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