| 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.6.5 |
| 8 |
* Text Domain: robin-image-optimizer |
| 9 |
* Domain Path: /languages/ |
| 10 |
* Author URI: https://cm-wp.com |
| 11 |
* Framework Version: FACTORY_469_VERSION |
| 12 |
* Requires at least: 4.8 |
| 13 |
* Requires PHP: 7.0 |
| 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', '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_470', 'admin'], |
| 91 |
['libs/factory/forms', 'factory_forms_466', 'admin'], |
| 92 |
['libs/factory/pages', 'factory_pages_467', 'admin'], |
| 93 |
['libs/factory/templates', 'factory_templates_118', 'all'], |
| 94 |
['libs/factory/logger', 'factory_logger_133', 'all'], |
| 95 |
['libs/factory/freemius', 'factory_freemius_157', 'all'], |
| 96 |
['libs/factory/adverts', 'factory_adverts_146', 'admin'], |
| 97 |
['libs/factory/feedback', 'factory_feedback_125', 'admin'], |
| 98 |
['libs/factory/processing', 'factory_processing_107', 'all'], |
| 99 |
], |
| 100 |
]; |
| 101 |
|
| 102 |
$wrio_compatibility = new Wbcr_Factory469_Requirements(__FILE__, array_merge($plugin_info, [ |
| 103 |
'plugin_already_activate' => defined('WRIO_PLUGIN_ACTIVE'), |
| 104 |
'required_php_version' => '7.0', |
| 105 |
'required_wp_version' => '4.8.0', |
| 106 |
'required_clearfy_check_component' => false, |
| 107 |
])); |
| 108 |
|
| 109 |
/** |
| 110 |
* If the plugin is compatible, then it will continue its work, otherwise it will be stopped, |
| 111 |
* and the user will throw a warning. |
| 112 |
*/ |
| 113 |
if( !$wrio_compatibility->check() ) { |
| 114 |
return; |
| 115 |
} |
| 116 |
|
| 117 |
/** |
| 118 |
* ----------------------------------------------------------------------------- |
| 119 |
* CONSTANTS |
| 120 |
* Install frequently used constants and constants for debugging, which will be |
| 121 |
* removed after compiling the plugin. |
| 122 |
* ----------------------------------------------------------------------------- |
| 123 |
*/ |
| 124 |
|
| 125 |
// This plugin is activated |
| 126 |
/** |
| 127 |
* |
| 128 |
*/ |
| 129 |
define('WRIO_PLUGIN_ACTIVE', true); |
| 130 |
|
| 131 |
// todo: remove after few releases. For compatibility with Clearfy |
| 132 |
define('WIO_PLUGIN_ACTIVE', true); |
| 133 |
|
| 134 |
// Plugin version |
| 135 |
define('WRIO_PLUGIN_VERSION', $wrio_compatibility->get_plugin_version()); |
| 136 |
|
| 137 |
// Директория плагина |
| 138 |
define('WRIO_PLUGIN_DIR', dirname(__FILE__)); |
| 139 |
|
| 140 |
// Относительный путь к плагину |
| 141 |
define('WRIO_PLUGIN_BASE', plugin_basename(__FILE__)); |
| 142 |
|
| 143 |
// Ссылка к директории плагина |
| 144 |
define('WRIO_PLUGIN_URL', plugins_url(null, __FILE__)); |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
/** |
| 149 |
* ----------------------------------------------------------------------------- |
| 150 |
* PLUGIN INIT |
| 151 |
* ----------------------------------------------------------------------------- |
| 152 |
*/ |
| 153 |
|
| 154 |
require_once WRIO_PLUGIN_DIR . '/libs/factory/core/boot.php'; |
| 155 |
require_once WRIO_PLUGIN_DIR . '/includes/class-rio-plugin.php'; |
| 156 |
|
| 157 |
try { |
| 158 |
new WRIO_Plugin(__FILE__, array_merge($plugin_info, [ |
| 159 |
'plugin_version' => WRIO_PLUGIN_VERSION, |
| 160 |
'plugin_text_domain' => $wrio_compatibility->get_text_domain(), |
| 161 |
])); |
| 162 |
} catch( Exception $e ) { |
| 163 |
// Plugin wasn't initialized due to an error |
| 164 |
define('WRIO_PLUGIN_THROW_ERROR', true); |
| 165 |
|
| 166 |
$wrio_plugin_error_func = function () use ($e) { |
| 167 |
$error = sprintf('The %s plugin has stopped. <b>Error:</b> %s Code: %s', 'Robin image optimizer', $e->getMessage(), $e->getCode()); |
| 168 |
echo '<div class="notice notice-error"><p>' . $error . '</p></div>'; |
| 169 |
}; |
| 170 |
|
| 171 |
add_action('admin_notices', $wrio_plugin_error_func); |
| 172 |
add_action('network_admin_notices', $wrio_plugin_error_func); |
| 173 |
} |
| 174 |
// @formatter:on |
| 175 |
|