Version Description
(21.01.2020) = * Fixed: ompatible with Clearfy 1.6.3. * Fixed: PHP error "Class 'Wbcr_FactoryClearfy_Compatibility' not found". * Fixed: Minor bugs. * Removed: Server 4 beta. * Added: Premium server.
Download this release
Release Info
Developer | webtemyk |
Plugin | Robin image optimizer — save money on image compression |
Version | 1.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.2
- admin/activation.php +3 -3
- admin/ajax/bulk-optimization.php +132 -60
- admin/assets/css/base-statistic.css +23 -4
- admin/assets/css/base-statistic.css.map +1 -1
- admin/assets/css/base-statistic.less +24 -1
- admin/assets/css/sweetalert-custom.css.map +1 -1
- admin/assets/js/bulk-optimization.js +70 -6
- admin/boot.php +336 -273
- admin/includes/classes/class-rio-optimize-template.php +2 -2
- admin/pages/class-rio-license.php +43 -8
- admin/pages/class-rio-log.php +2 -2
- admin/pages/class-rio-page.php +4 -6
- admin/pages/class-rio-settings.php +56 -56
- admin/pages/class-rio-statistic.php +243 -243
- includes/class-rio-plugin.php +171 -145
- includes/classes/class-rio-attachment.php +1 -1
- includes/classes/class-rio-optimization-tools.php +5 -1
- includes/classes/class-rio-views.php +4 -4
- includes/classes/index.php +1 -0
- includes/classes/logger/class-rio-logger.php +6 -6
- includes/classes/processors/class-rio-server-premium.php +179 -0
- includes/functions.php +97 -46
- libs/addons/admin/assets/js/custom-folders.js +4 -4
- libs/addons/admin/boot.php +1 -1
- libs/addons/includes/classes/webp/class-webp-api.php +308 -306
- libs/addons/includes/classes/webp/class-webp-delivery.php +82 -18
- libs/addons/includes/classes/webp/class-webp-listener.php +7 -5
- libs/addons/includes/classes/webp/composer.lock +5 -5
- libs/addons/includes/classes/webp/vendor/autoload.php +1 -1
- libs/addons/includes/classes/webp/vendor/composer/ClassLoader.php +1 -1
- libs/addons/includes/classes/webp/vendor/composer/autoload_real.php +4 -4
- libs/addons/includes/classes/webp/vendor/composer/autoload_static.php +3 -3
- libs/addons/includes/classes/webp/vendor/composer/installed.json +6 -6
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/README.md +6 -1
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/composer.json +6 -4
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/phpstan.neon +3 -0
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/phpunit.xml.dist +9 -1
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/{src → src-vendor}/simple_html_dom/simple_html_dom.inc +0 -0
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php +23 -5
- libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/src/PictureTags.php +6 -6
- libs/addons/views/modal-select-custom-folders.php +1 -1
- libs/addons/views/part-bulk-optimization-table-folders.php +1 -1
- libs/class-rio-relative-to-abs-uri.php +183 -0
- libs/factory/adverts/boot.php +50 -0
- libs/factory/adverts/includes/class-base.php +319 -0
- libs/factory/adverts/includes/class-dashboard-widget.php +125 -0
- libs/factory/adverts/includes/class-rest-request.php +197 -0
- libs/factory/adverts/includes/index.php +2 -0
- libs/factory/adverts/index.php +2 -0
- libs/factory/{core/langs/wbcr_factory_414-ru_RU.mo → adverts/langs/wbcr_factory_adverts_106-ru_RU.mo} +0 -0
- libs/factory/adverts/langs/wbcr_factory_adverts_106-ru_RU.po +83 -0
- libs/factory/bootstrap/assets/css-min/bootstrap.accordion.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.blue.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.coffee.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.core.min.css +2 -2
- libs/factory/bootstrap/assets/css-min/bootstrap.ectoplasm.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.form-group.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.light.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.midnight.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.ocean.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.separator.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/bootstrap.sunrise.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/control.checkbox.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/control.dropdown.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/control.multiple-textbox.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/holder.more-link.min.css +1 -1
- libs/factory/bootstrap/assets/css-min/index.php +0 -0
- libs/factory/bootstrap/assets/images/index.php +0 -0
- libs/factory/bootstrap/assets/index.php +0 -0
- libs/factory/bootstrap/assets/js-min/bootstrap.dropdown.min.js +1 -1
- libs/factory/bootstrap/assets/js-min/control.checkbox.min.js +1 -1
- libs/factory/bootstrap/assets/js-min/control.dropdown.min.js +1 -1
- libs/factory/bootstrap/assets/js-min/control.list.min.js +1 -1
- libs/factory/bootstrap/assets/js-min/control.multiple-textbox.min.js +1 -1
- libs/factory/bootstrap/assets/js-min/index.php +0 -0
- libs/factory/bootstrap/boot.php +45 -36
- libs/factory/bootstrap/includes/functions.php +172 -230
- libs/factory/bootstrap/includes/index.php +2 -0
- libs/factory/bootstrap/index.php +2 -0
- libs/factory/clearfy/assets/css/clearfy-base.css +24 -24
- libs/factory/clearfy/assets/css/clearfy-base.css.map +1 -0
- libs/factory/clearfy/assets/css/index.php +0 -0
- libs/factory/clearfy/assets/index.php +0 -0
- libs/factory/clearfy/assets/js/globals.js +15 -15
- libs/factory/clearfy/assets/js/index.php +0 -0
- libs/factory/clearfy/assets/js/license-manager.js +14 -18
- libs/factory/clearfy/boot.php +19 -18
- libs/factory/clearfy/includes/ajax-handlers.php +44 -32
- libs/factory/clearfy/includes/check-clearfy-compatibility.php +0 -306
- libs/factory/clearfy/includes/class-clearfy-configurate.php +0 -120
- libs/factory/clearfy/includes/class-clearfy-helpers.php +0 -370
- libs/factory/clearfy/includes/class-configurate.php +116 -0
- libs/factory/clearfy/includes/class-helpers.php +266 -0
- libs/factory/clearfy/langs/index.php +0 -0
- libs/factory/clearfy/langs/{wbcr_factory_clearfy_209-ru_RU.mo → wbcr_factory_clearfy_217-ru_RU.mo} +0 -0
- libs/factory/clearfy/langs/{wbcr_factory_clearfy_209-ru_RU.po → wbcr_factory_clearfy_217-ru_RU.po} +0 -0
- libs/factory/clearfy/pages/class-clearfy-license.php +0 -363
- libs/factory/clearfy/pages/class-clearfy-more-features.php +0 -148
- libs/factory/clearfy/pages/class-clearfy-pages.php +0 -385
- libs/factory/clearfy/pages/class-page-license.php +401 -0
- libs/factory/clearfy/pages/class-page-more-features.php +170 -0
- libs/factory/clearfy/pages/class-pages.php +418 -0
- libs/factory/core/README.md +3 -0
- libs/factory/core/boot.php +30 -30
- libs/factory/core/includes/activation/class-factory-activator.php +13 -12
- libs/factory/core/includes/activation/class-factory-update.php +12 -11
- libs/factory/core/includes/activation/index.php +2 -0
- libs/factory/core/includes/assets-managment/class-factory-assets-list.php +32 -31
- libs/factory/core/includes/assets-managment/class-factory-script-list.php +43 -43
- libs/factory/core/includes/assets-managment/class-factory-style-list.php +22 -22
- libs/factory/core/includes/assets-managment/index.php +2 -0
- libs/factory/core/includes/class-check-compatibility.php +95 -101
- libs/factory/core/includes/class-factory-migrations.php +31 -22
- libs/factory/core/includes/class-factory-notices.php +115 -112
- libs/factory/core/includes/class-factory-options.php +207 -135
- libs/factory/core/includes/class-factory-plugin-abstract.php +260 -155
- libs/factory/core/includes/class-factory-plugin-base.php +297 -137
- libs/factory/core/includes/class-factory-requests.php +34 -27
- libs/factory/core/includes/class-factory-requirements.php +65 -61
- libs/factory/core/includes/entities/class-factory-paths.php +7 -8
- libs/factory/core/includes/entities/class-factory-support.php +31 -32
- libs/factory/core/includes/functions.php +52 -52
- libs/factory/core/includes/index.php +2 -0
- libs/factory/core/includes/premium/class-factory-license-interface.php +12 -12
- libs/factory/core/includes/premium/class-factory-manager.php +39 -37
- libs/factory/core/includes/premium/class-factory-provider-abstract.php +84 -85
- libs/factory/core/includes/premium/index.php +2 -0
- libs/factory/core/includes/updates/class-factory-premium-upgrader.php +263 -235
- libs/factory/core/includes/updates/class-factory-upgrader.php +29 -60
- libs/factory/core/includes/updates/index.php +2 -0
- libs/factory/core/includes/updates/repositories/class-factory-repository-abstract.php +17 -17
- libs/factory/core/includes/updates/repositories/class-factory-wordpress.php +17 -17
- libs/factory/core/index.php +2 -0
- libs/factory/core/langs/index.php +2 -0
- libs/factory/core/langs/wbcr_factory_425-ru_RU.mo +0 -0
- libs/factory/core/langs/{wbcr_factory_414-ru_RU.po → wbcr_factory_425-ru_RU.po} +0 -0
- libs/factory/forms/assets/css/index.php +0 -0
- libs/factory/forms/assets/index.php +0 -0
- libs/factory/forms/boot.php +257 -257
- libs/factory/forms/controls/checkbox.php +4 -4
- libs/factory/forms/controls/color-and-opacity.php +4 -4
- libs/factory/forms/controls/color.php +2 -2
- libs/factory/forms/controls/customs/html.php +2 -2
- libs/factory/forms/controls/customs/index.php +2 -0
- libs/factory/forms/controls/customs/separator.php +2 -2
- libs/factory/forms/controls/datepicker-range.php +4 -4
- libs/factory/forms/controls/dropdown-and-colors.php +6 -6
- libs/factory/forms/controls/dropdown.php +5 -5
- libs/factory/forms/controls/font.php +11 -11
- libs/factory/forms/controls/google-font.php +8 -8
- libs/factory/forms/controls/gradient.php +4 -4
- libs/factory/forms/controls/hidden.php +2 -2
- libs/factory/forms/controls/holders/accordion-item.php +2 -2
- libs/factory/forms/controls/holders/accordion.php +2 -2
- libs/factory/forms/controls/holders/columns.php +2 -2
- libs/factory/forms/controls/holders/control-group-item.php +2 -2
- libs/factory/forms/controls/holders/control-group.php +3 -3
- libs/factory/forms/controls/holders/div.php +2 -2
- libs/factory/forms/controls/holders/form-group.php +2 -2
- libs/factory/forms/controls/holders/index.php +2 -0
- libs/factory/forms/controls/holders/more-link.php +2 -2
- libs/factory/forms/controls/holders/tab-item.php +2 -2
- libs/factory/forms/controls/holders/tab.php +4 -4
- libs/factory/forms/controls/index.php +2 -0
- libs/factory/forms/controls/integer.php +2 -2
- libs/factory/forms/controls/list.php +4 -4
- libs/factory/forms/controls/multiple-textbox.php +3 -3
- libs/factory/forms/controls/paddings-editor.php +3 -3
- libs/factory/forms/controls/pattern.php +9 -9
- libs/factory/forms/controls/radio-colors.php +2 -2
- libs/factory/forms/controls/radio.php +2 -2
- libs/factory/forms/controls/textarea.php +2 -2
- libs/factory/forms/controls/textbox.php +2 -2
- libs/factory/forms/controls/url.php +3 -3
- libs/factory/forms/controls/wp-editor.php +3 -3
- libs/factory/forms/includes/complex-control.class.php +4 -4
- libs/factory/forms/includes/control-holder.class.php +5 -5
- libs/factory/forms/includes/control.class.php +5 -5
- libs/factory/forms/includes/custom-element.class.php +2 -2
- libs/factory/forms/includes/form-element.class.php +7 -7
- libs/factory/forms/includes/form-layout.class.php +5 -5
- libs/factory/forms/includes/form.class.php +39 -39
- libs/factory/forms/includes/holder.class.php +6 -6
- libs/factory/forms/includes/html-builder.class.php +2 -2
- libs/factory/forms/includes/index.php +2 -0
- libs/factory/forms/includes/providers/index.php +2 -0
- libs/factory/forms/includes/providers/meta-value-provider.class.php +2 -2
- libs/factory/forms/includes/providers/options-value-provider.class.php +3 -3
- libs/factory/forms/includes/providers/value-provider.interface.php +2 -2
- libs/factory/forms/index.php +2 -0
- libs/factory/forms/langs/index.php +0 -0
- libs/factory/forms/langs/{wbcr_factory_forms_414-ru_RU.mo → wbcr_factory_forms_423-ru_RU.mo} +0 -0
- libs/factory/forms/langs/{wbcr_factory_forms_414-ru_RU.po → wbcr_factory_forms_423-ru_RU.po} +0 -0
- libs/factory/forms/layouts/bootstrap-3/bootstrap-3.php +7 -7
- libs/factory/forms/layouts/bootstrap-3/index.php +2 -0
- libs/factory/forms/layouts/index.php +2 -0
- libs/factory/freemius/boot.php +28 -18
- libs/factory/freemius/includes/class-freemius-api.php +7 -7
- libs/factory/freemius/includes/entities/class-freemius-entity.php +1 -1
- libs/factory/freemius/includes/entities/class-freemius-license.php +0 -80
admin/activation.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @author Webcraftic <wordpress.webraftic@gmail.com>
|
7 |
* @copyright (c) 09.09.2017, Webcraftic
|
8 |
-
* @see
|
9 |
* @version 1.0
|
10 |
*/
|
11 |
|
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
class WIO_Activation extends
|
18 |
|
19 |
/**
|
20 |
* Runs activation actions.
|
@@ -49,7 +49,7 @@ class WIO_Activation extends Wbcr_Factory414_Activator {
|
|
49 |
|
50 |
RIO_Process_Queue::try_create_plugin_tables();
|
51 |
|
52 |
-
|
53 |
|
54 |
WRIO_Logger::info( 'Parent plugin installation complete!' );
|
55 |
}
|
5 |
*
|
6 |
* @author Webcraftic <wordpress.webraftic@gmail.com>
|
7 |
* @copyright (c) 09.09.2017, Webcraftic
|
8 |
+
* @see Factory425_Activator
|
9 |
* @version 1.0
|
10 |
*/
|
11 |
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
class WIO_Activation extends Wbcr_Factory425_Activator {
|
18 |
|
19 |
/**
|
20 |
* Runs activation actions.
|
49 |
|
50 |
RIO_Process_Queue::try_create_plugin_tables();
|
51 |
|
52 |
+
WbcrFactoryClearfy217_Helpers::flushPageCache();
|
53 |
|
54 |
WRIO_Logger::info( 'Parent plugin installation complete!' );
|
55 |
}
|
admin/ajax/bulk-optimization.php
CHANGED
@@ -19,23 +19,23 @@ add_action( 'wp_ajax_wrio-cron-start', function () {
|
|
19 |
if ( ! current_user_can( 'manage_options' ) ) {
|
20 |
wp_die( - 1 );
|
21 |
}
|
22 |
-
|
23 |
$scope = WRIO_Plugin::app()->request->request( 'scope', null, true );
|
24 |
-
|
25 |
if ( empty( $scope ) ) {
|
26 |
wp_die( - 1 );
|
27 |
}
|
28 |
-
|
29 |
// where was runned cron
|
30 |
$cron_running_place = WRIO_Plugin::app()->getPopulateOption( 'cron_running', false );
|
31 |
-
|
32 |
if ( $scope == $cron_running_place ) {
|
33 |
wp_send_json_success();
|
34 |
}
|
35 |
-
|
36 |
WRIO_Plugin::app()->updatePopulateOption( 'cron_running', $scope );
|
37 |
WRIO_Cron::start();
|
38 |
-
|
39 |
wp_send_json_success();
|
40 |
} );
|
41 |
|
@@ -44,14 +44,14 @@ add_action( 'wp_ajax_wrio-cron-start', function () {
|
|
44 |
*/
|
45 |
add_action( 'wp_ajax_wrio-cron-stop', function () {
|
46 |
check_ajax_referer( 'bulk_optimization' );
|
47 |
-
|
48 |
if ( ! current_user_can( 'manage_options' ) ) {
|
49 |
wp_die( - 1 );
|
50 |
}
|
51 |
-
|
52 |
WRIO_Plugin::app()->updatePopulateOption( 'cron_running', false );
|
53 |
WRIO_Cron::stop();
|
54 |
-
|
55 |
wp_send_json_success();
|
56 |
} );
|
57 |
|
@@ -60,26 +60,26 @@ add_action( 'wp_ajax_wrio-cron-stop', function () {
|
|
60 |
*/
|
61 |
add_action( 'wp_ajax_wrio-bulk-optimization-process', function () {
|
62 |
check_admin_referer( 'bulk_optimization' );
|
63 |
-
|
64 |
if ( ! current_user_can( 'manage_options' ) ) {
|
65 |
wp_die( - 1 );
|
66 |
}
|
67 |
-
|
68 |
$reset_current_error = (bool) WRIO_Plugin::app()->request->request( 'reset_current_errors' );
|
69 |
$scope = WRIO_Plugin::app()->request->request( 'scope', null, true );
|
70 |
-
|
71 |
WRIO_Logger::info( sprintf( 'Start bulk optimization process! Scope: %s', $scope ) );
|
72 |
-
|
73 |
if ( empty( $scope ) ) {
|
74 |
wp_die( - 1 );
|
75 |
}
|
76 |
-
|
77 |
// Context class name. If plugin expands with add-ons
|
78 |
$class_name = 'WRIO_' . wrio_dashes_to_camel_case( $scope, true );
|
79 |
-
|
80 |
if ( ! class_exists( $class_name ) ) {
|
81 |
WRIO_Logger::error( sprintf( 'Bulk optimization error: Context class (%s) not found.', $class_name ) );
|
82 |
-
|
83 |
//todo: Temporary bug fix.
|
84 |
if ( 'media-library' === $scope ) {
|
85 |
$class_name = 'WRIO_Media_Library';
|
@@ -88,12 +88,12 @@ add_action( 'wp_ajax_wrio-bulk-optimization-process', function () {
|
|
88 |
} else if ( 'nextgen-gallery' == $scope ) {
|
89 |
$class_name = 'WRIO_Nextgen_Gallery';
|
90 |
}
|
91 |
-
|
92 |
if ( ! class_exists( $class_name ) ) {
|
93 |
wp_send_json_error( [ 'error_message' => 'Context class not found.' ] );
|
94 |
}
|
95 |
}
|
96 |
-
|
97 |
/**
|
98 |
* Create an instance of the class depending on the context in which scope user
|
99 |
* has runned optimization.
|
@@ -103,38 +103,38 @@ add_action( 'wp_ajax_wrio-bulk-optimization-process', function () {
|
|
103 |
* @see WRIO_Nextgen_Gallery
|
104 |
*/
|
105 |
$optimizer = new $class_name();
|
106 |
-
|
107 |
// в ajax запросе мы не знаем, получен ли он из мультиадминки или из обычной. Поэтому проверяем параметр, полученный из frontend
|
108 |
/*if ( isset( $_POST['multisite'] ) && (bool) $_POST['multisite'] ) {
|
109 |
$multisite = new WIO_Multisite;
|
110 |
$multisite->initHooks();
|
111 |
}*/
|
112 |
-
|
113 |
if ( $reset_current_error ) {
|
114 |
$optimizer->resetCurrentErrors(); // сбрасываем текущие ошибки оптимизации
|
115 |
}
|
116 |
-
|
117 |
$result = $optimizer->processUnoptimizedImages( 1 );
|
118 |
-
|
119 |
if ( is_wp_error( $result ) ) {
|
120 |
$error_massage = $result->get_error_message();
|
121 |
-
|
122 |
if ( empty( $error ) ) {
|
123 |
$error_massage = __( "Unknown error. Enable error log on the plugin's settings page, then check the error report on the Error Log page. You can export the error report and send it to the support service of the plugin.", "robin-image-optimizer" );
|
124 |
}
|
125 |
-
|
126 |
WRIO_Logger::error( sprintf( 'Bulk optimization error: %s.', $result->get_error_message() ) );
|
127 |
-
|
128 |
wp_send_json_error( [ 'error_message' => $error_massage ] );
|
129 |
}
|
130 |
-
|
131 |
// если изображения закончились - посылаем команду завершения
|
132 |
if ( $result['remain'] <= 0 ) {
|
133 |
$result['end'] = true;
|
134 |
}
|
135 |
-
|
136 |
WRIO_Logger::info( sprintf( 'End bulk optimization process! Scope: %s. Remain: %d', $scope, $result['remain'] ) );
|
137 |
-
|
138 |
wp_send_json_success( $result );
|
139 |
} );
|
140 |
|
@@ -142,32 +142,32 @@ add_action( 'wp_ajax_wrio-bulk-optimization-process', function () {
|
|
142 |
* Переоптимизация аттачмента
|
143 |
*/
|
144 |
add_action( 'wp_ajax_wio_reoptimize_image', function () {
|
145 |
-
|
146 |
if ( ! current_user_can( 'manage_options' ) ) {
|
147 |
wp_die( - 1 );
|
148 |
}
|
149 |
-
|
150 |
$default_level = WRIO_Plugin::app()->getPopulateOption( 'image_optimization_level', 'normal' );
|
151 |
-
|
152 |
$attachment_id = (int) WRIO_Plugin::app()->request->post( 'id' );
|
153 |
$level = WRIO_Plugin::app()->request->post( 'level', $default_level, true );
|
154 |
-
|
155 |
$backup = WIO_Backup::get_instance();
|
156 |
$media_library = WRIO_Media_Library::get_instance();
|
157 |
$backup_origin_images = WRIO_Plugin::app()->getPopulateOption( 'backup_origin_images', false );
|
158 |
-
|
159 |
if ( $backup_origin_images && ! $backup->isBackupWritable() ) {
|
160 |
echo $media_library->getMediaColumnContent( $attachment_id );
|
161 |
die();
|
162 |
}
|
163 |
-
|
164 |
$optimized_data = $media_library->optimizeAttachment( $attachment_id, $level );
|
165 |
-
|
166 |
if ( $optimized_data && isset( $optimized_data['processing'] ) ) {
|
167 |
echo 'processing';
|
168 |
die();
|
169 |
}
|
170 |
-
|
171 |
echo $media_library->getMediaColumnContent( $attachment_id );
|
172 |
die();
|
173 |
} );
|
@@ -176,20 +176,20 @@ add_action( 'wp_ajax_wio_reoptimize_image', function () {
|
|
176 |
* Восстановление аттачмента из резервной копии
|
177 |
*/
|
178 |
add_action( 'wp_ajax_wio_restore_image', function () {
|
179 |
-
|
180 |
if ( ! current_user_can( 'manage_options' ) ) {
|
181 |
wp_die( - 1 );
|
182 |
}
|
183 |
-
|
184 |
$attachment_id = (int) WRIO_Plugin::app()->request->post( 'id' );
|
185 |
-
|
186 |
$media_library = WRIO_Media_Library::get_instance();
|
187 |
$wio_attachment = $media_library->getAttachment( $attachment_id );
|
188 |
-
|
189 |
if ( $wio_attachment->isOptimized() ) {
|
190 |
$media_library->restoreAttachment( $attachment_id );
|
191 |
}
|
192 |
-
|
193 |
echo $media_library->getMediaColumnContent( $attachment_id );
|
194 |
die();
|
195 |
} );
|
@@ -201,50 +201,60 @@ add_action( 'wp_ajax_wio_restore_image', function () {
|
|
201 |
* статус выбранный).
|
202 |
*/
|
203 |
add_action( 'wp_ajax_wbcr-rio-check-servers-status', function () {
|
204 |
-
|
205 |
check_ajax_referer( 'bulk_optimization' );
|
206 |
-
|
207 |
if ( ! current_user_can( 'manage_options' ) ) {
|
208 |
wp_die( - 1 );
|
209 |
}
|
210 |
-
|
211 |
$server_name = WRIO_Plugin::app()->request->post( 'server_name' );
|
212 |
-
|
213 |
if ( empty( $server_name ) || ! in_array( $server_name, [
|
214 |
'server_1',
|
215 |
'server_2',
|
216 |
'server_3',
|
217 |
-
'server_4'
|
|
|
218 |
] ) ) {
|
219 |
wp_send_json_error( [ 'error' => __( 'Server name is empty!', 'robin-image-optimizer' ) ] );
|
220 |
}
|
221 |
-
|
222 |
// Позволяем выбрать сервер, даже если он недоступен.
|
223 |
WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_server', $server_name );
|
224 |
-
|
225 |
// Проверяем доступность сервер
|
226 |
// --------------------------------------------------------------------
|
227 |
$return_data = [ 'server_name' => $server_name ];
|
228 |
-
|
229 |
$server_url = wrio_get_server_url( $server_name );
|
230 |
-
|
|
|
231 |
$method = 'POST';
|
232 |
-
if ( $server_name == 'server_4' ) {
|
233 |
$api_url = $server_url . '/upload/' . wrio_generate_random_string( 16 ) . '/';
|
234 |
-
}
|
|
|
|
|
235 |
$api_url = $server_url . '/s.w.org/images/home/screen-themes.png';
|
236 |
$method = 'GET';
|
|
|
|
|
|
|
|
|
|
|
237 |
} else {
|
238 |
$api_url = $server_url;
|
239 |
}
|
240 |
-
|
241 |
$request = wp_remote_request( $api_url, [
|
242 |
-
'method'
|
|
|
243 |
] );
|
244 |
-
|
245 |
if ( is_wp_error( $request ) ) {
|
246 |
$er_msg = $request->get_error_message();
|
247 |
-
|
248 |
if ( "server_2" == $server_name ) {
|
249 |
// Hostgator Issue.
|
250 |
if ( ! empty( $er_msg ) && strpos( $er_msg, 'SSL CA cert' ) !== false ) {
|
@@ -252,17 +262,79 @@ add_action( 'wp_ajax_wbcr-rio-check-servers-status', function () {
|
|
252 |
WRIO_Plugin::app()->updatePopulateOption( 'use_http', 1 );
|
253 |
}
|
254 |
}
|
255 |
-
|
256 |
$return_data['error'] = $er_msg;
|
257 |
wp_send_json_error( $return_data );
|
258 |
}
|
259 |
-
|
260 |
$response_code = wp_remote_retrieve_response_code( $request );
|
261 |
-
|
262 |
if ( $response_code != 200 ) {
|
263 |
$return_data['error'] = 'Server response ' . $response_code;
|
264 |
wp_send_json_error( $return_data );
|
265 |
}
|
266 |
-
|
267 |
wp_send_json_success( $return_data );
|
268 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
if ( ! current_user_can( 'manage_options' ) ) {
|
20 |
wp_die( - 1 );
|
21 |
}
|
22 |
+
|
23 |
$scope = WRIO_Plugin::app()->request->request( 'scope', null, true );
|
24 |
+
|
25 |
if ( empty( $scope ) ) {
|
26 |
wp_die( - 1 );
|
27 |
}
|
28 |
+
|
29 |
// where was runned cron
|
30 |
$cron_running_place = WRIO_Plugin::app()->getPopulateOption( 'cron_running', false );
|
31 |
+
|
32 |
if ( $scope == $cron_running_place ) {
|
33 |
wp_send_json_success();
|
34 |
}
|
35 |
+
|
36 |
WRIO_Plugin::app()->updatePopulateOption( 'cron_running', $scope );
|
37 |
WRIO_Cron::start();
|
38 |
+
|
39 |
wp_send_json_success();
|
40 |
} );
|
41 |
|
44 |
*/
|
45 |
add_action( 'wp_ajax_wrio-cron-stop', function () {
|
46 |
check_ajax_referer( 'bulk_optimization' );
|
47 |
+
|
48 |
if ( ! current_user_can( 'manage_options' ) ) {
|
49 |
wp_die( - 1 );
|
50 |
}
|
51 |
+
|
52 |
WRIO_Plugin::app()->updatePopulateOption( 'cron_running', false );
|
53 |
WRIO_Cron::stop();
|
54 |
+
|
55 |
wp_send_json_success();
|
56 |
} );
|
57 |
|
60 |
*/
|
61 |
add_action( 'wp_ajax_wrio-bulk-optimization-process', function () {
|
62 |
check_admin_referer( 'bulk_optimization' );
|
63 |
+
|
64 |
if ( ! current_user_can( 'manage_options' ) ) {
|
65 |
wp_die( - 1 );
|
66 |
}
|
67 |
+
|
68 |
$reset_current_error = (bool) WRIO_Plugin::app()->request->request( 'reset_current_errors' );
|
69 |
$scope = WRIO_Plugin::app()->request->request( 'scope', null, true );
|
70 |
+
|
71 |
WRIO_Logger::info( sprintf( 'Start bulk optimization process! Scope: %s', $scope ) );
|
72 |
+
|
73 |
if ( empty( $scope ) ) {
|
74 |
wp_die( - 1 );
|
75 |
}
|
76 |
+
|
77 |
// Context class name. If plugin expands with add-ons
|
78 |
$class_name = 'WRIO_' . wrio_dashes_to_camel_case( $scope, true );
|
79 |
+
|
80 |
if ( ! class_exists( $class_name ) ) {
|
81 |
WRIO_Logger::error( sprintf( 'Bulk optimization error: Context class (%s) not found.', $class_name ) );
|
82 |
+
|
83 |
//todo: Temporary bug fix.
|
84 |
if ( 'media-library' === $scope ) {
|
85 |
$class_name = 'WRIO_Media_Library';
|
88 |
} else if ( 'nextgen-gallery' == $scope ) {
|
89 |
$class_name = 'WRIO_Nextgen_Gallery';
|
90 |
}
|
91 |
+
|
92 |
if ( ! class_exists( $class_name ) ) {
|
93 |
wp_send_json_error( [ 'error_message' => 'Context class not found.' ] );
|
94 |
}
|
95 |
}
|
96 |
+
|
97 |
/**
|
98 |
* Create an instance of the class depending on the context in which scope user
|
99 |
* has runned optimization.
|
103 |
* @see WRIO_Nextgen_Gallery
|
104 |
*/
|
105 |
$optimizer = new $class_name();
|
106 |
+
|
107 |
// в ajax запросе мы не знаем, получен ли он из мультиадминки или из обычной. Поэтому проверяем параметр, полученный из frontend
|
108 |
/*if ( isset( $_POST['multisite'] ) && (bool) $_POST['multisite'] ) {
|
109 |
$multisite = new WIO_Multisite;
|
110 |
$multisite->initHooks();
|
111 |
}*/
|
112 |
+
|
113 |
if ( $reset_current_error ) {
|
114 |
$optimizer->resetCurrentErrors(); // сбрасываем текущие ошибки оптимизации
|
115 |
}
|
116 |
+
|
117 |
$result = $optimizer->processUnoptimizedImages( 1 );
|
118 |
+
|
119 |
if ( is_wp_error( $result ) ) {
|
120 |
$error_massage = $result->get_error_message();
|
121 |
+
|
122 |
if ( empty( $error ) ) {
|
123 |
$error_massage = __( "Unknown error. Enable error log on the plugin's settings page, then check the error report on the Error Log page. You can export the error report and send it to the support service of the plugin.", "robin-image-optimizer" );
|
124 |
}
|
125 |
+
|
126 |
WRIO_Logger::error( sprintf( 'Bulk optimization error: %s.', $result->get_error_message() ) );
|
127 |
+
|
128 |
wp_send_json_error( [ 'error_message' => $error_massage ] );
|
129 |
}
|
130 |
+
|
131 |
// если изображения закончились - посылаем команду завершения
|
132 |
if ( $result['remain'] <= 0 ) {
|
133 |
$result['end'] = true;
|
134 |
}
|
135 |
+
|
136 |
WRIO_Logger::info( sprintf( 'End bulk optimization process! Scope: %s. Remain: %d', $scope, $result['remain'] ) );
|
137 |
+
|
138 |
wp_send_json_success( $result );
|
139 |
} );
|
140 |
|
142 |
* Переоптимизация аттачмента
|
143 |
*/
|
144 |
add_action( 'wp_ajax_wio_reoptimize_image', function () {
|
145 |
+
|
146 |
if ( ! current_user_can( 'manage_options' ) ) {
|
147 |
wp_die( - 1 );
|
148 |
}
|
149 |
+
|
150 |
$default_level = WRIO_Plugin::app()->getPopulateOption( 'image_optimization_level', 'normal' );
|
151 |
+
|
152 |
$attachment_id = (int) WRIO_Plugin::app()->request->post( 'id' );
|
153 |
$level = WRIO_Plugin::app()->request->post( 'level', $default_level, true );
|
154 |
+
|
155 |
$backup = WIO_Backup::get_instance();
|
156 |
$media_library = WRIO_Media_Library::get_instance();
|
157 |
$backup_origin_images = WRIO_Plugin::app()->getPopulateOption( 'backup_origin_images', false );
|
158 |
+
|
159 |
if ( $backup_origin_images && ! $backup->isBackupWritable() ) {
|
160 |
echo $media_library->getMediaColumnContent( $attachment_id );
|
161 |
die();
|
162 |
}
|
163 |
+
|
164 |
$optimized_data = $media_library->optimizeAttachment( $attachment_id, $level );
|
165 |
+
|
166 |
if ( $optimized_data && isset( $optimized_data['processing'] ) ) {
|
167 |
echo 'processing';
|
168 |
die();
|
169 |
}
|
170 |
+
|
171 |
echo $media_library->getMediaColumnContent( $attachment_id );
|
172 |
die();
|
173 |
} );
|
176 |
* Восстановление аттачмента из резервной копии
|
177 |
*/
|
178 |
add_action( 'wp_ajax_wio_restore_image', function () {
|
179 |
+
|
180 |
if ( ! current_user_can( 'manage_options' ) ) {
|
181 |
wp_die( - 1 );
|
182 |
}
|
183 |
+
|
184 |
$attachment_id = (int) WRIO_Plugin::app()->request->post( 'id' );
|
185 |
+
|
186 |
$media_library = WRIO_Media_Library::get_instance();
|
187 |
$wio_attachment = $media_library->getAttachment( $attachment_id );
|
188 |
+
|
189 |
if ( $wio_attachment->isOptimized() ) {
|
190 |
$media_library->restoreAttachment( $attachment_id );
|
191 |
}
|
192 |
+
|
193 |
echo $media_library->getMediaColumnContent( $attachment_id );
|
194 |
die();
|
195 |
} );
|
201 |
* статус выбранный).
|
202 |
*/
|
203 |
add_action( 'wp_ajax_wbcr-rio-check-servers-status', function () {
|
204 |
+
|
205 |
check_ajax_referer( 'bulk_optimization' );
|
206 |
+
|
207 |
if ( ! current_user_can( 'manage_options' ) ) {
|
208 |
wp_die( - 1 );
|
209 |
}
|
210 |
+
|
211 |
$server_name = WRIO_Plugin::app()->request->post( 'server_name' );
|
212 |
+
|
213 |
if ( empty( $server_name ) || ! in_array( $server_name, [
|
214 |
'server_1',
|
215 |
'server_2',
|
216 |
'server_3',
|
217 |
+
'server_4',
|
218 |
+
'server_5'
|
219 |
] ) ) {
|
220 |
wp_send_json_error( [ 'error' => __( 'Server name is empty!', 'robin-image-optimizer' ) ] );
|
221 |
}
|
222 |
+
|
223 |
// Позволяем выбрать сервер, даже если он недоступен.
|
224 |
WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_server', $server_name );
|
225 |
+
|
226 |
// Проверяем доступность сервер
|
227 |
// --------------------------------------------------------------------
|
228 |
$return_data = [ 'server_name' => $server_name ];
|
229 |
+
|
230 |
$server_url = wrio_get_server_url( $server_name );
|
231 |
+
$headers = [];
|
232 |
+
|
233 |
$method = 'POST';
|
234 |
+
/*if ( $server_name == 'server_4' ) {
|
235 |
$api_url = $server_url . '/upload/' . wrio_generate_random_string( 16 ) . '/';
|
236 |
+
} */
|
237 |
+
|
238 |
+
if ( $server_name == 'server_3' ) {
|
239 |
$api_url = $server_url . '/s.w.org/images/home/screen-themes.png';
|
240 |
$method = 'GET';
|
241 |
+
} else if ( $server_name == 'server_5' ) {
|
242 |
+
$api_url = "https://dashboard.robinoptimizer.com/v1/license/check";
|
243 |
+
$method = 'GET';
|
244 |
+
$headers['Authorization'] = 'Bearer ' . base64_encode( wrio_get_license_key() );
|
245 |
+
$headers['PluginId'] = wrio_get_freemius_plugin_id();
|
246 |
} else {
|
247 |
$api_url = $server_url;
|
248 |
}
|
249 |
+
|
250 |
$request = wp_remote_request( $api_url, [
|
251 |
+
'method' => $method,
|
252 |
+
'headers' => $headers
|
253 |
] );
|
254 |
+
|
255 |
if ( is_wp_error( $request ) ) {
|
256 |
$er_msg = $request->get_error_message();
|
257 |
+
|
258 |
if ( "server_2" == $server_name ) {
|
259 |
// Hostgator Issue.
|
260 |
if ( ! empty( $er_msg ) && strpos( $er_msg, 'SSL CA cert' ) !== false ) {
|
262 |
WRIO_Plugin::app()->updatePopulateOption( 'use_http', 1 );
|
263 |
}
|
264 |
}
|
265 |
+
|
266 |
$return_data['error'] = $er_msg;
|
267 |
wp_send_json_error( $return_data );
|
268 |
}
|
269 |
+
|
270 |
$response_code = wp_remote_retrieve_response_code( $request );
|
271 |
+
|
272 |
if ( $response_code != 200 ) {
|
273 |
$return_data['error'] = 'Server response ' . $response_code;
|
274 |
wp_send_json_error( $return_data );
|
275 |
}
|
276 |
+
|
277 |
wp_send_json_success( $return_data );
|
278 |
} );
|
279 |
+
|
280 |
+
/**
|
281 |
+
* На странице массовой оптмизации есть поле для выбора сервера. Когда пользователь
|
282 |
+
* выберет какой-то сервер, выполняется этот ajax обработчик. Обработчик пингует выбранный
|
283 |
+
* пользователем сервер и возвращает статус пинга (если пинг успешен, то сервер переход в
|
284 |
+
* статус выбранный).
|
285 |
+
*/
|
286 |
+
add_action( 'wp_ajax_wbcr-rio-check-user-balance', function () {
|
287 |
+
|
288 |
+
check_ajax_referer( 'bulk_optimization' );
|
289 |
+
|
290 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
291 |
+
wp_die( - 1 );
|
292 |
+
}
|
293 |
+
|
294 |
+
$api_url = 'https://dashboard.robinoptimizer.com/v1/license/remaining';
|
295 |
+
$headers['Authorization'] = 'Bearer ' . base64_encode( wrio_get_license_key() );
|
296 |
+
$headers['PluginId'] = wrio_get_freemius_plugin_id();
|
297 |
+
|
298 |
+
$request = wp_remote_request( $api_url, [
|
299 |
+
'method' => 'GET',
|
300 |
+
'headers' => $headers
|
301 |
+
] );
|
302 |
+
|
303 |
+
if ( is_wp_error( $request ) ) {
|
304 |
+
$error_msg = $request->get_error_message();
|
305 |
+
|
306 |
+
$return_data['error'] = $error_msg;
|
307 |
+
wp_send_json_error( $return_data );
|
308 |
+
}
|
309 |
+
|
310 |
+
$response_code = wp_remote_retrieve_response_code( $request );
|
311 |
+
$response_body = wp_remote_retrieve_body( $request );
|
312 |
+
|
313 |
+
if ( $response_code != 200 ) {
|
314 |
+
$return_data['error'] = 'Server response ' . $response_code;
|
315 |
+
if ( $response_code === 401 ) {
|
316 |
+
$error_data = @json_decode( $response_body );
|
317 |
+
$return_data['error'] = $error_data->message;
|
318 |
+
}
|
319 |
+
wp_send_json_error( $return_data );
|
320 |
+
}
|
321 |
+
|
322 |
+
if ( empty( $response_body ) ) {
|
323 |
+
$return_data['error'] = "Server responded an empty request body!";
|
324 |
+
wp_send_json_error( $return_data );
|
325 |
+
}
|
326 |
+
|
327 |
+
$data = @json_decode( $response_body );
|
328 |
+
|
329 |
+
if ( ! isset( $data->status ) || $data->status != 'ok' ) {
|
330 |
+
$return_data['error'] = "Server responded an fail status";
|
331 |
+
wp_send_json_error( $return_data );
|
332 |
+
}
|
333 |
+
|
334 |
+
$current_quota = (int) $data->response->quota;
|
335 |
+
WRIO_Plugin::app()->app()->updateOption( 'current_quota', $current_quota );
|
336 |
+
|
337 |
+
wp_send_json_success( [
|
338 |
+
'balance' => $current_quota,
|
339 |
+
] );
|
340 |
+
} );
|
admin/assets/css/base-statistic.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Styles for the Widget to be displayed in the Clearfy plugin
|
3 |
|
4 |
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
5 |
-
* @copyright Webcraftic
|
6 |
*/
|
7 |
#WBCR {
|
8 |
/* Doughnut */
|
@@ -182,6 +182,7 @@
|
|
182 |
}
|
183 |
#WBCR .wrio-servers #wrio-change-optimization-server {
|
184 |
position: relative;
|
|
|
185 |
max-width: 400px;
|
186 |
margin-right: 15px;
|
187 |
margin-bottom: 0;
|
@@ -194,6 +195,7 @@
|
|
194 |
background: #fff;
|
195 |
}
|
196 |
#WBCR .wrio-servers .wrio-server-status-wrap {
|
|
|
197 |
margin-top: 8px;
|
198 |
}
|
199 |
#WBCR .wrio-servers .wrio-server-status-wrap .wrio-server-status {
|
@@ -214,6 +216,23 @@
|
|
214 |
width: 30px;
|
215 |
background: url("../img/quick-start-loader.gif") center no-repeat;
|
216 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
#WBCR .wio-columns {
|
218 |
overflow: hidden;
|
219 |
padding: 15px 0;
|
@@ -321,7 +340,7 @@
|
|
321 |
}
|
322 |
#WBCR .wio-progress {
|
323 |
height: 8px;
|
324 |
-
transition: width .3s;
|
325 |
/*.wio-bar-negative {
|
326 |
width: 92% !important;
|
327 |
}*/
|
@@ -343,7 +362,7 @@
|
|
343 |
margin-right: -5.25em;
|
344 |
text-align: right;
|
345 |
font-weight: bold;
|
346 |
-
line-height: .8;
|
347 |
}
|
348 |
#WBCR .wio-chart {
|
349 |
position: relative;
|
@@ -562,7 +581,7 @@
|
|
562 |
#WBCR .factory-checkbox-disabled button {
|
563 |
pointer-events: none;
|
564 |
cursor: not-allowed;
|
565 |
-
opacity: .65;
|
566 |
filter: alpha(opacity=65);
|
567 |
-webkit-box-shadow: none;
|
568 |
box-shadow: none;
|
2 |
* Styles for the Widget to be displayed in the Clearfy plugin
|
3 |
|
4 |
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
5 |
+
* @copyright Webcraftic 14.06.2019
|
6 |
*/
|
7 |
#WBCR {
|
8 |
/* Doughnut */
|
182 |
}
|
183 |
#WBCR .wrio-servers #wrio-change-optimization-server {
|
184 |
position: relative;
|
185 |
+
display: inline-block;
|
186 |
max-width: 400px;
|
187 |
margin-right: 15px;
|
188 |
margin-bottom: 0;
|
195 |
background: #fff;
|
196 |
}
|
197 |
#WBCR .wrio-servers .wrio-server-status-wrap {
|
198 |
+
display: inline-block;
|
199 |
margin-top: 8px;
|
200 |
}
|
201 |
#WBCR .wrio-servers .wrio-server-status-wrap .wrio-server-status {
|
216 |
width: 30px;
|
217 |
background: url("../img/quick-start-loader.gif") center no-repeat;
|
218 |
}
|
219 |
+
#WBCR .wrio-servers .wrio-premium-user-balance-wrap {
|
220 |
+
display: none;
|
221 |
+
margin-top: 8px;
|
222 |
+
margin-left: 10px;
|
223 |
+
}
|
224 |
+
#WBCR .wrio-servers .wrio-premium-user-balance-wrap .wrio-premium-user-balance {
|
225 |
+
color: #fff;
|
226 |
+
padding: 3px 5px;
|
227 |
+
border-radius: 4px;
|
228 |
+
background: #ffc107;
|
229 |
+
}
|
230 |
+
#WBCR .wrio-servers .wrio-premium-user-balance-wrap .wrio-premium-user-balance-check-proccess {
|
231 |
+
display: inline-block;
|
232 |
+
height: 10px;
|
233 |
+
width: 30px;
|
234 |
+
background: url("../img/quick-start-loader.gif") center no-repeat;
|
235 |
+
}
|
236 |
#WBCR .wio-columns {
|
237 |
overflow: hidden;
|
238 |
padding: 15px 0;
|
340 |
}
|
341 |
#WBCR .wio-progress {
|
342 |
height: 8px;
|
343 |
+
transition: width 0.3s;
|
344 |
/*.wio-bar-negative {
|
345 |
width: 92% !important;
|
346 |
}*/
|
362 |
margin-right: -5.25em;
|
363 |
text-align: right;
|
364 |
font-weight: bold;
|
365 |
+
line-height: 0.8;
|
366 |
}
|
367 |
#WBCR .wio-chart {
|
368 |
position: relative;
|
581 |
#WBCR .factory-checkbox-disabled button {
|
582 |
pointer-events: none;
|
583 |
cursor: not-allowed;
|
584 |
+
opacity: 0.65;
|
585 |
filter: alpha(opacity=65);
|
586 |
-webkit-box-shadow: none;
|
587 |
box-shadow: none;
|
admin/assets/css/base-statistic.css.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["base-statistic.less"],"names":[],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,KAoBE;EACE,WAAA;;AArBJ,KA2BE;AA3BF,KA2B0C;EAC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BAAA;;AA3rBV,KAmqBE,mBAaE,GAGE,GAWE;AA9rBR,KAmqBsB,wBAalB,GAGE,GAWE;AA9rBR,KAmqBE,mBAaE,GAGE,GAW4B;AA9rBlC,KAmqBsB,wBAalB,GAGE,GAW4B;EACxB,cAAA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;;AAEA,KAjCR,mBAaE,GAGE,GAWE,yBAMG;AAAD,KAjCY,wBAalB,GAGE,GAWE,yBAMG;AAAD,KAjCR,mBAaE,GAGE,GAW4B,iCAMvB;AAAD,KAjCY,wBAalB,GAGE,GAW4B,iCAMvB;EACC,aAAA;EACA,gBAAA;;AAtsBZ,KAmqBE,mBAaE,GAGE,GAuBE;AA1sBR,KAmqBsB,wBAalB,GAGE,GAuBE;AA1sBR,KAmqBE,mBAaE,GAGE,GAuB2B;AA1sBjC,KAmqBsB,wBAalB,GAGE,GAuB2B;EACvB,kBAAA;;AAWR,QAA0B;EAA1B,KACE,KAAK;IACH,WAAA;IACA,oBAAA;;EAHJ,KAME,KAAK;EANP,KAOE,KAAK;IACH,WAAA;IACA,eAAA;IACA,WAAA;IACA,gBAAA;;;AAIJ;EACE;EAAI;IACF,gBAAA;;EAEF;IACE,mBAAA;;;AAIJ,QAA2B,wBAAuB,qBAAsB;EAAxE,KACE,aACE,gBAAe;EAFnB,KACE,aACkC,WAAU;IACxC,UAAA;;;AAMN,QAA0B;EAA1B,KACE,aACE,gBAAe;EAFnB,KACE,aACkC,WAAU;IACxC,WAAA;IACA,WAAA;IACA,UAAA;;EALN,KACE,aAOE,WAAU;IACR,eAAA","file":"base-statistic.css"}
|
admin/assets/css/base-statistic.less
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Styles for the Widget to be displayed in the Clearfy plugin
|
3 |
|
4 |
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
5 |
-
* @copyright Webcraftic
|
6 |
*/
|
7 |
|
8 |
@positiveColor: #8CC152;
|
@@ -215,6 +215,7 @@
|
|
215 |
|
216 |
#wrio-change-optimization-server {
|
217 |
position: relative;
|
|
|
218 |
max-width: 400px;
|
219 |
margin-right: 15px;
|
220 |
margin-bottom: 0;
|
@@ -229,6 +230,7 @@
|
|
229 |
}
|
230 |
|
231 |
.wrio-server-status-wrap {
|
|
|
232 |
margin-top: 8px;
|
233 |
|
234 |
.wrio-server-status {
|
@@ -253,6 +255,27 @@
|
|
253 |
}
|
254 |
}
|
255 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
}
|
257 |
|
258 |
.wio-columns {
|
2 |
* Styles for the Widget to be displayed in the Clearfy plugin
|
3 |
|
4 |
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
5 |
+
* @copyright Webcraftic 14.06.2019
|
6 |
*/
|
7 |
|
8 |
@positiveColor: #8CC152;
|
215 |
|
216 |
#wrio-change-optimization-server {
|
217 |
position: relative;
|
218 |
+
display: inline-block;
|
219 |
max-width: 400px;
|
220 |
margin-right: 15px;
|
221 |
margin-bottom: 0;
|
230 |
}
|
231 |
|
232 |
.wrio-server-status-wrap {
|
233 |
+
display: inline-block;
|
234 |
margin-top: 8px;
|
235 |
|
236 |
.wrio-server-status {
|
255 |
}
|
256 |
}
|
257 |
}
|
258 |
+
|
259 |
+
|
260 |
+
.wrio-premium-user-balance-wrap {
|
261 |
+
display: none;
|
262 |
+
margin-top: 8px;
|
263 |
+
margin-left: 10px;
|
264 |
+
|
265 |
+
.wrio-premium-user-balance {
|
266 |
+
color: #fff;
|
267 |
+
padding: 3px 5px;
|
268 |
+
border-radius: 4px;
|
269 |
+
background: #ffc107;
|
270 |
+
}
|
271 |
+
|
272 |
+
.wrio-premium-user-balance-check-proccess {
|
273 |
+
display: inline-block;
|
274 |
+
height: 10px;
|
275 |
+
width: 30px;
|
276 |
+
background: url("../img/quick-start-loader.gif") center no-repeat;
|
277 |
+
}
|
278 |
+
}
|
279 |
}
|
280 |
|
281 |
.wio-columns {
|
admin/assets/css/sweetalert-custom.css.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["sweetalert-custom.less"],"names":[],"mappings":";AACA,IAAI,eAAgB,iBAAgB;EAClC,iCAAA;EACA,eAAA;;AAGF;EACE,qBAAA;;AADF,WAGE;EACE,yBAAA;;AAJJ,WAOE;EACE,kBAAA;;AARJ,WAWE;EACE,mBAAA;;AAZJ,WAeE;EACE,SAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,
|
1 |
+
{"version":3,"sources":["sweetalert-custom.less"],"names":[],"mappings":";AACA,IAAI,eAAgB,iBAAgB;EAClC,iCAAA;EACA,eAAA;;AAGF;EACE,qBAAA;;AADF,WAGE;EACE,yBAAA;;AAJJ,WAOE;EACE,kBAAA;;AARJ,WAWE;EACE,mBAAA;;AAZJ,WAeE;EACE,SAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,WAAA;EACA,mBAAA;;AArBJ,WAwBE;EACE,eAAA;EACA,kBAAA;EACA,mBAAA;;AA3BJ,WA8BE;EACE,aAAA;EACA,aAAA;EACA,mBAAA;;AAjCJ,WA8BE,sBAKE,EAAC,OAAQ;EACP,kBAAA;EACA,oBAAA;;AArCN,WA8BE,sBAUE,OAAM;EACJ,8BAAA;EACA,uBAAA;EACA,qBAAA;EACA,2BAAA;;AA5CN,WA8BE,sBAiBE,OAAM;EACJ,YAAA;EACA,kBAAA;EACA,YAAA;EACA,eAAA;EACA,mBAAA;EACA,yBAAA;EACA,kBAAA;EACA,iBAAA;EACA,aAAA;;AAEA,WA5BJ,sBAiBE,OAAM,aAWH;EACC,yBAAA;EACA,4BAAA;EACA,2BAAA;EACA,cAAA;;AAGF,WAnCJ,sBAiBE,OAAM,aAkBH;EACC,yBAAA;EACA,cAAA;EACA,4BAAA;EACA,2BAAA;;;;;;AAOF,WA9CJ,sBAiBE,OAAM,aA6BH;AAAQ,WA9Cb,sBAiBE,OAAM,aA6BM;EACR,aAAA;EACA,iBAAA;EACA,WAAA;;AAMR;EACE,mBAAA;;AADF,mBAGE;EACE,kBAAA;EACA,WAAA;EACA,mBAAA;;AANJ,mBASE;EACE,eAAA;EACA,uBAAA;EACA,mBAAA;;AAZJ,mBAeE;EACE,mBAAA;;AAIJ;EACE,mBAAA;;AADF,iBAGE;EACE,kBAAA;EACA,WAAA;EACA,mBAAA;;AANJ,iBASE;EACE,eAAA;EACA,uBAAA;EACA,mBAAA;;AAZJ,iBAeE;EACE,mBAAA;;AAIJ;EACE,mBAAA;;AADF,4BAGE;EACE,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,cAAA;EACA,mBAAA;;AAVJ,4BAaE;EACE,SAAA;EACA,UAAA;;AAfJ,4BAaE,iBAIE;EACE,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,cAAA;;AAxBN,4BAaE,iBAcE,GAAE;EACA,gBAAA;;AA5BN,4BAaE,iBAkBE,GAAE;EACA,mBAAA;;AAhCN,4BAaE,iBAsBE,GAAG;EACD,6BAAA;;AApCN,4BAaE,iBA0BE,EAAC;EACC,SAAS,EAAT;EACA,cAAA;;AAzCN,4BA6CE;EACE,YAAA;EACA,gBAAA;;AA/CJ,4BAkDE,gBAAgB;EACd,kBAAA","file":"sweetalert-custom.css"}
|
admin/assets/js/bulk-optimization.js
CHANGED
@@ -21,13 +21,39 @@ jQuery(function($) {
|
|
21 |
|
22 |
this.registerEvents();
|
23 |
this.checkServerStatus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
},
|
25 |
|
26 |
registerEvents: function() {
|
27 |
-
var self = this
|
|
|
28 |
|
29 |
$('#wrio-change-optimization-server').on('change', function() {
|
30 |
$(this).prop('disabled', true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
self.checkServerStatus();
|
32 |
});
|
33 |
|
@@ -62,6 +88,41 @@ jQuery(function($) {
|
|
62 |
});
|
63 |
},
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
checkServerStatus: function() {
|
66 |
var self = this,
|
67 |
serverStatus = $('.wrio-server-status'),
|
@@ -84,15 +145,18 @@ jQuery(function($) {
|
|
84 |
serverStatus.removeClass('wrio-server-check-proccess');
|
85 |
|
86 |
if( !response || !response.data || !response.success ) {
|
|
|
|
|
|
|
87 |
if( !response || !response.data ) {
|
88 |
-
console.log('[Error]: Response error');
|
89 |
console.log(response);
|
90 |
-
return;
|
91 |
}
|
|
|
92 |
serverStatus.addClass('wrio-down');
|
93 |
-
console.log(self.i18n.server_status_down);
|
94 |
serverStatus.text(self.i18n.server_status_down);
|
95 |
self.serverDown = true;
|
|
|
|
|
96 |
} else {
|
97 |
serverStatus.addClass('wrio-stable');
|
98 |
serverStatus.text(self.i18n.server_status_stable);
|
@@ -289,10 +353,10 @@ jQuery(function($) {
|
|
289 |
throwError: function(error_message) {
|
290 |
this.stop();
|
291 |
|
292 |
-
var noticeId = $.
|
293 |
|
294 |
setTimeout(function() {
|
295 |
-
$.
|
296 |
}, 10000);
|
297 |
},
|
298 |
|
21 |
|
22 |
this.registerEvents();
|
23 |
this.checkServerStatus();
|
24 |
+
|
25 |
+
if( 'server_5' === $('#wrio-change-optimization-server').val() ) {
|
26 |
+
if( !this.settings.is_premium ) {
|
27 |
+
$.wrio_modal.showErrorModal(this.i18n.premium_server_disabled);
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
this.checkPremiumUserBalance();
|
31 |
+
}
|
32 |
},
|
33 |
|
34 |
registerEvents: function() {
|
35 |
+
var self = this,
|
36 |
+
selectedServer = $("#wrio-change-optimization-server option:selected");
|
37 |
|
38 |
$('#wrio-change-optimization-server').on('change', function() {
|
39 |
$(this).prop('disabled', true);
|
40 |
+
|
41 |
+
if( 'server_5' === $(this).val() ) {
|
42 |
+
if( !self.settings.is_premium ) {
|
43 |
+
$.wrio_modal.showErrorModal(self.i18n.premium_server_disabled);
|
44 |
+
selectedServer.prop('selected', true);
|
45 |
+
$(this).prop('disabled', false);
|
46 |
+
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
+
$('.wrio-premium-user-balance-wrap').css('display', 'inline-block');
|
51 |
+
self.checkPremiumUserBalance();
|
52 |
+
} else {
|
53 |
+
$('.wrio-premium-user-balance-wrap').css('display', 'none');
|
54 |
+
}
|
55 |
+
|
56 |
+
selectedServer = $(this).find('option:selected');
|
57 |
self.checkServerStatus();
|
58 |
});
|
59 |
|
88 |
});
|
89 |
},
|
90 |
|
91 |
+
checkPremiumUserBalance: function() {
|
92 |
+
var self = this,
|
93 |
+
userBalance = $('.wrio-premium-user-balance'),
|
94 |
+
data = {
|
95 |
+
'action': 'wbcr-rio-check-user-balance',
|
96 |
+
'_wpnonce': self.settings.nonce
|
97 |
+
};
|
98 |
+
|
99 |
+
userBalance.addClass('wrio-premium-user-balance-check-proccess');
|
100 |
+
userBalance.text('');
|
101 |
+
|
102 |
+
$.post(ajaxurl, data, function(response) {
|
103 |
+
userBalance.removeClass('wrio-premium-user-balance-check-proccess');
|
104 |
+
|
105 |
+
if( !response || !response.data || !response.success ) {
|
106 |
+
console.log('[Error]: Response error');
|
107 |
+
response.data && response.data.error && console.log(response.data.error);
|
108 |
+
|
109 |
+
if( !response || !response.data ) {
|
110 |
+
console.log(response);
|
111 |
+
}
|
112 |
+
|
113 |
+
userBalance.text('error');
|
114 |
+
} else {
|
115 |
+
userBalance.text(response.data.balance);
|
116 |
+
}
|
117 |
+
}).fail(function(xhr, status, error) {
|
118 |
+
console.log(xhr);
|
119 |
+
console.log(status);
|
120 |
+
console.log(error);
|
121 |
+
|
122 |
+
self.throwError(error);
|
123 |
+
});
|
124 |
+
},
|
125 |
+
|
126 |
checkServerStatus: function() {
|
127 |
var self = this,
|
128 |
serverStatus = $('.wrio-server-status'),
|
145 |
serverStatus.removeClass('wrio-server-check-proccess');
|
146 |
|
147 |
if( !response || !response.data || !response.success ) {
|
148 |
+
console.log('[Error]: Response error');
|
149 |
+
response.data && response.data.error && console.log(response.data.error);
|
150 |
+
|
151 |
if( !response || !response.data ) {
|
|
|
152 |
console.log(response);
|
|
|
153 |
}
|
154 |
+
|
155 |
serverStatus.addClass('wrio-down');
|
|
|
156 |
serverStatus.text(self.i18n.server_status_down);
|
157 |
self.serverDown = true;
|
158 |
+
|
159 |
+
return;
|
160 |
} else {
|
161 |
serverStatus.addClass('wrio-stable');
|
162 |
serverStatus.text(self.i18n.server_status_stable);
|
353 |
throwError: function(error_message) {
|
354 |
this.stop();
|
355 |
|
356 |
+
var noticeId = $.wbcr_factory_clearfy_217.app.showNotice(error_message, 'danger');
|
357 |
|
358 |
setTimeout(function() {
|
359 |
+
$.wbcr_factory_clearfy_217.app.hideNotice(noticeId);
|
360 |
}, 10000);
|
361 |
},
|
362 |
|
admin/boot.php
CHANGED
@@ -1,283 +1,346 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
// Exit if accessed directly
|
11 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
-
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Проверяем таблицу в базе данных
|
17 |
-
*
|
18 |
-
* Если таблица не существует или её структура устарела, то обновляем.
|
19 |
-
* Проверка проводится при каждой инициализации плагина т.к. структура может измениться
|
20 |
-
* после очередного обновления плагина.
|
21 |
-
*
|
22 |
-
* @return bool
|
23 |
-
*/
|
24 |
-
add_action( 'admin_init', function () {
|
25 |
-
RIO_Process_Queue::try_create_plugin_tables();
|
26 |
-
} );
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Удаляет карточку компонента в плагине Clearfy.
|
30 |
-
*
|
31 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
32 |
-
* @since 1.3.0
|
33 |
-
*/
|
34 |
-
add_filter( 'wbcr/clearfy/components/items_list', function ( $components ) {
|
35 |
-
if ( wrio_is_clearfy_license_activate() ) {
|
36 |
-
return $components;
|
37 |
}
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
}
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
return $notices;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
return;
|
140 |
-
}
|
141 |
-
|
142 |
-
$obj->printWarningNotice( wrio_get_meta_migration_notice_text() );
|
143 |
-
}, 10, 2 );
|
144 |
-
|
145 |
-
/***
|
146 |
-
* Flush configuration after saving the settings
|
147 |
-
*
|
148 |
-
* @param WHM_Plugin $plugin
|
149 |
-
* @param Wbcr_FactoryPages414_ImpressiveThemplate $obj
|
150 |
-
*
|
151 |
-
* @return bool
|
152 |
-
*/
|
153 |
-
/*add_action('wbcr_factory_414_imppage_after_form_save', function ($plugin, $obj) {
|
154 |
-
$is_rio = WRIO_Plugin::app()->getPluginName() == $plugin->getPluginName();
|
155 |
-
|
156 |
-
if( $is_rio ) {
|
157 |
-
WRIO_Cron::check();
|
158 |
-
}
|
159 |
-
}, 10, 2);*/
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Виджет отзывов
|
163 |
-
*
|
164 |
-
* @param string $page_url
|
165 |
-
* @param string $plugin_name
|
166 |
-
*
|
167 |
-
* @return string
|
168 |
-
*/
|
169 |
-
function wio_rating_widget_url( $page_url, $plugin_name ) {
|
170 |
-
if ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) {
|
171 |
-
return 'https://wordpress.org/support/plugin/robin-image-optimizer/reviews/#new-post';
|
172 |
-
}
|
173 |
-
|
174 |
-
return $page_url;
|
175 |
-
}
|
176 |
-
|
177 |
-
add_filter( 'wbcr_factory_pages_414_imppage_rating_widget_url', 'wio_rating_widget_url', 10, 2 );
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Widget with the offer to buy Clearfy Business
|
181 |
-
*
|
182 |
-
* @param array $widgets
|
183 |
-
* @param string $position
|
184 |
-
* @param Wbcr_Factory414_Plugin $plugin
|
185 |
-
*/
|
186 |
-
add_filter( 'wbcr/factory/pages/impressive/widgets', function ( $widgets, $position, $plugin ) {
|
187 |
-
if ( $plugin->getPluginName() == WRIO_Plugin::app()->getPluginName() ) {
|
188 |
-
require_once WRIO_PLUGIN_DIR . '/admin/includes/sidebar-widgets.php';
|
189 |
-
|
190 |
-
if ( wrio_is_license_activate() ) {
|
191 |
-
unset( $widgets['donate_widget'] );
|
192 |
-
|
193 |
-
if ( $position == 'right' ) {
|
194 |
-
unset( $widgets['businnes_suggetion'] );
|
195 |
-
unset( $widgets['rating_widget'] );
|
196 |
-
unset( $widgets['info_widget'] );
|
197 |
-
}
|
198 |
-
|
199 |
-
if ( $position == 'bottom' ) {
|
200 |
-
$widgets['support'] = wrio_get_sidebar_support_widget();
|
201 |
-
}
|
202 |
-
|
203 |
-
return $widgets;
|
204 |
-
} else {
|
205 |
-
if ( $position == 'right' ) {
|
206 |
-
unset( $widgets['info_widget'] );
|
207 |
-
unset( $widgets['rating_widget'] );
|
208 |
-
$widgets['support'] = wrio_get_sidebar_support_widget();
|
209 |
}
|
|
|
|
|
|
|
|
|
210 |
}
|
211 |
-
|
212 |
-
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
}
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
* @param string $type
|
264 |
-
* @param string $plugin_name
|
265 |
-
*/
|
266 |
-
add_filter( 'wbcr/factory/premium/notice_text', function ( $text, $type, $plugin_name ) {
|
267 |
-
if ( WRIO_Plugin::app()->getPluginName() != $plugin_name ) {
|
268 |
return $text;
|
269 |
-
}
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Admin boot
|
4 |
+
*
|
5 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>
|
6 |
+
* @copyright Webcraftic 25.05.2017
|
7 |
+
* @version 1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Проверяем таблицу в базе данных
|
17 |
+
*
|
18 |
+
* Если таблица не существует или её структура устарела, то обновляем.
|
19 |
+
* Проверка проводится при каждой инициализации плагина т.к. структура может измениться
|
20 |
+
* после очередного обновления плагина.
|
21 |
+
*
|
22 |
+
* @return bool
|
23 |
+
*/
|
24 |
+
add_action( 'admin_init', function () {
|
25 |
+
RIO_Process_Queue::try_create_plugin_tables();
|
26 |
+
} );
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Удаляет карточку компонента в плагине Clearfy.
|
30 |
+
*
|
31 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
32 |
+
* @since 1.3.0
|
33 |
+
*/
|
34 |
+
add_filter( 'wbcr/clearfy/components/items_list', function ( $components ) {
|
35 |
+
if ( wrio_is_clearfy_license_activate() ) {
|
36 |
+
return $components;
|
37 |
+
}
|
38 |
+
if ( ! empty( $components ) ) {
|
39 |
+
foreach ( $components as $key => $component ) {
|
40 |
+
if ( "robin_image_optimizer" == $component['name'] ) {
|
41 |
+
unset( $components[ $key ] );
|
42 |
+
}
|
43 |
}
|
44 |
}
|
45 |
+
|
46 |
+
return $components;
|
47 |
+
} );
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Добавляет карточку компонента на страницу компонентов
|
51 |
+
* в плагине Clearfy.
|
52 |
+
*
|
53 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
54 |
+
* @since 1.3.0
|
55 |
+
*/
|
56 |
+
add_action( 'wbcr/clearfy/components/custom_plugins_card', function () {
|
57 |
+
if ( ! wrio_is_clearfy_license_activate() ) {
|
58 |
+
$view = WRIO_Views::get_instance( WRIO_PLUGIN_DIR );
|
59 |
+
$view->print_template( 'clearfy-component-card' );
|
60 |
+
}
|
61 |
+
} );
|
62 |
+
|
63 |
+
/**
|
64 |
+
* We asset migration scripts to all admin panel pages
|
65 |
+
*
|
66 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
67 |
+
* @since 1.3.0
|
68 |
+
*/
|
69 |
+
add_action( 'admin_enqueue_scripts', function () {
|
70 |
+
if ( ! current_user_can( 'update_plugins' ) || ! wbcr_rio_has_meta_to_migrate() ) {
|
71 |
+
return;
|
72 |
+
}
|
73 |
+
|
74 |
+
wp_enqueue_script( 'wrio-meta-migrations', WRIO_PLUGIN_URL . '/admin/assets/js/meta-migrations.js', [
|
75 |
+
'jquery',
|
76 |
+
'wbcr-factory-clearfy-217-global'
|
77 |
+
], WRIO_Plugin::app()->getPluginVersion() );
|
78 |
+
} );
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Plugin was heavy migrated into new architecture. Specifically, post meta was moved to separate table and
|
82 |
+
* therefore it is required to migrate all of them to new table.
|
83 |
+
*
|
84 |
+
* This action prints a notice, which contains clickable link with JS onclick event, which invokes AJAX request
|
85 |
+
* to migrate these post metas to new table.
|
86 |
+
*
|
87 |
+
* Once all post meta migrated, notice would not be shown anymore.
|
88 |
+
*
|
89 |
+
* @param $notices
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
93 |
+
* @since 1.3.0
|
94 |
+
*
|
95 |
+
* @see wbcr_rio_migrate_postmeta_to_process_queue() for further information about AJAX processing function.
|
96 |
+
* @see wbcr_rio_has_meta_to_migrate() used to check whether to show notice or not.
|
97 |
+
*
|
98 |
+
* @see RIO_Process_Queue for further information about new table.
|
99 |
+
*/
|
100 |
+
add_action( "wbcr/factory/admin_notices", function ( $notices ) {
|
101 |
+
|
102 |
+
if ( ! current_user_can( 'update_plugins' ) || ! wbcr_rio_has_meta_to_migrate() ) {
|
103 |
+
return $notices;
|
104 |
+
}
|
105 |
+
|
106 |
+
$notices[] = [
|
107 |
+
'id' => WRIO_Plugin::app()->getPrefix() . 'meta_to_migration',
|
108 |
+
'type' => 'warning',
|
109 |
+
'dismissible' => false,
|
110 |
+
'dismiss_expires' => 0,
|
111 |
+
'text' => "<p><b>" . WRIO_Plugin::app()->getPluginTitle() . ":</b> " . wrio_get_meta_migration_notice_text() . '</p>'
|
112 |
+
];
|
113 |
+
|
114 |
return $notices;
|
115 |
+
} );
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Plugin was heavy migrated into new architecture. Specifically, post meta was moved to separate table and
|
119 |
+
* therefore it is required to migrate all of them to new table.
|
120 |
+
*
|
121 |
+
* This action prints a notice, which contains clickable link with JS onclick event, which invokes AJAX request
|
122 |
+
* to migrate these post metas to new table.
|
123 |
+
*
|
124 |
+
* Once all post meta migrated, notice would not be shown anymore.
|
125 |
+
*
|
126 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
127 |
+
* @param Wbcr_FactoryPages425_ImpressiveThemplate $obj
|
128 |
+
*
|
129 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
130 |
+
* @since 1.3.0
|
131 |
+
*
|
132 |
+
* @see wbcr_rio_migrate_postmeta_to_process_queue() for further information about AJAX processing function.
|
133 |
+
* @see wbcr_rio_has_meta_to_migrate() used to check whether to show notice or not.
|
134 |
+
*
|
135 |
+
* @see RIO_Process_Queue for further information about new table.
|
136 |
+
*/
|
137 |
+
add_action( 'wbcr/factory/pages/impressive/print_all_notices', function ( $plugin, $obj ) {
|
138 |
+
if ( ( $plugin->getPluginName() != WRIO_Plugin::app()->getPluginName() ) || ! wbcr_rio_has_meta_to_migrate() ) {
|
139 |
+
return;
|
140 |
+
}
|
141 |
+
|
142 |
+
$obj->printWarningNotice( wrio_get_meta_migration_notice_text() );
|
143 |
+
}, 10, 2 );
|
144 |
+
|
145 |
+
/***
|
146 |
+
* Flush configuration after saving the settings
|
147 |
+
*
|
148 |
+
* @param WRIO_Plugin $plugin
|
149 |
+
* @param Wbcr_FactoryPages425_ImpressiveThemplate $obj
|
150 |
+
*
|
151 |
+
* @return bool
|
152 |
+
*/
|
153 |
+
/*add_action('wbcr_factory_425_imppage_after_form_save', function ($plugin, $obj) {
|
154 |
+
$is_rio = WRIO_Plugin::app()->getPluginName() == $plugin->getPluginName();
|
155 |
+
|
156 |
+
if( $is_rio ) {
|
157 |
+
WRIO_Cron::check();
|
158 |
+
}
|
159 |
+
}, 10, 2);*/
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Виджет отзывов
|
163 |
+
*
|
164 |
+
* @param string $page_url
|
165 |
+
* @param string $plugin_name
|
166 |
+
*
|
167 |
+
* @return string
|
168 |
+
*/
|
169 |
+
function wio_rating_widget_url( $page_url, $plugin_name ) {
|
170 |
+
if ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) {
|
171 |
+
return 'https://wordpress.org/support/plugin/robin-image-optimizer/reviews/#new-post';
|
172 |
+
}
|
173 |
+
|
174 |
+
return $page_url;
|
175 |
}
|
176 |
+
|
177 |
+
add_filter( 'wbcr_factory_pages_425_imppage_rating_widget_url', 'wio_rating_widget_url', 10, 2 );
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Widget with the offer to buy Clearfy Business
|
181 |
+
*
|
182 |
+
* @param array $widgets
|
183 |
+
* @param string $position
|
184 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
185 |
+
*/
|
186 |
+
add_filter( 'wbcr/factory/pages/impressive/widgets', function ( $widgets, $position, $plugin ) {
|
187 |
+
if ( $plugin->getPluginName() == WRIO_Plugin::app()->getPluginName() ) {
|
188 |
+
require_once WRIO_PLUGIN_DIR . '/admin/includes/sidebar-widgets.php';
|
189 |
+
|
190 |
+
if ( wrio_is_license_activate() ) {
|
191 |
+
unset( $widgets['donate_widget'] );
|
192 |
+
|
193 |
+
if ( $position == 'right' ) {
|
194 |
+
unset( $widgets['business_suggetion'] );
|
195 |
+
unset( $widgets['rating_widget'] );
|
196 |
+
unset( $widgets['info_widget'] );
|
197 |
+
}
|
198 |
+
|
199 |
+
/*if ( $position == 'bottom' ) {
|
200 |
+
$widgets['support'] = wrio_get_sidebar_support_widget();
|
201 |
+
}*/
|
202 |
+
|
203 |
+
return $widgets;
|
204 |
+
} else {
|
205 |
+
if ( $position == 'right' ) {
|
206 |
+
unset( $widgets['info_widget'] );
|
207 |
+
unset( $widgets['rating_widget'] );
|
208 |
+
//$widgets['support'] = wrio_get_sidebar_support_widget();
|
209 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
}
|
211 |
+
|
212 |
+
//if ( $position == 'bottom' ) {
|
213 |
+
//$widgets['donate_widget'] = wrio_get_sidebar_premium_widget();
|
214 |
+
//}
|
215 |
}
|
216 |
+
|
217 |
+
return $widgets;
|
218 |
+
}, 20, 3 );
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Заменяет заголовок в рекламном виджете
|
222 |
+
*
|
223 |
+
* @param array $features
|
224 |
+
* @param string $plugin_name
|
225 |
+
* @param string $page_id
|
226 |
+
*/
|
227 |
+
add_filter( 'wbcr/clearfy/pages/suggetion_title', function ( $features, $plugin_name, $page_id ) {
|
228 |
+
if ( ! empty( $plugin_name ) && ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) ) {
|
229 |
+
return __( "ROBIN IMAGE OPTIMIZER PRO", 'robin-image-optimizer' );
|
230 |
}
|
231 |
+
|
232 |
+
return $features;
|
233 |
+
}, 20, 3 );
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Заменяем премиум возможности в рекламном виджете
|
237 |
+
*
|
238 |
+
* @param array $features
|
239 |
+
* @param string $plugin_name
|
240 |
+
* @param string $page_id
|
241 |
+
*/
|
242 |
+
add_filter( 'wbcr/clearfy/pages/suggetion_features', function ( $features, $plugin_name, $page_id ) {
|
243 |
+
if ( ! empty( $plugin_name ) && ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) ) {
|
244 |
+
$upgrade_feature = [];
|
245 |
+
$upgrade_feature[] = __( 'Automatic convertation in Webp', 'robin-image-optimizer' );
|
246 |
+
$upgrade_feature[] = __( 'You can optimize custom folders', 'robin-image-optimizer' );
|
247 |
+
$upgrade_feature[] = __( 'Support Nextgen gallery', 'robin-image-optimizer' );
|
248 |
+
$upgrade_feature[] = __( 'Multisite support', 'robin-image-optimizer' );
|
249 |
+
$upgrade_feature[] = __( 'Fast optimization servers', 'robin-image-optimizer' );
|
250 |
+
$upgrade_feature[] = __( 'No ads', 'robin-image-optimizer' );
|
251 |
+
$upgrade_feature[] = __( 'Best support', 'robin-image-optimizer' );
|
252 |
+
|
253 |
+
return $upgrade_feature;
|
254 |
+
}
|
255 |
+
|
256 |
+
return $features;
|
257 |
+
}, 20, 3 );
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Заменяем премиум возможности в рекламном виджете
|
261 |
+
*
|
262 |
+
* @param array $messages
|
263 |
+
* @param string $type
|
264 |
+
* @param string $plugin_name
|
265 |
+
*/
|
266 |
+
add_filter( 'wbcr/factory/premium/notice_text', function ( $text, $type, $plugin_name ) {
|
267 |
+
if ( WRIO_Plugin::app()->getPluginName() != $plugin_name ) {
|
268 |
+
return $text;
|
269 |
+
}
|
270 |
+
|
271 |
+
$license_page_url = WRIO_Plugin::app()->getPluginPageUrl( 'rio_license' );
|
272 |
+
|
273 |
+
if ( 'need_activate_license' == $type ) {
|
274 |
+
return sprintf( __( '<a href="%s">License activation</a> required. A license is required to get premium plugin updates, as well as to get additional services.', 'robin-image-optimizer' ), $license_page_url );
|
275 |
+
} else if ( 'need_renew_license' == $type ) {
|
276 |
+
return sprintf( __( 'Your <a href="%s">license</a> has expired. You can no longer get premium plugin updates, premium support and your access to Webcraftic services has been suspended.', 'robin-image-optimizer' ), $license_page_url );
|
277 |
+
}
|
278 |
+
|
|
|
|
|
|
|
|
|
|
|
279 |
return $text;
|
280 |
+
}, 10, 3 );
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Отправка уведомлений и скором окончании квоты
|
284 |
+
* Уведомления создаются только если квота <= 100
|
285 |
+
*
|
286 |
+
* @author Alexander Gorenkov <g.a.androidjc2@ya.ru>
|
287 |
+
* @since 1.4.2
|
288 |
+
*/
|
289 |
+
add_action( 'wbcr/factory/admin_notices', function ( $notices, $plugin_name ) {
|
290 |
+
if ( $plugin_name != WRIO_Plugin::app()->getPluginName() ) {
|
291 |
+
return $notices;
|
292 |
+
}
|
293 |
+
|
294 |
+
if ( WRIO_Plugin::app()->getPopulateOption( 'image_optimization_server' ) != 'server_5' ) {
|
295 |
+
return $notices;
|
296 |
+
}
|
297 |
+
|
298 |
+
$current_quota = WRIO_Plugin::app()->getOption( 'current_quota' );
|
299 |
+
if ( $current_quota > 100 ) {
|
300 |
+
return $notices;
|
301 |
+
}
|
302 |
+
|
303 |
+
$notice_text = __( 'The remainder of the quota is coming to an end. Remained credits: ' . $current_quota, 'robin_image_optimizer' );
|
304 |
+
|
305 |
+
$plugin_title = WRIO_Plugin::app()->getPluginTitle();
|
306 |
+
$notice_text = '<b>' . $plugin_title . '</b>: ' . $notice_text;
|
307 |
+
$notices[] = [
|
308 |
+
'id' => 'wrio_remained_quota',
|
309 |
+
'type' => 'warning',
|
310 |
+
'dismissible' => true,
|
311 |
+
'where' => [ 'plugins', 'dashboard', 'edit' ],
|
312 |
+
'dismiss_expires' => time() + 3600 * 4,
|
313 |
+
'text' => $notice_text,
|
314 |
+
];
|
315 |
+
|
316 |
+
return $notices;
|
317 |
+
}, 10, 2 );
|
318 |
+
|
319 |
+
/**
|
320 |
+
* Отправка уведомлений и скором окончании квоты в Impressive
|
321 |
+
* Уведомления создаются только если квота <= 100
|
322 |
+
*
|
323 |
+
* @param Wbcr_Factory425_Plugin $plugin Экземпляр плагина, который передается в функцию обратного вызова
|
324 |
+
* @param Wbcr_FactoryPages425_ImpressiveThemplate $obj Экземпляр страницы, который передается в функцию обратного вызова
|
325 |
+
*
|
326 |
+
* @author Alexander Gorenkov <g.a.androidjc2@ya.ru>
|
327 |
+
* @since 1.4.2
|
328 |
+
*/
|
329 |
+
add_action( 'wbcr/factory/pages/impressive/print_all_notices', function ( $plugin, $obj ) {
|
330 |
+
if ( $plugin->getPluginName() != WRIO_Plugin::app()->getPluginName() ) {
|
331 |
+
return false;
|
332 |
+
}
|
333 |
+
|
334 |
+
if ( WRIO_Plugin::app()->getPopulateOption( 'image_optimization_server' ) != 'server_5' ) {
|
335 |
+
return false;
|
336 |
+
}
|
337 |
+
|
338 |
+
$current_quota = WRIO_Plugin::app()->getOption( 'current_quota' );
|
339 |
+
if ( $current_quota > 100 ) {
|
340 |
+
return false;
|
341 |
+
}
|
342 |
+
|
343 |
+
$notice_text = __( 'The remainder of the quota is coming to an end. Remained credits: ' . $current_quota, 'robin_image_optimizer' );
|
344 |
+
|
345 |
+
$obj->printWarningNotice( $notice_text );
|
346 |
+
}, 10, 2 );
|
admin/includes/classes/class-rio-optimize-template.php
CHANGED
@@ -26,12 +26,12 @@ class WIO_OptimizePageTemplate {
|
|
26 |
/**
|
27 |
* Выводит контент страницы с учётом мультисайта
|
28 |
*
|
29 |
-
* @param
|
30 |
*
|
31 |
* @throws Exception
|
32 |
*/
|
33 |
|
34 |
-
/*public function showPageContent(
|
35 |
do_action( 'wbcr/rio/multisite_current_blog' );
|
36 |
$this->pageContent( $page );
|
37 |
do_action( 'wbcr/rio/multisite_restore_blog' );
|
26 |
/**
|
27 |
* Выводит контент страницы с учётом мультисайта
|
28 |
*
|
29 |
+
* @param Wbcr_FactoryClearfy217_PageBase $page
|
30 |
*
|
31 |
* @throws Exception
|
32 |
*/
|
33 |
|
34 |
+
/*public function showPageContent( Wbcr_FactoryClearfy217_PageBase $page ) {
|
35 |
do_action( 'wbcr/rio/multisite_current_blog' );
|
36 |
$this->pageContent( $page );
|
37 |
do_action( 'wbcr/rio/multisite_restore_blog' );
|
admin/pages/class-rio-license.php
CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
9 |
*
|
10 |
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
11 |
*/
|
12 |
-
class WRIO_License_Page extends
|
13 |
|
14 |
/**
|
15 |
* {@inheritdoc}
|
@@ -43,25 +43,60 @@ class WRIO_License_Page extends Wbcr_FactoryClearfy209_LicensePage {
|
|
43 |
|
44 |
/**
|
45 |
* {@inheritdoc}
|
46 |
-
* @param
|
47 |
*/
|
48 |
-
public function __construct(
|
49 |
$this->menu_title = __( 'License', 'robin-image-optimizer' );
|
50 |
$this->page_menu_short_description = __( 'Product activation', 'robin-image-optimizer' );
|
51 |
|
52 |
$this->plan_name = __( 'Robin image optimizer Premium', 'robin-image-optimizer' );
|
53 |
|
54 |
-
if ( is_multisite() && defined( '
|
55 |
-
|
56 |
-
|
57 |
-
if ( WRIO_Plugin::app()->isNetworkActive() && $clearfy_is_active_for_network ) {
|
58 |
$this->clearfy_collaboration = true;
|
59 |
}
|
60 |
-
} else if ( defined( '
|
61 |
$this->clearfy_collaboration = true;
|
62 |
}
|
63 |
|
64 |
parent::__construct( $plugin );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
/**
|
9 |
*
|
10 |
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
11 |
*/
|
12 |
+
class WRIO_License_Page extends Wbcr_FactoryClearfy217_LicensePage {
|
13 |
|
14 |
/**
|
15 |
* {@inheritdoc}
|
43 |
|
44 |
/**
|
45 |
* {@inheritdoc}
|
46 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
47 |
*/
|
48 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
49 |
$this->menu_title = __( 'License', 'robin-image-optimizer' );
|
50 |
$this->page_menu_short_description = __( 'Product activation', 'robin-image-optimizer' );
|
51 |
|
52 |
$this->plan_name = __( 'Robin image optimizer Premium', 'robin-image-optimizer' );
|
53 |
|
54 |
+
if ( is_multisite() && defined( 'WCL_PLUGIN_ACTIVE' ) ) {
|
55 |
+
if ( WRIO_Plugin::app()->isNetworkActive() && WCL_Plugin::app()->isNetworkActive() ) {
|
|
|
|
|
56 |
$this->clearfy_collaboration = true;
|
57 |
}
|
58 |
+
} else if ( defined( 'WCL_PLUGIN_ACTIVE' ) ) {
|
59 |
$this->clearfy_collaboration = true;
|
60 |
}
|
61 |
|
62 |
parent::__construct( $plugin );
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Adds a new plugin card to license components page
|
66 |
+
*
|
67 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
68 |
+
* @since 1.3.0
|
69 |
+
*/
|
70 |
+
add_filter( 'wbcr/clearfy/license/list_components', function ( $components ) {
|
71 |
+
$title = 'Free';
|
72 |
+
$icon = 'rio-premium-icon-256x256--lock.png';
|
73 |
+
$description = "";
|
74 |
+
|
75 |
+
if ( wrio_is_license_activate() ) {
|
76 |
+
$title = 'Premium';
|
77 |
+
$icon = 'rio-premium-icon-256x256--default.png';
|
78 |
+
//$description = "Key: " . wrio_get_license_key();
|
79 |
+
}
|
80 |
+
|
81 |
+
$components[] = [
|
82 |
+
'name' => 'robin_image_optimizer',
|
83 |
+
'title' => sprintf( __( 'Robin image optimizer [%s]', 'clearfy' ), $title ),
|
84 |
+
'url' => 'https://wordpress.org/plugins/robin-image-optimizer/',
|
85 |
+
'type' => 'wordpress',
|
86 |
+
'build' => $this->is_premium ? 'premium' : 'free',
|
87 |
+
'key' => $this->get_hidden_license_key(),
|
88 |
+
'plan' => $this->get_plan(),
|
89 |
+
'expiration_days' => $this->get_expiration_days(),
|
90 |
+
'quota' => $this->is_premium ? $this->premium_license->get_count_active_sites() . ' ' . __( 'of', 'clearfy' ) . ' ' . $this->premium_license->get_sites_quota() : null,
|
91 |
+
'subscription' => $this->is_premium && $this->premium_has_subscription ? sprintf( __( 'Automatic renewal, every %s', '' ), esc_attr( $this->get_billing_cycle_readable() ) ) : null,
|
92 |
+
'base_path' => 'robin-image-optimizer/robin-image-optimizer.php',
|
93 |
+
'icon' => WCL_PLUGIN_URL . '/admin/assets/img/' . $icon,
|
94 |
+
'description' => $description . __( 'Public License is a GPLv3 compatible license allowing you to change and use this version of the plugin for free. Please keep in mind this license covers only free edition of the plugin. Premium versions are distributed with other type of a license.', 'clearfy' ),
|
95 |
+
'license_page_id' => 'rio_license'
|
96 |
+
];
|
97 |
+
|
98 |
+
return $components;
|
99 |
+
} );
|
100 |
}
|
101 |
|
102 |
/**
|
admin/pages/class-rio-log.php
CHANGED
@@ -106,10 +106,10 @@ class WRIO_LogPage extends WRIO_Page {
|
|
106 |
|
107 |
jQuery('#wbcr-log-viewer').html('');
|
108 |
jQuery('#wbcr-log-size').text('0B');
|
109 |
-
jQuery.
|
110 |
},
|
111 |
error: function(jqXHR, textStatus, errorThrown) {
|
112 |
-
jQuery.
|
113 |
btn.html(currentBtnText);
|
114 |
}
|
115 |
});
|
106 |
|
107 |
jQuery('#wbcr-log-viewer').html('');
|
108 |
jQuery('#wbcr-log-size').text('0B');
|
109 |
+
jQuery.wbcr_factory_clearfy_217.app.showNotice(data.message, data.type);
|
110 |
},
|
111 |
error: function(jqXHR, textStatus, errorThrown) {
|
112 |
+
jQuery.wbcr_factory_clearfy_217.app.showNotice('Error: ' + errorThrown + ', status: ' + textStatus, 'danger');
|
113 |
btn.html(currentBtnText);
|
114 |
}
|
115 |
});
|
admin/pages/class-rio-page.php
CHANGED
@@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
18 |
* @copyright (c) 2018, Webcraftic
|
19 |
* @version 1.0
|
20 |
*/
|
21 |
-
class WRIO_Page extends
|
22 |
|
23 |
/**
|
24 |
* {@inheritdoc}
|
@@ -54,13 +54,11 @@ class WRIO_Page extends Wbcr_FactoryClearfy209_PageBase {
|
|
54 |
public function __construct( WRIO_Plugin $plugin ) {
|
55 |
$this->view = WRIO_Views::get_instance( WRIO_PLUGIN_DIR );
|
56 |
|
57 |
-
if ( is_multisite() && defined( '
|
58 |
-
|
59 |
-
|
60 |
-
if ( WRIO_Plugin::app()->isNetworkActive() && $clearfy_is_active_for_network ) {
|
61 |
$this->clearfy_collaboration = true;
|
62 |
}
|
63 |
-
} else if ( defined( '
|
64 |
$this->clearfy_collaboration = true;
|
65 |
}
|
66 |
|
18 |
* @copyright (c) 2018, Webcraftic
|
19 |
* @version 1.0
|
20 |
*/
|
21 |
+
class WRIO_Page extends Wbcr_FactoryClearfy217_PageBase {
|
22 |
|
23 |
/**
|
24 |
* {@inheritdoc}
|
54 |
public function __construct( WRIO_Plugin $plugin ) {
|
55 |
$this->view = WRIO_Views::get_instance( WRIO_PLUGIN_DIR );
|
56 |
|
57 |
+
if ( is_multisite() && defined( 'WCL_PLUGIN_ACTIVE' ) ) {
|
58 |
+
if ( WRIO_Plugin::app()->isNetworkActive() && WCL_Plugin::app()->isNetworkActive() ) {
|
|
|
|
|
59 |
$this->clearfy_collaboration = true;
|
60 |
}
|
61 |
+
} else if ( defined( 'WCL_PLUGIN_ACTIVE' ) ) {
|
62 |
$this->clearfy_collaboration = true;
|
63 |
}
|
64 |
|
admin/pages/class-rio-settings.php
CHANGED
@@ -12,91 +12,91 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
12 |
* @version 1.0
|
13 |
*/
|
14 |
class WRIO_SettingsPage extends WRIO_Page {
|
15 |
-
|
16 |
/**
|
17 |
* {@inheritdoc}
|
18 |
*/
|
19 |
public $id = 'rio_settings';
|
20 |
-
|
21 |
/**
|
22 |
* {@inheritdoc}
|
23 |
*/
|
24 |
public $page_menu_dashicon = 'dashicons-admin-generic';
|
25 |
-
|
26 |
/**
|
27 |
* {@inheritdoc}
|
28 |
*/
|
29 |
public $show_right_sidebar_in_options = true;
|
30 |
-
|
31 |
/**
|
32 |
* @param WRIO_Plugin $plugin
|
33 |
*/
|
34 |
public function __construct( WRIO_Plugin $plugin ) {
|
35 |
-
|
36 |
$this->menu_title = __( 'Settings', 'robin-image-optimizer' );
|
37 |
$this->page_menu_short_description = __( 'Plugin configuration', 'robin-image-optimizer' );
|
38 |
-
|
39 |
parent::__construct( $plugin );
|
40 |
}
|
41 |
-
|
42 |
/**
|
43 |
* Подключаем скрипты и стили для страницы
|
44 |
*
|
45 |
-
* @since 1.0.0
|
46 |
* @return void
|
47 |
-
* @
|
|
|
48 |
*
|
49 |
*/
|
50 |
public function assets( $scripts, $styles ) {
|
51 |
parent::assets( $scripts, $styles );
|
52 |
-
|
53 |
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/base-statistic.css' );
|
54 |
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/restore-backup.js' );
|
55 |
-
|
56 |
// Add Clearfy styles for HMWP pages
|
57 |
if ( defined( 'WBCR_CLEARFY_PLUGIN_ACTIVE' ) ) {
|
58 |
$this->styles->add( WCL_PLUGIN_URL . '/admin/assets/css/general.css' );
|
59 |
}
|
60 |
}
|
61 |
-
|
62 |
-
|
63 |
/**
|
64 |
* Выводим предупреждения
|
65 |
*
|
66 |
*/
|
67 |
protected function warningNotice() {
|
68 |
$upload_dir = wp_upload_dir();
|
69 |
-
|
70 |
if ( ! wp_is_writable( $upload_dir['basedir'] ) ) {
|
71 |
$this->printErrorNotice( __( 'Folder wp-content/uploads/ is unavailable for writing', 'robin-image-optimizer' ) );
|
72 |
}
|
73 |
-
|
74 |
$wio_backup = $upload_dir['basedir'] . '/wio_backup/';
|
75 |
if ( file_exists( $wio_backup ) && ! wp_is_writable( $wio_backup ) ) {
|
76 |
$this->printErrorNotice( __( 'Folder wp-content/uploads/wio-backup/ is unavailable for writing', 'robin-image-optimizer' ) );
|
77 |
}
|
78 |
-
|
79 |
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON == true ) {
|
80 |
$this->printErrorNotice( __( 'Cron is disabled in wp-config.php', 'robin-image-optimizer' ) );
|
81 |
}
|
82 |
}
|
83 |
-
|
84 |
-
|
85 |
/**
|
86 |
* Метод должен передать массив опций для создания формы с полями.
|
87 |
* Созданием страницы и формы занимается фреймворк
|
88 |
*
|
89 |
-
* @since 1.0.0
|
90 |
* @return mixed[]
|
|
|
91 |
*/
|
92 |
public function getPageOptions() {
|
93 |
$options = [];
|
94 |
-
|
95 |
$options[] = [
|
96 |
'type' => 'html',
|
97 |
'html' => '<div class="wbcr-factory-page-group-header"><strong>' . __( 'Main Settings', 'robin-image-optimizer' ) . '</strong><p>' . __( 'This section you can set main images optimization settings.', 'robin-image-optimizer' ) . '</p></div>'
|
98 |
];
|
99 |
-
|
100 |
$options[] = [
|
101 |
'type' => 'dropdown',
|
102 |
'name' => 'image_optimization_server',
|
@@ -104,28 +104,28 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
104 |
'data' => [
|
105 |
[
|
106 |
'server_1',
|
107 |
-
__( 'Server 1 (
|
108 |
-
|
109 |
],
|
110 |
[
|
111 |
'server_2',
|
112 |
__( 'Server 2 (✰✰) - poor compression, image size limit up to 1 MB', 'robin-image-optimizer' )
|
113 |
-
|
114 |
],
|
115 |
[
|
116 |
'server_3',
|
117 |
__( "Server 3 (✰✰) - poor compression, you can't use it on a localhost", 'robin-image-optimizer' )
|
118 |
],
|
119 |
[
|
120 |
-
'
|
121 |
-
__( '
|
122 |
],
|
123 |
],
|
124 |
'layout' => [ 'hint-type' => 'icon', 'hint-icon-color' => 'grey' ],
|
125 |
'hint' => __( 'We use several free servers for image optimization and can’t fully guarantee their stable performance. The server can be not available in some countries due to the political reasons. There is a solution: if one of the servers is not available or can’t optimize the image, you can try to switch to the alternative server. Each server has individual limitations for image weight and optimization level. By default, you have the best server with minimum limitations.', 'robin-image-optimizer' ),
|
126 |
'default' => 'server_1',
|
127 |
];
|
128 |
-
|
129 |
// Радио переключатель
|
130 |
$options[] = [
|
131 |
'type' => 'dropdown',
|
@@ -172,7 +172,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
172 |
],
|
173 |
]
|
174 |
];
|
175 |
-
|
176 |
// Текстовое поле
|
177 |
$options[] = [
|
178 |
'type' => 'textbox',
|
@@ -182,7 +182,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
182 |
'hint' => __( 'custom quality 1-100', 'robin-image-optimizer' ),
|
183 |
'default' => '70'
|
184 |
];
|
185 |
-
|
186 |
// Переключатель
|
187 |
$options[] = [
|
188 |
'type' => 'checkbox',
|
@@ -193,7 +193,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
193 |
'hint' => __( 'Automatically compress all images that you upload directly to the WordPress media library, when editing pages and posts or using themes and plugins.', 'robin-image-optimizer' ),
|
194 |
'default' => false
|
195 |
];
|
196 |
-
|
197 |
// Переключатель
|
198 |
$options[] = [
|
199 |
'type' => 'checkbox',
|
@@ -204,7 +204,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
204 |
'hint' => __( 'Before optimizing, all your images will be saved in a separate folder for future recovery.', 'robin-image-optimizer' ),
|
205 |
'default' => true
|
206 |
];
|
207 |
-
|
208 |
// Переключатель
|
209 |
$options[] = [
|
210 |
'type' => 'checkbox',
|
@@ -221,12 +221,12 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
221 |
'hide' => '#wrio-error-log-options'
|
222 |
]
|
223 |
];
|
224 |
-
|
225 |
$options[] = [
|
226 |
'type' => 'html',
|
227 |
'html' => [ $this, 'error_log_options' ]
|
228 |
];
|
229 |
-
|
230 |
$options[] = [
|
231 |
'type' => 'checkbox',
|
232 |
'way' => 'buttons',
|
@@ -243,18 +243,18 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
243 |
'hide' => '#wrio-webp-options'
|
244 |
]
|