-
Notifications
You must be signed in to change notification settings - Fork 2
/
advanced-responsive-images.php
67 lines (55 loc) · 1.71 KB
/
advanced-responsive-images.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/*
Plugin Name: Advanced Responsive Images
Version: 4.2.0
Plugin URI: https://github.com/asadowski10/advanced-responsive-images
Description: WordPress plugin to implement custom HTML markup for responsive images
Author: Alexandre Sadowski
Author URI: https://www.alexandresadowski.com/
Domain Path: languages
Text Domain: advanced-responsive-images
----
Copyright 2017 Alexandre Sadowski ([email protected])
*/
// don't load directly
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
// Plugin constants
define( 'ARI_VERSION', '4.2.0' );
define( 'ARI_MIN_PHP_VERSION', '7.4' );
define( 'ARI_VIEWS_FOLDER_NAME', 'ari' );
if ( ! defined( 'ARI_JSON_DIR' ) ) {
define( 'ARI_JSON_DIR', get_template_directory() . '/assets/conf-img/' );
}
if ( ! defined( 'ARI_MODE' ) ) {
define( 'ARI_MODE', 'picture_lazyload' );
}
if ( ! defined( 'ARI_PIXEL' ) ) {
define( 'ARI_PIXEL', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' );
}
// Plugin URL and PATH
define( 'ARI_URL', plugin_dir_url( __FILE__ ) );
define( 'ARI_DIR', plugin_dir_path( __FILE__ ) );
// Check PHP min version
if ( version_compare( PHP_VERSION, ARI_MIN_PHP_VERSION, '<' ) ) {
require_once( ARI_DIR . 'compat.php' );
// possibly display a notice, trigger error
add_action( 'admin_init', array( 'ARI\Compatibility', 'admin_init' ) );
// stop execution of this file
return;
}
/**
* Autoload all the things \o/
*/
require_once ARI_DIR . 'autoload.php';
add_action( 'plugins_loaded', 'init_advanced_responsive_images_plugin' );
/**
* Init the plugin
*/
function init_advanced_responsive_images_plugin() {
require_once ARI_DIR . 'functions/utils.php';
// Client
\ARI\Main::get_instance();
\ARI\Image_Sizes::get_instance();
}