forked from wp-media/imagify-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimagify.php
110 lines (101 loc) · 4.83 KB
/
imagify.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Plugin Name: Imagify
* Plugin URI: https://wordpress.org/plugins/imagify/
* Description: Dramaticaly reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth using Imagify, the new most advanced image optimization tool.
* Version: 1.6.10
* Author: WP Media
* Author URI: https://wp-media.me/
* Licence: GPLv2
*
* Text Domain: imagify
* Domain Path: languages
*
* Copyright 2017 WP Media
*/
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
// Imagify defines.
define( 'IMAGIFY_VERSION' , '1.6.10' );
define( 'IMAGIFY_SLUG' , 'imagify' );
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
define( 'IMAGIFY_WEB_MAIN' , 'https://imagify.io' );
define( 'IMAGIFY_APP_MAIN' , 'https://app.imagify.io' );
define( 'IMAGIFY_PAYMENT_URL' , IMAGIFY_APP_MAIN . '/#/plugin/' );
define( 'IMAGIFY_FILE' , __FILE__ );
define( 'IMAGIFY_PATH' , realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
define( 'IMAGIFY_INC_PATH' , realpath( IMAGIFY_PATH . 'inc/' ) . '/' );
define( 'IMAGIFY_ADMIN_PATH' , realpath( IMAGIFY_INC_PATH . 'admin' ) . '/' );
define( 'IMAGIFY_ADMIN_UI_PATH' , realpath( IMAGIFY_ADMIN_PATH . 'ui' ) . '/' );
define( 'IMAGIFY_COMMON_PATH' , realpath( IMAGIFY_INC_PATH . 'common' ) . '/' );
define( 'IMAGIFY_FUNCTIONS_PATH' , realpath( IMAGIFY_INC_PATH . 'functions' ) . '/' );
define( 'IMAGIFY_CLASSES_PATH' , realpath( IMAGIFY_INC_PATH . 'classes' ) . '/' );
define( 'IMAGIFY_CLASSES_ABSTRACTS_PATH' , realpath( IMAGIFY_CLASSES_PATH . 'abstracts' ) . '/' );
define( 'IMAGIFY_3RD_PARTY_PATH' , realpath( IMAGIFY_INC_PATH . '3rd-party' ) . '/' );
define( 'IMAGIFY_URL' , plugin_dir_url( IMAGIFY_FILE ) );
define( 'IMAGIFY_INC_URL' , IMAGIFY_URL . 'inc/' );
define( 'IMAGIFY_ADMIN_URL' , IMAGIFY_INC_URL . 'admin/' );
define( 'IMAGIFY_ASSETS_URL' , IMAGIFY_URL . 'assets/' );
define( 'IMAGIFY_ASSETS_JS_URL' , IMAGIFY_ASSETS_URL . 'js/' );
define( 'IMAGIFY_ASSETS_CSS_URL' , IMAGIFY_ASSETS_URL . 'css/' );
define( 'IMAGIFY_ASSETS_IMG_URL' , IMAGIFY_ASSETS_URL . 'images/' );
define( 'IMAGIFY_MAX_BYTES' , 5242880 );
define( 'IMAGIFY_INT_MAX' , PHP_INT_MAX - 30 );
add_action( 'plugins_loaded', '_imagify_init' );
/**
* Tell WP what to do when plugin is loaded.
*
* @since 1.0
*/
function _imagify_init() {
// Load translations.
load_plugin_textdomain( 'imagify', false, dirname( plugin_basename( IMAGIFY_FILE ) ) . '/languages/' );
// Nothing to do if autosave.
if ( defined( 'DOING_AUTOSAVE' ) ) {
return;
}
require( IMAGIFY_FUNCTIONS_PATH . 'compat.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'deprecated.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'common.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'options.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'formatting.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'files.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'admin.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'api.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'attachments.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'process.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'admin-ui.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'admin-stats.php' );
require( IMAGIFY_FUNCTIONS_PATH . 'i18n.php' );
require( IMAGIFY_CLASSES_ABSTRACTS_PATH . 'class-imagify-abstract-db.php' );
require( IMAGIFY_CLASSES_ABSTRACTS_PATH . 'class-imagify-abstract-attachment.php' );
require( IMAGIFY_CLASSES_PATH . 'class-imagify.php' );
require( IMAGIFY_CLASSES_PATH . 'class-imagify-user.php' );
require( IMAGIFY_CLASSES_PATH . 'class-imagify-attachment.php' );
require( IMAGIFY_CLASSES_PATH . 'class-imagify-notices.php' );
require( IMAGIFY_CLASSES_PATH . 'class-imagify-assets.php' );
require( IMAGIFY_COMMON_PATH . 'attachments.php' );
require( IMAGIFY_COMMON_PATH . 'admin-bar.php' );
require( IMAGIFY_COMMON_PATH . 'cron.php' );
require( IMAGIFY_3RD_PARTY_PATH . '3rd-party.php' );
if ( is_admin() ) {
require( IMAGIFY_ADMIN_PATH . 'upgrader.php' );
require( IMAGIFY_ADMIN_PATH . 'heartbeat.php' );
require( IMAGIFY_ADMIN_PATH . 'ajax.php' );
require( IMAGIFY_ADMIN_PATH . 'options.php' );
require( IMAGIFY_ADMIN_PATH . 'menu.php' );
require( IMAGIFY_ADMIN_PATH . 'plugins.php' );
require( IMAGIFY_ADMIN_PATH . 'upload.php' );
require( IMAGIFY_ADMIN_PATH . 'media.php' );
require( IMAGIFY_ADMIN_PATH . 'meta-boxes.php' );
require( IMAGIFY_ADMIN_UI_PATH . 'options.php' );
require( IMAGIFY_ADMIN_UI_PATH . 'bulk.php' );
Imagify_Notices::get_instance()->init();
}
Imagify_Assets::get_instance()->init();
/**
* Fires when Imagify is correctly loaded.
*
* @since 1.0
*/
do_action( 'imagify_loaded' );
}