PluginProbe
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF / 1.3.7
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF v1.3.7
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
163 lines 5.4 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.3.7
8 * Text Domain: robin-image-optimizer
9 * Domain Path: /languages/
10 * Author URI: https://robin-image-optimizer.webcraftic.com
11 * Framework Version: FACTORY_412_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' => 'http://robin-image-optimizer.webcraftic.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 // SANDBOX
65 //'slug' => 'robin-image-optimizer',
66 //'plugin_id' => '3106',
67 //'public_key' => 'pk_f4e5e537d4a5cb45d516fb9bdceec',
68 'price' => 19,
69 'has_updates' => false,
70 'updates_settings' => array(
71 'maybe_rollback' => true,
72 'rollback_settings' => array(
73 'prev_stable_version' => '0.0.0'
74 )
75 )
76 ),
77
78 // FRAMEWORK MODULES
79 'load_factory_modules' => array(
80 array( 'libs/factory/bootstrap', 'factory_bootstrap_412', 'admin' ),
81 array( 'libs/factory/forms', 'factory_forms_412', 'admin' ),
82 array( 'libs/factory/pages', 'factory_pages_412', 'admin' ),
83 array( 'libs/factory/clearfy', 'factory_clearfy_208', 'all' ),
84 array( 'libs/factory/freemius', 'factory_freemius_101', 'all' )
85 )
86 );
87
88 $wrio_compatibility = new Wbcr_Factory412_Requirements( __FILE__, array_merge( $plugin_info, array(
89 'plugin_already_activate' => defined( 'WRIO_PLUGIN_ACTIVE' ),
90 'required_php_version' => '5.4',
91 'required_wp_version' => '4.2.0',
92 'required_clearfy_check_component' => false
93 ) ) );
94
95
96 /**
97 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
98 * and the user will throw a warning.
99 */
100 if ( ! $wrio_compatibility->check() ) {
101 return;
102 }
103
104 /**
105 * -----------------------------------------------------------------------------
106 * CONSTANTS
107 * Install frequently used constants and constants for debugging, which will be
108 * removed after compiling the plugin.
109 * -----------------------------------------------------------------------------
110 */
111
112 // This plugin is activated
113 /**
114 *
115 */
116 define( 'WRIO_PLUGIN_ACTIVE', true );
117
118 // todo: remove after few releases. For compatibility with Clearfy
119 define( 'WIO_PLUGIN_ACTIVE', true );
120
121 // Plugin version
122 define( 'WRIO_PLUGIN_VERSION', $wrio_compatibility->get_plugin_version() );
123
124 // Директория плагина
125 define( 'WRIO_PLUGIN_DIR', dirname( __FILE__ ) );
126
127 // Относительный путь к плагину
128 define( 'WRIO_PLUGIN_BASE', plugin_basename( __FILE__ ) );
129
130 // Ссылка к директории плагина
131 define( 'WRIO_PLUGIN_URL', plugins_url( null, __FILE__ ) );
132
133
134
135 /**
136 * -----------------------------------------------------------------------------
137 * PLUGIN INIT
138 * -----------------------------------------------------------------------------
139 */
140
141 require_once( WRIO_PLUGIN_DIR . '/libs/factory/core/boot.php' );
142 require_once( WRIO_PLUGIN_DIR . '/includes/class-rio-plugin.php' );
143
144 try {
145 new WRIO_Plugin( __FILE__, array_merge( $plugin_info, array(
146 'plugin_version' => WRIO_PLUGIN_VERSION,
147 'plugin_text_domain' => $wrio_compatibility->get_text_domain(),
148 ) ) );
149 } catch( Exception $e ) {
150 // Plugin wasn't initialized due to an error
151 define( 'WRIO_PLUGIN_THROW_ERROR', true );
152
153 $wrio_plugin_error_func = function () use ( $e ) {
154 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Robin image optimizer', $e->getMessage(), $e->getCode() );
155 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
156 };
157
158 add_action( 'admin_notices', $wrio_plugin_error_func );
159 add_action( 'network_admin_notices', $wrio_plugin_error_func );
160 }
161 // @formatter:on
162
163