PluginProbe
Image SEO – AI-Driven Image SEO Optimizer / 3.2.9
Image SEO – AI-Driven Image SEO Optimizer v3.2.9
3.2.16 3.2.15 3.2.13 3.2.14 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 3.2.6 trunk 2.0.9 3.0.0 3.0.1 3.0.2 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 All 71 releases
imageseo / imageseo.php

imageseo.php in Image SEO – AI-Driven Image SEO Optimizer 3.2.9, at imageseo.php

163 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Image SEO
5 * Plugin URI: https://imageseo.io
6 * Description: Optimize your images for search engines. Search engine optimization and web marketing strategy often neglect their images.
7 * Author: WPChill
8 * Version: 3.2.9
9 * Author URI: https://www.wpchill.com/
10 * License: GPLv3 or later
11 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12 * Requires PHP: 7.0
13 * Text Domain: imageseo
14 * Tested up to: 7.0
15 * Domain Path: /languages/
16 *
17 * Copyright 2019-2023 WPUmbrella aurelio@wp-umbrella.com
18 * Copyright 24.10.2023 WPChill heyyy@wpchill.com
19 *
20 *
21 * Original Plugin URI: https://imageseo.io
22 * Original Author URI: https://imageseo.io
23 * Original Author: https://profiles.wordpress.org/gmulti/
24 *
25 * NOTE:
26 *
27 * WP Umbrella has transferred ownership to WPChill on: 24th of October, 2023.
28 *
29 * This program is free software; you can redistribute it and/or modify
30 * it under the terms of the GNU General Public License, version 3, as
31 * published by the Free Software Foundation.
32 *
33 * This program is distributed in the hope that it will be useful,
34 * but WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 * GNU General Public License for more details.
37 *
38 * You should have received a copy of the GNU General Public License
39 * along with this program; if not, write to the Free software
40 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
41 */
42
43 if ( ! defined( 'ABSPATH' ) ) {
44 exit;
45 }
46
47 require_once __DIR__ . '/vendor/autoload.php';
48
49 use ImageSeoWP\Admin\SettingsPage;
50 use ImageSeoWP\Context;
51 use ImageSeoWP\Processes\OnUploadImage;
52 use ImageSeoWP\Services\BulkOptimizer;
53
54 define( 'IMAGESEO_NAME', 'ImageSEO' );
55 define( 'IMAGESEO_SLUG', 'imageseo' );
56 define( 'IMAGESEO_OPTION_GROUP', 'group-imageseo' );
57 define( 'IMAGESEO_VERSION', '3.2.9' );
58 define( 'IMAGESEO_PHP_MIN', '7.4' );
59 define( 'IMAGESEO_DEBUG', false );
60 define( 'IMAGESEO_DEBUG_ALT', false );
61 define( 'IMAGESEO_BNAME', plugin_basename( __FILE__ ) );
62 define( 'IMAGESEO_DIR', __DIR__ );
63 define( 'IMAGESEO_DIR_LANGUAGES', IMAGESEO_DIR . '/languages' );
64 define( 'IMAGESEO_DIR_DIST', IMAGESEO_DIR . '/dist' );
65 define( 'IMAGESEO_API_URL', 'https://api.imageseo.io' );
66 define( 'IMAGESEO_APP_URL', 'https://app.imageseo.io' );
67 define( 'IMAGESEO_SITE_URL', 'https://imageseo.io' );
68 define( 'IMAGESEO_LANGUAGES', IMAGESEO_DIR . '/languages/' );
69
70 define( 'IMAGESEO_DIRURL', plugin_dir_url( __FILE__ ) );
71 define( 'IMAGESEO_URL_DIST', IMAGESEO_DIRURL . 'dist' );
72
73 define( 'IMAGESEO_TEMPLATES', IMAGESEO_DIR . '/templates' );
74 define( 'IMAGESEO_TEMPLATES_ADMIN', IMAGESEO_TEMPLATES . '/admin' );
75 define( 'IMAGESEO_TEMPLATES_ADMIN_NOTICES', IMAGESEO_TEMPLATES_ADMIN . '/notices' );
76 define( 'IMAGESEO_TEMPLATES_ADMIN_PAGES', IMAGESEO_TEMPLATES_ADMIN . '/pages' );
77 define( 'IMAGESEO_TEMPLATES_ADMIN_METABOXES', IMAGESEO_TEMPLATES_ADMIN . '/metaboxes' );
78 define( 'IMAGESEO_LOCALE', get_locale() );
79 /**
80 * Check compatibility this ImageSeo with WordPress config.
81 */
82 function imageseo_is_compatible() {
83 // Check php version.
84 if ( version_compare( PHP_VERSION, IMAGESEO_PHP_MIN ) < 0 ) {
85 add_action( 'admin_notices', 'imageseo_php_min_compatibility' );
86
87 return false;
88 }
89
90 return true;
91 }
92
93 /**
94 * Admin notices if imageseo not compatible.
95 */
96 function imageseo_php_min_compatibility() {
97 if ( ! file_exists( IMAGESEO_TEMPLATES_ADMIN_NOTICES . '/php-min.php' ) ) {
98 return;
99 }
100
101 include_once IMAGESEO_TEMPLATES_ADMIN_NOTICES . '/php-min.php';
102 }
103
104 function imageseo_plugin_activate() {
105 if ( ! imageseo_is_compatible() ) {
106 return;
107 }
108
109 require_once __DIR__ . '/imageseo-functions.php';
110
111 Context::getContext()->activatePlugin();
112 }
113
114 function imageseo_plugin_deactivate() {
115 require_once __DIR__ . '/imageseo-functions.php';
116
117 Context::getContext()->deactivatePlugin();
118 }
119
120 function imageseo_plugin_uninstall() {
121 delete_option( IMAGESEO_SLUG );
122 delete_option( 'imageseo_version' );
123 }
124
125 if ( ! class_exists( 'ActionScheduler' ) ) {
126 require_once IMAGESEO_DIR . '/thirds/action-scheduler/action-scheduler.php';
127 }
128
129
130 /**
131 * Load ImageSEO.
132 */
133 function imageseo_plugin_loaded() {
134
135 if ( imageseo_is_compatible() ) {
136 require_once __DIR__ . '/imageseo-functions.php';
137 load_plugin_textdomain( 'imageseo', false, IMAGESEO_DIR_LANGUAGES );
138
139 Context::getContext()->initPlugin();
140
141 /**
142 * Async process for background upload process
143 */
144 OnUploadImage::getInstance();
145
146 /**
147 * Render the settings page
148 */
149 SettingsPage::get_instance();
150
151 /**
152 * We need this here so that the bulk optimizer is always available.
153 */
154 BulkOptimizer::getInstance();
155 }
156 }
157
158 register_activation_hook( __FILE__, 'imageseo_plugin_activate' );
159 register_deactivation_hook( __FILE__, 'imageseo_plugin_deactivate' );
160 register_uninstall_hook( __FILE__, 'imageseo_plugin_uninstall' );
161
162 add_action( 'plugins_loaded', 'imageseo_plugin_loaded' );
163