PluginProbe
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF / 2.0.0
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF v2.0.0
2.0.7 2.0.6 2.0.5 trunk 1.3.7 1.4.0 1.4.1 1.4.2 1.4.6 1.5.0 1.5.3 1.5.6 1.5.8 1.6.5 1.6.6 1.6.9 1.7.0 1.7.4 1.8.1 1.8.2 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 All 26 releases
robin-image-optimizer / robin-image-optimizer.php
robin-image-optimizer.php
187 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Robin image optimizer
4 * Plugin URI: https://robinoptimizer.com
5 * Description: Optimize images without losing quality, speed up your website load, improve SEO and save money on server and CDN bandwidth.
6 * Author: Themeisle <contact@themeisle.com>
7 * Version: 2.0.0
8 * Text Domain: robin-image-optimizer
9 * Domain Path: /languages/
10 * Author URI: https://themeisle.com
11 * Framework Version: FACTORY_480_VERSION
12 * Requires at least: 5.6
13 * WordPress Available: yes
14 * Requires License: yes
15 * Requires PHP: 7.4
16 */
17
18 // Exit if accessed directly
19 if ( ! defined( 'ABSPATH' ) ) {
20 exit;
21 }
22
23 /**
24 * -----------------------------------------------------------------------------
25 * CHECK REQUIREMENTS
26 * Check compatibility with php and wp version of the user's site. As well as checking
27 * compatibility with other plugins.
28 * -----------------------------------------------------------------------------
29 */
30
31 require_once __DIR__ . '/libs/factory/core/includes/class-factory-requirements.php';
32
33 // @formatter:off
34 $plugin_info = [
35 'prefix' => 'wbcr_io_',
36 'plugin_name' => 'wbcr_image_optimizer',
37 'plugin_title' => 'Robin image optimizer',
38
39 // PLUGIN SUPPORT
40 'support_details' => [
41 'url' => 'https://robinoptimizer.com',
42 'pages_map' => [
43 'features' => 'premium-features', // {site}/premium-features
44 'pricing' => 'pricing', // {site}/prices
45 'support' => 'support', // {site}/support
46 'docs' => 'docs', // {site}/docs
47 ],
48 ],
49
50 // PLUGIN UPDATED SETTINGS
51 'has_updates' => false,
52 'updates_settings' => [
53 'repository' => 'wordpress',
54 'slug' => 'robin-image-optimizer',
55 'maybe_rollback' => true,
56 'rollback_settings' => [
57 'prev_stable_version' => '0.0.0',
58 ],
59 ],
60
61 // PLUGIN PREMIUM SETTINGS
62 'has_premium' => true,
63 'license_settings' => [
64 'provider' => 'freemius',
65 'slug' => 'robin-image-optimizer',
66 'plugin_id' => '3464',
67 'public_key' => 'pk_cafff5a51bd5fcf09c6bde806956d',
68 'price' => 39.99,
69 'has_updates' => false,
70 'updates_settings' => [
71 'maybe_rollback' => true,
72 'rollback_settings' => [
73 'prev_stable_version' => '0.0.0',
74 ],
75 ],
76 ],
77
78 // PLUGIN SUBSCRIBE FORM
79 'subscribe_widget' => true,
80 'subscribe_settings' => [ 'group_id' => '105407128' ],
81
82 // PLUGIN ADVERTS
83 'render_adverts' => true,
84 'adverts_settings' => [
85 'dashboard_widget' => true, // show dashboard widget (default: false)
86 'right_sidebar' => true, // show adverts sidebar (default: false)
87 'notice' => true, // show notice message (default: false)
88 ],
89
90 // FRAMEWORK MODULES
91 'load_factory_modules' => [
92 [ 'libs/factory/bootstrap', 'factory_bootstrap_482', 'admin' ],
93 [ 'libs/factory/forms', 'factory_forms_480', 'admin' ],
94 [ 'libs/factory/pages', 'factory_pages_480', 'admin' ],
95 [ 'libs/factory/templates', 'factory_templates_134', 'all' ],
96 [ 'libs/factory/logger', 'factory_logger_149', 'all' ],
97 [ 'libs/factory/freemius', 'factory_freemius_170', 'all' ],
98 [ 'libs/factory/adverts', 'factory_adverts_159', 'admin' ],
99 [ 'libs/factory/processing', 'factory_processing_113', 'all' ],
100 ],
101 ];
102
103 $wrio_compatibility = new Wbcr_Factory480_Requirements(
104 __FILE__,
105 array_merge(
106 $plugin_info,
107 [
108 'plugin_already_activate' => defined( 'WRIO_PLUGIN_ACTIVE' ),
109 'required_php_version' => '7.0',
110 'required_wp_version' => '4.8.0',
111 'required_clearfy_check_component' => false,
112 ]
113 )
114 );
115
116 /**
117 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
118 * and the user will throw a warning.
119 */
120 if ( ! $wrio_compatibility->check() ) {
121 return;
122 }
123
124 /**
125 * -----------------------------------------------------------------------------
126 * CONSTANTS
127 * Install frequently used constants and constants for debugging, which will be
128 * removed after compiling the plugin.
129 * -----------------------------------------------------------------------------
130 */
131
132 // This plugin is activated
133 /**
134 *
135 */
136 define( 'WRIO_PLUGIN_ACTIVE', true );
137
138 define( 'WIO_PLUGIN_ACTIVE', true );
139
140 // Plugin version
141 define( 'WRIO_PLUGIN_VERSION', $wrio_compatibility->get_plugin_version() );
142
143 // Директория плагина
144 define( 'WRIO_PLUGIN_DIR', __DIR__ );
145
146 // Относительный путь к плагину
147 define( 'WRIO_PLUGIN_BASE', plugin_basename( __FILE__ ) );
148
149 // Ссылка к директории плагина
150 define( 'WRIO_PLUGIN_URL', plugins_url( '', __FILE__ ) );
151
152 define( 'WRIO_PLUGIN_FILE', __FILE__ );
153 /**
154 * -----------------------------------------------------------------------------
155 * PLUGIN INIT
156 * -----------------------------------------------------------------------------
157 */
158
159 require_once WRIO_PLUGIN_DIR . '/libs/factory/core/boot.php';
160 require_once WRIO_PLUGIN_DIR . '/includes/class-rio-plugin.php';
161 try {
162
163 require_once WRIO_PLUGIN_DIR . '/vendor/autoload.php';
164 new WRIO_Plugin(
165 __FILE__,
166 array_merge(
167 $plugin_info,
168 [
169 'plugin_version' => WRIO_PLUGIN_VERSION,
170 'plugin_text_domain' => $wrio_compatibility->get_text_domain(),
171 ]
172 )
173 );
174 } catch ( Exception $e ) {
175 // Plugin wasn't initialized due to an error
176 define( 'WRIO_PLUGIN_THROW_ERROR', true );
177
178 $wrio_plugin_error_func = function () use ( $e ) {
179 $error = sprintf( 'The %s plugin has stopped. <b>Error:</b> %s Code: %s', 'Robin image optimizer', $e->getMessage(), $e->getCode() );
180 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
181 };
182
183 add_action( 'admin_notices', $wrio_plugin_error_func );
184 add_action( 'network_admin_notices', $wrio_plugin_error_func );
185 }
186 // @formatter:on
187