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