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