PluginProbe
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF / 1.4.6
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF v1.4.6
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 in Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF 1.4.6, at robin-image-optimizer.php

162 lines 5.3 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: Creative Motion
7 * Version: 1.4.6
8 * Text Domain: robin-image-optimizer
9 * Domain Path: /languages/
10 * Author URI: https://robinoptimizer.com
11 * Framework Version: FACTORY_436_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 // FRAMEWORK MODULES
75 'load_factory_modules' => array(
76 array( 'libs/factory/bootstrap', 'factory_bootstrap_436', 'admin' ),
77 array( 'libs/factory/forms', 'factory_forms_433', 'admin' ),
78 array( 'libs/factory/pages', 'factory_pages_435', 'admin' ),
79 array( 'libs/factory/clearfy', 'factory_clearfy_227', 'all' ),
80 array( 'libs/factory/freemius', 'factory_freemius_123', 'all' ),
81 array( 'libs/factory/adverts', 'factory_adverts_114', 'admin' ),
82 array( 'libs/factory/feedback', 'factory_feedback_107', 'admin' )
83 )
84 );
85
86
87
88 $wrio_compatibility = new Wbcr_Factory436_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 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
97 * and the user will throw a warning.
98 */
99 if ( ! $wrio_compatibility->check() ) {
100 return;
101 }
102
103 /**
104 * -----------------------------------------------------------------------------
105 * CONSTANTS
106 * Install frequently used constants and constants for debugging, which will be
107 * removed after compiling the plugin.
108 * -----------------------------------------------------------------------------
109 */
110
111 // This plugin is activated
112 /**
113 *
114 */
115 define( 'WRIO_PLUGIN_ACTIVE', true );
116
117 // todo: remove after few releases. For compatibility with Clearfy
118 define( 'WIO_PLUGIN_ACTIVE', true );
119
120 // Plugin version
121 define( 'WRIO_PLUGIN_VERSION', $wrio_compatibility->get_plugin_version() );
122
123 // Директория плагина
124 define( 'WRIO_PLUGIN_DIR', dirname( __FILE__ ) );
125
126 // Относительный путь к плагину
127 define( 'WRIO_PLUGIN_BASE', plugin_basename( __FILE__ ) );
128
129 // Ссылка к директории плагина
130 define( 'WRIO_PLUGIN_URL', plugins_url( null, __FILE__ ) );
131
132
133
134 /**
135 * -----------------------------------------------------------------------------
136 * PLUGIN INIT
137 * -----------------------------------------------------------------------------
138 */
139
140 require_once( WRIO_PLUGIN_DIR . '/libs/factory/core/boot.php' );
141 require_once( WRIO_PLUGIN_DIR . '/includes/class-rio-plugin.php' );
142
143 try {
144 new WRIO_Plugin( __FILE__, array_merge( $plugin_info, array(
145 'plugin_version' => WRIO_PLUGIN_VERSION,
146 'plugin_text_domain' => $wrio_compatibility->get_text_domain(),
147 ) ) );
148 } catch ( Exception $e ) {
149 // Plugin wasn't initialized due to an error
150 define( 'WRIO_PLUGIN_THROW_ERROR', true );
151
152 $wrio_plugin_error_func = function () use ( $e ) {
153 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Robin image optimizer', $e->getMessage(), $e->getCode() );
154 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
155 };
156
157 add_action( 'admin_notices', $wrio_plugin_error_func );
158 add_action( 'network_admin_notices', $wrio_plugin_error_func );
159 }
160 // @formatter:on
161
162