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 +111 -174
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;EACtC,wBAAA;;AA5BJ,KAiCE;EACE,SAAA;EAEA,mBAAA;;AApCJ,KAiCE,oBAKE;EACE,SAAA;;AAvCN,KAiCE,oBAKE,GAGE;EACE,kBAAA;EACA,qBAAA;EAEA,eAAA;EACA,mBAAA;EACA,4BAAA;;AAEA,KAhBN,oBAKE,GAGE,GAQG;EACC,mBAAA;;AAGF,KApBN,oBAKE,GAGE,GAYG;EAEC,mBAAA;EACA,6BAAA;EACA,8BAAA;EACA,+BAAA;EACA,gCAAA;EACA,mBAAA;;AAPF,KApBN,oBAKE,GAGE,GAYG,OASC;EACE,WAAA;;AAVJ,KApBN,oBAKE,GAGE,GAYG,OASC,EAGE;EACE,0BAAA;EACA,cAAA;;AAdN,KApBN,oBAKE,GAGE,GAYG,OAkBC;AAlBF,KApBN,oBAKE,GAGE,GAYG,OAkBa,kBAAiB;EAC3B,cAAA;;AAxEZ,KAiCE,oBAKE,GAGE,GAmCE;EACE,cAAA;EACA,4BAAA;EACA,qBAAA;EACA,cAAA;EACA,eAAA;EACA,cAAA;;AAEA,KAnDR,oBAKE,GAGE,GAmCE,oBAQG;AAAS,KAnDlB,oBAKE,GAGE,GAmCE,oBAQa;EACT,aAAA;EACA,gBAAA;EACA,aAAA;;AAvFZ,KAiCE,oBAKE,GAGE,GAmCE,oBAcE;AA1FV,KAiCE,oBAKE,GAGE,GAmCE,oBAcc,kBAAiB;EAC3B,qBAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,cAAA;;AAjGZ,KAiCE,oBAKE,GAGE,GAmCE,oBAyBE;EACE,qBAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,0BAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,cAAA;;AAhHZ,KAiCE,oBAKE,GAGE,GA2EE,kCAAiC;EAlHrC,qBAAA;EACA,kBAAA;EACA,SAAS,KAAT;EACA,mBAAA;EACA,kBAAA;EACA,WAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,mBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,WAAA;;AAjBJ,KA4HE;EACE,WAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;EACA,gBAAA;EACA,8BAAA;;AAlIJ,KA4HE,YAQE;AApIJ,KA4HE,YAQM;EACF,kBAAA;EACA,kBAAA;;AAtIN,KA4HE,YAaE;EACE,mBAAA;EACA,cAAA;EACA,2BAAA;;AAEA,KAlBJ,YAaE,GAKG,UAAU;EACT,mBAAA;;AA/IR,KA4HE,YAuBE,GAAE;EACA,
|
1 |
+
{"version":3,"sources":["base-statistic.less"],"names":[],"mappings":";;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,KAoBE;EACE,WAAA;;AArBJ,KA2BE;AA3BF,KA2B0C;EACtC,wBAAA;;AA5BJ,KAiCE;EACE,SAAA;EAEA,mBAAA;;AApCJ,KAiCE,oBAKE;EACE,SAAA;;AAvCN,KAiCE,oBAKE,GAGE;EACE,kBAAA;EACA,qBAAA;EAEA,eAAA;EACA,mBAAA;EACA,4BAAA;;AAEA,KAhBN,oBAKE,GAGE,GAQG;EACC,mBAAA;;AAGF,KApBN,oBAKE,GAGE,GAYG;EAEC,mBAAA;EACA,6BAAA;EACA,8BAAA;EACA,+BAAA;EACA,gCAAA;EACA,mBAAA;;AAPF,KApBN,oBAKE,GAGE,GAYG,OASC;EACE,WAAA;;AAVJ,KApBN,oBAKE,GAGE,GAYG,OASC,EAGE;EACE,0BAAA;EACA,cAAA;;AAdN,KApBN,oBAKE,GAGE,GAYG,OAkBC;AAlBF,KApBN,oBAKE,GAGE,GAYG,OAkBa,kBAAiB;EAC3B,cAAA;;AAxEZ,KAiCE,oBAKE,GAGE,GAmCE;EACE,cAAA;EACA,4BAAA;EACA,qBAAA;EACA,cAAA;EACA,eAAA;EACA,cAAA;;AAEA,KAnDR,oBAKE,GAGE,GAmCE,oBAQG;AAAS,KAnDlB,oBAKE,GAGE,GAmCE,oBAQa;EACT,aAAA;EACA,gBAAA;EACA,aAAA;;AAvFZ,KAiCE,oBAKE,GAGE,GAmCE,oBAcE;AA1FV,KAiCE,oBAKE,GAGE,GAmCE,oBAcc,kBAAiB;EAC3B,qBAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,cAAA;;AAjGZ,KAiCE,oBAKE,GAGE,GAmCE,oBAyBE;EACE,qBAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,0BAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,cAAA;;AAhHZ,KAiCE,oBAKE,GAGE,GA2EE,kCAAiC;EAlHrC,qBAAA;EACA,kBAAA;EACA,SAAS,KAAT;EACA,mBAAA;EACA,kBAAA;EACA,WAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,mBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,WAAA;;AAjBJ,KA4HE;EACE,WAAA;EACA,mBAAA;EACA,sBAAA;EACA,mBAAA;EACA,gBAAA;EACA,8BAAA;;AAlIJ,KA4HE,YAQE;AApIJ,KA4HE,YAQM;EACF,kBAAA;EACA,kBAAA;;AAtIN,KA4HE,YAaE;EACE,mBAAA;EACA,cAAA;EACA,2BAAA;;AAEA,KAlBJ,YAaE,GAKG,UAAU;EACT,mBAAA;;AA/IR,KA4HE,YAuBE,GAAE;EACA,yBAAA;;AApJN,KA4HE,YA2BE;EACE,gBAAgB,wDAAhB;;AAxJN,KA4HE,YA+BE;EACE,qBAAA;EACA,gBAAA;EACA,mBAAA;;AA9JN,KA4HE,YAqCE;EACE,cAAA;;AAlKN,KA4HE,YAyCE;EACE,cAAA;;AAtKN,KA4HE,YA6CE;EACE,cAAA;;AAGF,KAjDF,YAiDG,uBACC,GAAE,UAAU;EACV,gBAAA;;AA/KR,KAoLE;EACE,kBAAA;;AArLJ,KAoLE,cAGE,MACE;EACE,cAAA;EACA,mBAAA;EACA,eAAA;EACA,cAAA;;AA5LR,KAoLE,cAYE;EACE,kBAAA;EACA,qBAAA;EACA,gBAAA;EACA,kBAAA;EACA,gBAAA;EACA,yBAAA;EACA,mBAAA;;AAvMN,KAoLE,cAsBE;EACE,aAAA;EACA,aAAA;EACA,gBAAA;;AA7MN,KAoLE,cA4BE;EACE,qBAAA;EACA,eAAA;;AAlNN,KAoLE,cA4BE,yBAIE;EACE,uBAAA;EACA,WAAA;EACA,gBAAA;EACA,kBAAA;;AAEA,KAtCN,cA4BE,yBAIE,oBAMG;EACC,mBAAA;;AAGF,KA1CN,cA4BE,yBAIE,oBAUG;EACC,mBAAA;;AAGF,KA9CN,cA4BE,yBAIE,oBAcG;EACC,qBAAA;EACA,YAAA;EACA,WAAA;EACA,gBAAgB,iDAAhB;;AAtOV,KAoLE,cAwDE;EACE,aAAA;EACA,eAAA;EACA,iBAAA;;AA/ON,KAoLE,cAwDE,gCAKE;EACE,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,mBAAA;;AArPR,KAoLE,cAwDE,gCAYE;EACE,qBAAA;EACA,YAAA;EACA,WAAA;EACA,gBAAgB,iDAAhB;;AA5PR,KAiQE;EACE,gBAAA;EACA,eAAA;EACA,mBAAA;;AApQJ,KAiQE,aAKE;EACE,WAAA;EACA,8BAAA;EACA,2BAAA;EACA,sBAAA;;AA1QN,KAiQE,aAYE;EACE,cAAA;EACA,kBAAA;;AA/QN,KAiQE,aAiBE;EACE,cAAA;EACA,kBAAA;;AApRN,KAiQE,aAsBE;EACE,UAAA;EACA,eAAA;;AAzRN,KAiQE,aA2BE,gBAAe;EACb,UAAA;;AA7RN,KAiQE,aA+BE,WAAU;EACR,UAAA;EACA,kBAAA;EACA,aAAA;EACA,eAAA;EACA,yBAAA;EACA,qBAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,wCAAA;;AA5SN,KAgTE;EACE,WAAA;EACA,UAAA;EACA,sBAAA;EACA,uBAAA;EACA,4BAAA;EACA,eAAA;;AAtTJ,KAyTE;EACE,mBAAA;;AA1TJ,KA6TE,SAAS;EACP,gBAAA;EACA,kBAAA;;AA/TJ,KAkUE,SAAQ;EACN,yCAAA;;AAnUJ,KAsUE;EACE,qBAAA;EACA,gBAAA;;AAxUJ,KAsUE,0BAIE;EACE,cAAA;;AA3UN,KAsUE,0BAQE;EACE,mBAAA;EACA,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;EACA,sBAAA;EACA,mBAAA;EACA,cAAA;;AAtVN,KAsUE,0BAmBE;EACE,mBAAA;EACA,sBAAA;EACA,gBAAA;EACA,eAAA;EACA,cAAA;;AAGF,KA3BF,0BA2BI;EACA,cAAA;;AAlWN,KAsWE;EACE,mBAAA;;AAvWJ,KA0WE,UAAU;EACR,eAAA;EACA,kBAAA;;AA5WJ,KA+WE,UAAU;EACR,gBAAA;EACA,mBAAA;;AAjXJ,KAoXE,UAAU,4BAA4B;EACpC,cAAA;;AArXJ,KAwXE,kBACE;EACE,mBAAA;;AA1XN,KAwXE,kBAKE;EACE,cAAA;;AA9XN,KAkYE;EACE,WAAA;EACA,sBAAA;;;;;AApYJ,KA2YE,kBACE;EACE,mBAAA;;AA7YN,KA2YE,kBAKE;EACE,cAAA;;AAjZN,KAqZE,iBACE;EACE,mBAAA;;AAvZN,KAqZE,iBAKE;EACE,cAAA;;AA3ZN,KA+ZE,0BAA0B;EACxB,cAAA;EACA,qBAAA;EACA,iBAAA;EACA,iBAAA;EACA,gBAAA;;AApaJ,KAyaE;EACE,kBAAA;EACA,QAAA;EACA,qBAAA;EACA,sBAAA;;AA7aJ,KAgbE;EACE,kBAAA;EACA,qBAAA;EACA,iBAAA;;AAnbJ,KAsbE,qBAAqB;EACnB,cAAA;;AAvbJ,KA0bE;EACE,WAAA;EACA,kBAAA;;AA5bJ,KA+bE;EACE,kBAAA;EACA,OAAA;EACA,QAAA;EACA,QAAA;EACA,kBAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;;AAzcJ,KA4cE,mBAAmB;EACjB,eAAA;EACA,qBAAA;;AA9cJ,KAidE;EACE,gBAAA;;AAldJ,KAqdE,qBAAqB;EACnB,qBAAA;EACA,kBAAA;EACA,mBAAA;EACA,kBAAA;EACA,yBAAA;EACA,cAAA;EACA,eAAA;EACA,sDAAA;EACA,mDAAA;EACA,iDAAA;EACA,8CAAA;;AAheJ,KAmeE,qBAAqB,GAAG;EACtB,cAAA;EACA,kBAAA;EACA,OAAA;EACA,MAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;;AA1eJ,KA6eE;EACE,gBAAA;EACA,kBAAA;EACA,mBAAA;EACA,cAAA;EACA,SAAA;EACA,gBAAA;EACA,eAAA;EACA,oCAAA;EACA,iBAAA;EACA,kBAAA;EACA,aAAA;;AAEA,KAbF,qBAaG;EACC,8CAAA;;AAGF,KAjBF,qBAiBG;EACC,mBAAA;EACA,cAAA;;AAGF,KAtBF,qBAsBG;EACC,cAAA;EACA,wBAAgC,mDAAhC;EACA,kBAAA;;AAtgBN,KA0gBE;EACE,YAAA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;;AA9gBJ,KAihBE;EACE,cAAA;;AAlhBJ,KAqhBE;AArhBF,KAqhBsB;AArhBtB,KAqhB4C;EACxC,aAAA;;AAthBJ,KAyhBE;EACE,gBAAA;;AA1hBJ,KA6hBE,KAAI;EACF,0BAAA;EACA,4BAAA;;AA/hBJ,KAqiBE;EACE,4BAAA;;AAtiBJ,KAyiBE;EACE,kBAAA;;AA1iBJ,KAyiBE,oBAGE;EACE,kBAAA;;AA7iBN,KAijBE;EAEE,gBAAA;EACA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApjBJ,KAijBE,4BAKE;EACE,eAAA;EACA,gBAAA;;AAxjBN,KAijBE,4BA0CE;EACE,aAAA;EACA,mBAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;;AAhmBN,KAomBE;EACE,qBAAA;;AArmBJ,KAomBE,YAGE;EACE,eAAA;EACA,cAAA;;AAzmBN,KAomBE,YAQE;EACE,UAAA;EACA,kBAAA;;AA9mBN,KAomBE,YAaE,WAAU;EACR,WAAA;;AAlnBN,KAomBE,YAiBE;EACE,UAAA;EACA,iBAAA;EACA,kBAAA;;AAxnBN,KAomBE,YAuBE;;EAEE,gBAAA;;AA7nBN,KAomBE,YA4BE;EACE,cAAA;EACA,4BAAA;EACA,WAAA;EACA,iBAAA;;AApoBN,KAomBE,YAmCE,mBAAmB;EACjB,mBAAA;;AAxoBN,KAomBE,YAuCE,mBAAmB,GAAE;EACnB,gBAAA;;AAOF,KADF,kBACG,4BAA4B;EAjpB7B,qBAAA;EACA,kBAAA;EACA,SAAS,KAAT;EACA,mBAAA;EACA,kBAAA;EACA,WAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,mBAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;EACA,WAAA;;AAjBJ,KAwpBE,2BACE;AAzpBJ,KAwpBE,2BACS;EACL,oBAAA;EACA,mBAAA;EACA,aAAA;EACA,yBAAA;EACA,wBAAA;EACA,gBAAA;;AA/pBN,KAmqBE,mBACE;AApqBJ,KAmqBsB,wBAClB;EACE,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,cAAA;;AAxqBN,KAmqBE,mBAQE;AA3qBJ,KAmqBsB,wBAQlB;EACE,cAAA;EACA,eAAA;;AA7qBN,KAmqBE,mBAaE;AAhrBJ,KAmqBsB,wBAalB;EACE,eAAA;;AAGE,KAjBN,mBAaE,GAGE,GACG;AAAD,KAjBc,wBAalB,GAGE,GACG;EACC,SAAS,EAAT;EACA,cAAA;EACA,WAAA;;AAvrBV,KAmqBE,mBAaE,GAGE,GAOE;AA1rBR,KAmqBsB,wBAalB,GAGE,GAOE;EACE,gBAAA;;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 |
]
|
245 |
];
|
246 |
-
|
247 |
$options[] = [
|
248 |
'type' => 'html',
|
249 |
'html' => [ $this, 'conver_webp_options' ]
|
250 |
];
|
251 |
-
|
252 |
// восстановление
|
253 |
$options[] = [
|
254 |
'type' => 'html',
|
255 |
'html' => [ $this, 'rollbackButton' ],
|
256 |
];
|
257 |
-
|
258 |
// Переключатель
|
259 |
$options[] = [
|
260 |
'type' => 'checkbox',
|
@@ -265,12 +265,12 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
265 |
'hint' => __( 'EXIF is information stored in photos: camera model, shutter speed, exposure compensation, ISO, GPS, etc. By default, the plugin removes EXIF extended data. If your project is dedicated to photography and you need to display this data, then enable this option.', 'robin-image-optimizer' ),
|
266 |
'default' => true
|
267 |
];
|
268 |
-
|
269 |
$options[] = [
|
270 |
'type' => 'html',
|
271 |
'html' => '<div class="wbcr-factory-page-group-header"><strong>' . __( 'Optimization', 'robin-image-optimizer' ) . '</strong><p>' . __( 'Here you can specify additional image optimization options.', 'robin-image-optimizer' ) . '</p></div>'
|
272 |
];
|
273 |
-
|
274 |
// Переключатель
|
275 |
$options[] = [
|
276 |
'type' => 'checkbox',
|
@@ -289,7 +289,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
289 |
'hide' => '.factory-control-resize_larger_w,.factory-control-resize_larger_h'
|
290 |
]
|
291 |
];
|
292 |
-
|
293 |
// Текстовое поле
|
294 |
$options[] = [
|
295 |
'type' => 'textbox',
|
@@ -299,7 +299,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
299 |
'hint' => __( 'Set the maximum images resolution on the long side. For horizontal images, this will be the width, and for vertical images - the height. The resolution of the images will be changed proportionally according to the set value.', 'robin-image-optimizer' ),
|
300 |
'default' => '1600'
|
301 |
];
|
302 |
-
|
303 |
// Текстовое поле
|
304 |
$options[] = [
|
305 |
'type' => 'textbox',
|
@@ -309,7 +309,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
309 |
'hint' => __( 'Set the maximum images resolution on the long side. For horizontal images, this will be the width, and for vertical images - the height. The resolution of the images will be changed proportionally according to the set value.', 'robin-image-optimizer' ),
|
310 |
'default' => '1600'
|
311 |
];
|
312 |
-
|
313 |
// получаем зарегистрированные размеры изображений
|
314 |
$wp_image_sizes = wrio_get_image_sizes();
|
315 |
$wio_image_sizes = [];
|
@@ -319,7 +319,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
319 |
$key . ' - ' . $value['width'] . 'x' . $value['height'],
|
320 |
];
|
321 |
}
|
322 |
-
|
323 |
$options[] = [
|
324 |
'type' => 'list',
|
325 |
'way' => 'checklist',
|
@@ -330,20 +330,20 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
330 |
'hint' => __( 'Choose which sizes of thumbnails should be optimized and uncheck those that do not need optimization.', 'robin-image-optimizer' ),
|
331 |
'default' => 'thumbnail,medium'
|
332 |
];
|
333 |
-
|
334 |
$options = apply_filters( 'wbcr/rio/settings_page/options', $options );
|
335 |
-
|
336 |
$formOptions = [];
|
337 |
-
|
338 |
$formOptions[] = [
|
339 |
'type' => 'form-group',
|
340 |
'items' => $options,
|
341 |
//'cssClass' => 'postbox'
|
342 |
];
|
343 |
-
|
344 |
return $formOptions;
|
345 |
}
|
346 |
-
|
347 |
/**
|
348 |
* Save advanced options in database
|
349 |
*
|
@@ -351,7 +351,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
351 |
* @since 1.3.6
|
352 |
*/
|
353 |
public function beforeFormSave() {
|
354 |
-
|
355 |
/**
|
356 |
* Used to save webp options. It can also be used to intercept
|
357 |
* other unregistered fields.
|
@@ -359,18 +359,18 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
359 |
* @since 1.3.6
|
360 |
*/
|
361 |
do_action( "wrio/settings_page/berfore_form_save" );
|
362 |
-
|
363 |
$error_log = (int) WRIO_Plugin::app()->request->post( WRIO_Plugin::app()->getPrefix() . 'error_log', 0 );
|
364 |
-
|
365 |
if ( ! $error_log ) {
|
366 |
return;
|
367 |
}
|
368 |
-
|
369 |
$keep_error_log_on_frontend = (int) WRIO_Plugin::app()->request->post( 'wrio_keep_error_log_on_frontend', 0 );
|
370 |
-
|
371 |
WRIO_Plugin::app()->updatePopulateOption( 'keep_error_log_on_frontend', $keep_error_log_on_frontend );
|
372 |
}
|
373 |
-
|
374 |
/**
|
375 |
* This method adds advanced options for the "Convert Images to WebP" checkbox.
|
376 |
*
|
@@ -378,7 +378,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
378 |
* @since 1.3.6
|
379 |
*/
|
380 |
public function conver_webp_options() {
|
381 |
-
|
382 |
/**
|
383 |
* This hook prints options for delivering webp images.
|
384 |
*
|
@@ -386,7 +386,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
386 |
*/
|
387 |
do_action( "wrio/settings_page/conver_webp_options" );
|
388 |
}
|
389 |
-
|
390 |
/**
|
391 |
* This method adds advanced options for the "Error log" checkbox.
|
392 |
*
|
@@ -398,7 +398,7 @@ class WRIO_SettingsPage extends WRIO_Page {
|
|
398 |
'keep_error_log_on_frontend' => (int) WRIO_Plugin::app()->getPopulateOption( 'keep_error_log_on_frontend', 0 )
|
399 |
] );
|
400 |
}
|
401 |
-
|
402 |
/**
|
403 |
* Кнопка восстановления изображений
|
404 |
*/
|
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 |
* @return void
|
46 |
+
* @since 1.0.0
|
47 |
+
* @see Wbcr_FactoryPages425_AdminPage
|
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 |
* @return mixed[]
|
90 |
+
* @since 1.0.0
|
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 |
'data' => [
|
105 |
[
|
106 |
'server_1',
|
107 |
+
__( 'Server 1 (✰✰✰✰) - image size limit up to 5 MB', 'robin-image-optimizer' ),
|
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 |
+
'server_5',
|
121 |
+
__( 'Premium (✰✰✰✰✰) no limits', 'robin-image-optimizer' )
|
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 |
],
|
173 |
]
|
174 |
];
|
175 |
+
|
176 |
// Текстовое поле
|
177 |
$options[] = [
|
178 |
'type' => 'textbox',
|
182 |
'hint' => __( 'custom quality 1-100', 'robin-image-optimizer' ),
|
183 |
'default' => '70'
|
184 |
];
|
185 |
+
|
186 |
// Переключатель
|
187 |
$options[] = [
|
188 |
'type' => 'checkbox',
|
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 |
'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 |
'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 |
'hide' => '#wrio-webp-options'
|
244 |
]
|
245 |
];
|
246 |
+
|
247 |
$options[] = [
|
248 |
'type' => 'html',
|
249 |
'html' => [ $this, 'conver_webp_options' ]
|
250 |
];
|
251 |
+
|
252 |
// восстановление
|
253 |
$options[] = [
|
254 |
'type' => 'html',
|
255 |
'html' => [ $this, 'rollbackButton' ],
|
256 |
];
|
257 |
+
|
258 |
// Переключатель
|
259 |
$options[] = [
|
260 |
'type' => 'checkbox',
|
265 |
'hint' => __( 'EXIF is information stored in photos: camera model, shutter speed, exposure compensation, ISO, GPS, etc. By default, the plugin removes EXIF extended data. If your project is dedicated to photography and you need to display this data, then enable this option.', 'robin-image-optimizer' ),
|
266 |
'default' => true
|
267 |
];
|
268 |
+
|
269 |
$options[] = [
|
270 |
'type' => 'html',
|
271 |
'html' => '<div class="wbcr-factory-page-group-header"><strong>' . __( 'Optimization', 'robin-image-optimizer' ) . '</strong><p>' . __( 'Here you can specify additional image optimization options.', 'robin-image-optimizer' ) . '</p></div>'
|
272 |
];
|
273 |
+
|
274 |
// Переключатель
|
275 |
$options[] = [
|
276 |
'type' => 'checkbox',
|
289 |
'hide' => '.factory-control-resize_larger_w,.factory-control-resize_larger_h'
|
290 |
]
|
291 |
];
|
292 |
+
|
293 |
// Текстовое поле
|
294 |
$options[] = [
|
295 |
'type' => 'textbox',
|
299 |
'hint' => __( 'Set the maximum images resolution on the long side. For horizontal images, this will be the width, and for vertical images - the height. The resolution of the images will be changed proportionally according to the set value.', 'robin-image-optimizer' ),
|
300 |
'default' => '1600'
|
301 |
];
|
302 |
+
|
303 |
// Текстовое поле
|
304 |
$options[] = [
|
305 |
'type' => 'textbox',
|
309 |
'hint' => __( 'Set the maximum images resolution on the long side. For horizontal images, this will be the width, and for vertical images - the height. The resolution of the images will be changed proportionally according to the set value.', 'robin-image-optimizer' ),
|
310 |
'default' => '1600'
|
311 |
];
|
312 |
+
|
313 |
// получаем зарегистрированные размеры изображений
|
314 |
$wp_image_sizes = wrio_get_image_sizes();
|
315 |
$wio_image_sizes = [];
|
319 |
$key . ' - ' . $value['width'] . 'x' . $value['height'],
|
320 |
];
|
321 |
}
|
322 |
+
|
323 |
$options[] = [
|
324 |
'type' => 'list',
|
325 |
'way' => 'checklist',
|
330 |
'hint' => __( 'Choose which sizes of thumbnails should be optimized and uncheck those that do not need optimization.', 'robin-image-optimizer' ),
|
331 |
'default' => 'thumbnail,medium'
|
332 |
];
|
333 |
+
|
334 |
$options = apply_filters( 'wbcr/rio/settings_page/options', $options );
|
335 |
+
|
336 |
$formOptions = [];
|
337 |
+
|
338 |
$formOptions[] = [
|
339 |
'type' => 'form-group',
|
340 |
'items' => $options,
|
341 |
//'cssClass' => 'postbox'
|
342 |
];
|
343 |
+
|
344 |
return $formOptions;
|
345 |
}
|
346 |
+
|
347 |
/**
|
348 |
* Save advanced options in database
|
349 |
*
|
351 |
* @since 1.3.6
|
352 |
*/
|
353 |
public function beforeFormSave() {
|
354 |
+
|
355 |
/**
|
356 |
* Used to save webp options. It can also be used to intercept
|
357 |
* other unregistered fields.
|
359 |
* @since 1.3.6
|
360 |
*/
|
361 |
do_action( "wrio/settings_page/berfore_form_save" );
|
362 |
+
|
363 |
$error_log = (int) WRIO_Plugin::app()->request->post( WRIO_Plugin::app()->getPrefix() . 'error_log', 0 );
|
364 |
+
|
365 |
if ( ! $error_log ) {
|
366 |
return;
|
367 |
}
|
368 |
+
|
369 |
$keep_error_log_on_frontend = (int) WRIO_Plugin::app()->request->post( 'wrio_keep_error_log_on_frontend', 0 );
|
370 |
+
|
371 |
WRIO_Plugin::app()->updatePopulateOption( 'keep_error_log_on_frontend', $keep_error_log_on_frontend );
|
372 |
}
|
373 |
+
|
374 |
/**
|
375 |
* This method adds advanced options for the "Convert Images to WebP" checkbox.
|
376 |
*
|
378 |
* @since 1.3.6
|
379 |
*/
|
380 |
public function conver_webp_options() {
|
381 |
+
|
382 |
/**
|
383 |
* This hook prints options for delivering webp images.
|
384 |
*
|
386 |
*/
|
387 |
do_action( "wrio/settings_page/conver_webp_options" );
|
388 |
}
|
389 |
+
|
390 |
/**
|
391 |
* This method adds advanced options for the "Error log" checkbox.
|
392 |
*
|
398 |
'keep_error_log_on_frontend' => (int) WRIO_Plugin::app()->getPopulateOption( 'keep_error_log_on_frontend', 0 )
|
399 |
] );
|
400 |
}
|
401 |
+
|
402 |
/**
|
403 |
* Кнопка восстановления изображений
|
404 |
*/
|
admin/pages/class-rio-statistic.php
CHANGED
@@ -1,252 +1,252 @@
|
|
1 |
<?php
|
2 |
-
// Exit if accessed directly
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
|
5 |
-
}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Class WRIO_StatisticPage
|
9 |
-
* Класс отвечает за работу страницы статистики
|
10 |
-
*
|
11 |
-
* @author Eugene Jokerov <jokerov@gmail.com>
|
12 |
-
* @copyright (c) 2018, Webcraftic
|
13 |
-
*/
|
14 |
-
class WRIO_StatisticPage extends WRIO_Page {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* {@inheritdoc}
|
18 |
-
*/
|
19 |
-
public $id = 'rio_general';
|
20 |
-
|
21 |
-
/**
|
22 |
-
* {@inheritdoc}
|
23 |
-
*/
|
24 |
-
public $type = 'page';
|
25 |
-
|
26 |
-
/**
|
27 |
-
* {@inheritdoc}
|
28 |
-
*/
|
29 |
-
public $plugin;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* {@inheritdoc}
|
33 |
-
*/
|
34 |
-
public $page_menu_position = 20;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* {@inheritdoc}
|
38 |
-
*/
|
39 |
-
public $page_menu_dashicon = 'dashicons-chart-line';
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @var string
|
43 |
-
*/
|
44 |
-
public $menu_target = 'options-general.php';
|
45 |
-
|
46 |
-
/**
|
47 |
-
* @var bool
|
48 |
-
*/
|
49 |
-
public $internal = false;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* @var bool
|
53 |
-
*/
|
54 |
-
public $add_link_to_plugin_actions = true;
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Page type
|
58 |
-
*
|
59 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
60 |
-
* @since 1.3.0
|
61 |
-
* @var string
|
62 |
-
*/
|
63 |
-
protected $scope = 'media-library';
|
64 |
-
|
65 |
-
|
66 |
-
/**
|
67 |
-
* @param WRIO_Plugin $plugin
|
68 |
-
*/
|
69 |
-
public function __construct( WRIO_Plugin $plugin ) {
|
70 |
-
$this->menu_title = __( 'Robin image optimizer', 'robin-image-optimizer' );
|
71 |
-
$this->page_menu_short_description = __( 'Compress bulk of images', 'robin-image-optimizer' );
|
72 |
-
$this->plugin = $plugin;
|
73 |
-
|
74 |
-
parent::__construct( $plugin );
|
75 |
-
|
76 |
-
add_action( 'admin_enqueue_scripts', [ $this, 'print_i18n' ] );
|
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 |
-
|
104 |
-
|
105 |
-
|
106 |
-
return $this->clearfy_collaboration ? __( 'Image optimizer', 'robin-image-optimizer' ) : __( 'Bulk optimization', 'robin-image-optimizer' );
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* {@inheritdoc}
|
111 |
-
*/
|
112 |
-
public function assets( $scripts, $styles ) {
|
113 |
-
parent::assets( $scripts, $styles );
|
114 |
-
|
115 |
-
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/base-statistic.css' );
|
116 |
-
|
117 |
-
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/sweetalert2.js' );
|
118 |
-
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/sweetalert2.css' );
|
119 |
-
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/sweetalert-custom.css' );
|
120 |
-
|
121 |
-
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/Chart.min.js' );
|
122 |
-
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/statistic.js' );
|
123 |
-
|
124 |
-
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/modals.js', [ 'jquery' ], 'wrio-modals' );
|
125 |
-
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/bulk-optimization.js', [
|
126 |
-
'jquery',
|
127 |
-
'wrio-modals'
|
128 |
-
] );
|
129 |
-
|
130 |
-
// Add Clearfy styles for HMWP pages
|
131 |
-
if ( defined( 'WBCR_CLEARFY_PLUGIN_ACTIVE' ) ) {
|
132 |
-
$this->styles->add( WCL_PLUGIN_URL . '/admin/assets/css/general.css' );
|
133 |
}
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
* @since 1.3.0
|
141 |
-
* @throws \Exception
|
142 |
-
*/
|
143 |
-
public function print_i18n() {
|
144 |
-
$page = $this->plugin->request->get( 'page', null );
|
145 |
-
|
146 |
-
if ( $page != $this->getResultId() ) {
|
147 |
-
return;
|
148 |
}
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
'
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
$this->
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
?>
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
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 |
-
}
|
1 |
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
+
|
7 |
/**
|
8 |
+
* Class WRIO_StatisticPage
|
9 |
+
* Класс отвечает за работу страницы статистики
|
10 |
*
|
11 |
+
* @author Eugene Jokerov <jokerov@gmail.com>
|
12 |
+
* @copyright (c) 2018, Webcraftic
|
13 |
+
*/
|
14 |
+
class WRIO_StatisticPage extends WRIO_Page {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* {@inheritdoc}
|
18 |
+
*/
|
19 |
+
public $id = 'rio_general';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* {@inheritdoc}
|
23 |
+
*/
|
24 |
+
public $type = 'page';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* {@inheritdoc}
|
28 |
+
*/
|
29 |
+
public $plugin;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritdoc}
|
33 |
+
*/
|
34 |
+
public $page_menu_position = 20;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* {@inheritdoc}
|
38 |
+
*/
|
39 |
+
public $page_menu_dashicon = 'dashicons-chart-line';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
public $menu_target = 'options-general.php';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @var bool
|
48 |
+
*/
|
49 |
+
public $internal = false;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @var bool
|
53 |
+
*/
|
54 |
+
public $add_link_to_plugin_actions = true;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Page type
|
58 |
+
*
|
59 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
60 |
+
* @since 1.3.0
|
61 |
+
* @var string
|
62 |
+
*/
|
63 |
+
protected $scope = 'media-library';
|
64 |
+
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @param WRIO_Plugin $plugin
|
68 |
+
*/
|
69 |
+
public function __construct( WRIO_Plugin $plugin ) {
|
70 |
+
$this->menu_title = __( 'Robin image optimizer', 'robin-image-optimizer' );
|
71 |
+
$this->page_menu_short_description = __( 'Compress bulk of images', 'robin-image-optimizer' );
|
72 |
+
$this->plugin = $plugin;
|
73 |
+
|
74 |
+
parent::__construct( $plugin );
|
75 |
+
|
76 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'print_i18n' ] );
|
77 |
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Подменяем простраинство имен для меню плагина, если активирован плагин Clearfy
|
81 |
+
* Меню текущего плагина будет добавлено в общее меню Clearfy
|
82 |
+
*
|
83 |
+
* @return string
|
84 |
+
*/
|
85 |
+
public function getMenuScope() {
|
86 |
+
if ( $this->clearfy_collaboration ) {
|
87 |
+
//$this->internal = true;
|
88 |
+
|
89 |
+
return 'wbcr_clearfy';
|
90 |
+
}
|
91 |
+
|
92 |
+
return $this->plugin->getPluginName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* {@inheritdoc}
|
97 |
+
*/
|
98 |
+
public function getMenuTitle() {
|
99 |
+
return $this->clearfy_collaboration ? __( 'Robin Image Optimizer', 'robin-image-optimizer' ) : __( 'Robin image optimizer', 'robin-image-optimizer' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* {@inheritdoc}
|
104 |
+
*/
|
105 |
+
public function getPageTitle() {
|
106 |
+
return $this->clearfy_collaboration ? __( 'Image optimizer', 'robin-image-optimizer' ) : __( 'Bulk optimization', 'robin-image-optimizer' );
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* {@inheritdoc}
|
111 |
+
*/
|
112 |
+
public function assets( $scripts, $styles ) {
|
113 |
+
parent::assets( $scripts, $styles );
|
114 |
+
|
115 |
+
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/base-statistic.css' );
|
116 |
+
|
117 |
+
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/sweetalert2.js' );
|
118 |
+
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/sweetalert2.css' );
|
119 |
+
$this->styles->add( WRIO_PLUGIN_URL . '/admin/assets/css/sweetalert-custom.css' );
|
120 |
+
|
121 |
+
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/Chart.min.js' );
|
122 |
+
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/statistic.js' );
|
123 |
+
|
124 |
+
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/modals.js', [ 'jquery' ], 'wrio-modals' );
|
125 |
+
$this->scripts->add( WRIO_PLUGIN_URL . '/admin/assets/js/bulk-optimization.js', [
|
126 |
+
'jquery',
|
127 |
+
'wrio-modals'
|
128 |
+
] );
|
129 |
+
|
130 |
+
// Add Clearfy styles for HMWP pages
|
131 |
+
if ( defined( 'WBCR_CLEARFY_PLUGIN_ACTIVE' ) ) {
|
132 |
+
$this->styles->add( WCL_PLUGIN_URL . '/admin/assets/css/general.css' );
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Print localization only current page
|
138 |
+
*
|
139 |
+
* @throws \Exception
|
140 |
+
* @since 1.3.0
|
141 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
142 |
+
*/
|
143 |
+
public function print_i18n() {
|
144 |
+
$page = $this->plugin->request->get( 'page', null );
|
145 |
+
|
146 |
+
if ( $page != $this->getResultId() ) {
|
147 |
+
return;
|
148 |
+
}
|
149 |
+
|
150 |
+
$backup = new WIO_Backup();
|
151 |
+
|
152 |
+
wp_localize_script( 'jquery', 'wrio_l18n_bulk_page', $this->get_i18n() );
|
153 |
+
|
154 |
+
wp_localize_script( 'jquery', 'wrio_settings_bulk_page', [
|
155 |
+
'is_premium' => wrio_is_license_activate(),
|
156 |
+
'is_network_admin' => WRIO_Plugin::app()->isNetworkAdmin() ? 1 : 0,
|
157 |
+
'is_writable_backup_dir' => $backup->isBackupWritable() ? 1 : 0,
|
158 |
+
'images_backup' => WRIO_Plugin::app()->getPopulateOption( 'backup_origin_images', false ) ? 1 : 0,
|
159 |
+
'need_migration' => wbcr_rio_has_meta_to_migrate() ? 1 : 0,
|
160 |
+
'scope' => $this->scope,
|
161 |
+
'nonce' => wp_create_nonce( 'bulk_optimization' )
|
162 |
+
] );
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* {@inheritdoc}
|
167 |
+
*/
|
168 |
+
public function showPageContent() {
|
169 |
+
$is_premium = wrio_is_license_activate();
|
170 |
+
$statistics = $this->get_statisctic_data();
|
171 |
+
|
172 |
+
$template_data = [
|
173 |
+
'is_premium' => $is_premium,
|
174 |
+
'scope' => $this->scope
|
175 |
+
];
|
176 |
+
|
177 |
+
//do_action( 'wbcr/rio/multisite_current_blog' );
|
178 |
+
|
179 |
+
// Page header
|
180 |
+
$this->view->print_template( 'part-page-header', [
|
181 |
+
'title' => __( 'Image optimization dashboard', 'robin-image-optimizer' ),
|
182 |
+
'description' => __( 'Monitor image optimization statistics and run on demand or scheduled optimization.', 'robin-image-optimizer' )
|
183 |
+
], $this );
|
184 |
+
|
185 |
+
// Page tabs
|
186 |
+
$this->view->print_template( 'part-bulk-optimization-tabs', $template_data, $this );
|
187 |
+
|
188 |
?>
|
189 |
+
<div class="wbcr-factory-page-group-body" style="padding:0; border-top: 1px solid #d4d4d4;">
|
190 |
+
<?php
|
191 |
+
// Servers
|
192 |
+
$this->view->print_template( 'part-bulk-optimization-servers', $template_data, $this );
|
193 |
+
|
194 |
+
// Statistic
|
195 |
+
$this->view->print_template( 'part-bulk-optimization-statistic', array_merge( $template_data, [
|
196 |
+
'stats' => $statistics->get()
|
197 |
+
] ), $this );
|
198 |
+
|
199 |
+
// Optimization log
|
200 |
+
$this->view->print_template( 'part-bulk-optimization-log', array_merge( $template_data, [
|
201 |
+
'process_log' => $statistics->get_last_optimized_images()
|
202 |
+
] ), $this );
|
203 |
+
?>
|
204 |
+
</div>
|
205 |
+
<script type="text/html" id="wrio-tmpl-bulk-optimization">
|
206 |
+
<?php $this->view->print_template( 'modal-bulk-optimization' ); ?>
|
207 |
+
</script>
|
208 |
+
<?php
|
209 |
+
//do_action( 'wbcr/rio/multisite_restore_blog' );
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @return object|\WRIO_Image_Statistic
|
214 |
+
* @since 1.3.0
|
215 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
216 |
+
*/
|
217 |
+
protected function get_statisctic_data() {
|
218 |
+
return WRIO_Image_Statistic::get_instance();
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* @return array
|
223 |
+
* @since 1.3.0
|
224 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
225 |
+
*/
|
226 |
+
protected function get_i18n() {
|
227 |
+
return [
|
228 |
+
'premium_server_disabled' => __( 'You cannot use the premium server on a free plan. You must activate the license to use all the features of the premium version.', 'robin-image-optimizer' ),
|
229 |
+
'server_down_warning' => __( 'Your selected optimization server is down. This means that you cannot optimize images through this server. Try selecting another optimization server.', 'robin-image-optimizer' ),
|
230 |
+
'server_status_down' => __( 'down', 'robin-image-optimizer' ),
|
231 |
+
'server_status_stable' => __( 'stable', 'robin-image-optimizer' ),
|
232 |
+
'modal_error' => __( 'Error', 'robin-image-optimizer' ),
|
233 |
+
'modal_cancel' => __( 'Cancel', 'robin-image-optimizer' ),
|
234 |
+
'modal_confirm' => __( 'Confirm', 'robin-image-optimizer' ),
|
235 |
+
'modal_optimization_title' => __( 'Select optimization way', 'robin-image-optimizer' ),
|
236 |
+
'modal_optimization_monual_button' => __( 'Optimize now', 'robin-image-optimizer' ),
|
237 |
+
'modal_optimization_cron_button' => __( 'Scheduled optimization', 'robin-image-optimizer' ),
|
238 |
+
'need_migrations' => __( 'To start optimizing, you must complete migration from old plugin version.', 'robin-image-optimizer' ),
|
239 |
+
'optimization_complete' => __( 'All images from the media library are optimized.', 'robin-image-optimizer' ),
|
240 |
+
'optimization_inprogress' => __( 'Optimization in progress. Remained <span id="wio-total-unoptimized">%s</span> images.', 'robin-image-optimizer' ),
|
241 |
+
'leave_page_warning' => __( 'Are you sure that you want to leave the page? The optimization process is not over yet, stay on the page until the end of the optimization process.', 'robin-image-optimizer' ),
|
242 |
+
'process_without_backup' => __( 'Do you want to start optimization without backup?', 'robin-image-optimizer' ),
|
243 |
+
'button_resume' => __( 'Resume', 'robin-image-optimizer' ),
|
244 |
+
'button_completed' => __( 'Completed', 'robin-image-optimizer' ),
|
245 |
+
'buttom_start' => __( 'Run', 'robin-image-optimizer' ),
|
246 |
+
'button_stop' => __( 'Stop', 'robin-image-optimizer' ),
|
247 |
+
'button_stop_cron' => __( 'Stop shedule optimization', 'robin-image-optimizer' )
|
248 |
+
//Don't Need a Parachute?
|
249 |
+
//If you keep this option deactivated, you won't be able to re-optimize your images to another compression level and restore your original images in case of need.
|
250 |
+
];
|
251 |
+
}
|
252 |
}
|
|
includes/class-rio-plugin.php
CHANGED
@@ -1,158 +1,184 @@
|
|
1 |
<?php
|
2 |
-
// Exit if accessed directly
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
|
5 |
-
}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Основной класс плагина
|
9 |
-
*
|
10 |
-
* @author Webcraftic <wordpress.webraftic@gmail.com>
|
11 |
-
* @copyright (c) 19.02.2018, Webcraftic
|
12 |
-
* @version 1.0
|
13 |
-
*/
|
14 |
-
class WRIO_Plugin extends Wbcr_Factory414_Plugin {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @var Wbcr_Factory414_Plugin
|
18 |
-
*/
|
19 |
-
private static $app;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @param string $plugin_path
|
23 |
-
* @param array $data
|
24 |
-
*
|
25 |
-
* @throws Exception
|
26 |
-
*/
|
27 |
-
public function __construct( $plugin_path, $data ) {
|
28 |
-
self::$app = $this;
|
29 |
-
parent::__construct( $plugin_path, $data );
|
30 |
-
|
31 |
-
$this->includes();
|
32 |
-
|
33 |
-
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
34 |
-
// Ajax files
|
35 |
-
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/backup.php' );
|
36 |
-
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/bulk-optimization.php' );
|
37 |
-
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/logs.php' );
|
38 |
-
// Not under AJAX logical operator above on purpose to have helpers available to find out whether
|
39 |
-
// metas were migrated or not
|
40 |
-
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/meta-migrations.php' );
|
41 |
-
}
|
42 |
-
|
43 |
-
if ( is_admin() ) {
|
44 |
-
$this->initActivation();
|
45 |
-
}
|
46 |
-
|
47 |
-
add_action( 'plugins_loaded', [ $this, 'pluginsLoaded' ] );
|
48 |
}
|
49 |
-
|
50 |
/**
|
51 |
-
*
|
52 |
-
*/
|
53 |
-
protected function includes() {
|
54 |
-
|
55 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/functions.php' );
|
56 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-views.php' );
|
57 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-attachment.php' );
|
58 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-media-library.php' );
|
59 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-abstract.php' );
|
60 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-image-statistic.php' );
|
61 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-backup.php' );
|
62 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-optimization-tools.php' );
|
63 |
-
|
64 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-helper.php' );
|
65 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-object.php' ); // Base object
|
66 |
-
|
67 |
-
// Database related models
|
68 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-active-record.php' );
|
69 |
-
// Base class
|
70 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-extra-data.php' );
|
71 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-attachment-extra-data.php' );
|
72 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-server-smushit-extra-data.php' );
|
73 |
-
|
74 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-process-queue-table.php' ); // Processing queue model
|
75 |
-
|
76 |
-
// Cron
|
77 |
-
// ----------------
|
78 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-cron.php' );
|
79 |
-
new WRIO_Cron();
|
80 |
-
|
81 |
-
// Logger
|
82 |
-
// ----------------
|
83 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/logger/class-rio-logger.php' );
|
84 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/logger/class-rio-log-export.php' );
|
85 |
-
require_once( WRIO_PLUGIN_DIR . '/includes/classes/logger/class-rio-log-reader.php' );
|
86 |
-
new WRIO_Logger();
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Статический метод для быстрого доступа к информации о плагине, а также часто использумых методах.
|
91 |
-
*
|
92 |
-
* @return Wbcr_Factory414_Plugin
|
93 |
-
*/
|
94 |
-
public static function app() {
|
95 |
-
return self::$app;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Инициализируем активацию плагина
|
100 |
-
*/
|
101 |
-
protected function initActivation() {
|
102 |
-
include_once( WRIO_PLUGIN_DIR . '/admin/activation.php' );
|
103 |
-
self::app()->registerActivation( 'WIO_Activation' );
|
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 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
150 |
}
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
}
|
157 |
-
}
|
158 |
|
1 |
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
+
|
7 |
/**
|
8 |
+
* Основной класс плагина
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
*
|
10 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>
|
11 |
+
* @copyright (c) 19.02.2018, Webcraftic
|
12 |
+
* @version 1.0
|
13 |
*/
|
14 |
+
class WRIO_Plugin extends Wbcr_Factory425_Plugin {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @see self::app()
|
18 |
+
* @var Wbcr_Factory425_Plugin
|
19 |
+
*/
|
20 |
+
private static $app;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @since 3.1.0
|
24 |
+
* @var array
|
25 |
+
*/
|
26 |
+
private $plugin_data;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Конструктор
|
30 |
+
*
|
31 |
+
* Применяет конструктор родительского класса и записывает экземпляр текущего класса в свойство $app.
|
32 |
+
* Подробнее о свойстве $app см. self::app()
|
33 |
+
*
|
34 |
+
* @param string $plugin_path
|
35 |
+
* @param array $data
|
36 |
+
*
|
37 |
+
* @throws \Exception
|
38 |
+
*/
|
39 |
+
public function __construct( $plugin_path, $data ) {
|
40 |
+
parent::__construct( $plugin_path, $data );
|
41 |
+
|
42 |
+
self::$app = $this;
|
43 |
+
$this->plugin_data = $data;
|
44 |
+
|
45 |
+
$this->includes();
|
46 |
+
|
47 |
+
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
48 |
+
// Ajax files
|
49 |
+
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/backup.php' );
|
50 |
+
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/bulk-optimization.php' );
|
51 |
+
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/logs.php' );
|
52 |
+
// Not under AJAX logical operator above on purpose to have helpers available to find out whether
|
53 |
+
// metas were migrated or not
|
54 |
+
require_once( WRIO_PLUGIN_DIR . '/admin/ajax/meta-migrations.php' );
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( is_admin() ) {
|
58 |
+
$this->initActivation();
|
59 |
+
|
60 |
+
if ( wrio_is_license_activate() ) {
|
61 |
+
if ( ! defined( 'FACTORY_ADVERTS_BLOCK' ) ) {
|
62 |
+
define( 'FACTORY_ADVERTS_BLOCK', true );
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
add_action( 'plugins_loaded', [ $this, 'pluginsLoaded' ] );
|
68 |
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Статический метод для быстрого доступа к интерфейсу плагина.
|
72 |
+
*
|
73 |
+
* Позволяет разработчику глобально получить доступ к экземпляру класса плагина в любом месте
|
74 |
+
* плагина, но при этом разработчик не может вносить изменения в основной класс плагина.
|
75 |
+
*
|
76 |
+
* Используется для получения настроек плагина, информации о плагине, для доступа к вспомогательным
|
77 |
+
* классам.
|
78 |
+
*
|
79 |
+
* @return \Wbcr_Factory425_Plugin|\WRIO_Plugin
|
80 |
+
*/
|
81 |
+
public static function app() {
|
82 |
+
return self::$app;
|
83 |
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Подключаем функции бекенда
|
87 |
+
*
|
88 |
+
* @throws Exception
|
89 |
+
*/
|
90 |
+
public function pluginsLoaded() {
|
91 |
+
if ( is_admin() || wrio_doing_cron() || wrio_doing_rest_api() ) {
|
92 |
+
$media_library = WRIO_Media_Library::get_instance();
|
93 |
+
$media_library->initHooks();
|
94 |
+
}
|
95 |
+
|
96 |
+
if ( is_admin() ) {
|
97 |
+
require_once( WRIO_PLUGIN_DIR . '/admin/boot.php' );
|
98 |
+
//require_once( WRIO_PLUGIN_DIR . '/admin/includes/classes/class-rio-nextgen-landing.php' );
|
99 |
+
|
100 |
+
$this->registerPages();
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( wrio_doing_cron() || wrio_doing_rest_api() ) {
|
104 |
+
$media_library = WRIO_Media_Library::get_instance();
|
105 |
+
$media_library->initHooks();
|
106 |
+
}
|
107 |
+
|
108 |
+
if ( wrio_is_license_activate() ) {
|
109 |
+
require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' );
|
110 |
+
wrio_premium_load();
|
111 |
+
}
|
112 |
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Подключаем модули классы и функции
|
116 |
+
*/
|
117 |
+
protected function includes() {
|
118 |
+
|
119 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/functions.php' );
|
120 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-views.php' );
|
121 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-attachment.php' );
|
122 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-media-library.php' );
|
123 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-abstract.php' );
|
124 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-image-statistic.php' );
|
125 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-backup.php' );
|
126 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-optimization-tools.php' );
|
127 |
+
|
128 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-helper.php' );
|
129 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-object.php' ); // Base object
|
130 |
+
|
131 |
+
// Database related models
|
132 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-active-record.php' );
|
133 |
+
// Base class
|
134 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-base-extra-data.php' );
|
135 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-attachment-extra-data.php' );
|
136 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-server-smushit-extra-data.php' );
|
137 |
+
|
138 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/models/class-rio-process-queue-table.php' ); // Processing queue model
|
139 |
+
|
140 |
+
// Cron
|
141 |
+
// ----------------
|
142 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/class-rio-cron.php' );
|
143 |
+
new WRIO_Cron();
|
144 |
+
|
145 |
+
// Logger
|
146 |
+
// ----------------
|
147 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/logger/class-rio-logger.php' );
|
148 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/logger/class-rio-log-export.php' );
|
149 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/logger/class-rio-log-reader.php' );
|
150 |
+
new WRIO_Logger();
|
151 |
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Инициализируем активацию плагина
|
155 |
+
*/
|
156 |
+
protected function initActivation() {
|
157 |
+
include_once( WRIO_PLUGIN_DIR . '/admin/activation.php' );
|
158 |
+
self::app()->registerActivation( 'WIO_Activation' );
|
159 |
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Регистрируем страницы плагина
|
163 |
+
*
|
164 |
+
* @throws Exception
|
165 |
+
*/
|
166 |
+
private function registerPages() {
|
167 |
+
$admin_path = WRIO_PLUGIN_DIR . '/admin/pages/';
|
168 |
+
|
169 |
+
// Parent page class
|
170 |
+
require_once( $admin_path . '/class-rio-page.php' );
|
171 |
+
|
172 |
+
if ( ! wrio_is_clearfy_license_activate() ) {
|
173 |
+
self::app()->registerPage( 'WRIO_License_Page', $admin_path . '/class-rio-license.php' );
|
174 |
+
}
|
175 |
+
|
176 |
+
self::app()->registerPage( 'WRIO_SettingsPage', $admin_path . '/class-rio-settings.php' );
|
177 |
+
self::app()->registerPage( 'WRIO_StatisticPage', $admin_path . '/class-rio-statistic.php' );
|
178 |
+
|
179 |
+
if ( self::app()->getPopulateOption( 'error_log', false ) ) {
|
180 |
+
self::app()->registerPage( 'WRIO_LogPage', $admin_path . '/class-rio-log.php' );
|
181 |
+
}
|
182 |
}
|
183 |
}
|
|
|
184 |
|
includes/classes/class-rio-attachment.php
CHANGED
@@ -130,7 +130,7 @@ class WIO_Attachment {
|
|
130 |
return false;
|
131 |
}
|
132 |
|
133 |
-
$file_path =
|
134 |
}
|
135 |
|
136 |
if ( empty( $file_path ) || ! file_exists( $file_path ) ) {
|
130 |
return false;
|
131 |
}
|
132 |
|
133 |
+
$file_path = wrio_url_to_abs_path( $attachment->guid );
|
134 |
}
|
135 |
|
136 |
if ( empty( $file_path ) || ! file_exists( $file_path ) ) {
|
includes/classes/class-rio-optimization-tools.php
CHANGED
@@ -43,9 +43,13 @@ class WIO_OptimizationTools {
|
|
43 |
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-webcraftic.php' ); // webcraftic api
|
44 |
self::$image_processor = new WIO_Image_Processor_Webcraftic();
|
45 |
break;
|
46 |
-
case 'server_4':
|
47 |
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-clearfy1.php' ); // webcraftic api
|
48 |
self::$image_processor = new WIO_Image_Processor_Clearfy1();
|
|
|
|
|
|
|
|
|
49 |
break;
|
50 |
default:
|
51 |
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-resmush.php' ); // resmush api
|
43 |
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-webcraftic.php' ); // webcraftic api
|
44 |
self::$image_processor = new WIO_Image_Processor_Webcraftic();
|
45 |
break;
|
46 |
+
/*case 'server_4':
|
47 |
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-clearfy1.php' ); // webcraftic api
|
48 |
self::$image_processor = new WIO_Image_Processor_Clearfy1();
|
49 |
+
break;*/
|
50 |
+
case 'server_5':
|
51 |
+
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-premium.php' ); // webcraftic api
|
52 |
+
self::$image_processor = new WIO_Image_Processor_Premium();
|
53 |
break;
|
54 |
default:
|
55 |
require_once( WRIO_PLUGIN_DIR . '/includes/classes/processors/class-rio-server-resmush.php' ); // resmush api
|
includes/classes/class-rio-views.php
CHANGED
@@ -63,11 +63,11 @@ class WRIO_Views {
|
|
63 |
*
|
64 |
* @param string $template The template name.
|
65 |
* @param mixed $data Some data to pass to the template.
|
66 |
-
* @param
|
67 |
*
|
68 |
* @return bool|string The page contents. False if the template doesn't exist.
|
69 |
*/
|
70 |
-
public function get_template( $template, $data = [],
|
71 |
$template = str_replace( '_', '-', $template );
|
72 |
$path = $this->plugin_dir . '/views/' . $template . '.php';
|
73 |
|
@@ -92,9 +92,9 @@ class WRIO_Views {
|
|
92 |
*
|
93 |
* @param string $template The template name.
|
94 |
* @param mixed $data Some data to pass to the template.
|
95 |
-
* @param
|
96 |
*/
|
97 |
-
public function print_template( $template, $data = [],
|
98 |
echo $this->get_template( $template, $data, $page );
|
99 |
}
|
100 |
}
|
63 |
*
|
64 |
* @param string $template The template name.
|
65 |
* @param mixed $data Some data to pass to the template.
|
66 |
+
* @param Wbcr_FactoryClearfy217_PageBase $page
|
67 |
*
|
68 |
* @return bool|string The page contents. False if the template doesn't exist.
|
69 |
*/
|
70 |
+
public function get_template( $template, $data = [], Wbcr_FactoryClearfy217_PageBase $page = null ) {
|
71 |
$template = str_replace( '_', '-', $template );
|
72 |
$path = $this->plugin_dir . '/views/' . $template . '.php';
|
73 |
|
92 |
*
|
93 |
* @param string $template The template name.
|
94 |
* @param mixed $data Some data to pass to the template.
|
95 |
+
* @param Wbcr_FactoryClearfy217_PageBase $page
|
96 |
*/
|
97 |
+
public function print_template( $template, $data = [], Wbcr_FactoryClearfy217_PageBase $page = null ) {
|
98 |
echo $this->get_template( $template, $data, $page );
|
99 |
}
|
100 |
}
|
includes/classes/index.php
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
<?php
|
2 |
// silence is golden
|
|
1 |
<?php
|
2 |
// silence is golden
|
3 |
+
|
includes/classes/logger/class-rio-logger.php
CHANGED
@@ -346,13 +346,13 @@ class WRIO_Logger {
|
|
346 |
*/
|
347 |
public static function add( $level, $message ) {
|
348 |
|
349 |
-
if ( $level === self::LEVEL_DEBUG ) {
|
350 |
-
|
351 |
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
}
|
356 |
|
357 |
static::$_logs[] = static::get_format( $level, $message );
|
358 |
|
346 |
*/
|
347 |
public static function add( $level, $message ) {
|
348 |
|
349 |
+
//if ( $level === self::LEVEL_DEBUG ) {
|
350 |
+
//$log_debug = defined( 'WP_DEBUG' ) && WP_DEBUG;
|
351 |
|
352 |
+
//if ( ! $log_debug ) {
|
353 |
+
//return false;
|
354 |
+
//}
|
355 |
+
//}
|
356 |
|
357 |
static::$_logs[] = static::get_format( $level, $message );
|
358 |
|
includes/classes/processors/class-rio-server-premium.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Класс для оптимизации изображений через API сервиса Resmush.
|
9 |
+
*
|
10 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
11 |
+
* @copyright (c) 2018, Webcraftic
|
12 |
+
*/
|
13 |
+
class WIO_Image_Processor_Premium extends WIO_Image_Processor_Abstract {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
protected $api_url;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var string Имя сервера
|
22 |
+
*/
|
23 |
+
protected $server_name = 'server_5';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Инициализация
|
27 |
+
*
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
public function __construct() {
|
31 |
+
// Получаем ссылку на сервер 5
|
32 |
+
$this->api_url = wrio_get_server_url( $this->server_name );
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Оптимизация изображения
|
37 |
+
*
|
38 |
+
* @param array $params входные параметры оптимизации изображения
|
39 |
+
*
|
40 |
+
* @return array|WP_Error {
|
41 |
+
* Результаты оптимизации
|
42 |
+
*
|
43 |
+
* {type} string $optimized_img_url УРЛ оптимизированного изображения на сервере оптимизации
|
44 |
+
* {type} int $src_size размер исходного изображения в байтах
|
45 |
+
* {type} int $optimized_size размер оптимизированного изображения в байтах
|
46 |
+
* {type} int $optimized_percent На сколько процентов уменьшилось изображение
|
47 |
+
* }
|
48 |
+
*/
|
49 |
+
public function process( $settings ) {
|
50 |
+
|
51 |
+
$settings = wp_parse_args( $settings, [
|
52 |
+
'image_url' => '',
|
53 |
+
'quality' => 100,
|
54 |
+
'save_exif' => false,
|
55 |
+
] );
|
56 |
+
|
57 |
+
$query_args = [
|
58 |
+
'quality' => $settings['quality'],
|
59 |
+
'progressive' => true
|
60 |
+
];
|
61 |
+
|
62 |
+
if ( $settings['save_exif'] ) {
|
63 |
+
$query_args['strip-exif'] = true;
|
64 |
+
}
|
65 |
+
|
66 |
+
$file = wp_normalize_path( $settings['image_path'] );
|
67 |
+
|
68 |
+
if ( ! file_exists( $file ) ) {
|
69 |
+
return new WP_Error( 'http_request_failed', sprintf( "File %s isn't exists.", $file ) );
|
70 |
+
}
|
71 |
+
|
72 |
+
WRIO_Logger::info( sprintf( "Preparing to upload a file (%s) to a remote server (%s).", $settings['image_path'], $this->server_name ) );
|
73 |
+
|
74 |
+
$boundary = wp_generate_password( 24 ); // Just a random string, use something better than wp_generate_password() though.
|
75 |
+
$headers = [
|
76 |
+
'Authorization' => 'Bearer ' . base64_encode( wrio_get_license_key() ),
|
77 |
+
'PluginId' => wrio_get_freemius_plugin_id(),
|
78 |
+
'content-type' => 'multipart/form-data; boundary=' . $boundary
|
79 |
+
];
|
80 |
+
|
81 |
+
$payload = '';
|
82 |
+
|
83 |
+
// First, add the standard POST fields:
|
84 |
+
foreach ( $query_args as $name => $value ) {
|
85 |
+
$payload .= '--' . $boundary;
|
86 |
+
$payload .= "\r\n";
|
87 |
+
$payload .= 'Content-Disposition: form-data; name="' . $name . '"' . "\r\n\r\n";
|
88 |
+
$payload .= $value;
|
89 |
+
$payload .= "\r\n";
|
90 |
+
}
|
91 |
+
// Upload the file
|
92 |
+
if ( $file ) {
|
93 |
+
$payload .= '--' . $boundary;
|
94 |
+
$payload .= "\r\n";
|
95 |
+
$payload .= 'Content-Disposition: form-data; name="file"; filename="' . basename( $file ) . '"' . "\r\n";
|
96 |
+
//$payload .= 'Content-Type: image/jpeg' . "\r\n"; // If you know the mime-type
|
97 |
+
$payload .= "\r\n";
|
98 |
+
$payload .= @file_get_contents( $file );
|
99 |
+
$payload .= "\r\n";
|
100 |
+
}
|
101 |
+
|
102 |
+
$payload .= '--' . $boundary . '--';
|
103 |
+
|
104 |
+
$error_message = sprintf( 'Failed to get content of URL: %s as wp_remote_request()', $this->api_url );
|
105 |
+
|
106 |
+
wp_raise_memory_limit( 'image' );
|
107 |
+
|
108 |
+
$response = wp_remote_request( $this->api_url, [
|
109 |
+
'method' => 'POST',
|
110 |
+
'headers' => $headers,
|
111 |
+
'body' => $payload,
|
112 |
+
'timeout' => 150 // it make take some time for large images and slow Internet connections
|
113 |
+
] );
|
114 |
+
|
115 |
+
if ( is_wp_error( $response ) ) {
|
116 |
+
WRIO_Logger::error( sprintf( '%s returned error (%s).', $error_message, $response->get_error_message() ) );
|
117 |
+
|
118 |
+
return $response;
|
119 |
+
}
|
120 |
+
|
121 |
+
$response_code = wp_remote_retrieve_response_code($response);
|
122 |
+
if ($response_code !== 200) {
|
123 |
+
WRIO_Logger::error(sprintf('%s, responded Http error (%s)', $error_message, $response_code));
|
124 |
+
|
125 |
+
return new WP_Error('http_request_failed', sprintf("Server responded an HTTP error %s", $response_code));
|
126 |
+
}
|
127 |
+
|
128 |
+
$response_text = wp_remote_retrieve_body($response);
|
129 |
+
$data = @json_decode($response_text);
|
130 |
+
if (!isset($data->status)) {
|
131 |
+
WRIO_Logger::error(sprintf('%s responded an empty request body.', $error_message));
|
132 |
+
|
133 |
+
return new WP_Error('http_request_failed', "Server responded an empty request body.");
|
134 |
+
}
|
135 |
+
|
136 |
+
if ($data->status != 'ok') {
|
137 |
+
WRIO_Logger::error(sprintf("Pending status \"ok\", bot received \"%s\"", $data->status));
|
138 |
+
|
139 |
+
return new WP_Error('http_request_failed', sprintf("Server responded an %s status", $response_code));
|
140 |
+
}
|
141 |
+
|
142 |
+
WRIO_Plugin::app()->updateOption('current_quota', (int) $data->response->quota);
|
143 |
+
|
144 |
+
return [
|
145 |
+
'optimized_img_url' => $data->response->dest,
|
146 |
+
'src_size' => $data->response->src_size,
|
147 |
+
'optimized_size' => $data->response->dest_size,
|
148 |
+
'optimized_percent' => $data->response->percent,
|
149 |
+
'not_need_download' => false
|
150 |
+
];
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Качество изображения
|
155 |
+
* Метод конвертирует качество из настроек плагина в формат сервиса resmush
|
156 |
+
*
|
157 |
+
* @param mixed $quality качество
|
158 |
+
*
|
159 |
+
* @return int
|
160 |
+
*/
|
161 |
+
public function quality( $quality = 100 ) {
|
162 |
+
if ( is_numeric( $quality ) ) {
|
163 |
+
if ( $quality >= 1 && $quality <= 100 ) {
|
164 |
+
return $quality;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
if ( $quality == 'normal' ) {
|
168 |
+
return 90;
|
169 |
+
}
|
170 |
+
if ( $quality == 'aggresive' ) {
|
171 |
+
return 75;
|
172 |
+
}
|
173 |
+
if ( $quality == 'ultra' ) {
|
174 |
+
return 50;
|
175 |
+
}
|
176 |
+
|
177 |
+
return 100;
|
178 |
+
}
|
179 |
+
}
|
includes/functions.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
/**
|
4 |
* Checks if the current request is a WP REST API request.
|
5 |
*
|
@@ -29,9 +31,9 @@ function wrio_doing_rest_api() {
|
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
33 |
-
* @since 1.3.6
|
34 |
* @return bool
|
|
|
|
|
35 |
*/
|
36 |
function wrio_doing_ajax() {
|
37 |
if ( function_exists( 'wp_doing_ajax' ) ) {
|
@@ -42,9 +44,9 @@ function wrio_doing_ajax() {
|
|
42 |
}
|
43 |
|
44 |
/**
|
45 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
46 |
-
* @since 1.3.6
|
47 |
* @return bool
|
|
|
|
|
48 |
*/
|
49 |
function wrio_doing_cron() {
|
50 |
if ( function_exists( 'wp_doing_cron' ) ) {
|
@@ -57,14 +59,14 @@ function wrio_doing_cron() {
|
|
57 |
/**
|
58 |
* Convert full URL paths to absolute paths.
|
59 |
*
|
60 |
-
* @
|
61 |
-
* @since 1.1
|
62 |
*
|
63 |
-
* @
|
|
|
|
|
64 |
*
|
65 |
-
* @return string|null
|
66 |
*/
|
67 |
-
function
|
68 |
if ( empty( $url ) ) {
|
69 |
return null;
|
70 |
}
|
@@ -84,13 +86,45 @@ function wrio_convert_url_to_abs_path( $url ) {
|
|
84 |
}
|
85 |
|
86 |
/**
|
|
|
|
|
|
|
|
|
|
|
87 |
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
88 |
-
* @since 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
* @param $string
|
91 |
* @param bool $capitalize_first_character
|
92 |
*
|
93 |
* @return mixed|string
|
|
|
|
|
|
|
94 |
*/
|
95 |
function wrio_dashes_to_camel_case( $string, $capitalize_first_character = false ) {
|
96 |
|
@@ -106,33 +140,33 @@ function wrio_dashes_to_camel_case( $string, $capitalize_first_character = false
|
|
106 |
/**
|
107 |
* Alternative php functions basename. Our function works with сyrillic file names.
|
108 |
*
|
|
|
|
|
|
|
109 |
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
110 |
* @since 1.3.0
|
111 |
*
|
112 |
-
* @param string $str file path
|
113 |
-
*
|
114 |
-
* @return string|string[]|null
|
115 |
*/
|
116 |
/*function wrio_basename( $str ) {
|
117 |
return preg_replace( '/^.+[\\\\\\/]/', '', $str );
|
118 |
}*/
|
119 |
|
120 |
/**
|
121 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
122 |
-
* @since 1.3.0
|
123 |
* @return bool
|
|
|
|
|
124 |
*/
|
125 |
function wrio_is_active_nextgen_gallery() {
|
126 |
return is_plugin_active( 'nextgen-gallery/nggallery.php' );
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
131 |
-
* @since 1.1
|
132 |
-
*
|
133 |
* @param string $dir
|
134 |
*
|
135 |
* @return bool
|
|
|
|
|
|
|
136 |
*/
|
137 |
function wrio_rmdir( $dir ) {
|
138 |
if ( is_dir( $dir ) ) {
|
@@ -166,7 +200,7 @@ function wrio_rmdir( $dir ) {
|
|
166 |
* Пример: вводим 67894 байт, получаем 67.8 KB
|
167 |
* Пример: вводим 6789477 байт, получаем 6.7 MB
|
168 |
*
|
169 |
-
* @param int $size
|
170 |
*
|
171 |
* @return string
|
172 |
*/
|
@@ -203,9 +237,9 @@ function wrio_generate_random_string( $length = 10 ) {
|
|
203 |
* Checks whether the license is activated for the plugin or not. If the Clearfy plugin is installed
|
204 |
* in priorities checks its license.
|
205 |
*
|
206 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
207 |
-
* @since 1.3.0
|
208 |
* @return bool
|
|
|
|
|
209 |
*/
|
210 |
function wrio_is_license_activate() {
|
211 |
return wrio_is_clearfy_license_activate() || WRIO_Plugin::app()->premium->is_activate();
|
@@ -214,19 +248,27 @@ function wrio_is_license_activate() {
|
|
214 |
/**
|
215 |
* Checks whether the license is activated for Clearfy plugin.
|
216 |
*
|
217 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
218 |
-
* @since 1.3.0
|
219 |
* @return bool
|
|
|
|
|
220 |
*/
|
221 |
function wrio_is_clearfy_license_activate() {
|
222 |
if ( class_exists( 'WCL_Plugin' ) ) {
|
223 |
-
|
|
|
|
|
224 |
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
228 |
|
229 |
-
|
|
|
|
|
|
|
230 |
}
|
231 |
|
232 |
return false;
|
@@ -236,13 +278,17 @@ function wrio_is_clearfy_license_activate() {
|
|
236 |
* Checks active (not expired!) License for plugin or not. If the Clearfy plugin is installed
|
237 |
* checks its license in priorities.
|
238 |
*
|
239 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
240 |
-
* @since 1.3.0
|
241 |
* @return bool
|
|
|
|
|
242 |
*/
|
243 |
function wrio_is_license_active() {
|
244 |
if ( wrio_is_clearfy_license_activate() ) {
|
245 |
-
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
|
248 |
return WRIO_Plugin::app()->premium->is_activate() && WRIO_Plugin::app()->premium->is_active();
|
@@ -252,9 +298,9 @@ function wrio_is_license_active() {
|
|
252 |
* Allows you to get a license key. If the Clearfy plugin is installed, it will be prioritized
|
253 |
* return it key.
|
254 |
*
|
255 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
256 |
-
* @since 1.3.0
|
257 |
* @return string|null
|
|
|
|
|
258 |
*/
|
259 |
function wrio_get_license_key() {
|
260 |
if ( ! wrio_is_license_activate() ) {
|
@@ -262,16 +308,20 @@ function wrio_get_license_key() {
|
|
262 |
}
|
263 |
|
264 |
if ( wrio_is_clearfy_license_activate() ) {
|
265 |
-
|
|
|
|
|
|
|
|
|
266 |
}
|
267 |
|
268 |
return WRIO_Plugin::app()->premium->get_license()->get_key();
|
269 |
}
|
270 |
|
271 |
/**
|
272 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
273 |
-
* @since 1.3.0
|
274 |
* @return number|null
|
|
|
|
|
275 |
*/
|
276 |
function wrio_get_freemius_plugin_id() {
|
277 |
if ( wrio_is_clearfy_license_activate() ) {
|
@@ -313,17 +363,18 @@ function wrio_get_image_sizes() {
|
|
313 |
/**
|
314 |
* Возвращает URL сервера оптимизации
|
315 |
*
|
316 |
-
* @
|
317 |
-
*
|
318 |
-
* @param string $server_name имя сервера
|
319 |
*
|
320 |
* @return string
|
|
|
|
|
321 |
*/
|
322 |
function wrio_get_server_url( $server_name ) {
|
323 |
|
324 |
$use_http = WRIO_Plugin::app()->getPopulateOption( 'use_http' );
|
325 |
|
326 |
$servers = [
|
|
|
327 |
'server_4' => 'https://clearfy.pro/oimg.php',
|
328 |
'server_2' => $api_url = ( $use_http ? 'http://' : 'https://' ) . 'smushpro.wpmudev.org/1.0/',
|
329 |
'server_1' => 'http://api.resmush.it/ws.php',
|
@@ -342,10 +393,10 @@ function wrio_get_server_url( $server_name ) {
|
|
342 |
/**
|
343 |
* Check whether there are some migrations left to be processed.
|
344 |
*
|
345 |
-
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
346 |
-
* @since 1.3.0
|
347 |
* @return bool
|
348 |
* @throws Exception
|
|
|
|
|
349 |
*/
|
350 |
function wbcr_rio_has_meta_to_migrate() {
|
351 |
|
@@ -372,12 +423,12 @@ function wbcr_rio_has_meta_to_migrate() {
|
|
372 |
/**
|
373 |
* Get list of meta to migrate.
|
374 |
*
|
|
|
|
|
|
|
375 |
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
376 |
* @since 1.3.0
|
377 |
*
|
378 |
-
* @param int $limit Attachment limit per page.
|
379 |
-
*
|
380 |
-
* @return WP_Query
|
381 |
*/
|
382 |
function wbcr_rio_get_meta_to_migrate( $limit = 0 ) {
|
383 |
$args = [
|
@@ -401,9 +452,9 @@ function wbcr_rio_get_meta_to_migrate( $limit = 0 ) {
|
|
401 |
}
|
402 |
|
403 |
/**
|
404 |
-
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
405 |
-
* @since 1.3.0
|
406 |
* @return string
|
|
|
|
|
407 |
*/
|
408 |
function wrio_get_meta_migration_notice_text() {
|
409 |
$nonce = wp_create_nonce( 'wrio-meta-migrations' );
|
1 |
<?php
|
2 |
|
3 |
+
use WRIO\Paths\phpUri;
|
4 |
+
|
5 |
/**
|
6 |
* Checks if the current request is a WP REST API request.
|
7 |
*
|
31 |
}
|
32 |
|
33 |
/**
|
|
|
|
|
34 |
* @return bool
|
35 |
+
* @since 1.3.6
|
36 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
37 |
*/
|
38 |
function wrio_doing_ajax() {
|
39 |
if ( function_exists( 'wp_doing_ajax' ) ) {
|
44 |
}
|
45 |
|
46 |
/**
|
|
|
|
|
47 |
* @return bool
|
48 |
+
* @since 1.3.6
|
49 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
50 |
*/
|
51 |
function wrio_doing_cron() {
|
52 |
if ( function_exists( 'wp_doing_cron' ) ) {
|
59 |
/**
|
60 |
* Convert full URL paths to absolute paths.
|
61 |
*
|
62 |
+
* @param string $url abs url https://site.com/wp-conent/uploads/10/05/image.jpeg
|
|
|
63 |
*
|
64 |
+
* @return string|null abs path var/site.com/www/wp-conent/uploads/10/05/image.jpeg, if failure null
|
65 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
66 |
+
* @since 1.4.0
|
67 |
*
|
|
|
68 |
*/
|
69 |
+
function wrio_url_to_abs_path( $url ) {
|
70 |
if ( empty( $url ) ) {
|
71 |
return null;
|
72 |
}
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
+
* Convert relative urls to absolute
|
90 |
+
*
|
91 |
+
* @param string $url relative url /wp-conent/uploads/10/05/image.jpeg
|
92 |
+
*
|
93 |
+
* @return string abs url https://site.com/wp-conent/uploads/10/05/image.jpeg
|
94 |
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
95 |
+
* @since 1.4.0
|
96 |
+
*
|
97 |
+
*/
|
98 |
+
function wrio_rel_to_abs_url( $url ) {
|
99 |
+
require_once WRIO_PLUGIN_DIR . '/libs/class-rio-relative-to-abs-uri.php';
|
100 |
+
|
101 |
+
return WRIO\Paths\phpUri::parse( get_site_url() )->join( $url );
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Converts relative urls to absolute paths
|
106 |
+
*
|
107 |
+
* @param string $url relative url /wp-conent/uploads/10/05/image.jpeg
|
108 |
*
|
109 |
+
* @return string abs path var/site.com/www/wp-conent/uploads/10/05/image.jpeg
|
110 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
111 |
+
* @since 1.4.0
|
112 |
+
*
|
113 |
+
*/
|
114 |
+
function wrio_rel_url_to_abs_path( $url ) {
|
115 |
+
$abs_url = wrio_rel_to_abs_url( $url );
|
116 |
+
|
117 |
+
return wrio_url_to_abs_path( $abs_url );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
* @param $string
|
122 |
* @param bool $capitalize_first_character
|
123 |
*
|
124 |
* @return mixed|string
|
125 |
+
* @since 1.1
|
126 |
+
*
|
127 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
128 |
*/
|
129 |
function wrio_dashes_to_camel_case( $string, $capitalize_first_character = false ) {
|
130 |
|
140 |
/**
|
141 |
* Alternative php functions basename. Our function works with сyrillic file names.
|
142 |
*
|
143 |
+
* @param string $str file path
|
144 |
+
*
|
145 |
+
* @return string|string[]|null
|
146 |
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
147 |
* @since 1.3.0
|
148 |
*
|
|
|
|
|
|
|
149 |
*/
|
150 |
/*function wrio_basename( $str ) {
|
151 |
return preg_replace( '/^.+[\\\\\\/]/', '', $str );
|
152 |
}*/
|
153 |
|
154 |
/**
|
|
|
|
|
155 |
* @return bool
|
156 |
+
* @since 1.3.0
|
157 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
158 |
*/
|
159 |
function wrio_is_active_nextgen_gallery() {
|
160 |
return is_plugin_active( 'nextgen-gallery/nggallery.php' );
|
161 |
}
|
162 |
|
163 |
/**
|
|
|
|
|
|
|
164 |
* @param string $dir
|
165 |
*
|
166 |
* @return bool
|
167 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
168 |
+
* @since 1.1
|
169 |
+
*
|
170 |
*/
|
171 |
function wrio_rmdir( $dir ) {
|
172 |
if ( is_dir( $dir ) ) {
|
200 |
* Пример: вводим 67894 байт, получаем 67.8 KB
|
201 |
* Пример: вводим 6789477 байт, получаем 6.7 MB
|
202 |
*
|
203 |
+
* @param int $size размер файла в байтах
|
204 |
*
|
205 |
* @return string
|
206 |
*/
|
237 |
* Checks whether the license is activated for the plugin or not. If the Clearfy plugin is installed
|
238 |
* in priorities checks its license.
|
239 |
*
|
|
|
|
|
240 |
* @return bool
|
241 |
+
* @since 1.3.0
|
242 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
243 |
*/
|
244 |
function wrio_is_license_activate() {
|
245 |
return wrio_is_clearfy_license_activate() || WRIO_Plugin::app()->premium->is_activate();
|
248 |
/**
|
249 |
* Checks whether the license is activated for Clearfy plugin.
|
250 |
*
|
|
|
|
|
251 |
* @return bool
|
252 |
+
* @since 1.3.0
|
253 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
254 |
*/
|
255 |
function wrio_is_clearfy_license_activate() {
|
256 |
if ( class_exists( 'WCL_Plugin' ) ) {
|
257 |
+
if ( version_compare( WCL_PLUGIN_VERSION, '1.6.3', '>=' ) ) {
|
258 |
+
if ( WCL_Plugin::app()->premium->is_activate() ) {
|
259 |
+
$plan_id = WCL_Plugin::app()->premium->get_license()->get_plan_id();
|
260 |
|
261 |
+
// Old plans for the Clearfy plugin allowed the use the Robin Premium plugin under one license.
|
262 |
+
// Now for new plans this doesn't work.
|
263 |
+
return "4710" === $plan_id || "3530" === $plan_id;
|
264 |
+
}
|
265 |
+
} else {
|
266 |
+
$current_license = WCL_Licensing::instance()->getStorage()->getLicense();
|
267 |
|
268 |
+
if ( ! empty( $current_license ) && ! empty( $current_license->id ) ) {
|
269 |
+
return true;
|
270 |
+
}
|
271 |
+
}
|
272 |
}
|
273 |
|
274 |
return false;
|
278 |
* Checks active (not expired!) License for plugin or not. If the Clearfy plugin is installed
|
279 |
* checks its license in priorities.
|
280 |
*
|
|
|
|
|
281 |
* @return bool
|
282 |
+
* @since 1.3.0
|
283 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
284 |
*/
|
285 |
function wrio_is_license_active() {
|
286 |
if ( wrio_is_clearfy_license_activate() ) {
|
287 |
+
if ( version_compare( WCL_PLUGIN_VERSION, '1.6.3', '>=' ) ) {
|
288 |
+
return WCL_Plugin::app()->premium->is_active();
|
289 |
+
} else {
|
290 |
+
return WCL_Licensing::instance()->isLicenseValid();
|
291 |
+
}
|
292 |
}
|
293 |
|
294 |
return WRIO_Plugin::app()->premium->is_activate() && WRIO_Plugin::app()->premium->is_active();
|
298 |
* Allows you to get a license key. If the Clearfy plugin is installed, it will be prioritized
|
299 |
* return it key.
|
300 |
*
|
|
|
|
|
301 |
* @return string|null
|
302 |
+
* @since 1.3.0
|
303 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
304 |
*/
|
305 |
function wrio_get_license_key() {
|
306 |
if ( ! wrio_is_license_activate() ) {
|
308 |
}
|
309 |
|
310 |
if ( wrio_is_clearfy_license_activate() ) {
|
311 |
+
if ( version_compare( WCL_PLUGIN_VERSION, '1.6.3', '>=' ) ) {
|
312 |
+
return WCL_Plugin::app()->premium->get_license()->get_key();
|
313 |
+
} else {
|
314 |
+
return WCL_Licensing::instance()->getStorage()->getLicense()->secret_key;
|
315 |
+
}
|
316 |
}
|
317 |
|
318 |
return WRIO_Plugin::app()->premium->get_license()->get_key();
|
319 |
}
|
320 |
|
321 |
/**
|
|
|
|
|
322 |
* @return number|null
|
323 |
+
* @since 1.3.0
|
324 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
325 |
*/
|
326 |
function wrio_get_freemius_plugin_id() {
|
327 |
if ( wrio_is_clearfy_license_activate() ) {
|
363 |
/**
|
364 |
* Возвращает URL сервера оптимизации
|
365 |
*
|
366 |
+
* @param string $server_name имя сервера
|
|
|
|
|
367 |
*
|
368 |
* @return string
|
369 |
+
* @since 1.2.0
|
370 |
+
*
|
371 |
*/
|
372 |
function wrio_get_server_url( $server_name ) {
|
373 |
|
374 |
$use_http = WRIO_Plugin::app()->getPopulateOption( 'use_http' );
|
375 |
|
376 |
$servers = [
|
377 |
+
'server_5' => 'https://dashboard.robinoptimizer.com/v1/tariff/optimize',
|
378 |
'server_4' => 'https://clearfy.pro/oimg.php',
|
379 |
'server_2' => $api_url = ( $use_http ? 'http://' : 'https://' ) . 'smushpro.wpmudev.org/1.0/',
|
380 |
'server_1' => 'http://api.resmush.it/ws.php',
|
393 |
/**
|
394 |
* Check whether there are some migrations left to be processed.
|
395 |
*
|
|
|
|
|
396 |
* @return bool
|
397 |
* @throws Exception
|
398 |
+
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
399 |
+
* @since 1.3.0
|
400 |
*/
|
401 |
function wbcr_rio_has_meta_to_migrate() {
|
402 |
|
423 |
/**
|
424 |
* Get list of meta to migrate.
|
425 |
*
|
426 |
+
* @param int $limit Attachment limit per page.
|
427 |
+
*
|
428 |
+
* @return WP_Query
|
429 |
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
430 |
* @since 1.3.0
|
431 |
*
|
|
|
|
|
|
|
432 |
*/
|
433 |
function wbcr_rio_get_meta_to_migrate( $limit = 0 ) {
|
434 |
$args = [
|
452 |
}
|
453 |
|
454 |
/**
|
|
|
|
|
455 |
* @return string
|
456 |
+
* @since 1.3.0
|
457 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
458 |
*/
|
459 |
function wrio_get_meta_migration_notice_text() {
|
460 |
$nonce = wp_create_nonce( 'wrio-meta-migrations' );
|
libs/addons/admin/assets/js/custom-folders.js
CHANGED
@@ -86,10 +86,10 @@
|
|
86 |
if( response.data && response.data.error_message ) {
|
87 |
// todo: так как фреймворк не используется в аддоне, нужно доработать этот кусок кода. Он не
|
88 |
// может быть скомпилирован.
|
89 |
-
var noticeId = $.
|
90 |
|
91 |
setTimeout(function() {
|
92 |
-
$.
|
93 |
}, 5000);
|
94 |
}
|
95 |
return;
|
@@ -150,10 +150,10 @@
|
|
150 |
if( response.data && response.data.error_message ) {
|
151 |
// todo: так как фреймворк не используется в аддоне, нужно доработать этот кусок кода. Он не
|
152 |
// может быть скомпилирован.
|
153 |
-
var noticeId = $.
|
154 |
|
155 |
setTimeout(function() {
|
156 |
-
$.
|
157 |
}, 5000);
|
158 |
}
|
159 |
return;
|
86 |
if( response.data && response.data.error_message ) {
|
87 |
// todo: так как фреймворк не используется в аддоне, нужно доработать этот кусок кода. Он не
|
88 |
// может быть скомпилирован.
|
89 |
+
var noticeId = $.wbcr_factory_clearfy_217.app.showNotice(response.data.error_message, 'danger');
|
90 |
|
91 |
setTimeout(function() {
|
92 |
+
$.wbcr_factory_clearfy_217.app.hideNotice(noticeId);
|
93 |
}, 5000);
|
94 |
}
|
95 |
return;
|
150 |
if( response.data && response.data.error_message ) {
|
151 |
// todo: так как фреймворк не используется в аддоне, нужно доработать этот кусок кода. Он не
|
152 |
// может быть скомпилирован.
|
153 |
+
var noticeId = $.wbcr_factory_clearfy_217.app.showNotice(response.data.error_message, 'danger');
|
154 |
|
155 |
setTimeout(function() {
|
156 |
+
$.wbcr_factory_clearfy_217.app.hideNotice(noticeId);
|
157 |
}, 5000);
|
158 |
}
|
159 |
return;
|
libs/addons/admin/boot.php
CHANGED
@@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
20 |
* Flush configuration after saving the settings
|
21 |
*
|
22 |
* @param WHM_Plugin $plugin
|
23 |
-
* @param
|
24 |
*
|
25 |
* @return bool
|
26 |
*/
|
20 |
* Flush configuration after saving the settings
|
21 |
*
|
22 |
* @param WHM_Plugin $plugin
|
23 |
+
* @param Wbcr_FactoryPages425_ImpressiveThemplate $page
|
24 |
*
|
25 |
* @return bool
|
26 |
*/
|
libs/addons/includes/classes/webp/class-webp-api.php
CHANGED
@@ -1,339 +1,341 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class WRIO_WebP_Api processing images from processing queue, sends them to API and saves locally.
|
5 |
-
*
|
6 |
-
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
7 |
-
*/
|
8 |
-
class WRIO_WebP_Api {
|
9 |
-
|
10 |
/**
|
11 |
-
*
|
12 |
-
*/
|
13 |
-
private $_api_url = 'http://142.93.91.206/';
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @var int|null Attachment ID.
|
17 |
-
*/
|
18 |
-
private $_models = null;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var null|int UNIX epoch when last request was processed.
|
22 |
-
*/
|
23 |
-
private $_last_request_tick = null;
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
* WRIO_WebP_Api constructor.
|
28 |
*
|
29 |
-
* @
|
30 |
*/
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
/**
|
48 |
* @var RIOP_WebP_Extra_Data $extra_data
|
49 |
*/
|
50 |
$extra_data = $model->get_extra_data();
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
-
|
56 |
-
$
|
57 |
-
|
58 |
-
if (
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
$this->_last_request_tick = time();
|
77 |
-
} else {
|
78 |
-
if ( is_int( $this->_last_request_tick ) && ( time() - $this->_last_request_tick ) < 1 ) {
|
79 |
-
// Need to have some rest before calling REST :D to comply with API request limit
|
80 |
-
sleep( 2 );
|
81 |
}
|
82 |
-
|
83 |
-
$this->_last_request_tick = time();
|
84 |
-
}
|
85 |
-
|
86 |
-
if ( ! wrio_is_license_activate() ) {
|
87 |
-
WRIO_Logger::error( "Unable to get license to make proper request to the API" );
|
88 |
-
|
89 |
-
return false;
|
90 |
-
}
|
91 |
-
|
92 |
-
$transient_string = md5( WRIO_Plugin::app()->getPrefix() . '_processing_image' . $model->get_item_hash() );
|
93 |
-
|
94 |
-
$transient_value = get_transient( $transient_string );
|
95 |
-
|
96 |
-
if ( is_numeric( $transient_value ) && (int) $transient_value === 1 ) {
|
97 |
-
WRIO_Logger::info( sprintf( 'Skipping to wp_remote_get() as transient "%s" already exist. Usually it means that no request was returned yet', $transient_string ) );
|
98 |
-
|
99 |
return false;
|
100 |
}
|
101 |
-
|
102 |
-
set_transient( $transient_string, 1 );
|
103 |
-
|
104 |
-
$url = $this->_api_url . 'v1/image/convert?';
|
105 |
-
|
106 |
-
$url .= http_build_query( [ 'format' => 'webp' ] );
|
107 |
-
|
108 |
/**
|
109 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
*/
|
111 |
-
$
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
'Authorization' => 'Bearer ' . base64_encode( wrio_get_license_key() ),
|
124 |
-
'PluginId' => wrio_get_freemius_plugin_id(),
|
125 |
-
'Content-Type' => 'multipart/form-data; boundary=' . $multipartBoundary,
|
126 |
-
];
|
127 |
-
|
128 |
-
$response = wp_remote_post( $url, [
|
129 |
-
'timeout' => 60,
|
130 |
-
'headers' => $headers,
|
131 |
-
'body' => $body,
|
132 |
-
] );
|
133 |
-
|
134 |
-
delete_transient( $transient_string );
|
135 |
-
|
136 |
-
return $response;
|
137 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* Process response from API.
|
141 |
-
*
|
142 |
-
* @param array|WP_Error|false $response
|
143 |
-
*
|
144 |
-
* @return bool True means response image was successfully saved, false on failure.
|
145 |
-
*/
|
146 |
-
public function can_save( $response ) {
|
147 |
-
\WRIO_Logger::info( 'WebP convertation: Checks to save a webp by response.' );
|
148 |
-
//\WRIO_Logger::debug( var_export( $response, true ) );
|
149 |
-
|
150 |
-
if ( is_wp_error( $response ) ) {
|
151 |
-
WRIO_Logger::error( sprintf( 'Error response from API. Code: %s, error: %s', $response->get_error_code(), $response->get_error_message() ) );
|
152 |
-
|
153 |
-
return false;
|
154 |
-
}
|
155 |
-
|
156 |
-
if ( false === $response ) {
|
157 |
-
WRIO_Logger::error( 'Unknown response returned from API or it was not requested, failing to process response' );
|
158 |
-
|
159 |
-
return false;
|
160 |
-
}
|
161 |
-
|
162 |
-
$content_disposition = wp_remote_retrieve_header( $response, 'content-disposition' );
|
163 |
-
|
164 |
-
if ( 0 === strpos( $content_disposition, 'attachment;' ) ) {
|
165 |
-
|
166 |
$body = wp_remote_retrieve_body( $response );
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
return false;
|
172 |
}
|
173 |
-
|
174 |
-
\WRIO_Logger::info( 'WebP convertation: Image
|
175 |
-
|
176 |
return true;
|
177 |
}
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
|
|
|
|
192 |
}
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
/**
|
199 |
-
* Save file from response.
|
200 |
-
*
|
201 |
-
* It is assumed that it was checked by can_save() method.
|
202 |
-
*
|
203 |
-
* @param array|WP_Error|false $response
|
204 |
-
* @param RIO_Process_Queue $queue_model
|
205 |
-
*
|
206 |
-
* @return bool
|
207 |
-
* @see can_save() for further information.
|
208 |
-
*
|
209 |
-
*/
|
210 |
-
public function save_file( $response, $queue_model ) {
|
211 |
-
|
212 |
-
try {
|
213 |
-
$save_path = static::get_save_path( $queue_model );
|
214 |
-
} catch( \Exception $exception ) {
|
215 |
-
WRIO_Logger::error( sprintf( 'Unable to process response failed to get save path: "%s"', $exception->getMessage() ) );
|
216 |
-
|
217 |
-
return false;
|
218 |
-
}
|
219 |
-
|
220 |
-
\WRIO_Logger::info( sprintf( 'WebP convertation: Try to save webp image in %s.', $save_path ) );
|
221 |
-
|
222 |
-
$body = wp_remote_retrieve_body( $response );
|
223 |
-
|
224 |
-
$file_saved = @file_put_contents( $save_path, $body );
|
225 |
-
|
226 |
-
if ( ! $file_saved ) {
|
227 |
/**
|
228 |
-
* @var $
|
229 |
*/
|
230 |
-
$
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
*/
|
248 |
-
public function update( $queue_model ) {
|
249 |
-
|
250 |
-
try {
|
251 |
-
$save_path = static::get_save_path( $queue_model );
|
252 |
-
} catch( \Exception $exception ) {
|
253 |
-
WRIO_Logger::error( sprintf( 'Unable to update queue model #%s as of exception: %s', $queue_model->get_id(), $exception->getMessage() ) );
|
254 |
-
|
255 |
-
return false;
|
256 |
}
|
257 |
-
|
258 |
-
$queue_model->result_status = RIO_Process_Queue::STATUS_SUCCESS;
|
259 |
-
$queue_model->final_size = filesize( $save_path );
|
260 |
-
|
261 |
-
/**
|
262 |
-
* @var RIOP_WebP_Extra_Data $updated_extra_data
|
263 |
-
*/
|
264 |
-
$updated_extra_data = $queue_model->get_extra_data();
|
265 |
-
$updated_extra_data->set_converted_src( $this->get_save_url( $queue_model ) );
|
266 |
-
$updated_extra_data->set_converted_path( $save_path );
|
267 |
-
|
268 |
-
$queue_model->extra_data = $updated_extra_data;
|
269 |
-
|
270 |
/**
|
271 |
-
*
|
272 |
*
|
273 |
-
* @
|
274 |
*
|
275 |
-
* @
|
276 |
-
*
|
277 |
-
*/
|
278 |
-
do_action( 'wbcr/rio/webp_success', $queue_model );
|
279 |
-
|
280 |
-
return $queue_model->save();
|
281 |
-
}
|
282 |
-
|
283 |
-
/**
|
284 |
-
* Get complete save url.
|
285 |
-
*
|
286 |
-
* @param RIO_Process_Queue $queue_model Instance of queue item.
|
287 |
-
*
|
288 |
-
* @return string
|
289 |
-
*/
|
290 |
-
public function get_save_url( $queue_model ) {
|
291 |
-
/**
|
292 |
-
* @var $extra_data RIOP_WebP_Extra_Data
|
293 |
*/
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
}
|
301 |
-
|
302 |
-
$origin_file_name = wp_basename( $extra_data->get_source_src() );
|
303 |
-
$webp_file_name = trim( wp_basename( $extra_data->get_source_path() ) ) . '.webp';
|
304 |
-
|
305 |
-
return str_replace( $origin_file_name, $webp_file_name, $extra_data->get_source_src() );
|
306 |
-
}
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Get absolute save path.
|
310 |
-
*
|
311 |
-
* @param \RIO_Process_Queue $queue_model
|
312 |
-
*
|
313 |
-
* @return bool
|
314 |
-
* @throws Exception on failure to create missing directory
|
315 |
-
*/
|
316 |
-
public static function get_save_path( $queue_model ) {
|
317 |
/**
|
318 |
-
*
|
|
|
|
|
|
|
|
|
|
|
319 |
*/
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
$
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
}
|
336 |
-
|
337 |
-
return trailingslashit( $path ) . trim( wp_basename( $extra_data->get_source_path() ) ) . '.webp';
|
338 |
}
|
339 |
-
}
|
1 |
<?php
|
2 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/**
|
4 |
+
* Class WRIO_WebP_Api processing images from processing queue, sends them to API and saves locally.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
*
|
6 |
+
* @author Alexander Teshabaev <sasha.tesh@gmail.com>
|
7 |
*/
|
8 |
+
class WRIO_WebP_Api {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* @var string API url.
|
12 |
+
*/
|
13 |
+
//private $_api_url = 'http://142.93.91.206/';
|
14 |
+
private $_api_url = 'https://dashboard.robinoptimizer.com/';
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var int|null Attachment ID.
|
19 |
+
*/
|
20 |
+
private $_models = null;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @var null|int UNIX epoch when last request was processed.
|
24 |
+
*/
|
25 |
+
private $_last_request_tick = null;
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* WRIO_WebP_Api constructor.
|
30 |
+
*
|
31 |
+
* @param RIO_Process_Queue[] $model Item to be converted to WebP.
|
32 |
+
*/
|
33 |
+
public function __construct( $model ) {
|
34 |
+
$this->_models = $model;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Process image queue based on provided attachment ID.
|
39 |
+
*
|
40 |
+
* When attachment has multiple thumbnails, all of them would be converted one after another.
|
41 |
+
*
|
42 |
+
* Notice: when there are no items queried for provided data, false would be returned.
|
43 |
+
*
|
44 |
+
* @return bool true on success execution, false on failure or missing item in queue.
|
45 |
+
*/
|
46 |
+
public function process_image_queue() {
|
47 |
+
|
48 |
+
foreach ( $this->_models as $model ) {
|
49 |
+
/**
|
50 |
+
* @var RIOP_WebP_Extra_Data $extra_data
|
51 |
+
*/
|
52 |
+
$extra_data = $model->get_extra_data();
|
53 |
+
|
54 |
+
if ( $extra_data === null ) {
|
55 |
+
continue;
|
56 |
+
}
|
57 |
+
|
58 |
+
$response = $this->request( $model );
|
59 |
+
|
60 |
+
if ( $this->can_save( $response ) && $this->save_file( $response, $model ) ) {
|
61 |
+
$this->update( $model );
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
return true;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Request API
|
70 |
+
*
|
71 |
+
* @param RIO_Process_Queue $model Queue model.
|
72 |
+
*
|
73 |
+
* @return array|bool|WP_Error
|
74 |
+
*/
|
75 |
+
public function request( $model ) {
|
76 |
+
|
77 |
+
if ( $this->_last_request_tick === null ) {
|
78 |
+
$this->_last_request_tick = time();
|
79 |
+
} else {
|
80 |
+
if ( is_int( $this->_last_request_tick ) && ( time() - $this->_last_request_tick ) < 1 ) {
|
81 |
+
// Need to have some rest before calling REST :D to comply with API request limit
|
82 |
+
sleep( 2 );
|
83 |
+
}
|
84 |
+
|
85 |
+
$this->_last_request_tick = time();
|
86 |
+
}
|
87 |
+
|
88 |
+
if ( ! wrio_is_license_activate() ) {
|
89 |
+
WRIO_Logger::error( "Unable to get license to make proper request to the API" );
|
90 |
+
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
$transient_string = md5( WRIO_Plugin::app()->getPrefix() . '_processing_image' . $model->get_item_hash() );
|
95 |
+
|
96 |
+
$transient_value = get_transient( $transient_string );
|
97 |
+
|
98 |
+
if ( is_numeric( $transient_value ) && (int) $transient_value === 1 ) {
|
99 |
+
WRIO_Logger::info( sprintf( 'Skipping to wp_remote_get() as transient "%s" already exist. Usually it means that no request was returned yet', $transient_string ) );
|
100 |
+
|
101 |
+
return false;
|
102 |
+
}
|
103 |
+
|
104 |
+
set_transient( $transient_string, 1 );
|
105 |
+
|
106 |
+
$url = $this->_api_url . 'v1/image/convert?';
|
107 |
+
|
108 |
+
$url .= http_build_query( [ 'format' => 'webp' ] );
|
109 |
+
|
110 |
/**
|
111 |
* @var RIOP_WebP_Extra_Data $extra_data
|
112 |
*/
|
113 |
$extra_data = $model->get_extra_data();
|
114 |
+
|
115 |
+
$multipartBoundary = '--------------------------' . microtime( true );
|
116 |
+
|
117 |
+
$file_contents = file_get_contents( $extra_data->get_source_path() );
|
118 |
+
|
119 |
+
$body = "--" . $multipartBoundary . "\r\n" . "Content-Disposition: form-data; name=\"file\"; filename=\"" . basename( $extra_data->get_source_path() ) . "\"\r\n" . "Content-Type: " . $model->get_original_mime_type() . "\r\n\r\n" . $file_contents . "\r\n";
|
120 |
+
|
121 |
+
$body .= "--" . $multipartBoundary . "--\r\n";
|
122 |
+
|
123 |
+
$headers = [
|
124 |
+
// should be base64 encoded, otherwise API would fail authentication
|
125 |
+
'Authorization' => 'Bearer ' . base64_encode( wrio_get_license_key() ),
|
126 |
+
'PluginId' => wrio_get_freemius_plugin_id(),
|
127 |
+
'Content-Type' => 'multipart/form-data; boundary=' . $multipartBoundary,
|
128 |
+
];
|
129 |
+
|
130 |
+
$response = wp_remote_post( $url, [
|
131 |
+
'timeout' => 60,
|
132 |
+
'headers' => $headers,
|
133 |
+
'body' => $body,
|
134 |
+
] );
|
135 |
+
|
136 |
+
delete_transient( $transient_string );
|
137 |
+
|
138 |
+
return $response;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Process response from API.
|
143 |
+
*
|
144 |
+
* @param array|WP_Error|false $response
|
145 |
+
*
|
146 |
+
* @return bool True means response image was successfully saved, false on failure.
|
147 |
+
*/
|
148 |
+
public function can_save( $response ) {
|
149 |
+
\WRIO_Logger::info( 'WebP convertation: Checks to save a webp by response.' );
|
150 |
+
//\WRIO_Logger::debug( var_export( $response, true ) );
|
151 |
+
|
152 |
+
if ( is_wp_error( $response ) ) {
|
153 |
+
WRIO_Logger::error( sprintf( 'Error response from API. Code: %s, error: %s', $response->get_error_code(), $response->get_error_message() ) );
|
154 |
+
|
155 |
+
return false;
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( false === $response ) {
|
159 |
+
WRIO_Logger::error( 'Unknown response returned from API or it was not requested, failing to process response' );
|
160 |
+
|
161 |
+
return false;
|
162 |
}
|
163 |
+
|
164 |
+
$content_disposition = wp_remote_retrieve_header( $response, 'content-disposition' );
|
165 |
+
|
166 |
+
if ( 0 === strpos( $content_disposition, 'attachment;' ) ) {
|
167 |
+
|
168 |
+
$body = wp_remote_retrieve_body( $response );
|
169 |
+
|
170 |
+
if ( empty( $body ) ) {
|
171 |
+
WRIO_Logger::error( 'Response returned content-disposition header as "attachment;", but empty body returned, failing to proceed' );
|
172 |
+
|
173 |
+
return false;
|
174 |
+
}
|
175 |
+
|
176 |
+
\WRIO_Logger::info( 'WebP convertation: Image can be saved. ' );
|
177 |
+
|
178 |
+
return true;
|
179 |
}
|
180 |
+
|
181 |
+
$response_text = wp_remote_retrieve_body( $response );
|
182 |
+
|
183 |
+
if ( ! empty( $response_text ) ) {
|
184 |
+
$response_json = json_decode( $response_text );
|
185 |
+
|
186 |
+
if ( ! empty( $response_json ) ) {
|
187 |
+
if ( isset( $response_json->error ) && ! empty( $response_json->error ) ) {
|
188 |
+
WRIO_Logger::error( sprintf( 'Unable to convert attachment as API returned error: "%s"', $response_json->error ) );
|
189 |
+
}
|
190 |
+
|
191 |
+
if ( isset( $response_json->status ) && 401 === (int) $response_json->status ) {
|
192 |
+
WRIO_Logger::error( sprintf( 'Error response from API. Code: %s, error: %s', $response_json->message, $response_json->code ) );
|
193 |
+
}
|
194 |
+
}
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
return false;
|
198 |
}
|
199 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
/**
|
201 |
+
* Save file from response.
|
202 |
+
*
|
203 |
+
* It is assumed that it was checked by can_save() method.
|
204 |
+
*
|
205 |
+
* @param array|WP_Error|false $response
|
206 |
+
* @param RIO_Process_Queue $queue_model
|
207 |
+
*
|
208 |
+
* @return bool
|
209 |
+
* @see can_save() for further information.
|
210 |
+
*
|
211 |
*/
|
212 |
+
public function save_file( $response, $queue_model ) {
|
213 |
+
|
214 |
+
try {
|
215 |
+
$save_path = static::get_save_path( $queue_model );
|
216 |
+
} catch( \Exception $exception ) {
|
217 |
+
WRIO_Logger::error( sprintf( 'Unable to process response failed to get save path: "%s"', $exception->getMessage() ) );
|
218 |
+
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
|
222 |
+
\WRIO_Logger::info( sprintf( 'WebP convertation: Try to save webp image in %s.', $save_path ) );
|
223 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
$body = wp_remote_retrieve_body( $response );
|
225 |
+
|
226 |
+
$file_saved = @file_put_contents( $save_path, $body );
|
227 |
+
|
228 |
+
if ( ! $file_saved ) {
|
229 |
+
/**
|
230 |
+
* @var $http_response WP_HTTP_Requests_Response
|
231 |
+
*/
|
232 |
+
$http_response = $response['http_response'];
|
233 |
+
WRIO_Logger::error( sprintf( 'Failed to save file "%s" under %s with file_put_contents()', $save_path, $http_response->get_response_object()->url ) );
|
234 |
+
|
235 |
return false;
|
236 |
}
|
237 |
+
|
238 |
+
\WRIO_Logger::info( 'WebP convertation: Image saved successfully!' );
|
239 |
+
|
240 |
return true;
|
241 |
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Update processing item data to finish its cycle.
|
245 |
+
*
|
246 |
+
* @param RIO_Process_Queue $queue_model Queue model to be update.
|
247 |
+
*
|
248 |
+
* @return bool
|
249 |
+
*/
|
250 |
+
public function update( $queue_model ) {
|
251 |
+
|
252 |
+
try {
|
253 |
+
$save_path = static::get_save_path( $queue_model );
|
254 |
+
} catch( \Exception $exception ) {
|
255 |
+
WRIO_Logger::error( sprintf( 'Unable to update queue model #%s as of exception: %s', $queue_model->get_id(), $exception->getMessage() ) );
|
256 |
+
|
257 |
+
return false;
|
258 |
}
|
259 |
+
|
260 |
+
$queue_model->result_status = RIO_Process_Queue::STATUS_SUCCESS;
|
261 |
+
$queue_model->final_size = filesize( $save_path );
|
262 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
/**
|
264 |
+
* @var RIOP_WebP_Extra_Data $updated_extra_data
|
265 |
*/
|
266 |
+
$updated_extra_data = $queue_model->get_extra_data();
|
267 |
+
$updated_extra_data->set_converted_src( $this->get_save_url( $queue_model ) );
|
268 |
+
$updated_extra_data->set_converted_path( $save_path );
|
269 |
+
|
270 |
+
$queue_model->extra_data = $updated_extra_data;
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Хук срабатывает после успешной конвертации в WebP
|
274 |
+
*
|
275 |
+
* @param RIO_Process_Queue $queue_model
|
276 |
+
*
|
277 |
+
* @since 1.2.0
|
278 |
+
*
|
279 |
+
*/
|
280 |
+
do_action( 'wbcr/rio/webp_success', $queue_model );
|
281 |
+
|
282 |
+
return $queue_model->save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
}
|
284 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
/**
|
286 |
+
* Get complete save url.
|
287 |
*
|
288 |
+
* @param RIO_Process_Queue $queue_model Instance of queue item.
|
289 |
*
|
290 |
+
* @return string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
*/
|
292 |
+
public function get_save_url( $queue_model ) {
|
293 |
+
/**
|
294 |
+
* @var $extra_data RIOP_WebP_Extra_Data
|
295 |
+
*/
|
296 |
+
$extra_data = $queue_model->get_extra_data();
|
297 |
+
|
298 |
+
if ( empty( $extra_data ) ) {
|
299 |
+
WRIO_Logger::error( sprintf( 'Unable to get extra data for queue item #%s', $queue_model->get_id() ) );
|
300 |
+
|
301 |
+
return null;
|
302 |
+
}
|
303 |
+
|
304 |
+
$origin_file_name = wp_basename( $extra_data->get_source_src() );
|
305 |
+
$webp_file_name = trim( wp_basename( $extra_data->get_source_path() ) ) . '.webp';
|
306 |
+
|
307 |
+
return str_replace( $origin_file_name, $webp_file_name, $extra_data->get_source_src() );
|
308 |
}
|
309 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
/**
|
311 |
+
* Get absolute save path.
|
312 |
+
*
|
313 |
+
* @param \RIO_Process_Queue $queue_model
|
314 |
+
*
|
315 |
+
* @return bool
|
316 |
+
* @throws Exception on failure to create missing directory
|
317 |
*/
|
318 |
+
public static function get_save_path( $queue_model ) {
|
319 |
+
/**
|
320 |
+
* @var $extra_data RIOP_WebP_Extra_Data
|
321 |
+
*/
|
322 |
+
$extra_data = $queue_model->get_extra_data();
|
323 |
+
|
324 |
+
if ( empty( $extra_data ) ) {
|
325 |
+
WRIO_Logger::error( sprintf( 'Unable to get extra data for queue item #%s', $queue_model->get_id() ) );
|
326 |
+
|
327 |
+
return null;
|
328 |
+
}
|
329 |
+
|
330 |
+
$path = dirname( $extra_data->get_source_path() );
|
331 |
+
|
332 |
+
// Create DIR when does not exist
|
333 |
+
if ( ! file_exists( $path ) ) {
|
334 |
+
$message = sprintf( 'Failed to create directory %s with mode %s recursively', $path, 0755 );
|
335 |
+
WRIO_Logger::error( $message );
|
336 |
+
throw new \Exception( $message );
|
337 |
+
}
|
338 |
+
|
339 |
+
return trailingslashit( $path ) . trim( wp_basename( $extra_data->get_source_path() ) ) . '.webp';
|
340 |
}
|
|
|
|
|
341 |
}
|
|
libs/addons/includes/classes/webp/class-webp-delivery.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
namespace WRIO\WEBP\HTML;
|
4 |
|
5 |
// Exit if accessed directly
|
|
|
|
|
6 |
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
exit;
|
8 |
}
|
@@ -38,6 +40,7 @@ class Delivery {
|
|
38 |
* Initiate the class.
|
39 |
*/
|
40 |
public function init() {
|
|
|
41 |
if ( static::is_webp_enabled() ) {
|
42 |
|
43 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
@@ -188,8 +191,10 @@ class Delivery {
|
|
188 |
require_once WRIOP_PLUGIN_DIR . '/includes/classes/webp/class-webp-html-picture-tags.php';
|
189 |
$content = Picture_Tags::replace( $content );
|
190 |
} else if ( static::is_url_delivery_mode() ) {
|
191 |
-
|
192 |
-
|
|
|
|
|
193 |
}
|
194 |
|
195 |
// If the search and replacement are completed with an error, then return the raw content.
|
@@ -215,26 +220,22 @@ class Delivery {
|
|
215 |
* @return string
|
216 |
*/
|
217 |
public static function get_webp_url( $source_url, $return_value_on_fail ) {
|
218 |
-
|
219 |
-
// Currently we do not handle relative urls - so we skip
|
220 |
-
if ( ! preg_match( '#^https?://#', $source_url ) ) {
|
221 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
222 |
-
\WRIO_Logger::warning( sprintf( "Failed getting webp url.
|
223 |
}
|
224 |
|
225 |
return $return_value_on_fail;
|
226 |
}
|
227 |
|
228 |
-
if ( ! preg_match( '
|
229 |
-
|
230 |
-
\WRIO_Logger::warning( sprintf( "Failed getting webp url. Unsupported image format\r\nSource url: %s", $source_url ) );
|
231 |
-
}
|
232 |
-
|
233 |
-
return $return_value_on_fail;
|
234 |
}
|
235 |
|
|
|
|
|
236 |
// If the image is stored on a remote server, need to skip it
|
237 |
-
if (
|
238 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
239 |
\WRIO_Logger::warning( sprintf( "Failed getting webp url. Image is on a remote server\r\nSource url: %s", $source_url ) );
|
240 |
}
|
@@ -250,21 +251,30 @@ class Delivery {
|
|
250 |
return $return_value_on_fail;
|
251 |
}
|
252 |
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
// If you could not find original image, skip it. Perhaps an error
|
256 |
// in absolute path formation to the directory where the
|
257 |
// image is stored.
|
258 |
-
if ( empty( $
|
259 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
260 |
-
\WRIO_Logger::warning( sprintf( "Failed getting webp url. Unable to find origin image\r\nRelative path: (%s)\r\nSource url: (%s)", $
|
261 |
}
|
262 |
|
263 |
return $return_value_on_fail;
|
264 |
}
|
265 |
|
266 |
$webp_file_url = $source_url . '.webp';
|
267 |
-
$webp_file_path = $
|
268 |
|
269 |
if ( ! file_exists( $webp_file_path ) ) {
|
270 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
@@ -277,12 +287,66 @@ class Delivery {
|
|
277 |
return $webp_file_url;
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
/**
|
281 |
* Check whether browser supports WebP or not.
|
282 |
*
|
283 |
* @return bool
|
284 |
*/
|
285 |
-
|
286 |
if ( isset( $_SERVER['HTTP_ACCEPT'] ) && strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false || isset( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], ' Chrome/' ) !== false ) {
|
287 |
return true;
|
288 |
}
|
3 |
namespace WRIO\WEBP\HTML;
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
+
use WRIO_Logger;
|
7 |
+
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
40 |
* Initiate the class.
|
41 |
*/
|
42 |
public function init() {
|
43 |
+
|
44 |
if ( static::is_webp_enabled() ) {
|
45 |
|
46 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
191 |
require_once WRIOP_PLUGIN_DIR . '/includes/classes/webp/class-webp-html-picture-tags.php';
|
192 |
$content = Picture_Tags::replace( $content );
|
193 |
} else if ( static::is_url_delivery_mode() ) {
|
194 |
+
if(!is_admin()) {
|
195 |
+
require_once( WRIOP_PLUGIN_DIR . '/includes/classes/webp/class-webp-html-image-urls-replacer.php' );
|
196 |
+
$content = Urls_Replacer::replace( $content );
|
197 |
+
}
|
198 |
}
|
199 |
|
200 |
// If the search and replacement are completed with an error, then return the raw content.
|
220 |
* @return string
|
221 |
*/
|
222 |
public static function get_webp_url( $source_url, $return_value_on_fail ) {
|
223 |
+
if ( ! static::is_support_format( $source_url ) ) {
|
|
|
|
|
224 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
225 |
+
\WRIO_Logger::warning( sprintf( "Failed getting webp url. Unsupported image format\r\nSource url: %s", $source_url ) );
|
226 |
}
|
227 |
|
228 |
return $return_value_on_fail;
|
229 |
}
|
230 |
|
231 |
+
if ( ! preg_match( '#^https?://#', $source_url ) ) {
|
232 |
+
$source_url = wrio_rel_to_abs_url( $source_url );
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
|
235 |
+
$is_wpmedia_url = static::is_wpmedia_url( $source_url );
|
236 |
+
|
237 |
// If the image is stored on a remote server, need to skip it
|
238 |
+
if ( static::is_external_url( $source_url ) && ! $is_wpmedia_url ) {
|
239 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
240 |
\WRIO_Logger::warning( sprintf( "Failed getting webp url. Image is on a remote server\r\nSource url: %s", $source_url ) );
|
241 |
}
|
251 |
return $return_value_on_fail;
|
252 |
}
|
253 |
|
254 |
+
if ( $is_wpmedia_url ) {
|
255 |
+
$upload_dir = wp_get_upload_dir();
|
256 |
+
|
257 |
+
$repace_dir = $upload_dir['basedir'];
|
258 |
+
$replace_url = $upload_dir['baseurl'];
|
259 |
+
|
260 |
+
$file_path = str_replace( $replace_url, $repace_dir, $source_url );
|
261 |
+
} else {
|
262 |
+
$file_path = wrio_url_to_abs_path( $source_url );
|
263 |
+
}
|
264 |
|
265 |
// If you could not find original image, skip it. Perhaps an error
|
266 |
// in absolute path formation to the directory where the
|
267 |
// image is stored.
|
268 |
+
if ( empty( $file_path ) || ! file_exists( $file_path ) ) {
|
269 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
270 |
+
\WRIO_Logger::warning( sprintf( "Failed getting webp url. Unable to find origin image\r\nRelative path: (%s)\r\nSource url: (%s)", $file_path, $source_url ) );
|
271 |
}
|
272 |
|
273 |
return $return_value_on_fail;
|
274 |
}
|
275 |
|
276 |
$webp_file_url = $source_url . '.webp';
|
277 |
+
$webp_file_path = $file_path . '.webp';
|
278 |
|
279 |
if ( ! file_exists( $webp_file_path ) ) {
|
280 |
if ( \WRIO_Logger::is_keep_error_log_on_frontend() ) {
|
287 |
return $webp_file_url;
|
288 |
}
|
289 |
|
290 |
+
/**
|
291 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
292 |
+
* @since 1.4.0
|
293 |
+
*
|
294 |
+
* @param string $source_url
|
295 |
+
*
|
296 |
+
* @return bool
|
297 |
+
*/
|
298 |
+
protected static function is_wpmedia_url( $source_url ) {
|
299 |
+
$upload_dir = wp_get_upload_dir();
|
300 |
+
|
301 |
+
if ( isset( $upload_dir['error'] ) && $upload_dir['error'] !== false ) {
|
302 |
+
return false;
|
303 |
+
}
|
304 |
+
|
305 |
+
if ( false !== strpos( $source_url, $upload_dir['baseurl'] ) ) {
|
306 |
+
return true;
|
307 |
+
}
|
308 |
+
|
309 |
+
return false;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
314 |
+
* @since 1.4.0
|
315 |
+
*
|
316 |
+
* @param string $source_url
|
317 |
+
*
|
318 |
+
* @return bool
|
319 |
+
*/
|
320 |
+
protected static function is_support_format( $source_url ) {
|
321 |
+
if ( ! preg_match( '#(jpe?g|png)$#', $source_url ) ) {
|
322 |
+
return false;
|
323 |
+
}
|
324 |
+
|
325 |
+
return true;
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
330 |
+
* @since 1.4.0
|
331 |
+
*
|
332 |
+
* @param string $source_url
|
333 |
+
*
|
334 |
+
* @return bool
|
335 |
+
*/
|
336 |
+
protected static function is_external_url( $source_url ) {
|
337 |
+
if ( strpos( $source_url, get_site_url() ) === false ) {
|
338 |
+
return true;
|
339 |
+
}
|
340 |
+
|
341 |
+
return false;
|
342 |
+
}
|
343 |
+
|
344 |
/**
|
345 |
* Check whether browser supports WebP or not.
|
346 |
*
|
347 |
* @return bool
|
348 |
*/
|
349 |
+
protected static function is_supported_browser() {
|
350 |
if ( isset( $_SERVER['HTTP_ACCEPT'] ) && strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false || isset( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], ' Chrome/' ) !== false ) {
|
351 |
return true;
|
352 |
}
|
libs/addons/includes/classes/webp/class-webp-listener.php
CHANGED
@@ -397,10 +397,7 @@ class Listener {
|
|
397 |
// Fallback to get attachment meta it can be empty when WordPress failed to create it or invocation
|
398 |
// of method was produced too soon
|
399 |
if ( empty( $attachment_meta ) ) {
|
400 |
-
|
401 |
-
|
402 |
-
return $hashmap;
|
403 |
-
/*$exploded_url = explode( 'wp-content/uploads/', $attachment->guid, 2 );
|
404 |
|
405 |
if ( isset( $exploded_url[1] ) ) {
|
406 |
$exploded_relative_path = trim( $exploded_url[1] );
|
@@ -412,7 +409,12 @@ class Listener {
|
|
412 |
$attachment_meta = wp_generate_attachment_metadata( $attachment->ID, $path_from_url );
|
413 |
|
414 |
add_filter( 'wp_generate_attachment_metadata', 'WRIO_Media_Library::optimize_after_upload', 10, 2 );
|
415 |
-
}
|
|
|
|
|
|
|
|
|
|
|
416 |
}
|
417 |
|
418 |
if ( isset( $dirs['basedir'] ) && isset( $attachment_meta['file'] ) ) {
|
397 |
// Fallback to get attachment meta it can be empty when WordPress failed to create it or invocation
|
398 |
// of method was produced too soon
|
399 |
if ( empty( $attachment_meta ) ) {
|
400 |
+
$exploded_url = explode('wp-content/uploads/', $attachment->guid, 2 );
|
|
|
|
|
|
|
401 |
|
402 |
if ( isset( $exploded_url[1] ) ) {
|
403 |
$exploded_relative_path = trim( $exploded_url[1] );
|
409 |
$attachment_meta = wp_generate_attachment_metadata( $attachment->ID, $path_from_url );
|
410 |
|
411 |
add_filter( 'wp_generate_attachment_metadata', 'WRIO_Media_Library::optimize_after_upload', 10, 2 );
|
412 |
+
}
|
413 |
+
}
|
414 |
+
if ( empty( $attachment_meta ) ) {
|
415 |
+
\WRIO_Logger::error( sprintf( 'Attachment #%d metadata is empty. Webp image can not be converted.',$attachment->ID ) );
|
416 |
+
|
417 |
+
return $hashmap;
|
418 |
}
|
419 |
|
420 |
if ( isset( $dirs['basedir'] ) && isset( $attachment_meta['file'] ) ) {
|
libs/addons/includes/classes/webp/composer.lock
CHANGED
@@ -8,16 +8,16 @@
|
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "rosell-dk/dom-util-for-webp",
|
11 |
-
"version": "0.3.
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/rosell-dk/dom-util-for-webp.git",
|
15 |
-
"reference": "
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
-
"url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/
|
20 |
-
"reference": "
|
21 |
"shasum": ""
|
22 |
},
|
23 |
"require-dev": {
|
@@ -59,7 +59,7 @@
|
|
59 |
"images",
|
60 |
"replace"
|
61 |
],
|
62 |
-
"time": "2019-
|
63 |
}
|
64 |
],
|
65 |
"packages-dev": [],
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "rosell-dk/dom-util-for-webp",
|
11 |
+
"version": "0.3.1",
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/rosell-dk/dom-util-for-webp.git",
|
15 |
+
"reference": "bae8f4a9b666726359d28bfb227d886c12f136a9"
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/bae8f4a9b666726359d28bfb227d886c12f136a9",
|
20 |
+
"reference": "bae8f4a9b666726359d28bfb227d886c12f136a9",
|
21 |
"shasum": ""
|
22 |
},
|
23 |
"require-dev": {
|
59 |
"images",
|
60 |
"replace"
|
61 |
],
|
62 |
+
"time": "2019-07-31T14:17:18+00:00"
|
63 |
}
|
64 |
],
|
65 |
"packages-dev": [],
|
libs/addons/includes/classes/webp/vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit72ef64d1632393e46c77b12f00f8e9be::getLoader();
|
libs/addons/includes/classes/webp/vendor/composer/ClassLoader.php
CHANGED
@@ -279,7 +279,7 @@ class ClassLoader
|
|
279 |
*/
|
280 |
public function setApcuPrefix($apcuPrefix)
|
281 |
{
|
282 |
-
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
283 |
}
|
284 |
|
285 |
/**
|
279 |
*/
|
280 |
public function setApcuPrefix($apcuPrefix)
|
281 |
{
|
282 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
283 |
}
|
284 |
|
285 |
/**
|
libs/addons/includes/classes/webp/vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitf915fc14971134da4d8f26cdeb45e0c1
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit72ef64d1632393e46c77b12f00f8e9be
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit72ef64d1632393e46c77b12f00f8e9be', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit72ef64d1632393e46c77b12f00f8e9be', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit72ef64d1632393e46c77b12f00f8e9be::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
libs/addons/includes/classes/webp/vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'D' =>
|
@@ -23,8 +23,8 @@ class ComposerStaticInitf915fc14971134da4d8f26cdeb45e0c1
|
|
23 |
public static function getInitializer(ClassLoader $loader)
|
24 |
{
|
25 |
return \Closure::bind(function () use ($loader) {
|
26 |
-
$loader->prefixLengthsPsr4 =
|
27 |
-
$loader->prefixDirsPsr4 =
|
28 |
|
29 |
}, null, ClassLoader::class);
|
30 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit72ef64d1632393e46c77b12f00f8e9be
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'D' =>
|
23 |
public static function getInitializer(ClassLoader $loader)
|
24 |
{
|
25 |
return \Closure::bind(function () use ($loader) {
|
26 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit72ef64d1632393e46c77b12f00f8e9be::$prefixLengthsPsr4;
|
27 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit72ef64d1632393e46c77b12f00f8e9be::$prefixDirsPsr4;
|
28 |
|
29 |
}, null, ClassLoader::class);
|
30 |
}
|
libs/addons/includes/classes/webp/vendor/composer/installed.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
[
|
2 |
{
|
3 |
"name": "rosell-dk/dom-util-for-webp",
|
4 |
-
"version": "0.3.
|
5 |
-
"version_normalized": "0.3.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/rosell-dk/dom-util-for-webp.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require-dev": {
|
@@ -19,7 +19,7 @@
|
|
19 |
"phpunit/phpunit": "5.7.27",
|
20 |
"squizlabs/php_codesniffer": "3.*"
|
21 |
},
|
22 |
-
"time": "2019-
|
23 |
"type": "library",
|
24 |
"extra": {
|
25 |
"scripts-descriptions": {
|
1 |
[
|
2 |
{
|
3 |
"name": "rosell-dk/dom-util-for-webp",
|
4 |
+
"version": "0.3.1",
|
5 |
+
"version_normalized": "0.3.1.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/rosell-dk/dom-util-for-webp.git",
|
9 |
+
"reference": "bae8f4a9b666726359d28bfb227d886c12f136a9"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/bae8f4a9b666726359d28bfb227d886c12f136a9",
|
14 |
+
"reference": "bae8f4a9b666726359d28bfb227d886c12f136a9",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require-dev": {
|
19 |
"phpunit/phpunit": "5.7.27",
|
20 |
"squizlabs/php_codesniffer": "3.*"
|
21 |
},
|
22 |
+
"time": "2019-07-31T14:17:18+00:00",
|
23 |
"type": "library",
|
24 |
"extra": {
|
25 |
"scripts-descriptions": {
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
# dom-util-for-webp
|
2 |
|
3 |
-
[![
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
*Replace image URLs found in HTML*
|
6 |
|
1 |
# dom-util-for-webp
|
2 |
|
3 |
+
[![Latest Stable Version](https://img.shields.io/packagist/v/rosell-dk/image-mime-type-guesser.svg?style=flat-square)](https://packagist.org/packages/rosell-dk/dom-util-for-webp)
|
4 |
+
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net)
|
5 |
+
[![Build Status](https://img.shields.io/travis/rosell-dk/dom-util-for-webp/master.svg?style=flat-square)](https://travis-ci.org/rosell-dk/dom-util-for-webp)
|
6 |
+
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/rosell-dk/dom-util-for-webp.svg?style=flat-square)](https://scrutinizer-ci.com/g/rosell-dk/dom-util-for-webp/code-structure/master)
|
7 |
+
[![Quality Score](https://img.shields.io/scrutinizer/g/rosell-dk/dom-util-for-webp.svg?style=flat-square)](https://scrutinizer-ci.com/g/rosell-dk/dom-util-for-webp/)
|
8 |
+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/rosell-dk/dom-util-for-webp/blob/master/LICENSE)
|
9 |
|
10 |
*Replace image URLs found in HTML*
|
11 |
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/composer.json
CHANGED
@@ -10,17 +10,19 @@
|
|
10 |
"@build",
|
11 |
"@test",
|
12 |
"@phpcs-all",
|
13 |
-
"@composer validate --no-check-all --strict"
|
|
|
14 |
],
|
15 |
"cs-fix-all": [
|
16 |
"php-cs-fixer fix src"
|
17 |
],
|
18 |
"cs-fix": "php-cs-fixer fix",
|
19 |
"cs-dry": "php-cs-fixer fix --dry-run --diff",
|
20 |
-
"test": "phpunit",
|
21 |
"phpcs": "phpcs --standard=PSR2",
|
22 |
-
"
|
23 |
-
"
|
|
|
24 |
},
|
25 |
"extra": {
|
26 |
"scripts-descriptions": {
|
10 |
"@build",
|
11 |
"@test",
|
12 |
"@phpcs-all",
|
13 |
+
"@composer validate --no-check-all --strict",
|
14 |
+
"@phpstan-global"
|
15 |
],
|
16 |
"cs-fix-all": [
|
17 |
"php-cs-fixer fix src"
|
18 |
],
|
19 |
"cs-fix": "php-cs-fixer fix",
|
20 |
"cs-dry": "php-cs-fixer fix --dry-run --diff",
|
21 |
+
"test": "phpunit --coverage-text --coverage-clover=coverage.clover",
|
22 |
"phpcs": "phpcs --standard=PSR2",
|
23 |
+
"phpcbf": "phpcbf --standard=PSR2",
|
24 |
+
"phpstan": "vendor/bin/phpstan analyse src --level=4",
|
25 |
+
"phpstan-global": "~/.composer/vendor/bin/phpstan analyse src --level=4"
|
26 |
},
|
27 |
"extra": {
|
28 |
"scripts-descriptions": {
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/phpstan.neon
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
parameters:
|
2 |
+
ignoreErrors:
|
3 |
+
- '#Function str_get_html not found.#'
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/phpunit.xml.dist
CHANGED
@@ -20,11 +20,19 @@
|
|
20 |
|
21 |
<filter>
|
22 |
<whitelist>
|
23 |
-
<directory
|
24 |
<exclude>
|
25 |
<directory>./vendor</directory>
|
26 |
<directory>./tests</directory>
|
27 |
</exclude>
|
28 |
</whitelist>
|
29 |
</filter>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</phpunit>
|
20 |
|
21 |
<filter>
|
22 |
<whitelist>
|
23 |
+
<directory suffix=".php">src/</directory>
|
24 |
<exclude>
|
25 |
<directory>./vendor</directory>
|
26 |
<directory>./tests</directory>
|
27 |
</exclude>
|
28 |
</whitelist>
|
29 |
</filter>
|
30 |
+
|
31 |
+
<logging>
|
32 |
+
<log type="junit" target="build/report.junit.xml"/>
|
33 |
+
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
34 |
+
<log type="coverage-text" target="build/coverage.txt"/>
|
35 |
+
<!--<log type="coverage-html" target="build/coverage"/>-->
|
36 |
+
</logging>
|
37 |
+
|
38 |
</phpunit>
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/{src → src-vendor}/simple_html_dom/simple_html_dom.inc
RENAMED
File without changes
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php
CHANGED
@@ -26,17 +26,30 @@ namespace DOMUtilForWebP;
|
|
26 |
class ImageUrlReplacer
|
27 |
{
|
28 |
|
29 |
-
// define tags to be searched.
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
/**
|
33 |
*
|
34 |
-
* @return webp url or, if URL should not be changed, return nothing
|
35 |
**/
|
36 |
public function replaceUrl($url)
|
37 |
{
|
38 |
if (!preg_match('#(png|jpe?g)$#', $url)) {
|
39 |
-
return;
|
40 |
}
|
41 |
return $url . '.webp';
|
42 |
}
|
@@ -157,6 +170,11 @@ class ImageUrlReplacer
|
|
157 |
|
158 |
//$dom = HtmlDomParser::str_get_html($html, false, false, 'UTF-8', false);
|
159 |
$dom = str_get_html($html, false, false, 'UTF-8', false);
|
|
|
|
|
|
|
|
|
|
|
160 |
if ($dom === false) {
|
161 |
if (strlen($html) > MAX_FILE_SIZE) {
|
162 |
return '<!-- Alter HTML was skipped because the HTML is too big to process! ' .
|
@@ -204,7 +222,7 @@ class ImageUrlReplacer
|
|
204 |
public static function replace($html)
|
205 |
{
|
206 |
if (!function_exists('str_get_html')) {
|
207 |
-
require_once 'simple_html_dom/simple_html_dom.inc';
|
208 |
}
|
209 |
$iur = new static();
|
210 |
return $iur->replaceHtml($html);
|
26 |
class ImageUrlReplacer
|
27 |
{
|
28 |
|
29 |
+
// define tags to be searched.
|
30 |
+
// The div and li are on the list because these are often used with lazy loading
|
31 |
+
// should we add <meta> ?
|
32 |
+
// Probably not for open graph images or twitter
|
33 |
+
// so not these:
|
34 |
+
// - <meta property="og:image" content="[url]">
|
35 |
+
// - <meta property="og:image:secure_url" content="[url]">
|
36 |
+
// - <meta name="twitter:image" content="[url]">
|
37 |
+
// Meta can also be used in schema.org micro-formatting, ie:
|
38 |
+
// - <meta itemprop="image" content="[url]">
|
39 |
+
//
|
40 |
+
// How about preloaded images? - yes, suppose we should replace those
|
41 |
+
// - <link rel="prefetch" href="[url]">
|
42 |
+
// - <link rel="preload" as="image" href="[url]">
|
43 |
+
public static $searchInTags = ['img', 'source', 'input', 'iframe', 'div', 'li', 'link', 'a', 'section'];
|
44 |
|
45 |
/**
|
46 |
*
|
47 |
+
* @return string|null webp url or, if URL should not be changed, return nothing
|
48 |
**/
|
49 |
public function replaceUrl($url)
|
50 |
{
|
51 |
if (!preg_match('#(png|jpe?g)$#', $url)) {
|
52 |
+
return null;
|
53 |
}
|
54 |
return $url . '.webp';
|
55 |
}
|
170 |
|
171 |
//$dom = HtmlDomParser::str_get_html($html, false, false, 'UTF-8', false);
|
172 |
$dom = str_get_html($html, false, false, 'UTF-8', false);
|
173 |
+
|
174 |
+
// MAX_FILE_SIZE is defined in simple_html_dom.
|
175 |
+
// For safety sake, we make sure it is defined before using
|
176 |
+
defined('MAX_FILE_SIZE') || define('MAX_FILE_SIZE', 600000);
|
177 |
+
|
178 |
if ($dom === false) {
|
179 |
if (strlen($html) > MAX_FILE_SIZE) {
|
180 |
return '<!-- Alter HTML was skipped because the HTML is too big to process! ' .
|
222 |
public static function replace($html)
|
223 |
{
|
224 |
if (!function_exists('str_get_html')) {
|
225 |
+
require_once __DIR__ . '/../src-vendor/simple_html_dom/simple_html_dom.inc';
|
226 |
}
|
227 |
$iur = new static();
|
228 |
return $iur->replaceHtml($html);
|
libs/addons/includes/classes/webp/vendor/rosell-dk/dom-util-for-webp/src/PictureTags.php
CHANGED
@@ -30,11 +30,11 @@ class PictureTags
|
|
30 |
/**
|
31 |
* Look for attributes such as "data-lazy-src" and "data-src" and prefer them over "src"
|
32 |
*
|
33 |
-
* @param
|
34 |
-
* @param
|
35 |
*
|
36 |
-
* @return
|
37 |
-
* attrName is the name of the attribute used)
|
38 |
*
|
39 |
*/
|
40 |
private static function lazyGet($attributes, $attrName)
|
@@ -90,7 +90,7 @@ class PictureTags
|
|
90 |
/**
|
91 |
* Makes a string with all attributes.
|
92 |
*
|
93 |
-
* @param $attribute_array
|
94 |
* @return string
|
95 |
*/
|
96 |
private static function createAttributes($attribute_array)
|
@@ -194,7 +194,7 @@ class PictureTags
|
|
194 |
public static function replace($html)
|
195 |
{
|
196 |
if (!function_exists('str_get_html')) {
|
197 |
-
require_once 'simple_html_dom/simple_html_dom.inc';
|
198 |
}
|
199 |
$pt = new static();
|
200 |
return $pt->replaceHtml($html);
|
30 |
/**
|
31 |
* Look for attributes such as "data-lazy-src" and "data-src" and prefer them over "src"
|
32 |
*
|
33 |
+
* @param array $attributes an array of attributes for the element
|
34 |
+
* @param string $attrName ie "src", "srcset" or "sizes"
|
35 |
*
|
36 |
+
* @return array an array with "value" key and "attrName" key. ("value" is the value of the attribute and
|
37 |
+
* "attrName" is the name of the attribute used)
|
38 |
*
|
39 |
*/
|
40 |
private static function lazyGet($attributes, $attrName)
|
90 |
/**
|
91 |
* Makes a string with all attributes.
|
92 |
*
|
93 |
+
* @param array $attribute_array
|
94 |
* @return string
|
95 |
*/
|
96 |
private static function createAttributes($attribute_array)
|
194 |
public static function replace($html)
|
195 |
{
|
196 |
if (!function_exists('str_get_html')) {
|
197 |
+
require_once __DIR__ . '/../src-vendor/simple_html_dom/simple_html_dom.inc';
|
198 |
}
|
199 |
$pt = new static();
|
200 |
return $pt->replaceHtml($html);
|
libs/addons/views/modal-select-custom-folders.php
CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
|
4 |
|
5 |
/**
|
6 |
* @var array $data
|
7 |
-
* @var
|
8 |
*/
|
9 |
?>
|
10 |
<p><?php _e( 'Select a directory for optimization. All nested images and folders will be optimized recursively.', 'robin-image-optimizer' ) ?></p>
|
4 |
|
5 |
/**
|
6 |
* @var array $data
|
7 |
+
* @var Wbcr_FactoryClearfy217_PageBase $page
|
8 |
*/
|
9 |
?>
|
10 |
<p><?php _e( 'Select a directory for optimization. All nested images and folders will be optimized recursively.', 'robin-image-optimizer' ) ?></p>
|
libs/addons/views/part-bulk-optimization-table-folders.php
CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
|
4 |
|
5 |
/**
|
6 |
* @var array $data
|
7 |
-
* @var
|
8 |
*/
|
9 |
|
10 |
$cf = WRIO_Custom_Folders::get_instance();
|
4 |
|
5 |
/**
|
6 |
* @var array $data
|
7 |
+
* @var Wbcr_FactoryClearfy217_PageBase $page
|
8 |
*/
|
9 |
|
10 |
$cf = WRIO_Custom_Folders::get_instance();
|
libs/class-rio-relative-to-abs-uri.php
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WRIO\Paths;
|
4 |
+
|
5 |
+
// Exit if accessed directly
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* A php library for converting relative urls to absolute.
|
12 |
+
* Website: https://github.com/monkeysuffrage/phpuri
|
13 |
+
*
|
14 |
+
* <pre>
|
15 |
+
* echo phpUri::parse('https://www.google.com/')->join('foo');
|
16 |
+
* //==> https://www.google.com/foo
|
17 |
+
* </pre>
|
18 |
+
*
|
19 |
+
* Licensed under The MIT License
|
20 |
+
* Redistributions of files must retain the above copyright notice.
|
21 |
+
*
|
22 |
+
* @author P Guardiario <pguardiario@gmail.com>
|
23 |
+
* @version 1.0
|
24 |
+
*/
|
25 |
+
class phpUri {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* http(s)://
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
+
public $scheme;
|
33 |
+
/**
|
34 |
+
* www.example.com
|
35 |
+
*
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
public $authority;
|
39 |
+
/**
|
40 |
+
* /search
|
41 |
+
*
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
public $path;
|
45 |
+
/**
|
46 |
+
* ?q=foo
|
47 |
+
*
|
48 |
+
* @var string
|
49 |
+
*/
|
50 |
+
public $query;
|
51 |
+
/**
|
52 |
+
* #bar
|
53 |
+
*
|
54 |
+
* @var string
|
55 |
+
*/
|
56 |
+
public $fragment;
|
57 |
+
|
58 |
+
private function __construct( $string ) {
|
59 |
+
preg_match_all( '/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $string, $m );
|
60 |
+
$this->scheme = $m[2][0];
|
61 |
+
$this->authority = $m[4][0];
|
62 |
+
/**
|
63 |
+
* CHANGE:
|
64 |
+
*
|
65 |
+
* @author Dominik Habichtsberg <Dominik.Habichtsberg@Hbg-IT.de>
|
66 |
+
* @since 24 Mai 2015 10:02 Uhr
|
67 |
+
*
|
68 |
+
* Former code: $this->path = ( empty( $m[ 5 ][ 0 ] ) ) ? '/' : $m[ 5 ][ 0 ];
|
69 |
+
* No tests failed, when the path is empty.
|
70 |
+
* With the former code, the relative urls //g and #s failed
|
71 |
+
*/
|
72 |
+
$this->path = $m[5][0];
|
73 |
+
$this->query = $m[7][0];
|
74 |
+
$this->fragment = $m[9][0];
|
75 |
+
}
|
76 |
+
|
77 |
+
private function to_str() {
|
78 |
+
$ret = '';
|
79 |
+
if ( ! empty( $this->scheme ) ) {
|
80 |
+
$ret .= "{$this->scheme}:";
|
81 |
+
}
|
82 |
+
if ( ! empty( $this->authority ) ) {
|
83 |
+
$ret .= "//{$this->authority}";
|
84 |
+
}
|
85 |
+
$ret .= $this->normalize_path( $this->path );
|
86 |
+
if ( ! empty( $this->query ) ) {
|
87 |
+
$ret .= "?{$this->query}";
|
88 |
+
}
|
89 |
+
if ( ! empty( $this->fragment ) ) {
|
90 |
+
$ret .= "#{$this->fragment}";
|
91 |
+
}
|
92 |
+
|
93 |
+
return $ret;
|
94 |
+
}
|
95 |
+
|
96 |
+
private function normalize_path( $path ) {
|
97 |
+
if ( empty( $path ) ) {
|
98 |
+
return '';
|
99 |
+
}
|
100 |
+
$normalized_path = $path;
|
101 |
+
$normalized_path = preg_replace( '`//+`', '/', $normalized_path, - 1, $c0 );
|
102 |
+
$normalized_path = preg_replace( '`^/\\.\\.?/`', '/', $normalized_path, - 1, $c1 );
|
103 |
+
$normalized_path = preg_replace( '`/\\.(/|$)`', '/', $normalized_path, - 1, $c2 );
|
104 |
+
/**
|
105 |
+
* CHANGE:
|
106 |
+
*
|
107 |
+
* @author Dominik Habichtsberg <Dominik.Habichtsberg@Hbg-IT.de>
|
108 |
+
* @since 24 Mai 2015 10:05 Uhr
|
109 |
+
* changed limit form -1 to 1, because climbing up the directory-tree failed
|
110 |
+
*/
|
111 |
+
$normalized_path = preg_replace( '`/[^/]*?/\\.\\.(/|$)`', '/', $normalized_path, 1, $c3 );
|
112 |
+
$num_matches = $c0 + $c1 + $c2 + $c3;
|
113 |
+
|
114 |
+
return ( $num_matches > 0 ) ? $this->normalize_path( $normalized_path ) : $normalized_path;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Parse an url string
|
119 |
+
*
|
120 |
+
* @param string $url the url to parse
|
121 |
+
*
|
122 |
+
* @return phpUri
|
123 |
+
*/
|
124 |
+
public static function parse( $url ) {
|
125 |
+
$uri = new phpUri( $url );
|
126 |
+
/**
|
127 |
+
* CHANGE:
|
128 |
+
*
|
129 |
+
* @author Dominik Habichtsberg <Dominik.Habichtsberg@Hbg-IT.de>
|
130 |
+
* @since 24 Mai 2015 10:25 Uhr
|
131 |
+
* The base-url should always have a path
|
132 |
+
*/
|
133 |
+
if ( empty( $uri->path ) ) {
|
134 |
+
$uri->path = '/';
|
135 |
+
}
|
136 |
+
|
137 |
+
return $uri;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Join with a relative url
|
142 |
+
*
|
143 |
+
* @param string $relative the relative url to join
|
144 |
+
*
|
145 |
+
* @return string
|
146 |
+
*/
|
147 |
+
public function join( $relative ) {
|
148 |
+
$uri = new phpUri( $relative );
|
149 |
+
switch ( true ) {
|
150 |
+
case ! empty( $uri->scheme ):
|
151 |
+
break;
|
152 |
+
case ! empty( $uri->authority ):
|
153 |
+
break;
|
154 |
+
case empty( $uri->path ):
|
155 |
+
$uri->path = $this->path;
|
156 |
+
if ( empty( $uri->query ) ) {
|
157 |
+
$uri->query = $this->query;
|
158 |
+
}
|
159 |
+
break;
|
160 |
+
case strpos( $uri->path, '/' ) === 0:
|
161 |
+
break;
|
162 |
+
default:
|
163 |
+
$base_path = $this->path;
|
164 |
+
if ( strpos( $base_path, '/' ) === false ) {
|
165 |
+
$base_path = '';
|
166 |
+
} else {
|
167 |
+
$base_path = preg_replace( '/\/[^\/]+$/', '/', $base_path );
|
168 |
+
}
|
169 |
+
if ( empty( $base_path ) && empty( $this->authority ) ) {
|
170 |
+
$base_path = '/';
|
171 |
+
}
|
172 |
+
$uri->path = $base_path . $uri->path;
|
173 |
+
}
|
174 |
+
if ( empty( $uri->scheme ) ) {
|
175 |
+
$uri->scheme = $this->scheme;
|
176 |
+
if ( empty( $uri->authority ) ) {
|
177 |
+
$uri->authority = $this->authority;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
return $uri->to_str();
|
182 |
+
}
|
183 |
+
}
|
libs/factory/adverts/boot.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use WBCR\Factory_Adverts_106\Base;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Factory Adverts
|
7 |
+
*
|
8 |
+
* @author Alexander Vitkalov <nechin.va@gmail.com>
|
9 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
10 |
+
* @since 1.0.0
|
11 |
+
*
|
12 |
+
* @package factory-ad-inserter
|
13 |
+
* @copyright (c) 2019, Webcraftic Ltd
|
14 |
+
*
|
15 |
+
* @version 1.2.3
|
16 |
+
*/
|
17 |
+
|
18 |
+
// Exit if accessed directly
|
19 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
20 |
+
exit;
|
21 |
+
}
|
22 |
+
|
23 |
+
if ( defined( 'FACTORY_ADVERTS_106_LOADED' ) || ( defined( 'FACTORY_ADVERTS_BLOCK' ) && FACTORY_ADVERTS_BLOCK ) ) {
|
24 |
+
return;
|
25 |
+
}
|
26 |
+
|
27 |
+
# Устанавливаем константу, что модуль уже загружен
|
28 |
+
define( 'FACTORY_ADVERTS_106_LOADED', true );
|
29 |
+
|
30 |
+
# Устанавливаем версию модуля
|
31 |
+
define( 'FACTORY_ADVERTS_106_VERSION', '1.0.6' );
|
32 |
+
|
33 |
+
# Регистрируем тектовый домен, для интернализации интерфейса модуля
|
34 |
+
load_plugin_textdomain( 'wbcr_factory_adverts_106', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' );
|
35 |
+
|
36 |
+
# Устанавливаем директорию модуля
|
37 |
+
define( 'FACTORY_ADVERTS_106_DIR', dirname( __FILE__ ) );
|
38 |
+
|
39 |
+
# Устанавливаем url модуля
|
40 |
+
define( 'FACTORY_ADVERTS_106_URL', plugins_url( null, __FILE__ ) );
|
41 |
+
|
42 |
+
require_once( FACTORY_ADVERTS_106_DIR . '/includes/class-rest-request.php' );
|
43 |
+
require_once( FACTORY_ADVERTS_106_DIR . '/includes/class-base.php' );
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
47 |
+
*/
|
48 |
+
add_action( 'wbcr_factory_adverts_106_plugin_created', function ( $plugin ) {
|
49 |
+
$plugin->set_adverts_manager( "WBCR\Factory_Adverts_106\Base" );
|
50 |
+
} );
|
libs/factory/adverts/includes/class-base.php
ADDED
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WBCR\Factory_Adverts_106;
|
4 |
+
|
5 |
+
// Exit if accessed directly
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Base class for adverts module.
|
12 |
+
*
|
13 |
+
* Contains methods for retrieving banner data for a specific position.
|
14 |
+
* With this class user cat get advert content for a specific position.
|
15 |
+
* This class use functional design pattern.
|
16 |
+
*
|
17 |
+
* @author Alexander Vitkalov <nechin.va@gmail.com>
|
18 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
19 |
+
*
|
20 |
+
* @since 1.0.0 Added
|
21 |
+
* @package factory-adverts
|
22 |
+
* @copyright (c) 2019 Webcraftic Ltd
|
23 |
+
*/
|
24 |
+
class Base {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Экзепляр плагина с которым взаимодействует этот модуль
|
28 |
+
*
|
29 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
30 |
+
* @since 1.0.1
|
31 |
+
* @var \Wbcr_Factory425_Plugin
|
32 |
+
*/
|
33 |
+
private $plugin;
|
34 |
+
|
35 |
+
/*
|
36 |
+
* Contain array data with the plugin information and the module settings.
|
37 |
+
* Mainly used to get the name of the plugin and how to get the adverts blocks.
|
38 |
+
*
|
39 |
+
* @since 1.0.0 Added
|
40 |
+
*
|
41 |
+
* @var array Example: array(
|
42 |
+
* 'dashboard_widget' => true,
|
43 |
+
* 'right_sidebar' => true,
|
44 |
+
* 'notice' => true,
|
45 |
+
* ...
|
46 |
+
* )
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
private $settings = [];
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Экземпляр класса для работы API CreativeMotion
|
53 |
+
*
|
54 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
55 |
+
* @since 1.0.1
|
56 |
+
* @var \WBCR\Factory_Adverts_106\Creative_Motion_API
|
57 |
+
*/
|
58 |
+
private $api;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Сохраняем уже полученные данные, для объектного кеширования
|
62 |
+
*
|
63 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
64 |
+
* @since 1.0.1
|
65 |
+
* @var array
|
66 |
+
*/
|
67 |
+
private $placements = [];
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
71 |
+
* @since 1.0.1
|
72 |
+
* @var array
|
73 |
+
*/
|
74 |
+
private $errors = [];
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Wbcr_Factory_Adinserter constructor.
|
78 |
+
*
|
79 |
+
* - Store plugin information and settings.
|
80 |
+
* - Add filter and actions.
|
81 |
+
* - Include dashboard widget.
|
82 |
+
*
|
83 |
+
* @since 1.0.0 Added
|
84 |
+
*
|
85 |
+
* @param \Wbcr_Factory425_Plugin $plugin
|
86 |
+
*/
|
87 |
+
public function __construct( \Wbcr_Factory425_Plugin $plugin, $settings ) {
|
88 |
+
$this->plugin = $plugin;
|
89 |
+
|
90 |
+
$this->settings = wp_parse_args( $settings, [
|
91 |
+
'dashboard_widget' => false, // show dashboard widget (default: false)
|
92 |
+
'right_sidebar' => false, // show adverts sidebar (default: false)
|
93 |
+
'notice' => false, // show notice message (default: false),
|
94 |
+
'business_suggetion' => false,
|
95 |
+
'support' => false
|
96 |
+
] );
|
97 |
+
|
98 |
+
$this->api = new Creative_Motion_API( $this->plugin );
|
99 |
+
|
100 |
+
add_filter( 'wbcr/factory/pages/impressive/widgets', [ $this, 'register_plugin_widgets' ], 10, 3 );
|
101 |
+
add_action( 'wbcr/factory/admin_notices', [ $this, 'register_plugin_notice' ], 10, 2 );
|
102 |
+
add_action( 'current_screen', [ $this, 'register_dashboard_widget' ], 10, 2 );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Directly get advert content for selected position.
|
107 |
+
*
|
108 |
+
* @since 1.0.1 Rename method. Content should now be printed.
|
109 |
+
* @since 1.0.0 Added
|
110 |
+
*
|
111 |
+
* @param string $position Custom position name
|
112 |
+
*
|
113 |
+
* @return void
|
114 |
+
*/
|
115 |
+
public function render_placement( $position = 'right_sidebar' ) {
|
116 |
+
$content = '';
|
117 |
+
|
118 |
+
if ( $position ) {
|
119 |
+
$content = $this->get_content( $position );
|
120 |
+
}
|
121 |
+
|
122 |
+
echo $content;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Register widgets.
|
127 |
+
*
|
128 |
+
* Depending on the settings, register new widgets.
|
129 |
+
*
|
130 |
+
* @since 1.0.0 Added
|
131 |
+
*
|
132 |
+
* @param array $widgets Already existing registered widgets
|
133 |
+
* @param string $position Position for the widget
|
134 |
+
* @param string $plugin Plugin object for which the hook is run
|
135 |
+
*
|
136 |
+
* @return array array(
|
137 |
+
* 'adverts_widget' => '<p></p>',
|
138 |
+
* 'business_suggetion' => '<p></p>',
|
139 |
+
* 'support' => '<p></p>',
|
140 |
+
* ...
|
141 |
+
* )
|
142 |
+
*/
|
143 |
+
public function register_plugin_widgets( $widgets, $position, $plugin ) {
|
144 |
+
if ( $plugin->getPluginName() == $this->plugin->getPluginName() && 'right' == $position ) {
|
145 |
+
|
146 |
+
if ( $this->settings['right_sidebar'] ) {
|
147 |
+
$content = $this->get_content( 'right_sidebar' );
|
148 |
+
$widgets['adverts_widget'] = $content;
|
149 |
+
|
150 |
+
if ( empty( $widgets['adverts_widget'] ) ) {
|
151 |
+
if ( defined( 'FACTORY_ADVERTS_DEBUG' ) && FACTORY_ADVERTS_DEBUG ) {
|
152 |
+
$debug_message = '<div style="background: #fff4f1;padding: 10px;color: #a58074;">';
|
153 |
+
$debug_message .= $this->get_debug_message( 'right_sidebar' );
|
154 |
+
$debug_message .= '</div>';
|
155 |
+
|
156 |
+
$widgets['adverts_widget'] = $debug_message;
|
157 |
+
} else {
|
158 |
+
unset( $widgets['adverts_widget'] );
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
if ( $this->settings['business_suggetion'] ) {
|
164 |
+
$content = $this->get_content( 'business_suggetion' );
|
165 |
+
|
166 |
+
if ( ! empty( $content ) ) {
|
167 |
+
$widgets['business_suggetion'] = $content;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( $this->settings['support'] ) {
|
172 |
+
$content = $this->get_content( 'support' );
|
173 |
+
|
174 |
+
if ( ! empty( $content ) ) {
|
175 |
+
$widgets['support'] = $content;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
return $widgets;
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Регистрирует уведомление для текущего плагина
|
185 |
+
*
|
186 |
+
* Мы добавляем уведомления в массив всех уведомлений плагина с ключем 'adverts_notice',
|
187 |
+
* то есть если другие плагины, тоже добавят свои рекламные уведомления, они просто
|
188 |
+
* будут перезаписывать друг друга, в итоге будет отображено только одно рекламное
|
189 |
+
* уведомеление. Это нужно для того, чтобы ограничить пользователя от спама.
|
190 |
+
*
|
191 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
192 |
+
*
|
193 |
+
* @since 1.0.1 Переделан полностью под интферфейс фреймворка. Используем встроенную систему уведомлений.
|
194 |
+
* @since 1.0.0 Added
|
195 |
+
*
|
196 |
+
* @param array $notices Массив со списком всех уведомлений, которые будут напечатыны в админ панели
|
197 |
+
* @param string $plugin_name Имя плагина, передано для того, чтобы выводить уведомления условно, только для конкретного плагина
|
198 |
+
*/
|
199 |
+
public function register_plugin_notice( $notices, $plugin_name ) {
|
200 |
+
if ( $plugin_name !== $this->plugin->getPluginName() ) {
|
201 |
+
return $notices;
|
202 |
+
}
|
203 |
+
|
204 |
+
if ( $this->settings['notice'] ) {
|
205 |
+
$notice_content = $this->get_content( 'notice' );
|
206 |
+
|
207 |
+
if ( empty( $notice_content ) ) {
|
208 |
+
# Информация для отладки
|
209 |
+
if ( defined( 'FACTORY_ADVERTS_DEBUG' ) && FACTORY_ADVERTS_DEBUG ) {
|
210 |
+
$debug_message = $this->get_debug_message( 'notice' );
|
211 |
+
|
212 |
+
$notices['adverts_notice'] = [
|
213 |
+
'id' => 'adverts_debug',
|
214 |
+
'type' => 'error',
|
215 |
+
'dismissible' => false,
|
216 |
+
'dismiss_expires' => 0,
|
217 |
+
'text' => '<p><b>' . $this->plugin->getPluginTitle() . '</b>:<br>' . $debug_message . '</p>'
|
218 |
+
];
|
219 |
+
}
|
220 |
+
|
221 |
+
return $notices;
|
222 |
+
}
|
223 |
+
|
224 |
+
$hash = md5( $notice_content );
|
225 |
+
|
226 |
+
$notices['adverts_notice'] = [
|
227 |
+
'id' => 'adverts_' . $hash,
|
228 |
+
'type' => 'success',
|
229 |
+
'dismissible' => true,
|
230 |
+
'dismiss_expires' => 0,
|
231 |
+
'text' => '<p><b>' . $this->plugin->getPluginTitle() . '</b>:<br>' . $notice_content . '</p>'
|
232 |
+
];
|
233 |
+
}
|
234 |
+
|
235 |
+
return $notices;
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Include dashboard widget
|
240 |
+
*
|
241 |
+
* Include functionality the output of the widget on the dashboard.
|
242 |
+
* Only one dashboard widget must be shown for some plugins with this setting (dashboard_widget).
|
243 |
+
*
|
244 |
+
* @since 1.0.0 Added
|
245 |
+
*/
|
246 |
+
public function register_dashboard_widget() {
|
247 |
+
if ( $this->settings['dashboard_widget'] && current_user_can( 'manage_options' ) ) {
|
248 |
+
$current_screen = get_current_screen();
|
249 |
+
|
250 |
+
if ( ! in_array( $current_screen->id, [ 'dashboard', 'dashboard-network' ] ) ) {
|
251 |
+
return;
|
252 |
+
}
|
253 |
+
|
254 |
+
$content = $this->get_content( 'dashboard_widget' );
|
255 |
+
|
256 |
+
if ( empty( $content ) && defined( 'FACTORY_ADVERTS_DEBUG' ) && FACTORY_ADVERTS_DEBUG ) {
|
257 |
+
$content = $this->get_debug_message( 'dashboard_widget' );
|
258 |
+
}
|
259 |
+
|
260 |
+
require_once FACTORY_ADVERTS_106_DIR . '/includes/class-dashboard-widget.php';
|
261 |
+
new Dashboard_Widget( $this->plugin, $content );
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Позволяет получить сообщение об ошибках
|
267 |
+
*
|
268 |
+
* Метод проверяет последние ошибки, которые могли произойти в результате api запроса.
|
269 |
+
* Если ошибки есть, он выводит предупреждение и список последних ошибок. Если ошибок нет,
|
270 |
+
* метод вернет просто предупреждение, что реклама не настроена.
|
271 |
+
*
|
272 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
273 |
+
* @since 1.0.1
|
274 |
+
*
|
275 |
+
* @param string $position Position for the widget
|
276 |
+
*
|
277 |
+
* @return string Возвращает сообщение с последниеми ошибками для отладки
|
278 |
+
*/
|
279 |
+
private function get_debug_message( $position ) {
|
280 |
+
$debug_massage = 'Plugin ads not configured or server unavailable. See full error report below.<br>';
|
281 |
+
|
282 |
+
if ( isset( $this->errors[ $position ] ) && ! empty( $this->errors ) ) {
|
283 |
+
$debug_massage .= '<b>Last errors:</b><br>';
|
284 |
+
foreach ( $this->errors[ $position ] as $error_code => $error_message ) {
|
285 |
+
$debug_massage .= 'Code: ' . $error_code . ' Error: ' . $error_message . '<br>';
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
return $debug_massage;
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Get advert content for selected position.
|
294 |
+
*
|
295 |
+
* @since 1.0.1 Полностью переписан
|
296 |
+
* @since 1.0.0 Added
|
297 |
+
*
|
298 |
+
* @param string $position The position for advert
|
299 |
+
*
|
300 |
+
* @return string
|
301 |
+
*/
|
302 |
+
private function get_content( $position ) {
|
303 |
+
if ( isset( $this->placements[ $position ] ) ) {
|
304 |
+
return $this->placements[ $position ];
|
305 |
+
}
|
306 |
+
|
307 |
+
$content = $this->api->get_content( $position );
|
308 |
+
|
309 |
+
if ( is_wp_error( $content ) ) {
|
310 |
+
$this->errors[ $position ][ $content->get_error_code() ] = $content->get_error_message();
|
311 |
+
|
312 |
+
return null;
|
313 |
+
}
|
314 |
+
|
315 |
+
$this->placements[ $position ] = $content;
|
316 |
+
|
317 |
+
return $content;
|
318 |
+
}
|
319 |
+
}
|
libs/factory/adverts/includes/class-dashboard-widget.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WBCR\Factory_Adverts_106;
|
4 |
+
|
5 |
+
// Exit if accessed directly
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Adverts Dashboard Widget.
|
12 |
+
*
|
13 |
+
* Adds a widget with a banner or a list of news.
|
14 |
+
*
|
15 |
+
* @author Alexander Vitkalov <nechin.va@gmail.com>
|
16 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
17 |
+
*
|
18 |
+
* @since 1.0.0 Added
|
19 |
+
* @package factory-adverts
|
20 |
+
* @copyright (c) 2019 Webcraftic Ltd
|
21 |
+
*/
|
22 |
+
class Dashboard_Widget {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Контент, который должен быть напечатан внутри дашбоард виджета
|
26 |
+
*
|
27 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
28 |
+
* @since 1.0.1
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
private $content;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Экзепляр плагина с которым взаимодействует этот модуль
|
35 |
+
*
|
36 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
37 |
+
* @since 1.0.1
|
38 |
+
* @var \Wbcr_Factory425_Plugin
|
39 |
+
*/
|
40 |
+
private $plugin;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Dashboard_Widget constructor.
|
44 |
+
*
|
45 |
+
* Call parent constructor. Registration hooks.
|
46 |
+
*
|
47 |
+
* @since 1.0.0 Added
|
48 |
+
*
|
49 |
+
* @param \Wbcr_Factory425_Plugin $plugin
|
50 |
+
* @param string $content
|
51 |
+
*/
|
52 |
+
public function __construct( \Wbcr_Factory425_Plugin $plugin, $content ) {
|
53 |
+
|
54 |
+
$this->plugin = $plugin;
|
55 |
+
$this->content = $content;
|
56 |
+
|
57 |
+
if ( ! empty( $this->content ) ) {
|
58 |
+
if ( $this->plugin->isNetworkActive() && $this->plugin->isNetworkAdmin() ) {
|
59 |
+
add_action( 'wp_network_dashboard_setup', [ $this, 'add_dashboard_widgets' ], 999 );
|
60 |
+
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widgets' ], 999 );
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Add the News widget to the dashboard.
|
70 |
+
*
|
71 |
+
* @since 1.0.0 Added
|
72 |
+
*/
|
73 |
+
public function add_dashboard_widgets() {
|
74 |
+
$widget_id = 'wbcr-factory-adverts-widget';
|
75 |
+
|
76 |
+
wp_add_dashboard_widget( $widget_id, $this->plugin->getPluginTitle() . ' News', [
|
77 |
+
$this,
|
78 |
+
'print_widget_content'
|
79 |
+
] );
|
80 |
+
|
81 |
+
$this->sort_dashboard_widgets( $widget_id );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Create the function to output the contents of the Dashboard Widget.
|
86 |
+
*
|
87 |
+
* @since 1.0.0 Added
|
88 |
+
*/
|
89 |
+
public function print_widget_content() {
|
90 |
+
?>
|
91 |
+
<div class="wordpress-news hide-if-no-js">
|
92 |
+
<div class="rss-widget">
|
93 |
+
<?php echo $this->content; ?>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
<?php
|
97 |
+
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Сортируем виджеты на странице дашбоард
|
102 |
+
*
|
103 |
+
* Виджеты должны быть в таком порядке, чтобы наш виджет был выше всех.
|
104 |
+
*
|
105 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
106 |
+
* @author Alexander Vitkalov <nechin.va@gmail.com>
|
107 |
+
*
|
108 |
+
* @since 1.0.2 Добавлена поддержка мультисайтов
|
109 |
+
* @since 1.0.0 Добавлен
|
110 |
+
*
|
111 |
+
* @param string $widget_id ID нашего виджета
|
112 |
+
*/
|
113 |
+
private function sort_dashboard_widgets( $widget_id ) {
|
114 |
+
global $wp_meta_boxes;
|
115 |
+
|
116 |
+
$location = $this->plugin->isNetworkAdmin() ? 'dashboard-network' : 'dashboard';
|
117 |
+
|
118 |
+
$normal_core = $wp_meta_boxes[ $location ]['normal']['core'];
|
119 |
+
$widget_backup = [ $widget_id => $normal_core[ $widget_id ] ];
|
120 |
+
unset( $normal_core[ $widget_id ] );
|
121 |
+
$sorted_core = array_merge( $widget_backup, $normal_core );
|
122 |
+
|
123 |
+
$wp_meta_boxes['dashboard']['normal']['core'] = $sorted_core;
|
124 |
+
}
|
125 |
+
}
|
libs/factory/adverts/includes/class-rest-request.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WBCR\Factory_Adverts_106;
|
4 |
+
|
5 |
+
// Exit if accessed directly
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Factory request class.
|
12 |
+
*
|
13 |
+
* Performs a server request, retrieves banner data and stores it in the cache.
|
14 |
+
*
|
15 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
16 |
+
* @author Alexander Vitkalov <nechin.va@gmail.com>
|
17 |
+
*
|
18 |
+
* @since 1.0.1 Изменил имя класса и доработал его.
|
19 |
+
* @since 1.0.0 Added
|
20 |
+
*
|
21 |
+
* @package factory-adverts
|
22 |
+
* @copyright (c) 2019 Webcraftic Ltd
|
23 |
+
*/
|
24 |
+
class Creative_Motion_API {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Rest request url.
|
28 |
+
*
|
29 |
+
* Define rest request url for rest request to remote server.
|
30 |
+
*
|
31 |
+
* @since 1.2.1
|
32 |
+
*/
|
33 |
+
const SERVER_URL = 'https://api.cm-wp.com';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Rest route path.
|
37 |
+
*
|
38 |
+
* Define rest route path for rest request.
|
39 |
+
*
|
40 |
+
* @since 1.0.0
|
41 |
+
*/
|
42 |
+
const REST_ROUTE = '/adverds/v1/advt';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Интервал между запросами по умолчанию
|
46 |
+
*
|
47 |
+
* Значение в часах.
|
48 |
+
*
|
49 |
+
* @since 1.0.1
|
50 |
+
*/
|
51 |
+
const DEFAULT_REQUESTS_INTERVAL = 24;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Интервал между запросами, если сервер недоступен
|
55 |
+
*
|
56 |
+
* Значение в часах.
|
57 |
+
*
|
58 |
+
* @since 1.0.1
|
59 |
+
*/
|
60 |
+
const SERVER_UNAVAILABLE_INTERVAL = 4;
|
61 |
+
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Экзепляр плагина с которым взаимодействует этот модуль
|
65 |
+
*
|
66 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
67 |
+
* @since 1.0.1
|
68 |
+
* @var \Wbcr_Factory425_Plugin
|
69 |
+
*/
|
70 |
+
private $plugin;
|
71 |
+
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Request constructor.
|
75 |
+
*
|
76 |
+
* Variable initialization.
|
77 |
+
*
|
78 |
+
* @since 1.0.0 Added
|
79 |
+
*
|
80 |
+
* @param \Wbcr_Factory425_Plugin $plugin_name
|
81 |
+
*/
|
82 |
+
public function __construct( \Wbcr_Factory425_Plugin $plugin ) {
|
83 |
+
$this->plugin = $plugin;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Get adverts content.
|
88 |
+
*
|
89 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
90 |
+
* @since 1.0.1
|
91 |
+
*
|
92 |
+
* @param $position
|
93 |
+
*
|
94 |
+
* @return string|\WP_Error
|
95 |
+
*/
|
96 |
+
public function get_content( $position ) {
|
97 |
+
$data = $this->get_cache( $position );
|
98 |
+
|
99 |
+
if ( is_wp_error( $data ) ) {
|
100 |
+
return $data;
|
101 |
+
}
|
102 |
+
|
103 |
+
return strip_tags( $data['content'], '<b>,<a>,<i>,<strong>,<img>,<ul>,<ol>,<li>' );
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Get data from cache.
|
108 |
+
*
|
109 |
+
* If data in the cache, not empty and not expired, then get data from cache. Or get data from server.
|
110 |
+
*
|
111 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
112 |
+
*
|
113 |
+
* @since 1.0.1 Полностью переписан, с перехватом api ошибок
|
114 |
+
* @since 1.0.0 Added
|
115 |
+
*
|
116 |
+
* @return mixed array(
|
117 |
+
* 'plugin' => 'wbcr_insert_php',
|
118 |
+
* 'content' => '<p></p>',
|
119 |
+
* 'expires' => 1563542199,
|
120 |
+
* );
|
121 |
+
*/
|
122 |
+
private function get_cache( $position ) {
|
123 |
+
|
124 |
+
if ( defined( 'FACTORY_ADVERTS_DEBUG' ) && FACTORY_ADVERTS_DEBUG ) {
|
125 |
+
return $this->do_api_request( $position );
|
126 |
+
}
|
127 |
+
|
128 |
+
$key = $this->plugin->getPrefix() . md5( $position . 'adverts_transient_' );
|
129 |
+
|
130 |
+
$cached = get_transient( $key );
|
131 |
+
|
132 |
+
if ( $cached !== false ) {
|
133 |
+
if ( isset( $cached['error_code'] ) && isset( $cached['error'] ) ) {
|
134 |
+
return new \WP_Error( $cached['error_code'], $cached['error'] );
|
135 |
+
}
|
136 |
+
|
137 |
+
return $cached;
|
138 |
+
}
|
139 |
+
|
140 |
+
$data = $this->do_api_request( $position );
|
141 |
+
|
142 |
+
if ( is_wp_error( $data ) ) {
|
143 |
+
set_transient( $key, [
|
144 |
+
'error' => $data->get_error_message(),
|
145 |
+
'error_code' => $data->get_error_code()
|
146 |
+
], self::SERVER_UNAVAILABLE_INTERVAL * HOUR_IN_SECONDS );
|
147 |
+
|
148 |
+
return $data;
|
149 |
+
}
|
150 |
+
|
151 |
+
set_transient( $key, $data, self::DEFAULT_REQUESTS_INTERVAL * HOUR_IN_SECONDS );
|
152 |
+
|
153 |
+
return $data;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Performs rest api request.
|
158 |
+
*
|
159 |
+
* In some case on the server (Apache) in the .htaccess must be set
|
160 |
+
* RewriteRule ^wp-json/(.*)[?](.*) /?rest_route=/$1&$2 [L]
|
161 |
+
*
|
162 |
+
* @since 1.0.1 Добавлен перехват ошибок, рефакторинг кода.
|
163 |
+
* @since 1.0.0 Added
|
164 |
+
*
|
165 |
+
* @return mixed array(
|
166 |
+
* 'plugin' => 'wbcr_insert_php',
|
167 |
+
* 'content' => '<p></p>',
|
168 |
+
* 'expires' => 1563542199,
|
169 |
+
* );
|
170 |
+
*/
|
171 |
+
private function do_api_request( $position ) {
|
172 |
+
$default_result = [
|
173 |
+
'content' => '',
|
174 |
+
'expires' => self::DEFAULT_REQUESTS_INTERVAL * HOUR_IN_SECONDS,
|
175 |
+
];
|
176 |
+
|
177 |
+
$url = untrailingslashit( self::SERVER_URL ) . '/wp-json' . self::REST_ROUTE;
|
178 |
+
$url = add_query_arg( [ 'plugin' => $this->plugin->getPluginName(), 'position' => $position ], $url );
|
179 |
+
|
180 |
+
$response = wp_remote_get( $url );
|
181 |
+
|
182 |
+
$code = wp_remote_retrieve_response_code( $response );
|
183 |
+
$body = wp_remote_retrieve_body( $response );
|
184 |
+
|
185 |
+
$data = @json_decode( $body, true );
|
186 |
+
|
187 |
+
if ( is_wp_error( $response ) ) {
|
188 |
+
return $response;
|
189 |
+
}
|
190 |
+
|
191 |
+
if ( 200 !== $code ) {
|
192 |
+
return new \WP_Error( 'http_request_error', 'Failed request to the remote server. Code: ' . $code );
|
193 |
+
}
|
194 |
+
|
195 |
+
return wp_parse_args( $data, $default_result );
|
196 |
+
}
|
197 |
+
}
|
libs/factory/adverts/includes/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/adverts/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/{core/langs/wbcr_factory_414-ru_RU.mo → adverts/langs/wbcr_factory_adverts_106-ru_RU.mo}
RENAMED
File without changes
|
libs/factory/adverts/langs/wbcr_factory_adverts_106-ru_RU.po
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: factory_forms\n"
|
4 |
+
"POT-Creation-Date: 2018-10-16 22:44+0300\n"
|
5 |
+
"PO-Revision-Date: 2018-10-16 22:45+0300\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: Alex Kovalev <alex.kovalevv@gmail.com>\n"
|
8 |
+
"Language: ru_RU\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 2.1.1\n"
|
13 |
+
"X-Poedit-Basepath: ..\n"
|
14 |
+
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
15 |
+
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
16 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
|
18 |
+
"X-Poedit-SearchPath-0: .\n"
|
19 |
+
|
20 |
+
#: includes/check-compatibility.php:80
|
21 |
+
msgid "warning"
|
22 |
+
msgstr "предупреждение"
|
23 |
+
|
24 |
+
#: includes/check-compatibility.php:82
|
25 |
+
#, php-format
|
26 |
+
msgid "The %s plugin has stopped."
|
27 |
+
msgstr "Работа плагина %s была остановлена."
|
28 |
+
|
29 |
+
#: includes/check-compatibility.php:83
|
30 |
+
msgid "Possible reasons:"
|
31 |
+
msgstr "Возможные причины:"
|
32 |
+
|
33 |
+
#: includes/check-compatibility.php:89
|
34 |
+
#, php-format
|
35 |
+
msgid "You need to update the PHP version to %s or higher!"
|
36 |
+
msgstr "Вам нужно обновить версию PHP до %s или выше!"
|
37 |
+
|
38 |
+
#: includes/check-compatibility.php:94
|
39 |
+
#, php-format
|
40 |
+
msgid "You need to update WordPress to %s or higher!"
|
41 |
+
msgstr "Вам нужно обновить WordPress до %s или выше!"
|
42 |
+
|
43 |
+
#: includes/functions.php:132
|
44 |
+
#, php-format
|
45 |
+
msgid ""
|
46 |
+
"%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead."
|
47 |
+
msgstr ""
|
48 |
+
"%1$s является <strong>устаревшим,</strong> начиная с версии %2$s в "
|
49 |
+
"Wordpress! Используйте %3$s."
|
50 |
+
|
51 |
+
#: includes/functions.php:134
|
52 |
+
#, php-format
|
53 |
+
msgid ""
|
54 |
+
"%1$s is <strong>deprecated</strong> since version %2$s with no alternative "
|
55 |
+
"available."
|
56 |
+
msgstr ""
|
57 |
+
"%1$s был вызван с параметром, который является <strong>устаревшими</strong> "
|
58 |
+
"начиная с версии %2$s , в настоящее время доступных альтернатив нет."
|
59 |
+
|
60 |
+
#: includes/plugin.class.php:202 includes/plugin.class.php:237
|
61 |
+
msgid ""
|
62 |
+
"You are trying to call this earlier than the plugin menu will be registered."
|
63 |
+
msgstr ""
|
64 |
+
"Вы пытаетесь вызвать это раньше, чем будет зарегистрировано меню плагина."
|
65 |
+
|
66 |
+
#: includes/plugin.class.php:220
|
67 |
+
msgid ""
|
68 |
+
"You are trying to get a link to a page that does not have multisite mode. "
|
69 |
+
"Clicking this link will lead the user to a non-existent page."
|
70 |
+
msgstr ""
|
71 |
+
"Вы пытаетесь получить ссылку на страницу, которая не имеет "
|
72 |
+
"многопользовательского режима. Щелчок по этой ссылке приведет пользователя "
|
73 |
+
"к несуществующей странице."
|
74 |
+
|
75 |
+
#: includes/plugin.class.php:222
|
76 |
+
msgid ""
|
77 |
+
"Trying to get a link to an unregistered page. You are trying to call this "
|
78 |
+
"earlier than the plugin menu will be registered."
|
79 |
+
msgstr ""
|
80 |
+
"Попытка получить ссылку на незарегистрированную страницу. Вы пытаетесь "
|
81 |
+
"вызвать это раньше, чем будет зарегистрировано меню плагина."
|
82 |
+
|
83 |
+
|
libs/factory/bootstrap/assets/css-min/bootstrap.accordion.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .factory-accordion{margin:0 0 30px;border-top:1px solid #DDD;border-right:1px solid #DDD;border-left:1px solid #DDD;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.factory-bootstrap-426 .factory-accordion>h3{border-bottom:1px solid #DDD;cursor:pointer;padding:8px 15px;margin:0}.factory-bootstrap-426 .factory-accordion>div{display:none;margin:0;border-bottom:1px solid #DDD}.factory-bootstrap-426 .factory-accordion-item{display:none}.factory-bootstrap-426 .inner-factory-accordion-item{padding:10px 0}.factory-bootstrap-426 .factory-accordion>h3.active:hover{cursor:default}
|
libs/factory/bootstrap/assets/css-min/bootstrap.blue.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#e1a948;border-color:#d39323;color:#fff;-webkit-box-shadow:inset 0 1px 0 #ecc88a,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #ecc88a,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#db9825;border-color:#bd831f;color:#fff;-webkit-box-shadow:inset 0 1px 0 #e8be74,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #e8be74,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#db9825;border-color:#bd831f;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#d1cdc7!important;background:#db9825!important;border-color:#bd831f!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#e1a948;-webkit-box-shadow:inset 0 1px 2px #d39323;box-shadow:inset 0 1px 2px #d39323;border-top:1px solid #d39323;border-bottom:1px solid #d39323;border-left:1px solid #d39323}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#e1a948;border-color:#d39323}
|
libs/factory/bootstrap/assets/css-min/bootstrap.coffee.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#c7a589;border-color:#b78a66;color:#fff;-webkit-box-shadow:inset 0 1px 0 #e0cdbd,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #e0cdbd,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#ba906d;border-color:#ae7d55;color:#fff;-webkit-box-shadow:inset 0 1px 0 #d7bfac,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #d7bfac,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#ba906d;border-color:#ae7d55;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#d1cbc7!important;background:#ba906d!important;border-color:#ae7d55!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#c7a589;-webkit-box-shadow:inset 0 1px 2px #b78a66;box-shadow:inset 0 1px 2px #b78a66;border-top:1px solid #b78a66;border-bottom:1px solid #b78a66;border-left:1px solid #b78a66}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#c7a589;border-color:#b78a66}
|
libs/factory/bootstrap/assets/css-min/bootstrap.core.min.css
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-414 article,.factory-bootstrap-414 aside,.factory-bootstrap-414 details,.factory-bootstrap-414 figcaption,.factory-bootstrap-414 figure,.factory-bootstrap-414 footer,.factory-bootstrap-414 header,.factory-bootstrap-414 hgroup,.factory-bootstrap-414 main,.factory-bootstrap-414 nav,.factory-bootstrap-414 section,.factory-bootstrap-414 summary{display:block}.factory-bootstrap-414 audio,.factory-bootstrap-414 canvas,.factory-bootstrap-414 video{display:inline-block}.factory-bootstrap-414 audio:not([controls]){display:none;height:0}.factory-bootstrap-414 [hidden],.factory-bootstrap-414 template{display:none}.factory-bootstrap-414 body{margin:0}.factory-bootstrap-414 a{background:0 0}.factory-bootstrap-414 a:focus{outline:thin dotted}.factory-bootstrap-414 a:active,.factory-bootstrap-414 a:hover{outline:0}.factory-bootstrap-414 h1{margin:.67em 0}.factory-bootstrap-414 b,.factory-bootstrap-414 strong{font-weight:700}.factory-bootstrap-414 dfn{font-style:italic}.factory-bootstrap-414 hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}.factory-bootstrap-414 mark{color:#000;background:#ff0}.factory-bootstrap-414 code,.factory-bootstrap-414 kbd,.factory-bootstrap-414 pre,.factory-bootstrap-414 samp{font-size:1em}.factory-bootstrap-414 pre{white-space:pre-wrap}.factory-bootstrap-414 q{quotes:"\201C" "\201D" "\2018" "\2019"}.factory-bootstrap-414 sub,.factory-bootstrap-414 sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}.factory-bootstrap-414 sup{top:-.5em}.factory-bootstrap-414 sub{bottom:-.25em}.factory-bootstrap-414 img{border:0}.factory-bootstrap-414 svg:not(:root){overflow:hidden}.factory-bootstrap-414 figure{margin:0}.factory-bootstrap-414 button,.factory-bootstrap-414 input,.factory-bootstrap-414 select,.factory-bootstrap-414 textarea{margin:0}.factory-bootstrap-414 button,.factory-bootstrap-414 select{text-transform:none}.factory-bootstrap-414 select{padding-right:4px!important}.factory-bootstrap-414 button,.factory-bootstrap-414 input[type=reset],.factory-bootstrap-414 input[type=submit],html .factory-bootstrap-414 input[type=button]{cursor:pointer;-webkit-appearance:button}.factory-bootstrap-414 button[disabled],html .factory-bootstrap-414 input[disabled]{cursor:default}.factory-bootstrap-414 input[type=checkbox],.factory-bootstrap-414 input[type=radio]{padding:0;box-sizing:border-box}.factory-bootstrap-414 input[type=search]{-webkit-appearance:textfield}.factory-bootstrap-414 input[type=search]::-webkit-search-cancel-button,.factory-bootstrap-414 input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.factory-bootstrap-414 button::-moz-focus-inner,.factory-bootstrap-414 input::-moz-focus-inner{padding:0;border:0}.factory-bootstrap-414 textarea{overflow:auto;vertical-align:top}.factory-bootstrap-414 table{border-collapse:collapse;border-spacing:0}@media print{.factory-bootstrap-414 *{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}.factory-bootstrap-414 a,.factory-bootstrap-414 a:visited{text-decoration:underline}.factory-bootstrap-414 a[href]:after{content:" (" attr(href) ")"}.factory-bootstrap-414 abbr[title]:after{content:" (" attr(title) ")"}.factory-bootstrap-414 a[href^="javascript:"]:after,.factory-bootstrap-414 a[href^="#"]:after{content:""}.factory-bootstrap-414 blockquote,.factory-bootstrap-414 pre{border:1px solid #999;page-break-inside:avoid}.factory-bootstrap-414 thead{display:table-header-group}.factory-bootstrap-414 img,.factory-bootstrap-414 tr{page-break-inside:avoid}.factory-bootstrap-414 img{max-width:100%!important}@page{margin:2cm .5cm}.factory-bootstrap-414 h2,.factory-bootstrap-414 h3,.factory-bootstrap-414 p{orphans:3;widows:3}.factory-bootstrap-414 h2,.factory-bootstrap-414 h3{page-break-after:avoid}.factory-bootstrap-414 select{background:#fff!important}.factory-bootstrap-414 .navbar{display:none}.factory-bootstrap-414 .table td,.factory-bootstrap-414 .table th{background-color:#fff!important}.factory-bootstrap-414 .btn>.caret,.factory-bootstrap-414 .dropup>.btn>.caret{border-top-color:#000!important}.factory-bootstrap-414 .label{border:1px solid #000}.factory-bootstrap-414 .table{border-collapse:collapse!important}.factory-bootstrap-414 .table-bordered td,.factory-bootstrap-414 .table-bordered th{border:1px solid #ddd!important}}.factory-bootstrap-414 *,.factory-bootstrap-414 :after,.factory-bootstrap-414 :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html .factory-bootstrap-414{-webkit-tap-highlight-color:rgba(0,0,0,0)}.factory-bootstrap-414 body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333;background-color:#fff}.factory-bootstrap-414 button,.factory-bootstrap-414 input,.factory-bootstrap-414 select,.factory-bootstrap-414 textarea{font-family:inherit;font-size:inherit;line-height:inherit}.factory-bootstrap-414 img{vertical-align:middle}.factory-bootstrap-414 .img-responsive{display:block;height:auto;max-width:100%}.factory-bootstrap-414 .img-rounded{border-radius:6px}.factory-bootstrap-414 .img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.factory-bootstrap-414 .img-circle{border-radius:50%}.factory-bootstrap-414 hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.factory-bootstrap-414 .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.factory-bootstrap-414 .h1,.factory-bootstrap-414 .h2,.factory-bootstrap-414 .h3,.factory-bootstrap-414 .h4,.factory-bootstrap-414 .h5,.factory-bootstrap-414 .h6,.factory-bootstrap-414 h1,.factory-bootstrap-414 h2,.factory-bootstrap-414 h3,.factory-bootstrap-414 h4,.factory-bootstrap-414 h5,.factory-bootstrap-414 h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit}.factory-bootstrap-414 .h1 .small,.factory-bootstrap-414 .h1 small,.factory-bootstrap-414 .h2 .small,.factory-bootstrap-414 .h2 small,.factory-bootstrap-414 .h3 .small,.factory-bootstrap-414 .h3 small,.factory-bootstrap-414 .h4 .small,.factory-bootstrap-414 .h4 small,.factory-bootstrap-414 .h5 .small,.factory-bootstrap-414 .h5 small,.factory-bootstrap-414 .h6 .small,.factory-bootstrap-414 .h6 small,.factory-bootstrap-414 h1 .small,.factory-bootstrap-414 h1 small,.factory-bootstrap-414 h2 .small,.factory-bootstrap-414 h2 small,.factory-bootstrap-414 h3 .small,.factory-bootstrap-414 h3 small,.factory-bootstrap-414 h4 .small,.factory-bootstrap-414 h4 small,.factory-bootstrap-414 h5 .small,.factory-bootstrap-414 h5 small,.factory-bootstrap-414 h6 .small,.factory-bootstrap-414 h6 small{font-weight:400;line-height:1;color:#999}.factory-bootstrap-414 h1,.factory-bootstrap-414 h2,.factory-bootstrap-414 h3{margin-top:20px;margin-bottom:10px}.factory-bootstrap-414 h1 .small,.factory-bootstrap-414 h1 small,.factory-bootstrap-414 h2 .small,.factory-bootstrap-414 h2 small,.factory-bootstrap-414 h3 .small,.factory-bootstrap-414 h3 small{font-size:65%}.factory-bootstrap-414 h4,.factory-bootstrap-414 h5,.factory-bootstrap-414 h6{margin-top:10px;margin-bottom:10px}.factory-bootstrap-414 h4 .small,.factory-bootstrap-414 h4 small,.factory-bootstrap-414 h5 .small,.factory-bootstrap-414 h5 small,.factory-bootstrap-414 h6 .small,.factory-bootstrap-414 h6 small{font-size:75%}.factory-bootstrap-414 .h1,.factory-bootstrap-414 h1{font-size:36px}.factory-bootstrap-414 .h2,.factory-bootstrap-414 h2{font-size:30px}.factory-bootstrap-414 .h3,.factory-bootstrap-414 h3{font-size:24px}.factory-bootstrap-414 .h4,.factory-bootstrap-414 h4{font-size:18px}.factory-bootstrap-414 .h5,.factory-bootstrap-414 h5{font-size:14px}.factory-bootstrap-414 .h6,.factory-bootstrap-414 h6{font-size:12px}.factory-bootstrap-414 p{margin:0 0 10px}.factory-bootstrap-414 .lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.factory-bootstrap-414 .small,.factory-bootstrap-414 small{font-size:85%}.factory-bootstrap-414 cite{font-style:normal}.factory-bootstrap-414 .text-muted{color:#999}.factory-bootstrap-414 .text-primary{color:#428bca}.factory-bootstrap-414 .text-primary:hover{color:#3071a9}.factory-bootstrap-414 .text-warning{color:#8a6d3b}.factory-bootstrap-414 .text-warning:hover{color:#66512c}.factory-bootstrap-414 .text-danger{color:#a94442}.factory-bootstrap-414 .text-danger:hover{color:#843534}.factory-bootstrap-414 .text-success{color:#3c763d}.factory-bootstrap-414 .text-success:hover{color:#2b542c}.factory-bootstrap-414 .text-info{color:#31708f}.factory-bootstrap-414 .text-info:hover{color:#245269}.factory-bootstrap-414 .text-left{text-align:left}.factory-bootstrap-414 .text-right{text-align:right}.factory-bootstrap-414 .text-center{text-align:center}.factory-bootstrap-414 .page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}.factory-bootstrap-414 ol,.factory-bootstrap-414 ul{margin-top:0;margin-bottom:10px}.factory-bootstrap-414 ol ol,.factory-bootstrap-414 ol ul,.factory-bootstrap-414 ul ol,.factory-bootstrap-414 ul ul{margin-bottom:0}.factory-bootstrap-414 .list-inline,.factory-bootstrap-414 .list-unstyled{padding-left:0;list-style:none}.factory-bootstrap-414 .list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.factory-bootstrap-414 .list-inline>li:first-child{padding-left:0}.factory-bootstrap-414 dl{margin-top:0;margin-bottom:20px}.factory-bootstrap-414 dd,.factory-bootstrap-414 dt{line-height:1.428571429}.factory-bootstrap-414 dt{font-weight:700}.factory-bootstrap-414 dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:after,.dl-horizontal dd:before{display:table;content:" "}.dl-horizontal dd:after{clear:both}}.factory-bootstrap-414 abbr[data-original-title],.factory-bootstrap-414 abbr[title]{cursor:help;border-bottom:1px dotted #999}.factory-bootstrap-414 .initialism{font-size:90%;text-transform:uppercase}.factory-bootstrap-414 blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}.factory-bootstrap-414 blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}.factory-bootstrap-414 blockquote p:last-child{margin-bottom:0}.factory-bootstrap-414 blockquote .small,.factory-bootstrap-414 blockquote small{display:block;line-height:1.428571429;color:#999}.factory-bootstrap-414 blockquote .small:before,.factory-bootstrap-414 blockquote small:before{content:'\2014 \00A0'}.factory-bootstrap-414 blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}.factory-bootstrap-414 blockquote.pull-right .small,.factory-bootstrap-414 blockquote.pull-right p,.factory-bootstrap-414 blockquote.pull-right small{text-align:right}.factory-bootstrap-414 blockquote.pull-right .small:before,.factory-bootstrap-414 blockquote.pull-right small:before{content:''}.factory-bootstrap-414 blockquote.pull-right .small:after,.factory-bootstrap-414 blockquote.pull-right small:after{content:'\00A0 \2014'}.factory-bootstrap-414 blockquote:after,.factory-bootstrap-414 blockquote:before{content:""}.factory-bootstrap-414 address{margin-bottom:20px;font-style:normal;line-height:1.428571429}.factory-bootstrap-414 code,.factory-bootstrap-414 kbd,.factory-bootstrap-414 pre,.factory-bootstrap-414 samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}.factory-bootstrap-414 code{padding:2px 4px;font-size:90%;color:#c7254e;white-space:nowrap;background-color:#f9f2f4;border-radius:4px}.factory-bootstrap-414 pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}.factory-bootstrap-414 pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.factory-bootstrap-414 .pre-scrollable{max-height:340px;overflow-y:scroll}.factory-bootstrap-414 .container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.factory-bootstrap-414 .container:after,.factory-bootstrap-414 .container:before{display:table;content:" "}.factory-bootstrap-414 .container:after{clear:both}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.factory-bootstrap-414 .row{margin-right:-15px;margin-left:-15px}.factory-bootstrap-414 .row:after,.factory-bootstrap-414 .row:before{display:table;content:" "}.factory-bootstrap-414 .row:after{clear:both}.factory-bootstrap-414 .col-lg-1,.factory-bootstrap-414 .col-lg-10,.factory-bootstrap-414 .col-lg-11,.factory-bootstrap-414 .col-lg-12,.factory-bootstrap-414 .col-lg-2,.factory-bootstrap-414 .col-lg-3,.factory-bootstrap-414 .col-lg-4,.factory-bootstrap-414 .col-lg-5,.factory-bootstrap-414 .col-lg-6,.factory-bootstrap-414 .col-lg-7,.factory-bootstrap-414 .col-lg-8,.factory-bootstrap-414 .col-lg-9,.factory-bootstrap-414 .col-md-1,.factory-bootstrap-414 .col-md-10,.factory-bootstrap-414 .col-md-11,.factory-bootstrap-414 .col-md-12,.factory-bootstrap-414 .col-md-2,.factory-bootstrap-414 .col-md-3,.factory-bootstrap-414 .col-md-4,.factory-bootstrap-414 .col-md-5,.factory-bootstrap-414 .col-md-6,.factory-bootstrap-414 .col-md-7,.factory-bootstrap-414 .col-md-8,.factory-bootstrap-414 .col-md-9,.factory-bootstrap-414 .col-sm-1,.factory-bootstrap-414 .col-sm-10,.factory-bootstrap-414 .col-sm-11,.factory-bootstrap-414 .col-sm-12,.factory-bootstrap-414 .col-sm-2,.factory-bootstrap-414 .col-sm-3,.factory-bootstrap-414 .col-sm-4,.factory-bootstrap-414 .col-sm-5,.factory-bootstrap-414 .col-sm-6,.factory-bootstrap-414 .col-sm-7,.factory-bootstrap-414 .col-sm-8,.factory-bootstrap-414 .col-sm-9,.factory-bootstrap-414 .col-xs-1,.factory-bootstrap-414 .col-xs-10,.factory-bootstrap-414 .col-xs-11,.factory-bootstrap-414 .col-xs-12,.factory-bootstrap-414 .col-xs-2,.factory-bootstrap-414 .col-xs-3,.factory-bootstrap-414 .col-xs-4,.factory-bootstrap-414 .col-xs-5,.factory-bootstrap-414 .col-xs-6,.factory-bootstrap-414 .col-xs-7,.factory-bootstrap-414 .col-xs-8,.factory-bootstrap-414 .col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.factory-bootstrap-414 .col-xs-1,.factory-bootstrap-414 .col-xs-10,.factory-bootstrap-414 .col-xs-11,.factory-bootstrap-414 .col-xs-12,.factory-bootstrap-414 .col-xs-2,.factory-bootstrap-414 .col-xs-3,.factory-bootstrap-414 .col-xs-4,.factory-bootstrap-414 .col-xs-5,.factory-bootstrap-414 .col-xs-6,.factory-bootstrap-414 .col-xs-7,.factory-bootstrap-414 .col-xs-8,.factory-bootstrap-414 .col-xs-9{float:left}.factory-bootstrap-414 .col-xs-12{width:100%}.factory-bootstrap-414 .col-xs-11{width:91.66666666666666%}.factory-bootstrap-414 .col-xs-10{width:83.33333333333334%}.factory-bootstrap-414 .col-xs-9{width:75%}.factory-bootstrap-414 .col-xs-8{width:66.66666666666666%}.factory-bootstrap-414 .col-xs-7{width:58.333333333333336%}.factory-bootstrap-414 .col-xs-6{width:50%}.factory-bootstrap-414 .col-xs-5{width:41.66666666666667%}.factory-bootstrap-414 .col-xs-4{width:33.33333333333333%}.factory-bootstrap-414 .col-xs-3{width:25%}.factory-bootstrap-414 .col-xs-2{width:16.666666666666664%}.factory-bootstrap-414 .col-xs-1{width:8.333333333333332%}.factory-bootstrap-414 .col-xs-pull-12{right:100%}.factory-bootstrap-414 .col-xs-pull-11{right:91.66666666666666%}.factory-bootstrap-414 .col-xs-pull-10{right:83.33333333333334%}.factory-bootstrap-414 .col-xs-pull-9{right:75%}.factory-bootstrap-414 .col-xs-pull-8{right:66.66666666666666%}.factory-bootstrap-414 .col-xs-pull-7{right:58.333333333333336%}.factory-bootstrap-414 .col-xs-pull-6{right:50%}.factory-bootstrap-414 .col-xs-pull-5{right:41.66666666666667%}.factory-bootstrap-414 .col-xs-pull-4{right:33.33333333333333%}.factory-bootstrap-414 .col-xs-pull-3{right:25%}.factory-bootstrap-414 .col-xs-pull-2{right:16.666666666666664%}.factory-bootstrap-414 .col-xs-pull-1{right:8.333333333333332%}.factory-bootstrap-414 .col-xs-pull-0{right:0}.factory-bootstrap-414 .col-xs-push-12{left:100%}.factory-bootstrap-414 .col-xs-push-11{left:91.66666666666666%}.factory-bootstrap-414 .col-xs-push-10{left:83.33333333333334%}.factory-bootstrap-414 .col-xs-push-9{left:75%}.factory-bootstrap-414 .col-xs-push-8{left:66.66666666666666%}.factory-bootstrap-414 .col-xs-push-7{left:58.333333333333336%}.factory-bootstrap-414 .col-xs-push-6{left:50%}.factory-bootstrap-414 .col-xs-push-5{left:41.66666666666667%}.factory-bootstrap-414 .col-xs-push-4{left:33.33333333333333%}.factory-bootstrap-414 .col-xs-push-3{left:25%}.factory-bootstrap-414 .col-xs-push-2{left:16.666666666666664%}.factory-bootstrap-414 .col-xs-push-1{left:8.333333333333332%}.factory-bootstrap-414 .col-xs-push-0{left:0}.factory-bootstrap-414 .col-xs-offset-12{margin-left:100%}.factory-bootstrap-414 .col-xs-offset-11{margin-left:91.66666666666666%}.factory-bootstrap-414 .col-xs-offset-10{margin-left:83.33333333333334%}.factory-bootstrap-414 .col-xs-offset-9{margin-left:75%}.factory-bootstrap-414 .col-xs-offset-8{margin-left:66.66666666666666%}.factory-bootstrap-414 .col-xs-offset-7{margin-left:58.333333333333336%}.factory-bootstrap-414 .col-xs-offset-6{margin-left:50%}.factory-bootstrap-414 .col-xs-offset-5{margin-left:41.66666666666667%}.factory-bootstrap-414 .col-xs-offset-4{margin-left:33.33333333333333%}.factory-bootstrap-414 .col-xs-offset-3{margin-left:25%}.factory-bootstrap-414 .col-xs-offset-2{margin-left:16.666666666666664%}.factory-bootstrap-414 .col-xs-offset-1{margin-left:8.333333333333332%}.factory-bootstrap-414 .col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666666666666%}.col-sm-10{width:83.33333333333334%}.col-sm-9{width:75%}.col-sm-8{width:66.66666666666666%}.col-sm-7{width:58.333333333333336%}.col-sm-6{width:50%}.col-sm-5{width:41.66666666666667%}.col-sm-4{width:33.33333333333333%}.col-sm-3{width:25%}.col-sm-2{width:16.666666666666664%}.col-sm-1{width:8.333333333333332%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666666666666%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666666666666%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666666666666%}.col-md-10{width:83.33333333333334%}.col-md-9{width:75%}.col-md-8{width:66.66666666666666%}.col-md-7{width:58.333333333333336%}.col-md-6{width:50%}.col-md-5{width:41.66666666666667%}.col-md-4{width:33.33333333333333%}.col-md-3{width:25%}.col-md-2{width:16.666666666666664%}.col-md-1{width:8.333333333333332%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666666666666%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666666666666%}.col-md-push-10{left:83.33333333333334%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666666666666%}.col-md-push-7{left:58.333333333333336%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666666666667%}.col-md-push-4{left:33.33333333333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.666666666666664%}.col-md-push-1{left:8.333333333333332%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666666666666%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666666666666%}.col-lg-10{width:83.33333333333334%}.col-lg-9{width:75%}.col-lg-8{width:66.66666666666666%}.col-lg-7{width:58.333333333333336%}.col-lg-6{width:50%}.col-lg-5{width:41.66666666666667%}.col-lg-4{width:33.33333333333333%}.col-lg-3{width:25%}.col-lg-2{width:16.666666666666664%}.col-lg-1{width:8.333333333333332%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666666666666%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666666666666%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-0{margin-left:0}}.factory-bootstrap-414 table{max-width:100%;background-color:transparent}.factory-bootstrap-414 th{text-align:left}.factory-bootstrap-414 .table{width:100%;margin-bottom:20px}.factory-bootstrap-414 .table>tbody>tr>td,.factory-bootstrap-414 .table>tbody>tr>th,.factory-bootstrap-414 .table>tfoot>tr>td,.factory-bootstrap-414 .table>tfoot>tr>th,.factory-bootstrap-414 .table>thead>tr>td,.factory-bootstrap-414 .table>thead>tr>th{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.factory-bootstrap-414 .table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.factory-bootstrap-414 .table>caption+thead>tr:first-child>td,.factory-bootstrap-414 .table>caption+thead>tr:first-child>th,.factory-bootstrap-414 .table>colgroup+thead>tr:first-child>td,.factory-bootstrap-414 .table>colgroup+thead>tr:first-child>th,.factory-bootstrap-414 .table>thead:first-child>tr:first-child>td,.factory-bootstrap-414 .table>thead:first-child>tr:first-child>th{border-top:0}.factory-bootstrap-414 .table>tbody+tbody{border-top:2px solid #ddd}.factory-bootstrap-414 .table .table{background-color:#fff}.factory-bootstrap-414 .table-condensed>tbody>tr>td,.factory-bootstrap-414 .table-condensed>tbody>tr>th,.factory-bootstrap-414 .table-condensed>tfoot>tr>td,.factory-bootstrap-414 .table-condensed>tfoot>tr>th,.factory-bootstrap-414 .table-condensed>thead>tr>td,.factory-bootstrap-414 .table-condensed>thead>tr>th{padding:5px}.factory-bootstrap-414 .table-bordered,.factory-bootstrap-414 .table-bordered>tbody>tr>td,.factory-bootstrap-414 .table-bordered>tbody>tr>th,.factory-bootstrap-414 .table-bordered>tfoot>tr>td,.factory-bootstrap-414 .table-bordered>tfoot>tr>th,.factory-bootstrap-414 .table-bordered>thead>tr>td,.factory-bootstrap-414 .table-bordered>thead>tr>th{border:1px solid #ddd}.factory-bootstrap-414 .table-bordered>thead>tr>td,.factory-bootstrap-414 .table-bordered>thead>tr>th{border-bottom-width:2px}.factory-bootstrap-414 .table-striped>tbody>tr:nth-child(odd)>td,.factory-bootstrap-414 .table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.factory-bootstrap-414 .table-hover>tbody>tr:hover>td,.factory-bootstrap-414 .table-hover>tbody>tr:hover>th{background-color:#f5f5f5}.factory-bootstrap-414 table col[class*=col-]{position:static;display:table-column;float:none}.factory-bootstrap-414 table td[class*=col-],.factory-bootstrap-414 table th[class*=col-]{display:table-cell;float:none}.factory-bootstrap-414 .table>tbody>.active>td,.factory-bootstrap-414 .table>tbody>.active>th,.factory-bootstrap-414 .table>tbody>tr>.active,.factory-bootstrap-414 .table>tfoot>.active>td,.factory-bootstrap-414 .table>tfoot>.active>th,.factory-bootstrap-414 .table>tfoot>tr>.active,.factory-bootstrap-414 .table>thead>.active>td,.factory-bootstrap-414 .table>thead>.active>th,.factory-bootstrap-414 .table>thead>tr>.active{background-color:#f5f5f5}.factory-bootstrap-414 .table-hover>tbody>.active:hover>td,.factory-bootstrap-414 .table-hover>tbody>.active:hover>th,.factory-bootstrap-414 .table-hover>tbody>tr>.active:hover{background-color:#e8e8e8}.factory-bootstrap-414 .table>tbody>.success>td,.factory-bootstrap-414 .table>tbody>.success>th,.factory-bootstrap-414 .table>tbody>tr>.success,.factory-bootstrap-414 .table>tfoot>.success>td,.factory-bootstrap-414 .table>tfoot>.success>th,.factory-bootstrap-414 .table>tfoot>tr>.success,.factory-bootstrap-414 .table>thead>.success>td,.factory-bootstrap-414 .table>thead>.success>th,.factory-bootstrap-414 .table>thead>tr>.success{background-color:#dff0d8}.factory-bootstrap-414 .table-hover>tbody>.success:hover>td,.factory-bootstrap-414 .table-hover>tbody>.success:hover>th,.factory-bootstrap-414 .table-hover>tbody>tr>.success:hover{background-color:#d0e9c6}.factory-bootstrap-414 .table>tbody>.danger>td,.factory-bootstrap-414 .table>tbody>.danger>th,.factory-bootstrap-414 .table>tbody>tr>.danger,.factory-bootstrap-414 .table>tfoot>.danger>td,.factory-bootstrap-414 .table>tfoot>.danger>th,.factory-bootstrap-414 .table>tfoot>tr>.danger,.factory-bootstrap-414 .table>thead>.danger>td,.factory-bootstrap-414 .table>thead>.danger>th,.factory-bootstrap-414 .table>thead>tr>.danger{background-color:#f2dede}.factory-bootstrap-414 .table-hover>tbody>.danger:hover>td,.factory-bootstrap-414 .table-hover>tbody>.danger:hover>th,.factory-bootstrap-414 .table-hover>tbody>tr>.danger:hover{background-color:#ebcccc}.factory-bootstrap-414 .table>tbody>.warning>td,.factory-bootstrap-414 .table>tbody>.warning>th,.factory-bootstrap-414 .table>tbody>tr>.warning,.factory-bootstrap-414 .table>tfoot>.warning>td,.factory-bootstrap-414 .table>tfoot>.warning>th,.factory-bootstrap-414 .table>tfoot>tr>.warning,.factory-bootstrap-414 .table>thead>.warning>td,.factory-bootstrap-414 .table>thead>.warning>th,.factory-bootstrap-414 .table>thead>tr>.warning{background-color:#fcf8e3}.factory-bootstrap-414 .table-hover>tbody>.warning:hover>td,.factory-bootstrap-414 .table-hover>tbody>.warning:hover>th,.factory-bootstrap-414 .table-hover>tbody>tr>.warning:hover{background-color:#faf2cc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:scroll;overflow-y:hidden;border:1px solid #ddd;-ms-overflow-style:-ms-autohiding-scrollbar;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}.factory-bootstrap-414 fieldset{padding:0;margin:0;border:0}.factory-bootstrap-414 legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5;-moz-box-sizing:content-box;box-sizing:content-box}.factory-bootstrap-414 label{display:inline-block;margin-bottom:5px;font-weight:700}.factory-bootstrap-414 input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.factory-bootstrap-414 input[type=checkbox],.factory-bootstrap-414 input[type=radio]{margin:4px 0 0;margin-top:1px \9;line-height:normal}.factory-bootstrap-414 input[type=file]{display:block}.factory-bootstrap-414 select[multiple],.factory-bootstrap-414 select[size]{height:auto}.factory-bootstrap-414 select optgroup{font-family:inherit;font-size:inherit;font-style:inherit}.factory-bootstrap-414 input[type=checkbox]:focus,.factory-bootstrap-414 input[type=file]:focus,.factory-bootstrap-414 input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.factory-bootstrap-414 input[type=number]::-webkit-inner-spin-button,.factory-bootstrap-414 input[type=number]::-webkit-outer-spin-button{height:auto}.factory-bootstrap-414 output{display:block;padding-top:7px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle}.factory-bootstrap-414 .form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.factory-bootstrap-414 .form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-414 .form-control:-moz-placeholder{color:#999}.factory-bootstrap-414 .form-control::-moz-placeholder{color:#999;opacity:1}.factory-bootstrap-414 .form-control:-ms-input-placeholder{color:#999}.factory-bootstrap-414 .form-control::-webkit-input-placeholder{color:#999}.factory-bootstrap-414 .form-control[disabled],.factory-bootstrap-414 .form-control[readonly],.factory-bootstrap-414 fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}.factory-bootstrap-414 textarea.form-control{height:auto}.factory-bootstrap-414 .form-group{margin-bottom:15px}.factory-bootstrap-414 .checkbox,.factory-bootstrap-414 .radio{display:block;min-height:20px;padding-left:20px;margin-top:10px;margin-bottom:10px;vertical-align:middle}.factory-bootstrap-414 .checkbox label,.factory-bootstrap-414 .radio label{display:inline;margin-bottom:0;font-weight:400;cursor:pointer}.factory-bootstrap-414 .checkbox input[type=checkbox],.factory-bootstrap-414 .checkbox-inline input[type=checkbox],.factory-bootstrap-414 .radio input[type=radio],.factory-bootstrap-414 .radio-inline input[type=radio]{float:left;margin-left:-20px}.factory-bootstrap-414 .checkbox+.checkbox,.factory-bootstrap-414 .radio+.radio{margin-top:-5px}.factory-bootstrap-414 .checkbox-inline,.factory-bootstrap-414 .radio-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.factory-bootstrap-414 .checkbox-inline+.checkbox-inline,.factory-bootstrap-414 .radio-inline+.radio-inline{margin-top:0;margin-left:10px}.factory-bootstrap-414 .checkbox-inline[disabled],.factory-bootstrap-414 .checkbox[disabled],.factory-bootstrap-414 .radio-inline[disabled],.factory-bootstrap-414 .radio[disabled],.factory-bootstrap-414 fieldset[disabled] .checkbox,.factory-bootstrap-414 fieldset[disabled] .checkbox-inline,.factory-bootstrap-414 fieldset[disabled] .radio,.factory-bootstrap-414 fieldset[disabled] .radio-inline,.factory-bootstrap-414 fieldset[disabled] input[type=checkbox],.factory-bootstrap-414 fieldset[disabled] input[type=radio],.factory-bootstrap-414 input[type=checkbox][disabled],.factory-bootstrap-414 input[type=radio][disabled]{cursor:not-allowed}.factory-bootstrap-414 .input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-414 select.input-sm{height:30px;line-height:30px}.factory-bootstrap-414 textarea.input-sm{height:auto}.factory-bootstrap-414 .input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-414 select.input-lg{height:46px;line-height:46px}.factory-bootstrap-414 textarea.input-lg{height:auto}.factory-bootstrap-414 .has-warning .checkbox,.factory-bootstrap-414 .has-warning .checkbox-inline,.factory-bootstrap-414 .has-warning .control-label,.factory-bootstrap-414 .has-warning .help-block,.factory-bootstrap-414 .has-warning .radio,.factory-bootstrap-414 .has-warning .radio-inline{color:#8a6d3b}.factory-bootstrap-414 .has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-414 .has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.factory-bootstrap-414 .has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.factory-bootstrap-414 .has-error .checkbox,.factory-bootstrap-414 .has-error .checkbox-inline,.factory-bootstrap-414 .has-error .control-label,.factory-bootstrap-414 .has-error .help-block,.factory-bootstrap-414 .has-error .radio,.factory-bootstrap-414 .has-error .radio-inline{color:#a94442}.factory-bootstrap-414 .controls{display:block}.factory-bootstrap-414 .has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-414 .has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.factory-bootstrap-414 .has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.factory-bootstrap-414 .has-success .checkbox,.factory-bootstrap-414 .has-success .checkbox-inline,.factory-bootstrap-414 .has-success .control-label,.factory-bootstrap-414 .has-success .help-block,.factory-bootstrap-414 .has-success .radio,.factory-bootstrap-414 .has-success .radio-inline{color:#3c763d}.factory-bootstrap-414 .has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-414 .has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.factory-bootstrap-414 .has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.factory-bootstrap-414 .form-control-static{margin-bottom:0}.factory-bootstrap-414 .help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373;font-weight:400}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline select.form-control{width:auto}.form-inline .checkbox,.form-inline .radio{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{float:none;margin-left:0}}.factory-bootstrap-414 .form-horizontal .checkbox,.factory-bootstrap-414 .form-horizontal .checkbox-inline,.factory-bootstrap-414 .form-horizontal .control-label,.factory-bootstrap-414 .form-horizontal .radio,.factory-bootstrap-414 .form-horizontal .radio-inline{position:relative;padding-top:7px;margin-top:0;margin-bottom:0}.factory-bootstrap-414 .form-horizontal .control-label{max-width:200px}.factory-bootstrap-414 .form-horizontal .checkbox,.factory-bootstrap-414 .form-horizontal .radio{min-height:27px}.factory-bootstrap-414 .form-horizontal .form-group{margin-right:-15px;margin-left:-15px}.factory-bootstrap-414 .form-horizontal .form-group:after,.factory-bootstrap-414 .form-horizontal .form-group:before{display:table;content:" "}.factory-bootstrap-414 .form-horizontal .form-group:after{clear:both}.factory-bootstrap-414 .form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.factory-bootstrap-414 .btn{display:inline-block;padding:5px 12px;margin-bottom:0;font-size:13px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.factory-bootstrap-414 .btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.factory-bootstrap-414 .btn{text-decoration:none}.factory-bootstrap-414 .btn:focus,.factory-bootstrap-414 .btn:hover{color:#333;text-decoration:none}.factory-bootstrap-414 .btn.disabled,.factory-bootstrap-414 .btn[disabled],.factory-bootstrap-414 fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.factory-bootstrap-414 .btn-default.active,.factory-bootstrap-414 .btn-default:active,.factory-bootstrap-414 .btn-default:focus,.factory-bootstrap-414 .btn-default:hover,.factory-bootstrap-414 .open .dropdown-toggle.btn-default{background:#fafafa;border-color:#999;color:#222}.factory-bootstrap-414 .btn-default.active,.factory-bootstrap-414 .btn-default:active,.factory-bootstrap-414 .open .dropdown-toggle.btn-default{background-image:none}.factory-bootstrap-414 .btn-default.disabled,.factory-bootstrap-414 .btn-default.disabled.active,.factory-bootstrap-414 .btn-default.disabled:active,.factory-bootstrap-414 .btn-default.disabled:focus,.factory-bootstrap-414 .btn-default.disabled:hover,.factory-bootstrap-414 .btn-default[disabled],.factory-bootstrap-414 .btn-default[disabled].active,.factory-bootstrap-414 .btn-default[disabled]:active,.factory-bootstrap-414 .btn-default[disabled]:focus,.factory-bootstrap-414 .btn-default[disabled]:hover,.factory-bootstrap-414 fieldset[disabled] .btn-default,.factory-bootstrap-414 fieldset[disabled] .btn-default.active,.factory-bootstrap-414 fieldset[disabled] .btn-default:active,.factory-bootstrap-414 fieldset[disabled] .btn-default:focus,.factory-bootstrap-414 fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.factory-bootstrap-414 .btn-default .badge{color:#fff;background-color:#fff}.factory-bootstrap-414 .btn-primary.active,.factory-bootstrap-414 .btn-primary:active,.factory-bootstrap-414 .btn-primary:focus,.factory-bootstrap-414 .btn-primary:hover,.factory-bootstrap-414 .open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.factory-bootstrap-414 .btn-primary.active,.factory-bootstrap-414 .btn-primary:active,.factory-bootstrap-414 .open .dropdown-toggle.btn-primary{background-image:none}.factory-bootstrap-414 .btn-primary.disabled,.factory-bootstrap-414 .btn-primary.disabled.active,.factory-bootstrap-414 .btn-primary.disabled:active,.factory-bootstrap-414 .btn-primary.disabled:focus,.factory-bootstrap-414 .btn-primary.disabled:hover,.factory-bootstrap-414 .btn-primary[disabled],.factory-bootstrap-414 .btn-primary[disabled].active,.factory-bootstrap-414 .btn-primary[disabled]:active,.factory-bootstrap-414 .btn-primary[disabled]:focus,.factory-bootstrap-414 .btn-primary[disabled]:hover,.factory-bootstrap-414 fieldset[disabled] .btn-primary,.factory-bootstrap-414 fieldset[disabled] .btn-primary.active,.factory-bootstrap-414 fieldset[disabled] .btn-primary:active,.factory-bootstrap-414 fieldset[disabled] .btn-primary:focus,.factory-bootstrap-414 fieldset[disabled] .btn-primary:hover{background-color:#428bca;border-color:#357ebd}.factory-bootstrap-414 .btn-primary .badge{color:#428bca;background-color:#fff}.factory-bootstrap-414 .btn-warning{color:#fff;background-color:#f0ad4e}.factory-bootstrap-414 .btn-warning.active,.factory-bootstrap-414 .btn-warning:active,.factory-bootstrap-414 .btn-warning:focus,.factory-bootstrap-414 .btn-warning:hover,.factory-bootstrap-414 .open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.factory-bootstrap-414 .btn-warning.active,.factory-bootstrap-414 .btn-warning:active,.factory-bootstrap-414 .open .dropdown-toggle.btn-warning{background-image:none}.factory-bootstrap-414 .btn-warning.disabled,.factory-bootstrap-414 .btn-warning.disabled.active,.factory-bootstrap-414 .btn-warning.disabled:active,.factory-bootstrap-414 .btn-warning.disabled:focus,.factory-bootstrap-414 .btn-warning.disabled:hover,.factory-bootstrap-414 .btn-warning[disabled],.factory-bootstrap-414 .btn-warning[disabled].active,.factory-bootstrap-414 .btn-warning[disabled]:active,.factory-bootstrap-414 .btn-warning[disabled]:focus,.factory-bootstrap-414 .btn-warning[disabled]:hover,.factory-bootstrap-414 fieldset[disabled] .btn-warning,.factory-bootstrap-414 fieldset[disabled] .btn-warning.active,.factory-bootstrap-414 fieldset[disabled] .btn-warning:active,.factory-bootstrap-414 fieldset[disabled] .btn-warning:focus,.factory-bootstrap-414 fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.factory-bootstrap-414 .btn-warning .badge{color:#f0ad4e;background-color:#fff}.factory-bootstrap-414 .btn-success{color:#fff;background-color:#5cb85c}.factory-bootstrap-414 .btn-success.active,.factory-bootstrap-414 .btn-success:active,.factory-bootstrap-414 .btn-success:focus,.factory-bootstrap-414 .btn-success:hover,.factory-bootstrap-414 .open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.factory-bootstrap-414 .btn-success.active,.factory-bootstrap-414 .btn-success:active,.factory-bootstrap-414 .open .dropdown-toggle.btn-success{background-image:none}.factory-bootstrap-414 .btn-success.disabled,.factory-bootstrap-414 .btn-success.disabled.active,.factory-bootstrap-414 .btn-success.disabled:active,.factory-bootstrap-414 .btn-success.disabled:focus,.factory-bootstrap-414 .btn-success.disabled:hover,.factory-bootstrap-414 .btn-success[disabled],.factory-bootstrap-414 .btn-success[disabled].active,.factory-bootstrap-414 .btn-success[disabled]:active,.factory-bootstrap-414 .btn-success[disabled]:focus,.factory-bootstrap-414 .btn-success[disabled]:hover,.factory-bootstrap-414 fieldset[disabled] .btn-success,.factory-bootstrap-414 fieldset[disabled] .btn-success.active,.factory-bootstrap-414 fieldset[disabled] .btn-success:active,.factory-bootstrap-414 fieldset[disabled] .btn-success:focus,.factory-bootstrap-414 fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.factory-bootstrap-414 .btn-success .badge{color:#5cb85c;background-color:#fff}.factory-bootstrap-414 .btn-info{color:#fff;background-color:#5bc0de}.factory-bootstrap-414 .btn-info.active,.factory-bootstrap-414 .btn-info:active,.factory-bootstrap-414 .btn-info:focus,.factory-bootstrap-414 .btn-info:hover,.factory-bootstrap-414 .open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.factory-bootstrap-414 .btn-info.active,.factory-bootstrap-414 .btn-info:active,.factory-bootstrap-414 .open .dropdown-toggle.btn-info{background-image:none}.factory-bootstrap-414 .btn-info.disabled,.factory-bootstrap-414 .btn-info.disabled.active,.factory-bootstrap-414 .btn-info.disabled:active,.factory-bootstrap-414 .btn-info.disabled:focus,.factory-bootstrap-414 .btn-info.disabled:hover,.factory-bootstrap-414 .btn-info[disabled],.factory-bootstrap-414 .btn-info[disabled].active,.factory-bootstrap-414 .btn-info[disabled]:active,.factory-bootstrap-414 .btn-info[disabled]:focus,.factory-bootstrap-414 .btn-info[disabled]:hover,.factory-bootstrap-414 fieldset[disabled] .btn-info,.factory-bootstrap-414 fieldset[disabled] .btn-info.active,.factory-bootstrap-414 fieldset[disabled] .btn-info:active,.factory-bootstrap-414 fieldset[disabled] .btn-info:focus,.factory-bootstrap-414 fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.factory-bootstrap-414 .btn-info .badge{color:#5bc0de;background-color:#fff}.factory-bootstrap-414 .btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.factory-bootstrap-414 .btn-link,.factory-bootstrap-414 .btn-link:active,.factory-bootstrap-414 .btn-link[disabled],.factory-bootstrap-414 fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.factory-bootstrap-414 .btn-link,.factory-bootstrap-414 .btn-link:active,.factory-bootstrap-414 .btn-link:focus,.factory-bootstrap-414 .btn-link:hover{border-color:transparent}.factory-bootstrap-414 .btn-link:focus,.factory-bootstrap-414 .btn-link:hover{color:#2a6496;text-decoration:underline;background-color:transparent}.factory-bootstrap-414 .btn-link[disabled]:focus,.factory-bootstrap-414 .btn-link[disabled]:hover,.factory-bootstrap-414 fieldset[disabled] .btn-link:focus,.factory-bootstrap-414 fieldset[disabled] .btn-link:hover{color:#999;text-decoration:none}.factory-bootstrap-414 .btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-414 .btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-414 .btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-414 .btn-block{display:block;width:100%;padding-right:0;padding-left:0}.factory-bootstrap-414 .btn-block+.btn-block{margin-top:5px}.factory-bootstrap-414 input[type=button].btn-block,.factory-bootstrap-414 input[type=reset].btn-block,.factory-bootstrap-414 input[type=submit].btn-block{width:100%}.factory-bootstrap-414 .fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.factory-bootstrap-414 .fade.in{opacity:1}.factory-bootstrap-414 .collapse{display:none}.factory-bootstrap-414 .collapse.in{display:block}.factory-bootstrap-414 .collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular) format('svg')}.factory-bootstrap-414 .glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.factory-bootstrap-414 .glyphicon:empty{width:1em}.factory-bootstrap-414 .glyphicon-asterisk:before{content:"\2a"}.factory-bootstrap-414 .glyphicon-plus:before{content:"\2b"}.factory-bootstrap-414 .glyphicon-euro:before{content:"\20ac"}.factory-bootstrap-414 .glyphicon-minus:before{content:"\2212"}.factory-bootstrap-414 .glyphicon-cloud:before{content:"\2601"}.factory-bootstrap-414 .glyphicon-envelope:before{content:"\2709"}.factory-bootstrap-414 .glyphicon-pencil:before{content:"\270f"}.factory-bootstrap-414 .glyphicon-glass:before{content:"\e001"}.factory-bootstrap-414 .glyphicon-music:before{content:"\e002"}.factory-bootstrap-414 .glyphicon-search:before{content:"\e003"}.factory-bootstrap-414 .glyphicon-heart:before{content:"\e005"}.factory-bootstrap-414 .glyphicon-star:before{content:"\e006"}.factory-bootstrap-414 .glyphicon-star-empty:before{content:"\e007"}.factory-bootstrap-414 .glyphicon-user:before{content:"\e008"}.factory-bootstrap-414 .glyphicon-film:before{content:"\e009"}.factory-bootstrap-414 .glyphicon-th-large:before{content:"\e010"}.factory-bootstrap-414 .glyphicon-th:before{content:"\e011"}.factory-bootstrap-414 .glyphicon-th-list:before{content:"\e012"}.factory-bootstrap-414 .glyphicon-ok:before{content:"\e013"}.factory-bootstrap-414 .glyphicon-remove:before{content:"\e014"}.factory-bootstrap-414 .glyphicon-zoom-in:before{content:"\e015"}.factory-bootstrap-414 .glyphicon-zoom-out:before{content:"\e016"}.factory-bootstrap-414 .glyphicon-off:before{content:"\e017"}.factory-bootstrap-414 .glyphicon-signal:before{content:"\e018"}.factory-bootstrap-414 .glyphicon-cog:before{content:"\e019"}.factory-bootstrap-414 .glyphicon-trash:before{content:"\e020"}.factory-bootstrap-414 .glyphicon-home:before{content:"\e021"}.factory-bootstrap-414 .glyphicon-file:before{content:"\e022"}.factory-bootstrap-414 .glyphicon-time:before{content:"\e023"}.factory-bootstrap-414 .glyphicon-road:before{content:"\e024"}.factory-bootstrap-414 .glyphicon-download-alt:before{content:"\e025"}.factory-bootstrap-414 .glyphicon-download:before{content:"\e026"}.factory-bootstrap-414 .glyphicon-upload:before{content:"\e027"}.factory-bootstrap-414 .glyphicon-inbox:before{content:"\e028"}.factory-bootstrap-414 .glyphicon-play-circle:before{content:"\e029"}.factory-bootstrap-414 .glyphicon-repeat:before{content:"\e030"}.factory-bootstrap-414 .glyphicon-refresh:before{content:"\e031"}.factory-bootstrap-414 .glyphicon-list-alt:before{content:"\e032"}.factory-bootstrap-414 .glyphicon-lock:before{content:"\e033"}.factory-bootstrap-414 .glyphicon-flag:before{content:"\e034"}.factory-bootstrap-414 .glyphicon-headphones:before{content:"\e035"}.factory-bootstrap-414 .glyphicon-volume-off:before{content:"\e036"}.factory-bootstrap-414 .glyphicon-volume-down:before{content:"\e037"}.factory-bootstrap-414 .glyphicon-volume-up:before{content:"\e038"}.factory-bootstrap-414 .glyphicon-qrcode:before{content:"\e039"}.factory-bootstrap-414 .glyphicon-barcode:before{content:"\e040"}.factory-bootstrap-414 .glyphicon-tag:before{content:"\e041"}.factory-bootstrap-414 .glyphicon-tags:before{content:"\e042"}.factory-bootstrap-414 .glyphicon-book:before{content:"\e043"}.factory-bootstrap-414 .glyphicon-bookmark:before{content:"\e044"}.factory-bootstrap-414 .glyphicon-print:before{content:"\e045"}.factory-bootstrap-414 .glyphicon-camera:before{content:"\e046"}.factory-bootstrap-414 .glyphicon-font:before{content:"\e047"}.factory-bootstrap-414 .glyphicon-bold:before{content:"\e048"}.factory-bootstrap-414 .glyphicon-italic:before{content:"\e049"}.factory-bootstrap-414 .glyphicon-text-height:before{content:"\e050"}.factory-bootstrap-414 .glyphicon-text-width:before{content:"\e051"}.factory-bootstrap-414 .glyphicon-align-left:before{content:"\e052"}.factory-bootstrap-414 .glyphicon-align-center:before{content:"\e053"}.factory-bootstrap-414 .glyphicon-align-right:before{content:"\e054"}.factory-bootstrap-414 .glyphicon-align-justify:before{content:"\e055"}.factory-bootstrap-414 .glyphicon-list:before{content:"\e056"}.factory-bootstrap-414 .glyphicon-indent-left:before{content:"\e057"}.factory-bootstrap-414 .glyphicon-indent-right:before{content:"\e058"}.factory-bootstrap-414 .glyphicon-facetime-video:before{content:"\e059"}.factory-bootstrap-414 .glyphicon-picture:before{content:"\e060"}.factory-bootstrap-414 .glyphicon-map-marker:before{content:"\e062"}.factory-bootstrap-414 .glyphicon-adjust:before{content:"\e063"}.factory-bootstrap-414 .glyphicon-tint:before{content:"\e064"}.factory-bootstrap-414 .glyphicon-edit:before{content:"\e065"}.factory-bootstrap-414 .glyphicon-share:before{content:"\e066"}.factory-bootstrap-414 .glyphicon-check:before{content:"\e067"}.factory-bootstrap-414 .glyphicon-move:before{content:"\e068"}.factory-bootstrap-414 .glyphicon-step-backward:before{content:"\e069"}.factory-bootstrap-414 .glyphicon-fast-backward:before{content:"\e070"}.factory-bootstrap-414 .glyphicon-backward:before{content:"\e071"}.factory-bootstrap-414 .glyphicon-play:before{content:"\e072"}.factory-bootstrap-414 .glyphicon-pause:before{content:"\e073"}.factory-bootstrap-414 .glyphicon-stop:before{content:"\e074"}.factory-bootstrap-414 .glyphicon-forward:before{content:"\e075"}.factory-bootstrap-414 .glyphicon-fast-forward:before{content:"\e076"}.factory-bootstrap-414 .glyphicon-step-forward:before{content:"\e077"}.factory-bootstrap-414 .glyphicon-eject:before{content:"\e078"}.factory-bootstrap-414 .glyphicon-chevron-left:before{content:"\e079"}.factory-bootstrap-414 .glyphicon-chevron-right:before{content:"\e080"}.factory-bootstrap-414 .glyphicon-plus-sign:before{content:"\e081"}.factory-bootstrap-414 .glyphicon-minus-sign:before{content:"\e082"}.factory-bootstrap-414 .glyphicon-remove-sign:before{content:"\e083"}.factory-bootstrap-414 .glyphicon-ok-sign:before{content:"\e084"}.factory-bootstrap-414 .glyphicon-question-sign:before{content:"\e085"}.factory-bootstrap-414 .glyphicon-info-sign:before{content:"\e086"}.factory-bootstrap-414 .glyphicon-screenshot:before{content:"\e087"}.factory-bootstrap-414 .glyphicon-remove-circle:before{content:"\e088"}.factory-bootstrap-414 .glyphicon-ok-circle:before{content:"\e089"}.factory-bootstrap-414 .glyphicon-ban-circle:before{content:"\e090"}.factory-bootstrap-414 .glyphicon-arrow-left:before{content:"\e091"}.factory-bootstrap-414 .glyphicon-arrow-right:before{content:"\e092"}.factory-bootstrap-414 .glyphicon-arrow-up:before{content:"\e093"}.factory-bootstrap-414 .glyphicon-arrow-down:before{content:"\e094"}.factory-bootstrap-414 .glyphicon-share-alt:before{content:"\e095"}.factory-bootstrap-414 .glyphicon-resize-full:before{content:"\e096"}.factory-bootstrap-414 .glyphicon-resize-small:before{content:"\e097"}.factory-bootstrap-414 .glyphicon-exclamation-sign:before{content:"\e101"}.factory-bootstrap-414 .glyphicon-gift:before{content:"\e102"}.factory-bootstrap-414 .glyphicon-leaf:before{content:"\e103"}.factory-bootstrap-414 .glyphicon-fire:before{content:"\e104"}.factory-bootstrap-414 .glyphicon-eye-open:before{content:"\e105"}.factory-bootstrap-414 .glyphicon-eye-close:before{content:"\e106"}.factory-bootstrap-414 .glyphicon-warning-sign:before{content:"\e107"}.factory-bootstrap-414 .glyphicon-plane:before{content:"\e108"}.factory-bootstrap-414 .glyphicon-calendar:before{content:"\e109"}.factory-bootstrap-414 .glyphicon-random:before{content:"\e110"}.factory-bootstrap-414 .glyphicon-comment:before{content:"\e111"}.factory-bootstrap-414 .glyphicon-magnet:before{content:"\e112"}.factory-bootstrap-414 .glyphicon-chevron-up:before{content:"\e113"}.factory-bootstrap-414 .glyphicon-chevron-down:before{content:"\e114"}.factory-bootstrap-414 .glyphicon-retweet:before{content:"\e115"}.factory-bootstrap-414 .glyphicon-shopping-cart:before{content:"\e116"}.factory-bootstrap-414 .glyphicon-folder-close:before{content:"\e117"}.factory-bootstrap-414 .glyphicon-folder-open:before{content:"\e118"}.factory-bootstrap-414 .glyphicon-resize-vertical:before{content:"\e119"}.factory-bootstrap-414 .glyphicon-resize-horizontal:before{content:"\e120"}.factory-bootstrap-414 .glyphicon-hdd:before{content:"\e121"}.factory-bootstrap-414 .glyphicon-bullhorn:before{content:"\e122"}.factory-bootstrap-414 .glyphicon-bell:before{content:"\e123"}.factory-bootstrap-414 .glyphicon-certificate:before{content:"\e124"}.factory-bootstrap-414 .glyphicon-thumbs-up:before{content:"\e125"}.factory-bootstrap-414 .glyphicon-thumbs-down:before{content:"\e126"}.factory-bootstrap-414 .glyphicon-hand-right:before{content:"\e127"}.factory-bootstrap-414 .glyphicon-hand-left:before{content:"\e128"}.factory-bootstrap-414 .glyphicon-hand-up:before{content:"\e129"}.factory-bootstrap-414 .glyphicon-hand-down:before{content:"\e130"}.factory-bootstrap-414 .glyphicon-circle-arrow-right:before{content:"\e131"}.factory-bootstrap-414 .glyphicon-circle-arrow-left:before{content:"\e132"}.factory-bootstrap-414 .glyphicon-circle-arrow-up:before{content:"\e133"}.factory-bootstrap-414 .glyphicon-circle-arrow-down:before{content:"\e134"}.factory-bootstrap-414 .glyphicon-globe:before{content:"\e135"}.factory-bootstrap-414 .glyphicon-wrench:before{content:"\e136"}.factory-bootstrap-414 .glyphicon-tasks:before{content:"\e137"}.factory-bootstrap-414 .glyphicon-filter:before{content:"\e138"}.factory-bootstrap-414 .glyphicon-briefcase:before{content:"\e139"}.factory-bootstrap-414 .glyphicon-fullscreen:before{content:"\e140"}.factory-bootstrap-414 .glyphicon-dashboard:before{content:"\e141"}.factory-bootstrap-414 .glyphicon-paperclip:before{content:"\e142"}.factory-bootstrap-414 .glyphicon-heart-empty:before{content:"\e143"}.factory-bootstrap-414 .glyphicon-link:before{content:"\e144"}.factory-bootstrap-414 .glyphicon-phone:before{content:"\e145"}.factory-bootstrap-414 .glyphicon-pushpin:before{content:"\e146"}.factory-bootstrap-414 .glyphicon-usd:before{content:"\e148"}.factory-bootstrap-414 .glyphicon-gbp:before{content:"\e149"}.factory-bootstrap-414 .glyphicon-sort:before{content:"\e150"}.factory-bootstrap-414 .glyphicon-sort-by-alphabet:before{content:"\e151"}.factory-bootstrap-414 .glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.factory-bootstrap-414 .glyphicon-sort-by-order:before{content:"\e153"}.factory-bootstrap-414 .glyphicon-sort-by-order-alt:before{content:"\e154"}.factory-bootstrap-414 .glyphicon-sort-by-attributes:before{content:"\e155"}.factory-bootstrap-414 .glyphicon-sort-by-attributes-alt:before{content:"\e156"}.factory-bootstrap-414 .glyphicon-unchecked:before{content:"\e157"}.factory-bootstrap-414 .glyphicon-expand:before{content:"\e158"}.factory-bootstrap-414 .glyphicon-collapse-down:before{content:"\e159"}.factory-bootstrap-414 .glyphicon-collapse-up:before{content:"\e160"}.factory-bootstrap-414 .glyphicon-log-in:before{content:"\e161"}.factory-bootstrap-414 .glyphicon-flash:before{content:"\e162"}.factory-bootstrap-414 .glyphicon-log-out:before{content:"\e163"}.factory-bootstrap-414 .glyphicon-new-window:before{content:"\e164"}.factory-bootstrap-414 .glyphicon-record:before{content:"\e165"}.factory-bootstrap-414 .glyphicon-save:before{content:"\e166"}.factory-bootstrap-414 .glyphicon-open:before{content:"\e167"}.factory-bootstrap-414 .glyphicon-saved:before{content:"\e168"}.factory-bootstrap-414 .glyphicon-import:before{content:"\e169"}.factory-bootstrap-414 .glyphicon-export:before{content:"\e170"}.factory-bootstrap-414 .glyphicon-send:before{content:"\e171"}.factory-bootstrap-414 .glyphicon-floppy-disk:before{content:"\e172"}.factory-bootstrap-414 .glyphicon-floppy-saved:before{content:"\e173"}.factory-bootstrap-414 .glyphicon-floppy-remove:before{content:"\e174"}.factory-bootstrap-414 .glyphicon-floppy-save:before{content:"\e175"}.factory-bootstrap-414 .glyphicon-floppy-open:before{content:"\e176"}.factory-bootstrap-414 .glyphicon-credit-card:before{content:"\e177"}.factory-bootstrap-414 .glyphicon-transfer:before{content:"\e178"}.factory-bootstrap-414 .glyphicon-cutlery:before{content:"\e179"}.factory-bootstrap-414 .glyphicon-header:before{content:"\e180"}.factory-bootstrap-414 .glyphicon-compressed:before{content:"\e181"}.factory-bootstrap-414 .glyphicon-earphone:before{content:"\e182"}.factory-bootstrap-414 .glyphicon-phone-alt:before{content:"\e183"}.factory-bootstrap-414 .glyphicon-tower:before{content:"\e184"}.factory-bootstrap-414 .glyphicon-stats:before{content:"\e185"}.factory-bootstrap-414 .glyphicon-sd-video:before{content:"\e186"}.factory-bootstrap-414 .glyphicon-hd-video:before{content:"\e187"}.factory-bootstrap-414 .glyphicon-subtitles:before{content:"\e188"}.factory-bootstrap-414 .glyphicon-sound-stereo:before{content:"\e189"}.factory-bootstrap-414 .glyphicon-sound-dolby:before{content:"\e190"}.factory-bootstrap-414 .glyphicon-sound-5-1:before{content:"\e191"}.factory-bootstrap-414 .glyphicon-sound-6-1:before{content:"\e192"}.factory-bootstrap-414 .glyphicon-sound-7-1:before{content:"\e193"}.factory-bootstrap-414 .glyphicon-copyright-mark:before{content:"\e194"}.factory-bootstrap-414 .glyphicon-registration-mark:before{content:"\e195"}.factory-bootstrap-414 .glyphicon-cloud-download:before{content:"\e197"}.factory-bootstrap-414 .glyphicon-cloud-upload:before{content:"\e198"}.factory-bootstrap-414 .glyphicon-tree-conifer:before{content:"\e199"}.factory-bootstrap-414 .glyphicon-tree-deciduous:before{content:"\e200"}.factory-bootstrap-414 .caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.factory-bootstrap-414 .dropdown{position:relative}.factory-bootstrap-414 .dropdown-toggle:focus{outline:0}.factory-bootstrap-414 .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.factory-bootstrap-414 .dropdown-menu.pull-right{right:0;left:auto}.factory-bootstrap-414 .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.factory-bootstrap-414 .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429;color:#333;white-space:nowrap}.factory-bootstrap-414 .dropdown-menu>li>a:focus,.factory-bootstrap-414 .dropdown-menu>li>a:hover{color:#262626;text-decoration:none}.factory-bootstrap-414 .dropdown-menu>.active>a,.factory-bootstrap-414 .dropdown-menu>.active>a:focus,.factory-bootstrap-414 .dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0}.factory-bootstrap-414 .dropdown-menu>.disabled>a,.factory-bootstrap-414 .dropdown-menu>.disabled>a:focus,.factory-bootstrap-414 .dropdown-menu>.disabled>a:hover{color:#999}.factory-bootstrap-414 .dropdown-menu>.disabled>a:focus,.factory-bootstrap-414 .dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-414 .open>.dropdown-menu{display:block}.factory-bootstrap-414 .open>a{outline:0}.factory-bootstrap-414 .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.factory-bootstrap-414 .dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.factory-bootstrap-414 .pull-right>.dropdown-menu{right:0;left:auto}.factory-bootstrap-414 .dropup .caret,.factory-bootstrap-414 .navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.factory-bootstrap-414 .dropup .dropdown-menu,.factory-bootstrap-414 .navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.factory-bootstrap-414 .btn-group,.factory-bootstrap-414 .btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.factory-bootstrap-414 .btn-group-vertical>.btn,.factory-bootstrap-414 .btn-group>.btn{position:relative;float:left}.factory-bootstrap-414 .btn-group-vertical>.btn.active,.factory-bootstrap-414 .btn-group-vertical>.btn:active,.factory-bootstrap-414 .btn-group-vertical>.btn:focus,.factory-bootstrap-414 .btn-group-vertical>.btn:hover,.factory-bootstrap-414 .btn-group>.btn.active,.factory-bootstrap-414 .btn-group>.btn:active,.factory-bootstrap-414 .btn-group>.btn:focus,.factory-bootstrap-414 .btn-group>.btn:hover{z-index:2}.factory-bootstrap-414 .btn-group-vertical>.btn:focus,.factory-bootstrap-414 .btn-group>.btn:focus{outline:0}.factory-bootstrap-414 .btn-group .btn+.btn,.factory-bootstrap-414 .btn-group .btn+.btn-group,.factory-bootstrap-414 .btn-group .btn-group+.btn,.factory-bootstrap-414 .btn-group .btn-group+.btn-group{margin-left:-1px}.factory-bootstrap-414 .btn-toolbar:after,.factory-bootstrap-414 .btn-toolbar:before{display:table;content:" "}.factory-bootstrap-414 .btn-toolbar:after{clear:both}.factory-bootstrap-414 .btn-toolbar .btn-group{float:left}.factory-bootstrap-414 .btn-toolbar>.btn+.btn,.factory-bootstrap-414 .btn-toolbar>.btn+.btn-group,.factory-bootstrap-414 .btn-toolbar>.btn-group+.btn,.factory-bootstrap-414 .btn-toolbar>.btn-group+.btn-group{margin-left:5px}.factory-bootstrap-414 .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.factory-bootstrap-414 .btn-group>.btn:first-child{margin-left:0}.factory-bootstrap-414 .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.factory-bootstrap-414 .btn-group>.btn:last-child:not(:first-child),.factory-bootstrap-414 .btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .btn-group>.btn-group{float:left}.factory-bootstrap-414 .btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.factory-bootstrap-414 .btn-group>.btn-group:first-child>.btn:last-child,.factory-bootstrap-414 .btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.factory-bootstrap-414 .btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .btn-group .dropdown-toggle:active,.factory-bootstrap-414 .btn-group.open .dropdown-toggle{outline:0}.factory-bootstrap-414 .btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-414 .btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-414 .btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-414 .btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.factory-bootstrap-414 .btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.factory-bootstrap-414 .btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.factory-bootstrap-414 .btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.factory-bootstrap-414 .btn-group{border:4px solid #f9f9f9;border-radius:4px}.factory-bootstrap-414 .btn-group .btn.active.value{text-shadow:none;color:#fff;background-color:#33aad5;-webkit-box-shadow:inset 0 1px 1px #0074a2;box-shadow:inset 0 1px 3px #0074a2;border-top:1px solid #0074a2;border-bottom:1px solid #0074a2;border-left:1px solid #0074a2}.factory-bootstrap-414 .btn .caret{margin-left:0}.factory-bootstrap-414 .btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.factory-bootstrap-414 .dropup .btn-lg .caret{border-width:0 5px 5px}.factory-bootstrap-414 .btn-group-vertical>.btn,.factory-bootstrap-414 .btn-group-vertical>.btn-group,.factory-bootstrap-414 .btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.factory-bootstrap-414 .btn-group-vertical>.btn-group:after,.factory-bootstrap-414 .btn-group-vertical>.btn-group:before{display:table;content:" "}.factory-bootstrap-414 .btn-group-vertical>.btn-group:after{clear:both}.factory-bootstrap-414 .btn-group-vertical>.btn-group>.btn{float:none}.factory-bootstrap-414 .btn-group-vertical>.btn+.btn,.factory-bootstrap-414 .btn-group-vertical>.btn+.btn-group,.factory-bootstrap-414 .btn-group-vertical>.btn-group+.btn,.factory-bootstrap-414 .btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.factory-bootstrap-414 .btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.factory-bootstrap-414 .btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.factory-bootstrap-414 .btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:4px;border-top-left-radius:0}.factory-bootstrap-414 .btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.factory-bootstrap-414 .btn-group-vertical>.btn-group:first-child>.btn:last-child,.factory-bootstrap-414 .btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.factory-bootstrap-414 .btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .btn-group-justified{display:table;width:100%;border-collapse:separate;table-layout:fixed}.factory-bootstrap-414 .btn-group-justified>.btn,.factory-bootstrap-414 .btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.factory-bootstrap-414 .btn-group-justified>.btn-group .btn{width:100%}[data-toggle=buttons]>.btn>input[type=checkbox],[data-toggle=buttons]>.btn>input[type=radio]{display:none}.factory-bootstrap-414 .input-group{position:relative;display:table;border-collapse:separate}.factory-bootstrap-414 .input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.factory-bootstrap-414 .input-group .form-control{width:100%;margin-bottom:0}.factory-bootstrap-414 .input-group-lg>.form-control,.factory-bootstrap-414 .input-group-lg>.input-group-addon,.factory-bootstrap-414 .input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-414 select.input-group-lg>.form-control,.factory-bootstrap-414 select.input-group-lg>.input-group-addon,.factory-bootstrap-414 select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}.factory-bootstrap-414 textarea.input-group-lg>.form-control,.factory-bootstrap-414 textarea.input-group-lg>.input-group-addon,.factory-bootstrap-414 textarea.input-group-lg>.input-group-btn>.btn{height:auto}.factory-bootstrap-414 .input-group-sm>.form-control,.factory-bootstrap-414 .input-group-sm>.input-group-addon,.factory-bootstrap-414 .input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-414 select.input-group-sm>.form-control,.factory-bootstrap-414 select.input-group-sm>.input-group-addon,.factory-bootstrap-414 select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}.factory-bootstrap-414 textarea.input-group-sm>.form-control,.factory-bootstrap-414 textarea.input-group-sm>.input-group-addon,.factory-bootstrap-414 textarea.input-group-sm>.input-group-btn>.btn{height:auto}.factory-bootstrap-414 .input-group .form-control,.factory-bootstrap-414 .input-group-addon,.factory-bootstrap-414 .input-group-btn{display:table-cell}.factory-bootstrap-414 .input-group .form-control:not(:first-child):not(:last-child),.factory-bootstrap-414 .input-group-addon:not(:first-child):not(:last-child),.factory-bootstrap-414 .input-group-btn:not(:first-child):not(:last-child){border-radius:0}.factory-bootstrap-414 .input-group-addon,.factory-bootstrap-414 .input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.factory-bootstrap-414 .input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.factory-bootstrap-414 .input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.factory-bootstrap-414 .input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.factory-bootstrap-414 .input-group-addon input[type=checkbox],.factory-bootstrap-414 .input-group-addon input[type=radio]{margin-top:0}.factory-bootstrap-414 .input-group .form-control:first-child,.factory-bootstrap-414 .input-group-addon:first-child,.factory-bootstrap-414 .input-group-btn:first-child>.btn,.factory-bootstrap-414 .input-group-btn:first-child>.dropdown-toggle,.factory-bootstrap-414 .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.factory-bootstrap-414 .input-group-addon:first-child{border-right:0}.factory-bootstrap-414 .input-group .form-control:last-child,.factory-bootstrap-414 .input-group-addon:last-child,.factory-bootstrap-414 .input-group-btn:first-child>.btn:not(:first-child),.factory-bootstrap-414 .input-group-btn:last-child>.btn,.factory-bootstrap-414 .input-group-btn:last-child>.dropdown-toggle{border-bottom-left-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .input-group-addon:last-child{border-left:0}.factory-bootstrap-414 .input-group-btn{position:relative;white-space:nowrap}.factory-bootstrap-414 .input-group-btn:first-child>.btn{margin-right:-1px}.factory-bootstrap-414 .input-group-btn:last-child>.btn{margin-left:-1px}.factory-bootstrap-414 .input-group-btn>.btn{position:relative}.factory-bootstrap-414 .input-group-btn>.btn+.btn{margin-left:-4px}.factory-bootstrap-414 .input-group-btn>.btn:active,.factory-bootstrap-414 .input-group-btn>.btn:hover{z-index:2}.factory-bootstrap-414 .nav{padding-left:0;margin-bottom:0;list-style:none}.factory-bootstrap-414 .nav:after,.factory-bootstrap-414 .nav:before{display:table;content:" "}.factory-bootstrap-414 .nav:after{clear:both}.factory-bootstrap-414 .nav>li{position:relative;display:block}.factory-bootstrap-414 .nav>li>a{position:relative;display:block;padding:10px 15px}.factory-bootstrap-414 .nav>li>a:focus,.factory-bootstrap-414 .nav>li>a:hover{text-decoration:none;background-color:#eee}.factory-bootstrap-414 .nav>li.disabled>a{color:#999}.factory-bootstrap-414 .nav>li.disabled>a:focus,.factory-bootstrap-414 .nav>li.disabled>a:hover{color:#999;text-decoration:none;cursor:not-allowed;background-color:transparent}.factory-bootstrap-414 .nav .open>a,.factory-bootstrap-414 .nav .open>a:focus,.factory-bootstrap-414 .nav .open>a:hover{background-color:#eee;border-color:#428bca}.factory-bootstrap-414 .nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.factory-bootstrap-414 .nav>li>a>img{max-width:none}.factory-bootstrap-414 .nav-tabs{border-bottom:1px solid #ddd}.factory-bootstrap-414 .nav-tabs>li{float:left;margin-bottom:-1px}.factory-bootstrap-414 .nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0}.factory-bootstrap-414 .nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.factory-bootstrap-414 .nav-tabs>li.active>a,.factory-bootstrap-414 .nav-tabs>li.active>a:focus,.factory-bootstrap-414 .nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.factory-bootstrap-414 .nav-tabs.nav-justified{width:100%;border-bottom:0}.factory-bootstrap-414 .nav-tabs.nav-justified>li{float:none}.factory-bootstrap-414 .nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.factory-bootstrap-414 .nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.factory-bootstrap-414 .nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.factory-bootstrap-414 .nav-tabs.nav-justified>.active>a,.factory-bootstrap-414 .nav-tabs.nav-justified>.active>a:focus,.factory-bootstrap-414 .nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.factory-bootstrap-414 .nav-pills>li{float:left}.factory-bootstrap-414 .nav-pills>li>a{border-radius:4px}.factory-bootstrap-414 .nav-pills>li+li{margin-left:2px}.factory-bootstrap-414 .nav-pills>li.active>a,.factory-bootstrap-414 .nav-pills>li.active>a:focus,.factory-bootstrap-414 .nav-pills>li.active>a:hover{color:#fff;background-color:#428bca}.factory-bootstrap-414 .nav-stacked>li{float:none}.factory-bootstrap-414 .nav-stacked>li+li{margin-top:2px;margin-left:0}.factory-bootstrap-414 .nav-justified{width:100%}.factory-bootstrap-414 .nav-justified>li{float:none}.factory-bootstrap-414 .nav-justified>li>a{margin-bottom:5px;text-align:center}.factory-bootstrap-414 .nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.factory-bootstrap-414 .nav-tabs-justified{border-bottom:0}.factory-bootstrap-414 .nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.factory-bootstrap-414 .nav-tabs-justified>.active>a,.factory-bootstrap-414 .nav-tabs-justified>.active>a:focus,.factory-bootstrap-414 .nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.factory-bootstrap-414 .tab-content>.tab-pane{display:none}.factory-bootstrap-414 .tab-content>.active{display:block}.factory-bootstrap-414 .nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}.factory-bootstrap-414 .navbar:after,.factory-bootstrap-414 .navbar:before{display:table;content:" "}.factory-bootstrap-414 .navbar:after{clear:both}@media (min-width:768px){.navbar{border-radius:4px}}.factory-bootstrap-414 .navbar-header:after,.factory-bootstrap-414 .navbar-header:before{display:table;content:" "}.factory-bootstrap-414 .navbar-header:after{clear:both}@media (min-width:768px){.navbar-header{float:left}}.factory-bootstrap-414 .navbar-collapse{max-height:340px;padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.factory-bootstrap-414 .navbar-collapse:after,.factory-bootstrap-414 .navbar-collapse:before{display:table;content:" "}.factory-bootstrap-414 .navbar-collapse:after{clear:both}.factory-bootstrap-414 .navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.factory-bootstrap-414 .container>.navbar-collapse,.factory-bootstrap-414 .container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.factory-bootstrap-414 .navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.factory-bootstrap-414 .navbar-fixed-bottom,.factory-bootstrap-414 .navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.factory-bootstrap-414 .navbar-fixed-top{top:0;border-width:0 0 1px}.factory-bootstrap-414 .navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.factory-bootstrap-414 .navbar-brand{float:left;padding:15px;font-size:18px;line-height:20px}.factory-bootstrap-414 .navbar-brand:focus,.factory-bootstrap-414 .navbar-brand:hover{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.factory-bootstrap-414 .navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.factory-bootstrap-414 .navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.factory-bootstrap-414 .navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.factory-bootstrap-414 .navbar-nav{margin:7.5px -15px}.factory-bootstrap-414 .navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.factory-bootstrap-414 .navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form select.form-control{width:auto}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{float:none;margin-left:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.factory-bootstrap-414 .navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.factory-bootstrap-414 .navbar-nav.pull-right>li>.dropdown-menu,.factory-bootstrap-414 .navbar-nav>li>.dropdown-menu.pull-right{right:0;left:auto}.factory-bootstrap-414 .navbar-btn{margin-top:8px;margin-bottom:8px}.factory-bootstrap-414 .navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.factory-bootstrap-414 .navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.factory-bootstrap-414 .navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.factory-bootstrap-414 .navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.factory-bootstrap-414 .navbar-default .navbar-brand{color:#777}.factory-bootstrap-414 .navbar-default .navbar-brand:focus,.factory-bootstrap-414 .navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.factory-bootstrap-414 .navbar-default .navbar-nav>li>a,.factory-bootstrap-414 .navbar-default .navbar-text{color:#777}.factory-bootstrap-414 .navbar-default .navbar-nav>li>a:focus,.factory-bootstrap-414 .navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.factory-bootstrap-414 .navbar-default .navbar-nav>.active>a,.factory-bootstrap-414 .navbar-default .navbar-nav>.active>a:focus,.factory-bootstrap-414 .navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.factory-bootstrap-414 .navbar-default .navbar-nav>.disabled>a,.factory-bootstrap-414 .navbar-default .navbar-nav>.disabled>a:focus,.factory-bootstrap-414 .navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.factory-bootstrap-414 .navbar-default .navbar-toggle{border-color:#ddd}.factory-bootstrap-414 .navbar-default .navbar-toggle:focus,.factory-bootstrap-414 .navbar-default .navbar-toggle:hover{background-color:#ddd}.factory-bootstrap-414 .navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.factory-bootstrap-414 .navbar-default .navbar-collapse,.factory-bootstrap-414 .navbar-default .navbar-form{border-color:#e7e7e7}.factory-bootstrap-414 .navbar-default .navbar-nav>.open>a,.factory-bootstrap-414 .navbar-default .navbar-nav>.open>a:focus,.factory-bootstrap-414 .navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.factory-bootstrap-414 .navbar-default .navbar-link{color:#777}.factory-bootstrap-414 .navbar-default .navbar-link:hover{color:#333}.factory-bootstrap-414 .navbar-inverse{background-color:#222;border-color:#080808}.factory-bootstrap-414 .navbar-inverse .navbar-brand{color:#999}.factory-bootstrap-414 .navbar-inverse .navbar-brand:focus,.factory-bootstrap-414 .navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.factory-bootstrap-414 .navbar-inverse .navbar-nav>li>a,.factory-bootstrap-414 .navbar-inverse .navbar-text{color:#999}.factory-bootstrap-414 .navbar-inverse .navbar-nav>li>a:focus,.factory-bootstrap-414 .navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.factory-bootstrap-414 .navbar-inverse .navbar-nav>.active>a,.factory-bootstrap-414 .navbar-inverse .navbar-nav>.active>a:focus,.factory-bootstrap-414 .navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.factory-bootstrap-414 .navbar-inverse .navbar-nav>.disabled>a,.factory-bootstrap-414 .navbar-inverse .navbar-nav>.disabled>a:focus,.factory-bootstrap-414 .navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.factory-bootstrap-414 .navbar-inverse .navbar-toggle{border-color:#333}.factory-bootstrap-414 .navbar-inverse .navbar-toggle:focus,.factory-bootstrap-414 .navbar-inverse .navbar-toggle:hover{background-color:#333}.factory-bootstrap-414 .navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.factory-bootstrap-414 .navbar-inverse .navbar-collapse,.factory-bootstrap-414 .navbar-inverse .navbar-form{border-color:#101010}.factory-bootstrap-414 .navbar-inverse .navbar-nav>.open>a,.factory-bootstrap-414 .navbar-inverse .navbar-nav>.open>a:focus,.factory-bootstrap-414 .navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.factory-bootstrap-414 .navbar-inverse .navbar-link{color:#999}.factory-bootstrap-414 .navbar-inverse .navbar-link:hover{color:#fff}.factory-bootstrap-414 .breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.factory-bootstrap-414 .breadcrumb>li{display:inline-block}.factory-bootstrap-414 .breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.factory-bootstrap-414 .breadcrumb>.active{color:#999}.factory-bootstrap-414 .pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.factory-bootstrap-414 .pagination>li{display:inline}.factory-bootstrap-414 .pagination>li>a,.factory-bootstrap-414 .pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd}.factory-bootstrap-414 .pagination>li:first-child>a,.factory-bootstrap-414 .pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.factory-bootstrap-414 .pagination>li:last-child>a,.factory-bootstrap-414 .pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.factory-bootstrap-414 .pagination>li>a:focus,.factory-bootstrap-414 .pagination>li>a:hover,.factory-bootstrap-414 .pagination>li>span:focus,.factory-bootstrap-414 .pagination>li>span:hover{background-color:#eee}.factory-bootstrap-414 .pagination>.active>a,.factory-bootstrap-414 .pagination>.active>a:focus,.factory-bootstrap-414 .pagination>.active>a:hover,.factory-bootstrap-414 .pagination>.active>span,.factory-bootstrap-414 .pagination>.active>span:focus,.factory-bootstrap-414 .pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#1e8cbe;border-color:#0074a2}.factory-bootstrap-414 .pagination>.disabled>a,.factory-bootstrap-414 .pagination>.disabled>a:focus,.factory-bootstrap-414 .pagination>.disabled>a:hover,.factory-bootstrap-414 .pagination>.disabled>span,.factory-bootstrap-414 .pagination>.disabled>span:focus,.factory-bootstrap-414 .pagination>.disabled>span:hover{color:#999;cursor:not-allowed;background-color:#fff;border-color:#ddd}.factory-bootstrap-414 .pagination-lg>li>a,.factory-bootstrap-414 .pagination-lg>li>span{padding:10px 16px;font-size:18px}.factory-bootstrap-414 .pagination-lg>li:first-child>a,.factory-bootstrap-414 .pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.factory-bootstrap-414 .pagination-lg>li:last-child>a,.factory-bootstrap-414 .pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.factory-bootstrap-414 .pagination-sm>li>a,.factory-bootstrap-414 .pagination-sm>li>span{padding:5px 10px;font-size:12px}.factory-bootstrap-414 .pagination-sm>li:first-child>a,.factory-bootstrap-414 .pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.factory-bootstrap-414 .pagination-sm>li:last-child>a,.factory-bootstrap-414 .pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.factory-bootstrap-414 .pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.factory-bootstrap-414 .pager:after,.factory-bootstrap-414 .pager:before{display:table;content:" "}.factory-bootstrap-414 .pager:after{clear:both}.factory-bootstrap-414 .pager li{display:inline}.factory-bootstrap-414 .pager li>a,.factory-bootstrap-414 .pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.factory-bootstrap-414 .pager li>a:focus,.factory-bootstrap-414 .pager li>a:hover{text-decoration:none;background-color:#eee}.factory-bootstrap-414 .pager .next>a,.factory-bootstrap-414 .pager .next>span{float:right}.factory-bootstrap-414 .pager .previous>a,.factory-bootstrap-414 .pager .previous>span{float:left}.factory-bootstrap-414 .pager .disabled>a,.factory-bootstrap-414 .pager .disabled>a:focus,.factory-bootstrap-414 .pager .disabled>a:hover,.factory-bootstrap-414 .pager .disabled>span{color:#999;cursor:not-allowed;background-color:#fff}.factory-bootstrap-414 .label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.factory-bootstrap-414 .label[href]:focus,.factory-bootstrap-414 .label[href]:hover{color:#fff;text-decoration:none;cursor:pointer}.factory-bootstrap-414 .label:empty{display:none}.factory-bootstrap-414 .btn .label{position:relative;top:-1px}.factory-bootstrap-414 .label-default{background-color:#999}.factory-bootstrap-414 .label-default[href]:focus,.factory-bootstrap-414 .label-default[href]:hover{background-color:gray}.factory-bootstrap-414 .label-primary{background-color:#428bca}.factory-bootstrap-414 .label-primary[href]:focus,.factory-bootstrap-414 .label-primary[href]:hover{background-color:#3071a9}.factory-bootstrap-414 .label-success{background-color:#5cb85c}.factory-bootstrap-414 .label-success[href]:focus,.factory-bootstrap-414 .label-success[href]:hover{background-color:#449d44}.factory-bootstrap-414 .label-info{background-color:#5bc0de}.factory-bootstrap-414 .label-info[href]:focus,.factory-bootstrap-414 .label-info[href]:hover{background-color:#31b0d5}.factory-bootstrap-414 .label-warning{background-color:#f0ad4e}.factory-bootstrap-414 .label-warning[href]:focus,.factory-bootstrap-414 .label-warning[href]:hover{background-color:#ec971f}.factory-bootstrap-414 .label-danger{background-color:#d9534f}.factory-bootstrap-414 .label-danger[href]:focus,.factory-bootstrap-414 .label-danger[href]:hover{background-color:#c9302c}.factory-bootstrap-414 .badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#999;border-radius:10px}.factory-bootstrap-414 .badge:empty{display:none}.factory-bootstrap-414 .btn .badge{position:relative;top:-1px}.factory-bootstrap-414 a.badge:focus,.factory-bootstrap-414 a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.factory-bootstrap-414 .nav-pills>.active>a>.badge,.factory-bootstrap-414 a.list-group-item.active>.badge{color:#428bca;background-color:#fff}.factory-bootstrap-414 .nav-pills>li>a>.badge{margin-left:3px}.factory-bootstrap-414 .jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.factory-bootstrap-414 .jumbotron .h1,.factory-bootstrap-414 .jumbotron h1{line-height:1;color:inherit}.factory-bootstrap-414 .jumbotron p{line-height:1.4}.factory-bootstrap-414 .container .jumbotron{border-radius:6px}.factory-bootstrap-414 .jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.factory-bootstrap-414 .thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.factory-bootstrap-414 .thumbnail a>img,.factory-bootstrap-414 .thumbnail>img{display:block;height:auto;max-width:100%;margin-right:auto;margin-left:auto}.factory-bootstrap-414 a.thumbnail.active,.factory-bootstrap-414 a.thumbnail:focus,.factory-bootstrap-414 a.thumbnail:hover{border-color:#428bca}.factory-bootstrap-414 .thumbnail .caption{padding:9px;color:#333}.factory-bootstrap-414 .alert{border:1px solid transparent;border-radius:4px}.factory-bootstrap-414 .alert h4{margin-top:0;color:inherit}.factory-bootstrap-414 .alert .alert-link{font-weight:700}.factory-bootstrap-414 .alert>p,.factory-bootstrap-414 .alert>ul{margin-bottom:0}.factory-bootstrap-414 .alert>p+p{margin-top:5px}.factory-bootstrap-414 .alert-dismissable{padding-right:35px}.factory-bootstrap-414 .alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.factory-bootstrap-414 .alert-info{color:#31708f;background-color:#d9edf7}.factory-bootstrap-414 .alert-info hr{border-top-color:#a6e1ec}.factory-bootstrap-414 .alert-info .alert-link{color:#245269}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.factory-bootstrap-414 .progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.factory-bootstrap-414 .progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#2ea2cc;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.factory-bootstrap-414 .progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.factory-bootstrap-414 .progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.factory-bootstrap-414 .progress-bar-success{background-color:#5cb85c}.factory-bootstrap-414 .progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-414 .progress-bar-info{background-color:#5bc0de}.factory-bootstrap-414 .progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-414 .progress-bar-warning{background-color:#f0ad4e}.factory-bootstrap-414 .progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-414 .progress-bar-danger{background-color:#d9534f}.factory-bootstrap-414 .progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-414 .media,.factory-bootstrap-414 .media-body{overflow:hidden;zoom:1}.factory-bootstrap-414 .media,.factory-bootstrap-414 .media .media{margin-top:15px}.factory-bootstrap-414 .media:first-child{margin-top:0}.factory-bootstrap-414 .media-object{display:block}.factory-bootstrap-414 .media-heading{margin:0 0 5px}.factory-bootstrap-414 .media>.pull-left{margin-right:10px}.factory-bootstrap-414 .media>.pull-right{margin-left:10px}.factory-bootstrap-414 .media-list{padding-left:0;list-style:none}.factory-bootstrap-414 .list-group{padding-left:0;margin-bottom:20px}.factory-bootstrap-414 .list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.factory-bootstrap-414 .list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.factory-bootstrap-414 .list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.factory-bootstrap-414 .list-group-item>.badge{float:right}.factory-bootstrap-414 .list-group-item>.badge+.badge{margin-right:5px}.factory-bootstrap-414 a.list-group-item{color:#555}.factory-bootstrap-414 a.list-group-item .list-group-item-heading{color:#333}.factory-bootstrap-414 a.list-group-item:focus,.factory-bootstrap-414 a.list-group-item:hover{text-decoration:none;background-color:#f5f5f5}.factory-bootstrap-414 a.list-group-item.active,.factory-bootstrap-414 a.list-group-item.active:focus,.factory-bootstrap-414 a.list-group-item.active:hover{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.factory-bootstrap-414 a.list-group-item.active .list-group-item-heading,.factory-bootstrap-414 a.list-group-item.active:focus .list-group-item-heading,.factory-bootstrap-414 a.list-group-item.active:hover .list-group-item-heading{color:inherit}.factory-bootstrap-414 a.list-group-item.active .list-group-item-text,.factory-bootstrap-414 a.list-group-item.active:focus .list-group-item-text,.factory-bootstrap-414 a.list-group-item.active:hover .list-group-item-text{color:#e1edf7}.factory-bootstrap-414 .list-group-item-heading{margin-top:0;margin-bottom:5px}.factory-bootstrap-414 .list-group-item-text{margin-bottom:0;line-height:1.3}.factory-bootstrap-414 .panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px}.factory-bootstrap-414 .panel-body{padding:15px}.factory-bootstrap-414 .panel-body:after,.factory-bootstrap-414 .panel-body:before{display:table;content:" "}.factory-bootstrap-414 .panel-body:after{clear:both}.factory-bootstrap-414 .panel>.list-group{margin-bottom:0}.factory-bootstrap-414 .panel>.list-group .list-group-item{border-width:1px 0}.factory-bootstrap-414 .panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-414 .panel>.list-group .list-group-item:last-child{border-bottom:0}.factory-bootstrap-414 .panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.factory-bootstrap-414 .panel>.table,.factory-bootstrap-414 .panel>.table-responsive>.table{margin-bottom:0}.factory-bootstrap-414 .panel>.panel-body+.table,.factory-bootstrap-414 .panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.factory-bootstrap-414 .panel>.table>tbody:first-child td,.factory-bootstrap-414 .panel>.table>tbody:first-child th{border-top:0}.factory-bootstrap-414 .panel>.table-bordered,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered{border:0}.factory-bootstrap-414 .panel>.table-bordered>tbody>tr>td:first-child,.factory-bootstrap-414 .panel>.table-bordered>tbody>tr>th:first-child,.factory-bootstrap-414 .panel>.table-bordered>tfoot>tr>td:first-child,.factory-bootstrap-414 .panel>.table-bordered>tfoot>tr>th:first-child,.factory-bootstrap-414 .panel>.table-bordered>thead>tr>td:first-child,.factory-bootstrap-414 .panel>.table-bordered>thead>tr>th:first-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.factory-bootstrap-414 .panel>.table-bordered>tbody>tr>td:last-child,.factory-bootstrap-414 .panel>.table-bordered>tbody>tr>th:last-child,.factory-bootstrap-414 .panel>.table-bordered>tfoot>tr>td:last-child,.factory-bootstrap-414 .panel>.table-bordered>tfoot>tr>th:last-child,.factory-bootstrap-414 .panel>.table-bordered>thead>tr>td:last-child,.factory-bootstrap-414 .panel>.table-bordered>thead>tr>th:last-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.factory-bootstrap-414 .panel>.table-bordered>tbody>tr:last-child>td,.factory-bootstrap-414 .panel>.table-bordered>tbody>tr:last-child>th,.factory-bootstrap-414 .panel>.table-bordered>tfoot>tr:last-child>td,.factory-bootstrap-414 .panel>.table-bordered>tfoot>tr:last-child>th,.factory-bootstrap-414 .panel>.table-bordered>thead>tr:last-child>td,.factory-bootstrap-414 .panel>.table-bordered>thead>tr:last-child>th,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>thead>tr:last-child>td,.factory-bootstrap-414 .panel>.table-responsive>.table-bordered>thead>tr:last-child>th{border-bottom:0}.factory-bootstrap-414 .panel>.table-responsive{margin-bottom:0;border:0}.factory-bootstrap-414 .panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.factory-bootstrap-414 .panel-heading>.dropdown .dropdown-toggle{color:inherit}.factory-bootstrap-414 .panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.factory-bootstrap-414 .panel-title>a{color:inherit}.factory-bootstrap-414 .panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.factory-bootstrap-414 .panel-group .panel{margin-bottom:0;overflow:hidden;border-radius:4px}.factory-bootstrap-414 .panel-group .panel+.panel{margin-top:5px}.factory-bootstrap-414 .panel-group .panel-heading{border-bottom:0}.factory-bootstrap-414 .panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.factory-bootstrap-414 .panel-group .panel-footer{border-top:0}.factory-bootstrap-414 .panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.factory-bootstrap-414 .panel-default{border-color:#ddd}.factory-bootstrap-414 .panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.factory-bootstrap-414 .panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.factory-bootstrap-414 .panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.factory-bootstrap-414 .panel-primary{border-color:#428bca}.factory-bootstrap-414 .panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.factory-bootstrap-414 .panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.factory-bootstrap-414 .panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.factory-bootstrap-414 .panel-success{border-color:#d6e9c6}.factory-bootstrap-414 .panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.factory-bootstrap-414 .panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.factory-bootstrap-414 .panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.factory-bootstrap-414 .panel-warning{border-color:#faebcc}.factory-bootstrap-414 .panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.factory-bootstrap-414 .panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.factory-bootstrap-414 .panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.factory-bootstrap-414 .panel-danger{border-color:#ebccd1}.factory-bootstrap-414 .panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.factory-bootstrap-414 .panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.factory-bootstrap-414 .panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.factory-bootstrap-414 .panel-info{border-color:#bce8f1}.factory-bootstrap-414 .panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.factory-bootstrap-414 .panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.factory-bootstrap-414 .panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.factory-bootstrap-414 .well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px}.factory-bootstrap-414 .well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.factory-bootstrap-414 .well-lg{padding:24px;border-radius:6px}.factory-bootstrap-414 .well-sm{padding:9px;border-radius:3px}.factory-bootstrap-414 .close{float:right;font-size:14px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.factory-bootstrap-414 .alert .close{position:relative;top:-8px;right:-7px}.factory-bootstrap-414 .close:focus,.factory-bootstrap-414 .close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.factory-bootstrap-414 button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.factory-bootstrap-414 .modal-open{overflow:hidden}.factory-bootstrap-414 .modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:auto;overflow-y:scroll;width:auto;margin-left:0;background-color:transparent;border:0}.factory-bootstrap-414 .modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.factory-bootstrap-414 .modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.factory-bootstrap-414 .modal-dialog{position:relative;z-index:1050;width:auto;margin:10px}.factory-bootstrap-414 .modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box}.factory-bootstrap-414 .modal-backdrop,.factory-bootstrap-414-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.factory-bootstrap-414 .modal-backdrop.fade,.factory-bootstrap-414-modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.factory-bootstrap-414 .modal-backdrop.in,.factory-bootstrap-414-modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.factory-bootstrap-414 .modal-header{min-height:16.428571429px;padding:15px;border-bottom:1px solid #e5e5e5}.factory-bootstrap-414 .modal-header .close{margin-top:-2px}.factory-bootstrap-414 .modal-title{margin:0;line-height:1.428571429}.factory-bootstrap-414 .modal-body{position:relative;padding:20px;max-height:none}.factory-bootstrap-414 .modal-footer{padding:19px 20px 20px;margin-top:15px;text-align:right;border-top:1px solid #e5e5e5}.factory-bootstrap-414 .modal-footer:after,.factory-bootstrap-414 .modal-footer:before{display:table;content:" "}.factory-bootstrap-414 .modal-footer:after{clear:both}.factory-bootstrap-414 .modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.factory-bootstrap-414 .modal-footer .btn-group .btn+.btn{margin-left:-1px}.factory-bootstrap-414 .modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.factory-bootstrap-414 .modal-dialog{width:600px;margin:30px auto}.factory-bootstrap-414 .modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}}.factory-bootstrap-414 .tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.factory-bootstrap-414 .tooltip.in{opacity:.9;filter:alpha(opacity=90)}.factory-bootstrap-414 .tooltip.top{padding:5px 0;margin-top:-3px}.factory-bootstrap-414 .tooltip.right{padding:0 5px;margin-left:3px}.factory-bootstrap-414 .tooltip.bottom{padding:5px 0;margin-top:3px}.factory-bootstrap-414 .tooltip.left{padding:0 5px;margin-left:-3px}.factory-bootstrap-414 .tooltip-inner{width:400px;padding:15px 20px;color:#fff;text-align:left;text-decoration:none;background-color:#673ab7;border-radius:3px}.factory-bootstrap-414 .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.factory-bootstrap-414 .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#673ab7;border-width:5px 5px 0}.factory-bootstrap-414 .tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-top-color:#673ab7;border-width:5px 5px 0}.factory-bootstrap-414 .tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-top-color:#673ab7;border-width:5px 5px 0}.factory-bootstrap-414 .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#673ab7;border-width:5px 5px 5px 0}.factory-bootstrap-414 .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#673ab7;border-width:5px 0 5px 5px}.factory-bootstrap-414 .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#673ab7;border-width:0 5px 5px}.factory-bootstrap-414 .tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-bottom-color:#673ab7;border-width:0 5px 5px}.factory-bootstrap-414 .tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-bottom-color:#673ab7;border-width:0 5px 5px}.factory-bootstrap-414 .popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);background-clip:padding-box}.factory-bootstrap-414 .popover.top{margin-top:-10px}.factory-bootstrap-414 .popover.right{margin-left:10px}.factory-bootstrap-414 .popover.bottom{margin-top:10px}.factory-bootstrap-414 .popover.left{margin-left:-10px}.factory-bootstrap-414 .popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.factory-bootstrap-414 .popover-content{padding:9px 14px}.factory-bootstrap-414 .popover .arrow,.factory-bootstrap-414 .popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.factory-bootstrap-414 .popover .arrow{border-width:11px}.factory-bootstrap-414 .popover .arrow:after{border-width:10px;content:""}.factory-bootstrap-414 .popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.factory-bootstrap-414 .popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0;content:" "}.factory-bootstrap-414 .popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.factory-bootstrap-414 .popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0;content:" "}.factory-bootstrap-414 .popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);border-top-width:0}.factory-bootstrap-414 .popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0;content:" "}.factory-bootstrap-414 .popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,.25);border-right-width:0}.factory-bootstrap-414 .popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0;content:" "}.factory-bootstrap-414 .carousel{position:relative}.factory-bootstrap-414 .carousel-inner{position:relative;width:100%;overflow:hidden}.factory-bootstrap-414 .carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.factory-bootstrap-414 .carousel-inner>.item>a>img,.factory-bootstrap-414 .carousel-inner>.item>img{display:block;height:auto;max-width:100%;line-height:1}.factory-bootstrap-414 .carousel-inner>.active,.factory-bootstrap-414 .carousel-inner>.next,.factory-bootstrap-414 .carousel-inner>.prev{display:block}.factory-bootstrap-414 .carousel-inner>.active{left:0}.factory-bootstrap-414 .carousel-inner>.next,.factory-bootstrap-414 .carousel-inner>.prev{position:absolute;top:0;width:100%}.factory-bootstrap-414 .carousel-inner>.next{left:100%}.factory-bootstrap-414 .carousel-inner>.prev{left:-100%}.factory-bootstrap-414 .carousel-inner>.next.left,.factory-bootstrap-414 .carousel-inner>.prev.right{left:0}.factory-bootstrap-414 .carousel-inner>.active.left{left:-100%}.factory-bootstrap-414 .carousel-inner>.active.right{left:100%}.factory-bootstrap-414 .carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);opacity:.5;filter:alpha(opacity=50)}.factory-bootstrap-414 .carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.5) 0),color-stop(rgba(0,0,0,.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.factory-bootstrap-414 .carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.0001) 0),color-stop(rgba(0,0,0,.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.factory-bootstrap-414 .carousel-control:focus,.factory-bootstrap-414 .carousel-control:hover{color:#fff;text-decoration:none;outline:0;opacity:.9;filter:alpha(opacity=90)}.factory-bootstrap-414 .carousel-control .glyphicon-chevron-left,.factory-bootstrap-414 .carousel-control .glyphicon-chevron-right,.factory-bootstrap-414 .carousel-control .icon-next,.factory-bootstrap-414 .carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block}.factory-bootstrap-414 .carousel-control .glyphicon-chevron-left,.factory-bootstrap-414 .carousel-control .icon-prev{left:50%}.factory-bootstrap-414 .carousel-control .glyphicon-chevron-right,.factory-bootstrap-414 .carousel-control .icon-next{right:50%}.factory-bootstrap-414 .carousel-control .icon-next,.factory-bootstrap-414 .carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.factory-bootstrap-414 .carousel-control .icon-prev:before{content:'\2039'}.factory-bootstrap-414 .carousel-control .icon-next:before{content:'\203a'}.factory-bootstrap-414 .carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.factory-bootstrap-414 .carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.factory-bootstrap-414 .carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.factory-bootstrap-414 .carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.factory-bootstrap-414 .carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicons-chevron-left,.carousel-control .glyphicons-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.factory-bootstrap-414 .clearfix:after,.factory-bootstrap-414 .clearfix:before{display:table;content:" "}.factory-bootstrap-414 .clearfix:after{clear:both}.factory-bootstrap-414 .center-block{display:block;margin-right:auto;margin-left:auto}.factory-bootstrap-414 .pull-right{float:right!important}.factory-bootstrap-414 .pull-left{float:left!important}.factory-bootstrap-414 .hide{display:none!important}.factory-bootstrap-414 .show{display:block!important}.factory-bootstrap-414 .invisible{visibility:hidden}.factory-bootstrap-414 .text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.factory-bootstrap-414 .hidden{display:none!important;visibility:hidden!important}.factory-bootstrap-414 .affix{position:fixed}@-ms-viewport{width:device-width}.factory-bootstrap-414 .visible-lg,.factory-bootstrap-414 .visible-md,.factory-bootstrap-414 .visible-sm,.factory-bootstrap-414 .visible-xs,.factory-bootstrap-414 td.visible-lg,.factory-bootstrap-414 td.visible-md,.factory-bootstrap-414 td.visible-sm,.factory-bootstrap-414 td.visible-xs,.factory-bootstrap-414 th.visible-lg,.factory-bootstrap-414 th.visible-md,.factory-bootstrap-414 th.visible-sm,.factory-bootstrap-414 th.visible-xs,.factory-bootstrap-414 tr.visible-lg,.factory-bootstrap-414 tr.visible-md,.factory-bootstrap-414 tr.visible-sm,.factory-bootstrap-414 tr.visible-xs{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}table.visible-xs.visible-sm{display:table}tr.visible-xs.visible-sm{display:table-row!important}td.visible-xs.visible-sm,th.visible-xs.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}table.visible-xs.visible-md{display:table}tr.visible-xs.visible-md{display:table-row!important}td.visible-xs.visible-md,th.visible-xs.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-xs.visible-lg{display:block!important}table.visible-xs.visible-lg{display:table}tr.visible-xs.visible-lg{display:table-row!important}td.visible-xs.visible-lg,th.visible-xs.visible-lg{display:table-cell!important}}@media (max-width:767px){.visible-sm.visible-xs{display:block!important}table.visible-sm.visible-xs{display:table}tr.visible-sm.visible-xs{display:table-row!important}td.visible-sm.visible-xs,th.visible-sm.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}table.visible-sm.visible-md{display:table}tr.visible-sm.visible-md{display:table-row!important}td.visible-sm.visible-md,th.visible-sm.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-sm.visible-lg{display:block!important}table.visible-sm.visible-lg{display:table}tr.visible-sm.visible-lg{display:table-row!important}td.visible-sm.visible-lg,th.visible-sm.visible-lg{display:table-cell!important}}@media (max-width:767px){.visible-md.visible-xs{display:block!important}table.visible-md.visible-xs{display:table}tr.visible-md.visible-xs{display:table-row!important}td.visible-md.visible-xs,th.visible-md.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}table.visible-md.visible-sm{display:table}tr.visible-md.visible-sm{display:table-row!important}td.visible-md.visible-sm,th.visible-md.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-md.visible-lg{display:block!important}table.visible-md.visible-lg{display:table}tr.visible-md.visible-lg{display:table-row!important}td.visible-md.visible-lg,th.visible-md.visible-lg{display:table-cell!important}}@media (max-width:767px){.visible-lg.visible-xs{display:block!important}table.visible-lg.visible-xs{display:table}tr.visible-lg.visible-xs{display:table-row!important}td.visible-lg.visible-xs,th.visible-lg.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}table.visible-lg.visible-sm{display:table}tr.visible-lg.visible-sm{display:table-row!important}td.visible-lg.visible-sm,th.visible-lg.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}table.visible-lg.visible-md{display:table}tr.visible-lg.visible-md{display:table-row!important}td.visible-lg.visible-md,th.visible-lg.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}.factory-bootstrap-414 .hidden-xs{display:block!important}.factory-bootstrap-414 table.hidden-xs{display:table}.factory-bootstrap-414 tr.hidden-xs{display:table-row!important}.factory-bootstrap-414 td.hidden-xs,.factory-bootstrap-414 th.hidden-xs{display:table-cell!important}@media (max-width:767px){.hidden-xs,td.hidden-xs,th.hidden-xs,tr.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm,th.hidden-xs.hidden-sm,tr.hidden-xs.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md,td.hidden-xs.hidden-md,th.hidden-xs.hidden-md,tr.hidden-xs.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg,th.hidden-xs.hidden-lg,tr.hidden-xs.hidden-lg{display:none!important}}.factory-bootstrap-414 .hidden-sm{display:block!important}.factory-bootstrap-414 table.hidden-sm{display:table}.factory-bootstrap-414 tr.hidden-sm{display:table-row!important}.factory-bootstrap-414 td.hidden-sm,.factory-bootstrap-414 th.hidden-sm{display:table-cell!important}@media (max-width:767px){.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs,th.hidden-sm.hidden-xs,tr.hidden-sm.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm,td.hidden-sm,th.hidden-sm,tr.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md,td.hidden-sm.hidden-md,th.hidden-sm.hidden-md,tr.hidden-sm.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg,th.hidden-sm.hidden-lg,tr.hidden-sm.hidden-lg{display:none!important}}.factory-bootstrap-414 .hidden-md{display:block!important}.factory-bootstrap-414 table.hidden-md{display:table}.factory-bootstrap-414 tr.hidden-md{display:table-row!important}.factory-bootstrap-414 td.hidden-md,.factory-bootstrap-414 th.hidden-md{display:table-cell!important}@media (max-width:767px){.hidden-md.hidden-xs,td.hidden-md.hidden-xs,th.hidden-md.hidden-xs,tr.hidden-md.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-md.hidden-sm,td.hidden-md.hidden-sm,th.hidden-md.hidden-sm,tr.hidden-md.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md,td.hidden-md,th.hidden-md,tr.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-md.hidden-lg,td.hidden-md.hidden-lg,th.hidden-md.hidden-lg,tr.hidden-md.hidden-lg{display:none!important}}.factory-bootstrap-414 .hidden-lg{display:block!important}.factory-bootstrap-414 table.hidden-lg{display:table}.factory-bootstrap-414 tr.hidden-lg{display:table-row!important}.factory-bootstrap-414 td.hidden-lg,.factory-bootstrap-414 th.hidden-lg{display:table-cell!important}@media (max-width:767px){.factory-bootstrap-414 .hidden-lg.hidden-xs,.factory-bootstrap-414 td.hidden-lg.hidden-xs,.factory-bootstrap-414 th.hidden-lg.hidden-xs,.factory-bootstrap-414 tr.hidden-lg.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.factory-bootstrap-414 .hidden-lg.hidden-sm,.factory-bootstrap-414 td.hidden-lg.hidden-sm,.factory-bootstrap-414 th.hidden-lg.hidden-sm,.factory-bootstrap-414 tr.hidden-lg.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.factory-bootstrap-414 .hidden-lg.hidden-md,.factory-bootstrap-414 td.hidden-lg.hidden-md,.factory-bootstrap-414 th.hidden-lg.hidden-md,.factory-bootstrap-414 tr.hidden-lg.hidden-md{display:none!important}}@media (min-width:1200px){.factory-bootstrap-414 .hidden-lg,.factory-bootstrap-414 td.hidden-lg,.factory-bootstrap-414 th.hidden-lg,.factory-bootstrap-414 tr.hidden-lg{display:none!important}}.factory-bootstrap-414 .visible-print,.factory-bootstrap-414 td.visible-print,.factory-bootstrap-414 th.visible-print,.factory-bootstrap-414 tr.visible-print{display:none!important}@media print{.factory-bootstrap-414 .visible-print{display:block!important}.factory-bootstrap-414 table.visible-print{display:table}.factory-bootstrap-414 tr.visible-print{display:table-row!important}.factory-bootstrap-414 td.visible-print,.factory-bootstrap-414 th.visible-print{display:table-cell!important}.factory-bootstrap-414 .hidden-print,.factory-bootstrap-414 td.hidden-print,.factory-bootstrap-414 th.hidden-print,.factory-bootstrap-414 tr.hidden-print{display:none!important}}/*!
|
12 |
* Factory Default Bootstrap Theme
|
13 |
*
|
14 |
* The code is based on Bootstrap v2.1.1
|
@@ -22,4 +22,4 @@
|
|
22 |
*
|
23 |
* @package factory-bootstrap
|
24 |
* @since 1.0.0
|
25 |
-
*/.factory-bootstrap-414 .btn-danger,.factory-bootstrap-414 .btn-default,.factory-bootstrap-414 .btn-info,.factory-bootstrap-414 .btn-primary,.factory-bootstrap-414 .btn-success,.factory-bootstrap-414 .btn-warning{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-414 .btn-danger.active,.factory-bootstrap-414 .btn-danger:active,.factory-bootstrap-414 .btn-default.active,.factory-bootstrap-414 .btn-default:active,.factory-bootstrap-414 .btn-info.active,.factory-bootstrap-414 .btn-info:active,.factory-bootstrap-414 .btn-primary.active,.factory-bootstrap-414 .btn-primary:active,.factory-bootstrap-414 .btn-success.active,.factory-bootstrap-414 .btn-success:active,.factory-bootstrap-414 .btn-warning.active,.factory-bootstrap-414 .btn-warning:active{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.1);box-shadow:inset 0 1px 1px rgba(0,0,0,.1)}.factory-bootstrap-414 .btn.active,.factory-bootstrap-414 .btn:active{background-image:none}.factory-bootstrap-414 .btn-default{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.factory-bootstrap-414 .btn-default.active,.factory-bootstrap-414 .btn-default:active{background-color:#fff;border-color:#dbdbdb}.factory-bootstrap-414 .btn-gold{font-weight:700;padding:7px 12px;cursor:pointer;line-height:16px;display:inline-block;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;box-shadow:#e3e3e3 0 1px 1px;-moz-box-shadow:0 1px 1px rgba(000,000,000,.1),inset 0 1px 1px rgba(255,255,255,.7);-webkit-box-shadow:0 1px 1px rgba(000,000,000,.1),inset 0 1px 1px rgba(255,255,255,.7);text-shadow:1px 1px 0 #ffe8b2;color:#7c5d1b;border:1px solid #d6a437;background:#feeb80}.factory-bootstrap-414 .btn-gold:focus,.factory-bootstrap-414 .btn-gold:hover{background:#fef0a1}.factory-bootstrap-414 .btn-gold.active,.factory-bootstrap-414 .btn-gold:active{background:#fef0a1;-webkit-box-shadow:inset 0 3px 8px 0 #f8ba36;box-shadow:inset 0 3px 8px 0 #f8ba36}.factory-bootstrap-414 .btn-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.factory-bootstrap-414 .btn-primary:focus,.factory-bootstrap-414 .btn-primary:hover{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.factory-bootstrap-414 .btn-primary.active,.factory-bootstrap-414 .btn-primary:active{background-color:#2d6ca2;border-color:#2b669a}.factory-bootstrap-414 .btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);background-repeat:repeat-x;border-color:#3e8f3e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-414 .btn-success:focus,.factory-bootstrap-414 .btn-success:hover{background-color:#419641;background-position:0 -15px}.factory-bootstrap-414 .btn-success.active,.factory-bootstrap-414 .btn-success:active{background-color:#419641;border-color:#3e8f3e}.factory-bootstrap-414 .btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);background-repeat:repeat-x;border-color:#e38d13;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-414 .btn-warning:focus,.factory-bootstrap-414 .btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.factory-bootstrap-414 .btn-warning.active,.factory-bootstrap-414 .btn-warning:active{background-color:#eb9316;border-color:#e38d13}.factory-bootstrap-414 .btn-danger{color:#fff;background:#d9534f;border-color:#d43f3a}.factory-bootstrap-414 .btn-danger.active,.factory-bootstrap-414 .btn-danger:active,.factory-bootstrap-414 .btn-danger:focus,.factory-bootstrap-414 .btn-danger:hover,.factory-bootstrap-414 .open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.factory-bootstrap-414 .btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);background-repeat:repeat-x;border-color:#28a4c9;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-414 .btn-info:focus,.factory-bootstrap-414 .btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.factory-bootstrap-414 .btn-info.active,.factory-bootstrap-414 .btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.factory-bootstrap-414 .img-thumbnail,.factory-bootstrap-414 .thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.factory-bootstrap-414 .dropdown-menu>li>a:focus,.factory-bootstrap-414 .dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.factory-bootstrap-414 .dropdown-menu>.active>a,.factory-bootstrap-414 .dropdown-menu>.active>a:focus,.factory-bootstrap-414 .dropdown-menu>.active>a:hover{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.factory-bootstrap-414 .navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.factory-bootstrap-414 .navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.factory-bootstrap-414 .navbar-brand,.factory-bootstrap-414 .navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.factory-bootstrap-414 .navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-414 .navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.factory-bootstrap-414 .navbar-inverse .navbar-brand,.factory-bootstrap-414 .navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.factory-bootstrap-414 .navbar-fixed-bottom,.factory-bootstrap-414 .navbar-fixed-top,.factory-bootstrap-414 .navbar-static-top{border-radius:0}.factory-bootstrap-414 .alert{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.factory-bootstrap-414 .alert .actions{padding-top:10px}.factory-bootstrap-414 .alert-success{color:#3c763d;background-color:#dff0d8;border-bottom:2px solid #c8e5bc}.factory-bootstrap-414 .alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;border-color:#9acfea;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0)}.factory-bootstrap-414 .alert{text-shadow:none;box-shadow:none;margin:0;margin-top:10px;margin-bottom:10px;padding:10px}.factory-bootstrap-414 .alert-normal,.factory-bootstrap-414 .alert-warning{background:#fcf8e3;color:#8a6d3b;border:1px solid #b8823b}.factory-bootstrap-414 .alert-danger{background:#cf4944;color:#fff;border-bottom:2px solid #b23e3a}.factory-bootstrap-414 .alert-danger a:not(.btn),.factory-bootstrap-414 .alert-error a:not(.btn){color:#fff}.factory-bootstrap-414 .progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.factory-bootstrap-414 .progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.factory-bootstrap-414 .progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.factory-bootstrap-414 .progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.factory-bootstrap-414 .progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.factory-bootstrap-414 .progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.factory-bootstrap-414 .list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.factory-bootstrap-414 .list-group-item.active,.factory-bootstrap-414 .list-group-item.active:focus,.factory-bootstrap-414 .list-group-item.active:hover{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;border-color:#3278b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0)}.factory-bootstrap-414 .panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.factory-bootstrap-414 .panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.factory-bootstrap-414 .panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.factory-bootstrap-414 .panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.factory-bootstrap-414 .panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.factory-bootstrap-414 .panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.factory-bootstrap-414 .panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.factory-bootstrap-414 .well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;border-color:#dcdcdc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}.factory-bootstrap-414 .factory-after{margin-left:7px;display:inline-block}.factory-bootstrap-414 .factory-hidden{display:none}.factory-bootstrap-414 .factory-ajax-loader{width:25px;height:25px;background:url(../assets/images/loader-sm-tr.gif)}.factory-control-error{background-color:rgba(0,0,0,.8);white-space:normal;z-index:10;font-weight:400;line-height:150%;border-radius:4px;color:#fff;font-size:13px;margin-top:5px;padding:4px 10px 3px;max-width:500px;display:inline-block}.factory-control-error i{margin:0 7px 0 1px}
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 article,.factory-bootstrap-426 aside,.factory-bootstrap-426 details,.factory-bootstrap-426 figcaption,.factory-bootstrap-426 figure,.factory-bootstrap-426 footer,.factory-bootstrap-426 header,.factory-bootstrap-426 hgroup,.factory-bootstrap-426 main,.factory-bootstrap-426 nav,.factory-bootstrap-426 section,.factory-bootstrap-426 summary{display:block}.factory-bootstrap-426 audio,.factory-bootstrap-426 canvas,.factory-bootstrap-426 video{display:inline-block}.factory-bootstrap-426 audio:not([controls]){display:none;height:0}.factory-bootstrap-426 [hidden],.factory-bootstrap-426 template{display:none}.factory-bootstrap-426 body{margin:0}.factory-bootstrap-426 a{background:0 0}.factory-bootstrap-426 a:focus{outline:thin dotted}.factory-bootstrap-426 a:active,.factory-bootstrap-426 a:hover{outline:0}.factory-bootstrap-426 h1{margin:.67em 0}.factory-bootstrap-426 b,.factory-bootstrap-426 strong{font-weight:700}.factory-bootstrap-426 dfn{font-style:italic}.factory-bootstrap-426 hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}.factory-bootstrap-426 mark{color:#000;background:#ff0}.factory-bootstrap-426 code,.factory-bootstrap-426 kbd,.factory-bootstrap-426 pre,.factory-bootstrap-426 samp{font-size:1em}.factory-bootstrap-426 pre{white-space:pre-wrap}.factory-bootstrap-426 q{quotes:"\201C" "\201D" "\2018" "\2019"}.factory-bootstrap-426 sub,.factory-bootstrap-426 sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}.factory-bootstrap-426 sup{top:-.5em}.factory-bootstrap-426 sub{bottom:-.25em}.factory-bootstrap-426 img{border:0}.factory-bootstrap-426 svg:not(:root){overflow:hidden}.factory-bootstrap-426 figure{margin:0}.factory-bootstrap-426 button,.factory-bootstrap-426 input,.factory-bootstrap-426 select,.factory-bootstrap-426 textarea{margin:0}.factory-bootstrap-426 button,.factory-bootstrap-426 select{text-transform:none}.factory-bootstrap-426 select{padding-right:4px!important}.factory-bootstrap-426 button,.factory-bootstrap-426 input[type=reset],.factory-bootstrap-426 input[type=submit],html .factory-bootstrap-426 input[type=button]{cursor:pointer;-webkit-appearance:button}.factory-bootstrap-426 button[disabled],html .factory-bootstrap-426 input[disabled]{cursor:default}.factory-bootstrap-426 input[type=checkbox],.factory-bootstrap-426 input[type=radio]{padding:0;box-sizing:border-box}.factory-bootstrap-426 input[type=search]{-webkit-appearance:textfield}.factory-bootstrap-426 input[type=search]::-webkit-search-cancel-button,.factory-bootstrap-426 input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.factory-bootstrap-426 button::-moz-focus-inner,.factory-bootstrap-426 input::-moz-focus-inner{padding:0;border:0}.factory-bootstrap-426 textarea{overflow:auto;vertical-align:top}.factory-bootstrap-426 table{border-collapse:collapse;border-spacing:0}@media print{.factory-bootstrap-426 *{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}.factory-bootstrap-426 a,.factory-bootstrap-426 a:visited{text-decoration:underline}.factory-bootstrap-426 a[href]:after{content:" (" attr(href) ")"}.factory-bootstrap-426 abbr[title]:after{content:" (" attr(title) ")"}.factory-bootstrap-426 a[href^="javascript:"]:after,.factory-bootstrap-426 a[href^="#"]:after{content:""}.factory-bootstrap-426 blockquote,.factory-bootstrap-426 pre{border:1px solid #999;page-break-inside:avoid}.factory-bootstrap-426 thead{display:table-header-group}.factory-bootstrap-426 img,.factory-bootstrap-426 tr{page-break-inside:avoid}.factory-bootstrap-426 img{max-width:100%!important}@page{margin:2cm .5cm}.factory-bootstrap-426 h2,.factory-bootstrap-426 h3,.factory-bootstrap-426 p{orphans:3;widows:3}.factory-bootstrap-426 h2,.factory-bootstrap-426 h3{page-break-after:avoid}.factory-bootstrap-426 select{background:#fff!important}.factory-bootstrap-426 .navbar{display:none}.factory-bootstrap-426 .table td,.factory-bootstrap-426 .table th{background-color:#fff!important}.factory-bootstrap-426 .btn>.caret,.factory-bootstrap-426 .dropup>.btn>.caret{border-top-color:#000!important}.factory-bootstrap-426 .label{border:1px solid #000}.factory-bootstrap-426 .table{border-collapse:collapse!important}.factory-bootstrap-426 .table-bordered td,.factory-bootstrap-426 .table-bordered th{border:1px solid #ddd!important}}.factory-bootstrap-426 *,.factory-bootstrap-426 :after,.factory-bootstrap-426 :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html .factory-bootstrap-426{-webkit-tap-highlight-color:rgba(0,0,0,0)}.factory-bootstrap-426 body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333;background-color:#fff}.factory-bootstrap-426 button,.factory-bootstrap-426 input,.factory-bootstrap-426 select,.factory-bootstrap-426 textarea{font-family:inherit;font-size:inherit;line-height:inherit}.factory-bootstrap-426 img{vertical-align:middle}.factory-bootstrap-426 .img-responsive{display:block;height:auto;max-width:100%}.factory-bootstrap-426 .img-rounded{border-radius:6px}.factory-bootstrap-426 .img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.factory-bootstrap-426 .img-circle{border-radius:50%}.factory-bootstrap-426 hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.factory-bootstrap-426 .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.factory-bootstrap-426 .h1,.factory-bootstrap-426 .h2,.factory-bootstrap-426 .h3,.factory-bootstrap-426 .h4,.factory-bootstrap-426 .h5,.factory-bootstrap-426 .h6,.factory-bootstrap-426 h1,.factory-bootstrap-426 h2,.factory-bootstrap-426 h3,.factory-bootstrap-426 h4,.factory-bootstrap-426 h5,.factory-bootstrap-426 h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit}.factory-bootstrap-426 .h1 .small,.factory-bootstrap-426 .h1 small,.factory-bootstrap-426 .h2 .small,.factory-bootstrap-426 .h2 small,.factory-bootstrap-426 .h3 .small,.factory-bootstrap-426 .h3 small,.factory-bootstrap-426 .h4 .small,.factory-bootstrap-426 .h4 small,.factory-bootstrap-426 .h5 .small,.factory-bootstrap-426 .h5 small,.factory-bootstrap-426 .h6 .small,.factory-bootstrap-426 .h6 small,.factory-bootstrap-426 h1 .small,.factory-bootstrap-426 h1 small,.factory-bootstrap-426 h2 .small,.factory-bootstrap-426 h2 small,.factory-bootstrap-426 h3 .small,.factory-bootstrap-426 h3 small,.factory-bootstrap-426 h4 .small,.factory-bootstrap-426 h4 small,.factory-bootstrap-426 h5 .small,.factory-bootstrap-426 h5 small,.factory-bootstrap-426 h6 .small,.factory-bootstrap-426 h6 small{font-weight:400;line-height:1;color:#999}.factory-bootstrap-426 h1,.factory-bootstrap-426 h2,.factory-bootstrap-426 h3{margin-top:20px;margin-bottom:10px}.factory-bootstrap-426 h1 .small,.factory-bootstrap-426 h1 small,.factory-bootstrap-426 h2 .small,.factory-bootstrap-426 h2 small,.factory-bootstrap-426 h3 .small,.factory-bootstrap-426 h3 small{font-size:65%}.factory-bootstrap-426 h4,.factory-bootstrap-426 h5,.factory-bootstrap-426 h6{margin-top:10px;margin-bottom:10px}.factory-bootstrap-426 h4 .small,.factory-bootstrap-426 h4 small,.factory-bootstrap-426 h5 .small,.factory-bootstrap-426 h5 small,.factory-bootstrap-426 h6 .small,.factory-bootstrap-426 h6 small{font-size:75%}.factory-bootstrap-426 .h1,.factory-bootstrap-426 h1{font-size:36px}.factory-bootstrap-426 .h2,.factory-bootstrap-426 h2{font-size:30px}.factory-bootstrap-426 .h3,.factory-bootstrap-426 h3{font-size:24px}.factory-bootstrap-426 .h4,.factory-bootstrap-426 h4{font-size:18px}.factory-bootstrap-426 .h5,.factory-bootstrap-426 h5{font-size:14px}.factory-bootstrap-426 .h6,.factory-bootstrap-426 h6{font-size:12px}.factory-bootstrap-426 p{margin:0 0 10px}.factory-bootstrap-426 .lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.factory-bootstrap-426 .small,.factory-bootstrap-426 small{font-size:85%}.factory-bootstrap-426 cite{font-style:normal}.factory-bootstrap-426 .text-muted{color:#999}.factory-bootstrap-426 .text-primary{color:#428bca}.factory-bootstrap-426 .text-primary:hover{color:#3071a9}.factory-bootstrap-426 .text-warning{color:#8a6d3b}.factory-bootstrap-426 .text-warning:hover{color:#66512c}.factory-bootstrap-426 .text-danger{color:#a94442}.factory-bootstrap-426 .text-danger:hover{color:#843534}.factory-bootstrap-426 .text-success{color:#3c763d}.factory-bootstrap-426 .text-success:hover{color:#2b542c}.factory-bootstrap-426 .text-info{color:#31708f}.factory-bootstrap-426 .text-info:hover{color:#245269}.factory-bootstrap-426 .text-left{text-align:left}.factory-bootstrap-426 .text-right{text-align:right}.factory-bootstrap-426 .text-center{text-align:center}.factory-bootstrap-426 .page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}.factory-bootstrap-426 ol,.factory-bootstrap-426 ul{margin-top:0;margin-bottom:10px}.factory-bootstrap-426 ol ol,.factory-bootstrap-426 ol ul,.factory-bootstrap-426 ul ol,.factory-bootstrap-426 ul ul{margin-bottom:0}.factory-bootstrap-426 .list-inline,.factory-bootstrap-426 .list-unstyled{padding-left:0;list-style:none}.factory-bootstrap-426 .list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.factory-bootstrap-426 .list-inline>li:first-child{padding-left:0}.factory-bootstrap-426 dl{margin-top:0;margin-bottom:20px}.factory-bootstrap-426 dd,.factory-bootstrap-426 dt{line-height:1.428571429}.factory-bootstrap-426 dt{font-weight:700}.factory-bootstrap-426 dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:after,.dl-horizontal dd:before{display:table;content:" "}.dl-horizontal dd:after{clear:both}}.factory-bootstrap-426 abbr[data-original-title],.factory-bootstrap-426 abbr[title]{cursor:help;border-bottom:1px dotted #999}.factory-bootstrap-426 .initialism{font-size:90%;text-transform:uppercase}.factory-bootstrap-426 blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}.factory-bootstrap-426 blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}.factory-bootstrap-426 blockquote p:last-child{margin-bottom:0}.factory-bootstrap-426 blockquote .small,.factory-bootstrap-426 blockquote small{display:block;line-height:1.428571429;color:#999}.factory-bootstrap-426 blockquote .small:before,.factory-bootstrap-426 blockquote small:before{content:'\2014 \00A0'}.factory-bootstrap-426 blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}.factory-bootstrap-426 blockquote.pull-right .small,.factory-bootstrap-426 blockquote.pull-right p,.factory-bootstrap-426 blockquote.pull-right small{text-align:right}.factory-bootstrap-426 blockquote.pull-right .small:before,.factory-bootstrap-426 blockquote.pull-right small:before{content:''}.factory-bootstrap-426 blockquote.pull-right .small:after,.factory-bootstrap-426 blockquote.pull-right small:after{content:'\00A0 \2014'}.factory-bootstrap-426 blockquote:after,.factory-bootstrap-426 blockquote:before{content:""}.factory-bootstrap-426 address{margin-bottom:20px;font-style:normal;line-height:1.428571429}.factory-bootstrap-426 code,.factory-bootstrap-426 kbd,.factory-bootstrap-426 pre,.factory-bootstrap-426 samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}.factory-bootstrap-426 code{padding:2px 4px;font-size:90%;color:#c7254e;white-space:nowrap;background-color:#f9f2f4;border-radius:4px}.factory-bootstrap-426 pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}.factory-bootstrap-426 pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.factory-bootstrap-426 .pre-scrollable{max-height:340px;overflow-y:scroll}.factory-bootstrap-426 .container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.factory-bootstrap-426 .container:after,.factory-bootstrap-426 .container:before{display:table;content:" "}.factory-bootstrap-426 .container:after{clear:both}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.factory-bootstrap-426 .row{margin-right:-15px;margin-left:-15px}.factory-bootstrap-426 .row:after,.factory-bootstrap-426 .row:before{display:table;content:" "}.factory-bootstrap-426 .row:after{clear:both}.factory-bootstrap-426 .col-lg-1,.factory-bootstrap-426 .col-lg-10,.factory-bootstrap-426 .col-lg-11,.factory-bootstrap-426 .col-lg-12,.factory-bootstrap-426 .col-lg-2,.factory-bootstrap-426 .col-lg-3,.factory-bootstrap-426 .col-lg-4,.factory-bootstrap-426 .col-lg-5,.factory-bootstrap-426 .col-lg-6,.factory-bootstrap-426 .col-lg-7,.factory-bootstrap-426 .col-lg-8,.factory-bootstrap-426 .col-lg-9,.factory-bootstrap-426 .col-md-1,.factory-bootstrap-426 .col-md-10,.factory-bootstrap-426 .col-md-11,.factory-bootstrap-426 .col-md-12,.factory-bootstrap-426 .col-md-2,.factory-bootstrap-426 .col-md-3,.factory-bootstrap-426 .col-md-4,.factory-bootstrap-426 .col-md-5,.factory-bootstrap-426 .col-md-6,.factory-bootstrap-426 .col-md-7,.factory-bootstrap-426 .col-md-8,.factory-bootstrap-426 .col-md-9,.factory-bootstrap-426 .col-sm-1,.factory-bootstrap-426 .col-sm-10,.factory-bootstrap-426 .col-sm-11,.factory-bootstrap-426 .col-sm-12,.factory-bootstrap-426 .col-sm-2,.factory-bootstrap-426 .col-sm-3,.factory-bootstrap-426 .col-sm-4,.factory-bootstrap-426 .col-sm-5,.factory-bootstrap-426 .col-sm-6,.factory-bootstrap-426 .col-sm-7,.factory-bootstrap-426 .col-sm-8,.factory-bootstrap-426 .col-sm-9,.factory-bootstrap-426 .col-xs-1,.factory-bootstrap-426 .col-xs-10,.factory-bootstrap-426 .col-xs-11,.factory-bootstrap-426 .col-xs-12,.factory-bootstrap-426 .col-xs-2,.factory-bootstrap-426 .col-xs-3,.factory-bootstrap-426 .col-xs-4,.factory-bootstrap-426 .col-xs-5,.factory-bootstrap-426 .col-xs-6,.factory-bootstrap-426 .col-xs-7,.factory-bootstrap-426 .col-xs-8,.factory-bootstrap-426 .col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.factory-bootstrap-426 .col-xs-1,.factory-bootstrap-426 .col-xs-10,.factory-bootstrap-426 .col-xs-11,.factory-bootstrap-426 .col-xs-12,.factory-bootstrap-426 .col-xs-2,.factory-bootstrap-426 .col-xs-3,.factory-bootstrap-426 .col-xs-4,.factory-bootstrap-426 .col-xs-5,.factory-bootstrap-426 .col-xs-6,.factory-bootstrap-426 .col-xs-7,.factory-bootstrap-426 .col-xs-8,.factory-bootstrap-426 .col-xs-9{float:left}.factory-bootstrap-426 .col-xs-12{width:100%}.factory-bootstrap-426 .col-xs-11{width:91.66666666666666%}.factory-bootstrap-426 .col-xs-10{width:83.33333333333334%}.factory-bootstrap-426 .col-xs-9{width:75%}.factory-bootstrap-426 .col-xs-8{width:66.66666666666666%}.factory-bootstrap-426 .col-xs-7{width:58.333333333333336%}.factory-bootstrap-426 .col-xs-6{width:50%}.factory-bootstrap-426 .col-xs-5{width:41.66666666666667%}.factory-bootstrap-426 .col-xs-4{width:33.33333333333333%}.factory-bootstrap-426 .col-xs-3{width:25%}.factory-bootstrap-426 .col-xs-2{width:16.666666666666664%}.factory-bootstrap-426 .col-xs-1{width:8.333333333333332%}.factory-bootstrap-426 .col-xs-pull-12{right:100%}.factory-bootstrap-426 .col-xs-pull-11{right:91.66666666666666%}.factory-bootstrap-426 .col-xs-pull-10{right:83.33333333333334%}.factory-bootstrap-426 .col-xs-pull-9{right:75%}.factory-bootstrap-426 .col-xs-pull-8{right:66.66666666666666%}.factory-bootstrap-426 .col-xs-pull-7{right:58.333333333333336%}.factory-bootstrap-426 .col-xs-pull-6{right:50%}.factory-bootstrap-426 .col-xs-pull-5{right:41.66666666666667%}.factory-bootstrap-426 .col-xs-pull-4{right:33.33333333333333%}.factory-bootstrap-426 .col-xs-pull-3{right:25%}.factory-bootstrap-426 .col-xs-pull-2{right:16.666666666666664%}.factory-bootstrap-426 .col-xs-pull-1{right:8.333333333333332%}.factory-bootstrap-426 .col-xs-pull-0{right:0}.factory-bootstrap-426 .col-xs-push-12{left:100%}.factory-bootstrap-426 .col-xs-push-11{left:91.66666666666666%}.factory-bootstrap-426 .col-xs-push-10{left:83.33333333333334%}.factory-bootstrap-426 .col-xs-push-9{left:75%}.factory-bootstrap-426 .col-xs-push-8{left:66.66666666666666%}.factory-bootstrap-426 .col-xs-push-7{left:58.333333333333336%}.factory-bootstrap-426 .col-xs-push-6{left:50%}.factory-bootstrap-426 .col-xs-push-5{left:41.66666666666667%}.factory-bootstrap-426 .col-xs-push-4{left:33.33333333333333%}.factory-bootstrap-426 .col-xs-push-3{left:25%}.factory-bootstrap-426 .col-xs-push-2{left:16.666666666666664%}.factory-bootstrap-426 .col-xs-push-1{left:8.333333333333332%}.factory-bootstrap-426 .col-xs-push-0{left:0}.factory-bootstrap-426 .col-xs-offset-12{margin-left:100%}.factory-bootstrap-426 .col-xs-offset-11{margin-left:91.66666666666666%}.factory-bootstrap-426 .col-xs-offset-10{margin-left:83.33333333333334%}.factory-bootstrap-426 .col-xs-offset-9{margin-left:75%}.factory-bootstrap-426 .col-xs-offset-8{margin-left:66.66666666666666%}.factory-bootstrap-426 .col-xs-offset-7{margin-left:58.333333333333336%}.factory-bootstrap-426 .col-xs-offset-6{margin-left:50%}.factory-bootstrap-426 .col-xs-offset-5{margin-left:41.66666666666667%}.factory-bootstrap-426 .col-xs-offset-4{margin-left:33.33333333333333%}.factory-bootstrap-426 .col-xs-offset-3{margin-left:25%}.factory-bootstrap-426 .col-xs-offset-2{margin-left:16.666666666666664%}.factory-bootstrap-426 .col-xs-offset-1{margin-left:8.333333333333332%}.factory-bootstrap-426 .col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666666666666%}.col-sm-10{width:83.33333333333334%}.col-sm-9{width:75%}.col-sm-8{width:66.66666666666666%}.col-sm-7{width:58.333333333333336%}.col-sm-6{width:50%}.col-sm-5{width:41.66666666666667%}.col-sm-4{width:33.33333333333333%}.col-sm-3{width:25%}.col-sm-2{width:16.666666666666664%}.col-sm-1{width:8.333333333333332%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666666666666%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666666666666%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666666666666%}.col-md-10{width:83.33333333333334%}.col-md-9{width:75%}.col-md-8{width:66.66666666666666%}.col-md-7{width:58.333333333333336%}.col-md-6{width:50%}.col-md-5{width:41.66666666666667%}.col-md-4{width:33.33333333333333%}.col-md-3{width:25%}.col-md-2{width:16.666666666666664%}.col-md-1{width:8.333333333333332%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666666666666%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666666666666%}.col-md-push-10{left:83.33333333333334%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666666666666%}.col-md-push-7{left:58.333333333333336%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666666666667%}.col-md-push-4{left:33.33333333333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.666666666666664%}.col-md-push-1{left:8.333333333333332%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666666666666%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666666666666%}.col-lg-10{width:83.33333333333334%}.col-lg-9{width:75%}.col-lg-8{width:66.66666666666666%}.col-lg-7{width:58.333333333333336%}.col-lg-6{width:50%}.col-lg-5{width:41.66666666666667%}.col-lg-4{width:33.33333333333333%}.col-lg-3{width:25%}.col-lg-2{width:16.666666666666664%}.col-lg-1{width:8.333333333333332%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666666666666%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666666666666%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-0{margin-left:0}}.factory-bootstrap-426 table{max-width:100%;background-color:transparent}.factory-bootstrap-426 th{text-align:left}.factory-bootstrap-426 .table{width:100%;margin-bottom:20px}.factory-bootstrap-426 .table>tbody>tr>td,.factory-bootstrap-426 .table>tbody>tr>th,.factory-bootstrap-426 .table>tfoot>tr>td,.factory-bootstrap-426 .table>tfoot>tr>th,.factory-bootstrap-426 .table>thead>tr>td,.factory-bootstrap-426 .table>thead>tr>th{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.factory-bootstrap-426 .table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.factory-bootstrap-426 .table>caption+thead>tr:first-child>td,.factory-bootstrap-426 .table>caption+thead>tr:first-child>th,.factory-bootstrap-426 .table>colgroup+thead>tr:first-child>td,.factory-bootstrap-426 .table>colgroup+thead>tr:first-child>th,.factory-bootstrap-426 .table>thead:first-child>tr:first-child>td,.factory-bootstrap-426 .table>thead:first-child>tr:first-child>th{border-top:0}.factory-bootstrap-426 .table>tbody+tbody{border-top:2px solid #ddd}.factory-bootstrap-426 .table .table{background-color:#fff}.factory-bootstrap-426 .table-condensed>tbody>tr>td,.factory-bootstrap-426 .table-condensed>tbody>tr>th,.factory-bootstrap-426 .table-condensed>tfoot>tr>td,.factory-bootstrap-426 .table-condensed>tfoot>tr>th,.factory-bootstrap-426 .table-condensed>thead>tr>td,.factory-bootstrap-426 .table-condensed>thead>tr>th{padding:5px}.factory-bootstrap-426 .table-bordered,.factory-bootstrap-426 .table-bordered>tbody>tr>td,.factory-bootstrap-426 .table-bordered>tbody>tr>th,.factory-bootstrap-426 .table-bordered>tfoot>tr>td,.factory-bootstrap-426 .table-bordered>tfoot>tr>th,.factory-bootstrap-426 .table-bordered>thead>tr>td,.factory-bootstrap-426 .table-bordered>thead>tr>th{border:1px solid #ddd}.factory-bootstrap-426 .table-bordered>thead>tr>td,.factory-bootstrap-426 .table-bordered>thead>tr>th{border-bottom-width:2px}.factory-bootstrap-426 .table-striped>tbody>tr:nth-child(odd)>td,.factory-bootstrap-426 .table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.factory-bootstrap-426 .table-hover>tbody>tr:hover>td,.factory-bootstrap-426 .table-hover>tbody>tr:hover>th{background-color:#f5f5f5}.factory-bootstrap-426 table col[class*=col-]{position:static;display:table-column;float:none}.factory-bootstrap-426 table td[class*=col-],.factory-bootstrap-426 table th[class*=col-]{display:table-cell;float:none}.factory-bootstrap-426 .table>tbody>.active>td,.factory-bootstrap-426 .table>tbody>.active>th,.factory-bootstrap-426 .table>tbody>tr>.active,.factory-bootstrap-426 .table>tfoot>.active>td,.factory-bootstrap-426 .table>tfoot>.active>th,.factory-bootstrap-426 .table>tfoot>tr>.active,.factory-bootstrap-426 .table>thead>.active>td,.factory-bootstrap-426 .table>thead>.active>th,.factory-bootstrap-426 .table>thead>tr>.active{background-color:#f5f5f5}.factory-bootstrap-426 .table-hover>tbody>.active:hover>td,.factory-bootstrap-426 .table-hover>tbody>.active:hover>th,.factory-bootstrap-426 .table-hover>tbody>tr>.active:hover{background-color:#e8e8e8}.factory-bootstrap-426 .table>tbody>.success>td,.factory-bootstrap-426 .table>tbody>.success>th,.factory-bootstrap-426 .table>tbody>tr>.success,.factory-bootstrap-426 .table>tfoot>.success>td,.factory-bootstrap-426 .table>tfoot>.success>th,.factory-bootstrap-426 .table>tfoot>tr>.success,.factory-bootstrap-426 .table>thead>.success>td,.factory-bootstrap-426 .table>thead>.success>th,.factory-bootstrap-426 .table>thead>tr>.success{background-color:#dff0d8}.factory-bootstrap-426 .table-hover>tbody>.success:hover>td,.factory-bootstrap-426 .table-hover>tbody>.success:hover>th,.factory-bootstrap-426 .table-hover>tbody>tr>.success:hover{background-color:#d0e9c6}.factory-bootstrap-426 .table>tbody>.danger>td,.factory-bootstrap-426 .table>tbody>.danger>th,.factory-bootstrap-426 .table>tbody>tr>.danger,.factory-bootstrap-426 .table>tfoot>.danger>td,.factory-bootstrap-426 .table>tfoot>.danger>th,.factory-bootstrap-426 .table>tfoot>tr>.danger,.factory-bootstrap-426 .table>thead>.danger>td,.factory-bootstrap-426 .table>thead>.danger>th,.factory-bootstrap-426 .table>thead>tr>.danger{background-color:#f2dede}.factory-bootstrap-426 .table-hover>tbody>.danger:hover>td,.factory-bootstrap-426 .table-hover>tbody>.danger:hover>th,.factory-bootstrap-426 .table-hover>tbody>tr>.danger:hover{background-color:#ebcccc}.factory-bootstrap-426 .table>tbody>.warning>td,.factory-bootstrap-426 .table>tbody>.warning>th,.factory-bootstrap-426 .table>tbody>tr>.warning,.factory-bootstrap-426 .table>tfoot>.warning>td,.factory-bootstrap-426 .table>tfoot>.warning>th,.factory-bootstrap-426 .table>tfoot>tr>.warning,.factory-bootstrap-426 .table>thead>.warning>td,.factory-bootstrap-426 .table>thead>.warning>th,.factory-bootstrap-426 .table>thead>tr>.warning{background-color:#fcf8e3}.factory-bootstrap-426 .table-hover>tbody>.warning:hover>td,.factory-bootstrap-426 .table-hover>tbody>.warning:hover>th,.factory-bootstrap-426 .table-hover>tbody>tr>.warning:hover{background-color:#faf2cc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:scroll;overflow-y:hidden;border:1px solid #ddd;-ms-overflow-style:-ms-autohiding-scrollbar;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}.factory-bootstrap-426 fieldset{padding:0;margin:0;border:0}.factory-bootstrap-426 legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5;-moz-box-sizing:content-box;box-sizing:content-box}.factory-bootstrap-426 label{display:inline-block;margin-bottom:5px;font-weight:700}.factory-bootstrap-426 input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.factory-bootstrap-426 input[type=checkbox],.factory-bootstrap-426 input[type=radio]{margin:4px 0 0;margin-top:1px \9;line-height:normal}.factory-bootstrap-426 input[type=file]{display:block}.factory-bootstrap-426 select[multiple],.factory-bootstrap-426 select[size]{height:auto}.factory-bootstrap-426 select optgroup{font-family:inherit;font-size:inherit;font-style:inherit}.factory-bootstrap-426 input[type=checkbox]:focus,.factory-bootstrap-426 input[type=file]:focus,.factory-bootstrap-426 input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.factory-bootstrap-426 input[type=number]::-webkit-inner-spin-button,.factory-bootstrap-426 input[type=number]::-webkit-outer-spin-button{height:auto}.factory-bootstrap-426 output{display:block;padding-top:7px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle}.factory-bootstrap-426 .form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.factory-bootstrap-426 .form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-426 .form-control:-moz-placeholder{color:#999}.factory-bootstrap-426 .form-control::-moz-placeholder{color:#999;opacity:1}.factory-bootstrap-426 .form-control:-ms-input-placeholder{color:#999}.factory-bootstrap-426 .form-control::-webkit-input-placeholder{color:#999}.factory-bootstrap-426 .form-control[disabled],.factory-bootstrap-426 .form-control[readonly],.factory-bootstrap-426 fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}.factory-bootstrap-426 textarea.form-control{height:auto}.factory-bootstrap-426 .form-group{margin-bottom:15px}.factory-bootstrap-426 .checkbox,.factory-bootstrap-426 .radio{display:block;min-height:20px;padding-left:20px;margin-top:10px;margin-bottom:10px;vertical-align:middle}.factory-bootstrap-426 .checkbox label,.factory-bootstrap-426 .radio label{display:inline;margin-bottom:0;font-weight:400;cursor:pointer}.factory-bootstrap-426 .checkbox input[type=checkbox],.factory-bootstrap-426 .checkbox-inline input[type=checkbox],.factory-bootstrap-426 .radio input[type=radio],.factory-bootstrap-426 .radio-inline input[type=radio]{float:left;margin-left:-20px}.factory-bootstrap-426 .checkbox+.checkbox,.factory-bootstrap-426 .radio+.radio{margin-top:-5px}.factory-bootstrap-426 .checkbox-inline,.factory-bootstrap-426 .radio-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.factory-bootstrap-426 .checkbox-inline+.checkbox-inline,.factory-bootstrap-426 .radio-inline+.radio-inline{margin-top:0;margin-left:10px}.factory-bootstrap-426 .checkbox-inline[disabled],.factory-bootstrap-426 .checkbox[disabled],.factory-bootstrap-426 .radio-inline[disabled],.factory-bootstrap-426 .radio[disabled],.factory-bootstrap-426 fieldset[disabled] .checkbox,.factory-bootstrap-426 fieldset[disabled] .checkbox-inline,.factory-bootstrap-426 fieldset[disabled] .radio,.factory-bootstrap-426 fieldset[disabled] .radio-inline,.factory-bootstrap-426 fieldset[disabled] input[type=checkbox],.factory-bootstrap-426 fieldset[disabled] input[type=radio],.factory-bootstrap-426 input[type=checkbox][disabled],.factory-bootstrap-426 input[type=radio][disabled]{cursor:not-allowed}.factory-bootstrap-426 .input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-426 select.input-sm{height:30px;line-height:30px}.factory-bootstrap-426 textarea.input-sm{height:auto}.factory-bootstrap-426 .input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-426 select.input-lg{height:46px;line-height:46px}.factory-bootstrap-426 textarea.input-lg{height:auto}.factory-bootstrap-426 .has-warning .checkbox,.factory-bootstrap-426 .has-warning .checkbox-inline,.factory-bootstrap-426 .has-warning .control-label,.factory-bootstrap-426 .has-warning .help-block,.factory-bootstrap-426 .has-warning .radio,.factory-bootstrap-426 .has-warning .radio-inline{color:#8a6d3b}.factory-bootstrap-426 .has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-426 .has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.factory-bootstrap-426 .has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.factory-bootstrap-426 .has-error .checkbox,.factory-bootstrap-426 .has-error .checkbox-inline,.factory-bootstrap-426 .has-error .control-label,.factory-bootstrap-426 .has-error .help-block,.factory-bootstrap-426 .has-error .radio,.factory-bootstrap-426 .has-error .radio-inline{color:#a94442}.factory-bootstrap-426 .controls{display:block}.factory-bootstrap-426 .has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-426 .has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.factory-bootstrap-426 .has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.factory-bootstrap-426 .has-success .checkbox,.factory-bootstrap-426 .has-success .checkbox-inline,.factory-bootstrap-426 .has-success .control-label,.factory-bootstrap-426 .has-success .help-block,.factory-bootstrap-426 .has-success .radio,.factory-bootstrap-426 .has-success .radio-inline{color:#3c763d}.factory-bootstrap-426 .has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-426 .has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.factory-bootstrap-426 .has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.factory-bootstrap-426 .form-control-static{margin-bottom:0}.factory-bootstrap-426 .help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373;font-weight:400}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline select.form-control{width:auto}.form-inline .checkbox,.form-inline .radio{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{float:none;margin-left:0}}.factory-bootstrap-426 .form-horizontal .checkbox,.factory-bootstrap-426 .form-horizontal .checkbox-inline,.factory-bootstrap-426 .form-horizontal .control-label,.factory-bootstrap-426 .form-horizontal .radio,.factory-bootstrap-426 .form-horizontal .radio-inline{position:relative;padding-top:7px;margin-top:0;margin-bottom:0}.factory-bootstrap-426 .form-horizontal .control-label{max-width:200px}.factory-bootstrap-426 .form-horizontal .checkbox,.factory-bootstrap-426 .form-horizontal .radio{min-height:27px}.factory-bootstrap-426 .form-horizontal .form-group{margin-right:-15px;margin-left:-15px}.factory-bootstrap-426 .form-horizontal .form-group:after,.factory-bootstrap-426 .form-horizontal .form-group:before{display:table;content:" "}.factory-bootstrap-426 .form-horizontal .form-group:after{clear:both}.factory-bootstrap-426 .form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.factory-bootstrap-426 .btn{display:inline-block;padding:5px 12px;margin-bottom:0;font-size:13px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.factory-bootstrap-426 .btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.factory-bootstrap-426 .btn{text-decoration:none}.factory-bootstrap-426 .btn:focus,.factory-bootstrap-426 .btn:hover{color:#333;text-decoration:none}.factory-bootstrap-426 .btn.disabled,.factory-bootstrap-426 .btn[disabled],.factory-bootstrap-426 fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.factory-bootstrap-426 .btn-default.active,.factory-bootstrap-426 .btn-default:active,.factory-bootstrap-426 .btn-default:focus,.factory-bootstrap-426 .btn-default:hover,.factory-bootstrap-426 .open .dropdown-toggle.btn-default{background:#fafafa;border-color:#999;color:#222}.factory-bootstrap-426 .btn-default.active,.factory-bootstrap-426 .btn-default:active,.factory-bootstrap-426 .open .dropdown-toggle.btn-default{background-image:none}.factory-bootstrap-426 .btn-default.disabled,.factory-bootstrap-426 .btn-default.disabled.active,.factory-bootstrap-426 .btn-default.disabled:active,.factory-bootstrap-426 .btn-default.disabled:focus,.factory-bootstrap-426 .btn-default.disabled:hover,.factory-bootstrap-426 .btn-default[disabled],.factory-bootstrap-426 .btn-default[disabled].active,.factory-bootstrap-426 .btn-default[disabled]:active,.factory-bootstrap-426 .btn-default[disabled]:focus,.factory-bootstrap-426 .btn-default[disabled]:hover,.factory-bootstrap-426 fieldset[disabled] .btn-default,.factory-bootstrap-426 fieldset[disabled] .btn-default.active,.factory-bootstrap-426 fieldset[disabled] .btn-default:active,.factory-bootstrap-426 fieldset[disabled] .btn-default:focus,.factory-bootstrap-426 fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.factory-bootstrap-426 .btn-default .badge{color:#fff;background-color:#fff}.factory-bootstrap-426 .btn-primary.active,.factory-bootstrap-426 .btn-primary:active,.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover,.factory-bootstrap-426 .open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.factory-bootstrap-426 .btn-primary.active,.factory-bootstrap-426 .btn-primary:active,.factory-bootstrap-426 .open .dropdown-toggle.btn-primary{background-image:none}.factory-bootstrap-426 .btn-primary.disabled,.factory-bootstrap-426 .btn-primary.disabled.active,.factory-bootstrap-426 .btn-primary.disabled:active,.factory-bootstrap-426 .btn-primary.disabled:focus,.factory-bootstrap-426 .btn-primary.disabled:hover,.factory-bootstrap-426 .btn-primary[disabled],.factory-bootstrap-426 .btn-primary[disabled].active,.factory-bootstrap-426 .btn-primary[disabled]:active,.factory-bootstrap-426 .btn-primary[disabled]:focus,.factory-bootstrap-426 .btn-primary[disabled]:hover,.factory-bootstrap-426 fieldset[disabled] .btn-primary,.factory-bootstrap-426 fieldset[disabled] .btn-primary.active,.factory-bootstrap-426 fieldset[disabled] .btn-primary:active,.factory-bootstrap-426 fieldset[disabled] .btn-primary:focus,.factory-bootstrap-426 fieldset[disabled] .btn-primary:hover{background-color:#428bca;border-color:#357ebd}.factory-bootstrap-426 .btn-primary .badge{color:#428bca;background-color:#fff}.factory-bootstrap-426 .btn-warning{color:#fff;background-color:#f0ad4e}.factory-bootstrap-426 .btn-warning.active,.factory-bootstrap-426 .btn-warning:active,.factory-bootstrap-426 .btn-warning:focus,.factory-bootstrap-426 .btn-warning:hover,.factory-bootstrap-426 .open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.factory-bootstrap-426 .btn-warning.active,.factory-bootstrap-426 .btn-warning:active,.factory-bootstrap-426 .open .dropdown-toggle.btn-warning{background-image:none}.factory-bootstrap-426 .btn-warning.disabled,.factory-bootstrap-426 .btn-warning.disabled.active,.factory-bootstrap-426 .btn-warning.disabled:active,.factory-bootstrap-426 .btn-warning.disabled:focus,.factory-bootstrap-426 .btn-warning.disabled:hover,.factory-bootstrap-426 .btn-warning[disabled],.factory-bootstrap-426 .btn-warning[disabled].active,.factory-bootstrap-426 .btn-warning[disabled]:active,.factory-bootstrap-426 .btn-warning[disabled]:focus,.factory-bootstrap-426 .btn-warning[disabled]:hover,.factory-bootstrap-426 fieldset[disabled] .btn-warning,.factory-bootstrap-426 fieldset[disabled] .btn-warning.active,.factory-bootstrap-426 fieldset[disabled] .btn-warning:active,.factory-bootstrap-426 fieldset[disabled] .btn-warning:focus,.factory-bootstrap-426 fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.factory-bootstrap-426 .btn-warning .badge{color:#f0ad4e;background-color:#fff}.factory-bootstrap-426 .btn-success{color:#fff;background-color:#5cb85c}.factory-bootstrap-426 .btn-success.active,.factory-bootstrap-426 .btn-success:active,.factory-bootstrap-426 .btn-success:focus,.factory-bootstrap-426 .btn-success:hover,.factory-bootstrap-426 .open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.factory-bootstrap-426 .btn-success.active,.factory-bootstrap-426 .btn-success:active,.factory-bootstrap-426 .open .dropdown-toggle.btn-success{background-image:none}.factory-bootstrap-426 .btn-success.disabled,.factory-bootstrap-426 .btn-success.disabled.active,.factory-bootstrap-426 .btn-success.disabled:active,.factory-bootstrap-426 .btn-success.disabled:focus,.factory-bootstrap-426 .btn-success.disabled:hover,.factory-bootstrap-426 .btn-success[disabled],.factory-bootstrap-426 .btn-success[disabled].active,.factory-bootstrap-426 .btn-success[disabled]:active,.factory-bootstrap-426 .btn-success[disabled]:focus,.factory-bootstrap-426 .btn-success[disabled]:hover,.factory-bootstrap-426 fieldset[disabled] .btn-success,.factory-bootstrap-426 fieldset[disabled] .btn-success.active,.factory-bootstrap-426 fieldset[disabled] .btn-success:active,.factory-bootstrap-426 fieldset[disabled] .btn-success:focus,.factory-bootstrap-426 fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.factory-bootstrap-426 .btn-success .badge{color:#5cb85c;background-color:#fff}.factory-bootstrap-426 .btn-info{color:#fff;background-color:#5bc0de}.factory-bootstrap-426 .btn-info.active,.factory-bootstrap-426 .btn-info:active,.factory-bootstrap-426 .btn-info:focus,.factory-bootstrap-426 .btn-info:hover,.factory-bootstrap-426 .open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.factory-bootstrap-426 .btn-info.active,.factory-bootstrap-426 .btn-info:active,.factory-bootstrap-426 .open .dropdown-toggle.btn-info{background-image:none}.factory-bootstrap-426 .btn-info.disabled,.factory-bootstrap-426 .btn-info.disabled.active,.factory-bootstrap-426 .btn-info.disabled:active,.factory-bootstrap-426 .btn-info.disabled:focus,.factory-bootstrap-426 .btn-info.disabled:hover,.factory-bootstrap-426 .btn-info[disabled],.factory-bootstrap-426 .btn-info[disabled].active,.factory-bootstrap-426 .btn-info[disabled]:active,.factory-bootstrap-426 .btn-info[disabled]:focus,.factory-bootstrap-426 .btn-info[disabled]:hover,.factory-bootstrap-426 fieldset[disabled] .btn-info,.factory-bootstrap-426 fieldset[disabled] .btn-info.active,.factory-bootstrap-426 fieldset[disabled] .btn-info:active,.factory-bootstrap-426 fieldset[disabled] .btn-info:focus,.factory-bootstrap-426 fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.factory-bootstrap-426 .btn-info .badge{color:#5bc0de;background-color:#fff}.factory-bootstrap-426 .btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.factory-bootstrap-426 .btn-link,.factory-bootstrap-426 .btn-link:active,.factory-bootstrap-426 .btn-link[disabled],.factory-bootstrap-426 fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.factory-bootstrap-426 .btn-link,.factory-bootstrap-426 .btn-link:active,.factory-bootstrap-426 .btn-link:focus,.factory-bootstrap-426 .btn-link:hover{border-color:transparent}.factory-bootstrap-426 .btn-link:focus,.factory-bootstrap-426 .btn-link:hover{color:#2a6496;text-decoration:underline;background-color:transparent}.factory-bootstrap-426 .btn-link[disabled]:focus,.factory-bootstrap-426 .btn-link[disabled]:hover,.factory-bootstrap-426 fieldset[disabled] .btn-link:focus,.factory-bootstrap-426 fieldset[disabled] .btn-link:hover{color:#999;text-decoration:none}.factory-bootstrap-426 .btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-426 .btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-426 .btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-426 .btn-block{display:block;width:100%;padding-right:0;padding-left:0}.factory-bootstrap-426 .btn-block+.btn-block{margin-top:5px}.factory-bootstrap-426 input[type=button].btn-block,.factory-bootstrap-426 input[type=reset].btn-block,.factory-bootstrap-426 input[type=submit].btn-block{width:100%}.factory-bootstrap-426 .fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.factory-bootstrap-426 .fade.in{opacity:1}.factory-bootstrap-426 .collapse{display:none}.factory-bootstrap-426 .collapse.in{display:block}.factory-bootstrap-426 .collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular) format('svg')}.factory-bootstrap-426 .glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.factory-bootstrap-426 .glyphicon:empty{width:1em}.factory-bootstrap-426 .glyphicon-asterisk:before{content:"\2a"}.factory-bootstrap-426 .glyphicon-plus:before{content:"\2b"}.factory-bootstrap-426 .glyphicon-euro:before{content:"\20ac"}.factory-bootstrap-426 .glyphicon-minus:before{content:"\2212"}.factory-bootstrap-426 .glyphicon-cloud:before{content:"\2601"}.factory-bootstrap-426 .glyphicon-envelope:before{content:"\2709"}.factory-bootstrap-426 .glyphicon-pencil:before{content:"\270f"}.factory-bootstrap-426 .glyphicon-glass:before{content:"\e001"}.factory-bootstrap-426 .glyphicon-music:before{content:"\e002"}.factory-bootstrap-426 .glyphicon-search:before{content:"\e003"}.factory-bootstrap-426 .glyphicon-heart:before{content:"\e005"}.factory-bootstrap-426 .glyphicon-star:before{content:"\e006"}.factory-bootstrap-426 .glyphicon-star-empty:before{content:"\e007"}.factory-bootstrap-426 .glyphicon-user:before{content:"\e008"}.factory-bootstrap-426 .glyphicon-film:before{content:"\e009"}.factory-bootstrap-426 .glyphicon-th-large:before{content:"\e010"}.factory-bootstrap-426 .glyphicon-th:before{content:"\e011"}.factory-bootstrap-426 .glyphicon-th-list:before{content:"\e012"}.factory-bootstrap-426 .glyphicon-ok:before{content:"\e013"}.factory-bootstrap-426 .glyphicon-remove:before{content:"\e014"}.factory-bootstrap-426 .glyphicon-zoom-in:before{content:"\e015"}.factory-bootstrap-426 .glyphicon-zoom-out:before{content:"\e016"}.factory-bootstrap-426 .glyphicon-off:before{content:"\e017"}.factory-bootstrap-426 .glyphicon-signal:before{content:"\e018"}.factory-bootstrap-426 .glyphicon-cog:before{content:"\e019"}.factory-bootstrap-426 .glyphicon-trash:before{content:"\e020"}.factory-bootstrap-426 .glyphicon-home:before{content:"\e021"}.factory-bootstrap-426 .glyphicon-file:before{content:"\e022"}.factory-bootstrap-426 .glyphicon-time:before{content:"\e023"}.factory-bootstrap-426 .glyphicon-road:before{content:"\e024"}.factory-bootstrap-426 .glyphicon-download-alt:before{content:"\e025"}.factory-bootstrap-426 .glyphicon-download:before{content:"\e026"}.factory-bootstrap-426 .glyphicon-upload:before{content:"\e027"}.factory-bootstrap-426 .glyphicon-inbox:before{content:"\e028"}.factory-bootstrap-426 .glyphicon-play-circle:before{content:"\e029"}.factory-bootstrap-426 .glyphicon-repeat:before{content:"\e030"}.factory-bootstrap-426 .glyphicon-refresh:before{content:"\e031"}.factory-bootstrap-426 .glyphicon-list-alt:before{content:"\e032"}.factory-bootstrap-426 .glyphicon-lock:before{content:"\e033"}.factory-bootstrap-426 .glyphicon-flag:before{content:"\e034"}.factory-bootstrap-426 .glyphicon-headphones:before{content:"\e035"}.factory-bootstrap-426 .glyphicon-volume-off:before{content:"\e036"}.factory-bootstrap-426 .glyphicon-volume-down:before{content:"\e037"}.factory-bootstrap-426 .glyphicon-volume-up:before{content:"\e038"}.factory-bootstrap-426 .glyphicon-qrcode:before{content:"\e039"}.factory-bootstrap-426 .glyphicon-barcode:before{content:"\e040"}.factory-bootstrap-426 .glyphicon-tag:before{content:"\e041"}.factory-bootstrap-426 .glyphicon-tags:before{content:"\e042"}.factory-bootstrap-426 .glyphicon-book:before{content:"\e043"}.factory-bootstrap-426 .glyphicon-bookmark:before{content:"\e044"}.factory-bootstrap-426 .glyphicon-print:before{content:"\e045"}.factory-bootstrap-426 .glyphicon-camera:before{content:"\e046"}.factory-bootstrap-426 .glyphicon-font:before{content:"\e047"}.factory-bootstrap-426 .glyphicon-bold:before{content:"\e048"}.factory-bootstrap-426 .glyphicon-italic:before{content:"\e049"}.factory-bootstrap-426 .glyphicon-text-height:before{content:"\e050"}.factory-bootstrap-426 .glyphicon-text-width:before{content:"\e051"}.factory-bootstrap-426 .glyphicon-align-left:before{content:"\e052"}.factory-bootstrap-426 .glyphicon-align-center:before{content:"\e053"}.factory-bootstrap-426 .glyphicon-align-right:before{content:"\e054"}.factory-bootstrap-426 .glyphicon-align-justify:before{content:"\e055"}.factory-bootstrap-426 .glyphicon-list:before{content:"\e056"}.factory-bootstrap-426 .glyphicon-indent-left:before{content:"\e057"}.factory-bootstrap-426 .glyphicon-indent-right:before{content:"\e058"}.factory-bootstrap-426 .glyphicon-facetime-video:before{content:"\e059"}.factory-bootstrap-426 .glyphicon-picture:before{content:"\e060"}.factory-bootstrap-426 .glyphicon-map-marker:before{content:"\e062"}.factory-bootstrap-426 .glyphicon-adjust:before{content:"\e063"}.factory-bootstrap-426 .glyphicon-tint:before{content:"\e064"}.factory-bootstrap-426 .glyphicon-edit:before{content:"\e065"}.factory-bootstrap-426 .glyphicon-share:before{content:"\e066"}.factory-bootstrap-426 .glyphicon-check:before{content:"\e067"}.factory-bootstrap-426 .glyphicon-move:before{content:"\e068"}.factory-bootstrap-426 .glyphicon-step-backward:before{content:"\e069"}.factory-bootstrap-426 .glyphicon-fast-backward:before{content:"\e070"}.factory-bootstrap-426 .glyphicon-backward:before{content:"\e071"}.factory-bootstrap-426 .glyphicon-play:before{content:"\e072"}.factory-bootstrap-426 .glyphicon-pause:before{content:"\e073"}.factory-bootstrap-426 .glyphicon-stop:before{content:"\e074"}.factory-bootstrap-426 .glyphicon-forward:before{content:"\e075"}.factory-bootstrap-426 .glyphicon-fast-forward:before{content:"\e076"}.factory-bootstrap-426 .glyphicon-step-forward:before{content:"\e077"}.factory-bootstrap-426 .glyphicon-eject:before{content:"\e078"}.factory-bootstrap-426 .glyphicon-chevron-left:before{content:"\e079"}.factory-bootstrap-426 .glyphicon-chevron-right:before{content:"\e080"}.factory-bootstrap-426 .glyphicon-plus-sign:before{content:"\e081"}.factory-bootstrap-426 .glyphicon-minus-sign:before{content:"\e082"}.factory-bootstrap-426 .glyphicon-remove-sign:before{content:"\e083"}.factory-bootstrap-426 .glyphicon-ok-sign:before{content:"\e084"}.factory-bootstrap-426 .glyphicon-question-sign:before{content:"\e085"}.factory-bootstrap-426 .glyphicon-info-sign:before{content:"\e086"}.factory-bootstrap-426 .glyphicon-screenshot:before{content:"\e087"}.factory-bootstrap-426 .glyphicon-remove-circle:before{content:"\e088"}.factory-bootstrap-426 .glyphicon-ok-circle:before{content:"\e089"}.factory-bootstrap-426 .glyphicon-ban-circle:before{content:"\e090"}.factory-bootstrap-426 .glyphicon-arrow-left:before{content:"\e091"}.factory-bootstrap-426 .glyphicon-arrow-right:before{content:"\e092"}.factory-bootstrap-426 .glyphicon-arrow-up:before{content:"\e093"}.factory-bootstrap-426 .glyphicon-arrow-down:before{content:"\e094"}.factory-bootstrap-426 .glyphicon-share-alt:before{content:"\e095"}.factory-bootstrap-426 .glyphicon-resize-full:before{content:"\e096"}.factory-bootstrap-426 .glyphicon-resize-small:before{content:"\e097"}.factory-bootstrap-426 .glyphicon-exclamation-sign:before{content:"\e101"}.factory-bootstrap-426 .glyphicon-gift:before{content:"\e102"}.factory-bootstrap-426 .glyphicon-leaf:before{content:"\e103"}.factory-bootstrap-426 .glyphicon-fire:before{content:"\e104"}.factory-bootstrap-426 .glyphicon-eye-open:before{content:"\e105"}.factory-bootstrap-426 .glyphicon-eye-close:before{content:"\e106"}.factory-bootstrap-426 .glyphicon-warning-sign:before{content:"\e107"}.factory-bootstrap-426 .glyphicon-plane:before{content:"\e108"}.factory-bootstrap-426 .glyphicon-calendar:before{content:"\e109"}.factory-bootstrap-426 .glyphicon-random:before{content:"\e110"}.factory-bootstrap-426 .glyphicon-comment:before{content:"\e111"}.factory-bootstrap-426 .glyphicon-magnet:before{content:"\e112"}.factory-bootstrap-426 .glyphicon-chevron-up:before{content:"\e113"}.factory-bootstrap-426 .glyphicon-chevron-down:before{content:"\e114"}.factory-bootstrap-426 .glyphicon-retweet:before{content:"\e115"}.factory-bootstrap-426 .glyphicon-shopping-cart:before{content:"\e116"}.factory-bootstrap-426 .glyphicon-folder-close:before{content:"\e117"}.factory-bootstrap-426 .glyphicon-folder-open:before{content:"\e118"}.factory-bootstrap-426 .glyphicon-resize-vertical:before{content:"\e119"}.factory-bootstrap-426 .glyphicon-resize-horizontal:before{content:"\e120"}.factory-bootstrap-426 .glyphicon-hdd:before{content:"\e121"}.factory-bootstrap-426 .glyphicon-bullhorn:before{content:"\e122"}.factory-bootstrap-426 .glyphicon-bell:before{content:"\e123"}.factory-bootstrap-426 .glyphicon-certificate:before{content:"\e124"}.factory-bootstrap-426 .glyphicon-thumbs-up:before{content:"\e125"}.factory-bootstrap-426 .glyphicon-thumbs-down:before{content:"\e126"}.factory-bootstrap-426 .glyphicon-hand-right:before{content:"\e127"}.factory-bootstrap-426 .glyphicon-hand-left:before{content:"\e128"}.factory-bootstrap-426 .glyphicon-hand-up:before{content:"\e129"}.factory-bootstrap-426 .glyphicon-hand-down:before{content:"\e130"}.factory-bootstrap-426 .glyphicon-circle-arrow-right:before{content:"\e131"}.factory-bootstrap-426 .glyphicon-circle-arrow-left:before{content:"\e132"}.factory-bootstrap-426 .glyphicon-circle-arrow-up:before{content:"\e133"}.factory-bootstrap-426 .glyphicon-circle-arrow-down:before{content:"\e134"}.factory-bootstrap-426 .glyphicon-globe:before{content:"\e135"}.factory-bootstrap-426 .glyphicon-wrench:before{content:"\e136"}.factory-bootstrap-426 .glyphicon-tasks:before{content:"\e137"}.factory-bootstrap-426 .glyphicon-filter:before{content:"\e138"}.factory-bootstrap-426 .glyphicon-briefcase:before{content:"\e139"}.factory-bootstrap-426 .glyphicon-fullscreen:before{content:"\e140"}.factory-bootstrap-426 .glyphicon-dashboard:before{content:"\e141"}.factory-bootstrap-426 .glyphicon-paperclip:before{content:"\e142"}.factory-bootstrap-426 .glyphicon-heart-empty:before{content:"\e143"}.factory-bootstrap-426 .glyphicon-link:before{content:"\e144"}.factory-bootstrap-426 .glyphicon-phone:before{content:"\e145"}.factory-bootstrap-426 .glyphicon-pushpin:before{content:"\e146"}.factory-bootstrap-426 .glyphicon-usd:before{content:"\e148"}.factory-bootstrap-426 .glyphicon-gbp:before{content:"\e149"}.factory-bootstrap-426 .glyphicon-sort:before{content:"\e150"}.factory-bootstrap-426 .glyphicon-sort-by-alphabet:before{content:"\e151"}.factory-bootstrap-426 .glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.factory-bootstrap-426 .glyphicon-sort-by-order:before{content:"\e153"}.factory-bootstrap-426 .glyphicon-sort-by-order-alt:before{content:"\e154"}.factory-bootstrap-426 .glyphicon-sort-by-attributes:before{content:"\e155"}.factory-bootstrap-426 .glyphicon-sort-by-attributes-alt:before{content:"\e156"}.factory-bootstrap-426 .glyphicon-unchecked:before{content:"\e157"}.factory-bootstrap-426 .glyphicon-expand:before{content:"\e158"}.factory-bootstrap-426 .glyphicon-collapse-down:before{content:"\e159"}.factory-bootstrap-426 .glyphicon-collapse-up:before{content:"\e160"}.factory-bootstrap-426 .glyphicon-log-in:before{content:"\e161"}.factory-bootstrap-426 .glyphicon-flash:before{content:"\e162"}.factory-bootstrap-426 .glyphicon-log-out:before{content:"\e163"}.factory-bootstrap-426 .glyphicon-new-window:before{content:"\e164"}.factory-bootstrap-426 .glyphicon-record:before{content:"\e165"}.factory-bootstrap-426 .glyphicon-save:before{content:"\e166"}.factory-bootstrap-426 .glyphicon-open:before{content:"\e167"}.factory-bootstrap-426 .glyphicon-saved:before{content:"\e168"}.factory-bootstrap-426 .glyphicon-import:before{content:"\e169"}.factory-bootstrap-426 .glyphicon-export:before{content:"\e170"}.factory-bootstrap-426 .glyphicon-send:before{content:"\e171"}.factory-bootstrap-426 .glyphicon-floppy-disk:before{content:"\e172"}.factory-bootstrap-426 .glyphicon-floppy-saved:before{content:"\e173"}.factory-bootstrap-426 .glyphicon-floppy-remove:before{content:"\e174"}.factory-bootstrap-426 .glyphicon-floppy-save:before{content:"\e175"}.factory-bootstrap-426 .glyphicon-floppy-open:before{content:"\e176"}.factory-bootstrap-426 .glyphicon-credit-card:before{content:"\e177"}.factory-bootstrap-426 .glyphicon-transfer:before{content:"\e178"}.factory-bootstrap-426 .glyphicon-cutlery:before{content:"\e179"}.factory-bootstrap-426 .glyphicon-header:before{content:"\e180"}.factory-bootstrap-426 .glyphicon-compressed:before{content:"\e181"}.factory-bootstrap-426 .glyphicon-earphone:before{content:"\e182"}.factory-bootstrap-426 .glyphicon-phone-alt:before{content:"\e183"}.factory-bootstrap-426 .glyphicon-tower:before{content:"\e184"}.factory-bootstrap-426 .glyphicon-stats:before{content:"\e185"}.factory-bootstrap-426 .glyphicon-sd-video:before{content:"\e186"}.factory-bootstrap-426 .glyphicon-hd-video:before{content:"\e187"}.factory-bootstrap-426 .glyphicon-subtitles:before{content:"\e188"}.factory-bootstrap-426 .glyphicon-sound-stereo:before{content:"\e189"}.factory-bootstrap-426 .glyphicon-sound-dolby:before{content:"\e190"}.factory-bootstrap-426 .glyphicon-sound-5-1:before{content:"\e191"}.factory-bootstrap-426 .glyphicon-sound-6-1:before{content:"\e192"}.factory-bootstrap-426 .glyphicon-sound-7-1:before{content:"\e193"}.factory-bootstrap-426 .glyphicon-copyright-mark:before{content:"\e194"}.factory-bootstrap-426 .glyphicon-registration-mark:before{content:"\e195"}.factory-bootstrap-426 .glyphicon-cloud-download:before{content:"\e197"}.factory-bootstrap-426 .glyphicon-cloud-upload:before{content:"\e198"}.factory-bootstrap-426 .glyphicon-tree-conifer:before{content:"\e199"}.factory-bootstrap-426 .glyphicon-tree-deciduous:before{content:"\e200"}.factory-bootstrap-426 .caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.factory-bootstrap-426 .dropdown{position:relative}.factory-bootstrap-426 .dropdown-toggle:focus{outline:0}.factory-bootstrap-426 .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.factory-bootstrap-426 .dropdown-menu.pull-right{right:0;left:auto}.factory-bootstrap-426 .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.factory-bootstrap-426 .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429;color:#333;white-space:nowrap}.factory-bootstrap-426 .dropdown-menu>li>a:focus,.factory-bootstrap-426 .dropdown-menu>li>a:hover{color:#262626;text-decoration:none}.factory-bootstrap-426 .dropdown-menu>.active>a,.factory-bootstrap-426 .dropdown-menu>.active>a:focus,.factory-bootstrap-426 .dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0}.factory-bootstrap-426 .dropdown-menu>.disabled>a,.factory-bootstrap-426 .dropdown-menu>.disabled>a:focus,.factory-bootstrap-426 .dropdown-menu>.disabled>a:hover{color:#999}.factory-bootstrap-426 .dropdown-menu>.disabled>a:focus,.factory-bootstrap-426 .dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-426 .open>.dropdown-menu{display:block}.factory-bootstrap-426 .open>a{outline:0}.factory-bootstrap-426 .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.factory-bootstrap-426 .dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.factory-bootstrap-426 .pull-right>.dropdown-menu{right:0;left:auto}.factory-bootstrap-426 .dropup .caret,.factory-bootstrap-426 .navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.factory-bootstrap-426 .dropup .dropdown-menu,.factory-bootstrap-426 .navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.factory-bootstrap-426 .btn-group,.factory-bootstrap-426 .btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.factory-bootstrap-426 .btn-group-vertical>.btn,.factory-bootstrap-426 .btn-group>.btn{position:relative;float:left}.factory-bootstrap-426 .btn-group-vertical>.btn.active,.factory-bootstrap-426 .btn-group-vertical>.btn:active,.factory-bootstrap-426 .btn-group-vertical>.btn:focus,.factory-bootstrap-426 .btn-group-vertical>.btn:hover,.factory-bootstrap-426 .btn-group>.btn.active,.factory-bootstrap-426 .btn-group>.btn:active,.factory-bootstrap-426 .btn-group>.btn:focus,.factory-bootstrap-426 .btn-group>.btn:hover{z-index:2}.factory-bootstrap-426 .btn-group-vertical>.btn:focus,.factory-bootstrap-426 .btn-group>.btn:focus{outline:0}.factory-bootstrap-426 .btn-group .btn+.btn,.factory-bootstrap-426 .btn-group .btn+.btn-group,.factory-bootstrap-426 .btn-group .btn-group+.btn,.factory-bootstrap-426 .btn-group .btn-group+.btn-group{margin-left:-1px}.factory-bootstrap-426 .btn-toolbar:after,.factory-bootstrap-426 .btn-toolbar:before{display:table;content:" "}.factory-bootstrap-426 .btn-toolbar:after{clear:both}.factory-bootstrap-426 .btn-toolbar .btn-group{float:left}.factory-bootstrap-426 .btn-toolbar>.btn+.btn,.factory-bootstrap-426 .btn-toolbar>.btn+.btn-group,.factory-bootstrap-426 .btn-toolbar>.btn-group+.btn,.factory-bootstrap-426 .btn-toolbar>.btn-group+.btn-group{margin-left:5px}.factory-bootstrap-426 .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.factory-bootstrap-426 .btn-group>.btn:first-child{margin-left:0}.factory-bootstrap-426 .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.factory-bootstrap-426 .btn-group>.btn:last-child:not(:first-child),.factory-bootstrap-426 .btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .btn-group>.btn-group{float:left}.factory-bootstrap-426 .btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.factory-bootstrap-426 .btn-group>.btn-group:first-child>.btn:last-child,.factory-bootstrap-426 .btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.factory-bootstrap-426 .btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .btn-group .dropdown-toggle:active,.factory-bootstrap-426 .btn-group.open .dropdown-toggle{outline:0}.factory-bootstrap-426 .btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-426 .btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-426 .btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-426 .btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.factory-bootstrap-426 .btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.factory-bootstrap-426 .btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.factory-bootstrap-426 .btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.factory-bootstrap-426 .btn-group{border:4px solid #f9f9f9;border-radius:4px}.factory-bootstrap-426 .btn-group .btn.active.value{text-shadow:none;color:#fff;background-color:#33aad5;-webkit-box-shadow:inset 0 1px 1px #0074a2;box-shadow:inset 0 1px 3px #0074a2;border-top:1px solid #0074a2;border-bottom:1px solid #0074a2;border-left:1px solid #0074a2}.factory-bootstrap-426 .btn .caret{margin-left:0}.factory-bootstrap-426 .btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.factory-bootstrap-426 .dropup .btn-lg .caret{border-width:0 5px 5px}.factory-bootstrap-426 .btn-group-vertical>.btn,.factory-bootstrap-426 .btn-group-vertical>.btn-group,.factory-bootstrap-426 .btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.factory-bootstrap-426 .btn-group-vertical>.btn-group:after,.factory-bootstrap-426 .btn-group-vertical>.btn-group:before{display:table;content:" "}.factory-bootstrap-426 .btn-group-vertical>.btn-group:after{clear:both}.factory-bootstrap-426 .btn-group-vertical>.btn-group>.btn{float:none}.factory-bootstrap-426 .btn-group-vertical>.btn+.btn,.factory-bootstrap-426 .btn-group-vertical>.btn+.btn-group,.factory-bootstrap-426 .btn-group-vertical>.btn-group+.btn,.factory-bootstrap-426 .btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.factory-bootstrap-426 .btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.factory-bootstrap-426 .btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.factory-bootstrap-426 .btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:4px;border-top-left-radius:0}.factory-bootstrap-426 .btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.factory-bootstrap-426 .btn-group-vertical>.btn-group:first-child>.btn:last-child,.factory-bootstrap-426 .btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.factory-bootstrap-426 .btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .btn-group-justified{display:table;width:100%;border-collapse:separate;table-layout:fixed}.factory-bootstrap-426 .btn-group-justified>.btn,.factory-bootstrap-426 .btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.factory-bootstrap-426 .btn-group-justified>.btn-group .btn{width:100%}[data-toggle=buttons]>.btn>input[type=checkbox],[data-toggle=buttons]>.btn>input[type=radio]{display:none}.factory-bootstrap-426 .input-group{position:relative;display:table;border-collapse:separate}.factory-bootstrap-426 .input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.factory-bootstrap-426 .input-group .form-control{width:100%;margin-bottom:0}.factory-bootstrap-426 .input-group-lg>.form-control,.factory-bootstrap-426 .input-group-lg>.input-group-addon,.factory-bootstrap-426 .input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.factory-bootstrap-426 select.input-group-lg>.form-control,.factory-bootstrap-426 select.input-group-lg>.input-group-addon,.factory-bootstrap-426 select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}.factory-bootstrap-426 textarea.input-group-lg>.form-control,.factory-bootstrap-426 textarea.input-group-lg>.input-group-addon,.factory-bootstrap-426 textarea.input-group-lg>.input-group-btn>.btn{height:auto}.factory-bootstrap-426 .input-group-sm>.form-control,.factory-bootstrap-426 .input-group-sm>.input-group-addon,.factory-bootstrap-426 .input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.factory-bootstrap-426 select.input-group-sm>.form-control,.factory-bootstrap-426 select.input-group-sm>.input-group-addon,.factory-bootstrap-426 select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}.factory-bootstrap-426 textarea.input-group-sm>.form-control,.factory-bootstrap-426 textarea.input-group-sm>.input-group-addon,.factory-bootstrap-426 textarea.input-group-sm>.input-group-btn>.btn{height:auto}.factory-bootstrap-426 .input-group .form-control,.factory-bootstrap-426 .input-group-addon,.factory-bootstrap-426 .input-group-btn{display:table-cell}.factory-bootstrap-426 .input-group .form-control:not(:first-child):not(:last-child),.factory-bootstrap-426 .input-group-addon:not(:first-child):not(:last-child),.factory-bootstrap-426 .input-group-btn:not(:first-child):not(:last-child){border-radius:0}.factory-bootstrap-426 .input-group-addon,.factory-bootstrap-426 .input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.factory-bootstrap-426 .input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.factory-bootstrap-426 .input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.factory-bootstrap-426 .input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.factory-bootstrap-426 .input-group-addon input[type=checkbox],.factory-bootstrap-426 .input-group-addon input[type=radio]{margin-top:0}.factory-bootstrap-426 .input-group .form-control:first-child,.factory-bootstrap-426 .input-group-addon:first-child,.factory-bootstrap-426 .input-group-btn:first-child>.btn,.factory-bootstrap-426 .input-group-btn:first-child>.dropdown-toggle,.factory-bootstrap-426 .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.factory-bootstrap-426 .input-group-addon:first-child{border-right:0}.factory-bootstrap-426 .input-group .form-control:last-child,.factory-bootstrap-426 .input-group-addon:last-child,.factory-bootstrap-426 .input-group-btn:first-child>.btn:not(:first-child),.factory-bootstrap-426 .input-group-btn:last-child>.btn,.factory-bootstrap-426 .input-group-btn:last-child>.dropdown-toggle{border-bottom-left-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .input-group-addon:last-child{border-left:0}.factory-bootstrap-426 .input-group-btn{position:relative;white-space:nowrap}.factory-bootstrap-426 .input-group-btn:first-child>.btn{margin-right:-1px}.factory-bootstrap-426 .input-group-btn:last-child>.btn{margin-left:-1px}.factory-bootstrap-426 .input-group-btn>.btn{position:relative}.factory-bootstrap-426 .input-group-btn>.btn+.btn{margin-left:-4px}.factory-bootstrap-426 .input-group-btn>.btn:active,.factory-bootstrap-426 .input-group-btn>.btn:hover{z-index:2}.factory-bootstrap-426 .nav{padding-left:0;margin-bottom:0;list-style:none}.factory-bootstrap-426 .nav:after,.factory-bootstrap-426 .nav:before{display:table;content:" "}.factory-bootstrap-426 .nav:after{clear:both}.factory-bootstrap-426 .nav>li{position:relative;display:block}.factory-bootstrap-426 .nav>li>a{position:relative;display:block;padding:10px 15px}.factory-bootstrap-426 .nav>li>a:focus,.factory-bootstrap-426 .nav>li>a:hover{text-decoration:none;background-color:#eee}.factory-bootstrap-426 .nav>li.disabled>a{color:#999}.factory-bootstrap-426 .nav>li.disabled>a:focus,.factory-bootstrap-426 .nav>li.disabled>a:hover{color:#999;text-decoration:none;cursor:not-allowed;background-color:transparent}.factory-bootstrap-426 .nav .open>a,.factory-bootstrap-426 .nav .open>a:focus,.factory-bootstrap-426 .nav .open>a:hover{background-color:#eee;border-color:#428bca}.factory-bootstrap-426 .nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.factory-bootstrap-426 .nav>li>a>img{max-width:none}.factory-bootstrap-426 .nav-tabs{border-bottom:1px solid #ddd}.factory-bootstrap-426 .nav-tabs>li{float:left;margin-bottom:-1px}.factory-bootstrap-426 .nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0}.factory-bootstrap-426 .nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.factory-bootstrap-426 .nav-tabs>li.active>a,.factory-bootstrap-426 .nav-tabs>li.active>a:focus,.factory-bootstrap-426 .nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.factory-bootstrap-426 .nav-tabs.nav-justified{width:100%;border-bottom:0}.factory-bootstrap-426 .nav-tabs.nav-justified>li{float:none}.factory-bootstrap-426 .nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.factory-bootstrap-426 .nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.factory-bootstrap-426 .nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.factory-bootstrap-426 .nav-tabs.nav-justified>.active>a,.factory-bootstrap-426 .nav-tabs.nav-justified>.active>a:focus,.factory-bootstrap-426 .nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.factory-bootstrap-426 .nav-pills>li{float:left}.factory-bootstrap-426 .nav-pills>li>a{border-radius:4px}.factory-bootstrap-426 .nav-pills>li+li{margin-left:2px}.factory-bootstrap-426 .nav-pills>li.active>a,.factory-bootstrap-426 .nav-pills>li.active>a:focus,.factory-bootstrap-426 .nav-pills>li.active>a:hover{color:#fff;background-color:#428bca}.factory-bootstrap-426 .nav-stacked>li{float:none}.factory-bootstrap-426 .nav-stacked>li+li{margin-top:2px;margin-left:0}.factory-bootstrap-426 .nav-justified{width:100%}.factory-bootstrap-426 .nav-justified>li{float:none}.factory-bootstrap-426 .nav-justified>li>a{margin-bottom:5px;text-align:center}.factory-bootstrap-426 .nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.factory-bootstrap-426 .nav-tabs-justified{border-bottom:0}.factory-bootstrap-426 .nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.factory-bootstrap-426 .nav-tabs-justified>.active>a,.factory-bootstrap-426 .nav-tabs-justified>.active>a:focus,.factory-bootstrap-426 .nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.factory-bootstrap-426 .tab-content>.tab-pane{display:none}.factory-bootstrap-426 .tab-content>.active{display:block}.factory-bootstrap-426 .nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}.factory-bootstrap-426 .navbar:after,.factory-bootstrap-426 .navbar:before{display:table;content:" "}.factory-bootstrap-426 .navbar:after{clear:both}@media (min-width:768px){.navbar{border-radius:4px}}.factory-bootstrap-426 .navbar-header:after,.factory-bootstrap-426 .navbar-header:before{display:table;content:" "}.factory-bootstrap-426 .navbar-header:after{clear:both}@media (min-width:768px){.navbar-header{float:left}}.factory-bootstrap-426 .navbar-collapse{max-height:340px;padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.factory-bootstrap-426 .navbar-collapse:after,.factory-bootstrap-426 .navbar-collapse:before{display:table;content:" "}.factory-bootstrap-426 .navbar-collapse:after{clear:both}.factory-bootstrap-426 .navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.factory-bootstrap-426 .container>.navbar-collapse,.factory-bootstrap-426 .container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.factory-bootstrap-426 .navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.factory-bootstrap-426 .navbar-fixed-bottom,.factory-bootstrap-426 .navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.factory-bootstrap-426 .navbar-fixed-top{top:0;border-width:0 0 1px}.factory-bootstrap-426 .navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.factory-bootstrap-426 .navbar-brand{float:left;padding:15px;font-size:18px;line-height:20px}.factory-bootstrap-426 .navbar-brand:focus,.factory-bootstrap-426 .navbar-brand:hover{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.factory-bootstrap-426 .navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.factory-bootstrap-426 .navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.factory-bootstrap-426 .navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.factory-bootstrap-426 .navbar-nav{margin:7.5px -15px}.factory-bootstrap-426 .navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.factory-bootstrap-426 .navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form select.form-control{width:auto}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{float:none;margin-left:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.factory-bootstrap-426 .navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.factory-bootstrap-426 .navbar-nav.pull-right>li>.dropdown-menu,.factory-bootstrap-426 .navbar-nav>li>.dropdown-menu.pull-right{right:0;left:auto}.factory-bootstrap-426 .navbar-btn{margin-top:8px;margin-bottom:8px}.factory-bootstrap-426 .navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.factory-bootstrap-426 .navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.factory-bootstrap-426 .navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.factory-bootstrap-426 .navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.factory-bootstrap-426 .navbar-default .navbar-brand{color:#777}.factory-bootstrap-426 .navbar-default .navbar-brand:focus,.factory-bootstrap-426 .navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.factory-bootstrap-426 .navbar-default .navbar-nav>li>a,.factory-bootstrap-426 .navbar-default .navbar-text{color:#777}.factory-bootstrap-426 .navbar-default .navbar-nav>li>a:focus,.factory-bootstrap-426 .navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.factory-bootstrap-426 .navbar-default .navbar-nav>.active>a,.factory-bootstrap-426 .navbar-default .navbar-nav>.active>a:focus,.factory-bootstrap-426 .navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.factory-bootstrap-426 .navbar-default .navbar-nav>.disabled>a,.factory-bootstrap-426 .navbar-default .navbar-nav>.disabled>a:focus,.factory-bootstrap-426 .navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.factory-bootstrap-426 .navbar-default .navbar-toggle{border-color:#ddd}.factory-bootstrap-426 .navbar-default .navbar-toggle:focus,.factory-bootstrap-426 .navbar-default .navbar-toggle:hover{background-color:#ddd}.factory-bootstrap-426 .navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.factory-bootstrap-426 .navbar-default .navbar-collapse,.factory-bootstrap-426 .navbar-default .navbar-form{border-color:#e7e7e7}.factory-bootstrap-426 .navbar-default .navbar-nav>.open>a,.factory-bootstrap-426 .navbar-default .navbar-nav>.open>a:focus,.factory-bootstrap-426 .navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.factory-bootstrap-426 .navbar-default .navbar-link{color:#777}.factory-bootstrap-426 .navbar-default .navbar-link:hover{color:#333}.factory-bootstrap-426 .navbar-inverse{background-color:#222;border-color:#080808}.factory-bootstrap-426 .navbar-inverse .navbar-brand{color:#999}.factory-bootstrap-426 .navbar-inverse .navbar-brand:focus,.factory-bootstrap-426 .navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.factory-bootstrap-426 .navbar-inverse .navbar-nav>li>a,.factory-bootstrap-426 .navbar-inverse .navbar-text{color:#999}.factory-bootstrap-426 .navbar-inverse .navbar-nav>li>a:focus,.factory-bootstrap-426 .navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.factory-bootstrap-426 .navbar-inverse .navbar-nav>.active>a,.factory-bootstrap-426 .navbar-inverse .navbar-nav>.active>a:focus,.factory-bootstrap-426 .navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.factory-bootstrap-426 .navbar-inverse .navbar-nav>.disabled>a,.factory-bootstrap-426 .navbar-inverse .navbar-nav>.disabled>a:focus,.factory-bootstrap-426 .navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.factory-bootstrap-426 .navbar-inverse .navbar-toggle{border-color:#333}.factory-bootstrap-426 .navbar-inverse .navbar-toggle:focus,.factory-bootstrap-426 .navbar-inverse .navbar-toggle:hover{background-color:#333}.factory-bootstrap-426 .navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.factory-bootstrap-426 .navbar-inverse .navbar-collapse,.factory-bootstrap-426 .navbar-inverse .navbar-form{border-color:#101010}.factory-bootstrap-426 .navbar-inverse .navbar-nav>.open>a,.factory-bootstrap-426 .navbar-inverse .navbar-nav>.open>a:focus,.factory-bootstrap-426 .navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.factory-bootstrap-426 .navbar-inverse .navbar-link{color:#999}.factory-bootstrap-426 .navbar-inverse .navbar-link:hover{color:#fff}.factory-bootstrap-426 .breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.factory-bootstrap-426 .breadcrumb>li{display:inline-block}.factory-bootstrap-426 .breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.factory-bootstrap-426 .breadcrumb>.active{color:#999}.factory-bootstrap-426 .pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.factory-bootstrap-426 .pagination>li{display:inline}.factory-bootstrap-426 .pagination>li>a,.factory-bootstrap-426 .pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd}.factory-bootstrap-426 .pagination>li:first-child>a,.factory-bootstrap-426 .pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.factory-bootstrap-426 .pagination>li:last-child>a,.factory-bootstrap-426 .pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.factory-bootstrap-426 .pagination>li>a:focus,.factory-bootstrap-426 .pagination>li>a:hover,.factory-bootstrap-426 .pagination>li>span:focus,.factory-bootstrap-426 .pagination>li>span:hover{background-color:#eee}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#1e8cbe;border-color:#0074a2}.factory-bootstrap-426 .pagination>.disabled>a,.factory-bootstrap-426 .pagination>.disabled>a:focus,.factory-bootstrap-426 .pagination>.disabled>a:hover,.factory-bootstrap-426 .pagination>.disabled>span,.factory-bootstrap-426 .pagination>.disabled>span:focus,.factory-bootstrap-426 .pagination>.disabled>span:hover{color:#999;cursor:not-allowed;background-color:#fff;border-color:#ddd}.factory-bootstrap-426 .pagination-lg>li>a,.factory-bootstrap-426 .pagination-lg>li>span{padding:10px 16px;font-size:18px}.factory-bootstrap-426 .pagination-lg>li:first-child>a,.factory-bootstrap-426 .pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.factory-bootstrap-426 .pagination-lg>li:last-child>a,.factory-bootstrap-426 .pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.factory-bootstrap-426 .pagination-sm>li>a,.factory-bootstrap-426 .pagination-sm>li>span{padding:5px 10px;font-size:12px}.factory-bootstrap-426 .pagination-sm>li:first-child>a,.factory-bootstrap-426 .pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.factory-bootstrap-426 .pagination-sm>li:last-child>a,.factory-bootstrap-426 .pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.factory-bootstrap-426 .pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.factory-bootstrap-426 .pager:after,.factory-bootstrap-426 .pager:before{display:table;content:" "}.factory-bootstrap-426 .pager:after{clear:both}.factory-bootstrap-426 .pager li{display:inline}.factory-bootstrap-426 .pager li>a,.factory-bootstrap-426 .pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.factory-bootstrap-426 .pager li>a:focus,.factory-bootstrap-426 .pager li>a:hover{text-decoration:none;background-color:#eee}.factory-bootstrap-426 .pager .next>a,.factory-bootstrap-426 .pager .next>span{float:right}.factory-bootstrap-426 .pager .previous>a,.factory-bootstrap-426 .pager .previous>span{float:left}.factory-bootstrap-426 .pager .disabled>a,.factory-bootstrap-426 .pager .disabled>a:focus,.factory-bootstrap-426 .pager .disabled>a:hover,.factory-bootstrap-426 .pager .disabled>span{color:#999;cursor:not-allowed;background-color:#fff}.factory-bootstrap-426 .label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.factory-bootstrap-426 .label[href]:focus,.factory-bootstrap-426 .label[href]:hover{color:#fff;text-decoration:none;cursor:pointer}.factory-bootstrap-426 .label:empty{display:none}.factory-bootstrap-426 .btn .label{position:relative;top:-1px}.factory-bootstrap-426 .label-default{background-color:#999}.factory-bootstrap-426 .label-default[href]:focus,.factory-bootstrap-426 .label-default[href]:hover{background-color:gray}.factory-bootstrap-426 .label-primary{background-color:#428bca}.factory-bootstrap-426 .label-primary[href]:focus,.factory-bootstrap-426 .label-primary[href]:hover{background-color:#3071a9}.factory-bootstrap-426 .label-success{background-color:#5cb85c}.factory-bootstrap-426 .label-success[href]:focus,.factory-bootstrap-426 .label-success[href]:hover{background-color:#449d44}.factory-bootstrap-426 .label-info{background-color:#5bc0de}.factory-bootstrap-426 .label-info[href]:focus,.factory-bootstrap-426 .label-info[href]:hover{background-color:#31b0d5}.factory-bootstrap-426 .label-warning{background-color:#f0ad4e}.factory-bootstrap-426 .label-warning[href]:focus,.factory-bootstrap-426 .label-warning[href]:hover{background-color:#ec971f}.factory-bootstrap-426 .label-danger{background-color:#d9534f}.factory-bootstrap-426 .label-danger[href]:focus,.factory-bootstrap-426 .label-danger[href]:hover{background-color:#c9302c}.factory-bootstrap-426 .badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#999;border-radius:10px}.factory-bootstrap-426 .badge:empty{display:none}.factory-bootstrap-426 .btn .badge{position:relative;top:-1px}.factory-bootstrap-426 a.badge:focus,.factory-bootstrap-426 a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.factory-bootstrap-426 .nav-pills>.active>a>.badge,.factory-bootstrap-426 a.list-group-item.active>.badge{color:#428bca;background-color:#fff}.factory-bootstrap-426 .nav-pills>li>a>.badge{margin-left:3px}.factory-bootstrap-426 .jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.factory-bootstrap-426 .jumbotron .h1,.factory-bootstrap-426 .jumbotron h1{line-height:1;color:inherit}.factory-bootstrap-426 .jumbotron p{line-height:1.4}.factory-bootstrap-426 .container .jumbotron{border-radius:6px}.factory-bootstrap-426 .jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.factory-bootstrap-426 .thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.factory-bootstrap-426 .thumbnail a>img,.factory-bootstrap-426 .thumbnail>img{display:block;height:auto;max-width:100%;margin-right:auto;margin-left:auto}.factory-bootstrap-426 a.thumbnail.active,.factory-bootstrap-426 a.thumbnail:focus,.factory-bootstrap-426 a.thumbnail:hover{border-color:#428bca}.factory-bootstrap-426 .thumbnail .caption{padding:9px;color:#333}.factory-bootstrap-426 .alert{border:1px solid transparent;border-radius:4px}.factory-bootstrap-426 .alert h4{margin-top:0;color:inherit}.factory-bootstrap-426 .alert .alert-link{font-weight:700}.factory-bootstrap-426 .alert>p,.factory-bootstrap-426 .alert>ul{margin-bottom:0}.factory-bootstrap-426 .alert>p+p{margin-top:5px}.factory-bootstrap-426 .alert-dismissable{padding-right:35px}.factory-bootstrap-426 .alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.factory-bootstrap-426 .alert-info{color:#31708f;background-color:#d9edf7}.factory-bootstrap-426 .alert-info hr{border-top-color:#a6e1ec}.factory-bootstrap-426 .alert-info .alert-link{color:#245269}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.factory-bootstrap-426 .progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.factory-bootstrap-426 .progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#2ea2cc;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.factory-bootstrap-426 .progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.factory-bootstrap-426 .progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.factory-bootstrap-426 .progress-bar-success{background-color:#5cb85c}.factory-bootstrap-426 .progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-426 .progress-bar-info{background-color:#5bc0de}.factory-bootstrap-426 .progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-426 .progress-bar-warning{background-color:#f0ad4e}.factory-bootstrap-426 .progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-426 .progress-bar-danger{background-color:#d9534f}.factory-bootstrap-426 .progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.factory-bootstrap-426 .media,.factory-bootstrap-426 .media-body{overflow:hidden;zoom:1}.factory-bootstrap-426 .media,.factory-bootstrap-426 .media .media{margin-top:15px}.factory-bootstrap-426 .media:first-child{margin-top:0}.factory-bootstrap-426 .media-object{display:block}.factory-bootstrap-426 .media-heading{margin:0 0 5px}.factory-bootstrap-426 .media>.pull-left{margin-right:10px}.factory-bootstrap-426 .media>.pull-right{margin-left:10px}.factory-bootstrap-426 .media-list{padding-left:0;list-style:none}.factory-bootstrap-426 .list-group{padding-left:0;margin-bottom:20px}.factory-bootstrap-426 .list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.factory-bootstrap-426 .list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.factory-bootstrap-426 .list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.factory-bootstrap-426 .list-group-item>.badge{float:right}.factory-bootstrap-426 .list-group-item>.badge+.badge{margin-right:5px}.factory-bootstrap-426 a.list-group-item{color:#555}.factory-bootstrap-426 a.list-group-item .list-group-item-heading{color:#333}.factory-bootstrap-426 a.list-group-item:focus,.factory-bootstrap-426 a.list-group-item:hover{text-decoration:none;background-color:#f5f5f5}.factory-bootstrap-426 a.list-group-item.active,.factory-bootstrap-426 a.list-group-item.active:focus,.factory-bootstrap-426 a.list-group-item.active:hover{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.factory-bootstrap-426 a.list-group-item.active .list-group-item-heading,.factory-bootstrap-426 a.list-group-item.active:focus .list-group-item-heading,.factory-bootstrap-426 a.list-group-item.active:hover .list-group-item-heading{color:inherit}.factory-bootstrap-426 a.list-group-item.active .list-group-item-text,.factory-bootstrap-426 a.list-group-item.active:focus .list-group-item-text,.factory-bootstrap-426 a.list-group-item.active:hover .list-group-item-text{color:#e1edf7}.factory-bootstrap-426 .list-group-item-heading{margin-top:0;margin-bottom:5px}.factory-bootstrap-426 .list-group-item-text{margin-bottom:0;line-height:1.3}.factory-bootstrap-426 .panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px}.factory-bootstrap-426 .panel-body{padding:15px}.factory-bootstrap-426 .panel-body:after,.factory-bootstrap-426 .panel-body:before{display:table;content:" "}.factory-bootstrap-426 .panel-body:after{clear:both}.factory-bootstrap-426 .panel>.list-group{margin-bottom:0}.factory-bootstrap-426 .panel>.list-group .list-group-item{border-width:1px 0}.factory-bootstrap-426 .panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.factory-bootstrap-426 .panel>.list-group .list-group-item:last-child{border-bottom:0}.factory-bootstrap-426 .panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.factory-bootstrap-426 .panel>.table,.factory-bootstrap-426 .panel>.table-responsive>.table{margin-bottom:0}.factory-bootstrap-426 .panel>.panel-body+.table,.factory-bootstrap-426 .panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.factory-bootstrap-426 .panel>.table>tbody:first-child td,.factory-bootstrap-426 .panel>.table>tbody:first-child th{border-top:0}.factory-bootstrap-426 .panel>.table-bordered,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered{border:0}.factory-bootstrap-426 .panel>.table-bordered>tbody>tr>td:first-child,.factory-bootstrap-426 .panel>.table-bordered>tbody>tr>th:first-child,.factory-bootstrap-426 .panel>.table-bordered>tfoot>tr>td:first-child,.factory-bootstrap-426 .panel>.table-bordered>tfoot>tr>th:first-child,.factory-bootstrap-426 .panel>.table-bordered>thead>tr>td:first-child,.factory-bootstrap-426 .panel>.table-bordered>thead>tr>th:first-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.factory-bootstrap-426 .panel>.table-bordered>tbody>tr>td:last-child,.factory-bootstrap-426 .panel>.table-bordered>tbody>tr>th:last-child,.factory-bootstrap-426 .panel>.table-bordered>tfoot>tr>td:last-child,.factory-bootstrap-426 .panel>.table-bordered>tfoot>tr>th:last-child,.factory-bootstrap-426 .panel>.table-bordered>thead>tr>td:last-child,.factory-bootstrap-426 .panel>.table-bordered>thead>tr>th:last-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.factory-bootstrap-426 .panel>.table-bordered>tbody>tr:last-child>td,.factory-bootstrap-426 .panel>.table-bordered>tbody>tr:last-child>th,.factory-bootstrap-426 .panel>.table-bordered>tfoot>tr:last-child>td,.factory-bootstrap-426 .panel>.table-bordered>tfoot>tr:last-child>th,.factory-bootstrap-426 .panel>.table-bordered>thead>tr:last-child>td,.factory-bootstrap-426 .panel>.table-bordered>thead>tr:last-child>th,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>thead>tr:last-child>td,.factory-bootstrap-426 .panel>.table-responsive>.table-bordered>thead>tr:last-child>th{border-bottom:0}.factory-bootstrap-426 .panel>.table-responsive{margin-bottom:0;border:0}.factory-bootstrap-426 .panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.factory-bootstrap-426 .panel-heading>.dropdown .dropdown-toggle{color:inherit}.factory-bootstrap-426 .panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.factory-bootstrap-426 .panel-title>a{color:inherit}.factory-bootstrap-426 .panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.factory-bootstrap-426 .panel-group .panel{margin-bottom:0;overflow:hidden;border-radius:4px}.factory-bootstrap-426 .panel-group .panel+.panel{margin-top:5px}.factory-bootstrap-426 .panel-group .panel-heading{border-bottom:0}.factory-bootstrap-426 .panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.factory-bootstrap-426 .panel-group .panel-footer{border-top:0}.factory-bootstrap-426 .panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.factory-bootstrap-426 .panel-default{border-color:#ddd}.factory-bootstrap-426 .panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.factory-bootstrap-426 .panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.factory-bootstrap-426 .panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.factory-bootstrap-426 .panel-primary{border-color:#428bca}.factory-bootstrap-426 .panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.factory-bootstrap-426 .panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.factory-bootstrap-426 .panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.factory-bootstrap-426 .panel-success{border-color:#d6e9c6}.factory-bootstrap-426 .panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.factory-bootstrap-426 .panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.factory-bootstrap-426 .panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.factory-bootstrap-426 .panel-warning{border-color:#faebcc}.factory-bootstrap-426 .panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.factory-bootstrap-426 .panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.factory-bootstrap-426 .panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.factory-bootstrap-426 .panel-danger{border-color:#ebccd1}.factory-bootstrap-426 .panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.factory-bootstrap-426 .panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.factory-bootstrap-426 .panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.factory-bootstrap-426 .panel-info{border-color:#bce8f1}.factory-bootstrap-426 .panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.factory-bootstrap-426 .panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.factory-bootstrap-426 .panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.factory-bootstrap-426 .well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px}.factory-bootstrap-426 .well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.factory-bootstrap-426 .well-lg{padding:24px;border-radius:6px}.factory-bootstrap-426 .well-sm{padding:9px;border-radius:3px}.factory-bootstrap-426 .close{float:right;font-size:14px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.factory-bootstrap-426 .alert .close{position:relative;top:-8px;right:-7px}.factory-bootstrap-426 .close:focus,.factory-bootstrap-426 .close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.factory-bootstrap-426 button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.factory-bootstrap-426 .modal-open{overflow:hidden}.factory-bootstrap-426 .modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:auto;overflow-y:scroll;width:auto;margin-left:0;background-color:transparent;border:0}.factory-bootstrap-426 .modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.factory-bootstrap-426 .modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.factory-bootstrap-426 .modal-dialog{position:relative;z-index:1050;width:auto;margin:10px}.factory-bootstrap-426 .modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box}.factory-bootstrap-426 .modal-backdrop,.factory-bootstrap-426-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.factory-bootstrap-426 .modal-backdrop.fade,.factory-bootstrap-426-modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.factory-bootstrap-426 .modal-backdrop.in,.factory-bootstrap-426-modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.factory-bootstrap-426 .modal-header{min-height:16.428571429px;padding:15px;border-bottom:1px solid #e5e5e5}.factory-bootstrap-426 .modal-header .close{margin-top:-2px}.factory-bootstrap-426 .modal-title{margin:0;line-height:1.428571429}.factory-bootstrap-426 .modal-body{position:relative;padding:20px;max-height:none}.factory-bootstrap-426 .modal-footer{padding:19px 20px 20px;margin-top:15px;text-align:right;border-top:1px solid #e5e5e5}.factory-bootstrap-426 .modal-footer:after,.factory-bootstrap-426 .modal-footer:before{display:table;content:" "}.factory-bootstrap-426 .modal-footer:after{clear:both}.factory-bootstrap-426 .modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.factory-bootstrap-426 .modal-footer .btn-group .btn+.btn{margin-left:-1px}.factory-bootstrap-426 .modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.factory-bootstrap-426 .modal-dialog{width:600px;margin:30px auto}.factory-bootstrap-426 .modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}}.factory-bootstrap-426 .tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.factory-bootstrap-426 .tooltip.in{opacity:.9;filter:alpha(opacity=90)}.factory-bootstrap-426 .tooltip.top{padding:5px 0;margin-top:-3px}.factory-bootstrap-426 .tooltip.right{padding:0 5px;margin-left:3px}.factory-bootstrap-426 .tooltip.bottom{padding:5px 0;margin-top:3px}.factory-bootstrap-426 .tooltip.left{padding:0 5px;margin-left:-3px}.factory-bootstrap-426 .tooltip-inner{width:400px;padding:15px 20px;color:#fff;text-align:left;text-decoration:none;background-color:#673ab7;border-radius:3px}.factory-bootstrap-426 .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.factory-bootstrap-426 .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#673ab7;border-width:5px 5px 0}.factory-bootstrap-426 .tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-top-color:#673ab7;border-width:5px 5px 0}.factory-bootstrap-426 .tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-top-color:#673ab7;border-width:5px 5px 0}.factory-bootstrap-426 .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#673ab7;border-width:5px 5px 5px 0}.factory-bootstrap-426 .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#673ab7;border-width:5px 0 5px 5px}.factory-bootstrap-426 .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#673ab7;border-width:0 5px 5px}.factory-bootstrap-426 .tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-bottom-color:#673ab7;border-width:0 5px 5px}.factory-bootstrap-426 .tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-bottom-color:#673ab7;border-width:0 5px 5px}.factory-bootstrap-426 .popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);background-clip:padding-box}.factory-bootstrap-426 .popover.top{margin-top:-10px}.factory-bootstrap-426 .popover.right{margin-left:10px}.factory-bootstrap-426 .popover.bottom{margin-top:10px}.factory-bootstrap-426 .popover.left{margin-left:-10px}.factory-bootstrap-426 .popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.factory-bootstrap-426 .popover-content{padding:9px 14px}.factory-bootstrap-426 .popover .arrow,.factory-bootstrap-426 .popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.factory-bootstrap-426 .popover .arrow{border-width:11px}.factory-bootstrap-426 .popover .arrow:after{border-width:10px;content:""}.factory-bootstrap-426 .popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.factory-bootstrap-426 .popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0;content:" "}.factory-bootstrap-426 .popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.factory-bootstrap-426 .popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0;content:" "}.factory-bootstrap-426 .popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);border-top-width:0}.factory-bootstrap-426 .popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0;content:" "}.factory-bootstrap-426 .popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,.25);border-right-width:0}.factory-bootstrap-426 .popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0;content:" "}.factory-bootstrap-426 .carousel{position:relative}.factory-bootstrap-426 .carousel-inner{position:relative;width:100%;overflow:hidden}.factory-bootstrap-426 .carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.factory-bootstrap-426 .carousel-inner>.item>a>img,.factory-bootstrap-426 .carousel-inner>.item>img{display:block;height:auto;max-width:100%;line-height:1}.factory-bootstrap-426 .carousel-inner>.active,.factory-bootstrap-426 .carousel-inner>.next,.factory-bootstrap-426 .carousel-inner>.prev{display:block}.factory-bootstrap-426 .carousel-inner>.active{left:0}.factory-bootstrap-426 .carousel-inner>.next,.factory-bootstrap-426 .carousel-inner>.prev{position:absolute;top:0;width:100%}.factory-bootstrap-426 .carousel-inner>.next{left:100%}.factory-bootstrap-426 .carousel-inner>.prev{left:-100%}.factory-bootstrap-426 .carousel-inner>.next.left,.factory-bootstrap-426 .carousel-inner>.prev.right{left:0}.factory-bootstrap-426 .carousel-inner>.active.left{left:-100%}.factory-bootstrap-426 .carousel-inner>.active.right{left:100%}.factory-bootstrap-426 .carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);opacity:.5;filter:alpha(opacity=50)}.factory-bootstrap-426 .carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.5) 0),color-stop(rgba(0,0,0,.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.factory-bootstrap-426 .carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.0001) 0),color-stop(rgba(0,0,0,.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.factory-bootstrap-426 .carousel-control:focus,.factory-bootstrap-426 .carousel-control:hover{color:#fff;text-decoration:none;outline:0;opacity:.9;filter:alpha(opacity=90)}.factory-bootstrap-426 .carousel-control .glyphicon-chevron-left,.factory-bootstrap-426 .carousel-control .glyphicon-chevron-right,.factory-bootstrap-426 .carousel-control .icon-next,.factory-bootstrap-426 .carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block}.factory-bootstrap-426 .carousel-control .glyphicon-chevron-left,.factory-bootstrap-426 .carousel-control .icon-prev{left:50%}.factory-bootstrap-426 .carousel-control .glyphicon-chevron-right,.factory-bootstrap-426 .carousel-control .icon-next{right:50%}.factory-bootstrap-426 .carousel-control .icon-next,.factory-bootstrap-426 .carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.factory-bootstrap-426 .carousel-control .icon-prev:before{content:'\2039'}.factory-bootstrap-426 .carousel-control .icon-next:before{content:'\203a'}.factory-bootstrap-426 .carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.factory-bootstrap-426 .carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.factory-bootstrap-426 .carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.factory-bootstrap-426 .carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.factory-bootstrap-426 .carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicons-chevron-left,.carousel-control .glyphicons-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.factory-bootstrap-426 .clearfix:after,.factory-bootstrap-426 .clearfix:before{display:table;content:" "}.factory-bootstrap-426 .clearfix:after{clear:both}.factory-bootstrap-426 .center-block{display:block;margin-right:auto;margin-left:auto}.factory-bootstrap-426 .pull-right{float:right!important}.factory-bootstrap-426 .pull-left{float:left!important}.factory-bootstrap-426 .hide{display:none!important}.factory-bootstrap-426 .show{display:block!important}.factory-bootstrap-426 .invisible{visibility:hidden}.factory-bootstrap-426 .text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.factory-bootstrap-426 .hidden{display:none!important;visibility:hidden!important}.factory-bootstrap-426 .affix{position:fixed}@-ms-viewport{width:device-width}.factory-bootstrap-426 .visible-lg,.factory-bootstrap-426 .visible-md,.factory-bootstrap-426 .visible-sm,.factory-bootstrap-426 .visible-xs,.factory-bootstrap-426 td.visible-lg,.factory-bootstrap-426 td.visible-md,.factory-bootstrap-426 td.visible-sm,.factory-bootstrap-426 td.visible-xs,.factory-bootstrap-426 th.visible-lg,.factory-bootstrap-426 th.visible-md,.factory-bootstrap-426 th.visible-sm,.factory-bootstrap-426 th.visible-xs,.factory-bootstrap-426 tr.visible-lg,.factory-bootstrap-426 tr.visible-md,.factory-bootstrap-426 tr.visible-sm,.factory-bootstrap-426 tr.visible-xs{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}table.visible-xs.visible-sm{display:table}tr.visible-xs.visible-sm{display:table-row!important}td.visible-xs.visible-sm,th.visible-xs.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}table.visible-xs.visible-md{display:table}tr.visible-xs.visible-md{display:table-row!important}td.visible-xs.visible-md,th.visible-xs.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-xs.visible-lg{display:block!important}table.visible-xs.visible-lg{display:table}tr.visible-xs.visible-lg{display:table-row!important}td.visible-xs.visible-lg,th.visible-xs.visible-lg{display:table-cell!important}}@media (max-width:767px){.visible-sm.visible-xs{display:block!important}table.visible-sm.visible-xs{display:table}tr.visible-sm.visible-xs{display:table-row!important}td.visible-sm.visible-xs,th.visible-sm.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}table.visible-sm.visible-md{display:table}tr.visible-sm.visible-md{display:table-row!important}td.visible-sm.visible-md,th.visible-sm.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-sm.visible-lg{display:block!important}table.visible-sm.visible-lg{display:table}tr.visible-sm.visible-lg{display:table-row!important}td.visible-sm.visible-lg,th.visible-sm.visible-lg{display:table-cell!important}}@media (max-width:767px){.visible-md.visible-xs{display:block!important}table.visible-md.visible-xs{display:table}tr.visible-md.visible-xs{display:table-row!important}td.visible-md.visible-xs,th.visible-md.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}table.visible-md.visible-sm{display:table}tr.visible-md.visible-sm{display:table-row!important}td.visible-md.visible-sm,th.visible-md.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-md.visible-lg{display:block!important}table.visible-md.visible-lg{display:table}tr.visible-md.visible-lg{display:table-row!important}td.visible-md.visible-lg,th.visible-md.visible-lg{display:table-cell!important}}@media (max-width:767px){.visible-lg.visible-xs{display:block!important}table.visible-lg.visible-xs{display:table}tr.visible-lg.visible-xs{display:table-row!important}td.visible-lg.visible-xs,th.visible-lg.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}table.visible-lg.visible-sm{display:table}tr.visible-lg.visible-sm{display:table-row!important}td.visible-lg.visible-sm,th.visible-lg.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}table.visible-lg.visible-md{display:table}tr.visible-lg.visible-md{display:table-row!important}td.visible-lg.visible-md,th.visible-lg.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}.factory-bootstrap-426 .hidden-xs{display:block!important}.factory-bootstrap-426 table.hidden-xs{display:table}.factory-bootstrap-426 tr.hidden-xs{display:table-row!important}.factory-bootstrap-426 td.hidden-xs,.factory-bootstrap-426 th.hidden-xs{display:table-cell!important}@media (max-width:767px){.hidden-xs,td.hidden-xs,th.hidden-xs,tr.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm,th.hidden-xs.hidden-sm,tr.hidden-xs.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md,td.hidden-xs.hidden-md,th.hidden-xs.hidden-md,tr.hidden-xs.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg,th.hidden-xs.hidden-lg,tr.hidden-xs.hidden-lg{display:none!important}}.factory-bootstrap-426 .hidden-sm{display:block!important}.factory-bootstrap-426 table.hidden-sm{display:table}.factory-bootstrap-426 tr.hidden-sm{display:table-row!important}.factory-bootstrap-426 td.hidden-sm,.factory-bootstrap-426 th.hidden-sm{display:table-cell!important}@media (max-width:767px){.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs,th.hidden-sm.hidden-xs,tr.hidden-sm.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm,td.hidden-sm,th.hidden-sm,tr.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md,td.hidden-sm.hidden-md,th.hidden-sm.hidden-md,tr.hidden-sm.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg,th.hidden-sm.hidden-lg,tr.hidden-sm.hidden-lg{display:none!important}}.factory-bootstrap-426 .hidden-md{display:block!important}.factory-bootstrap-426 table.hidden-md{display:table}.factory-bootstrap-426 tr.hidden-md{display:table-row!important}.factory-bootstrap-426 td.hidden-md,.factory-bootstrap-426 th.hidden-md{display:table-cell!important}@media (max-width:767px){.hidden-md.hidden-xs,td.hidden-md.hidden-xs,th.hidden-md.hidden-xs,tr.hidden-md.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-md.hidden-sm,td.hidden-md.hidden-sm,th.hidden-md.hidden-sm,tr.hidden-md.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md,td.hidden-md,th.hidden-md,tr.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-md.hidden-lg,td.hidden-md.hidden-lg,th.hidden-md.hidden-lg,tr.hidden-md.hidden-lg{display:none!important}}.factory-bootstrap-426 .hidden-lg{display:block!important}.factory-bootstrap-426 table.hidden-lg{display:table}.factory-bootstrap-426 tr.hidden-lg{display:table-row!important}.factory-bootstrap-426 td.hidden-lg,.factory-bootstrap-426 th.hidden-lg{display:table-cell!important}@media (max-width:767px){.factory-bootstrap-426 .hidden-lg.hidden-xs,.factory-bootstrap-426 td.hidden-lg.hidden-xs,.factory-bootstrap-426 th.hidden-lg.hidden-xs,.factory-bootstrap-426 tr.hidden-lg.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.factory-bootstrap-426 .hidden-lg.hidden-sm,.factory-bootstrap-426 td.hidden-lg.hidden-sm,.factory-bootstrap-426 th.hidden-lg.hidden-sm,.factory-bootstrap-426 tr.hidden-lg.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.factory-bootstrap-426 .hidden-lg.hidden-md,.factory-bootstrap-426 td.hidden-lg.hidden-md,.factory-bootstrap-426 th.hidden-lg.hidden-md,.factory-bootstrap-426 tr.hidden-lg.hidden-md{display:none!important}}@media (min-width:1200px){.factory-bootstrap-426 .hidden-lg,.factory-bootstrap-426 td.hidden-lg,.factory-bootstrap-426 th.hidden-lg,.factory-bootstrap-426 tr.hidden-lg{display:none!important}}.factory-bootstrap-426 .visible-print,.factory-bootstrap-426 td.visible-print,.factory-bootstrap-426 th.visible-print,.factory-bootstrap-426 tr.visible-print{display:none!important}@media print{.factory-bootstrap-426 .visible-print{display:block!important}.factory-bootstrap-426 table.visible-print{display:table}.factory-bootstrap-426 tr.visible-print{display:table-row!important}.factory-bootstrap-426 td.visible-print,.factory-bootstrap-426 th.visible-print{display:table-cell!important}.factory-bootstrap-426 .hidden-print,.factory-bootstrap-426 td.hidden-print,.factory-bootstrap-426 th.hidden-print,.factory-bootstrap-426 tr.hidden-print{display:none!important}}/*!
|
12 |
* Factory Default Bootstrap Theme
|
13 |
*
|
14 |
* The code is based on Bootstrap v2.1.1
|
22 |
*
|
23 |
* @package factory-bootstrap
|
24 |
* @since 1.0.0
|
25 |
+
*/.factory-bootstrap-426 .btn-danger,.factory-bootstrap-426 .btn-default,.factory-bootstrap-426 .btn-info,.factory-bootstrap-426 .btn-primary,.factory-bootstrap-426 .btn-success,.factory-bootstrap-426 .btn-warning{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.factory-bootstrap-426 .btn-danger.active,.factory-bootstrap-426 .btn-danger:active,.factory-bootstrap-426 .btn-default.active,.factory-bootstrap-426 .btn-default:active,.factory-bootstrap-426 .btn-info.active,.factory-bootstrap-426 .btn-info:active,.factory-bootstrap-426 .btn-primary.active,.factory-bootstrap-426 .btn-primary:active,.factory-bootstrap-426 .btn-success.active,.factory-bootstrap-426 .btn-success:active,.factory-bootstrap-426 .btn-warning.active,.factory-bootstrap-426 .btn-warning:active{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.1);box-shadow:inset 0 1px 1px rgba(0,0,0,.1)}.factory-bootstrap-426 .btn.active,.factory-bootstrap-426 .btn:active{background-image:none}.factory-bootstrap-426 .btn-default{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.factory-bootstrap-426 .btn-default.active,.factory-bootstrap-426 .btn-default:active{background-color:#fff;border-color:#dbdbdb}.factory-bootstrap-426 .btn-gold{font-weight:700;padding:7px 12px;cursor:pointer;line-height:16px;display:inline-block;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;box-shadow:#e3e3e3 0 1px 1px;-moz-box-shadow:0 1px 1px rgba(000,000,000,.1),inset 0 1px 1px rgba(255,255,255,.7);-webkit-box-shadow:0 1px 1px rgba(000,000,000,.1),inset 0 1px 1px rgba(255,255,255,.7);text-shadow:1px 1px 0 #ffe8b2;color:#7c5d1b;border:1px solid #d6a437;background:#feeb80}.factory-bootstrap-426 .btn-gold:focus,.factory-bootstrap-426 .btn-gold:hover{background:#fef0a1}.factory-bootstrap-426 .btn-gold.active,.factory-bootstrap-426 .btn-gold:active{background:#fef0a1;-webkit-box-shadow:inset 0 3px 8px 0 #f8ba36;box-shadow:inset 0 3px 8px 0 #f8ba36}.factory-bootstrap-426 .btn-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.factory-bootstrap-426 .btn-primary.active,.factory-bootstrap-426 .btn-primary:active{background-color:#2d6ca2;border-color:#2b669a}.factory-bootstrap-426 .btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);background-repeat:repeat-x;border-color:#3e8f3e;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-426 .btn-success:focus,.factory-bootstrap-426 .btn-success:hover{background-color:#419641;background-position:0 -15px}.factory-bootstrap-426 .btn-success.active,.factory-bootstrap-426 .btn-success:active{background-color:#419641;border-color:#3e8f3e}.factory-bootstrap-426 .btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);background-repeat:repeat-x;border-color:#e38d13;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-426 .btn-warning:focus,.factory-bootstrap-426 .btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.factory-bootstrap-426 .btn-warning.active,.factory-bootstrap-426 .btn-warning:active{background-color:#eb9316;border-color:#e38d13}.factory-bootstrap-426 .btn-danger{color:#fff;background:#d9534f;border-color:#d43f3a}.factory-bootstrap-426 .btn-danger.active,.factory-bootstrap-426 .btn-danger:active,.factory-bootstrap-426 .btn-danger:focus,.factory-bootstrap-426 .btn-danger:hover,.factory-bootstrap-426 .open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.factory-bootstrap-426 .btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);background-repeat:repeat-x;border-color:#28a4c9;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-426 .btn-info:focus,.factory-bootstrap-426 .btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.factory-bootstrap-426 .btn-info.active,.factory-bootstrap-426 .btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.factory-bootstrap-426 .img-thumbnail,.factory-bootstrap-426 .thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.factory-bootstrap-426 .dropdown-menu>li>a:focus,.factory-bootstrap-426 .dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.factory-bootstrap-426 .dropdown-menu>.active>a,.factory-bootstrap-426 .dropdown-menu>.active>a:focus,.factory-bootstrap-426 .dropdown-menu>.active>a:hover{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.factory-bootstrap-426 .navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.factory-bootstrap-426 .navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.factory-bootstrap-426 .navbar-brand,.factory-bootstrap-426 .navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.factory-bootstrap-426 .navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.factory-bootstrap-426 .navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.factory-bootstrap-426 .navbar-inverse .navbar-brand,.factory-bootstrap-426 .navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.factory-bootstrap-426 .navbar-fixed-bottom,.factory-bootstrap-426 .navbar-fixed-top,.factory-bootstrap-426 .navbar-static-top{border-radius:0}.factory-bootstrap-426 .alert{-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.factory-bootstrap-426 .alert .actions{padding-top:10px}.factory-bootstrap-426 .alert-success{color:#3c763d;background-color:#dff0d8;border-bottom:2px solid #c8e5bc}.factory-bootstrap-426 .alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;border-color:#9acfea;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0)}.factory-bootstrap-426 .alert{text-shadow:none;box-shadow:none;margin:0;margin-top:10px;margin-bottom:10px;padding:10px}.factory-bootstrap-426 .alert-normal,.factory-bootstrap-426 .alert-warning{background:#fcf8e3;color:#8a6d3b;border:1px solid #b8823b}.factory-bootstrap-426 .alert-danger{background:#cf4944;color:#fff;border-bottom:2px solid #b23e3a}.factory-bootstrap-426 .alert-danger a:not(.btn),.factory-bootstrap-426 .alert-error a:not(.btn){color:#fff}.factory-bootstrap-426 .progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.factory-bootstrap-426 .progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.factory-bootstrap-426 .progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.factory-bootstrap-426 .progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.factory-bootstrap-426 .progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.factory-bootstrap-426 .progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.factory-bootstrap-426 .list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.factory-bootstrap-426 .list-group-item.active,.factory-bootstrap-426 .list-group-item.active:focus,.factory-bootstrap-426 .list-group-item.active:hover{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;border-color:#3278b3;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0)}.factory-bootstrap-426 .panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.factory-bootstrap-426 .panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.factory-bootstrap-426 .panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.factory-bootstrap-426 .panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.factory-bootstrap-426 .panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.factory-bootstrap-426 .panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.factory-bootstrap-426 .panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.factory-bootstrap-426 .well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;border-color:#dcdcdc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}.factory-bootstrap-426 .factory-after{margin-left:7px;display:inline-block}.factory-bootstrap-426 .factory-hidden{display:none}.factory-bootstrap-426 .factory-ajax-loader{width:25px;height:25px;background:url(../assets/images/loader-sm-tr.gif)}.factory-control-error{background-color:rgba(0,0,0,.8);white-space:normal;z-index:10;font-weight:400;line-height:150%;border-radius:4px;color:#fff;font-size:13px;margin-top:5px;padding:4px 10px 3px;max-width:500px;display:inline-block}.factory-control-error i{margin:0 7px 0 1px}
|
libs/factory/bootstrap/assets/css-min/bootstrap.ectoplasm.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#a3b745;border-color:#839237;color:#fff;-webkit-box-shadow:inset 0 1px 0 #c0cd7b,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #c0cd7b,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#89993a;border-color:#727f30;color:#fff;-webkit-box-shadow:inset 0 1px 0 #b7c669,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #b7c669,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#89993a;border-color:#727f30;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#cfd1c7!important;background:#89993a!important;border-color:#727f30!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#a3b745;-webkit-box-shadow:inset 0 1px 2px #839237;box-shadow:inset 0 1px 2px #839237;border-top:1px solid #839237;border-bottom:1px solid #839237;border-left:1px solid #839237}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#a3b745;border-color:#839237}
|
libs/factory/bootstrap/assets/css-min/bootstrap.form-group.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .factory-form-group .factory-legend{padding:9px 12px;background-color:#f9f9f9}.factory-bootstrap-426 .factory-form-group .factory-title{font-weight:700;font-size:14px;line-height:14px;color:#555;margin:0}.factory-bootstrap-426 .factory-form-group .factory-hint-icon{display:block;width:16px;height:16px;line-height:13px;padding:0;font-size:11px;text-align:center;position:absolute;top:-5px;right:-3px;color:#fff;background:#E91E63;border-radius:3px}.factory-bootstrap-426 .factory-form-group .factory-hint-icon.factory-hint-icon-green{background:#8bc34a}.factory-bootstrap-426 .factory-form-group .factory-hint-icon.factory-hint-icon-grey{background:#9e9e9e}.factory-bootstrap-426 .factory-form-group .factory-hint-icon.factory-hint-icon-red{background:#E91E63}.factory-bootstrap-426 .factory-form-group .factory-hint{margin:0;font-size:12px;line-height:16px;margin-top:6px}.factory-bootstrap-426 .factory-form-group+.factory-form-group{margin-top:30px}.factory-bootstrap-426 .factory-form-group legend+.control-group{margin-top:0}
|
libs/factory/bootstrap/assets/css-min/bootstrap.light.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#04a4cc;border-color:#037c9a;color:#fff;-webkit-box-shadow:inset 0 1px 0 #22cffb,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #22cffb,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#0384a4;border-color:#036881;color:#fff;-webkit-box-shadow:inset 0 1px 0 #09cafa,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #09cafa,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#0384a4;border-color:#036881;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#c7cfd1!important;background:#0384a4!important;border-color:#036881!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#04a4cc;-webkit-box-shadow:inset 0 1px 2px #037c9a;box-shadow:inset 0 1px 2px #037c9a;border-top:1px solid #037c9a;border-bottom:1px solid #037c9a;border-left:1px solid #037c9a}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#04a4cc;border-color:#037c9a}
|
libs/factory/bootstrap/assets/css-min/bootstrap.midnight.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#e14d43;border-color:#d02a21;color:#fff;-webkit-box-shadow:inset 0 1px 0 #ec8a85,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #ec8a85,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#d92c23;border-color:#ba251e;color:#fff;-webkit-box-shadow:inset 0 1px 0 #e8756f,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #e8756f,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#d92c23;border-color:#ba251e;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#d1c7c7!important;background:#d92c23!important;border-color:#ba251e!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#e14d43;-webkit-box-shadow:inset 0 1px 2px #d02a21;box-shadow:inset 0 1px 2px #d02a21;border-top:1px solid #d02a21;border-bottom:1px solid #d02a21;border-left:1px solid #d02a21}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#e14d43;border-color:#d02a21}
|
libs/factory/bootstrap/assets/css-min/bootstrap.ocean.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#9ebaa0;border-color:#80a583;color:#fff;-webkit-box-shadow:inset 0 1px 0 #cbdacc,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #cbdacc,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#86a988;border-color:#719a74;color:#fff;-webkit-box-shadow:inset 0 1px 0 #bccfbd,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #bccfbd,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#86a988;border-color:#719a74;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#c7d1c8!important;background:#86a988!important;border-color:#719a74!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#9ebaa0;-webkit-box-shadow:inset 0 1px 2px #80a583;box-shadow:inset 0 1px 2px #80a583;border-top:1px solid #80a583;border-bottom:1px solid #80a583;border-left:1px solid #80a583}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#9ebaa0;border-color:#80a583}
|
libs/factory/bootstrap/assets/css-min/bootstrap.separator.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .factory-separator{border-bottom:1px solid #f9f9f9;border-top:1px solid #d1d1d1;margin-bottom:25px}
|
libs/factory/bootstrap/assets/css-min/bootstrap.sunrise.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .btn-primary{background:#dd823b;border-color:#c36822;color:#fff;-webkit-box-shadow:inset 0 1px 0 #e8ab7c,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #e8ab7c,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:focus,.factory-bootstrap-426 .btn-primary:hover{background:#cc6c23;border-color:#ad5c1e;color:#fff;-webkit-box-shadow:inset 0 1px 0 #e59d66,0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 #e59d66,0 1px 0 rgba(0,0,0,.15)}.factory-bootstrap-426 .btn-primary:active{background:#cc6c23;border-color:#ad5c1e;color:#fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.factory-bootstrap-426 .btn-primary:disabled,.factory-bootstrap-426 .btn-primary[disabled]{color:#d1cbc7!important;background:#cc6c23!important;border-color:#ad5c1e!important;text-shadow:none!important}.factory-bootstrap-426 .btn-group .btn.active.value{background-color:#dd823b;-webkit-box-shadow:inset 0 1px 2px #c36822;box-shadow:inset 0 1px 2px #c36822;border-top:1px solid #c36822;border-bottom:1px solid #c36822;border-left:1px solid #c36822}.factory-bootstrap-426 .pagination>.active>a,.factory-bootstrap-426 .pagination>.active>a:focus,.factory-bootstrap-426 .pagination>.active>a:hover,.factory-bootstrap-426 .pagination>.active>span,.factory-bootstrap-426 .pagination>.active>span:focus,.factory-bootstrap-426 .pagination>.active>span:hover{background-color:#dd823b;border-color:#c36822}
|
libs/factory/bootstrap/assets/css-min/control.checkbox.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
#side-sortables .factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
#side-sortables .factory-bootstrap-426 .factory-buttons-way{float:right;position:relative;top:-25px;left:5px;border:3px solid #f9f9f9;border-radius:4px}.factory-bootstrap-426 .factory-buttons-way{border:3px solid #f9f9f9;border-radius:4px}.factory-bootstrap-426 .factory-buttons-way button{padding-left:10px;padding-right:10px}.factory-bootstrap-426 .factory-buttons-way .factory-on.active{text-shadow:none;color:#fff;background-color:#33aad5;-webkit-box-shadow:inset 0 1px 1px #0074a2;box-shadow:inset 0 1px 3px #0074a2;border-top:1px solid #0074a2;border-bottom:1px solid #0074a2;border-left:1px solid #0074a2}.factory-bootstrap-426 .factory-checkbox-tumbler-hint{margin-top:5px}.factory-bootstrap-426 .factory-checkbox-tumbler-hint .factory-tumbler-content{display:inline-block;background-color:#ffd;padding:1px 5px}.admin-color-light .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#04a4cc;-webkit-box-shadow:inset 0 1px 2px #037c9a;box-shadow:inset 0 1px 2px #037c9a;border-top:1px solid #037c9a;border-bottom:1px solid #037c9a;border-left:1px solid #037c9a}.admin-color-blue .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#e1a948;-webkit-box-shadow:inset 0 1px 2px #d39323;box-shadow:inset 0 1px 2px #d39323;border-top:1px solid #d39323;border-bottom:1px solid #d39323;border-left:1px solid #d39323}.admin-color-coffee .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#c7a589;-webkit-box-shadow:inset 0 1px 2px #b78a66;box-shadow:inset 0 1px 2px #b78a66;border-top:1px solid #b78a66;border-bottom:1px solid #b78a66;border-left:1px solid #b78a66}.admin-color-ectoplasm .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#a3b745;-webkit-box-shadow:inset 0 1px 2px #839237;box-shadow:inset 0 1px 2px #839237;border-top:1px solid #839237;border-bottom:1px solid #839237;border-left:1px solid #839237}.admin-color-midnight .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#e14d43;-webkit-box-shadow:inset 0 1px 2px #d02a21;box-shadow:inset 0 1px 2px #d02a21;border-top:1px solid #d02a21;border-bottom:1px solid #d02a21;border-left:1px solid #d02a21}.admin-color-ocean .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#9ebaa0;-webkit-box-shadow:inset 0 1px 2px #80a583;box-shadow:inset 0 1px 2px #80a583;border-top:1px solid #80a583;border-bottom:1px solid #80a583;border-left:1px solid #80a583}.admin-color-sunrise .factory-bootstrap-426 .factory-buttons-way .factory-on.active{background-color:#dd823b;-webkit-box-shadow:inset 0 1px 2px #c36822;box-shadow:inset 0 1px 2px #c36822;border-top:1px solid #c36822;border-bottom:1px solid #c36822;border-left:1px solid #c36822}
|
libs/factory/bootstrap/assets/css-min/control.dropdown.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .factory-dropdown.factory-buttons-way .fa{margin-right:6px;position:relative}.factory-bootstrap-426 .factory-dropdown.factory-buttons-way{border:0;border-radius:0}.factory-bootstrap-426 .factory-hints .factory-hint{margin-top:5px;display:inline-block;background-color:#ffd;padding:1px 5px}.admin-color-light .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#04a4cc;-webkit-box-shadow:inset 0 1px 2px #037c9a;box-shadow:inset 0 1px 2px #037c9a;border-top:1px solid #037c9a;border-bottom:1px solid #037c9a;border-left:1px solid #037c9a}.admin-color-blue .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#e1a948;-webkit-box-shadow:inset 0 1px 2px #d39323;box-shadow:inset 0 1px 2px #d39323;border-top:1px solid #d39323;border-bottom:1px solid #d39323;border-left:1px solid #d39323}.admin-color-coffee .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#c7a589;-webkit-box-shadow:inset 0 1px 2px #b78a66;box-shadow:inset 0 1px 2px #b78a66;border-top:1px solid #b78a66;border-bottom:1px solid #b78a66;border-left:1px solid #b78a66}.admin-color-ectoplasm .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#a3b745;-webkit-box-shadow:inset 0 1px 2px #839237;box-shadow:inset 0 1px 2px #839237;border-top:1px solid #839237;border-bottom:1px solid #839237;border-left:1px solid #839237}.admin-color-midnight .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#e14d43;-webkit-box-shadow:inset 0 1px 2px #d02a21;box-shadow:inset 0 1px 2px #d02a21;border-top:1px solid #d02a21;border-bottom:1px solid #d02a21;border-left:1px solid #d02a21}.admin-color-ocean .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#9ebaa0;-webkit-box-shadow:inset 0 1px 2px #80a583;box-shadow:inset 0 1px 2px #80a583;border-top:1px solid #80a583;border-bottom:1px solid #80a583;border-left:1px solid #80a583}.admin-color-sunrise .factory-bootstrap-426 .factory-dropdown.factory-buttons-way .active{background-color:#dd823b;-webkit-box-shadow:inset 0 1px 2px #c36822;box-shadow:inset 0 1px 2px #c36822;border-top:1px solid #c36822;border-bottom:1px solid #c36822;border-left:1px solid #c36822}.factory-bootstrap-426 .factory-dropdown.factory-ddslick-way .dd-select{background-color:#fff!important}.factory-bootstrap-426 .factory-dropdown.factory-ddslick-way label{margin-bottom:1px}.factory-bootstrap-426 .factory-dropdown.factory-ddslick-way .dd-option,.factory-bootstrap-426 .factory-dropdown.factory-ddslick-way .dd-selected{padding:8px 12px 8px 11px!important}
|
libs/factory/bootstrap/assets/css-min/control.multiple-textbox.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .factory-mtextbox-item{position:relative;margin-bottom:5px}.factory-bootstrap-426 .factory-mtextbox-item input,.factory-mtextbox-remove-item{display:inline-block}.factory-bootstrap-426 .factory-mtextbox-item .factory-mtextbox-remove-item{position:absolute;top:0;right:0;bottom:0;width:40px;border-radius:0 3px 3px 0;outline:0}.factory-bootstrap-426 .factory-mtextbox-item .factory-mtextbox-remove-item:focus,.factory-bootstrap-426 .factory-mtextbox-item .factory-mtextbox-remove-item:hover{box-shadow:none;outline:0}.factory-bootstrap-426 .factory-mtextbox-add-item{display:block;margin-top:10px}
|
libs/factory/bootstrap/assets/css-min/holder.more-link.min.css
CHANGED
@@ -8,4 +8,4 @@
|
|
8 |
*/
|
9 |
|
10 |
|
11 |
-
.factory-bootstrap-
|
8 |
*/
|
9 |
|
10 |
|
11 |
+
.factory-bootstrap-426 .factory-more-link-content{border-top:1px dashed #DDD;padding-top:25px;width:100%;padding-right:20px;position:relative}.factory-bootstrap-426 .factory-tab .factory-more-link-show{display:inline-block;text-decoration:none;border-bottom:1px dotted #21759b;position:relative}.factory-bootstrap-426 .factory-tab .factory-more-link-show:hover{border-color:#d54e21}.factory-bootstrap-426 .factory-tab .factory-more-link-hide{position:absolute;margin-top:-35px;background-color:#fff;padding:0 5px;right:20px;color:#bbb;text-decoration:none}.factory-bootstrap-426 .factory-tab .factory-more-link-hide:hover{color:#999}
|
libs/factory/bootstrap/assets/css-min/index.php
DELETED
File without changes
|
libs/factory/bootstrap/assets/images/index.php
DELETED
File without changes
|
libs/factory/bootstrap/assets/index.php
DELETED
File without changes
|
libs/factory/bootstrap/assets/js-min/bootstrap.dropdown.min.js
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
-
+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=factory-dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}},a.fn.
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
+
+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=factory-dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}},a.fn.factoryBootstrap426_dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.factoryBootstrap426_dropdown.Constructor=f,a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu]",f.prototype.keydown)}(jQuery);
|
libs/factory/bootstrap/assets/js-min/control.checkbox.min.js
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
-
!function(a){var b=function(b){var c=this;this.$element=a(b),this.$result=this.$element.find(".factory-result"),this.$on=this.$element.find(".factory-on"),this.$off=this.$element.find(".factory-off");var d=this.$element.is(".factory-tumbler"),e=this.$element.is(".factory-has-tumbler-hint"),f=this.$element.data("tumbler-function"),g=this.$element.data("tumbler-delay");g||(g=3e3),this.callByPath=function(a,b){for(var c=a.split("."),d=window,e=0;e<c.length;e++)d=d[c[e]];d.apply(d,b)},this.$on.click(function(){return c.$off.removeClass("active"),c.$on.addClass("active"),d?setTimeout(function(){c.$on.removeClass("active"),c.$off.addClass("active");var a=e?c.$element.next():null;f?c.callByPath(f,[c.$element,a]):e&&(c.$element.next().fadeIn(300),setTimeout(function(){c.$element.next().fadeOut(500)},g))},300):(c.$result.attr("checked","checked"),c.$result.val(1),c.$result.trigger("change")),!1}),this.$off.click(function(){return c.$on.removeClass("active"),c.$off.addClass("active"),d?setTimeout(function(){c.$off.removeClass("active"),c.$on.addClass("active");var a=e?c.$element.next():null;f?c.callByPath(f,[c.$element,a]):e&&(c.$element.next().fadeIn(300),setTimeout(function(){c.$element.next().fadeOut(500)},g))},300):(c.$result.removeAttr("checked"),c.$result.val(0),c.$result.trigger("change")),!1}),this.hashCode=function(a){var b=0;if(!a||0===a.length)return b;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);b=(b<<5)-b+d,b&=b}return b=b.toString(16),b=b.replace("-","")},this.executeEvents=function(a){(void 0!==window.__factory_checkbox_control_events_off_data||void 0!==window.__factory_checkbox_control_events_on_data)&&(a.change(function(){c.eventsProcess(a)}),c.eventsProcess(a))},this.eventsProcess=function(b){var d=b.attr("name"),e=b.prop("checked"),f=window.__factory_checkbox_control_events_on_data[d],g=window.__factory_checkbox_control_events_off_data[d];if(f||g){var h,i;void 0===window.__factory_checkbox_control_detach_elements&&(window.__factory_checkbox_control_detach_elements={}),h=window.__factory_checkbox_control_detach_elements,i=e?f:g;for(var j in i)if(i.hasOwnProperty(j)){var k,l=i[j];a.isArray(l)||(k=c.hashCode(d+l));var m;switch(j){case"hide":"string"==typeof l&&a(l).hide(0);break;case"show":"string"==typeof l&&a(l).fadeIn(200);break;case"detach":"string"==typeof l&&a(l).each(function(b){h[k]||(h[k]={}),h[k][b]||(h[k][b]={}),h[k][b].recovery_contanier=a(this).parent(),h[k][b].element=a(this).clone(!0),a(this).remove()});break;case"recovery":if(h[k]){for(var n in h[k])h[k].hasOwnProperty(n)&&h[k][n].recovery_contanier&&h[k][n].element&&h[k][n].recovery_contanier.append(h[k][n].element);delete h[k]}break;case"removeClasses":if("object"==typeof l)for(m in l)l.hasOwnProperty(m)&&l[m]&&a(m).removeClass(l[m]);break;case"addClasses":if("object"==typeof l)for(m in l)l.hasOwnProperty(m)&&l[m]&&a(m).addClass(l[m]);break;case"setValue":if("object"==typeof l)for(m in l)l.hasOwnProperty(m)&&void 0!==l[m]&&null!==l[m]&&(console.log(l[m]),a(m).val(l[m]))}}}},this.executeEvents(this.$result)};a.fn.
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
+
!function(a){var b=function(b){var c=this;this.$element=a(b),this.$result=this.$element.find(".factory-result"),this.$on=this.$element.find(".factory-on"),this.$off=this.$element.find(".factory-off");var d=this.$element.is(".factory-tumbler"),e=this.$element.is(".factory-has-tumbler-hint"),f=this.$element.data("tumbler-function"),g=this.$element.data("tumbler-delay");g||(g=3e3),this.callByPath=function(a,b){for(var c=a.split("."),d=window,e=0;e<c.length;e++)d=d[c[e]];d.apply(d,b)},this.$on.click(function(){return c.$off.removeClass("active"),c.$on.addClass("active"),d?setTimeout(function(){c.$on.removeClass("active"),c.$off.addClass("active");var a=e?c.$element.next():null;f?c.callByPath(f,[c.$element,a]):e&&(c.$element.next().fadeIn(300),setTimeout(function(){c.$element.next().fadeOut(500)},g))},300):(c.$result.attr("checked","checked"),c.$result.val(1),c.$result.trigger("change")),!1}),this.$off.click(function(){return c.$on.removeClass("active"),c.$off.addClass("active"),d?setTimeout(function(){c.$off.removeClass("active"),c.$on.addClass("active");var a=e?c.$element.next():null;f?c.callByPath(f,[c.$element,a]):e&&(c.$element.next().fadeIn(300),setTimeout(function(){c.$element.next().fadeOut(500)},g))},300):(c.$result.removeAttr("checked"),c.$result.val(0),c.$result.trigger("change")),!1}),this.hashCode=function(a){var b=0;if(!a||0===a.length)return b;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);b=(b<<5)-b+d,b&=b}return b=b.toString(16),b=b.replace("-","")},this.executeEvents=function(a){(void 0!==window.__factory_checkbox_control_events_off_data||void 0!==window.__factory_checkbox_control_events_on_data)&&(a.change(function(){c.eventsProcess(a)}),c.eventsProcess(a))},this.eventsProcess=function(b){var d=b.attr("name"),e=b.prop("checked"),f=window.__factory_checkbox_control_events_on_data[d],g=window.__factory_checkbox_control_events_off_data[d];if(f||g){var h,i;void 0===window.__factory_checkbox_control_detach_elements&&(window.__factory_checkbox_control_detach_elements={}),h=window.__factory_checkbox_control_detach_elements,i=e?f:g;for(var j in i)if(i.hasOwnProperty(j)){var k,l=i[j];a.isArray(l)||(k=c.hashCode(d+l));var m;switch(j){case"hide":"string"==typeof l&&a(l).hide(0);break;case"show":"string"==typeof l&&a(l).fadeIn(200);break;case"detach":"string"==typeof l&&a(l).each(function(b){h[k]||(h[k]={}),h[k][b]||(h[k][b]={}),h[k][b].recovery_contanier=a(this).parent(),h[k][b].element=a(this).clone(!0),a(this).remove()});break;case"recovery":if(h[k]){for(var n in h[k])h[k].hasOwnProperty(n)&&h[k][n].recovery_contanier&&h[k][n].element&&h[k][n].recovery_contanier.append(h[k][n].element);delete h[k]}break;case"removeClasses":if("object"==typeof l)for(m in l)l.hasOwnProperty(m)&&l[m]&&a(m).removeClass(l[m]);break;case"addClasses":if("object"==typeof l)for(m in l)l.hasOwnProperty(m)&&l[m]&&a(m).addClass(l[m]);break;case"setValue":if("object"==typeof l)for(m in l)l.hasOwnProperty(m)&&void 0!==l[m]&&null!==l[m]&&(console.log(l[m]),a(m).val(l[m]))}}}},this.executeEvents(this.$result)};a.fn.factoryBootstrap426_checkboxControl=function(c){if("string"==typeof c){var d=a(this).data("factory.checkbox.control");return d?d[c]():null}return this.each(function(){var c=a(this),d=c.data("factory.checkbox.control");d||c.data("factory.checkbox.control",d=new b(this))})},a.fn.factoryBootstrap426_checkboxControl.Constructor=b,a(function(){a(".factory-bootstrap-426 .factory-checkbox.factory-buttons-way").factoryBootstrap426_checkboxControl()})}(jQuery);
|
libs/factory/bootstrap/assets/js-min/control.dropdown.min.js
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
-
!function(a){var b=function(b){var c=this;if(this.$element=a(b),this.way=this.$element.data("way"),this.name=this.$element.data("name")||this.$element.attr("name"),this.hashCode=function(a){var b=0;if(!a||0===a.length)return b;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);b=(b<<5)-b+d,b&=b}return b=b.toString(16),b=b.replace("-","")},this.executeEvents=function(a){void 0!==window.factory_dropdown_control_events_data&&(a.change(function(){c.eventsProcess(a)}),c.eventsProcess(a))},this.eventsProcess=function(b){var d=b.attr("name"),e=b.val(),f=window.factory_dropdown_control_events_data[d];if(f&&f[e]){var g;void 0===window.__factory_dropdown_control_detach_elements&&(window.__factory_dropdown_control_detach_elements={}),g=window.__factory_dropdown_control_detach_elements;for(var h in f[e])if(f[e].hasOwnProperty(h)){var i,j=f[e][h];switch(a.isArray(j)||(i=c.hashCode(d+j)),h){case"hide":"string"==typeof j&&a(j).hide(0);break;case"show":"string"==typeof j&&a(j).fadeIn(200);break;case"detach":"string"==typeof j&&a(j).each(function(b){g[i]||(g[i]={}),g[i][b]||(g[i][b]={}),g[i][b].recovery_contanier=a(this).parent(),g[i][b].element=a(this).clone(!0),a(this).remove()});break;case"recovery":if(g[i]){for(var k in g[i])g[i].hasOwnProperty(k)&&g[i][k].recovery_contanier&&g[i][k].element&&g[i][k].recovery_contanier.append(g[i][k].element);delete g[i]}break;case"removeClasses":if("object"==typeof j)for(var l in j)j.hasOwnProperty(l)&&j[l]&&a(l).removeClass(j[l]);break;case"addClasses":if("object"==typeof j)for(var l in j)j.hasOwnProperty(l)&&j[l]&&a(l).addClass(j[l])}}}},"buttons"===this.way)this.$result=this.$element.find(".factory-result"),this.$hints=this.$element.find(".factory-hints"),this.$buttons=this.$element.find(".btn"),c.executeEvents(this.$result),this.$buttons.click(function(){var b=a(this).data("value");return c.$buttons.removeClass("active"),a(this).addClass("active"),c.$hints.find(".factory-hint").hide(),c.$hints.find(".factory-hint-"+b).fadeIn(),c.$result.val(b),c.$result.trigger("change"),!1});else if("ddslick"===this.way){c.executeEvents(c.$element.find(".factory-result"));var d=window["factory_"+this.name+"_data"],e=this.$element.find(".factory-ddslick"),f=this.$element.data("width")||300,g=this.$element.data("align")||"right";a(d).each(function(){return this.imageHoverSrc?void(a("<img/>")[0].src=this.imageHoverSrc):!0}),e.ddslick({data:d,width:f,imagePosition:g,selectText:"- select -",onSelected:function(a){a.selectedData.imageHoverSrc&&c.$element.find(".dd-selected-image").attr("src",a.selectedData.imageHoverSrc);var b=c.$element.find(".factory-result").val(a.selectedData.value);b.change()}})}else{c.executeEvents(this.$element),this.$hints=this.$element.next(),this.$hints.hasClass("factory-hints")&&(this.$element.change(function(){return c.updateHints(),!1}),this.updateHints=function(){var a=c.$element.val();c.$hints.find(".factory-hint").hide(),c.$hints.find(".factory-hint-"+a).show()},c.updateHints()),this.getAjaxData=function(){var a=c.$element.data("ajax-data-id");return window[a]},this.loadData=function(){var b=c.getAjaxData();a.ajax({url:b.url,data:b.data,dataType:"json",success:function(a){return a.error?c.showError(a.error):void c.fill(a.items)},error:function(a){console&&console.log&&console.log(a.responseText),c.showError("Unexpected error occurred during the ajax request.")},complete:function(){c.removeLoader()}})},this.fill=function(a){this.clearList();var b=c.getAjaxData();if(a&&a.length)for(var d in a){var e=a[d];c.addListItem(e)}else this.$element.append("<option>"+b.emptyList+"</li>");this.$element.trigger("factory-loaded")},this.clearList=function(){this.$element.html("")},this.addListItem=function(b){var d=a("<option />").attr("value",b.value).text(b.title).appendTo(this.$element),e=c.getAjaxData();e.selected&&e.selected==b.value&&d.attr("selected","selected")},this.showError=function(b){this.clearList();var d=a("<div class='factory-control-error'></div>").append(a("<i class='fa fa-exclamation-triangle'></i>")).append(b),e=c.getAjaxData();this.$element.append("<option>"+e.emptyList+"</li>"),this.$element.after(d),this.$element.addClass("factory-has-error")},this.removeLoader=function(){this.$element.removeClass("factory-hidden");var b=c.getAjaxData();a(b.loader).remove()};var h=this.$element.data("ajax");h&&this.loadData()}};a.fn.
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
+
!function(a){var b=function(b){var c=this;if(this.$element=a(b),this.way=this.$element.data("way"),this.name=this.$element.data("name")||this.$element.attr("name"),this.hashCode=function(a){var b=0;if(!a||0===a.length)return b;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);b=(b<<5)-b+d,b&=b}return b=b.toString(16),b=b.replace("-","")},this.executeEvents=function(a){void 0!==window.factory_dropdown_control_events_data&&(a.change(function(){c.eventsProcess(a)}),c.eventsProcess(a))},this.eventsProcess=function(b){var d=b.attr("name"),e=b.val(),f=window.factory_dropdown_control_events_data[d];if(f&&f[e]){var g;void 0===window.__factory_dropdown_control_detach_elements&&(window.__factory_dropdown_control_detach_elements={}),g=window.__factory_dropdown_control_detach_elements;for(var h in f[e])if(f[e].hasOwnProperty(h)){var i,j=f[e][h];switch(a.isArray(j)||(i=c.hashCode(d+j)),h){case"hide":"string"==typeof j&&a(j).hide(0);break;case"show":"string"==typeof j&&a(j).fadeIn(200);break;case"detach":"string"==typeof j&&a(j).each(function(b){g[i]||(g[i]={}),g[i][b]||(g[i][b]={}),g[i][b].recovery_contanier=a(this).parent(),g[i][b].element=a(this).clone(!0),a(this).remove()});break;case"recovery":if(g[i]){for(var k in g[i])g[i].hasOwnProperty(k)&&g[i][k].recovery_contanier&&g[i][k].element&&g[i][k].recovery_contanier.append(g[i][k].element);delete g[i]}break;case"removeClasses":if("object"==typeof j)for(var l in j)j.hasOwnProperty(l)&&j[l]&&a(l).removeClass(j[l]);break;case"addClasses":if("object"==typeof j)for(var l in j)j.hasOwnProperty(l)&&j[l]&&a(l).addClass(j[l])}}}},"buttons"===this.way)this.$result=this.$element.find(".factory-result"),this.$hints=this.$element.find(".factory-hints"),this.$buttons=this.$element.find(".btn"),c.executeEvents(this.$result),this.$buttons.click(function(){var b=a(this).data("value");return c.$buttons.removeClass("active"),a(this).addClass("active"),c.$hints.find(".factory-hint").hide(),c.$hints.find(".factory-hint-"+b).fadeIn(),c.$result.val(b),c.$result.trigger("change"),!1});else if("ddslick"===this.way){c.executeEvents(c.$element.find(".factory-result"));var d=window["factory_"+this.name+"_data"],e=this.$element.find(".factory-ddslick"),f=this.$element.data("width")||300,g=this.$element.data("align")||"right";a(d).each(function(){return this.imageHoverSrc?void(a("<img/>")[0].src=this.imageHoverSrc):!0}),e.ddslick({data:d,width:f,imagePosition:g,selectText:"- select -",onSelected:function(a){a.selectedData.imageHoverSrc&&c.$element.find(".dd-selected-image").attr("src",a.selectedData.imageHoverSrc);var b=c.$element.find(".factory-result").val(a.selectedData.value);b.change()}})}else{c.executeEvents(this.$element),this.$hints=this.$element.next(),this.$hints.hasClass("factory-hints")&&(this.$element.change(function(){return c.updateHints(),!1}),this.updateHints=function(){var a=c.$element.val();c.$hints.find(".factory-hint").hide(),c.$hints.find(".factory-hint-"+a).show()},c.updateHints()),this.getAjaxData=function(){var a=c.$element.data("ajax-data-id");return window[a]},this.loadData=function(){var b=c.getAjaxData();a.ajax({url:b.url,data:b.data,dataType:"json",success:function(a){return a.error?c.showError(a.error):void c.fill(a.items)},error:function(a){console&&console.log&&console.log(a.responseText),c.showError("Unexpected error occurred during the ajax request.")},complete:function(){c.removeLoader()}})},this.fill=function(a){this.clearList();var b=c.getAjaxData();if(a&&a.length)for(var d in a){var e=a[d];c.addListItem(e)}else this.$element.append("<option>"+b.emptyList+"</li>");this.$element.trigger("factory-loaded")},this.clearList=function(){this.$element.html("")},this.addListItem=function(b){var d=a("<option />").attr("value",b.value).text(b.title).appendTo(this.$element),e=c.getAjaxData();e.selected&&e.selected==b.value&&d.attr("selected","selected")},this.showError=function(b){this.clearList();var d=a("<div class='factory-control-error'></div>").append(a("<i class='fa fa-exclamation-triangle'></i>")).append(b),e=c.getAjaxData();this.$element.append("<option>"+e.emptyList+"</li>"),this.$element.after(d),this.$element.addClass("factory-has-error")},this.removeLoader=function(){this.$element.removeClass("factory-hidden");var b=c.getAjaxData();a(b.loader).remove()};var h=this.$element.data("ajax");h&&this.loadData()}};a.fn.factoryBootstrap426_dropdownControl=function(c){if("string"==typeof c){var d=a(this).data("factory.dropdown.control");return d?d[c]():null}return this.each(function(){var c=a(this),d=c.data("factory.dropdown.control");d||c.data("factory.dropdown.control",d=new b(this))})},a.fn.factoryBootstrap426_dropdownControl.Constructor=b,a(function(){a(".factory-bootstrap-426 .factory-dropdown").factoryBootstrap426_dropdownControl()})}(jQuery);
|
libs/factory/bootstrap/assets/js-min/control.list.min.js
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
-
!function(a){var b=function(b){var c=this;if(this.$element=a(b),this.way=this.$element.data("way"),this.name=this.$element.data("name"),"checklist"===this.way){this.getAjaxData=function(){var a=c.$element.data("ajax-data-id");return window[a]},this.loadData=function(){var b=c.getAjaxData();a.ajax({url:b.url,data:b.data,dataType:"json",success:function(a){return a.error?c.showError(a.error):void c.fill(a.items)},error:function(){c.showError("Unexpected error occurred during the ajax request.")},complete:function(){c.removeLoader()}})},this.fill=function(a){this.clearList();var b=c.getAjaxData();if(a&&a.length){this.$element.removeClass("factory-empty");for(var d in a){var e=a[d];c.addListItem(e)}}else this.$element.addClass("factory-empty"),this.$element.append("<li>"+b.emptyList+"</li>")},this.clearList=function(){this.$element.html("")},this.addListItem=function(b){var d=a("<li>"),e=a("<label>").attr("for","factory-checklist-"+c.name+"-"+b.value).appendTo(d),f=a("<span>").appendTo(e),g=a("<input />").attr("type","checkbox").attr("name",c.name+"[]").val(b.value).attr("id","factory-checklist-"+c.name+"-"+b.value).appendTo(f),h=(a("<span>"+b.title+"</span>").appendTo(e),c.getAjaxData());h.selected.length&&a.inArray(b.value,h.selected)>=0&&g.attr("checked","checked"),this.$element.append(d)},this.showError=function(b){this.$element.html("").append(a("<i class='fa fa-exclamation-triangle'></i>")).append(b),this.$element.addClass("factory-list-error")},this.removeLoader=function(){this.$element.removeClass("factory-hidden");var b=c.getAjaxData();a(b.loader).remove()};var d=this.$element.data("ajax");d&&this.loadData()}};a.fn.
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
+
!function(a){var b=function(b){var c=this;if(this.$element=a(b),this.way=this.$element.data("way"),this.name=this.$element.data("name"),"checklist"===this.way){this.getAjaxData=function(){var a=c.$element.data("ajax-data-id");return window[a]},this.loadData=function(){var b=c.getAjaxData();a.ajax({url:b.url,data:b.data,dataType:"json",success:function(a){return a.error?c.showError(a.error):void c.fill(a.items)},error:function(){c.showError("Unexpected error occurred during the ajax request.")},complete:function(){c.removeLoader()}})},this.fill=function(a){this.clearList();var b=c.getAjaxData();if(a&&a.length){this.$element.removeClass("factory-empty");for(var d in a){var e=a[d];c.addListItem(e)}}else this.$element.addClass("factory-empty"),this.$element.append("<li>"+b.emptyList+"</li>")},this.clearList=function(){this.$element.html("")},this.addListItem=function(b){var d=a("<li>"),e=a("<label>").attr("for","factory-checklist-"+c.name+"-"+b.value).appendTo(d),f=a("<span>").appendTo(e),g=a("<input />").attr("type","checkbox").attr("name",c.name+"[]").val(b.value).attr("id","factory-checklist-"+c.name+"-"+b.value).appendTo(f),h=(a("<span>"+b.title+"</span>").appendTo(e),c.getAjaxData());h.selected.length&&a.inArray(b.value,h.selected)>=0&&g.attr("checked","checked"),this.$element.append(d)},this.showError=function(b){this.$element.html("").append(a("<i class='fa fa-exclamation-triangle'></i>")).append(b),this.$element.addClass("factory-list-error")},this.removeLoader=function(){this.$element.removeClass("factory-hidden");var b=c.getAjaxData();a(b.loader).remove()};var d=this.$element.data("ajax");d&&this.loadData()}};a.fn.factoryBootstrap426_listControl=function(c){if("string"==typeof c){var d=a(this).data("factory.list.control");return d?d[c]():null}return this.each(function(){var c=a(this),d=c.data("factory.list.control");d||c.data("factory.list.control",d=new b(this))})},a.fn.factoryBootstrap426_listControl.Constructor=b,a(function(){a(".factory-bootstrap-426 .factory-list").factoryBootstrap426_listControl()})}(jQuery);
|
libs/factory/bootstrap/assets/js-min/control.multiple-textbox.min.js
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
-
!function(a){"use strict";var b=function(b){this.$element=a(b);var c=a(".factory-mtextbox-item",this.$element).eq(0).clone(!0);a(".factory-mtextbox-add-item",this.$element).on("click",function(){var b=a(this).closest(".factory-multiple-textbox-group").find(".factory-mtextbox-items"),d=c.clone(!0),e=a('<button class="btn btn-default btn-small factory-mtextbox-remove-item"><i class="fa fa-times" aria-hidden="true"></i></button>');return b.append(d.append(e)),d.find('input[type="text"]').val("").focus(),!1}),a(document).on("click",".factory-mtextbox-remove-item",function(){return a(this).closest(".factory-mtextbox-item").remove(),!1})};a.fn.
|
7 |
* Support: http://webcraftic.com/contact-us/
|
8 |
*/
|
9 |
|
10 |
+
!function(a){"use strict";var b=function(b){this.$element=a(b);var c=a(".factory-mtextbox-item",this.$element).eq(0).clone(!0);a(".factory-mtextbox-add-item",this.$element).on("click",function(){var b=a(this).closest(".factory-multiple-textbox-group").find(".factory-mtextbox-items"),d=c.clone(!0),e=a('<button class="btn btn-default btn-small factory-mtextbox-remove-item"><i class="fa fa-times" aria-hidden="true"></i></button>');return b.append(d.append(e)),d.find('input[type="text"]').val("").focus(),!1}),a(document).on("click",".factory-mtextbox-remove-item",function(){return a(this).closest(".factory-mtextbox-item").remove(),!1})};a.fn.factoryBootstrap426_MultipleTextboxControl=function(){return this.each(function(){new b(this)})},a(function(){a(".factory-bootstrap-426 .factory-multiple-textbox-group").factoryBootstrap426_MultipleTextboxControl()})}(jQuery);
|
libs/factory/bootstrap/assets/js-min/index.php
DELETED
File without changes
|
libs/factory/bootstrap/boot.php
CHANGED
@@ -1,37 +1,46 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Factory Bootstrap
|
4 |
+
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
6 |
+
* @since 1.0.0
|
7 |
+
* @package factory-bootstrap
|
8 |
+
* @copyright (c) 2018, Webcraftic Ltd
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
// module provides function only for the admin area
|
18 |
+
if ( ! is_admin() ) {
|
19 |
+
return;
|
20 |
+
}
|
21 |
+
|
22 |
+
if ( defined( 'FACTORY_BOOTSTRAP_426_LOADED' ) ) {
|
23 |
+
return;
|
24 |
+
}
|
25 |
+
|
26 |
+
define( 'FACTORY_BOOTSTRAP_426_VERSION', '4.2.6' );
|
27 |
+
define( 'FACTORY_BOOTSTRAP_426_LOADED', true );
|
28 |
+
|
29 |
+
if ( ! defined( 'FACTORY_FLAT_ADMIN' ) ) {
|
30 |
+
define( 'FACTORY_FLAT_ADMIN', true );
|
31 |
+
}
|
32 |
+
|
33 |
+
define( 'FACTORY_BOOTSTRAP_426_DIR', dirname( __FILE__ ) );
|
34 |
+
define( 'FACTORY_BOOTSTRAP_426_URL', plugins_url( null, __FILE__ ) );
|
35 |
+
|
36 |
+
require_once( FACTORY_BOOTSTRAP_426_DIR . '/includes/functions.php' );
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
40 |
+
*/
|
41 |
+
add_action( 'wbcr_factory_bootstrap_426_plugin_created', function ( $plugin ) {
|
42 |
+
$manager = new Wbcr_FactoryBootstrap426_Manager( $plugin );
|
43 |
+
$plugin->setBootstap( $manager );
|
44 |
+
} );
|
45 |
+
|
46 |
+
|
libs/factory/bootstrap/includes/functions.php
CHANGED
@@ -10,285 +10,227 @@
|
|
10 |
*
|
11 |
*/
|
12 |
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
/**
|
16 |
-
*
|
|
|
|
|
17 |
*/
|
18 |
-
|
19 |
-
$manager = new Wbcr_FactoryBootstrap414_Manager( $plugin );
|
20 |
-
$plugin->setBootstap( $manager );
|
21 |
-
}
|
22 |
-
|
23 |
-
if ( ! class_exists( 'Wbcr_FactoryBootstrap414_Manager' ) ) {
|
24 |
|
25 |
/**
|
26 |
-
*
|
27 |
*
|
28 |
* @since 3.2.0
|
|
|
29 |
*/
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* A plugin for which the manager was created.
|
34 |
-
*
|
35 |
-
* @since 3.2.0
|
36 |
-
* @var Wbcr_Factory414_Plugin
|
37 |
-
*/
|
38 |
-
public $plugin;
|
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 |
-
} else {
|
83 |
-
if ( ! in_array( $scripts, $this->scripts ) ) {
|
84 |
-
$this->scripts[] = $scripts;
|
85 |
}
|
86 |
}
|
|
|
|
|
|
|
|
|
87 |
}
|
|
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
}
|
103 |
-
}
|
104 |
-
} else {
|
105 |
-
if ( ! in_array( $styles, $this->styles ) ) {
|
106 |
-
$this->styles[] = $styles;
|
107 |
}
|
108 |
}
|
|
|
|
|
|
|
|
|
109 |
}
|
|
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
do_action( 'wbcr_factory_414_bootstrap_enqueue_scripts', $hook );
|
122 |
-
do_action( 'wbcr_factory_414_bootstrap_enqueue_scripts_' . $this->plugin->getPluginName(), $hook );
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
$dependencies[] = 'jquery';
|
127 |
-
$dependencies[] = 'jquery-ui-core';
|
128 |
-
$dependencies[] = 'jquery-ui-widget';
|
129 |
-
}
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
break;
|
138 |
-
}
|
139 |
-
}
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
146 |
}
|
|
|
147 |
|
148 |
-
|
149 |
-
$
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
} else if ( $color_name == 'coffee' ) {
|
164 |
-
$primary_dark = '#b78a66';
|
165 |
-
$primary_light = '#c7a589';
|
166 |
-
} else if ( $color_name == 'ectoplasm' ) {
|
167 |
-
$primary_dark = '#839237';
|
168 |
-
$primary_light = '#a3b745';
|
169 |
-
} else if ( $color_name == 'ocean' ) {
|
170 |
-
$primary_dark = '#80a583';
|
171 |
-
$primary_light = '#9ebaa0';
|
172 |
-
} else if ( $color_name == 'midnight' ) {
|
173 |
-
$primary_dark = '#d02a21';
|
174 |
-
$primary_light = '#e14d43';
|
175 |
-
} else if ( $color_name == 'sunrise' ) {
|
176 |
-
$primary_dark = '#c36822';
|
177 |
-
$primary_light = '#dd823b';
|
178 |
-
} else {
|
179 |
-
$primary_dark = '#0074a2';
|
180 |
-
$primary_light = '#2ea2cc';
|
181 |
-
}
|
182 |
|
183 |
-
|
184 |
-
<script>
|
185 |
-
if( !window.factory ) {
|
186 |
-
window.factory = {};
|
187 |
-
}
|
188 |
-
if( !window.factory.factoryBootstrap414 ) {
|
189 |
-
window.factory.factoryBootstrap414 = {};
|
190 |
-
}
|
191 |
-
window.factory.factoryBootstrap414.colors = {
|
192 |
-
primaryDark: '<?php echo $primary_dark ?>',
|
193 |
-
primaryLight: '<?php echo $primary_light ?>'
|
194 |
-
};
|
195 |
-
</script>
|
196 |
-
<?php
|
197 |
-
}
|
198 |
|
199 |
/**
|
200 |
-
*
|
201 |
-
*
|
202 |
-
* @
|
203 |
*/
|
204 |
-
|
205 |
-
|
206 |
-
$is_first = true;
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
* @since 4.1.0
|
212 |
-
*/
|
213 |
-
$cache_enable = apply_filters( 'wbcr/factory/bootstrap/cache_enable', true );
|
214 |
|
215 |
-
|
216 |
-
|
217 |
-
$cache_dir_url = FACTORY_BOOTSTRAP_414_URL . '/assets/cache/';
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
227 |
}
|
228 |
} else {
|
229 |
-
$
|
230 |
-
|
231 |
-
if ( @mkdir( $cache_dir_path, 0755 ) && wp_is_writable( $cache_dir_path ) ) {
|
232 |
-
$cache_dir_exists = true;
|
233 |
-
}
|
234 |
-
} else {
|
235 |
-
if ( wp_is_writable( $cache_dir_path ) ) {
|
236 |
-
$cache_dir_exists = true;
|
237 |
-
}
|
238 |
}
|
|
|
239 |
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
250 |
} else {
|
251 |
-
|
252 |
-
wp_enqueue_script( md5( $script_to_load ), FACTORY_BOOTSTRAP_414_URL . "/assets/$type-min/$script_to_load.min." . $type, $is_first ? $dependencies : false, $this->plugin->getPluginVersion() );
|
253 |
-
} else {
|
254 |
-
wp_enqueue_style( md5( $script_to_load ), FACTORY_BOOTSTRAP_414_URL . "/assets/$type-min/$script_to_load.min." . $type, [], $this->plugin->getPluginVersion() );
|
255 |
-
}
|
256 |
-
$is_first = false;
|
257 |
}
|
|
|
258 |
}
|
|
|
259 |
|
260 |
-
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
}
|
274 |
}
|
275 |
}
|
276 |
}
|
277 |
}
|
|
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
|
291 |
-
|
292 |
-
}
|
293 |
}
|
294 |
-
}
|
10 |
*
|
11 |
*/
|
12 |
|
13 |
+
// Exit if accessed directly
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
15 |
+
exit;
|
16 |
+
}
|
17 |
|
18 |
/**
|
19 |
+
* The Bootstrap Manager class.
|
20 |
+
*
|
21 |
+
* @since 3.2.0
|
22 |
*/
|
23 |
+
class Wbcr_FactoryBootstrap426_Manager {
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
/**
|
26 |
+
* A plugin for which the manager was created.
|
27 |
*
|
28 |
* @since 3.2.0
|
29 |
+
* @var Wbcr_Factory425_Plugin
|
30 |
*/
|
31 |
+
public $plugin;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
/**
|
34 |
+
* Contains scripts to include.
|
35 |
+
*
|
36 |
+
* @since 3.2.0
|
37 |
+
* @var string[]
|
38 |
+
*/
|
39 |
+
public $scripts = [];
|
40 |
|
41 |
+
/**
|
42 |
+
* Contains styles to include.
|
43 |
+
*
|
44 |
+
* @since 3.2.0
|
45 |
+
* @var string[]
|
46 |
+
*/
|
47 |
+
public $styles = [];
|
48 |
|
49 |
+
/**
|
50 |
+
* Createas a new instance of the license api for a given plugin.
|
51 |
+
*
|
52 |
+
* @since 1.0.0
|
53 |
+
*/
|
54 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
55 |
+
$this->plugin = $plugin;
|
56 |
|
57 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'loadAssets' ] );
|
58 |
+
add_filter( 'admin_body_class', [ $this, 'adminBodyClass' ] );
|
59 |
+
}
|
60 |
|
61 |
+
/**
|
62 |
+
* Includes the Bootstrap scripts.
|
63 |
+
*
|
64 |
+
* @since 3.2.0
|
65 |
+
*
|
66 |
+
* @param array|string $scripts
|
67 |
+
*/
|
68 |
+
public function enqueueScript( $scripts ) {
|
69 |
+
if ( is_array( $scripts ) ) {
|
70 |
+
foreach ( $scripts as $script ) {
|
71 |
+
if ( ! in_array( $script, $this->scripts ) ) {
|
72 |
+
$this->scripts[] = $script;
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
}
|
75 |
+
} else {
|
76 |
+
if ( ! in_array( $scripts, $this->scripts ) ) {
|
77 |
+
$this->scripts[] = $scripts;
|
78 |
+
}
|
79 |
}
|
80 |
+
}
|
81 |
|
82 |
+
/**
|
83 |
+
* * Includes the Bootstrap styles.
|
84 |
+
*
|
85 |
+
* @since 3.2.0
|
86 |
+
*
|
87 |
+
* @param array|string $styles
|
88 |
+
*/
|
89 |
+
public function enqueueStyle( $styles ) {
|
90 |
|
91 |
+
if ( is_array( $styles ) ) {
|
92 |
+
foreach ( $styles as $style ) {
|
93 |
+
if ( ! in_array( $style, $this->styles ) ) {
|
94 |
+
$this->styles[] = $style;
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
}
|
97 |
+
} else {
|
98 |
+
if ( ! in_array( $styles, $this->styles ) ) {
|
99 |
+
$this->styles[] = $styles;
|
100 |
+
}
|
101 |
}
|
102 |
+
}
|
103 |
|
104 |
+
/**
|
105 |
+
* Loads Bootstrap assets.
|
106 |
+
*
|
107 |
+
* @since 3.2.0
|
108 |
+
* @return void
|
109 |
+
* @see admin_enqueue_scripts
|
110 |
+
*
|
111 |
+
*/
|
112 |
+
public function loadAssets( $hook ) {
|
|
|
|
|
|
|
113 |
|
114 |
+
do_action( 'wbcr_factory_425_bootstrap_enqueue_scripts', $hook );
|
115 |
+
do_action( 'wbcr_factory_425_bootstrap_enqueue_scripts_' . $this->plugin->getPluginName(), $hook );
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
$dependencies = [];
|
118 |
+
if ( ! empty( $this->scripts ) ) {
|
119 |
+
$dependencies[] = 'jquery';
|
120 |
+
$dependencies[] = 'jquery-ui-core';
|
121 |
+
$dependencies[] = 'jquery-ui-widget';
|
122 |
+
}
|
|
|
|
|
|
|
123 |
|
124 |
+
foreach ( $this->scripts as $script ) {
|
125 |
+
switch ( $script ) {
|
126 |
+
case 'plugin.iris':
|
127 |
+
$dependencies[] = 'jquery-ui-widget';
|
128 |
+
$dependencies[] = 'jquery-ui-slider';
|
129 |
+
$dependencies[] = 'jquery-ui-draggable';
|
130 |
+
break;
|
131 |
}
|
132 |
+
}
|
133 |
|
134 |
+
if ( ! empty( $this->scripts ) ) {
|
135 |
+
$this->enqueueScripts( $this->scripts, 'js', $dependencies );
|
136 |
+
}
|
137 |
+
if ( ! empty( $this->styles ) ) {
|
138 |
+
$this->enqueueScripts( $this->styles, 'css', $dependencies );
|
139 |
+
}
|
140 |
+
}
|
|
|
141 |
|
142 |
+
/**
|
143 |
+
* @param array $scripts
|
144 |
+
* @param string $type
|
145 |
+
* @param array $dependencies
|
146 |
+
*/
|
147 |
+
protected function enqueueScripts( array $scripts, $type, array $dependencies ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
+
$is_first = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
/**
|
152 |
+
* Sets permission for file caching and combining into one file.
|
153 |
+
*
|
154 |
+
* @since 4.1.0
|
155 |
*/
|
156 |
+
$cache_enable = apply_filters( 'wbcr/factory/bootstrap/cache_enable', true );
|
|
|
|
|
157 |
|
158 |
+
$cache_id = md5( implode( ',', $this->scripts ) . $type . $this->plugin->getPluginVersion() );
|
159 |
+
$cache_dir_path = FACTORY_BOOTSTRAP_426_DIR . '/assets/cache/';
|
160 |
+
$cache_dir_url = FACTORY_BOOTSTRAP_426_URL . '/assets/cache/';
|
|
|
|
|
|
|
161 |
|
162 |
+
$cache_filepath = $cache_dir_path . $cache_id . ".min." . $type;
|
163 |
+
$cache_fileurl = $cache_dir_url . $cache_id . ".min." . $type;
|
|
|
164 |
|
165 |
+
if ( $cache_enable && file_exists( $cache_filepath ) ) {
|
166 |
+
if ( $type == 'js' ) {
|
167 |
+
wp_enqueue_script( 'wbcr-factory-bootstrap-' . $cache_id, $cache_fileurl, $dependencies, $this->plugin->getPluginVersion() );
|
168 |
+
} else {
|
169 |
+
wp_enqueue_style( 'wbcr-factory-bootstrap-' . $cache_id, $cache_fileurl, [], $this->plugin->getPluginVersion() );
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
$cache_dir_exists = false;
|
173 |
+
if ( ! file_exists( $cache_dir_path ) ) {
|
174 |
+
if ( @mkdir( $cache_dir_path, 0755 ) && wp_is_writable( $cache_dir_path ) ) {
|
175 |
+
$cache_dir_exists = true;
|
176 |
}
|
177 |
} else {
|
178 |
+
if ( wp_is_writable( $cache_dir_path ) ) {
|
179 |
+
$cache_dir_exists = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
+
}
|
182 |
|
183 |
+
$concat_files = [];
|
184 |
+
foreach ( $scripts as $script_to_load ) {
|
185 |
+
$script_to_load = sanitize_text_field( $script_to_load );
|
186 |
+
if ( $cache_enable && $cache_dir_exists ) {
|
187 |
+
$fname = FACTORY_BOOTSTRAP_426_DIR . "/assets/$type-min/$script_to_load.min." . $type;
|
188 |
+
if ( file_exists( $fname ) ) {
|
189 |
+
$f = @fopen( $fname, 'r' );
|
190 |
+
$concat_files[] = @fread( $f, filesize( $fname ) );
|
191 |
+
@fclose( $f );
|
192 |
+
}
|
193 |
+
} else {
|
194 |
+
if ( $type == 'js' ) {
|
195 |
+
wp_enqueue_script( md5( $script_to_load ), FACTORY_BOOTSTRAP_426_URL . "/assets/$type-min/$script_to_load.min." . $type, $is_first ? $dependencies : false, $this->plugin->getPluginVersion() );
|
196 |
} else {
|
197 |
+
wp_enqueue_style( md5( $script_to_load ), FACTORY_BOOTSTRAP_426_URL . "/assets/$type-min/$script_to_load.min." . $type, [], $this->plugin->getPluginVersion() );
|
|
|
|
|
|
|
|
|
|
|
198 |
}
|
199 |
+
$is_first = false;
|
200 |
}
|
201 |
+
}
|
202 |
|
203 |
+
if ( $cache_enable && $cache_dir_exists && ! empty( $concat_files ) ) {
|
204 |
|
205 |
+
$cf = @fopen( $cache_filepath, 'w' );
|
206 |
+
$write_content = implode( PHP_EOL, $concat_files );
|
207 |
+
@fwrite( $cf, $write_content );
|
208 |
+
@fclose( $cf );
|
209 |
+
chmod( $cache_filepath, 0755 );
|
210 |
|
211 |
+
if ( file_exists( $cache_filepath ) ) {
|
212 |
+
if ( $type == 'js' ) {
|
213 |
+
wp_enqueue_script( 'wbcr-factory-bootstrap-' . $cache_id, $cache_fileurl, $dependencies, $this->plugin->getPluginVersion() );
|
214 |
+
} else {
|
215 |
+
wp_enqueue_style( 'wbcr-factory-bootstrap-' . $cache_id, $cache_fileurl, [], $this->plugin->getPluginVersion() );
|
|
|
216 |
}
|
217 |
}
|
218 |
}
|
219 |
}
|
220 |
+
}
|
221 |
|
222 |
+
/**
|
223 |
+
* Adds the body classes: 'factory-flat or 'factory-volumetric'.
|
224 |
+
*
|
225 |
+
* @since 3.2.0
|
226 |
+
*
|
227 |
+
* @param string $classes
|
228 |
+
*
|
229 |
+
* @return string
|
230 |
+
*/
|
231 |
+
public function adminBodyClass( $classes ) {
|
232 |
+
$classes .= FACTORY_FLAT_ADMIN ? ' factory-flat ' : ' factory-volumetric ';
|
233 |
|
234 |
+
return $classes;
|
|
|
235 |
}
|
236 |
+
}
|
libs/factory/bootstrap/includes/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/bootstrap/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/clearfy/assets/css/clearfy-base.css
CHANGED
@@ -5,18 +5,18 @@
|
|
5 |
* @copyright Webcraftic 06.10.2018
|
6 |
* @sicne 2.0.5
|
7 |
*/
|
8 |
-
#WBCR .wbcr-factory-pages-
|
9 |
padding: 30px 80px;
|
10 |
}
|
11 |
-
#WBCR .wbcr-factory-pages-
|
12 |
margin: 0 0 20px;
|
13 |
}
|
14 |
-
#WBCR .wbcr-factory-pages-
|
15 |
border: 2px dashed #8bc34a;
|
16 |
background: #fff;
|
17 |
padding: 20px;
|
18 |
}
|
19 |
-
#WBCR .wbcr-factory-pages-
|
20 |
display: inline-block;
|
21 |
cursor: pointer;
|
22 |
line-height: 16px;
|
@@ -35,16 +35,16 @@
|
|
35 |
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
36 |
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
37 |
}
|
38 |
-
#WBCR .wbcr-factory-pages-
|
39 |
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
40 |
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
41 |
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
42 |
}
|
43 |
-
#WBCR .wbcr-factory-pages-
|
44 |
outline: none;
|
45 |
border: 0;
|
46 |
}
|
47 |
-
#WBCR .wbcr-factory-pages-
|
48 |
display: inline-block;
|
49 |
cursor: pointer;
|
50 |
line-height: 16px;
|
@@ -63,22 +63,22 @@
|
|
63 |
-moz-box-shadow: 0 1px 0 rgba(60, 45, 2, 0.31);
|
64 |
-webkit-box-shadow: 0 1px 0 rgba(60, 45, 2, 0.31);
|
65 |
}
|
66 |
-
#WBCR .wbcr-factory-pages-
|
67 |
box-shadow: inset 0 1px 0 rgba(60, 45, 2, 0.31);
|
68 |
-moz-box-shadow: inset 0 1px 0 rgba(60, 45, 2, 0.31);
|
69 |
-webkit-box-shadow: inset 0 1px 0 rgba(60, 45, 2, 0.31);
|
70 |
}
|
71 |
-
#WBCR .wbcr-factory-pages-
|
72 |
outline: none;
|
73 |
border: 0;
|
74 |
}
|
75 |
-
#WBCR .wbcr-factory-pages-
|
76 |
background: #fff;
|
77 |
color: #353535;
|
78 |
font-weight: 600;
|
79 |
border: 2px dashed #8bc34a;
|
80 |
}
|
81 |
-
#WBCR .wbcr-factory-pages-
|
82 |
margin: 0 0 20px;
|
83 |
padding: 10px 0;
|
84 |
text-align: center;
|
@@ -89,16 +89,16 @@
|
|
89 |
vertical-align: middle;
|
90 |
text-transform: uppercase;
|
91 |
}
|
92 |
-
#WBCR .wbcr-factory-pages-
|
93 |
position: relative;
|
94 |
margin-bottom: 20px;
|
95 |
}
|
96 |
-
#WBCR .wbcr-factory-pages-
|
97 |
font-size: 15px;
|
98 |
padding: 7px;
|
99 |
padding-left: 20px;
|
100 |
}
|
101 |
-
#WBCR .wbcr-factory-pages-
|
102 |
content: " ";
|
103 |
display: inline-block;
|
104 |
width: 0.4em;
|
@@ -112,7 +112,7 @@
|
|
112 |
-o-transform: rotate(45deg);
|
113 |
transform: rotate(45deg);
|
114 |
}
|
115 |
-
#WBCR .wbcr-factory-pages-
|
116 |
display: block;
|
117 |
cursor: pointer;
|
118 |
line-height: 16px;
|
@@ -131,44 +131,44 @@
|
|
131 |
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
132 |
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
133 |
}
|
134 |
-
#WBCR .wbcr-factory-pages-
|
135 |
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
136 |
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
137 |
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
138 |
}
|
139 |
-
#WBCR .wbcr-factory-pages-
|
140 |
outline: none;
|
141 |
border: 0;
|
142 |
}
|
143 |
@media screen and (max-width: 1550px) {
|
144 |
-
#WBCR .wbcr-factory-pages-
|
145 |
padding: 10px 80px;
|
146 |
}
|
147 |
-
#WBCR .wbcr-factory-pages-
|
148 |
padding: 10px;
|
149 |
}
|
150 |
-
#WBCR .wbcr-factory-pages-
|
151 |
margin: 0 0 20px;
|
152 |
padding: 10px 0;
|
153 |
font-size: 13px;
|
154 |
font-weight: 600;
|
155 |
}
|
156 |
-
#WBCR .wbcr-factory-pages-
|
157 |
margin-bottom: 20px;
|
158 |
}
|
159 |
-
#WBCR .wbcr-factory-pages-
|
160 |
font-size: 13px;
|
161 |
padding: 2px;
|
162 |
padding-left: 10px;
|
163 |
}
|
164 |
-
#WBCR .wbcr-factory-pages-
|
165 |
width: 0.4em;
|
166 |
height: 0.7em;
|
167 |
border-width: 0 0.2em 0.2em 0;
|
168 |
left: 0;
|
169 |
margin-right: 10px;
|
170 |
}
|
171 |
-
#WBCR .wbcr-factory-pages-
|
172 |
font-weight: 700;
|
173 |
line-height: 16px;
|
174 |
font-size: 12px;
|
5 |
* @copyright Webcraftic 06.10.2018
|
6 |
* @sicne 2.0.5
|
7 |
*/
|
8 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion {
|
9 |
padding: 30px 80px;
|
10 |
}
|
11 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion h3 {
|
12 |
margin: 0 0 20px;
|
13 |
}
|
14 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-inner-contanier {
|
15 |
border: 2px dashed #8bc34a;
|
16 |
background: #fff;
|
17 |
padding: 20px;
|
18 |
}
|
19 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-activate-premium {
|
20 |
display: inline-block;
|
21 |
cursor: pointer;
|
22 |
line-height: 16px;
|
35 |
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
36 |
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
37 |
}
|
38 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-activate-premium:active {
|
39 |
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
40 |
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
41 |
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
42 |
}
|
43 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-activate-premium:focus {
|
44 |
outline: none;
|
45 |
border: 0;
|
46 |
}
|
47 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-purchase-premium {
|
48 |
display: inline-block;
|
49 |
cursor: pointer;
|
50 |
line-height: 16px;
|
63 |
-moz-box-shadow: 0 1px 0 rgba(60, 45, 2, 0.31);
|
64 |
-webkit-box-shadow: 0 1px 0 rgba(60, 45, 2, 0.31);
|
65 |
}
|
66 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-purchase-premium:active {
|
67 |
box-shadow: inset 0 1px 0 rgba(60, 45, 2, 0.31);
|
68 |
-moz-box-shadow: inset 0 1px 0 rgba(60, 45, 2, 0.31);
|
69 |
-webkit-box-shadow: inset 0 1px 0 rgba(60, 45, 2, 0.31);
|
70 |
}
|
71 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-suggetion .wbcr-factory-purchase-premium:focus {
|
72 |
outline: none;
|
73 |
border: 0;
|
74 |
}
|
75 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion {
|
76 |
background: #fff;
|
77 |
color: #353535;
|
78 |
font-weight: 600;
|
79 |
border: 2px dashed #8bc34a;
|
80 |
}
|
81 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion h3 {
|
82 |
margin: 0 0 20px;
|
83 |
padding: 10px 0;
|
84 |
text-align: center;
|
89 |
vertical-align: middle;
|
90 |
text-transform: uppercase;
|
91 |
}
|
92 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion ul {
|
93 |
position: relative;
|
94 |
margin-bottom: 20px;
|
95 |
}
|
96 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion ul li {
|
97 |
font-size: 15px;
|
98 |
padding: 7px;
|
99 |
padding-left: 20px;
|
100 |
}
|
101 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion ul li:before {
|
102 |
content: " ";
|
103 |
display: inline-block;
|
104 |
width: 0.4em;
|
112 |
-o-transform: rotate(45deg);
|
113 |
transform: rotate(45deg);
|
114 |
}
|
115 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion .wbcr-factory-purchase-premium {
|
116 |
display: block;
|
117 |
cursor: pointer;
|
118 |
line-height: 16px;
|
131 |
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
132 |
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
133 |
}
|
134 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion .wbcr-factory-purchase-premium:active {
|
135 |
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
136 |
-moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
137 |
-webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2);
|
138 |
}
|
139 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion .wbcr-factory-purchase-premium:focus {
|
140 |
outline: none;
|
141 |
border: 0;
|
142 |
}
|
143 |
@media screen and (max-width: 1550px) {
|
144 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-clearfy-217-multisite-pro-suggetion {
|
145 |
padding: 10px 80px;
|
146 |
}
|
147 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion {
|
148 |
padding: 10px;
|
149 |
}
|
150 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion h3 {
|
151 |
margin: 0 0 20px;
|
152 |
padding: 10px 0;
|
153 |
font-size: 13px;
|
154 |
font-weight: 600;
|
155 |
}
|
156 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion ul {
|
157 |
margin-bottom: 20px;
|
158 |
}
|
159 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion ul li {
|
160 |
font-size: 13px;
|
161 |
padding: 2px;
|
162 |
padding-left: 10px;
|
163 |
}
|
164 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion ul li:before {
|
165 |
width: 0.4em;
|
166 |
height: 0.7em;
|
167 |
border-width: 0 0.2em 0.2em 0;
|
168 |
left: 0;
|
169 |
margin-right: 10px;
|
170 |
}
|
171 |
+
#WBCR .wbcr-factory-pages-425-impressive-page-template .wbcr-factory-right-sidebar-section .wbcr-factory-clearfy-217-pro-suggettion .wbcr-factory-purchase-premium {
|
172 |
font-weight: 700;
|
173 |
line-height: 16px;
|
174 |
font-size: 12px;
|
libs/factory/clearfy/assets/css/clearfy-base.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["clearfy-base.less"],"names":[],"mappings":";;;;;;;AAoCA,KAEE,iDACE;EACE,kBAAA;;AAJN,KAEE,iDACE,8CAGE;EACE,gBAAA;;AAPR,KAEE,iDACE,8CAOE;EACE,0BAAA;EACA,gBAAA;EACA,aAAA;;AAbR,KAEE,iDACE,8CAaE;EACE,qBAAA;EA5CN,eAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,kBAAA;EACA,qBAAA;EACA,yBAAA;EACA,kBAAA;EACA,uBAAA;EACA,0BAAA;EACA,cAAA;EACA,mBAAA;EACA,sCAAA;EACA,2CAAA;EACA,8CAAA;;AACA,KAaA,iDACE,8CAaE,+BA3BH;EACC,4CAAA;EACA,iDAAA;EACA,oDAAA;;AAEF,KAQA,iDACE,8CAaE,+BAtBH;EACC,aAAA;EACA,SAAA;;AAIJ,KAEE,iDACE,8CAiBE;EACE,qBAAA;EAhDN,eAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,kBAAA;EACA,qBAAA;EACA,yBAAA;EACA,kBAAA;EACA,uBAAA;EACA,0BAAA;EACA,cAAA;EACA,mBAAA;EACA,yCAAA;EACA,8CAAA;EACA,iDAAA;;AACA,KAaA,iDACE,8CAiBE,+BA/BH;EACC,+CAAA;EACA,oDAAA;EACA,uDAAA;;AAEF,KAQA,iDACE,8CAiBE,+BA1BH;EACC,aAAA;EACA,SAAA;;AAIJ,KAEE,iDAwBE,oCACE;EACE,gBAAA;EACA,cAAA;EACA,gBAAA;EACA,0BAAA;;AA/BR,KAEE,iDAwBE,oCACE,yCAME;EACE,gBAAA;EACA,eAAA;EACA,kBAAA;EACA,gCAAA;EACA,cAAA;EACA,eAAA;EACA,gBAAA;EACA,sBAAA;EACA,yBAAA;;AA1CV,KAEE,iDAwBE,oCACE,yCAkBE;EAEE,kBAAA;EACA,mBAAA;;AAhDV,KAEE,iDAwBE,oCACE,yCAkBE,GAKE;EACE,eAAA;EACA,YAAA;EACA,kBAAA;;AAIA,KAvDV,iDAwBE,oCACE,yCAkBE,GAKE,GAOG;EACC,SAAS,GAAT;EACA,qBAAA;EACA,YAAA;EACA,aAAA;EACA,qBAAA;EACA,6BAAA;EACA,OAAA;EACA,kBAAA;EACA,mBAAmB,aAAnB;EACA,gBAAgB,aAAhB;EACA,cAAc,aAAd;EACA,WAAW,aAAX;;AArEd,KAEE,iDAwBE,oCACE,yCAgDE;EACE,cAAA;EAvGR,eAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;EACA,kBAAA;EACA,qBAAA;EACA,yBAAA;EACA,kBAAA;EACA,uBAAA;EACA,0BAAA;EACA,cAAA;EACA,mBAAA;EACA,sCAAA;EACA,2CAAA;EACA,8CAAA;;AACA,KAaA,iDAwBE,oCACE,yCAgDE,+BAtFL;EACC,4CAAA;EACA,iDAAA;EACA,oDAAA;;AAEF,KAQA,iDAwBE,oCACE,yCAgDE,+BAjFL;EACC,aAAA;EACA,SAAA;;AAwFJ,mBAAsC;EACpC,KACE,iDACE;IACE,kBAAA;;EAHN,KACE,iDAKE,oCACE;IACE,aAAA;;EARR,KACE,iDAKE,oCACE,yCAGE;IACE,gBAAA;IACA,eAAA;IACA,eAAA;IACA,gBAAA;;EAdV,KACE,iDAKE,oCACE,yCAUE;IACE,mBAAA;;EAlBV,KACE,iDAKE,oCACE,yCAUE,GAGE;IACE,eAAA;IACA,YAAA;IACA,kBAAA;;EAEA,KAxBV,iDAKE,oCACE,yCAUE,GAGE,GAKG;IACC,YAAA;IACA,aAAA;IACA,6BAAA;IACA,OAAA;IACA,kBAAA;;EA9Bd,KACE,iDAKE,oCACE,yCA4BE;IACE,gBAAA;IACA,iBAAA;IACA,eAAA;IACA,iBAAA;IACA,kBAAA;IACA,uBAAA;IACA,0BAAA","file":"clearfy-base.css"}
|
libs/factory/clearfy/assets/css/index.php
DELETED
File without changes
|
libs/factory/clearfy/assets/index.php
DELETED
File without changes
|
libs/factory/clearfy/assets/js/globals.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
* Глобальный JS файл, который регистрирует глобальные переменные с общими методами для всех компонентов Clearfy
|
3 |
* и самого Clearfy.
|
4 |
*
|
5 |
-
* $.
|
6 |
-
* $.
|
7 |
*
|
8 |
* Copyright 2018, Webcraftic, http://webcraftic.com
|
9 |
*
|
@@ -13,11 +13,11 @@
|
|
13 |
(function($) {
|
14 |
'use strict';
|
15 |
|
16 |
-
if( !$.
|
17 |
-
$.
|
18 |
}
|
19 |
|
20 |
-
$.
|
21 |
/**
|
22 |
* Создает и показывает уведомление внутри интерфейса Clearfy
|
23 |
*
|
@@ -63,12 +63,12 @@
|
|
63 |
/**
|
64 |
* Хук выполняет проивольную функцию, после того как уведомление отображено
|
65 |
* Реализация системы фильтров и хуков в файле libs/clearfy/admin/assests/js/global.js
|
66 |
-
* Пример регистрации хука $.
|
67 |
* function(noticeId) {});
|
68 |
* @param {string} noticeId - id уведомления
|
69 |
*/
|
70 |
-
$.
|
71 |
-
$.
|
72 |
});
|
73 |
|
74 |
return noticeId;
|
@@ -93,13 +93,13 @@
|
|
93 |
/**
|
94 |
* Хук выполняет проивольную функцию, после того как уведомление скрыто
|
95 |
* Реализация системы фильтров и хуков в файле libs/clearfy/admin/assests/js/global.js
|
96 |
-
* Пример регистрации хука $.
|
97 |
* function(noticeId)
|
98 |
* {});
|
99 |
* @param {string} noticeId - id уведомления
|
100 |
*/
|
101 |
-
$.
|
102 |
-
$.
|
103 |
});
|
104 |
},
|
105 |
|
@@ -116,7 +116,7 @@
|
|
116 |
|
117 |
};
|
118 |
|
119 |
-
$.
|
120 |
|
121 |
/**
|
122 |
* A set of registered filters.
|
@@ -183,20 +183,20 @@
|
|
183 |
}
|
184 |
};
|
185 |
|
186 |
-
$.
|
187 |
|
188 |
/**
|
189 |
* Applies filters to a given input value.
|
190 |
*/
|
191 |
run: function(filterName, args) {
|
192 |
-
$.
|
193 |
},
|
194 |
|
195 |
/**
|
196 |
* Registers a new filter.
|
197 |
*/
|
198 |
add: function(filterName, callback, priority) {
|
199 |
-
$.
|
200 |
}
|
201 |
};
|
202 |
|
2 |
* Глобальный JS файл, который регистрирует глобальные переменные с общими методами для всех компонентов Clearfy
|
3 |
* и самого Clearfy.
|
4 |
*
|
5 |
+
* $.wbcr_factory_clearfy_217.app - методы для работы с приложением. Скрыть, показать уведомления.
|
6 |
+
* $.wbcr_factory_clearfy_217.hooks - это иммитация хуков и фильтров аналогично тем, что используются в Wordpress
|
7 |
*
|
8 |
* Copyright 2018, Webcraftic, http://webcraftic.com
|
9 |
*
|
13 |
(function($) {
|
14 |
'use strict';
|
15 |
|
16 |
+
if( !$.wbcr_factory_clearfy_217 ) {
|
17 |
+
$.wbcr_factory_clearfy_217 = {};
|
18 |
}
|
19 |
|
20 |
+
$.wbcr_factory_clearfy_217.app = $.wbcr_factory_clearfy_217.app || {
|
21 |
/**
|
22 |
* Создает и показывает уведомление внутри интерфейса Clearfy
|
23 |
*
|
63 |
/**
|
64 |
* Хук выполняет проивольную функцию, после того как уведомление отображено
|
65 |
* Реализация системы фильтров и хуков в файле libs/clearfy/admin/assests/js/global.js
|
66 |
+
* Пример регистрации хука $.wbcr_factory_clearfy_217.hooks.add('wbcr/factory_clearfy_217/updated',
|
67 |
* function(noticeId) {});
|
68 |
* @param {string} noticeId - id уведомления
|
69 |
*/
|
70 |
+
$.wbcr_factory_clearfy_217.hooks.run('wbcr/factory_clearfy_217/showed_notice', [noticeId]);
|
71 |
+
$.wbcr_factory_clearfy_217.hooks.run('wbcr/clearfy/showed_notice', [noticeId]);
|
72 |
});
|
73 |
|
74 |
return noticeId;
|
93 |
/**
|
94 |
* Хук выполняет проивольную функцию, после того как уведомление скрыто
|
95 |
* Реализация системы фильтров и хуков в файле libs/clearfy/admin/assests/js/global.js
|
96 |
+
* Пример регистрации хука $.wbcr_factory_clearfy_217.hooks.add('wbcr/factory_clearfy_217/updated',
|
97 |
* function(noticeId)
|
98 |
* {});
|
99 |
* @param {string} noticeId - id уведомления
|
100 |
*/
|
101 |
+
$.wbcr_factory_clearfy_217.hooks.run('wbcr/factory_clearfy_217/hidded_notice', [noticeId]);
|
102 |
+
$.wbcr_factory_clearfy_217.hooks.run('wbcr/clearfy/hidded_notice', [noticeId]);
|
103 |
});
|
104 |
},
|
105 |
|
116 |
|
117 |
};
|
118 |
|
119 |
+
$.wbcr_factory_clearfy_217.filters = $.wbcr_factory_clearfy_217.filters || {
|
120 |
|
121 |
/**
|
122 |
* A set of registered filters.
|
183 |
}
|
184 |
};
|
185 |
|
186 |
+
$.wbcr_factory_clearfy_217.hooks = $.wbcr_factory_clearfy_217.hooks || {
|
187 |
|
188 |
/**
|
189 |
* Applies filters to a given input value.
|
190 |
*/
|
191 |
run: function(filterName, args) {
|
192 |
+
$.wbcr_factory_clearfy_217.filters.run(filterName, args);
|
193 |
},
|
194 |
|
195 |
/**
|
196 |
* Registers a new filter.
|
197 |
*/
|
198 |
add: function(filterName, callback, priority) {
|
199 |
+
$.wbcr_factory_clearfy_217.filters.add(filterName, callback, priority);
|
200 |
}
|
201 |
};
|
202 |
|
libs/factory/clearfy/assets/js/index.php
DELETED
File without changes
|
libs/factory/clearfy/assets/js/license-manager.js
CHANGED
@@ -3,44 +3,40 @@
|
|
3 |
* Его основная роль отправка ajax запросов на проверку, активацию, деактивацию лицензии
|
4 |
* и вывод уведомлений об ошибка или успешно выполнении проверок.
|
5 |
*
|
6 |
-
* @author
|
7 |
* @copyright (c) 05.10.2018, Webcraftic
|
8 |
* @version 1.1
|
9 |
* @since 1.4.0
|
10 |
*/
|
11 |
-
|
12 |
-
|
13 |
jQuery(function($) {
|
14 |
|
15 |
var allNotices = [];
|
16 |
|
17 |
$(document).on('click', '.wcl-control-btn', function() {
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
21 |
|
22 |
for( i = 0; i < allNotices.length; i++ ) {
|
23 |
-
$.
|
24 |
}
|
25 |
|
26 |
$('.wcl-control-btn').hide();
|
27 |
|
28 |
-
var wrapper = $('#wcl-license-wrapper'),
|
29 |
-
loader = wrapper.data('loader'),
|
30 |
-
pluginClass = wrapper.data('plugin');
|
31 |
-
|
32 |
$(this).after('<img class="wcl-loader" src="' + loader + '">');
|
33 |
|
34 |
var data = {
|
35 |
-
action: 'wbcr-clearfy-activate-license',
|
36 |
-
_wpnonce:
|
37 |
-
|
|
|
38 |
licensekey: ''
|
39 |
};
|
40 |
|
41 |
if( $(this).data('action').trim() === 'activate' ) {
|
42 |
data.licensekey = $('#license-key').val().trim();
|
43 |
-
data.plugin_class = pluginClass;
|
44 |
}
|
45 |
|
46 |
$.ajax(ajaxurl, {
|
@@ -57,7 +53,7 @@ jQuery(function($) {
|
|
57 |
|
58 |
if( response.data ) {
|
59 |
console.log(response.data.error_message);
|
60 |
-
noticeId = $.
|
61 |
allNotices.push(noticeId);
|
62 |
} else {
|
63 |
console.log(response);
|
@@ -67,7 +63,7 @@ jQuery(function($) {
|
|
67 |
}
|
68 |
|
69 |
if( response.data && response.data.message ) {
|
70 |
-
noticeId = $.
|
71 |
allNotices.push(noticeId);
|
72 |
|
73 |
// todo: доработать генерацию формы, вместо перезагрузки страницы
|
@@ -84,7 +80,7 @@ jQuery(function($) {
|
|
84 |
console.log(xhr.responseText);
|
85 |
console.log(thrownError);
|
86 |
|
87 |
-
var noticeId = $.
|
88 |
|
89 |
allNotices.push(noticeId);
|
90 |
}
|
3 |
* Его основная роль отправка ajax запросов на проверку, активацию, деактивацию лицензии
|
4 |
* и вывод уведомлений об ошибка или успешно выполнении проверок.
|
5 |
*
|
6 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
7 |
* @copyright (c) 05.10.2018, Webcraftic
|
8 |
* @version 1.1
|
9 |
* @since 1.4.0
|
10 |
*/
|
|
|
|
|
11 |
jQuery(function($) {
|
12 |
|
13 |
var allNotices = [];
|
14 |
|
15 |
$(document).on('click', '.wcl-control-btn', function() {
|
16 |
+
var wrapper = $('#wcl-license-wrapper'),
|
17 |
+
loader = wrapper.data('loader'),
|
18 |
+
pluginName = wrapper.data('plugin-name'),
|
19 |
+
wpnonce = wrapper.data('nonce'),
|
20 |
+
licenseAction = $(this).data('action');
|
21 |
|
22 |
for( i = 0; i < allNotices.length; i++ ) {
|
23 |
+
$.wbcr_factory_clearfy_217.app.hideNotice(allNotices[i]);
|
24 |
}
|
25 |
|
26 |
$('.wcl-control-btn').hide();
|
27 |
|
|
|
|
|
|
|
|
|
28 |
$(this).after('<img class="wcl-loader" src="' + loader + '">');
|
29 |
|
30 |
var data = {
|
31 |
+
action: 'wbcr-clearfy-activate-license-for-' + pluginName,
|
32 |
+
_wpnonce: wpnonce,
|
33 |
+
plugin_name: pluginName,
|
34 |
+
license_action: licenseAction,
|
35 |
licensekey: ''
|
36 |
};
|
37 |
|
38 |
if( $(this).data('action').trim() === 'activate' ) {
|
39 |
data.licensekey = $('#license-key').val().trim();
|
|
|
40 |
}
|
41 |
|
42 |
$.ajax(ajaxurl, {
|
53 |
|
54 |
if( response.data ) {
|
55 |
console.log(response.data.error_message);
|
56 |
+
noticeId = $.wbcr_factory_clearfy_217.app.showNotice('Error: [' + response.data.error_message + ']', 'danger');
|
57 |
allNotices.push(noticeId);
|
58 |
} else {
|
59 |
console.log(response);
|
63 |
}
|
64 |
|
65 |
if( response.data && response.data.message ) {
|
66 |
+
noticeId = $.wbcr_factory_clearfy_217.app.showNotice(response.data.message, 'success');
|
67 |
allNotices.push(noticeId);
|
68 |
|
69 |
// todo: доработать генерацию формы, вместо перезагрузки страницы
|
80 |
console.log(xhr.responseText);
|
81 |
console.log(thrownError);
|
82 |
|
83 |
+
var noticeId = $.wbcr_factory_clearfy_217.app.showNotice('Error: [' + thrownError + '] Status: [' + xhr.status + '] Error massage: [' + xhr.responseText + ']', 'danger');
|
84 |
|
85 |
allNotices.push(noticeId);
|
86 |
}
|
libs/factory/clearfy/boot.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Factory clearfy
|
4 |
*
|
5 |
-
* @author
|
|
|
|
|
6 |
* @copyright (c) 2018, Webcraftic Ltd
|
7 |
*
|
8 |
-
* @package clearfy
|
9 |
-
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -14,35 +14,36 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if ( defined( '
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
-
define( '
|
22 |
|
23 |
-
define( '
|
24 |
|
25 |
-
define( '
|
26 |
-
define( '
|
27 |
|
28 |
-
load_plugin_textdomain( '
|
29 |
|
30 |
-
require(
|
31 |
-
require(
|
32 |
-
require(
|
33 |
|
34 |
// module provides function only for the admin area
|
35 |
if ( is_admin() ) {
|
36 |
/**
|
37 |
* Подключаем скрипты для установки компонентов Clearfy
|
38 |
-
* на все страницы
|
39 |
*/
|
40 |
add_action( 'admin_enqueue_scripts', function () {
|
41 |
-
wp_enqueue_script( 'wbcr-factory-clearfy-
|
42 |
} );
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
48 |
}
|
2 |
/**
|
3 |
* Factory clearfy
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
6 |
+
* @since 1.0.0
|
7 |
+
* @package clearfy
|
8 |
* @copyright (c) 2018, Webcraftic Ltd
|
9 |
*
|
|
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if ( defined( 'FACTORY_CLEARFY_217_LOADED' ) ) {
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
+
define( 'FACTORY_CLEARFY_217_LOADED', true );
|
22 |
|
23 |
+
define( 'FACTORY_CLEARFY_217', '2.1.7' );
|
24 |
|
25 |
+
define( 'FACTORY_CLEARFY_217_DIR', dirname( __FILE__ ) );
|
26 |
+
define( 'FACTORY_CLEARFY_217_URL', plugins_url( null, __FILE__ ) );
|
27 |
|
28 |
+
load_plugin_textdomain( 'wbcr_factory_clearfy_217', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' );
|
29 |
|
30 |
+
require( FACTORY_CLEARFY_217_DIR . '/includes/ajax-handlers.php' );
|
31 |
+
require( FACTORY_CLEARFY_217_DIR . '/includes/class-helpers.php' );
|
32 |
+
require( FACTORY_CLEARFY_217_DIR . '/includes/class-configurate.php' );
|
33 |
|
34 |
// module provides function only for the admin area
|
35 |
if ( is_admin() ) {
|
36 |
/**
|
37 |
* Подключаем скрипты для установки компонентов Clearfy
|
38 |
+
* на все страницы админпанели.
|
39 |
*/
|
40 |
add_action( 'admin_enqueue_scripts', function () {
|
41 |
+
wp_enqueue_script( 'wbcr-factory-clearfy-217-global', FACTORY_CLEARFY_217_URL . '/assets/js/globals.js', [ 'jquery' ], FACTORY_CLEARFY_217 );
|
42 |
} );
|
43 |
|
44 |
+
if ( defined( 'FACTORY_PAGES_425_LOADED' ) ) {
|
45 |
+
require( FACTORY_CLEARFY_217_DIR . '/pages/class-pages.php' );
|
46 |
+
require( FACTORY_CLEARFY_217_DIR . '/pages/class-page-more-features.php' );
|
47 |
+
require( FACTORY_CLEARFY_217_DIR . '/pages/class-page-license.php' );
|
48 |
+
}
|
49 |
}
|
libs/factory/clearfy/includes/ajax-handlers.php
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Ajax handlers
|
4 |
-
*
|
|
|
5 |
* @copyright (c) 2017 Webraftic Ltd
|
6 |
-
* @version
|
7 |
*/
|
8 |
|
9 |
// Exit if accessed directly
|
@@ -14,76 +15,87 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
/**
|
15 |
* Обработчик ajax запросов для проверки, активации, деактивации лицензионного ключа
|
16 |
*
|
17 |
-
* @
|
18 |
*
|
19 |
-
* @
|
20 |
*
|
21 |
*/
|
22 |
-
function
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
$action = $plugin_instance->request->post( 'license_action', false, true );
|
26 |
$license_key = $plugin_instance->request->post( 'licensekey', null );
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
30 |
die();
|
31 |
}
|
32 |
-
|
33 |
$result = null;
|
34 |
$success_message = '';
|
35 |
-
|
36 |
try {
|
37 |
switch ( $action ) {
|
38 |
case 'activate':
|
39 |
if ( empty( $license_key ) || strlen( $license_key ) > 32 ) {
|
40 |
-
wp_send_json_error(
|
41 |
} else {
|
42 |
$plugin_instance->premium->activate( $license_key );
|
43 |
-
$success_message = __( 'Your license has been successfully activated', '
|
44 |
}
|
45 |
break;
|
46 |
case 'deactivate':
|
47 |
$plugin_instance->premium->deactivate();
|
48 |
-
$success_message = __( 'The license is deactivated', '
|
49 |
break;
|
50 |
case 'sync':
|
51 |
$plugin_instance->premium->sync();
|
52 |
-
$success_message = __( 'The license has been updated', '
|
53 |
break;
|
54 |
case 'unsubscribe':
|
55 |
$plugin_instance->premium->cancel_paid_subscription();
|
56 |
-
$success_message = __( 'Subscription success cancelled', '
|
57 |
break;
|
58 |
}
|
59 |
} catch( Exception $e ) {
|
60 |
-
|
61 |
/**
|
62 |
-
* Экшен
|
|
|
|
|
|
|
63 |
*
|
64 |
-
* @param string $action
|
65 |
* @param string $license_key
|
66 |
* @param string $error_message
|
67 |
*
|
68 |
-
* @
|
69 |
*/
|
70 |
-
do_action(
|
71 |
-
|
72 |
-
wp_send_json_error(
|
73 |
die();
|
74 |
}
|
75 |
-
|
76 |
/**
|
77 |
-
* Экшен
|
|
|
|
|
|
|
78 |
*
|
79 |
-
* @param string $action
|
80 |
* @param string $license_key
|
81 |
*
|
82 |
-
* @
|
83 |
*/
|
84 |
-
do_action(
|
85 |
-
|
86 |
-
wp_send_json_success(
|
87 |
-
|
88 |
die();
|
89 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Ajax handlers
|
4 |
+
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
6 |
* @copyright (c) 2017 Webraftic Ltd
|
7 |
+
* @version 1.0
|
8 |
*/
|
9 |
|
10 |
// Exit if accessed directly
|
15 |
/**
|
16 |
* Обработчик ajax запросов для проверки, активации, деактивации лицензионного ключа
|
17 |
*
|
18 |
+
* @since 2.0.7
|
19 |
*
|
20 |
+
* @param Wbcr_Factory425_Plugin $plugin_instance
|
21 |
*
|
22 |
*/
|
23 |
+
function wbcr_factory_clearfy_217_check_license( $plugin_instance ) {
|
24 |
+
|
25 |
+
$plugin_name = $plugin_instance->request->post( 'plugin_name', null, true );
|
26 |
+
|
27 |
+
if ( ( $plugin_instance->getPluginName() !== $plugin_name ) || ! $plugin_instance->current_user_can() ) {
|
28 |
+
wp_die( - 1, 403 );
|
29 |
+
}
|
30 |
+
|
31 |
$action = $plugin_instance->request->post( 'license_action', false, true );
|
32 |
$license_key = $plugin_instance->request->post( 'licensekey', null );
|
33 |
+
|
34 |
+
check_admin_referer( "clearfy_activate_license_for_{$plugin_name}" );
|
35 |
+
|
36 |
+
if ( empty( $action ) || ! in_array( $action, [ 'activate', 'deactivate', 'sync', 'unsubscribe' ] ) ) {
|
37 |
+
wp_send_json_error( [ 'error_message' => __( 'Licensing action not passed or this action is prohibited!', 'wbcr_factory_clearfy_217' ) ] );
|
38 |
die();
|
39 |
}
|
40 |
+
|
41 |
$result = null;
|
42 |
$success_message = '';
|
43 |
+
|
44 |
try {
|
45 |
switch ( $action ) {
|
46 |
case 'activate':
|
47 |
if ( empty( $license_key ) || strlen( $license_key ) > 32 ) {
|
48 |
+
wp_send_json_error( [ 'error_message' => __( 'License key is empty or license key too long (license key is 32 characters long)', 'wbcr_factory_clearfy_217' ) ] );
|
49 |
} else {
|
50 |
$plugin_instance->premium->activate( $license_key );
|
51 |
+
$success_message = __( 'Your license has been successfully activated', 'wbcr_factory_clearfy_217' );
|
52 |
}
|
53 |
break;
|
54 |
case 'deactivate':
|
55 |
$plugin_instance->premium->deactivate();
|
56 |
+
$success_message = __( 'The license is deactivated', 'wbcr_factory_clearfy_217' );
|
57 |
break;
|
58 |
case 'sync':
|
59 |
$plugin_instance->premium->sync();
|
60 |
+
$success_message = __( 'The license has been updated', 'wbcr_factory_clearfy_217' );
|
61 |
break;
|
62 |
case 'unsubscribe':
|
63 |
$plugin_instance->premium->cancel_paid_subscription();
|
64 |
+
$success_message = __( 'Subscription success cancelled', 'wbcr_factory_clearfy_217' );
|
65 |
break;
|
66 |
}
|
67 |
} catch( Exception $e ) {
|
68 |
+
|
69 |
/**
|
70 |
+
* Экшен выполняется, когда проверка лицензии вернула ошибку
|
71 |
+
*
|
72 |
+
* @since 2.1.2 Переименован в {$plugin_name}/factory/clearfy/check_license_error
|
73 |
+
* @since 2.0.7
|
74 |
*
|
|
|
75 |
* @param string $license_key
|
76 |
* @param string $error_message
|
77 |
*
|
78 |
+
* @param string $action
|
79 |
*/
|
80 |
+
do_action( "{$plugin_name}/factory/clearfy/check_license_error", $action, $license_key, $e->getMessage() );
|
81 |
+
|
82 |
+
wp_send_json_error( [ 'error_message' => $e->getMessage() ] );
|
83 |
die();
|
84 |
}
|
85 |
+
|
86 |
/**
|
87 |
+
* Экшен выполняется, когда проверка лицензии успешно завершена
|
88 |
+
*
|
89 |
+
* @since 2.1.2 Переименован в {$plugin_name}/factory/clearfy/check_license_success
|
90 |
+
* @since 2.0.7
|
91 |
*
|
|
|
92 |
* @param string $license_key
|
93 |
*
|
94 |
+
* @param string $action
|
95 |
*/
|
96 |
+
do_action( "{$plugin_name}/factory/clearfy/check_license_success", $action, $license_key );
|
97 |
+
|
98 |
+
wp_send_json_success( [ 'message' => $success_message ] );
|
99 |
+
|
100 |
die();
|
101 |
}
|
libs/factory/clearfy/includes/check-clearfy-compatibility.php
DELETED
@@ -1,306 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Класс позволяет получить информацию о плагине Clearfy и его совместимость с другими плагинами.
|
5 |
-
* Наследует класс Wbcr_Factory_Compatibility, который отвечает за проверку базовой совместимости сайта.
|
6 |
-
*
|
7 |
-
* @author Webcraftic <wordpress.webraftic@gmail.com>
|
8 |
-
* @copyright (c) 26.09.2018, Webcraftic
|
9 |
-
* @version 1.0.0
|
10 |
-
* @since 2.0.5
|
11 |
-
*/
|
12 |
-
if( !class_exists('Wbcr_FactoryClearfy_Compatibility') ) {
|
13 |
-
|
14 |
-
class Wbcr_FactoryClearfy_Compatibility extends Wbcr_Factory_Compatibility {
|
15 |
-
|
16 |
-
protected $factory_version;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @var bool
|
20 |
-
*/
|
21 |
-
protected $plugin_as_component;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @var bool
|
25 |
-
*/
|
26 |
-
protected $plugin_already_activate;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @var bool
|
30 |
-
*/
|
31 |
-
protected $plugin_dir;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @var bool
|
35 |
-
*/
|
36 |
-
protected $plugin_base;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @var bool
|
40 |
-
*/
|
41 |
-
protected $plugin_url;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* С какой версией Clearfy может работать этот плагин
|
45 |
-
*
|
46 |
-
* @var string
|
47 |
-
*/
|
48 |
-
protected $required_clearfy_version = '1.4.2';
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Нужно ли требовать активацию Clearfy для работы этого плагина
|
52 |
-
* Если true, то нужно
|
53 |
-
*
|
54 |
-
* @var bool по умолчанию false
|
55 |
-
*/
|
56 |
-
protected $required_clearfy_active = false;
|
57 |
-
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Нужно ли проверять активирован ли этот плагин, как компонент в плагине Clearfy
|
61 |
-
* Если true, то нужно
|
62 |
-
*
|
63 |
-
* @var bool по умолчанию false
|
64 |
-
*/
|
65 |
-
protected $required_clearfy_check_component = false;
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Нужно ли проверять совместимость фреймворка для работы с плагином Clearfy
|
69 |
-
* Если true, то нужно
|
70 |
-
*
|
71 |
-
* @var bool по умолчанию false
|
72 |
-
*/
|
73 |
-
protected $required_clearfy_framework_compatibility = false;
|
74 |
-
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Нужно ли проверять совместимость этого плагин с версией Clearfy
|
78 |
-
* Если true, то нужно
|
79 |
-
*
|
80 |
-
* @var bool по умолчанию false
|
81 |
-
*/
|
82 |
-
protected $required_clearfy_version_compatibility = false;
|
83 |
-
|
84 |
-
|
85 |
-
function __construct(array $plugin_info)
|
86 |
-
{
|
87 |
-
parent::__construct($plugin_info);
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Это статистический метод. Вовзращает директорию плагина Clearfy
|
92 |
-
*
|
93 |
-
* @return string
|
94 |
-
*/
|
95 |
-
public static function getClearfyDir()
|
96 |
-
{
|
97 |
-
$folder_name = 'clearfy';
|
98 |
-
|
99 |
-
return WP_PLUGIN_DIR . '/' . $folder_name;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Это статистический метод. Вовзращает базовый путь к плагину Clearfy
|
104 |
-
* Пример: clearfy/clearfy.php
|
105 |
-
*
|
106 |
-
* @return string
|
107 |
-
*/
|
108 |
-
public static function getClearfyBasePath()
|
109 |
-
{
|
110 |
-
return plugin_basename(self::getClearfyPluginFile());
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Это статистический метод. Вовзращает aбсолютный путь к основному файлу плагина Clearfy *
|
115 |
-
* Пример: www/wp-content/plugins/clearfy/clearfy.php
|
116 |
-
*
|
117 |
-
* @return string
|
118 |
-
*/
|
119 |
-
public static function getClearfyPluginFile()
|
120 |
-
{
|
121 |
-
return self::getClearfyDir() . '/clearfy.php';
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Это статистический метод. Возвращает версию плагина Clearfy *
|
126 |
-
* Пример: 1.3.0
|
127 |
-
*
|
128 |
-
* @return string
|
129 |
-
*/
|
130 |
-
public static function getClearfyVersion()
|
131 |
-
{
|
132 |
-
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
133 |
-
|
134 |
-
$plugin_data = get_plugin_data(self::getClearfyPluginFile());
|
135 |
-
|
136 |
-
return !empty($plugin_data['Version']) ? $plugin_data['Version'] : null;
|
137 |
-
}
|
138 |
-
|
139 |
-
public function registerNotices()
|
140 |
-
{
|
141 |
-
if( current_user_can('activate_plugins') && current_user_can('edit_plugins') && current_user_can('install_plugins') ) {
|
142 |
-
if( is_plugin_active_for_network(self::getClearfyBasePath()) ) {
|
143 |
-
add_action('network_admin_notices', array($this, 'showNotice'));
|
144 |
-
} else {
|
145 |
-
add_action('admin_notices', array($this, 'showNotice'));
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Проверяем, активирован ли плагин Clearfy
|
153 |
-
*
|
154 |
-
* @return bool
|
155 |
-
*/
|
156 |
-
public static function isClearfyActivate()
|
157 |
-
{
|
158 |
-
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
159 |
-
|
160 |
-
return is_plugin_active(self::getClearfyBasePath());
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Проверяем, активирован ли плагин, как компонент в Clearfy
|
165 |
-
*
|
166 |
-
* @return bool
|
167 |
-
*/
|
168 |
-
public function isPluginActiveAsComponent()
|
169 |
-
{
|
170 |
-
return self::isClearfyActivate() && !$this->plugin_as_component;
|
171 |
-
}
|
172 |
-
|
173 |
-
/**
|
174 |
-
* Проверяем совместимость с версией фреймворка, который использует плагина Clearfy
|
175 |
-
*
|
176 |
-
* @return bool
|
177 |
-
*/
|
178 |
-
public function checkClearfyFrameworkCompatibility()
|
179 |
-
{
|
180 |
-
if( !defined('WBCR_CLEARFY_FRAMEWORK_VER') || empty($this->factory_version) ) {
|
181 |
-
return false;
|
182 |
-
}
|
183 |
-
|
184 |
-
return WBCR_CLEARFY_FRAMEWORK_VER == $this->factory_version;
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Проверяем совместимость этого плагина с версией Clearfy
|
189 |
-
*
|
190 |
-
* @return bool
|
191 |
-
*/
|
192 |
-
public function checkClearfyVersionCompatibility()
|
193 |
-
{
|
194 |
-
$plugin_version = self::getClearfyVersion();
|
195 |
-
|
196 |
-
if( !empty($plugin_version) ) {
|
197 |
-
if( !version_compare($plugin_version, $this->required_clearfy_version, '>=') ) {
|
198 |
-
return false;
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
return true;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Совместимость с плагином Clearfy, проверяется только в премиум компонентах,
|
207 |
-
* так как компоненты компилируются с Clearfy на одной версии фреймворка
|
208 |
-
*
|
209 |
-
* @return bool|mixed
|
210 |
-
*/
|
211 |
-
public function check()
|
212 |
-
{
|
213 |
-
if( $this->plugin_already_activate ) {
|
214 |
-
return false;
|
215 |
-
}
|
216 |
-
|
217 |
-
if( $this->required_clearfy_check_component && $this->isPluginActiveAsComponent() ) {
|
218 |
-
return false;
|
219 |
-
}
|
220 |
-
|
221 |
-
if( !parent::check() ) {
|
222 |
-
return false;
|
223 |
-
}
|
224 |
-
|
225 |
-
if( !self::checkClearfyFrameworkCompatibility() && $this->required_clearfy_framework_compatibility ) {
|
226 |
-
return false;
|
227 |
-
}
|
228 |
-
|
229 |
-
if( $this->required_clearfy_active ) {
|
230 |
-
if( self::isClearfyActivate() ) {
|
231 |
-
if( $this->required_clearfy_version_compatibility ) {
|
232 |
-
$plugin_version = self::getClearfyVersion();
|
233 |
-
|
234 |
-
if( !empty($plugin_version) ) {
|
235 |
-
if( !version_compare($plugin_version, $this->required_clearfy_version, '>=') ) {
|
236 |
-
return false;
|
237 |
-
}
|
238 |
-
}
|
239 |
-
}
|
240 |
-
} else {
|
241 |
-
return false;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
return true;
|
246 |
-
}
|
247 |
-
|
248 |
-
/**
|
249 |
-
* Метод возвращает текст уведомления
|
250 |
-
*
|
251 |
-
* @return string
|
252 |
-
*/
|
253 |
-
public function getNoticeText()
|
254 |
-
{
|
255 |
-
if( !self::isClearfyActivate() && !$this->required_clearfy_active ) {
|
256 |
-
return parent::getNoticeText();
|
257 |
-
}
|
258 |
-
|
259 |
-
$notice_text = $notice_default_text = '';
|
260 |
-
|
261 |
-
if( self::isClearfyActivate() ) {
|
262 |
-
$notice_default_text .= '<b>' . __('Clearfy warning', 'wbcr_factory_clearfy_209') . ':</b>' . '<br>';
|
263 |
-
$phrase = sprintf(__('The %s component', 'wbcr_factory_clearfy_209'), $this->plugin_title);
|
264 |
-
} else {
|
265 |
-
$notice_default_text .= '<b>' . $this->plugin_title . ' ' . __('warning', 'wbcr_factory_clearfy_209') . ':</b>' . '<br>';
|
266 |
-
$phrase = sprintf(__('The %s plugin', 'wbcr_factory_clearfy_209'), $this->plugin_title);
|
267 |
-
}
|
268 |
-
|
269 |
-
$notice_default_text .= $phrase . ' ' . __('has stopped.', 'wbcr_factory_clearfy_209');
|
270 |
-
$notice_default_text .= __('Possible reasons:', 'wbcr_factory_clearfy_209') . ' <br>';
|
271 |
-
|
272 |
-
$has_one = false;
|
273 |
-
|
274 |
-
if( !$this->isPhpCompatibility() ) {
|
275 |
-
$has_one = true;
|
276 |
-
$notice_text .= '- ' . sprintf(__('You need to update the PHP version to %s or higher!', 'wbcr_factory_clearfy_209'), $this->required_php_version) . '<br>';
|
277 |
-
}
|
278 |
-
|
279 |
-
if( !$this->isWpCompatibility() ) {
|
280 |
-
$has_one = true;
|
281 |
-
$notice_text .= '- ' . sprintf(__('You need to update WordPress to %s or higher!', 'wbcr_factory_clearfy_209'), $this->required_wp_version) . '<br>';
|
282 |
-
}
|
283 |
-
|
284 |
-
if( $this->required_clearfy_version_compatibility && !$this->checkClearfyVersionCompatibility() ) {
|
285 |
-
$has_one = true;
|
286 |
-
$notice_text .= '- ' . sprintf(__('You need to update the Clearfy plugin version to %s or higher!', 'wbcr_factory_clearfy_209'), $this->required_clearfy_version) . '<br>';
|
287 |
-
}
|
288 |
-
|
289 |
-
if( $this->plugin_already_activate ) {
|
290 |
-
$has_one = true;
|
291 |
-
$notice_text = '- ' . sprintf(__('This plugin is already activated, you are trying to activate it again.', 'wbcr_factory_clearfy_209'), $this->required_php_version) . '<br>';
|
292 |
-
}
|
293 |
-
|
294 |
-
if( $this->required_clearfy_check_component && $this->isPluginActiveAsComponent() ) {
|
295 |
-
$has_one = true;
|
296 |
-
$notice_text = '- ' . sprintf(__('Clearfy has the features of the %s plugin. Please, deactivate %s to avoid conflicts of plugins!', 'wbcr_factory_clearfy_209'), $this->plugin_title, $this->plugin_title) . '<br>';
|
297 |
-
}
|
298 |
-
|
299 |
-
if( $has_one ) {
|
300 |
-
$notice_text = $notice_default_text . $notice_text;
|
301 |
-
}
|
302 |
-
|
303 |
-
return $notice_text;
|
304 |
-
}
|
305 |
-
}
|
306 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/factory/clearfy/includes/class-clearfy-configurate.php
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Configurate clearfy plugins
|
4 |
-
*
|
5 |
-
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
6 |
-
* @copyright (c) 2018, Webcraftic Ltd
|
7 |
-
*
|
8 |
-
* @package clearfy
|
9 |
-
* @since 1.0.0
|
10 |
-
*/
|
11 |
-
|
12 |
-
// Exit if accessed directly
|
13 |
-
if( !defined('ABSPATH') ) {
|
14 |
-
exit;
|
15 |
-
}
|
16 |
-
|
17 |
-
if( !class_exists('Wbcr_FactoryClearfy209_Configurate') ) {
|
18 |
-
|
19 |
-
abstract class Wbcr_FactoryClearfy209_Configurate {
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @param Wbcr_Factory414_Plugin $plugin
|
23 |
-
*/
|
24 |
-
public function __construct(Wbcr_Factory414_Plugin $plugin)
|
25 |
-
{
|
26 |
-
$this->plugin = $plugin;
|
27 |
-
$this->registerActionsAndFilters();
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Registers filters and actions
|
32 |
-
* @return mixed
|
33 |
-
*/
|
34 |
-
abstract protected function registerActionsAndFilters();
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Get options with namespace
|
38 |
-
*
|
39 |
-
* @param $option_name
|
40 |
-
* @param bool $default
|
41 |
-
* @return mixed|void
|
42 |
-
*/
|
43 |
-
public function getPopulateOption($option_name, $default = false)
|
44 |
-
{
|
45 |
-
return $this->plugin->getPopulateOption($option_name, $default);
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Get options with namespace
|
50 |
-
*
|
51 |
-
* @param $option_name
|
52 |
-
* @param bool $default
|
53 |
-
* @return mixed|void
|
54 |
-
*/
|
55 |
-
public function getOption($option_name, $default = false)
|
56 |
-
{
|
57 |
-
return $this->plugin->getOption($option_name, $default);
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Get network options with namespace
|
62 |
-
*
|
63 |
-
* @param $option_name
|
64 |
-
* @param bool $default
|
65 |
-
* @return mixed|void
|
66 |
-
*/
|
67 |
-
public function getNetworkOption($option_name, $default = false)
|
68 |
-
{
|
69 |
-
return $this->plugin->getNetworkOption($option_name, $default);
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* @param $option_name
|
74 |
-
* @param $value
|
75 |
-
* @return bool
|
76 |
-
*/
|
77 |
-
public function updatePopulateOption($option_name, $value)
|
78 |
-
{
|
79 |
-
$this->plugin->updatePopulateOption($option_name, $value);
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* @param $option_name
|
84 |
-
* @param $value
|
85 |
-
* @return bool
|
86 |
-
*/
|
87 |
-
public function updateNetworkOption($option_name, $value)
|
88 |
-
{
|
89 |
-
$this->plugin->updateNetworkOption($option_name, $value);
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* @param $option_name
|
94 |
-
* @param $value
|
95 |
-
* @return bool
|
96 |
-
*/
|
97 |
-
public function updateOption($option_name, $value)
|
98 |
-
{
|
99 |
-
$this->plugin->updateOption($option_name, $value);
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* @param $option_name
|
104 |
-
* @return bool
|
105 |
-
*/
|
106 |
-
public function deletePopulateOption($option_name)
|
107 |
-
{
|
108 |
-
$this->plugin->deletePopulateOption($option_name);
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* @param $option_name
|
113 |
-
* @return bool
|
114 |
-
*/
|
115 |
-
public function deleteOption($option_name)
|
116 |
-
{
|
117 |
-
$this->plugin->deleteOption($option_name);
|
118 |
-
}
|
119 |
-
}
|
120 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/factory/clearfy/includes/class-clearfy-helpers.php
DELETED
@@ -1,370 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Helpers functions
|
5 |
-
*
|
6 |
-
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
7 |
-
* @copyright (c) 2018, Webcraftic Ltd
|
8 |
-
*
|
9 |
-
* @package clearfy
|
10 |
-
* @since 1.0.0
|
11 |
-
*/
|
12 |
-
|
13 |
-
// Exit if accessed directly
|
14 |
-
if( !defined('ABSPATH') ) {
|
15 |
-
exit;
|
16 |
-
}
|
17 |
-
|
18 |
-
if( !class_exists('WbcrFactoryClearfy209_Helpers') ) {
|
19 |
-
class WbcrFactoryClearfy209_Helpers {
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Ссылка по умолчанию (анг)
|
23 |
-
*/
|
24 |
-
const WEBCRAFTIC_SITE_URL = 'https://clearfy.pro';
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Русская локализация сайта
|
28 |
-
*/
|
29 |
-
const WEBCRAFTIC_RU_SITE_URL = 'https://ru.clearfy.pro';
|
30 |
-
/**
|
31 |
-
* Украинская локализация сайта
|
32 |
-
*/
|
33 |
-
const WEBCRAFTIC_UA_SITE_URL = 'https://ua.clearfy.pro';
|
34 |
-
/**
|
35 |
-
* Испанская
|
36 |
-
*/
|
37 |
-
const WEBCRAFTIC_ES_SITE_URL = 'https://es.clearfy.pro';
|
38 |
-
/**
|
39 |
-
* Французкая
|
40 |
-
*/
|
41 |
-
const WEBCRAFTIC_DE_SITE_URL = 'https://de.clearfy.pro';
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @since 2.0.5
|
45 |
-
* @param int $price
|
46 |
-
* @return int
|
47 |
-
*/
|
48 |
-
public static function getClearfyBusinessPrice($price = 19)
|
49 |
-
{
|
50 |
-
return (int)apply_filters('wbcr/clearfy/business_price', $price);
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @since 2.0.5
|
55 |
-
* @param int $price
|
56 |
-
* @return int
|
57 |
-
*/
|
58 |
-
public static function getClearfyBusinessRevPrice($price = 69)
|
59 |
-
{
|
60 |
-
return (int)apply_filters('wbcr/clearfy/business_rev_price', $price);
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Get a link to the official website of the developer
|
65 |
-
*
|
66 |
-
* @return string|null
|
67 |
-
*/
|
68 |
-
public static function getWebcrafticSiteUrl()
|
69 |
-
{
|
70 |
-
if( get_locale() == 'ru_RU' ) {
|
71 |
-
return self::WEBCRAFTIC_RU_SITE_URL;
|
72 |
-
}
|
73 |
-
|
74 |
-
return self::WEBCRAFTIC_SITE_URL;
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* /**
|
79 |
-
* Get a link to the official website of the developer
|
80 |
-
*
|
81 |
-
* @since 2.0.5
|
82 |
-
* @param string $plugin_name
|
83 |
-
* @param string $page - page address
|
84 |
-
* @param string $utm_content - from which page or part of the plugin user moved to the site
|
85 |
-
* @param string $urm_source
|
86 |
-
* @return string
|
87 |
-
*/
|
88 |
-
public static function getWebcrafticSitePageUrl($plugin_name, $page, $utm_content = null, $urm_source = 'wordpress.org')
|
89 |
-
{
|
90 |
-
$args = array('utm_source' => $urm_source);
|
91 |
-
|
92 |
-
if( !empty($plugin_name) ) {
|
93 |
-
$args['utm_campaign'] = $plugin_name;
|
94 |
-
}
|
95 |
-
|
96 |
-
if( !empty($utm_content) ) {
|
97 |
-
$args['utm_content'] = $utm_content;
|
98 |
-
}
|
99 |
-
|
100 |
-
$raw_url = add_query_arg($args, self::getWebcrafticSiteUrl() . '/' . $page . '/');
|
101 |
-
$url = esc_url($raw_url);
|
102 |
-
|
103 |
-
/**
|
104 |
-
* @param string $url
|
105 |
-
* @param string $raw_url
|
106 |
-
* @param string $plugin_name
|
107 |
-
* @param string $page - page address
|
108 |
-
* @param string $utm_content - from which page or part of the plugin user moved to the site
|
109 |
-
* @param string $urm_source
|
110 |
-
*/
|
111 |
-
|
112 |
-
return apply_filters('wbcr/clearfy/webcraftic_site_page_url', $url, $raw_url, $plugin_name, $page, $utm_content, $urm_source);
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Recursive sanitation for an array
|
117 |
-
*
|
118 |
-
* @param $array
|
119 |
-
* @since 2.0.5
|
120 |
-
* @return mixed
|
121 |
-
*/
|
122 |
-
public static function recursiveSanitizeArray($array, $function)
|
123 |
-
{
|
124 |
-
foreach($array as $key => &$value) {
|
125 |
-
if( is_array($value) ) {
|
126 |
-
$value = self::recursiveSanitizeArray($value, $function);
|
127 |
-
} else {
|
128 |
-
if( function_exists($function) ) {
|
129 |
-
$value = $function($value);
|
130 |
-
}
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
return $array;
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Is permalink enabled?
|
139 |
-
* @global WP_Rewrite $wp_rewrite
|
140 |
-
* @since 1.0.0
|
141 |
-
* @return bool
|
142 |
-
*/
|
143 |
-
public static function isPermalink()
|
144 |
-
{
|
145 |
-
global $wp_rewrite;
|
146 |
-
|
147 |
-
if( !isset($wp_rewrite) || !is_object($wp_rewrite) || !$wp_rewrite->using_permalinks() ) {
|
148 |
-
return false;
|
149 |
-
}
|
150 |
-
|
151 |
-
return true;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Display 404 page to bump bots and bad guys
|
156 |
-
*
|
157 |
-
* @param bool $simple If true force displaying basic 404 page
|
158 |
-
*/
|
159 |
-
public static function setError404()
|
160 |
-
{
|
161 |
-
global $wp_query;
|
162 |
-
|
163 |
-
if( function_exists('status_header') ) {
|
164 |
-
status_header('404');
|
165 |
-
nocache_headers();
|
166 |
-
}
|
167 |
-
|
168 |
-
if( $wp_query && is_object($wp_query) ) {
|
169 |
-
$wp_query->set_404();
|
170 |
-
get_template_part(404);
|
171 |
-
} else {
|
172 |
-
global $pagenow;
|
173 |
-
|
174 |
-
$pagenow = 'index.php';
|
175 |
-
|
176 |
-
if( !defined('WP_USE_THEMES') ) {
|
177 |
-
define('WP_USE_THEMES', true);
|
178 |
-
}
|
179 |
-
|
180 |
-
wp();
|
181 |
-
|
182 |
-
$_SERVER['REQUEST_URI'] = self::userTrailingslashit('/hmwp_404');
|
183 |
-
|
184 |
-
require_once(ABSPATH . WPINC . '/template-loader.php');
|
185 |
-
}
|
186 |
-
|
187 |
-
exit();
|
188 |
-
}
|
189 |
-
|
190 |
-
public static function useTrailingSlashes()
|
191 |
-
{
|
192 |
-
return ('/' === substr(get_option('permalink_structure'), -1, 1));
|
193 |
-
}
|
194 |
-
|
195 |
-
public static function userTrailingslashit($string)
|
196 |
-
{
|
197 |
-
return self::useTrailingSlashes() ? trailingslashit($string) : untrailingslashit($string);
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* Returns true if a needle can be found in a haystack
|
202 |
-
*
|
203 |
-
* @param string $string
|
204 |
-
* @param string $find
|
205 |
-
* @param bool $case_sensitive
|
206 |
-
* @return bool
|
207 |
-
*/
|
208 |
-
public static function strContains($string, $find, $case_sensitive = true)
|
209 |
-
{
|
210 |
-
if( empty($string) || empty($find) ) {
|
211 |
-
return false;
|
212 |
-
}
|
213 |
-
|
214 |
-
$pos = $case_sensitive ? strpos($string, $find) : stripos($string, $find);
|
215 |
-
|
216 |
-
return !($pos === false);
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Tests if a text starts with an given string.
|
221 |
-
*
|
222 |
-
* @param string $string
|
223 |
-
* @param string $find
|
224 |
-
* @param bool $case_sensitive
|
225 |
-
* @return bool
|
226 |
-
*/
|
227 |
-
public static function strStartsWith($string, $find, $case_sensitive = true)
|
228 |
-
{
|
229 |
-
if( $case_sensitive ) {
|
230 |
-
return strpos($string, $find) === 0;
|
231 |
-
}
|
232 |
-
|
233 |
-
return stripos($string, $find) === 0;
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* Tests if a text ends with an given string.
|
238 |
-
*
|
239 |
-
* @param $string
|
240 |
-
* @param $find
|
241 |
-
* @param bool $case_sensitive
|
242 |
-
* @return bool
|
243 |
-
*/
|
244 |
-
public static function strEndsWith($string, $find, $case_sensitive = true)
|
245 |
-
{
|
246 |
-
$expected_position = strlen($string) - strlen($find);
|
247 |
-
|
248 |
-
if( $case_sensitive ) {
|
249 |
-
return strrpos($string, $find, 0) === $expected_position;
|
250 |
-
}
|
251 |
-
|
252 |
-
return strripos($string, $find, 0) === $expected_position;
|
253 |
-
}
|
254 |
-
|
255 |
-
public static function arrayMergeInsert(array $arr, array $inserted, $position = 'bottom', $key = null)
|
256 |
-
{
|
257 |
-
if( $position == 'top' ) {
|
258 |
-
return array_merge($inserted, $arr);
|
259 |
-
}
|
260 |
-
$key_position = ($key === null) ? false : array_search($key, array_keys($arr));
|
261 |
-
if( $key_position === false OR ($position != 'before' AND $position != 'after') ) {
|
262 |
-
return array_merge($arr, $inserted);
|
263 |
-
}
|
264 |
-
if( $position == 'after' ) {
|
265 |
-
$key_position++;
|
266 |
-
}
|
267 |
-
|
268 |
-
return array_merge(array_slice($arr, 0, $key_position, true), $inserted, array_slice($arr, $key_position, null, true));
|
269 |
-
}
|
270 |
-
|
271 |
-
public static function maybeGetPostJson($name)
|
272 |
-
{
|
273 |
-
if( isset($_POST[$name]) AND is_string($_POST[$name]) ) {
|
274 |
-
$result = json_decode(stripslashes($_POST[$name]), true);
|
275 |
-
if( !is_array($result) ) {
|
276 |
-
$result = array();
|
277 |
-
}
|
278 |
-
|
279 |
-
return $result;
|
280 |
-
} else {
|
281 |
-
return array();
|
282 |
-
}
|
283 |
-
}
|
284 |
-
|
285 |
-
public static function getEscapeJson(array $data)
|
286 |
-
{
|
287 |
-
return htmlspecialchars(json_encode($data), ENT_QUOTES, 'UTF-8');
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* Replace url for multisite
|
292 |
-
*
|
293 |
-
* @param $string
|
294 |
-
*
|
295 |
-
* @return string
|
296 |
-
*/
|
297 |
-
public static function replaceMsUrl($string)
|
298 |
-
{
|
299 |
-
if( is_multisite() && BLOG_ID_CURRENT_SITE != get_current_blog_id() ) {
|
300 |
-
return str_replace(get_site_url(BLOG_ID_CURRENT_SITE), get_site_url(get_current_blog_id()), $string);
|
301 |
-
}
|
302 |
-
|
303 |
-
return $string;
|
304 |
-
}
|
305 |
-
|
306 |
-
/*
|
307 |
-
* Flushes as many page cache plugin's caches as possible.
|
308 |
-
*
|
309 |
-
* @return void
|
310 |
-
*/
|
311 |
-
public static function flushPageCache()
|
312 |
-
{
|
313 |
-
if( function_exists('wp_cache_clear_cache') ) {
|
314 |
-
if( is_multisite() ) {
|
315 |
-
$blog_id = get_current_blog_id();
|
316 |
-
wp_cache_clear_cache($blog_id);
|
317 |
-
} else {
|
318 |
-
wp_cache_clear_cache();
|
319 |
-
}
|
320 |
-
} elseif( has_action('cachify_flush_cache') ) {
|
321 |
-
do_action('cachify_flush_cache');
|
322 |
-
} elseif( function_exists('w3tc_pgcache_flush') ) {
|
323 |
-
w3tc_pgcache_flush();
|
324 |
-
} elseif( function_exists('wp_fast_cache_bulk_delete_all') ) {
|
325 |
-
wp_fast_cache_bulk_delete_all();
|
326 |
-
} elseif( class_exists('WpFastestCache') ) {
|
327 |
-
$wpfc = new WpFastestCache();
|
328 |
-
$wpfc->deleteCache();
|
329 |
-
} elseif( class_exists('c_ws_plugin__qcache_purging_routines') ) {
|
330 |
-
c_ws_plugin__qcache_purging_routines::purge_cache_dir(); // quick cache
|
331 |
-
} elseif( class_exists('zencache') ) {
|
332 |
-
zencache::clear();
|
333 |
-
} elseif( class_exists('comet_cache') ) {
|
334 |
-
comet_cache::clear();
|
335 |
-
} elseif( class_exists('WpeCommon') ) {
|
336 |
-
// WPEngine cache purge/flush methods to call by default
|
337 |
-
$wpe_methods = array(
|
338 |
-
'purge_varnish_cache',
|
339 |
-
);
|
340 |
-
|
341 |
-
// More agressive clear/flush/purge behind a filter
|
342 |
-
if( apply_filters('wbcr/factory/flush_wpengine_aggressive', false) ) {
|
343 |
-
$wpe_methods = array_merge($wpe_methods, array('purge_memcached', 'clear_maxcdn_cache'));
|
344 |
-
}
|
345 |
-
|
346 |
-
// Filtering the entire list of WpeCommon methods to be called (for advanced usage + easier testing)
|
347 |
-
$wpe_methods = apply_filters('wbcr/factory/wpengine_methods', $wpe_methods);
|
348 |
-
|
349 |
-
foreach($wpe_methods as $wpe_method) {
|
350 |
-
if( method_exists('WpeCommon', $wpe_method) ) {
|
351 |
-
WpeCommon::$wpe_method();
|
352 |
-
}
|
353 |
-
}
|
354 |
-
} elseif( function_exists('sg_cachepress_purge_cache') ) {
|
355 |
-
sg_cachepress_purge_cache();
|
356 |
-
} elseif( file_exists(WP_CONTENT_DIR . '/wp-cache-config.php') && function_exists('prune_super_cache') ) {
|
357 |
-
// fallback for WP-Super-Cache
|
358 |
-
global $cache_path;
|
359 |
-
if( is_multisite() ) {
|
360 |
-
$blog_id = get_current_blog_id();
|
361 |
-
prune_super_cache(get_supercache_dir($blog_id), true);
|
362 |
-
prune_super_cache($cache_path . 'blogs/', true);
|
363 |
-
} else {
|
364 |
-
prune_super_cache($cache_path . 'supercache/', true);
|
365 |
-
prune_super_cache($cache_path, true);
|
366 |
-
}
|
367 |
-
}
|
368 |
-
}
|
369 |
-
}
|
370 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/factory/clearfy/includes/class-configurate.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Configurate clearfy plugins
|
9 |
+
*
|
10 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
11 |
+
* @since 1.0.0
|
12 |
+
* @package clearfy
|
13 |
+
* @copyright (c) 2018, Webcraftic Ltd
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
abstract class Wbcr_FactoryClearfy217_Configurate {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
20 |
+
*/
|
21 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
22 |
+
$this->plugin = $plugin;
|
23 |
+
$this->registerActionsAndFilters();
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Registers filters and actions
|
28 |
+
*
|
29 |
+
* @return mixed
|
30 |
+
*/
|
31 |
+
abstract protected function registerActionsAndFilters();
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get options with namespace
|
35 |
+
*
|
36 |
+
* @param $option_name
|
37 |
+
* @param bool $default
|
38 |
+
*
|
39 |
+
* @return mixed|void
|
40 |
+
*/
|
41 |
+
public function getPopulateOption( $option_name, $default = false ) {
|
42 |
+
return $this->plugin->getPopulateOption( $option_name, $default );
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get options with namespace
|
47 |
+
*
|
48 |
+
* @param $option_name
|
49 |
+
* @param bool $default
|
50 |
+
*
|
51 |
+
* @return mixed|void
|
52 |
+
*/
|
53 |
+
public function getOption( $option_name, $default = false ) {
|
54 |
+
return $this->plugin->getOption( $option_name, $default );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Get network options with namespace
|
59 |
+
*
|
60 |
+
* @param $option_name
|
61 |
+
* @param bool $default
|
62 |
+
*
|
63 |
+
* @return mixed|void
|
64 |
+
*/
|
65 |
+
public function getNetworkOption( $option_name, $default = false ) {
|
66 |
+
return $this->plugin->getNetworkOption( $option_name, $default );
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @param $option_name
|
71 |
+
* @param $value
|
72 |
+
*
|
73 |
+
* @return bool
|
74 |
+
*/
|
75 |
+
public function updatePopulateOption( $option_name, $value ) {
|
76 |
+
$this->plugin->updatePopulateOption( $option_name, $value );
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @param $option_name
|
81 |
+
* @param $value
|
82 |
+
*
|
83 |
+
* @return bool
|
84 |
+
*/
|
85 |
+
public function updateNetworkOption( $option_name, $value ) {
|
86 |
+
$this->plugin->updateNetworkOption( $option_name, $value );
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* @param $option_name
|
91 |
+
* @param $value
|
92 |
+
*
|
93 |
+
* @return bool
|
94 |
+
*/
|
95 |
+
public function updateOption( $option_name, $value ) {
|
96 |
+
$this->plugin->updateOption( $option_name, $value );
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @param $option_name
|
101 |
+
*
|
102 |
+
* @return bool
|
103 |
+
*/
|
104 |
+
public function deletePopulateOption( $option_name ) {
|
105 |
+
$this->plugin->deletePopulateOption( $option_name );
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* @param $option_name
|
110 |
+
*
|
111 |
+
* @return bool
|
112 |
+
*/
|
113 |
+
public function deleteOption( $option_name ) {
|
114 |
+
$this->plugin->deleteOption( $option_name );
|
115 |
+
}
|
116 |
+
}
|
libs/factory/clearfy/includes/class-helpers.php
ADDED
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Helpers functions
|
10 |
+
*
|
11 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
12 |
+
* @since 1.0.0
|
13 |
+
* @package clearfy
|
14 |
+
* @copyright (c) 2018, Webcraftic Ltd
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
class WbcrFactoryClearfy217_Helpers {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Recursive sanitation for an array
|
21 |
+
*
|
22 |
+
* @since 2.0.5
|
23 |
+
*
|
24 |
+
* @param $array
|
25 |
+
*
|
26 |
+
* @return mixed
|
27 |
+
*/
|
28 |
+
public static function recursiveSanitizeArray( $array, $function ) {
|
29 |
+
foreach ( $array as $key => &$value ) {
|
30 |
+
if ( is_array( $value ) ) {
|
31 |
+
$value = self::recursiveSanitizeArray( $value, $function );
|
32 |
+
} else {
|
33 |
+
if ( function_exists( $function ) ) {
|
34 |
+
$value = $function( $value );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
return $array;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Is permalink enabled?
|
44 |
+
*
|
45 |
+
* @since 1.0.0
|
46 |
+
* @return bool
|
47 |
+
* @global WP_Rewrite $wp_rewrite
|
48 |
+
*/
|
49 |
+
public static function isPermalink() {
|
50 |
+
global $wp_rewrite;
|
51 |
+
|
52 |
+
if ( ! isset( $wp_rewrite ) || ! is_object( $wp_rewrite ) || ! $wp_rewrite->using_permalinks() ) {
|
53 |
+
return false;
|
54 |
+
}
|
55 |
+
|
56 |
+
return true;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Display 404 page to bump bots and bad guys
|
61 |
+
*
|
62 |
+
* @param bool $simple If true force displaying basic 404 page
|
63 |
+
*/
|
64 |
+
public static function setError404() {
|
65 |
+
global $wp_query;
|
66 |
+
|
67 |
+
if ( function_exists( 'status_header' ) ) {
|
68 |
+
status_header( '404' );
|
69 |
+
nocache_headers();
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( $wp_query && is_object( $wp_query ) ) {
|
73 |
+
$wp_query->set_404();
|
74 |
+
get_template_part( 404 );
|
75 |
+
} else {
|
76 |
+
global $pagenow;
|
77 |
+
|
78 |
+
$pagenow = 'index.php';
|
79 |
+
|
80 |
+
if ( ! defined( 'WP_USE_THEMES' ) ) {
|
81 |
+
define( 'WP_USE_THEMES', true );
|
82 |
+
}
|
83 |
+
|
84 |
+
wp();
|
85 |
+
|
86 |
+
$_SERVER['REQUEST_URI'] = self::userTrailingslashit( '/hmwp_404' );
|
87 |
+
|
88 |
+
require_once( ABSPATH . WPINC . '/template-loader.php' );
|
89 |
+
}
|
90 |
+
|
91 |
+
exit();
|
92 |
+
}
|
93 |
+
|
94 |
+
public static function useTrailingSlashes() {
|
95 |
+
return ( '/' === substr( get_option( 'permalink_structure' ), - 1, 1 ) );
|
96 |
+
}
|
97 |
+
|
98 |
+
public static function userTrailingslashit( $string ) {
|
99 |
+
return self::useTrailingSlashes() ? trailingslashit( $string ) : untrailingslashit( $string );
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Returns true if a needle can be found in a haystack
|
104 |
+
*
|
105 |
+
* @param string $string
|
106 |
+
* @param string $find
|
107 |
+
* @param bool $case_sensitive
|
108 |
+
*
|
109 |
+
* @return bool
|
110 |
+
*/
|
111 |
+
public static function strContains( $string, $find, $case_sensitive = true ) {
|
112 |
+
if ( empty( $string ) || empty( $find ) ) {
|
113 |
+
return false;
|
114 |
+
}
|
115 |
+
|
116 |
+
$pos = $case_sensitive ? strpos( $string, $find ) : stripos( $string, $find );
|
117 |
+
|
118 |
+
return ! ( $pos === false );
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Tests if a text starts with an given string.
|
123 |
+
*
|
124 |
+
* @param string $string
|
125 |
+
* @param string $find
|
126 |
+
* @param bool $case_sensitive
|
127 |
+
*
|
128 |
+
* @return bool
|
129 |
+
*/
|
130 |
+
public static function strStartsWith( $string, $find, $case_sensitive = true ) {
|
131 |
+
if ( $case_sensitive ) {
|
132 |
+
return strpos( $string, $find ) === 0;
|
133 |
+
}
|
134 |
+
|
135 |
+
return stripos( $string, $find ) === 0;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Tests if a text ends with an given string.
|
140 |
+
*
|
141 |
+
* @param $string
|
142 |
+
* @param $find
|
143 |
+
* @param bool $case_sensitive
|
144 |
+
*
|
145 |
+
* @return bool
|
146 |
+
*/
|
147 |
+
public static function strEndsWith( $string, $find, $case_sensitive = true ) {
|
148 |
+
$expected_position = strlen( $string ) - strlen( $find );
|
149 |
+
|
150 |
+
if ( $case_sensitive ) {
|
151 |
+
return strrpos( $string, $find, 0 ) === $expected_position;
|
152 |
+
}
|
153 |
+
|
154 |
+
return strripos( $string, $find, 0 ) === $expected_position;
|
155 |
+
}
|
156 |
+
|
157 |
+
public static function arrayMergeInsert( array $arr, array $inserted, $position = 'bottom', $key = null ) {
|
158 |
+
if ( $position == 'top' ) {
|
159 |
+
return array_merge( $inserted, $arr );
|
160 |
+
}
|
161 |
+
$key_position = ( $key === null ) ? false : array_search( $key, array_keys( $arr ) );
|
162 |
+
if ( $key_position === false OR ( $position != 'before' AND $position != 'after' ) ) {
|
163 |
+
return array_merge( $arr, $inserted );
|
164 |
+
}
|
165 |
+
if ( $position == 'after' ) {
|
166 |
+
$key_position ++;
|
167 |
+
}
|
168 |
+
|
169 |
+
return array_merge( array_slice( $arr, 0, $key_position, true ), $inserted, array_slice( $arr, $key_position, null, true ) );
|
170 |
+
}
|
171 |
+
|
172 |
+
public static function maybeGetPostJson( $name ) {
|
173 |
+
if ( isset( $_POST[ $name ] ) AND is_string( $_POST[ $name ] ) ) {
|
174 |
+
$result = json_decode( stripslashes( $_POST[ $name ] ), true );
|
175 |
+
if ( ! is_array( $result ) ) {
|
176 |
+
$result = [];
|
177 |
+
}
|
178 |
+
|
179 |
+
return $result;
|
180 |
+
} else {
|
181 |
+
return [];
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
public static function getEscapeJson( array $data ) {
|
186 |
+
return htmlspecialchars( json_encode( $data ), ENT_QUOTES, 'UTF-8' );
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Replace url for multisite
|
191 |
+
*
|
192 |
+
* @param $string
|
193 |
+
*
|
194 |
+
* @return string
|
195 |
+
*/
|
196 |
+
public static function replaceMsUrl( $string ) {
|
197 |
+
if ( is_multisite() && BLOG_ID_CURRENT_SITE != get_current_blog_id() ) {
|
198 |
+
return str_replace( get_site_url( BLOG_ID_CURRENT_SITE ), get_site_url( get_current_blog_id() ), $string );
|
199 |
+
}
|
200 |
+
|
201 |
+
return $string;
|
202 |
+
}
|
203 |
+
|
204 |
+
/*
|
205 |
+
* Flushes as many page cache plugin's caches as possible.
|
206 |
+
*
|
207 |
+
* @return void
|
208 |
+
*/
|
209 |
+
public static function flushPageCache() {
|
210 |
+
if ( function_exists( 'wp_cache_clear_cache' ) ) {
|
211 |
+
if ( is_multisite() ) {
|
212 |
+
$blog_id = get_current_blog_id();
|
213 |
+
wp_cache_clear_cache( $blog_id );
|
214 |
+
} else {
|
215 |
+
wp_cache_clear_cache();
|
216 |
+
}
|
217 |
+
} else if ( has_action( 'cachify_flush_cache' ) ) {
|
218 |
+
do_action( 'cachify_flush_cache' );
|
219 |
+
} else if ( function_exists( 'w3tc_pgcache_flush' ) ) {
|
220 |
+
w3tc_pgcache_flush();
|
221 |
+
} else if ( function_exists( 'wp_fast_cache_bulk_delete_all' ) ) {
|
222 |
+
wp_fast_cache_bulk_delete_all();
|
223 |
+
} else if ( class_exists( 'WpFastestCache' ) ) {
|
224 |
+
$wpfc = new WpFastestCache();
|
225 |
+
$wpfc->deleteCache();
|
226 |
+
} else if ( class_exists( 'c_ws_plugin__qcache_purging_routines' ) ) {
|
227 |
+
c_ws_plugin__qcache_purging_routines::purge_cache_dir(); // quick cache
|
228 |
+
} else if ( class_exists( 'zencache' ) ) {
|
229 |
+
zencache::clear();
|
230 |
+
} else if ( class_exists( 'comet_cache' ) ) {
|
231 |
+
comet_cache::clear();
|
232 |
+
} else if ( class_exists( 'WpeCommon' ) ) {
|
233 |
+
// WPEngine cache purge/flush methods to call by default
|
234 |
+
$wpe_methods = [
|
235 |
+
'purge_varnish_cache',
|
236 |
+
];
|
237 |
+
|
238 |
+
// More agressive clear/flush/purge behind a filter
|
239 |
+
if ( apply_filters( 'wbcr/factory/flush_wpengine_aggressive', false ) ) {
|
240 |
+
$wpe_methods = array_merge( $wpe_methods, [ 'purge_memcached', 'clear_maxcdn_cache' ] );
|
241 |
+
}
|
242 |
+
|
243 |
+
// Filtering the entire list of WpeCommon methods to be called (for advanced usage + easier testing)
|
244 |
+
$wpe_methods = apply_filters( 'wbcr/factory/wpengine_methods', $wpe_methods );
|
245 |
+
|
246 |
+
foreach ( $wpe_methods as $wpe_method ) {
|
247 |
+
if ( method_exists( 'WpeCommon', $wpe_method ) ) {
|
248 |
+
WpeCommon::$wpe_method();
|
249 |
+
}
|
250 |
+
}
|
251 |
+
} else if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
|
252 |
+
sg_cachepress_purge_cache();
|
253 |
+
} else if ( file_exists( WP_CONTENT_DIR . '/wp-cache-config.php' ) && function_exists( 'prune_super_cache' ) ) {
|
254 |
+
// fallback for WP-Super-Cache
|
255 |
+
global $cache_path;
|
256 |
+
if ( is_multisite() ) {
|
257 |
+
$blog_id = get_current_blog_id();
|
258 |
+
prune_super_cache( get_supercache_dir( $blog_id ), true );
|
259 |
+
prune_super_cache( $cache_path . 'blogs/', true );
|
260 |
+
} else {
|
261 |
+
prune_super_cache( $cache_path . 'supercache/', true );
|
262 |
+
prune_super_cache( $cache_path, true );
|
263 |
+
}
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
libs/factory/clearfy/langs/index.php
DELETED
File without changes
|
libs/factory/clearfy/langs/{wbcr_factory_clearfy_209-ru_RU.mo → wbcr_factory_clearfy_217-ru_RU.mo}
RENAMED
File without changes
|
libs/factory/clearfy/langs/{wbcr_factory_clearfy_209-ru_RU.po → wbcr_factory_clearfy_217-ru_RU.po}
RENAMED
File without changes
|
libs/factory/clearfy/pages/class-clearfy-license.php
DELETED
@@ -1,363 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Exit if accessed directly
|
4 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
-
exit;
|
6 |
-
}
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Class Wbcr_FactoryLicense000_LicensePage is used as template to display form to active premium functionality.
|
10 |
-
*
|
11 |
-
* @since 2.0.7
|
12 |
-
*/
|
13 |
-
class Wbcr_FactoryClearfy209_LicensePage extends Wbcr_FactoryClearfy209_PageBase {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* {@inheritdoc}
|
17 |
-
*/
|
18 |
-
public $type = "page";
|
19 |
-
|
20 |
-
/**
|
21 |
-
* {@inheritdoc}
|
22 |
-
*/
|
23 |
-
public $page_menu_dashicon = 'dashicons-admin-network';
|
24 |
-
|
25 |
-
/**
|
26 |
-
* {@inheritdoc}
|
27 |
-
*/
|
28 |
-
public $show_right_sidebar_in_options = false;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* {@inheritdoc}
|
32 |
-
*/
|
33 |
-
public $page_menu_position = 0;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* {@inheritdoc}
|
37 |
-
*/
|
38 |
-
public $available_for_multisite = true;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @var string Name of the paid plan.
|
42 |
-
*/
|
43 |
-
public $plan_name;
|
44 |
-
|
45 |
-
// PREMIUM SECTION
|
46 |
-
// ------------------------------------------------------------------
|
47 |
-
/**
|
48 |
-
* @since 2.0.7
|
49 |
-
* @var bool
|
50 |
-
*/
|
51 |
-
protected $is_premium;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @since 2.0.7
|
55 |
-
* @var \WBCR\Factory_414\Premium\Provider
|
56 |
-
*/
|
57 |
-
protected $premium;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* @since 2.0.7
|
61 |
-
* @var bool
|
62 |
-
*/
|
63 |
-
protected $is_premium_active;
|
64 |
-
|
65 |
-
/**
|
66 |
-
* @since 2.0.7
|
67 |
-
* @var bool
|
68 |
-
*/
|
69 |
-
protected $premium_has_subscription;
|
70 |
-
|
71 |
-
/**
|
72 |
-
* @since 2.0.7
|
73 |
-
* @var \WBCR\Factory_414\Premium\Interfaces\License
|
74 |
-
*/
|
75 |
-
protected $premium_license;
|
76 |
-
|
77 |
-
// END PREMIUM SECTION
|
78 |
-
// ------------------------------------------------------------------
|
79 |
-
|
80 |
-
/**
|
81 |
-
* {@inheritdoc}
|
82 |
-
* @param Wbcr_Factory414_Plugin $plugin
|
83 |
-
*/
|
84 |
-
public function __construct( Wbcr_Factory414_Plugin $plugin ) {
|
85 |
-
$this->plugin = $plugin;
|
86 |
-
|
87 |
-
parent::__construct( $plugin );
|
88 |
-
|
89 |
-
if ( ! $this->id ) {
|
90 |
-
$this->id = $this->plugin->getPrefix() . 'license';
|
91 |
-
}
|
92 |
-
$this->premium = WRIO_Plugin::app()->premium;
|
93 |
-
$this->is_premium = $this->premium->is_activate();
|
94 |
-
$this->is_premium_active = $this->premium->is_active();
|
95 |
-
$this->premium_has_subscription = $this->premium->has_paid_subscription();
|
96 |
-
$this->premium_license = $this->premium->get_license();
|
97 |
-
|
98 |
-
add_action( 'wp_ajax_wbcr-clearfy-activate-license', array( $this, 'ajax_handler' ) );
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* [MAGIC] Magic method that configures assets for a page.
|
103 |
-
*/
|
104 |
-
public function assets( $scripts, $styles ) {
|
105 |
-
parent::assets( $scripts, $styles );
|
106 |
-
|
107 |
-
$this->styles->add( FACTORY_CLEARFY_209_URL . '/assets/css/license-manager.css' );
|
108 |
-
$this->scripts->add( FACTORY_CLEARFY_209_URL . '/assets/js/license-manager.js' );
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Регистрируем ajax обработчик для текущей страницы
|
113 |
-
* @since 2.0.7
|
114 |
-
*/
|
115 |
-
public function ajax_handler() {
|
116 |
-
wbcr_factory_clearfy_209_check_license( $this->plugin );
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* {@inheritdoc}
|
121 |
-
*/
|
122 |
-
public function showPageContent() {
|
123 |
-
?>
|
124 |
-
<?php wp_nonce_field( 'license' ); ?>
|
125 |
-
<div id="wcl-license-wrapper"
|
126 |
-
data-loader="<?php echo FACTORY_CLEARFY_209_URL . '/assets/img/loader.gif'; ?>"
|
127 |
-
data-plugin="<?php echo get_class( $this->plugin ) ?>">
|
128 |
-
<?php $this->show_license_form(); ?>
|
129 |
-
</div>
|
130 |
-
<?php
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Get before content.
|
135 |
-
*
|
136 |
-
* @return string Before content.
|
137 |
-
*/
|
138 |
-
protected function get_plan_description() {
|
139 |
-
return '';
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* @return string
|
144 |
-
*/
|
145 |
-
protected function get_hidden_license_key() {
|
146 |
-
if ( ! $this->is_premium ) {
|
147 |
-
return '';
|
148 |
-
}
|
149 |
-
|
150 |
-
return $this->premium_license->get_hidden_key();
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @return string
|
155 |
-
*/
|
156 |
-
protected function get_plan() {
|
157 |
-
if ( ! $this->is_premium ) {
|
158 |
-
return 'free';
|
159 |
-
}
|
160 |
-
|
161 |
-
return $this->premium->get_plan();
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* @return mixed
|
166 |
-
*/
|
167 |
-
protected function get_expiration_days() {
|
168 |
-
return $this->premium_license->get_expiration_time( 'days' );
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* @return string
|
173 |
-
*/
|
174 |
-
protected function get_billing_cycle_readable() {
|
175 |
-
if ( ! $this->is_premium ) {
|
176 |
-
return '';
|
177 |
-
}
|
178 |
-
|
179 |
-
$billing_cycle = $this->premium->get_billing_cycle();
|
180 |
-
$billing = 'lifetime';
|
181 |
-
|
182 |
-
if ( 1 == $billing_cycle ) {
|
183 |
-
$billing = 'month';
|
184 |
-
} else if ( 12 == $billing_cycle ) {
|
185 |
-
$billing = 'year';
|
186 |
-
}
|
187 |
-
|
188 |
-
return $billing;
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Тип лицензии, цветовое оформление для формы лицензирования
|
193 |
-
* free - бесплатная
|
194 |
-
* gift - пожизненная лицензия, лицензия на особых условиях
|
195 |
-
* trial - красный цвет, применяется для триалов, если лиценизия истекла или заблокирована
|
196 |
-
* paid - обычная оплаченная лицензия, в данный момент активна.
|
197 |
-
*
|
198 |
-
* @return string
|
199 |
-
*/
|
200 |
-
protected function get_license_type() {
|
201 |
-
if ( ! $this->is_premium ) {
|
202 |
-
return 'free';
|
203 |
-
}
|
204 |
-
|
205 |
-
$license = $this->premium_license;
|
206 |
-
|
207 |
-
if ( $license->is_lifetime() ) {
|
208 |
-
return 'gift';
|
209 |
-
} else if ( $license->get_expiration_time( 'days' ) < 1 ) {
|
210 |
-
return 'trial';
|
211 |
-
}
|
212 |
-
|
213 |
-
return 'paid';
|
214 |
-
}
|
215 |
-
|
216 |
-
/**
|
217 |
-
* @param bool|WP_Error $notice
|
218 |
-
*/
|
219 |
-
public function show_license_form( $notice = false ) {
|
220 |
-
?>
|
221 |
-
<div class="factory-bootstrap-414 onp-page-wrap <?= $this->get_license_type() ?>-license-manager-content"
|
222 |
-
id="license-manager">
|
223 |
-
<div>
|
224 |
-
<h3><?php printf( __( 'Activate %s', 'wbcr_factory_clearfy_209' ), $this->plan_name ) ?></h3>
|
225 |
-
<?php echo $this->get_plan_description() ?>
|
226 |
-
</div>
|
227 |
-
<br>
|
228 |
-
<?php if ( is_wp_error( $notice ) ) : ?>
|
229 |
-
<div class="license-message <?= $this->get_license_type() ?>-license-message">
|
230 |
-
<div class="alert <?php echo esc_attr( $notice->get_error_code() ); ?>">
|
231 |
-
<h4 class="alert-heading"><?php _e( $notice->get_error_message(), 'wbcr_factory_clearfy_209' ) ?></h4>
|
232 |
-
</div>
|
233 |
-
</div>
|
234 |
-
<?php endif; ?>
|
235 |
-
<div class="onp-container">
|
236 |
-
<div class="license-details">
|
237 |
-
<?php if ( $this->get_license_type() == 'free' ): ?>
|
238 |
-
<a href="<?php echo $this->plugin->get_support()->get_pricing_url( true, 'license_page' ); ?>"
|
239 |
-
class="purchase-premium" target="_blank" rel="noopener">
|
240 |
-
<span class="btn btn-gold btn-inner-wrap">
|
241 |
-
<?php printf( __( 'Upgrade to Premium for $%s', 'wbcr_factory_clearfy_209' ), $this->premium->get_price() ) ?>
|
242 |
-
</span>
|
243 |
-
</a>
|
244 |
-
<p><?php printf( __( 'Your current license for %1$s:', 'wbcr_factory_clearfy_209' ), $this->plugin->getPluginTitle() ) ?></p>
|
245 |
-
<?php endif; ?>
|
246 |
-
<div class="license-details-block <?= $this->get_license_type() ?>-details-block">
|
247 |
-
<?php if ( $this->is_premium ): ?>
|
248 |
-
<a data-action="deactivate" href="#"
|
249 |
-
class="btn btn-default btn-small license-delete-button wcl-control-btn">
|
250 |
-
<?php _e( 'Delete Key', 'wbcr_factory_clearfy_209' ) ?>
|
251 |
-
</a>
|
252 |
-
<a data-action="sync" href="#"
|
253 |
-
class="btn btn-default btn-small license-synchronization-button wcl-control-btn">
|
254 |
-
<?php _e( 'Synchronization', 'wbcr_factory_clearfy_209' ) ?>
|
255 |
-
</a>
|
256 |
-
<?php endif; ?>
|
257 |
-
<h3>
|
258 |
-
<?php echo ucfirst( $this->get_plan() ); ?>
|
259 |
-
|
260 |
-
<?php if ( $this->is_premium && $this->premium_has_subscription ): ?>
|
261 |
-
<span style="font-size: 15px;">
|
262 |
-
(<?php printf( __( 'Automatic renewal, every %s', '' ), esc_attr( $this->get_billing_cycle_readable() ) ); ?>)
|
263 |
-
</span>
|
264 |
-
<?php endif; ?>
|
265 |
-
</h3>
|
266 |
-
<?php if ( $this->is_premium ): ?>
|
267 |
-
<div class="license-key-identity">
|
268 |
-
<code><?= esc_attr( $this->get_hidden_license_key() ) ?></code>
|
269 |
-
</div>
|
270 |
-
<?php endif; ?>
|
271 |
-
<div class="license-key-description">
|
272 |
-
<p><?php _e( 'Public License is a GPLv2 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.', 'wbcr_factory_clearfy_209' ) ?>
|
273 |
-
</p>
|
274 |
-
<?php if ( $this->is_premium && $this->premium_has_subscription ): ?>
|
275 |
-
<p class="activate-trial-hint">
|
276 |
-
<?php _e( 'You use a paid subscription for the plugin updates. In case you don’t want to receive paid updates, please, click <a data-action="unsubscribe" class="wcl-control-btn" href="#">cancel subscription</a>', 'wbcr_factory_clearfy_209' ) ?>
|
277 |
-
</p>
|
278 |
-
<?php endif; ?>
|
279 |
-
|
280 |
-
<?php if ( $this->get_license_type() == 'trial' ): ?>
|
281 |
-
<p class="activate-error-hint">
|
282 |
-
<?php printf( __( 'Your license has expired, please extend the license to get updates and support.', 'wbcr_factory_clearfy_209' ), '' ) ?>
|
283 |
-
</p>
|
284 |
-
<?php endif; ?>
|
285 |
-
</div>
|
286 |
-
<table class="license-params" colspacing="0" colpadding="0">
|
287 |
-
<tr>
|
288 |
-
<!--<td class="license-param license-param-domain">
|
289 |
-
<span class="license-value"><?php echo esc_attr( $_SERVER['SERVER_NAME'] ); ?></span>
|
290 |
-
<span class="license-value-name"><?php _e( 'domain', 'wbcr_factory_clearfy_209' ) ?></span>
|
291 |
-
</td>-->
|
292 |
-
<td class="license-param license-param-days">
|
293 |
-
<span class="license-value"><?= $this->get_plan() ?></span>
|
294 |
-
<span class="license-value-name"><?php _e( 'plan', 'wbcr_factory_clearfy_209' ) ?></span>
|
295 |
-
</td>
|
296 |
-
<?php if ( $this->is_premium ) : ?>
|
297 |
-
<td class="license-param license-param-sites">
|
298 |
-
<span class="license-value">
|
299 |
-
<?php echo esc_attr( $this->premium_license->get_count_active_sites() ); ?>
|
300 |
-
<?php _e( 'of', 'wbcr_factory_clearfy_209' ) ?>
|
301 |
-
<?php echo esc_attr( $this->premium_license->get_sites_quota() ); ?></span>
|
302 |
-
<span class="license-value-name"><?php _e( 'active sites', 'wbcr_factory_clearfy_209' ) ?></span>
|
303 |
-
</td>
|
304 |
-
<?php endif; ?>
|
305 |
-
<td class="license-param license-param-version">
|
306 |
-
<span class="license-value"><?= $this->plugin->getPluginVersion() ?></span>
|
307 |
-
<span class="license-value-name"><span>version</span></span>
|
308 |
-
</td>
|
309 |
-
<?php if ( $this->is_premium ): ?>
|
310 |
-
<td class="license-param license-param-days">
|
311 |
-
<?php if ( $this->get_license_type() == 'trial' ): ?>
|
312 |
-
<span class="license-value"><?php _e( 'EXPIRED!', 'wbcr_factory_clearfy_209' ) ?></span>
|
313 |
-
<span class="license-value-name"><?php _e( 'please update the key', 'wbcr_factory_clearfy_209' ) ?></span>
|
314 |
-
<?php else: ?>
|
315 |
-
<span class="license-value">
|
316 |
-
<?php
|
317 |
-
if ( $this->premium_license->is_lifetime() ) {
|
318 |
-
echo 'infiniate';
|
319 |
-
} else {
|
320 |
-
echo $this->get_expiration_days();
|
321 |
-
}
|
322 |
-
?>
|
323 |
-
<small> <?php _e( 'day(s)', 'wbcr_factory_clearfy_209' ) ?></small>
|
324 |
-
</span>
|
325 |
-
<span class="license-value-name"><?php _e( 'remained', 'wbcr_factory_clearfy_209' ) ?></span>
|
326 |
-
<?php endif; ?>
|
327 |
-
</td>
|
328 |
-
<?php endif; ?>
|
329 |
-
</tr>
|
330 |
-
</table>
|
331 |
-
</div>
|
332 |
-
</div>
|
333 |
-
<div class="license-input">
|
334 |
-
<form action="" method="post">
|
335 |
-
<?php if ( $this->is_premium ): ?>
|
336 |
-
<p><?php _e( 'Have a key to activate the premium version? Paste it here:', 'wbcr_factory_clearfy_209' ) ?><p>
|
337 |
-
<?php else: ?>
|
338 |
-
<p><?php _e( 'Have a key to activate the plugin? Paste it here:', 'wbcr_factory_clearfy_209' ) ?>
|
339 |
-
<p>
|
340 |
-
<?php endif; ?>
|
341 |
-
<button data-action="activate" class="btn btn-default wcl-control-btn" type="button"
|
342 |
-
id="license-submit">
|
343 |
-
<?php _e( 'Submit Key', 'wbcr_factory_clearfy_209' ) ?>
|
344 |
-
</button>
|
345 |
-
<div class="license-key-wrap">
|
346 |
-
<input type="text" id="license-key" name="licensekey" value="" class="form-control"/>
|
347 |
-
</div>
|
348 |
-
<?php if ( $this->is_premium ): ?>
|
349 |
-
<p style="margin-top: 10px;">
|
350 |
-
<?php printf( __( '<a href="%s" target="_blank" rel="noopener">Lean more</a> about the premium version and get the license key to activate it now!', 'wbcr_factory_clearfy_209' ), $this->plugin->get_support()->get_pricing_url( true, 'license_page' ) ); ?>
|
351 |
-
</p>
|
352 |
-
<?php else: ?>
|
353 |
-
<p style="margin-top: 10px;">
|
354 |
-
<?php printf( __( 'Can’t find your key? Go to <a href="%s" target="_blank" rel="noopener">this page</a> and login using the e-mail address associated with your purchase.', 'wbcr_factory_clearfy_209' ), $this->plugin->get_support()->get_contacts_url( true, 'license_page' ) ) ?>
|
355 |
-
</p>
|
356 |
-
<?php endif; ?>
|
357 |
-
</form>
|
358 |
-
</div>
|
359 |
-
</div>
|
360 |
-
</div>
|
361 |
-
<?php
|
362 |
-
}
|
363 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/factory/clearfy/pages/class-clearfy-more-features.php
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The page Settings.
|
4 |
-
*
|
5 |
-
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
6 |
-
* @copyright (c) 2018, Webcraftic Ltd
|
7 |
-
*
|
8 |
-
* @package clearfy
|
9 |
-
* @since 1.0.1
|
10 |
-
*/
|
11 |
-
|
12 |
-
// Exit if accessed directly
|
13 |
-
if( !defined('ABSPATH') ) {
|
14 |
-
exit;
|
15 |
-
}
|
16 |
-
|
17 |
-
if( !class_exists('Wbcr_FactoryClearfy209_MoreFeaturesPage') && class_exists('Wbcr_FactoryPages414_ImpressiveThemplate') ) {
|
18 |
-
|
19 |
-
class Wbcr_FactoryClearfy209_MoreFeaturesPage extends Wbcr_FactoryPages414_ImpressiveThemplate {
|
20 |
-
|
21 |
-
public $id = "more_features";
|
22 |
-
|
23 |
-
public $page_menu_dashicon = 'dashicons-star-filled wbcr-factory-orange-color';
|
24 |
-
|
25 |
-
public $page_menu_position = 5;
|
26 |
-
|
27 |
-
public $type = 'page';
|
28 |
-
|
29 |
-
public function __construct(Wbcr_Factory414_Plugin $plugin)
|
30 |
-
{
|
31 |
-
$this->menu_title = __('More features (<b>free</b>)', 'wbcr_factory_clearfy_209');
|
32 |
-
|
33 |
-
parent::__construct($plugin);
|
34 |
-
|
35 |
-
$this->plugin = $plugin;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getPageTitle()
|
39 |
-
{
|
40 |
-
return __('More features', 'wbcr_factory_clearfy_209');
|
41 |
-
}
|
42 |
-
|
43 |
-
public function showPageContent()
|
44 |
-
{
|
45 |
-
?>
|
46 |
-
<div class="row">
|
47 |
-
<div class="col-sm-4">
|
48 |
-
<div class="wbcr-factory-feature-box">
|
49 |
-
<span class="dashicons dashicons-yes"></span>
|
50 |
-
|
51 |
-
<h3><?php _e('Code cleaning', 'wbcr_factory_clearfy_209')?></h3>
|
52 |
-
|
53 |
-
<p><?php _e('Clears the source code of the page from unused code.', 'wbcr_factory_clearfy_209')?></p>
|
54 |
-
</div>
|
55 |
-
</div>
|
56 |
-
<div class="col-sm-4">
|
57 |
-
<div class="wbcr-factory-feature-box">
|
58 |
-
<span class="dashicons dashicons-chart-bar"></span>
|
59 |
-
|
60 |
-
<h3><?php _e('Improve SEO', 'wbcr_factory_clearfy_209')?></h3>
|
61 |
-
|
62 |
-
<p><?php _e('Removes duplicate pages, closes external links, changes the headers of the server.', 'wbcr_factory_clearfy_209')?></p>
|
63 |
-
</div>
|
64 |
-
</div>
|
65 |
-
<div class="col-sm-4">
|
66 |
-
<div class="wbcr-factory-feature-box">
|
67 |
-
<span class="dashicons dashicons-shield-alt"></span>
|
68 |
-
|
69 |
-
<h3><?php _e('Site protection', 'wbcr_factory_clearfy_209')?></h3>
|
70 |
-
|
71 |
-
<p><?php _e('Enables and disables features that improve the protection of your site.', 'wbcr_factory_clearfy_209')?></p>
|
72 |
-
</div>
|
73 |
-
</div>
|
74 |
-
<div class="col-sm-4">
|
75 |
-
<div class="wbcr-factory-feature-box">
|
76 |
-
<span class="dashicons dashicons-welcome-comments"></span>
|
77 |
-
|
78 |
-
<h3><?php _e('Disable comments', 'wbcr_factory_clearfy_209')?></h3>
|
79 |
-
|
80 |
-
<p><?php _e('Disables comments on the entire site or on specific pages.', 'wbcr_factory_clearfy_209')?></p>
|
81 |
-
</div>
|
82 |
-
</div>
|
83 |
-
<div class="col-sm-4">
|
84 |
-
<div class="wbcr-factory-feature-box">
|
85 |
-
<span class="dashicons dashicons-update"></span>
|
86 |
-
|
87 |
-
<h3><?php _e('Manage updates', 'wbcr_factory_clearfy_209')?></h3>
|
88 |
-
|
89 |
-
<p><?php _e('Enables or disables automatically updates for plugins, themes and core. It is also possible
|
90 |
-
to disable all updates.', 'wbcr_factory_clearfy_209')?></p>
|
91 |
-
</div>
|
92 |
-
</div>
|
93 |
-
<div class="col-sm-4">
|
94 |
-
<div class="wbcr-factory-feature-box">
|
95 |
-
<span class="dashicons dashicons-admin-plugins"></span>
|
96 |
-
|
97 |
-
<h3><?php _e('Manage widgets', 'wbcr_factory_clearfy_209')?></h3>
|
98 |
-
|
99 |
-
<p><?php _e('Allows you to remove unused widgets.', 'wbcr_factory_clearfy_209')?></p>
|
100 |
-
</div>
|
101 |
-
</div>
|
102 |
-
<div class="col-sm-4">
|
103 |
-
<div class="wbcr-factory-feature-box">
|
104 |
-
<span class="dashicons dashicons-dashboard"></span>
|
105 |
-
|
106 |
-
<h3><?php _e('Speed Optimization', 'wbcr_factory_clearfy_209')?></h3>
|
107 |
-
|
108 |
-
<p><?php _e('Increases performance by disabling unused functions and reducing the number of requests.', 'wbcr_factory_clearfy_209')?></p>
|
109 |
-
</div>
|
110 |
-
</div>
|
111 |
-
<div class="col-sm-4">
|
112 |
-
<div class="wbcr-factory-feature-box">
|
113 |
-
<span class="dashicons dashicons-visibility"></span>
|
114 |
-
|
115 |
-
<h3><?php _e('Site privacy', 'wbcr_factory_clearfy_209')?></h3>
|
116 |
-
|
117 |
-
<p><?php _e('Allows you to hide the version of the site and plugins. Allows you to hide your
|
118 |
-
WordPress.', 'wbcr_factory_clearfy_209')?></p>
|
119 |
-
</div>
|
120 |
-
</div>
|
121 |
-
<div class="col-sm-4">
|
122 |
-
<div class="wbcr-factory-feature-box">
|
123 |
-
<span class="dashicons dashicons-admin-settings"></span>
|
124 |
-
|
125 |
-
<h3><?php _e('Easy setup', 'wbcr_factory_clearfy_209')?></h3>
|
126 |
-
|
127 |
-
<p><?php _e('In quick mode, you can easily configure the plugin according to your needs.', 'wbcr_factory_clearfy_209')?></p>
|
128 |
-
</div>
|
129 |
-
</div>
|
130 |
-
</div>
|
131 |
-
|
132 |
-
<div class="wbcr-factory-buttons-wrap">
|
133 |
-
<?php
|
134 |
-
$url = 'https://clearfy.pro';
|
135 |
-
|
136 |
-
if( get_locale() == 'ru_RU' ) {
|
137 |
-
$url = 'https://ru.clearfy.pro';
|
138 |
-
}
|
139 |
-
$url .= '?utm_source=wordpress.org&utm_campaign=' . $this->plugin->getPluginName();
|
140 |
-
?>
|
141 |
-
<a href="<?= $url ?>" class="wbcr-factory-premium-button" target="_blank">
|
142 |
-
<?php _e('Get the ultimate plugin 100% FREE', 'wbcr_factory_clearfy_209')?>
|
143 |
-
</a>
|
144 |
-
</div>
|
145 |
-
<?php
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/factory/clearfy/pages/class-clearfy-pages.php
DELETED
@@ -1,385 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Общий класс прослойка для страниц Clearfy и его компоннетов.
|
5 |
-
* В этом классе добавляются общие ресурсы и элементы, необходимые для всех связанных плагинов.
|
6 |
-
*
|
7 |
-
* Author: Webcraftic <wordpress.webraftic@gmail.com>
|
8 |
-
* Version: 1.1.0
|
9 |
-
* @since 2.0.5
|
10 |
-
*/
|
11 |
-
|
12 |
-
// Exit if accessed directly
|
13 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
-
exit;
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Class Wbcr_FactoryPages414_ImpressiveThemplate
|
19 |
-
*
|
20 |
-
* @method string getInfoWidget() - get widget content information
|
21 |
-
* @method string getRatingWidget( array $args = array() ) - get widget content rating
|
22 |
-
* @method string getDonateWidget() - get widget content donate
|
23 |
-
* @method string getBusinessSuggetionWidget()
|
24 |
-
*/
|
25 |
-
|
26 |
-
if ( ! class_exists( 'Wbcr_FactoryClearfy209_PageBase' ) && class_exists( 'Wbcr_FactoryPages414_ImpressiveThemplate' ) ) {
|
27 |
-
|
28 |
-
class Wbcr_FactoryClearfy209_PageBase extends Wbcr_FactoryPages414_ImpressiveThemplate {
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Показывать правый сайдбар?
|
32 |
-
* Сайдбар будет показан на внутренних страницах шаблона.
|
33 |
-
*
|
34 |
-
* @var bool
|
35 |
-
*/
|
36 |
-
public $show_right_sidebar_in_options = true;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Страница доступна в меню суперадмнистратора (режим мультисайтов)
|
40 |
-
*
|
41 |
-
* @var bool
|
42 |
-
*/
|
43 |
-
public $available_for_multisite = true;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Показывать нижний сайдбар?
|
47 |
-
* Сайдбар будет показан на внутренних страницах шаблона.
|
48 |
-
*
|
49 |
-
* @var bool
|
50 |
-
*/
|
51 |
-
//public $show_bottom_sidebar = false;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @param Wbcr_Factory414_Plugin $plugin
|
55 |
-
*/
|
56 |
-
public function __construct( Wbcr_Factory414_Plugin $plugin ) {
|
57 |
-
parent::__construct( $plugin );
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @param $name
|
62 |
-
* @param $arguments
|
63 |
-
*
|
64 |
-
* @return null|string
|
65 |
-
*/
|
66 |
-
public function __call( $name, $arguments ) {
|
67 |
-
if ( substr( $name, 0, 3 ) == 'get' ) {
|
68 |
-
$called_method_name = 'show' . substr( $name, 3 );
|
69 |
-
if ( method_exists( $this, $called_method_name ) ) {
|
70 |
-
ob_start();
|
71 |
-
|
72 |
-
$this->$called_method_name( $arguments );
|
73 |
-
$content = ob_get_contents();
|
74 |
-
ob_end_clean();
|
75 |
-
|
76 |
-
return $content;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
return null;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Requests assets (js and css) for the page.
|
85 |
-
*
|
86 |
-
* @see Wbcr_FactoryPages414_AdminPage
|
87 |
-
*
|
88 |
-
* @param Wbcr_Factory414_ScriptList $scripts
|
89 |
-
* @param Wbcr_Factory414_StyleList $styles
|
90 |
-
*
|
91 |
-
* @return void
|
92 |
-
*/
|
93 |
-
public function assets( $scripts, $styles ) {
|
94 |
-
parent::assets( $scripts, $styles );
|
95 |
-
|
96 |
-
$this->styles->add( FACTORY_CLEARFY_209_URL . '/assets/css/clearfy-base.css' );
|
97 |
-
|
98 |
-
// todo: вынести все общие скрипты и стили фреймворка, продумать совместимость с другими плагинами
|
99 |
-
if ( defined( 'WCL_PLUGIN_URL' ) ) {
|
100 |
-
$this->styles->add( WCL_PLUGIN_URL . '/admin/assets/css/general.css' );
|
101 |
-
}
|
102 |
-
|
103 |
-
wbcr_factory_414_do_action_deprecated( 'wbcr_clearfy_page_enqueue_scripts', array(
|
104 |
-
$this->getResultId(),
|
105 |
-
$scripts,
|
106 |
-
$styles
|
107 |
-
), '1.4.0', 'wbcr/clearfy/page_assets' );
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Allows you to enqueue scripts to the internal pages of the plugin.
|
111 |
-
* $this->getResultId() - page id + plugin name = quick_start-wbcr_clearfy
|
112 |
-
* @since 2.0.5
|
113 |
-
*/
|
114 |
-
do_action( 'wbcr/clearfy/page_assets', $this->getResultId(), $scripts, $styles );
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* @return Wbcr_Factory414_Request
|
119 |
-
*/
|
120 |
-
public function request() {
|
121 |
-
return $this->plugin->request;
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* @since 2.0.5
|
126 |
-
*
|
127 |
-
* @param $option_name
|
128 |
-
* @param bool $default *
|
129 |
-
*
|
130 |
-
* @return mixed|void
|
131 |
-
*/
|
132 |
-
public function getPopulateOption( $option_name, $default = false ) {
|
133 |
-
return $this->plugin->getPopulateOption( $option_name, $default );
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* @param $option_name
|
138 |
-
* @param bool $default
|
139 |
-
*
|
140 |
-
* @return mixed|void
|
141 |
-
*/
|
142 |
-
public function getOption( $option_name, $default = false ) {
|
143 |
-
return $this->plugin->getOption( $option_name, $default );
|
144 |
-
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* @param $option_name
|
148 |
-
* @param $value
|
149 |
-
*
|
150 |
-
* @return void
|
151 |
-
*/
|
152 |
-
public function updatePopulateOption( $option_name, $value ) {
|
153 |
-
$this->plugin->updatePopulateOption( $option_name, $value );
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* @param $option_name
|
158 |
-
* @param $value
|
159 |
-
*
|
160 |
-
* @return void
|
161 |
-
*/
|
162 |
-
public function updateOption( $option_name, $value ) {
|
163 |
-
$this->plugin->updateOption( $option_name, $value );
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* @param $option_name
|
168 |
-
*
|
169 |
-
* @return void
|
170 |
-
*/
|
171 |
-
public function deletePopulateOption( $option_name ) {
|
172 |
-
$this->plugin->deletePopulateOption( $option_name );
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* @param $option_name
|
177 |
-
*
|
178 |
-
* @return void
|
179 |
-
*/
|
180 |
-
public function deleteOption( $option_name ) {
|
181 |
-
$this->plugin->deleteOption( $option_name );
|
182 |
-
}
|
183 |
-
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Действие выполняется для всех страниц Clearfy и его компонентах.
|
187 |
-
* Это простое предложение перейти на PRO версию.
|
188 |
-
*/
|
189 |
-
public function multisiteProAction() {
|
190 |
-
if ( is_multisite() && $this->plugin->isNetworkActive() ) {
|
191 |
-
|
192 |
-
$license_page_url = $this->getBaseUrl( 'license' );
|
193 |
-
$upgrade_url = WbcrFactoryClearfy209_Helpers::getWebcrafticSitePageUrl( $this->plugin->getPluginName(), 'pricing', 'multisite_save_settings' );
|
194 |
-
$upgrade_price = WbcrFactoryClearfy209_Helpers::getClearfyBusinessPrice();
|
195 |
-
|
196 |
-
$html = '<div class="wbcr-factory-clearfy-209-multisite-suggetion">';
|
197 |
-
$html .= '<div class="wbcr-factory-inner-contanier">';
|
198 |
-
$html .= '<h3>' . __( 'Upgrade to Clearfy Business', 'wbcr_factory_clearfy_209' ) . '</h3>';
|
199 |
-
$html .= '<p>' . __( 'Oops... Sorry for the inconvenience caused!', 'wbcr_factory_clearfy_209' ) . '</p>';
|
200 |
-
$html .= '<p>' . __( 'Complete multisite support is available in Clearfy Business and Clearfy Business Revolution packages only!', 'wbcr_factory_clearfy_209' ) . '</p>';
|
201 |
-
$html .= '<p>' . __( 'You can activate the plugin on each website and use it with zero limitations. But you can’t save the plugin’s settings under the Super Administrator role!', 'wbcr_factory_clearfy_209' ) . '</p>';
|
202 |
-
$html .= '<p style="margin-top:20px">';
|
203 |
-
$html .= '<a href="' . $license_page_url . '" class="wbcr-factory-activate-premium" rel="noopener">' . __( 'Activate license ', 'wbcr_factory_clearfy_209' ) . '</a> ';
|
204 |
-
$html .= '<a href="' . $upgrade_url . '" class="wbcr-factory-purchase-premium" target="_blank" rel="noopener">' . sprintf( __( 'Upgrade to Clearfy Business for $%d', 'wbcr_factory_clearfy_209' ), $upgrade_price ) . '</a>';
|
205 |
-
$html .= '</p>';
|
206 |
-
$html .= '</div>';
|
207 |
-
$html .= '</div>';
|
208 |
-
|
209 |
-
$this->showPage( $html );
|
210 |
-
|
211 |
-
return;
|
212 |
-
}
|
213 |
-
|
214 |
-
$this->redirectToAction( 'index' );
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* @param string $position
|
219 |
-
*
|
220 |
-
* @return mixed|void
|
221 |
-
*/
|
222 |
-
protected function getPageWidgets( $position = 'bottom' ) {
|
223 |
-
$widgets = array();
|
224 |
-
|
225 |
-
if ( $position == 'bottom' ) {
|
226 |
-
$widgets['info_widget'] = $this->getInfoWidget();
|
227 |
-
$widgets['rating_widget'] = $this->getRatingWidget();
|
228 |
-
$widgets['donate_widget'] = $this->getDonateWidget();
|
229 |
-
} else if ( $position == 'right' ) {
|
230 |
-
$widgets['businnes_suggetion'] = $this->getBusinessSuggetionWidget();
|
231 |
-
$widgets['info_widget'] = $this->getInfoWidget();
|
232 |
-
$widgets['rating_widget'] = $this->getRatingWidget();
|
233 |
-
}
|
234 |
-
|
235 |
-
/**
|
236 |
-
* @since 4.0.9 - является устаревшим
|
237 |
-
*/
|
238 |
-
$widgets = wbcr_factory_414_apply_filters_deprecated( 'wbcr_factory_pages_414_imppage_get_widgets', array(
|
239 |
-
$widgets,
|
240 |
-
$position,
|
241 |
-
$this->plugin,
|
242 |
-
$this
|
243 |
-
), '4.0.9', 'wbcr/factory/pages/impressive/widgets' );
|
244 |
-
|
245 |
-
/**
|
246 |
-
* @since 4.0.1 - добавлен
|
247 |
-
* @since 4.0.9 - изменено имя
|
248 |
-
*/
|
249 |
-
$widgets = apply_filters( 'wbcr/factory/pages/impressive/widgets', $widgets, $position, $this->plugin, $this );
|
250 |
-
|
251 |
-
return $widgets;
|
252 |
-
}
|
253 |
-
|
254 |
-
public function showBusinessSuggetionWidget() {
|
255 |
-
$plugin_name = $this->plugin->getPluginName();
|
256 |
-
$upgrade_price = $this->plugin->has_premium() ? $this->plugin->premium->get_price() : 0;
|
257 |
-
$purchase_url = $this->plugin->get_support()->get_pricing_url( true, 'right_sidebar_ads' );
|
258 |
-
|
259 |
-
$default_features = array(
|
260 |
-
'4_premium' => __( '4 premium components now;', 'wbcr_factory_clearfy_209' ),
|
261 |
-
'40_premium' => __( '40 new premium components within a year for the single price;', 'wbcr_factory_clearfy_209' ),
|
262 |
-
'multisite_support' => __( 'Multisite support;', 'wbcr_factory_clearfy_209' ),
|
263 |
-
'advance_settings' => __( 'Advanced settings;', 'wbcr_factory_clearfy_209' ),
|
264 |
-
'no_ads' => __( 'No ads;', 'wbcr_factory_clearfy_209' ),
|
265 |
-
'perfect_support' => __( 'Perfect support.', 'wbcr_factory_clearfy_209' )
|
266 |
-
);
|
267 |
-
|
268 |
-
/**
|
269 |
-
* @since 2.0.8 - added
|
270 |
-
*/
|
271 |
-
$suggetion_title = __( 'MORE IN CLEARFY <span>BUSINESS</span>', 'wbcr_factory_clearfy_209' );
|
272 |
-
$suggetion_title = apply_filters( 'wbcr/clearfy/pages/suggetion_title', $suggetion_title, $plugin_name, $this->id );
|
273 |
-
|
274 |
-
/**
|
275 |
-
* @since 2.0.8 - deprecated
|
276 |
-
*/
|
277 |
-
$suggetion_features = wbcr_factory_414_apply_filters_deprecated( 'wbcr/clearfy/page_bussines_suggetion_features', array(
|
278 |
-
$default_features,
|
279 |
-
$this->plugin->getPluginName(),
|
280 |
-
$this->id
|
281 |
-
), '2.0.8', 'wbcr/clearfy/pages/suggetion_features' );
|
282 |
-
|
283 |
-
/**
|
284 |
-
* @since 2.0.8 - renamed
|
285 |
-
* @since 2.0.6
|
286 |
-
*/
|
287 |
-
$suggetion_features = apply_filters( 'wbcr/clearfy/pages/suggetion_features', $suggetion_features, $plugin_name, $this->id );
|
288 |
-
|
289 |
-
if ( empty( $suggetion_features ) ) {
|
290 |
-
$suggetion_features = $default_features;
|
291 |
-
}
|
292 |
-
?>
|
293 |
-
<div class="wbcr-factory-sidebar-widget wbcr-factory-clearfy-209-pro-suggettion">
|
294 |
-
<h3><?php echo $suggetion_title; ?></h3>
|
295 |
-
<ul>
|
296 |
-
<?php if ( ! empty( $suggetion_features ) ): ?>
|
297 |
-
<?php foreach ( $suggetion_features as $feature ): ?>
|
298 |
-
<li><?= $feature ?></li>
|
299 |
-
<?php endforeach; ?>
|
300 |
-
<?php endif; ?>
|
301 |
-
</ul>
|
302 |
-
<a href="<?php echo $purchase_url ?>" class="wbcr-factory-purchase-premium" target="_blank" rel="noopener">
|
303 |
-
<?php printf( __( 'Upgrade for $%s', 'wbcr_factory_clearfy_209' ), $upgrade_price ) ?>
|
304 |
-
</a>
|
305 |
-
</div>
|
306 |
-
<?php
|
307 |
-
}
|
308 |
-
|
309 |
-
public function showInfoWidget() {
|
310 |
-
?>
|
311 |
-
<div class="wbcr-factory-sidebar-widget">
|
312 |
-
<ul>
|
313 |
-
<li>
|
314 |
-
<span class="wbcr-factory-hint-icon-simple wbcr-factory-simple-red">
|
315 |
-
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC" alt=""/>
|
316 |
-
</span>
|
317 |
-
- <?php _e( 'A neutral setting that can not harm your site, but you must be sure that you need to use it.', 'wbcr_factory_clearfy_209' ); ?>
|
318 |
-
</li>
|
319 |
-
<li>
|
320 |
-
<span class="wbcr-factory-hint-icon-simple wbcr-factory-simple-grey">
|
321 |
-
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC" alt=""/>
|
322 |
-
</span>
|
323 |
-
- <?php _e( 'When set this option, you must be careful. Plugins and themes may depend on this function. You must be sure that you can disable this feature for the site.', 'wbcr_factory_clearfy_209' ); ?>
|
324 |
-
</li>
|
325 |
-
<li>
|
326 |
-
<span class="wbcr-factory-hint-icon-simple wbcr-factory-simple-green">
|
327 |
-
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC" alt=""/>
|
328 |
-
</span>
|
329 |
-
- <?php _e( 'Absolutely safe setting, We recommend to use.', 'wbcr_factory_clearfy_209' ); ?>
|
330 |
-
</li>
|
331 |
-
</ul>
|
332 |
-
----------<br>
|
333 |
-
<p><?php _e( 'Hover to the icon to get help for the feature you selected.', 'wbcr_factory_clearfy_209' ); ?></p>
|
334 |
-
</div>
|
335 |
-
<?php
|
336 |
-
}
|
337 |
-
|
338 |
-
public function showRatingWidget( array $args ) {
|
339 |
-
if ( ! isset( $args[0] ) || empty( $args[0] ) ) {
|
340 |
-
$page_url = "https://goo.gl/tETE2X";
|
341 |
-
} else {
|
342 |
-
$page_url = $args[0];
|
343 |
-
}
|
344 |
-
|
345 |
-
$page_url = apply_filters( 'wbcr_factory_pages_414_imppage_rating_widget_url', $page_url, $this->plugin->getPluginName(), $this->getResultId() );
|
346 |
-
|
347 |
-
?>
|
348 |
-
<div class="wbcr-factory-sidebar-widget">
|
349 |
-
<p>
|
350 |
-
<strong><?php _e( 'Do you want the plugin to improved and update?', 'wbcr_factory_clearfy_209' ); ?></strong>
|
351 |
-
</p>
|
352 |
-
<p><?php _e( 'Help the author, leave a review on wordpress.org. Thanks to feedback, I will know that the plugin is really useful to you and is needed.', 'wbcr_factory_clearfy_209' ); ?></p>
|
353 |
-
<p><?php _e( 'And also write your ideas on how to extend or improve the plugin.', 'wbcr_factory_clearfy_209' ); ?></p>
|
354 |
-
<p>
|
355 |
-
<i class="wbcr-factory-icon-5stars"></i>
|
356 |
-
<a href="<?= $page_url ?>" title="Go rate us" target="_blank">
|
357 |
-
<strong><?php _e( 'Go rate us and push ideas', 'wbcr_factory_clearfy_209' ); ?></strong>
|
358 |
-
</a>
|
359 |
-
</p>
|
360 |
-
</div>
|
361 |
-
<?php
|
362 |
-
}
|
363 |
-
|
364 |
-
public function showDonateWidget() {
|
365 |
-
?>
|
366 |
-
<div class="wbcr-factory-sidebar-widget">
|
367 |
-
<p>
|
368 |
-
<strong><?php _e( 'Donation for plugin development', 'wbcr_factory_clearfy_209' ); ?></strong>
|
369 |
-
</p>
|
370 |
-
<?php if ( get_locale() !== 'ru_RU' ): ?>
|
371 |
-
<form id="wbcr-factory-paypal-donation-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
372 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
373 |
-
<input type="hidden" name="hosted_button_id" value="VDX7JNTQPNPFW">
|
374 |
-
<div class="wbcr-factory-donation-price">5$</div>
|
375 |
-
<input type="image" src="<?= FACTORY_PAGES_414_URL ?>/templates/assets/img/paypal-donate.png" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
|
376 |
-
</form>
|
377 |
-
<?php else: ?>
|
378 |
-
<iframe frameborder="0" allowtransparency="true" scrolling="no" src="https://money.yandex.ru/embed/donate.xml?account=410011242846510&quickpay=donate&payment-type-choice=on&mobile-payment-type-choice=on&default-sum=300&targets=%D0%9D%D0%B0+%D0%BF%D0%BE%D0%B4%D0%B4%D0%B5%D1%80%D0%B6%D0%BA%D1%83+%D0%BF%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD%D0%B0+%D0%B8+%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D1%83+%D0%BD%D0%BE%D0%B2%D1%8B%D1%85+%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9.+&target-visibility=on&project-name=Webcraftic&project-site=&button-text=05&comment=on&hint=%D0%9A%D0%B0%D0%BA%D1%83%D1%8E+%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8E+%D0%BD%D1%83%D0%B6%D0%BD%D0%BE+%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C+%D0%B2+%D0%BF%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD%3F&mail=on&successURL=" width="508" height="187"></iframe>
|
379 |
-
<?php endif; ?>
|
380 |
-
</div>
|
381 |
-
<?php
|
382 |
-
}
|
383 |
-
}
|
384 |
-
}
|
385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libs/factory/clearfy/pages/class-page-license.php
ADDED
@@ -0,0 +1,401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Wbcr_FactoryLicense000_LicensePage is used as template to display form to active premium functionality.
|
10 |
+
*
|
11 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
12 |
+
* @since 2.0.7
|
13 |
+
*/
|
14 |
+
class Wbcr_FactoryClearfy217_LicensePage extends Wbcr_FactoryClearfy217_PageBase {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* {@inheritdoc}
|
18 |
+
*
|
19 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
20 |
+
* @since 2.1.2
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
public $type = "page";
|
24 |
+
|
25 |
+
/**
|
26 |
+
* {@inheritdoc}
|
27 |
+
*
|
28 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
29 |
+
* @since 2.1.2
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
+
public $page_menu_dashicon = 'dashicons-admin-network';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* {@inheritdoc}
|
36 |
+
*
|
37 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
38 |
+
* @since 2.1.2
|
39 |
+
* @var bool
|
40 |
+
*/
|
41 |
+
public $show_right_sidebar_in_options = false;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* {@inheritdoc}
|
45 |
+
*
|
46 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
47 |
+
* @since 2.1.2
|
48 |
+
* @var int
|
49 |
+
*/
|
50 |
+
public $page_menu_position = 0;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* {@inheritdoc}
|
54 |
+
*
|
55 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
56 |
+
* @since 2.1.2
|
57 |
+
* @var bool
|
58 |
+
*/
|
59 |
+
public $available_for_multisite = true;
|
60 |
+
|
61 |
+
/**
|
62 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
63 |
+
* @since 2.1.2
|
64 |
+
* @var string
|
65 |
+
*/
|
66 |
+
public $plugin_name;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* @var string Name of the paid plan.
|
70 |
+
*/
|
71 |
+
public $plan_name;
|
72 |
+
|
73 |
+
// PREMIUM SECTION
|
74 |
+
// ------------------------------------------------------------------
|
75 |
+
/**
|
76 |
+
* @since 2.0.7
|
77 |
+
* @var bool
|
78 |
+
*/
|
79 |
+
protected $is_premium;
|
80 |
+
|
81 |
+
/**
|
82 |
+
* @since 2.0.7
|
83 |
+
* @var \WBCR\Factory_425\Premium\Provider
|
84 |
+
*/
|
85 |
+
protected $premium;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* @since 2.0.7
|
89 |
+
* @var bool
|
90 |
+
*/
|
91 |
+
protected $is_premium_active;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* @since 2.0.7
|
95 |
+
* @var bool
|
96 |
+
*/
|
97 |
+
protected $premium_has_subscription;
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @since 2.0.7
|
101 |
+
* @var \WBCR\Factory_425\Premium\Interfaces\License
|
102 |
+
*/
|
103 |
+
protected $premium_license;
|
104 |
+
|
105 |
+
// END PREMIUM SECTION
|
106 |
+
// ------------------------------------------------------------------
|
107 |
+
|
108 |
+
/**
|
109 |
+
* {@inheritdoc}
|
110 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
111 |
+
*/
|
112 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
113 |
+
$this->plugin = $plugin;
|
114 |
+
|
115 |
+
parent::__construct( $plugin );
|
116 |
+
|
117 |
+
if ( ! $this->id ) {
|
118 |
+
$this->id = $this->plugin->getPrefix() . 'license';
|
119 |
+
}
|
120 |
+
|
121 |
+
$this->plugin_name = $this->plugin->getPluginName();
|
122 |
+
$this->premium = $plugin->premium;
|
123 |
+
$this->is_premium = $this->premium->is_activate();
|
124 |
+
$this->is_premium_active = $this->premium->is_active();
|
125 |
+
$this->premium_has_subscription = $this->premium->has_paid_subscription();
|
126 |
+
$this->premium_license = $this->premium->get_license();
|
127 |
+
|
128 |
+
add_action( "wp_ajax_wbcr-clearfy-activate-license-for-{$this->plugin_name}", [ $this, 'ajax_handler' ] );
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* [MAGIC] Magic method that configures assets for a page.
|
133 |
+
*/
|
134 |
+
public function assets( $scripts, $styles ) {
|
135 |
+
parent::assets( $scripts, $styles );
|
136 |
+
|
137 |
+
$this->styles->add( FACTORY_CLEARFY_217_URL . '/assets/css/license-manager.css' );
|
138 |
+
$this->scripts->add( FACTORY_CLEARFY_217_URL . '/assets/js/license-manager.js' );
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Регистрируем ajax обработчик для текущей страницы
|
143 |
+
*
|
144 |
+
* @since 2.0.7
|
145 |
+
*/
|
146 |
+
public function ajax_handler() {
|
147 |
+
wbcr_factory_clearfy_217_check_license( $this->plugin );
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* {@inheritdoc}
|
152 |
+
*/
|
153 |
+
public function showPageContent() {
|
154 |
+
?>
|
155 |
+
<div id="wcl-license-wrapper"
|
156 |
+
data-loader="<?php echo FACTORY_CLEARFY_217_URL . '/assets/img/loader.gif'; ?>"
|
157 |
+
data-plugin-name="<?php echo esc_attr( $this->plugin_name ); ?>"
|
158 |
+
data-nonce="<?php echo wp_create_nonce( "clearfy_activate_license_for_{$this->plugin_name}" ) ?>">
|
159 |
+
<?php $this->show_license_form(); ?>
|
160 |
+
</div>
|
161 |
+
<?php
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Get before content.
|
166 |
+
*
|
167 |
+
* @return string Before content.
|
168 |
+
*/
|
169 |
+
protected function get_plan_description() {
|
170 |
+
return '';
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* @return string
|
175 |
+
*/
|
176 |
+
protected function get_hidden_license_key() {
|
177 |
+
if ( ! $this->is_premium ) {
|
178 |
+
return '';
|
179 |
+
}
|
180 |
+
|
181 |
+
return $this->premium_license->get_hidden_key();
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* @return string
|
186 |
+
*/
|
187 |
+
protected function get_plan() {
|
188 |
+
if ( ! $this->is_premium ) {
|
189 |
+
return 'free';
|
190 |
+
}
|
191 |
+
|
192 |
+
return $this->premium->get_plan();
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* @return mixed
|
197 |
+
*/
|
198 |
+
protected function get_expiration_days() {
|
199 |
+
if ( ! $this->is_premium ) {
|
200 |
+
return '';
|
201 |
+
}
|
202 |
+
|
203 |
+
return $this->premium_license->get_expiration_time( 'days' );
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* @return string
|
208 |
+
*/
|
209 |
+
protected function get_billing_cycle_readable() {
|
210 |
+
if ( ! $this->is_premium ) {
|
211 |
+
return '';
|
212 |
+
}
|
213 |
+
|
214 |
+
$billing_cycle = $this->premium->get_billing_cycle();
|
215 |
+
$billing = 'lifetime';
|
216 |
+
|
217 |
+
if ( 1 == $billing_cycle ) {
|
218 |
+
$billing = 'month';
|
219 |
+
} else if ( 12 == $billing_cycle ) {
|
220 |
+
$billing = 'year';
|
221 |
+
}
|
222 |
+
|
223 |
+
return $billing;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Тип лицензии, цветовое оформление для формы лицензирования
|
228 |
+
* free - бесплатная
|
229 |
+
* gift - пожизненная лицензия, лицензия на особых условиях
|
230 |
+
* trial - красный цвет, применяется для триалов, если лиценизия истекла или заблокирована
|
231 |
+
* paid - обычная оплаченная лицензия, в данный момент активна.
|
232 |
+
*
|
233 |
+
* @return string
|
234 |
+
*/
|
235 |
+
protected function get_license_type() {
|
236 |
+
if ( ! $this->is_premium ) {
|
237 |
+
return 'free';
|
238 |
+
}
|
239 |
+
|
240 |
+
$license = $this->premium_license;
|
241 |
+
|
242 |
+
if ( $license->is_lifetime() ) {
|
243 |
+
return 'gift';
|
244 |
+
} else if ( $license->get_expiration_time( 'days' ) < 1 ) {
|
245 |
+
return 'trial';
|
246 |
+
}
|
247 |
+
|
248 |
+
return 'paid';
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* @param bool|WP_Error $notice
|
253 |
+
*/
|
254 |
+
public function show_license_form( $notice = false ) {
|
255 |
+
?>
|
256 |
+
<div id="license-manager"
|
257 |
+
class="factory-bootstrap-426 onp-page-wrap <?= $this->get_license_type() ?>-license-manager-content">
|
258 |
+
<div>
|
259 |
+
<h3><?php printf( __( 'Activate %s', 'wbcr_factory_clearfy_217' ), $this->plan_name ) ?></h3>
|
260 |
+
<?php echo $this->get_plan_description() ?>
|
261 |
+
</div>
|
262 |
+
<br>
|
263 |
+
<?php if ( is_wp_error( $notice ) ) : ?>
|
264 |
+
<div class="license-message <?= $this->get_license_type() ?>-license-message">
|
265 |
+
<div class="alert <?php echo esc_attr( $notice->get_error_code() ); ?>">
|
266 |
+
<h4 class="alert-heading"><?php _e( $notice->get_error_message(), 'wbcr_factory_clearfy_217' ) ?></h4>
|
267 |
+
</div>
|
268 |
+
</div>
|
269 |
+
<?php endif; ?>
|
270 |
+
<div class="onp-container">
|
271 |
+
<div class="license-details">
|
272 |
+
<?php if ( $this->get_license_type() == 'free' ): ?>
|
273 |
+
<a href="<?php echo $this->plugin->get_support()->get_pricing_url( true, 'license_page' ); ?>"
|
274 |
+
class="purchase-premium" target="_blank" rel="noopener">
|
275 |
+
<span class="btn btn-gold btn-inner-wrap">
|
276 |
+
<?php _e( 'Upgrade to Premium', 'wbcr_factory_clearfy_217' ) ?>
|
277 |
+
</span>
|
278 |
+
</a>
|
279 |
+
<p><?php printf( __( 'Your current license for %1$s:', 'wbcr_factory_clearfy_217' ), $this->plugin->getPluginTitle() ) ?></p>
|
280 |
+
<?php endif; ?>
|
281 |
+
<div class="license-details-block <?= $this->get_license_type() ?>-details-block">
|
282 |
+
<?php if ( $this->is_premium ): ?>
|
283 |
+
<a data-action="deactivate" href="#"
|
284 |
+
class="btn btn-default btn-small license-delete-button wcl-control-btn">
|
285 |
+
<?php _e( 'Delete Key', 'wbcr_factory_clearfy_217' ) ?>
|
286 |
+
</a>
|
287 |
+
<a data-action="sync" href="#"
|
288 |
+
class="btn btn-default btn-small license-synchronization-button wcl-control-btn">
|
289 |
+
<?php _e( 'Synchronization', 'wbcr_factory_clearfy_217' ) ?>
|
290 |
+
</a>
|
291 |
+
<?php endif; ?>
|
292 |
+
<h3>
|
293 |
+
<?php echo ucfirst( $this->get_plan() ); ?>
|
294 |
+
|
295 |
+
<?php if ( $this->is_premium && $this->premium_has_subscription ): ?>
|
296 |
+
<span style="font-size: 15px;">
|
297 |
+
(<?php printf( __( 'Automatic renewal, every %s', '' ), esc_attr( $this->get_billing_cycle_readable() ) ); ?>)
|
298 |
+
</span>
|
299 |
+
<?php endif; ?>
|
300 |
+
</h3>
|
301 |
+
<?php if ( $this->is_premium ): ?>
|
302 |
+
<div class="license-key-identity">
|
303 |
+
<code><?= esc_attr( $this->get_hidden_license_key() ) ?></code>
|
304 |
+
</div>
|
305 |
+
<?php endif; ?>
|
306 |
+
<div class="license-key-description">
|
307 |
+
<?php if ( ! $this->is_premium ): ?>
|
308 |
+
<p><?php _e( '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.', 'wbcr_factory_clearfy_217' ) ?></p>
|
309 |
+
<?php else: ?>
|
310 |
+
<p><?php _e( 'Сommercial license, only to the premium add-on to this free plugin. You cannot distribute or modify the premium add-on. But free plugin is a GPLv3 compatible license allowing you to change and use this version of the plugin for free.', 'wbcr_factory_clearfy_217' ) ?></p>
|
311 |
+
<?php endif; ?>
|
312 |
+
<?php if ( $this->is_premium && $this->premium_has_subscription ): ?>
|
313 |
+
<p class="activate-trial-hint">
|
314 |
+
<?php _e( 'You use a paid subscription for the plugin updates. In case you don’t want to receive paid updates, please, click <a data-action="unsubscribe" class="wcl-control-btn" href="#">cancel subscription</a>', 'wbcr_factory_clearfy_217' ) ?>
|
315 |
+
</p>
|
316 |
+
<?php endif; ?>
|
317 |
+
|
318 |
+
<?php if ( $this->get_license_type() == 'trial' ): ?>
|
319 |
+
<p class="activate-error-hint">
|
320 |
+
<?php printf( __( 'Your license has expired, please extend the license to get updates and support.', 'wbcr_factory_clearfy_217' ), '' ) ?>
|
321 |
+
</p>
|
322 |
+
<?php endif; ?>
|
323 |
+
</div>
|
324 |
+
<table class="license-params" colspacing="0" colpadding="0">
|
325 |
+
<tr>
|
326 |
+
<!--<td class="license-param license-param-domain">
|
327 |
+
<span class="license-value"><?php echo esc_attr( $_SERVER['SERVER_NAME'] ); ?></span>
|
328 |
+
<span class="license-value-name"><?php _e( 'domain', 'wbcr_factory_clearfy_217' ) ?></span>
|
329 |
+
</td>-->
|
330 |
+
<td class="license-param license-param-days">
|
331 |
+
<span class="license-value"><?= $this->get_plan() ?></span>
|
332 |
+
<span class="license-value-name"><?php _e( 'plan', 'wbcr_factory_clearfy_217' ) ?></span>
|
333 |
+
</td>
|
334 |
+
<?php if ( $this->is_premium ) : ?>
|
335 |
+
<td class="license-param license-param-sites">
|
336 |
+
<span class="license-value">
|
337 |
+
<?php echo esc_attr( $this->premium_license->get_count_active_sites() ); ?>
|
338 |
+
<?php _e( 'of', 'wbcr_factory_clearfy_217' ) ?>
|
339 |
+
<?php echo esc_attr( $this->premium_license->get_sites_quota() ); ?></span>
|
340 |
+
<span class="license-value-name"><?php _e( 'active sites', 'wbcr_factory_clearfy_217' ) ?></span>
|
341 |
+
</td>
|
342 |
+
<?php endif; ?>
|
343 |
+
<td class="license-param license-param-version">
|
344 |
+
<span class="license-value"><?= $this->plugin->getPluginVersion() ?></span>
|
345 |
+
<span class="license-value-name"><span>version</span></span>
|
346 |
+
</td>
|
347 |
+
<?php if ( $this->is_premium ): ?>
|
348 |
+
<td class="license-param license-param-days">
|
349 |
+
<?php if ( $this->get_license_type() == 'trial' ): ?>
|
350 |
+
<span class="license-value"><?php _e( 'EXPIRED!', 'wbcr_factory_clearfy_217' ) ?></span>
|
351 |
+
<span class="license-value-name"><?php _e( 'please update the key', 'wbcr_factory_clearfy_217' ) ?></span>
|
352 |
+
<?php else: ?>
|
353 |
+
<span class="license-value">
|
354 |
+
<?php
|
355 |
+
if ( $this->premium_license->is_lifetime() ) {
|
356 |
+
echo 'infiniate';
|
357 |
+
} else {
|
358 |
+
echo $this->get_expiration_days();
|
359 |
+
}
|
360 |
+
?>
|
361 |
+
<small> <?php _e( 'day(s)', 'wbcr_factory_clearfy_217' ) ?></small>
|
362 |
+
</span>
|
363 |
+
<span class="license-value-name"><?php _e( 'remained', 'wbcr_factory_clearfy_217' ) ?></span>
|
364 |
+
<?php endif; ?>
|
365 |
+
</td>
|
366 |
+
<?php endif; ?>
|
367 |
+
</tr>
|
368 |
+
</table>
|
369 |
+
</div>
|
370 |
+
</div>
|
371 |
+
<div class="license-input">
|
372 |
+
<form action="" method="post">
|
373 |
+
<?php if ( $this->is_premium ): ?>
|
374 |
+
<p><?php _e( 'Have a key to activate the premium version? Paste it here:', 'wbcr_factory_clearfy_217' ) ?><p>
|
375 |
+
<?php else: ?>
|
376 |
+
<p><?php _e( 'Have a key to activate the plugin? Paste it here:', 'wbcr_factory_clearfy_217' ) ?>
|
377 |
+
<p>
|
378 |
+
<?php endif; ?>
|
379 |
+
<button data-action="activate" class="btn btn-default wcl-control-btn" type="button"
|
380 |
+
id="license-submit">
|
381 |
+
<?php _e( 'Submit Key', 'wbcr_factory_clearfy_217' ) ?>
|
382 |
+
</button>
|
383 |
+
<div class="license-key-wrap">
|
384 |
+
<input type="text" id="license-key" name="licensekey" value="" class="form-control"/>
|
385 |
+
</div>
|
386 |
+
<?php if ( $this->is_premium ): ?>
|
387 |
+
<p style="margin-top: 10px;">
|
388 |
+
<?php printf( __( '<a href="%s" target="_blank" rel="noopener">Lean more</a> about the premium version and get the license key to activate it now!', 'wbcr_factory_clearfy_217' ), $this->plugin->get_support()->get_pricing_url( true, 'license_page' ) ); ?>
|
389 |
+
</p>
|
390 |
+
<?php else: ?>
|
391 |
+
<p style="margin-top: 10px;">
|
392 |
+
<?php printf( __( 'Can’t find your key? Go to <a href="%s" target="_blank" rel="noopener">this page</a> and login using the e-mail address associated with your purchase.', 'wbcr_factory_clearfy_217' ), $this->plugin->get_support()->get_contacts_url( true, 'license_page' ) ) ?>
|
393 |
+
</p>
|
394 |
+
<?php endif; ?>
|
395 |
+
</form>
|
396 |
+
</div>
|
397 |
+
</div>
|
398 |
+
</div>
|
399 |
+
<?php
|
400 |
+
}
|
401 |
+
}
|
libs/factory/clearfy/pages/class-page-more-features.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The page Settings.
|
4 |
+
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
6 |
+
* @since 1.0.1
|
7 |
+
* @package clearfy
|
8 |
+
* @copyright (c) 2018, Webcraftic Ltd
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
|
18 |
+
class Wbcr_FactoryClearfy217_MoreFeaturesPage extends Wbcr_FactoryPages425_ImpressiveThemplate {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* {@inheritDoc}
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
public $id = "more_features";
|
26 |
+
|
27 |
+
/**
|
28 |
+
* {@inheritDoc}
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
+
public $page_menu_dashicon = 'dashicons-star-filled wbcr-factory-orange-color';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* {@inheritDoc}
|
36 |
+
*
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
public $page_menu_position = 5;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* {@inheritDoc}
|
43 |
+
*
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
public $type = 'page';
|
47 |
+
|
48 |
+
/**
|
49 |
+
* {@inheritDoc}
|
50 |
+
*
|
51 |
+
* @var bool
|
52 |
+
*/
|
53 |
+
public $available_for_multisite = true;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* {@inheritDoc}
|
57 |
+
*
|
58 |
+
* @since 2.0.6 - добавлен
|
59 |
+
* @var bool
|
60 |
+
*/
|
61 |
+
public $internal = true;
|
62 |
+
|
63 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
64 |
+
$this->menu_title = __( 'More features (<b>free</b>)', 'wbcr_factory_clearfy_217' );
|
65 |
+
|
66 |
+
parent::__construct( $plugin );
|
67 |
+
|
68 |
+
$this->plugin = $plugin;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* {@inheritDoc}
|
73 |
+
*
|
74 |
+
* @return string
|
75 |
+
*/
|
76 |
+
public function getPageTitle() {
|
77 |
+
return __( 'More features', 'wbcr_factory_clearfy_217' );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* {@inheritDoc}
|
82 |
+
*
|
83 |
+
* @return void
|
84 |
+
*/
|
85 |
+
public function showPageContent() {
|
86 |
+
?>
|
87 |
+
<div class="row">
|
88 |
+
<div class="col-sm-4">
|
89 |
+
<div class="wbcr-factory-feature-box">
|
90 |
+
<span class="dashicons dashicons-yes"></span>
|
91 |
+
<h3><?php _e( 'Code cleaning', 'wbcr_factory_clearfy_217' ) ?></h3>
|
92 |
+
<p><?php _e( 'Clears the source code of the page from unused code.', 'wbcr_factory_clearfy_217' ) ?></p>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
<div class="col-sm-4">
|
96 |
+
<div class="wbcr-factory-feature-box">
|
97 |
+
<span class="dashicons dashicons-chart-bar"></span>
|
98 |
+
<h3><?php _e( 'Improve SEO', 'wbcr_factory_clearfy_217' ) ?></h3>
|
99 |
+
<p><?php _e( 'Removes duplicate pages, closes external links, changes the headers of the server.', 'wbcr_factory_clearfy_217' ) ?></p>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
<div class="col-sm-4">
|
103 |
+
<div class="wbcr-factory-feature-box">
|
104 |
+
<span class="dashicons dashicons-shield-alt"></span>
|
105 |
+
<h3><?php _e( 'Site protection', 'wbcr_factory_clearfy_217' ) ?></h3>
|
106 |
+
<p><?php _e( 'Enables and disables features that improve the protection of your site.', 'wbcr_factory_clearfy_217' ) ?></p>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
<div class="col-sm-4">
|
110 |
+
<div class="wbcr-factory-feature-box">
|
111 |
+
<span class="dashicons dashicons-welcome-comments"></span>
|
112 |
+
<h3><?php _e( 'Disable comments', 'wbcr_factory_clearfy_217' ) ?></h3>
|
113 |
+
<p><?php _e( 'Disables comments on the entire site or on specific pages.', 'wbcr_factory_clearfy_217' ) ?></p>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
<div class="col-sm-4">
|
117 |
+
<div class="wbcr-factory-feature-box">
|
118 |
+
<span class="dashicons dashicons-update"></span>
|
119 |
+
<h3><?php _e( 'Manage updates', 'wbcr_factory_clearfy_217' ) ?></h3>
|
120 |
+
<p><?php _e( 'Enables or disables automatically updates for plugins, themes and core. It is also possible
|
121 |
+
to disable all updates.', 'wbcr_factory_clearfy_217' ) ?></p>
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
<div class="col-sm-4">
|
125 |
+
<div class="wbcr-factory-feature-box">
|
126 |
+
<span class="dashicons dashicons-admin-plugins"></span>
|
127 |
+
<h3><?php _e( 'Manage widgets', 'wbcr_factory_clearfy_217' ) ?></h3>
|
128 |
+
<p><?php _e( 'Allows you to remove unused widgets.', 'wbcr_factory_clearfy_217' ) ?></p>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<div class="col-sm-4">
|
132 |
+
<div class="wbcr-factory-feature-box">
|
133 |
+
<span class="dashicons dashicons-dashboard"></span>
|
134 |
+
<h3><?php _e( 'Speed Optimization', 'wbcr_factory_clearfy_217' ) ?></h3>
|
135 |
+
<p><?php _e( 'Increases performance by disabling unused functions and reducing the number of requests.', 'wbcr_factory_clearfy_217' ) ?></p>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
<div class="col-sm-4">
|
139 |
+
<div class="wbcr-factory-feature-box">
|
140 |
+
<span class="dashicons dashicons-visibility"></span>
|
141 |
+
<h3><?php _e( 'Site privacy', 'wbcr_factory_clearfy_217' ) ?></h3>
|
142 |
+
<p><?php _e( 'Allows you to hide the version of the site and plugins. Allows you to hide your
|
143 |
+
WordPress.', 'wbcr_factory_clearfy_217' ) ?></p>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
<div class="col-sm-4">
|
147 |
+
<div class="wbcr-factory-feature-box">
|
148 |
+
<span class="dashicons dashicons-admin-settings"></span>
|
149 |
+
<h3><?php _e( 'Easy setup', 'wbcr_factory_clearfy_217' ) ?></h3>
|
150 |
+
<p><?php _e( 'In quick mode, you can easily configure the plugin according to your needs.', 'wbcr_factory_clearfy_217' ) ?></p>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
<div class="wbcr-factory-buttons-wrap">
|
155 |
+
<?php
|
156 |
+
$url = 'https://clearfy.pro';
|
157 |
+
|
158 |
+
if ( get_locale() == 'ru_RU' ) {
|
159 |
+
$url = 'https://ru.clearfy.pro';
|
160 |
+
}
|
161 |
+
$url .= '?utm_source=wordpress.org&utm_campaign=' . $this->plugin->getPluginName();
|
162 |
+
?>
|
163 |
+
<a href="<?= $url ?>" class="wbcr-factory-premium-button" target="_blank">
|
164 |
+
<?php _e( 'Get the ultimate plugin 100% FREE', 'wbcr_factory_clearfy_217' ) ?>
|
165 |
+
</a>
|
166 |
+
</div>
|
167 |
+
<?php
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
libs/factory/clearfy/pages/class-pages.php
ADDED
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Общий класс прослойка для страниц Clearfy и его компоннетов.
|
5 |
+
* В этом классе добавляются общие ресурсы и элементы, необходимые для всех связанных плагинов.
|
6 |
+
*
|
7 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
|
8 |
+
* @since 2.0.5
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Exit if accessed directly
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
13 |
+
exit;
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Class Wbcr_FactoryPages425_ImpressiveThemplate
|
18 |
+
*
|
19 |
+
* @method string getInfoWidget() - get widget content information
|
20 |
+
* @method string getRatingWidget( array $args = [] ) - get widget content rating
|
21 |
+
* @method string getDonateWidget() - get widget content donate
|
22 |
+
* @method string getBusinessSuggetionWidget()
|
23 |
+
* @method string getSupportWidget
|
24 |
+
*/
|
25 |
+
class Wbcr_FactoryClearfy217_PageBase extends Wbcr_FactoryPages425_ImpressiveThemplate {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* {@inheritDoc}
|
29 |
+
*
|
30 |
+
* @since 2.0.5 - добавлен
|
31 |
+
* @var bool
|
32 |
+
*/
|
33 |
+
public $show_right_sidebar_in_options = true;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* {@inheritDoc}
|
37 |
+
*
|
38 |
+
* @since 2.0.5 - добавлен
|
39 |
+
* @var bool
|
40 |
+
*/
|
41 |
+
public $available_for_multisite = true;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* {@inheritDoc}
|
45 |
+
*
|
46 |
+
* @since 2.0.6 - добавлен
|
47 |
+
* @var bool
|
48 |
+
*/
|
49 |
+
public $internal = true;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
53 |
+
*/
|
54 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
55 |
+
parent::__construct( $plugin );
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @param $name
|
60 |
+
* @param $arguments
|
61 |
+
*
|
62 |
+
* @return null|string
|
63 |
+
*/
|
64 |
+
public function __call( $name, $arguments ) {
|
65 |
+
if ( substr( $name, 0, 3 ) == 'get' ) {
|
66 |
+
$called_method_name = 'show' . substr( $name, 3 );
|
67 |
+
if ( method_exists( $this, $called_method_name ) ) {
|
68 |
+
ob_start();
|
69 |
+
|
70 |
+
$this->$called_method_name( $arguments );
|
71 |
+
$content = ob_get_contents();
|
72 |
+
ob_end_clean();
|
73 |
+
|
74 |
+
return $content;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
return null;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Requests assets (js and css) for the page.
|
83 |
+
*
|
84 |
+
* @param Wbcr_Factory425_ScriptList $scripts
|
85 |
+
* @param Wbcr_Factory425_StyleList $styles
|
86 |
+
*
|
87 |
+
* @return void
|
88 |
+
* @see Wbcr_FactoryPages425_AdminPage
|
89 |
+
*
|
90 |
+
*/
|
91 |
+
public function assets( $scripts, $styles ) {
|
92 |
+
parent::assets( $scripts, $styles );
|
93 |
+
|
94 |
+
$this->styles->add( FACTORY_CLEARFY_217_URL . '/assets/css/clearfy-base.css' );
|
95 |
+
|
96 |
+
// todo: вынести все общие скрипты и стили фреймворка, продумать совместимость с другими плагинами
|
97 |
+
if ( defined( 'WCL_PLUGIN_URL' ) ) {
|
98 |
+
$this->styles->add( WCL_PLUGIN_URL . '/admin/assets/css/general.css' );
|
99 |
+
}
|
100 |
+
|
101 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr_clearfy_page_enqueue_scripts', [
|
102 |
+
$this->getResultId(),
|
103 |
+
$scripts,
|
104 |
+
$styles
|
105 |
+
], '1.4.0', 'wbcr/clearfy/page_assets' );
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Allows you to enqueue scripts to the internal pages of the plugin.
|
109 |
+
* $this->getResultId() - page id + plugin name = quick_start-wbcr_clearfy
|
110 |
+
*
|
111 |
+
* @since 2.0.5
|
112 |
+
*/
|
113 |
+
do_action( 'wbcr/clearfy/page_assets', $this->getResultId(), $scripts, $styles );
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* @return Wbcr_Factory425_Request
|
118 |
+
*/
|
119 |
+
public function request() {
|
120 |
+
return $this->plugin->request;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* @param $option_name
|
125 |
+
* @param bool $default *
|
126 |
+
*
|
127 |
+
* @return mixed|void
|
128 |
+
* @since 2.0.5
|
129 |
+
*
|
130 |
+
*/
|
131 |
+
public function getPopulateOption( $option_name, $default = false ) {
|
132 |
+
return $this->plugin->getPopulateOption( $option_name, $default );
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* @param $option_name
|
137 |
+
* @param bool $default
|
138 |
+
*
|
139 |
+
* @return mixed|void
|
140 |
+
*/
|
141 |
+
public function getOption( $option_name, $default = false ) {
|
142 |
+
return $this->plugin->getOption( $option_name, $default );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* @param $option_name
|
147 |
+
* @param $value
|
148 |
+
*
|
149 |
+
* @return void
|
150 |
+
*/
|
151 |
+
public function updatePopulateOption( $option_name, $value ) {
|
152 |
+
$this->plugin->updatePopulateOption( $option_name, $value );
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* @param $option_name
|
157 |
+
* @param $value
|
158 |
+
*
|
159 |
+
* @return void
|
160 |
+
*/
|
161 |
+
public function updateOption( $option_name, $value ) {
|
162 |
+
$this->plugin->updateOption( $option_name, $value );
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* @param $option_name
|
167 |
+
*
|
168 |
+
* @return void
|
169 |
+
*/
|
170 |
+
public function deletePopulateOption( $option_name ) {
|
171 |
+
$this->plugin->deletePopulateOption( $option_name );
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* @param $option_name
|
176 |
+
*
|
177 |
+
* @return void
|
178 |
+
*/
|
179 |
+
public function deleteOption( $option_name ) {
|
180 |
+
$this->plugin->deleteOption( $option_name );
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @param string $position
|
185 |
+
*
|
186 |
+
* @return mixed|void
|
187 |
+
*/
|
188 |
+
protected function getPageWidgets( $position = 'bottom' ) {
|
189 |
+
$widgets = [];
|
190 |
+
|
191 |
+
if ( $position == 'bottom' ) {
|
192 |
+
$widgets['info_widget'] = $this->getInfoWidget();
|
193 |
+
$widgets['rating_widget'] = $this->getRatingWidget();
|
194 |
+
$widgets['support_widget'] = $this->getSupportWidget();
|
195 |
+
//$widgets['donate_widget'] = $this->getDonateWidget();
|
196 |
+
} else if ( $position == 'right' ) {
|
197 |
+
$widgets['business_suggetion'] = $this->getBusinessSuggetionWidget();
|
198 |
+
$widgets['info_widget'] = $this->getInfoWidget();
|
199 |
+
$widgets['rating_widget'] = $this->getRatingWidget();
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* @since 4.0.9 - является устаревшим
|
204 |
+
*/
|
205 |
+
$widgets = wbcr_factory_425_apply_filters_deprecated( 'wbcr_factory_pages_425_imppage_get_widgets', [
|
206 |
+
$widgets,
|
207 |
+
$position,
|
208 |
+
$this->plugin,
|
209 |
+
$this
|
210 |
+
], '4.0.9', 'wbcr/factory/pages/impressive/widgets' );
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @since 4.0.1 - добавлен
|
214 |
+
* @since 4.0.9 - изменено имя
|
215 |
+
*/
|
216 |
+
$widgets = apply_filters( 'wbcr/factory/pages/impressive/widgets', $widgets, $position, $this->plugin, $this );
|
217 |
+
|
218 |
+
return $widgets;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Создает Html разметку виджета для рекламы премиум версии
|
223 |
+
*
|
224 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
225 |
+
* @since 2.0.2
|
226 |
+
*/
|
227 |
+
public function showBusinessSuggetionWidget() {
|
228 |
+
$plugin_name = $this->plugin->getPluginName();
|
229 |
+
$upgrade_price = $this->plugin->has_premium() ? $this->plugin->premium->get_price() : 0;
|
230 |
+
$purchase_url = $this->plugin->get_support()->get_pricing_url( true, 'right_sidebar_ads' );
|
231 |
+
|
232 |
+
$default_features = [
|
233 |
+
'4_premium' => __( '4 premium components now;', 'wbcr_factory_clearfy_217' ),
|
234 |
+
'40_premium' => __( '40 new premium components within a year for the single price;', 'wbcr_factory_clearfy_217' ),
|
235 |
+
'multisite_support' => __( 'Multisite support;', 'wbcr_factory_clearfy_217' ),
|
236 |
+
'advance_settings' => __( 'Advanced settings;', 'wbcr_factory_clearfy_217' ),
|
237 |
+
'no_ads' => __( 'No ads;', 'wbcr_factory_clearfy_217' ),
|
238 |
+
'perfect_support' => __( 'Perfect support.', 'wbcr_factory_clearfy_217' )
|
239 |
+
];
|
240 |
+
|
241 |
+
/**
|
242 |
+
* @since 2.0.8 - added
|
243 |
+
*/
|
244 |
+
$suggetion_title = __( 'MORE IN CLEARFY <span>BUSINESS</span>', 'wbcr_factory_clearfy_217' );
|
245 |
+
$suggetion_title = apply_filters( 'wbcr/clearfy/pages/suggetion_title', $suggetion_title, $plugin_name, $this->id );
|
246 |
+
|
247 |
+
/**
|
248 |
+
* @since 2.0.8 - deprecated
|
249 |
+
*/
|
250 |
+
$suggetion_features = wbcr_factory_425_apply_filters_deprecated( 'wbcr/clearfy/page_bussines_suggetion_features', [
|
251 |
+
$default_features,
|
252 |
+
$this->plugin->getPluginName(),
|
253 |
+
$this->id
|
254 |
+
], '2.0.8', 'wbcr/clearfy/pages/suggetion_features' );
|
255 |
+
|
256 |
+
/**
|
257 |
+
* @since 2.0.8 - renamed
|
258 |
+
* @since 2.0.6
|
259 |
+
*/
|
260 |
+
$suggetion_features = apply_filters( 'wbcr/clearfy/pages/suggetion_features', $suggetion_features, $plugin_name, $this->id );
|
261 |
+
|
262 |
+
if ( empty( $suggetion_features ) ) {
|
263 |
+
$suggetion_features = $default_features;
|
264 |
+
}
|
265 |
+
?>
|
266 |
+
<div class="wbcr-factory-sidebar-widget wbcr-factory-clearfy-217-pro-suggettion">
|
267 |
+
<h3><?php echo $suggetion_title; ?></h3>
|
268 |
+
<ul>
|
269 |
+
<?php if ( ! empty( $suggetion_features ) ): ?>
|
270 |
+
<?php foreach ( $suggetion_features as $feature ): ?>
|
271 |
+
<li><?= $feature ?></li>
|
272 |
+
<?php endforeach; ?>
|
273 |
+
<?php endif; ?>
|
274 |
+
</ul>
|
275 |
+
<a href="<?php echo $purchase_url ?>" class="wbcr-factory-purchase-premium" target="_blank"
|
276 |
+
rel="noopener">
|
277 |
+
<?php printf( __( 'Upgrade for $%s', 'wbcr_factory_clearfy_217' ), $upgrade_price ) ?>
|
278 |
+
</a>
|
279 |
+
</div>
|
280 |
+
<?php
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Создает html разметку виджета с информационными маркерами
|
285 |
+
*
|
286 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
287 |
+
* @since 2.0.0
|
288 |
+
*/
|
289 |
+
public function showInfoWidget() {
|
290 |
+
?>
|
291 |
+
<div class="wbcr-factory-sidebar-widget">
|
292 |
+
<ul>
|
293 |
+
<li>
|
294 |
+
<span class="wbcr-factory-hint-icon-simple wbcr-factory-simple-red">
|
295 |
+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC"
|
296 |
+
alt=""/>
|
297 |
+
</span>
|
298 |
+
- <?php _e( 'A neutral setting that can not harm your site, but you must be sure that you need to use it.', 'wbcr_factory_clearfy_217' ); ?>
|
299 |
+
</li>
|
300 |
+
<li>
|
301 |
+
<span class="wbcr-factory-hint-icon-simple wbcr-factory-simple-grey">
|
302 |
+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC"
|
303 |
+
alt=""/>
|
304 |
+
</span>
|
305 |
+
- <?php _e( 'When set this option, you must be careful. Plugins and themes may depend on this function. You must be sure that you can disable this feature for the site.', 'wbcr_factory_clearfy_217' ); ?>
|
306 |
+
</li>
|
307 |
+
<li>
|
308 |
+
<span class="wbcr-factory-hint-icon-simple wbcr-factory-simple-green">
|
309 |
+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAQAAABKmM6bAAAAUUlEQVQIHU3BsQ1AQABA0X/komIrnQHYwyhqQ1hBo9KZRKL9CBfeAwy2ri42JA4mPQ9rJ6OVt0BisFM3Po7qbEliru7m/FkY+TN64ZVxEzh4ndrMN7+Z+jXCAAAAAElFTkSuQmCC"
|
310 |
+
alt=""/>
|
311 |
+
</span>
|
312 |
+
- <?php _e( 'Absolutely safe setting, We recommend to use.', 'wbcr_factory_clearfy_217' ); ?>
|
313 |
+
</li>
|
314 |
+
</ul>
|
315 |
+
----------<br>
|
316 |
+
<p><?php _e( 'Hover to the icon to get help for the feature you selected.', 'wbcr_factory_clearfy_217' ); ?></p>
|
317 |
+
</div>
|
318 |
+
<?php
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Создает html разметку виджета рейтинга
|
323 |
+
*
|
324 |
+
* @param array $args
|
325 |
+
*
|
326 |
+
* @since 2.0.0
|
327 |
+
*
|
328 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
329 |
+
*/
|
330 |
+
public function showRatingWidget( array $args ) {
|
331 |
+
if ( ! isset( $args[0] ) || empty( $args[0] ) ) {
|
332 |
+
$page_url = "https://goo.gl/tETE2X";
|
333 |
+
} else {
|
334 |
+
$page_url = $args[0];
|
335 |
+
}
|
336 |
+
|
337 |
+
$page_url = apply_filters( 'wbcr_factory_pages_425_imppage_rating_widget_url', $page_url, $this->plugin->getPluginName(), $this->getResultId() );
|
338 |
+
|
339 |
+
?>
|
340 |
+
<div class="wbcr-factory-sidebar-widget">
|
341 |
+
<p>
|
342 |
+
<strong><?php _e( 'Do you want the plugin to improved and update?', 'wbcr_factory_clearfy_217' ); ?></strong>
|
343 |
+
</p>
|
344 |
+
<p><?php _e( 'Help the author, leave a review on wordpress.org. Thanks to feedback, I will know that the plugin is really useful to you and is needed.', 'wbcr_factory_clearfy_217' ); ?></p>
|
345 |
+
<p><?php _e( 'And also write your ideas on how to extend or improve the plugin.', 'wbcr_factory_clearfy_217' ); ?></p>
|
346 |
+
<p>
|
347 |
+
<i class="wbcr-factory-icon-5stars"></i>
|
348 |
+
<a href="<?= $page_url ?>" title="Go rate us" target="_blank">
|
349 |
+
<strong><?php _e( 'Go rate us and push ideas', 'wbcr_factory_clearfy_217' ); ?></strong>
|
350 |
+
</a>
|
351 |
+
</p>
|
352 |
+
</div>
|
353 |
+
<?php
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Создает html размету виджета доната
|
358 |
+
*
|
359 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
360 |
+
* @since 2.0.0
|
361 |
+
*/
|
362 |
+
public function showDonateWidget() {
|
363 |
+
?>
|
364 |
+
<div class="wbcr-factory-sidebar-widget">
|
365 |
+
<p>
|
366 |
+
<strong><?php _e( 'Donation for plugin development', 'wbcr_factory_clearfy_217' ); ?></strong>
|
367 |
+
</p>
|
368 |
+
<?php if ( get_locale() !== 'ru_RU' ): ?>
|
369 |
+
<form id="wbcr-factory-paypal-donation-form" action="https://www.paypal.com/cgi-bin/webscr"
|
370 |
+
method="post" target="_blank">
|
371 |
+
<input type="hidden" name="cmd" value="_s-xclick">
|
372 |
+
<input type="hidden" name="hosted_button_id" value="VDX7JNTQPNPFW">
|
373 |
+
<div class="wbcr-factory-donation-price">5$</div>
|
374 |
+
<input type="image" src="<?= FACTORY_PAGES_425_URL ?>/templates/assets/img/paypal-donate.png"
|
375 |
+
border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
|
376 |
+
</form>
|
377 |
+
<?php else: ?>
|
378 |
+
<iframe frameborder="0" allowtransparency="true" scrolling="no"
|
379 |
+
src="https://money.yandex.ru/embed/donate.xml?account=410011242846510&quickpay=donate&payment-type-choice=on&mobile-payment-type-choice=on&default-sum=300&targets=%D0%9D%D0%B0+%D0%BF%D0%BE%D0%B4%D0%B4%D0%B5%D1%80%D0%B6%D0%BA%D1%83+%D0%BF%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD%D0%B0+%D0%B8+%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D1%83+%D0%BD%D0%BE%D0%B2%D1%8B%D1%85+%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9.+&target-visibility=on&project-name=Webcraftic&project-site=&button-text=05&comment=on&hint=%D0%9A%D0%B0%D0%BA%D1%83%D1%8E+%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8E+%D0%BD%D1%83%D0%B6%D0%BD%D0%BE+%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%B8%D1%82%D1%8C+%D0%B2+%D0%BF%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD%3F&mail=on&successURL="
|
380 |
+
width="508" height="187"></iframe>
|
381 |
+
<?php endif; ?>
|
382 |
+
</div>
|
383 |
+
<?php
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Создает html разметку виджета поддержки
|
388 |
+
*
|
389 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
390 |
+
* @since 2.0.8
|
391 |
+
*/
|
392 |
+
public function showSupportWidget() {
|
393 |
+
$free_support_url = $this->plugin->get_support()->get_contacts_url();
|
394 |
+
$hot_support_url = $this->plugin->get_support()->get_site_url() . '/other-questions-support';
|
395 |
+
|
396 |
+
?>
|
397 |
+
<div id="wbcr-clr-support-widget" class="wbcr-factory-sidebar-widget">
|
398 |
+
<p><strong><?php _e( 'Having Issues?', 'clearfy' ); ?></strong></p>
|
399 |
+
<div class="wbcr-clr-support-widget-body">
|
400 |
+
<p>
|
401 |
+
<?php _e( 'We provide free support for this plugin. If you are pushed with a problem, just create a new ticket. We will definitely help you!', 'clearfy' ); ?>
|
402 |
+
</p>
|
403 |
+
<ul>
|
404 |
+
<li><span class="dashicons dashicons-sos"></span>
|
405 |
+
<a href="<?= $free_support_url ?>" target="_blank"
|
406 |
+
rel="noopener"><?php _e( 'Get starting free support', 'clearfy' ); ?></a>
|
407 |
+
</li>
|
408 |
+
<li style="margin-top: 15px;background: #fff4f1;padding: 10px;color: #a58074;">
|
409 |
+
<span class="dashicons dashicons-warning"></span>
|
410 |
+
<?php printf( __( 'If you find a php error or a vulnerability in plugin, you can <a href="%s" target="_blank" rel="noopener">create ticket</a> in hot support that we responded instantly.', 'clearfy' ), $hot_support_url ); ?>
|
411 |
+
</li>
|
412 |
+
</ul>
|
413 |
+
</div>
|
414 |
+
</div>
|
415 |
+
<?php
|
416 |
+
}
|
417 |
+
}
|
418 |
+
|
libs/factory/core/README.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
# Core Factory Framework
|
2 |
+
|
3 |
+
It performs the connection of system modules of the framework, is responsible for migrations, plugin updates, admin notifications, initialization of the plugin.
|
libs/factory/core/boot.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Factory Plugin
|
4 |
*
|
5 |
-
* @author
|
|
|
|
|
6 |
* @copyright (c) 2018, Webcraftic Ltd
|
7 |
*
|
8 |
-
* @package core
|
9 |
-
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -14,49 +14,49 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if ( defined( '
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
-
define( '
|
22 |
|
23 |
-
define( '
|
24 |
|
25 |
-
define( '
|
26 |
-
define( '
|
27 |
|
28 |
-
load_plugin_textdomain( '
|
29 |
|
30 |
#comp merge
|
31 |
-
require_once(
|
32 |
|
33 |
-
require_once(
|
34 |
-
require_once(
|
35 |
|
36 |
-
require_once(
|
37 |
-
require_once(
|
38 |
-
require_once(
|
39 |
-
require_once(
|
40 |
-
require_once(
|
41 |
|
42 |
// ASSETS
|
43 |
-
require_once(
|
44 |
-
require_once(
|
45 |
-
require_once(
|
46 |
|
47 |
// PREMIUM
|
48 |
-
require_once(
|
49 |
-
require_once(
|
50 |
-
require_once(
|
51 |
|
52 |
// UPDATES
|
53 |
-
require_once(
|
54 |
-
require_once(
|
55 |
-
require_once(
|
56 |
-
require_once(
|
57 |
|
58 |
-
require_once(
|
59 |
|
60 |
-
require_once(
|
61 |
-
require_once(
|
62 |
#endcomp
|
2 |
/**
|
3 |
* Factory Plugin
|
4 |
*
|
5 |
+
* @author @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @since 1.0.0
|
7 |
+
* @package core
|
8 |
* @copyright (c) 2018, Webcraftic Ltd
|
9 |
*
|
|
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if ( defined( 'FACTORY_425_LOADED' ) ) {
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
+
define( 'FACTORY_425_LOADED', true );
|
22 |
|
23 |
+
define( 'FACTORY_425_VERSION', '4.2.5' );
|
24 |
|
25 |
+
define( 'FACTORY_425_DIR', dirname( __FILE__ ) );
|
26 |
+
define( 'FACTORY_425_URL', plugins_url( null, __FILE__ ) );
|
27 |
|
28 |
+
load_plugin_textdomain( 'wbcr_factory_425', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' );
|
29 |
|
30 |
#comp merge
|
31 |
+
require_once( FACTORY_425_DIR . '/includes/functions.php' );
|
32 |
|
33 |
+
require_once( FACTORY_425_DIR . '/includes/entities/class-factory-paths.php' );
|
34 |
+
require_once( FACTORY_425_DIR . '/includes/entities/class-factory-support.php' );
|
35 |
|
36 |
+
require_once( FACTORY_425_DIR . '/includes/class-factory-requests.php' );
|
37 |
+
require_once( FACTORY_425_DIR . '/includes/class-factory-options.php' );
|
38 |
+
require_once( FACTORY_425_DIR . '/includes/class-factory-plugin-base.php' );
|
39 |
+
require_once( FACTORY_425_DIR . '/includes/class-factory-migrations.php' );
|
40 |
+
require_once( FACTORY_425_DIR . '/includes/class-factory-notices.php' );
|
41 |
|
42 |
// ASSETS
|
43 |
+
require_once( FACTORY_425_DIR . '/includes/assets-managment/class-factory-assets-list.php' );
|
44 |
+
require_once( FACTORY_425_DIR . '/includes/assets-managment/class-factory-script-list.php' );
|
45 |
+
require_once( FACTORY_425_DIR . '/includes/assets-managment/class-factory-style-list.php' );
|
46 |
|
47 |
// PREMIUM
|
48 |
+
require_once( FACTORY_425_DIR . '/includes/premium/class-factory-license-interface.php' );
|
49 |
+
require_once( FACTORY_425_DIR . '/includes/premium/class-factory-provider-abstract.php' );
|
50 |
+
require_once( FACTORY_425_DIR . '/includes/premium/class-factory-manager.php' );
|
51 |
|
52 |
// UPDATES
|
53 |
+
require_once( FACTORY_425_DIR . '/includes/updates/repositories/class-factory-repository-abstract.php' );
|
54 |
+
require_once( FACTORY_425_DIR . '/includes/updates/repositories/class-factory-wordpress.php' );
|
55 |
+
require_once( FACTORY_425_DIR . '/includes/updates/class-factory-upgrader.php' );
|
56 |
+
require_once( FACTORY_425_DIR . '/includes/updates/class-factory-premium-upgrader.php' );
|
57 |
|
58 |
+
require_once( FACTORY_425_DIR . '/includes/class-factory-plugin-abstract.php' );
|
59 |
|
60 |
+
require_once( FACTORY_425_DIR . '/includes/activation/class-factory-activator.php' );
|
61 |
+
require_once( FACTORY_425_DIR . '/includes/activation/class-factory-update.php' );
|
62 |
#endcomp
|
libs/factory/core/includes/activation/class-factory-activator.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* The file contains a base class for plugin activators.
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @
|
7 |
*
|
8 |
-
* @package
|
9 |
-
* @since
|
10 |
*/
|
11 |
// Exit if accessed directly
|
12 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -19,24 +19,25 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
-
abstract class
|
23 |
-
|
24 |
/**
|
25 |
* Curent plugin.
|
26 |
-
*
|
|
|
27 |
*/
|
28 |
public $plugin;
|
29 |
-
|
30 |
-
public function __construct(
|
31 |
$this->plugin = $plugin;
|
32 |
}
|
33 |
-
|
34 |
public function activate() {
|
35 |
}
|
36 |
-
|
37 |
public function deactivate() {
|
38 |
}
|
39 |
-
|
40 |
public function update() {
|
41 |
}
|
42 |
}
|
2 |
/**
|
3 |
* The file contains a base class for plugin activators.
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
7 |
*
|
8 |
+
* @package factory-core
|
9 |
+
* @since 1.0.0
|
10 |
*/
|
11 |
// Exit if accessed directly
|
12 |
if ( ! defined( 'ABSPATH' ) ) {
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
+
abstract class Wbcr_Factory425_Activator {
|
23 |
+
|
24 |
/**
|
25 |
* Curent plugin.
|
26 |
+
*
|
27 |
+
* @var Wbcr_Factory425_Plugin
|
28 |
*/
|
29 |
public $plugin;
|
30 |
+
|
31 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
32 |
$this->plugin = $plugin;
|
33 |
}
|
34 |
+
|
35 |
public function activate() {
|
36 |
}
|
37 |
+
|
38 |
public function deactivate() {
|
39 |
}
|
40 |
+
|
41 |
public function update() {
|
42 |
}
|
43 |
}
|
libs/factory/core/includes/activation/class-factory-update.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* The file contains a base class for update items of plugins.
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @
|
7 |
*
|
8 |
-
* @package
|
9 |
-
* @since
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -20,19 +20,20 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
abstract class
|
24 |
-
|
25 |
/**
|
26 |
* Current plugin
|
27 |
-
*
|
|
|
28 |
*/
|
29 |
var $plugin;
|
30 |
-
|
31 |
-
public function __construct(
|
32 |
$this->plugin = $plugin;
|
33 |
}
|
34 |
-
|
35 |
abstract function install();
|
36 |
-
|
37 |
//abstract function rollback();
|
38 |
}
|
2 |
/**
|
3 |
* The file contains a base class for update items of plugins.
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
7 |
*
|
8 |
+
* @package factory-core
|
9 |
+
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
abstract class Wbcr_Factory425_Update {
|
24 |
+
|
25 |
/**
|
26 |
* Current plugin
|
27 |
+
*
|
28 |
+
* @var Wbcr_Factory425_Plugin
|
29 |
*/
|
30 |
var $plugin;
|
31 |
+
|
32 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
33 |
$this->plugin = $plugin;
|
34 |
}
|
35 |
+
|
36 |
abstract function install();
|
37 |
+
|
38 |
//abstract function rollback();
|
39 |
}
|
libs/factory/core/includes/activation/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/includes/assets-managment/class-factory-assets-list.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* The class contains a base class for all lists of assets.
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @
|
7 |
*
|
8 |
-
* @package
|
9 |
-
* @since
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -19,27 +19,27 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
-
class
|
23 |
-
|
24 |
-
protected $all =
|
25 |
-
public $header_place =
|
26 |
-
public $footer_place =
|
27 |
-
public $required =
|
28 |
-
|
29 |
protected $default_place;
|
30 |
-
|
31 |
/**
|
32 |
-
* @var
|
33 |
*/
|
34 |
protected $plugin;
|
35 |
-
|
36 |
/**
|
37 |
-
* @param
|
38 |
-
* @param bool
|
39 |
*/
|
40 |
-
public function __construct(
|
41 |
$this->plugin = $plugin;
|
42 |
-
|
43 |
if ( $defaultIsFooter ) {
|
44 |
$this->default_place = &$this->footer_place;
|
45 |
}
|
@@ -47,23 +47,24 @@ class Wbcr_Factory414_AssetsList {
|
|
47 |
$this->default_place = &$this->header_place;
|
48 |
}
|
49 |
}
|
50 |
-
|
51 |
/**
|
52 |
* Remove items from the collection
|
|
|
53 |
* @return $this
|
54 |
*/
|
55 |
public function deregister() {
|
56 |
foreach ( func_get_args() as $item ) {
|
57 |
-
|
58 |
if ( ! is_string( $item ) ) {
|
59 |
return $this;
|
60 |
}
|
61 |
-
|
62 |
$key_in_all = array_search( $item, $this->all );
|
63 |
$key_in_default_place = array_search( $item, $this->default_place );
|
64 |
$key_in_header_place = array_search( $item, $this->header_place );
|
65 |
$key_inFooterPlace = array_search( $item, $this->footer_place );
|
66 |
-
|
67 |
if ( $key_in_all ) {
|
68 |
unset( $this->all[ $key_in_all ] );
|
69 |
}
|
@@ -77,14 +78,14 @@ class Wbcr_Factory414_AssetsList {
|
|
77 |
unset( $this->footer_place[ $key_inFooterPlace ] );
|
78 |
}
|
79 |
}
|
80 |
-
|
81 |
return $this;
|
82 |
}
|
83 |
-
|
84 |
/**
|
85 |
* Checks whether the collection is empty.
|
86 |
*
|
87 |
-
* @param string $source
|
88 |
*
|
89 |
* @return boolean
|
90 |
*/
|
@@ -92,25 +93,25 @@ class Wbcr_Factory414_AssetsList {
|
|
92 |
if ( 'bootstrap' === $source ) {
|
93 |
return empty( $this->required[ $source ] );
|
94 |
}
|
95 |
-
|
96 |
return empty( $this->all ) && empty( $this->required );
|
97 |
}
|
98 |
-
|
99 |
public function IsHeaderEmpty() {
|
100 |
return empty( $this->header_place );
|
101 |
}
|
102 |
-
|
103 |
public function IsFooterEmpty() {
|
104 |
return empty( $this->footer_place );
|
105 |
}
|
106 |
-
|
107 |
/**
|
108 |
* Adds new items to the requried collection.
|
109 |
*
|
110 |
* @param mixed
|
111 |
*/
|
112 |
public function request( $items, $source = 'wordpress' ) {
|
113 |
-
|
114 |
if ( is_array( $items ) ) {
|
115 |
foreach ( $items as $item ) {
|
116 |
$this->required[ $source ][] = $item;
|
@@ -118,7 +119,7 @@ class Wbcr_Factory414_AssetsList {
|
|
118 |
} else {
|
119 |
$this->required[ $source ][] = $items;
|
120 |
}
|
121 |
-
|
122 |
return $this;
|
123 |
}
|
124 |
}
|
2 |
/**
|
3 |
* The class contains a base class for all lists of assets.
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
7 |
*
|
8 |
+
* @package factory-core
|
9 |
+
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
+
class Wbcr_Factory425_AssetsList {
|
23 |
+
|
24 |
+
protected $all = [];
|
25 |
+
public $header_place = [];
|
26 |
+
public $footer_place = [];
|
27 |
+
public $required = [];
|
28 |
+
|
29 |
protected $default_place;
|
30 |
+
|
31 |
/**
|
32 |
+
* @var Wbcr_Factory425_Plugin
|
33 |
*/
|
34 |
protected $plugin;
|
35 |
+
|
36 |
/**
|
37 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
38 |
+
* @param bool $defaultIsFooter
|
39 |
*/
|
40 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin, $defaultIsFooter = true ) {
|
41 |
$this->plugin = $plugin;
|
42 |
+
|
43 |
if ( $defaultIsFooter ) {
|
44 |
$this->default_place = &$this->footer_place;
|
45 |
}
|
47 |
$this->default_place = &$this->header_place;
|
48 |
}
|
49 |
}
|
50 |
+
|
51 |
/**
|
52 |
* Remove items from the collection
|
53 |
+
*
|
54 |
* @return $this
|
55 |
*/
|
56 |
public function deregister() {
|
57 |
foreach ( func_get_args() as $item ) {
|
58 |
+
|
59 |
if ( ! is_string( $item ) ) {
|
60 |
return $this;
|
61 |
}
|
62 |
+
|
63 |
$key_in_all = array_search( $item, $this->all );
|
64 |
$key_in_default_place = array_search( $item, $this->default_place );
|
65 |
$key_in_header_place = array_search( $item, $this->header_place );
|
66 |
$key_inFooterPlace = array_search( $item, $this->footer_place );
|
67 |
+
|
68 |
if ( $key_in_all ) {
|
69 |
unset( $this->all[ $key_in_all ] );
|
70 |
}
|
78 |
unset( $this->footer_place[ $key_inFooterPlace ] );
|
79 |
}
|
80 |
}
|
81 |
+
|
82 |
return $this;
|
83 |
}
|
84 |
+
|
85 |
/**
|
86 |
* Checks whether the collection is empty.
|
87 |
*
|
88 |
+
* @param string $source if the 'bootstrap' specified, checks only whether the bootstrap assets were required.
|
89 |
*
|
90 |
* @return boolean
|
91 |
*/
|
93 |
if ( 'bootstrap' === $source ) {
|
94 |
return empty( $this->required[ $source ] );
|
95 |
}
|
96 |
+
|
97 |
return empty( $this->all ) && empty( $this->required );
|
98 |
}
|
99 |
+
|
100 |
public function IsHeaderEmpty() {
|
101 |
return empty( $this->header_place );
|
102 |
}
|
103 |
+
|
104 |
public function IsFooterEmpty() {
|
105 |
return empty( $this->footer_place );
|
106 |
}
|
107 |
+
|
108 |
/**
|
109 |
* Adds new items to the requried collection.
|
110 |
*
|
111 |
* @param mixed
|
112 |
*/
|
113 |
public function request( $items, $source = 'wordpress' ) {
|
114 |
+
|
115 |
if ( is_array( $items ) ) {
|
116 |
foreach ( $items as $item ) {
|
117 |
$this->required[ $source ][] = $item;
|
119 |
} else {
|
120 |
$this->required[ $source ][] = $items;
|
121 |
}
|
122 |
+
|
123 |
return $this;
|
124 |
}
|
125 |
}
|
libs/factory/core/includes/assets-managment/class-factory-script-list.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* The file contains a class to manage script assets.
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @
|
7 |
*
|
8 |
-
* @package
|
9 |
-
* @since
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -20,11 +20,11 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
class
|
24 |
-
|
25 |
-
public $localize_data =
|
26 |
public $use_ajax = false;
|
27 |
-
|
28 |
/**
|
29 |
* Adds new items to the collection (default place).
|
30 |
*
|
@@ -32,20 +32,20 @@ class Wbcr_Factory414_ScriptList extends Wbcr_Factory414_AssetsList {
|
|
32 |
*
|
33 |
* @version 2.0
|
34 |
*/
|
35 |
-
public function add( $file_url, $deps =
|
36 |
-
|
37 |
if ( empty( $file_url ) ) {
|
38 |
return $this;
|
39 |
}
|
40 |
-
|
41 |
-
$resource =
|
42 |
$resource['file_url'] = $file_url;
|
43 |
$resource['deps'] = $deps;
|
44 |
$resource['handle'] = $handle;
|
45 |
$resource['version'] = $version;
|
46 |
-
|
47 |
$this->all[] = $resource;
|
48 |
-
|
49 |
switch ( $place ) {
|
50 |
case 'header':
|
51 |
$this->header_place[] = $resource;
|
@@ -57,84 +57,84 @@ class Wbcr_Factory414_ScriptList extends Wbcr_Factory414_AssetsList {
|
|
57 |
$this->default_place[] = $resource;
|
58 |
break;
|
59 |
}
|
60 |
-
|
61 |
return $this;
|
62 |
}
|
63 |
-
|
64 |
/**
|
65 |
* Adds new items to the collection (header).
|
66 |
*
|
67 |
* @param mixed
|
68 |
*/
|
69 |
-
public function addToHeader( $file_url, $deps =
|
70 |
return $this->add( $file_url, $deps, $handle, 'header' );
|
71 |
}
|
72 |
-
|
73 |
/**
|
74 |
* Adds new items to the collection (footer).
|
75 |
*
|
76 |
* @param mixed
|
77 |
*/
|
78 |
-
public function addToFooter( $file_url, $deps =
|
79 |
return $this->add( $file_url, $deps, $handle, 'footer' );
|
80 |
}
|
81 |
-
|
82 |
/**
|
83 |
* Осуществляет подключение всех зарегистрированных скриптов
|
84 |
*
|
85 |
* @param string $source
|
86 |
*/
|
87 |
public function connect( $source = 'wordpress' ) {
|
88 |
-
|
89 |
// register all global required scripts
|
90 |
if ( ! empty( $this->required[ $source ] ) ) {
|
91 |
foreach ( $this->required[ $source ] as $script ) {
|
92 |
if ( 'wordpress' === $source ) {
|
93 |
wp_enqueue_script( $script );
|
94 |
-
}
|
95 |
$this->plugin->bootstrap->enqueueScript( $script );
|
96 |
}
|
97 |
}
|
98 |
}
|
99 |
-
|
100 |
if ( $source == 'bootstrap' ) {
|
101 |
return;
|
102 |
}
|
103 |
-
|
104 |
$is_first_script = true;
|
105 |
$is_footer = false;
|
106 |
-
|
107 |
// register all other scripts
|
108 |
-
foreach (
|
109 |
foreach ( $script_place as $script ) {
|
110 |
-
|
111 |
if ( empty( $script['file_url'] ) ) {
|
112 |
continue;
|
113 |
}
|
114 |
-
|
115 |
$handle = ! empty( $script['handle'] ) ? $script['handle'] : $script['file_url'];
|
116 |
-
$deps = ! is_array( $script['deps'] ) ?
|
117 |
$version = ! empty( $script['version'] ) ? $script['version'] : $this->plugin->getPluginVersion();
|
118 |
-
|
119 |
wp_register_script( $handle, $script['file_url'], $deps, $version, $is_footer );
|
120 |
-
|
121 |
if ( $is_first_script && $this->use_ajax ) {
|
122 |
-
wp_localize_script( $handle, 'factory',
|
123 |
}
|
124 |
-
|
125 |
if ( ! empty( $this->localize_data[ $handle ] ) ) {
|
126 |
wp_localize_script( $handle, $this->localize_data[ $handle ][0], $this->localize_data[ $handle ][1] );
|
127 |
}
|
128 |
-
|
129 |
wp_enqueue_script( $handle );
|
130 |
-
|
131 |
$is_first_script = false;
|
132 |
}
|
133 |
-
|
134 |
$is_footer = true;
|
135 |
}
|
136 |
}
|
137 |
-
|
138 |
/**
|
139 |
* Если вызвать этот метод, на странице будет обязательно добавлена
|
140 |
* глобальная JS переменная с ссылкой на ajax обработчик
|
@@ -142,24 +142,24 @@ class Wbcr_Factory414_ScriptList extends Wbcr_Factory414_AssetsList {
|
|
142 |
public function useAjax() {
|
143 |
$this->use_ajax = true;
|
144 |
}
|
145 |
-
|
146 |
/**
|
147 |
* Регистрирует глобальную JS переменную с пользовательскими данными
|
148 |
*
|
149 |
* @param string $varname
|
150 |
* @param string $data
|
151 |
*
|
152 |
-
* @return
|
153 |
*/
|
154 |
public function localize( $varname, $data ) {
|
155 |
$bindTo = count( $this->all ) == 0 ? null : end( $this->all );
|
156 |
-
|
157 |
if ( ! $bindTo ) {
|
158 |
return $this;
|
159 |
}
|
160 |
-
|
161 |
-
$this->localize_data[ $bindTo ] =
|
162 |
-
|
163 |
return $this;
|
164 |
}
|
165 |
}
|
2 |
/**
|
3 |
* The file contains a class to manage script assets.
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
7 |
*
|
8 |
+
* @package factory-core
|
9 |
+
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
class Wbcr_Factory425_ScriptList extends Wbcr_Factory425_AssetsList {
|
24 |
+
|
25 |
+
public $localize_data = [];
|
26 |
public $use_ajax = false;
|
27 |
+
|
28 |
/**
|
29 |
* Adds new items to the collection (default place).
|
30 |
*
|
32 |
*
|
33 |
* @version 2.0
|
34 |
*/
|
35 |
+
public function add( $file_url, $deps = [ 'jquery' ], $handle = null, $version = false, $place = 'default' ) {
|
36 |
+
|
37 |
if ( empty( $file_url ) ) {
|
38 |
return $this;
|
39 |
}
|
40 |
+
|
41 |
+
$resource = [];
|
42 |
$resource['file_url'] = $file_url;
|
43 |
$resource['deps'] = $deps;
|
44 |
$resource['handle'] = $handle;
|
45 |
$resource['version'] = $version;
|
46 |
+
|
47 |
$this->all[] = $resource;
|
48 |
+
|
49 |
switch ( $place ) {
|
50 |
case 'header':
|
51 |
$this->header_place[] = $resource;
|
57 |
$this->default_place[] = $resource;
|
58 |
break;
|
59 |
}
|
60 |
+
|
61 |
return $this;
|
62 |
}
|
63 |
+
|
64 |
/**
|
65 |
* Adds new items to the collection (header).
|
66 |
*
|
67 |
* @param mixed
|
68 |
*/
|
69 |
+
public function addToHeader( $file_url, $deps = [ 'jquery' ], $handle = null ) {
|
70 |
return $this->add( $file_url, $deps, $handle, 'header' );
|
71 |
}
|
72 |
+
|
73 |
/**
|
74 |
* Adds new items to the collection (footer).
|
75 |
*
|
76 |
* @param mixed
|
77 |
*/
|
78 |
+
public function addToFooter( $file_url, $deps = [ 'jquery' ], $handle = null ) {
|
79 |
return $this->add( $file_url, $deps, $handle, 'footer' );
|
80 |
}
|
81 |
+
|
82 |
/**
|
83 |
* Осуществляет подключение всех зарегистрированных скриптов
|
84 |
*
|
85 |
* @param string $source
|
86 |
*/
|
87 |
public function connect( $source = 'wordpress' ) {
|
88 |
+
|
89 |
// register all global required scripts
|
90 |
if ( ! empty( $this->required[ $source ] ) ) {
|
91 |
foreach ( $this->required[ $source ] as $script ) {
|
92 |
if ( 'wordpress' === $source ) {
|
93 |
wp_enqueue_script( $script );
|
94 |
+
} else if ( 'bootstrap' === $source ) {
|
95 |
$this->plugin->bootstrap->enqueueScript( $script );
|
96 |
}
|
97 |
}
|
98 |
}
|
99 |
+
|
100 |
if ( $source == 'bootstrap' ) {
|
101 |
return;
|
102 |
}
|
103 |
+
|
104 |
$is_first_script = true;
|
105 |
$is_footer = false;
|
106 |
+
|
107 |
// register all other scripts
|
108 |
+
foreach ( [ $this->header_place, $this->footer_place ] as $script_place ) {
|
109 |
foreach ( $script_place as $script ) {
|
110 |
+
|
111 |
if ( empty( $script['file_url'] ) ) {
|
112 |
continue;
|
113 |
}
|
114 |
+
|
115 |
$handle = ! empty( $script['handle'] ) ? $script['handle'] : $script['file_url'];
|
116 |
+
$deps = ! is_array( $script['deps'] ) ? [] : $script['deps'];
|
117 |
$version = ! empty( $script['version'] ) ? $script['version'] : $this->plugin->getPluginVersion();
|
118 |
+
|
119 |
wp_register_script( $handle, $script['file_url'], $deps, $version, $is_footer );
|
120 |
+
|
121 |
if ( $is_first_script && $this->use_ajax ) {
|
122 |
+
wp_localize_script( $handle, 'factory', [ 'ajaxurl' => admin_url( 'admin-ajax.php' ) ] );
|
123 |
}
|
124 |
+
|
125 |
if ( ! empty( $this->localize_data[ $handle ] ) ) {
|
126 |
wp_localize_script( $handle, $this->localize_data[ $handle ][0], $this->localize_data[ $handle ][1] );
|
127 |
}
|
128 |
+
|
129 |
wp_enqueue_script( $handle );
|
130 |
+
|
131 |
$is_first_script = false;
|
132 |
}
|
133 |
+
|
134 |
$is_footer = true;
|
135 |
}
|
136 |
}
|
137 |
+
|
138 |
/**
|
139 |
* Если вызвать этот метод, на странице будет обязательно добавлена
|
140 |
* глобальная JS переменная с ссылкой на ajax обработчик
|
142 |
public function useAjax() {
|
143 |
$this->use_ajax = true;
|
144 |
}
|
145 |
+
|
146 |
/**
|
147 |
* Регистрирует глобальную JS переменную с пользовательскими данными
|
148 |
*
|
149 |
* @param string $varname
|
150 |
* @param string $data
|
151 |
*
|
152 |
+
* @return Wbcr_Factory425_ScriptList $this
|
153 |
*/
|
154 |
public function localize( $varname, $data ) {
|
155 |
$bindTo = count( $this->all ) == 0 ? null : end( $this->all );
|
156 |
+
|
157 |
if ( ! $bindTo ) {
|
158 |
return $this;
|
159 |
}
|
160 |
+
|
161 |
+
$this->localize_data[ $bindTo ] = [ $varname, $data ];
|
162 |
+
|
163 |
return $this;
|
164 |
}
|
165 |
}
|
libs/factory/core/includes/assets-managment/class-factory-style-list.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* The file contains a class to manage style assets.
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @
|
7 |
*
|
8 |
-
* @package
|
9 |
-
* @since
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -20,8 +20,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
class
|
24 |
-
|
25 |
/**
|
26 |
* Adds new items to the collection (default place).
|
27 |
*
|
@@ -29,56 +29,56 @@ class Wbcr_Factory414_StyleList extends Wbcr_Factory414_AssetsList {
|
|
29 |
*
|
30 |
* @version 2.0
|
31 |
*/
|
32 |
-
public function add( $file_url, $deps =
|
33 |
-
|
34 |
if ( empty( $file_url ) ) {
|
35 |
return $this;
|
36 |
}
|
37 |
-
|
38 |
-
$resource =
|
39 |
$resource['file_url'] = $file_url;
|
40 |
$resource['deps'] = $deps;
|
41 |
$resource['handle'] = $handle;
|
42 |
$resource['version'] = $version;
|
43 |
$resource['media'] = $media;
|
44 |
-
|
45 |
$this->all[] = $resource;
|
46 |
-
|
47 |
return $this;
|
48 |
}
|
49 |
-
|
50 |
public function connect( $source = 'wordpress' ) {
|
51 |
// register all global required scripts
|
52 |
if ( ! empty( $this->required[ $source ] ) ) {
|
53 |
-
|
54 |
foreach ( $this->required[ $source ] as $style ) {
|
55 |
if ( 'wordpress' === $source ) {
|
56 |
wp_enqueue_style( $style );
|
57 |
-
}
|
58 |
$this->plugin->bootstrap->enqueueStyle( $style );
|
59 |
}
|
60 |
}
|
61 |
}
|
62 |
-
|
63 |
if ( $source == 'bootstrap' ) {
|
64 |
return;
|
65 |
}
|
66 |
-
|
67 |
if ( empty( $this->all ) ) {
|
68 |
return;
|
69 |
}
|
70 |
-
|
71 |
// register all other styles
|
72 |
foreach ( $this->all as $style ) {
|
73 |
-
|
74 |
if ( empty( $style['file_url'] ) ) {
|
75 |
continue;
|
76 |
}
|
77 |
-
|
78 |
$handle = ! empty( $style['handle'] ) ? $style['handle'] : md5( $style['file_url'] );
|
79 |
-
$deps = ! is_array( $style['deps'] ) ?
|
80 |
$version = ! empty( $style['version'] ) ? $style['version'] : $this->plugin->getPluginVersion();
|
81 |
-
|
82 |
wp_enqueue_style( $handle, $style['file_url'], $deps, $version );
|
83 |
}
|
84 |
}
|
2 |
/**
|
3 |
* The file contains a class to manage style assets.
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
7 |
*
|
8 |
+
* @package factory-core
|
9 |
+
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
class Wbcr_Factory425_StyleList extends Wbcr_Factory425_AssetsList {
|
24 |
+
|
25 |
/**
|
26 |
* Adds new items to the collection (default place).
|
27 |
*
|
29 |
*
|
30 |
* @version 2.0
|
31 |
*/
|
32 |
+
public function add( $file_url, $deps = [], $handle = null, $version = false, $media = 'all' ) {
|
33 |
+
|
34 |
if ( empty( $file_url ) ) {
|
35 |
return $this;
|
36 |
}
|
37 |
+
|
38 |
+
$resource = [];
|
39 |
$resource['file_url'] = $file_url;
|
40 |
$resource['deps'] = $deps;
|
41 |
$resource['handle'] = $handle;
|
42 |
$resource['version'] = $version;
|
43 |
$resource['media'] = $media;
|
44 |
+
|
45 |
$this->all[] = $resource;
|
46 |
+
|
47 |
return $this;
|
48 |
}
|
49 |
+
|
50 |
public function connect( $source = 'wordpress' ) {
|
51 |
// register all global required scripts
|
52 |
if ( ! empty( $this->required[ $source ] ) ) {
|
53 |
+
|
54 |
foreach ( $this->required[ $source ] as $style ) {
|
55 |
if ( 'wordpress' === $source ) {
|
56 |
wp_enqueue_style( $style );
|
57 |
+
} else if ( 'bootstrap' === $source ) {
|
58 |
$this->plugin->bootstrap->enqueueStyle( $style );
|
59 |
}
|
60 |
}
|
61 |
}
|
62 |
+
|
63 |
if ( $source == 'bootstrap' ) {
|
64 |
return;
|
65 |
}
|
66 |
+
|
67 |
if ( empty( $this->all ) ) {
|
68 |
return;
|
69 |
}
|
70 |
+
|
71 |
// register all other styles
|
72 |
foreach ( $this->all as $style ) {
|
73 |
+
|
74 |
if ( empty( $style['file_url'] ) ) {
|
75 |
continue;
|
76 |
}
|
77 |
+
|
78 |
$handle = ! empty( $style['handle'] ) ? $style['handle'] : md5( $style['file_url'] );
|
79 |
+
$deps = ! is_array( $style['deps'] ) ? [] : $style['deps'];
|
80 |
$version = ! empty( $style['version'] ) ? $style['version'] : $this->plugin->getPluginVersion();
|
81 |
+
|
82 |
wp_enqueue_style( $handle, $style['file_url'], $deps, $version );
|
83 |
}
|
84 |
}
|
libs/factory/core/includes/assets-managment/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/includes/class-check-compatibility.php
CHANGED
@@ -1,128 +1,122 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
}
|
27 |
-
|
28 |
-
add_action('admin_init', array($this, 'registerNotices'));
|
29 |
}
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
*
|
34 |
-
* @return bool
|
35 |
-
*/
|
36 |
-
public function check()
|
37 |
-
{
|
38 |
-
if( !$this->isPhpCompatibility() ) {
|
39 |
-
return false;
|
40 |
-
}
|
41 |
-
|
42 |
-
if( !$this->isWpCompatibility() ) {
|
43 |
-
return false;
|
44 |
-
}
|
45 |
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
*
|
52 |
-
* @return mixed
|
53 |
-
*/
|
54 |
-
public function isPhpCompatibility()
|
55 |
-
{
|
56 |
-
return version_compare(PHP_VERSION, $this->required_php_version, '>=');
|
57 |
}
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
*
|
62 |
-
* @return mixed
|
63 |
-
*/
|
64 |
-
public function isWpCompatibility()
|
65 |
-
{
|
66 |
-
// Get the WP Version global.
|
67 |
-
global $wp_version;
|
68 |
-
|
69 |
-
return version_compare($wp_version, $this->required_wp_version, '>=');
|
70 |
-
}
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
$notice_default_text .= '<b>' . $this->plugin_title . ' ' . __('warning', '') . ':</b>' . '<br>';
|
81 |
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
-
|
|
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
$notice_text .= '- ' . sprintf(__('You need to update WordPress to %s or higher!', 'wbcr_factory_414'), $this->required_wp_version) . '<br>';
|
95 |
-
}
|
96 |
|
97 |
-
|
98 |
-
$notice_text = $notice_default_text . $notice_text;
|
99 |
-
}
|
100 |
|
101 |
-
|
|
|
|
|
102 |
}
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
add_action('network_admin_notices', array($this, 'showNotice'));
|
109 |
-
}
|
110 |
|
111 |
-
|
112 |
-
|
113 |
}
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
$notice_text = $this->getNoticeText();
|
118 |
|
119 |
-
|
120 |
-
|
|
|
|
|
121 |
}
|
122 |
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
-
|
|
|
126 |
}
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
-
}
|
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Проверяет совместимость с плагинами Webcraftic, с версиями php, с версиями Wordpress
|
5 |
+
*
|
6 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
7 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
8 |
+
*
|
9 |
+
* @version 1.0.0
|
10 |
+
* @since 4.0.8
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! class_exists( 'Wbcr_Factory_Compatibility' ) ) {
|
14 |
+
class Wbcr_Factory_Compatibility {
|
15 |
+
|
16 |
+
protected $plugin_prefix;
|
17 |
+
protected $plugin_class_prefix;
|
18 |
+
protected $plugin_name;
|
19 |
+
protected $plugin_title = "(no title)";
|
20 |
+
protected $required_php_version = '5.3';
|
21 |
+
protected $required_wp_version = '4.2.0';
|
22 |
+
|
23 |
+
function __construct( array $plugin_info ) {
|
24 |
+
foreach ( (array) $plugin_info as $property => $value ) {
|
25 |
+
$this->$property = $value;
|
|
|
|
|
|
|
26 |
}
|
27 |
|
28 |
+
add_action( 'admin_init', [ $this, 'registerNotices' ] );
|
29 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
/**
|
32 |
+
* Метод проверяет совместимость плагина с php и wordpress версией
|
33 |
+
*
|
34 |
+
* @return bool
|
35 |
+
*/
|
36 |
+
public function check() {
|
37 |
+
if ( ! $this->isPhpCompatibility() ) {
|
38 |
+
return false;
|
39 |
}
|
40 |
|
41 |
+
if ( ! $this->isWpCompatibility() ) {
|
42 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
+
return true;
|
46 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
/**
|
49 |
+
* Метод проверяет совместимость плагина с php версией сервера
|
50 |
+
*
|
51 |
+
* @return mixed
|
52 |
+
*/
|
53 |
+
public function isPhpCompatibility() {
|
54 |
+
return version_compare( PHP_VERSION, $this->required_php_version, '>=' );
|
55 |
+
}
|
|
|
56 |
|
57 |
+
/**
|
58 |
+
* Метод проверяет совместимость плагина с Wordpress версией сайта
|
59 |
+
*
|
60 |
+
* @return mixed
|
61 |
+
*/
|
62 |
+
public function isWpCompatibility() {
|
63 |
+
// Get the WP Version global.
|
64 |
+
global $wp_version;
|
65 |
|
66 |
+
return version_compare( $wp_version, $this->required_wp_version, '>=' );
|
67 |
+
}
|
68 |
|
69 |
+
/**
|
70 |
+
* Метод возвращает текст уведомления
|
71 |
+
*
|
72 |
+
* @return string
|
73 |
+
*/
|
74 |
+
public function getNoticeText() {
|
75 |
+
$notice_text = $notice_default_text = '';
|
76 |
+
$notice_default_text .= '<b>' . $this->plugin_title . ' ' . __( 'warning', '' ) . ':</b>' . '<br>';
|
77 |
|
78 |
+
$notice_default_text .= sprintf( __( 'The %s plugin has stopped.', 'wbcr_factory_clearfy_217' ), $this->plugin_title ) . ' ';
|
79 |
+
$notice_default_text .= __( 'Possible reasons:', '' ) . ' <br>';
|
|
|
|
|
80 |
|
81 |
+
$has_one = false;
|
|
|
|
|
82 |
|
83 |
+
if ( ! $this->isPhpCompatibility() ) {
|
84 |
+
$has_one = true;
|
85 |
+
$notice_text .= '- ' . sprintf( __( 'You need to update the PHP version to %s or higher!', 'wbcr_factory_425' ), $this->required_php_version ) . '<br>';
|
86 |
}
|
87 |
|
88 |
+
if ( ! $this->isWpCompatibility() ) {
|
89 |
+
$has_one = true;
|
90 |
+
$notice_text .= '- ' . sprintf( __( 'You need to update WordPress to %s or higher!', 'wbcr_factory_425' ), $this->required_wp_version ) . '<br>';
|
91 |
+
}
|
|
|
|
|
92 |
|
93 |
+
if ( $has_one ) {
|
94 |
+
$notice_text = $notice_default_text . $notice_text;
|
95 |
}
|
96 |
|
97 |
+
return $notice_text;
|
98 |
+
}
|
|
|
99 |
|
100 |
+
public function registerNotices() {
|
101 |
+
if ( current_user_can( 'activate_plugins' ) && current_user_can( 'edit_plugins' ) && current_user_can( 'install_plugins' ) ) {
|
102 |
+
if ( is_multisite() ) {
|
103 |
+
add_action( 'network_admin_notices', [ $this, 'showNotice' ] );
|
104 |
}
|
105 |
|
106 |
+
add_action( 'admin_notices', [ $this, 'showNotice' ] );
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
public function showNotice() {
|
111 |
+
$notice_text = $this->getNoticeText();
|
112 |
|
113 |
+
if ( empty( $notice_text ) ) {
|
114 |
+
return;
|
115 |
}
|
116 |
+
|
117 |
+
$notice_text = '<p>' . $this->getNoticeText() . '</p>';
|
118 |
+
|
119 |
+
echo '<div class="notice notice-error">' . apply_filters( 'wbcr/factory/check_compatibility/notice_text', $notice_text, $this->plugin_name ) . '</div>';
|
120 |
}
|
121 |
+
}
|
122 |
+
}
|
libs/factory/core/includes/class-factory-migrations.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use Exception;
|
6 |
-
use
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
@@ -23,10 +23,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
23 |
* todo: get_option and get_site_option are used because some caching plugins caching options, which causes problems
|
24 |
*
|
25 |
*
|
26 |
-
* @author
|
|
|
|
|
27 |
* @since 4.1.1
|
28 |
-
* @copyright (c) 2018 Webraftic Ltd
|
29 |
-
* @link https://webcraftic.com
|
30 |
*/
|
31 |
class Migrations {
|
32 |
|
@@ -35,11 +35,11 @@ class Migrations {
|
|
35 |
/**
|
36 |
* Migrations constructor.
|
37 |
*
|
38 |
-
* @param
|
39 |
*
|
40 |
* @throws Exception
|
41 |
*/
|
42 |
-
public function __construct(
|
43 |
|
44 |
$this->plugin = $plugin;
|
45 |
$plugin_name = $plugin->getPluginName();
|
@@ -52,8 +52,8 @@ class Migrations {
|
|
52 |
add_action( "admin_init", [ $this, "check_migrations" ] );
|
53 |
|
54 |
add_action( "wbcr/factory/plugin_{$plugin_name}_activated", [ $this, 'activation_hook' ] );
|
55 |
-
add_action( "
|
56 |
-
add_action( "
|
57 |
}
|
58 |
}
|
59 |
|
@@ -105,11 +105,16 @@ class Migrations {
|
|
105 |
* and framework will intercept them safely for user and display them
|
106 |
* in this notice.
|
107 |
*
|
108 |
-
* @param array
|
|
|
109 |
*
|
110 |
* @return array
|
111 |
*/
|
112 |
-
public function migration_error_notice( $notices ) {
|
|
|
|
|
|
|
|
|
113 |
|
114 |
if ( ! $this->is_migration_error() || ! current_user_can( 'update_plugins' ) ) {
|
115 |
return $notices;
|
@@ -124,14 +129,14 @@ class Migrations {
|
|
124 |
$fix_migration_error_url = add_query_arg( 'wbcr_factory_fix_migration_error', 1 );
|
125 |
|
126 |
$notice_text = $migration_error_text;
|
127 |
-
$notice_text .= "<br><br><a href='{$fix_migration_error_url}' class='button button-default'>" . __( 'I fixed, confirm migration', '
|
128 |
|
129 |
$notices[] = [
|
130 |
'id' => 'migration_debug_bar',
|
131 |
'type' => 'error',
|
132 |
'dismissible' => false,
|
133 |
'dismiss_expires' => 0,
|
134 |
-
'text' => '<p><b>' . $this->plugin->getPluginTitle() . ' ' . __( 'migration error', '
|
135 |
];
|
136 |
|
137 |
return $notices;
|
@@ -141,31 +146,35 @@ class Migrations {
|
|
141 |
* Debug panel, display some information from the database. Also allows
|
142 |
* perform manual migrations to test new migrations.
|
143 |
*
|
144 |
-
* @param $notices
|
|
|
145 |
*
|
146 |
* @return array
|
147 |
*/
|
148 |
-
public function debug_bar_notice( $notices ) {
|
149 |
|
|
|
|
|
|
|
150 |
if ( ! $this->is_debug() || ! current_user_can( 'update_plugins' ) ) {
|
151 |
return $notices;
|
152 |
}
|
153 |
|
154 |
$migrate_url = add_query_arg( 'wbcr_factory_test_migration', 1 );
|
155 |
|
156 |
-
$notice_text = __( "Plugin activated:", "
|
157 |
|
158 |
-
$notice_text .= __( "Old plugin version (debug):", "
|
159 |
-
$notice_text .= __( "Current plugin version:", "
|
160 |
-
$notice_text .= __( "Need migration:", "
|
161 |
-
$notice_text .= "<a href='{$migrate_url}' class='button button-default'>" . __( "Migrate now", "
|
162 |
|
163 |
$notices[] = [
|
164 |
'id' => 'migration_debug_bar',
|
165 |
'type' => 'warning',
|
166 |
'dismissible' => false,
|
167 |
'dismiss_expires' => 0,
|
168 |
-
'text' => '<p><b style="color:red;">' . $this->plugin->getPluginTitle() . ' ' . __( 'migrations DEBUG bar', '
|
169 |
];
|
170 |
|
171 |
return $notices;
|
@@ -496,7 +505,7 @@ class Migrations {
|
|
496 |
$classes = [];
|
497 |
|
498 |
if ( ! function_exists( 'token_get_all' ) ) {
|
499 |
-
throw new Exception( __( 'There is no PHP Tokenizer extension installed on your server, you cannot use the token_get_all function.', '
|
500 |
}
|
501 |
|
502 |
$tokens = token_get_all( $phpCode );
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425;
|
4 |
|
5 |
use Exception;
|
6 |
+
use Wbcr_Factory425_Plugin;
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
23 |
* todo: get_option and get_site_option are used because some caching plugins caching options, which causes problems
|
24 |
*
|
25 |
*
|
26 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
27 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
28 |
+
*
|
29 |
* @since 4.1.1
|
|
|
|
|
30 |
*/
|
31 |
class Migrations {
|
32 |
|
35 |
/**
|
36 |
* Migrations constructor.
|
37 |
*
|
38 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
39 |
*
|
40 |
* @throws Exception
|
41 |
*/
|
42 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
43 |
|
44 |
$this->plugin = $plugin;
|
45 |
$plugin_name = $plugin->getPluginName();
|
52 |
add_action( "admin_init", [ $this, "check_migrations" ] );
|
53 |
|
54 |
add_action( "wbcr/factory/plugin_{$plugin_name}_activated", [ $this, 'activation_hook' ] );
|
55 |
+
add_action( "wbcr/factory/admin_notices", [ $this, "debug_bar_notice" ], 10, 2 );
|
56 |
+
add_action( "wbcr/factory/admin_notices", [ $this, "migration_error_notice" ], 10, 2 );
|
57 |
}
|
58 |
}
|
59 |
|
105 |
* and framework will intercept them safely for user and display them
|
106 |
* in this notice.
|
107 |
*
|
108 |
+
* @param array $notices
|
109 |
+
* @param static $plugin_name
|
110 |
*
|
111 |
* @return array
|
112 |
*/
|
113 |
+
public function migration_error_notice( $notices, $plugin_name ) {
|
114 |
+
|
115 |
+
if ( $this->plugin->getPluginName() !== $plugin_name ) {
|
116 |
+
return $notices;
|
117 |
+
}
|
118 |
|
119 |
if ( ! $this->is_migration_error() || ! current_user_can( 'update_plugins' ) ) {
|
120 |
return $notices;
|
129 |
$fix_migration_error_url = add_query_arg( 'wbcr_factory_fix_migration_error', 1 );
|
130 |
|
131 |
$notice_text = $migration_error_text;
|
132 |
+
$notice_text .= "<br><br><a href='{$fix_migration_error_url}' class='button button-default'>" . __( 'I fixed, confirm migration', 'wbcr_factory_425' ) . "</a>";
|
133 |
|
134 |
$notices[] = [
|
135 |
'id' => 'migration_debug_bar',
|
136 |
'type' => 'error',
|
137 |
'dismissible' => false,
|
138 |
'dismiss_expires' => 0,
|
139 |
+
'text' => '<p><b>' . $this->plugin->getPluginTitle() . ' ' . __( 'migration error', 'wbcr_factory_425' ) . '</b><br>' . $notice_text . '</p>'
|
140 |
];
|
141 |
|
142 |
return $notices;
|
146 |
* Debug panel, display some information from the database. Also allows
|
147 |
* perform manual migrations to test new migrations.
|
148 |
*
|
149 |
+
* @param array $notices
|
150 |
+
* @param string $plugin_name
|
151 |
*
|
152 |
* @return array
|
153 |
*/
|
154 |
+
public function debug_bar_notice( $notices, $plugin_name ) {
|
155 |
|
156 |
+
if ( $this->plugin->getPluginName() !== $plugin_name ) {
|
157 |
+
return $notices;
|
158 |
+
}
|
159 |
if ( ! $this->is_debug() || ! current_user_can( 'update_plugins' ) ) {
|
160 |
return $notices;
|
161 |
}
|
162 |
|
163 |
$migrate_url = add_query_arg( 'wbcr_factory_test_migration', 1 );
|
164 |
|
165 |
+
$notice_text = __( "Plugin activated:", "wbcr_factory_425" ) . ' ' . date( "Y-m-d H:i:s", $this->get_plugin_activated_time() ) . "<br>";
|
166 |
|
167 |
+
$notice_text .= __( "Old plugin version (debug):", "wbcr_factory_425" ) . ' ' . $this->get_old_plugin_version() . "<br>";
|
168 |
+
$notice_text .= __( "Current plugin version:", "wbcr_factory_425" ) . ' ' . $this->get_current_plugin_version() . "<br>";
|
169 |
+
$notice_text .= __( "Need migration:", "wbcr_factory_425" ) . ' ' . ( $this->need_migration() ? "true" : "false" ) . "<br><br>";
|
170 |
+
$notice_text .= "<a href='{$migrate_url}' class='button button-default'>" . __( "Migrate now", "wbcr_factory_425" ) . "</a><br>";
|
171 |
|
172 |
$notices[] = [
|
173 |
'id' => 'migration_debug_bar',
|
174 |
'type' => 'warning',
|
175 |
'dismissible' => false,
|
176 |
'dismiss_expires' => 0,
|
177 |
+
'text' => '<p><b style="color:red;">' . $this->plugin->getPluginTitle() . ' ' . __( 'migrations DEBUG bar', 'wbcr_factory_425' ) . '</b><br>' . $notice_text . '</p>'
|
178 |
];
|
179 |
|
180 |
return $notices;
|
505 |
$classes = [];
|
506 |
|
507 |
if ( ! function_exists( 'token_get_all' ) ) {
|
508 |
+
throw new Exception( __( 'There is no PHP Tokenizer extension installed on your server, you cannot use the token_get_all function.', 'wbcr_factory_425' ) );
|
509 |
}
|
510 |
|
511 |
$tokens = token_get_all( $phpCode );
|
libs/factory/core/includes/class-factory-notices.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
-
use
|
6 |
|
7 |
// Exit if accessed directly
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -18,28 +18,27 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
18 |
/**
|
19 |
* A group of classes and methods to create and manage notices.
|
20 |
*
|
21 |
-
* @author
|
22 |
-
* @
|
23 |
-
* @copyright (c) 2018 Webraftic Ltd
|
24 |
*
|
25 |
-
* @package
|
26 |
-
* @since
|
27 |
*/
|
28 |
class Notices {
|
29 |
-
|
30 |
/**
|
31 |
-
* @var
|
32 |
*/
|
33 |
protected $plugin;
|
34 |
/**
|
35 |
* @var array
|
36 |
*/
|
37 |
-
protected $notices =
|
38 |
-
|
39 |
/**
|
40 |
* @var array
|
41 |
*/
|
42 |
-
protected $default_where =
|
43 |
'plugins',
|
44 |
'themes',
|
45 |
'dashboard',
|
@@ -49,183 +48,188 @@ class Notices {
|
|
49 |
'plugins-network',
|
50 |
'themes-network',
|
51 |
'settings-network',
|
52 |
-
|
53 |
-
|
54 |
/**
|
55 |
* @var array
|
56 |
*/
|
57 |
private $dissmised_notices;
|
58 |
-
|
59 |
/**
|
60 |
* Инициализируем уведомлений сразу после загрузки модуля уведомлений
|
61 |
*
|
62 |
-
* @param
|
63 |
*/
|
64 |
public function __construct( $plugin ) {
|
65 |
//default notices
|
66 |
//---
|
67 |
-
|
68 |
$this->plugin = $plugin;
|
69 |
-
$this->dissmised_notices = $this->plugin->getPopulateOption( 'factory_dismissed_notices',
|
70 |
-
|
71 |
-
add_action( 'current_screen',
|
72 |
-
|
73 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
74 |
-
add_action( 'wp_ajax_' . $this->plugin->getPluginName() . '_dismiss_notice',
|
75 |
$this,
|
76 |
-
'
|
77 |
-
|
78 |
}
|
79 |
}
|
80 |
-
|
81 |
/**
|
82 |
* Регистрирует экшены для работы с уведомлениями на текущем экране странице.
|
83 |
* Уведомления собираются через фильтр wbcr_factory_admin_notices, если в массиве уведомлений,
|
84 |
* хотя бы одно, соответствует условиям в параметре $notice['where'], то метод печает вспомогательные скрипты и уведомления.
|
85 |
*/
|
86 |
public function currentScreenAction() {
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
90 |
$this->notices,
|
91 |
-
$this->plugin->getPluginName()
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
94 |
if ( count( $this->notices ) == 0 ) {
|
95 |
return;
|
96 |
}
|
97 |
-
|
98 |
$screen = get_current_screen();
|
99 |
-
|
100 |
$has_notices = false;
|
101 |
-
foreach ( $this->notices as $notice ) {
|
102 |
-
|
103 |
if ( ! isset( $notice['id'] ) ) {
|
104 |
continue;
|
105 |
}
|
106 |
-
|
107 |
$where = ! isset( $notice['where'] ) || empty( $notice['where'] ) ? $this->default_where : $notice['where'];
|
108 |
-
|
109 |
-
if ( in_array( $screen->base, $where ) && ! $this->
|
110 |
$has_notices = true;
|
111 |
break;
|
112 |
};
|
113 |
}
|
114 |
-
|
115 |
if ( $has_notices ) {
|
116 |
-
add_action( 'admin_footer',
|
117 |
-
|
118 |
if ( $this->plugin->isNetworkActive() ) {
|
119 |
if ( current_user_can( 'manage_network' ) ) {
|
120 |
-
add_action( 'network_admin_notices',
|
121 |
-
add_action( 'admin_notices',
|
122 |
}
|
123 |
} else {
|
124 |
-
add_action( 'admin_notices',
|
125 |
}
|
126 |
}
|
127 |
}
|
128 |
-
|
129 |
/**
|
130 |
* Показывает все зарегистрированные уведомления для текущего плагина.
|
131 |
* Уведомления показываются только на определенных страницах через параметр $notice['where'],
|
132 |
* если уведомление ранее было скрыто или не соотвествует правилам $notice['where'], оно не будет показано!
|
133 |
*/
|
134 |
-
public function
|
135 |
if ( count( $this->notices ) == 0 ) {
|
136 |
return;
|
137 |
}
|
138 |
-
|
139 |
if ( ! current_user_can( 'activate_plugins' ) || ! current_user_can( 'edit_plugins' ) || ! current_user_can( 'install_plugins' ) ) {
|
140 |
return;
|
141 |
}
|
142 |
-
|
143 |
$screen = get_current_screen();
|
144 |
-
|
145 |
foreach ( $this->notices as $notice ) {
|
146 |
-
|
147 |
if ( ! isset( $notice['id'] ) ) {
|
148 |
continue;
|
149 |
}
|
150 |
-
|
151 |
$where = ! isset( $notice['where'] ) || empty( $notice['where'] ) ? $this->default_where : $notice['where'];
|
152 |
-
|
153 |
-
if ( in_array( $screen->base, $where ) && ! $this->
|
154 |
-
$this->
|
155 |
};
|
156 |
}
|
157 |
}
|
158 |
-
|
159 |
/**
|
160 |
* Показывает уведомление, по переданным параметрам
|
161 |
*
|
162 |
-
* @param array $data
|
163 |
-
*
|
164 |
-
*
|
165 |
-
*
|
166 |
-
*
|
167 |
-
*
|
168 |
-
*
|
169 |
-
*
|
170 |
-
*
|
171 |
*/
|
172 |
-
public function
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
178 |
return;
|
179 |
}
|
180 |
-
|
181 |
-
$type = ! isset( $data['type'] ) || empty( $data['type'] ) ? 'error' : $data['type'];
|
182 |
-
|
183 |
-
$dismissible = ! isset( $data['dismissible'] ) || empty( $data['dismissible'] ) ? false : $data['dismissible'];
|
184 |
-
|
185 |
-
$dismiss_expires = ! isset( $data['dismiss_expires'] ) || empty( $data['dismiss_expires'] ) ? 0 : $data['dismiss_expires'];
|
186 |
-
|
187 |
-
$classes = ! isset( $data['classes'] ) || empty( $data['classes'] ) ? array() : $data['classes'];
|
188 |
-
|
189 |
$plugin_name = str_replace( '_', '-', $this->plugin->getPluginName() );
|
190 |
-
|
191 |
-
$classes = array_merge(
|
192 |
'notice',
|
193 |
-
'notice-' . $type,
|
194 |
$plugin_name . '-factory-notice'
|
195 |
-
|
196 |
-
|
197 |
-
if ( $dismissible ) {
|
198 |
$classes[] = 'is-dismissible';
|
199 |
$classes[] = $plugin_name . '-factory-notice-dismiss';
|
200 |
}
|
201 |
?>
|
202 |
-
<div data-name="wbcr_factory_notice_
|
203 |
<?= $data['text'] ?>
|
204 |
</div>
|
205 |
<?php
|
206 |
}
|
207 |
-
|
208 |
/**
|
209 |
* Когда пользователь нажимает кнопку закрыть уведомление,
|
210 |
* отправляется ajax запрос с вызовом текущего метода
|
211 |
*/
|
212 |
-
public function
|
|
|
|
|
|
|
|
|
213 |
check_admin_referer( $this->plugin->getPluginName() . '_factory_dismiss_notice', 'nonce' );
|
214 |
-
|
215 |
// Имя уведомления (идентификатор)
|
216 |
-
$name =
|
217 |
-
|
218 |
// Время в Unix timestamp, по истечению, которого уведомление снова будет показано
|
219 |
// Если передан 0, то уведомление будет скрыто навсегда
|
220 |
-
$expires =
|
221 |
-
|
222 |
if ( empty( $name ) ) {
|
223 |
-
|
224 |
-
exit;
|
225 |
}
|
226 |
-
|
227 |
-
$notices = $this->plugin->getPopulateOption( "factory_dismissed_notices",
|
228 |
-
|
229 |
if ( ! empty( $notices ) ) {
|
230 |
foreach ( (array) $notices as $notice_id => $notice_expires ) {
|
231 |
if ( $notice_expires !== 0 && $notice_expires < time() ) {
|
@@ -233,23 +237,22 @@ class Notices {
|
|
233 |
}
|
234 |
}
|
235 |
}
|
236 |
-
|
237 |
$notices[ $name ] = $expires;
|
238 |
-
|
239 |
$this->plugin->updatePopulateOption( 'factory_dismissed_notices', $notices );
|
240 |
-
|
241 |
-
|
242 |
-
exit;
|
243 |
}
|
244 |
-
|
245 |
/**
|
246 |
* Javascript code
|
247 |
* Печает в подвале страницы код, для взаимодействия с сервером через ajax,
|
248 |
* код используется при нажатии на кнопку закрыть уведомление. *
|
249 |
*/
|
250 |
-
public function
|
251 |
$plugin_name = str_replace( '_', '-', $this->plugin->getPluginName() );
|
252 |
-
|
253 |
?>
|
254 |
<script type="text/javascript">
|
255 |
jQuery(function($) {
|
@@ -267,22 +270,22 @@ class Notices {
|
|
267 |
</script>
|
268 |
<?php
|
269 |
}
|
270 |
-
|
271 |
-
|
272 |
/**
|
273 |
* Проверяет скрыто уведоление или нет
|
274 |
*
|
275 |
-
* @param string $notice_id
|
276 |
*
|
277 |
* @return bool
|
278 |
*/
|
279 |
-
protected function
|
280 |
if ( ! empty( $this->dissmised_notices ) && isset( $this->dissmised_notices[ 'wbcr_factory_notice_' . $notice_id ] ) ) {
|
281 |
$expires = (int) $this->dissmised_notices[ 'wbcr_factory_notice_' . $notice_id ];
|
282 |
-
|
283 |
return $expires === 0 || $expires > time();
|
284 |
}
|
285 |
-
|
286 |
return false;
|
287 |
}
|
288 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425;
|
4 |
|
5 |
+
use Wbcr_Factory425_Plugin;
|
6 |
|
7 |
// Exit if accessed directly
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
18 |
/**
|
19 |
* A group of classes and methods to create and manage notices.
|
20 |
*
|
21 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
22 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
|
|
23 |
*
|
24 |
+
* @package factory-notices
|
25 |
+
* @since 1.0.0
|
26 |
*/
|
27 |
class Notices {
|
28 |
+
|
29 |
/**
|
30 |
+
* @var Wbcr_Factory425_Plugin
|
31 |
*/
|
32 |
protected $plugin;
|
33 |
/**
|
34 |
* @var array
|
35 |
*/
|
36 |
+
protected $notices = [];
|
37 |
+
|
38 |
/**
|
39 |
* @var array
|
40 |
*/
|
41 |
+
protected $default_where = [
|
42 |
'plugins',
|
43 |
'themes',
|
44 |
'dashboard',
|
48 |
'plugins-network',
|
49 |
'themes-network',
|
50 |
'settings-network',
|
51 |
+
];
|
52 |
+
|
53 |
/**
|
54 |
* @var array
|
55 |
*/
|
56 |
private $dissmised_notices;
|
57 |
+
|
58 |
/**
|
59 |
* Инициализируем уведомлений сразу после загрузки модуля уведомлений
|
60 |
*
|
61 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
62 |
*/
|
63 |
public function __construct( $plugin ) {
|
64 |
//default notices
|
65 |
//---
|
66 |
+
|
67 |
$this->plugin = $plugin;
|
68 |
+
$this->dissmised_notices = $this->plugin->getPopulateOption( 'factory_dismissed_notices', [] );
|
69 |
+
|
70 |
+
add_action( 'current_screen', [ $this, 'currentScreenAction' ] );
|
71 |
+
|
72 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
73 |
+
add_action( 'wp_ajax_' . $this->plugin->getPluginName() . '_dismiss_notice', [
|
74 |
$this,
|
75 |
+
'dismiss_notice'
|
76 |
+
] );
|
77 |
}
|
78 |
}
|
79 |
+
|
80 |
/**
|
81 |
* Регистрирует экшены для работы с уведомлениями на текущем экране странице.
|
82 |
* Уведомления собираются через фильтр wbcr_factory_admin_notices, если в массиве уведомлений,
|
83 |
* хотя бы одно, соответствует условиям в параметре $notice['where'], то метод печает вспомогательные скрипты и уведомления.
|
84 |
*/
|
85 |
public function currentScreenAction() {
|
86 |
+
/**
|
87 |
+
* @since 2.1.2 - является устаревшим
|
88 |
+
*/
|
89 |
+
$this->notices = wbcr_factory_425_apply_filters_deprecated( 'wbcr_factory_notices_000_list', [
|
90 |
$this->notices,
|
91 |
+
$this->plugin->getPluginName(),
|
92 |
+
], '2.1.2', 'wbcr/factory/admin_notices' );
|
93 |
+
|
94 |
+
/**
|
95 |
+
* @since 2.1.2 - Добавлен, модуль factory_notices_000 был удален. Поэтому в этому хуке мы заменили префикс на factory_425
|
96 |
+
*/
|
97 |
+
$this->notices = apply_filters( 'wbcr/factory/admin_notices', $this->notices, $this->plugin->getPluginName() );
|
98 |
+
|
99 |
if ( count( $this->notices ) == 0 ) {
|
100 |
return;
|
101 |
}
|
102 |
+
|
103 |
$screen = get_current_screen();
|
104 |
+
|
105 |
$has_notices = false;
|
106 |
+
foreach ( (array) $this->notices as $notice ) {
|
|
|
107 |
if ( ! isset( $notice['id'] ) ) {
|
108 |
continue;
|
109 |
}
|
110 |
+
|
111 |
$where = ! isset( $notice['where'] ) || empty( $notice['where'] ) ? $this->default_where : $notice['where'];
|
112 |
+
|
113 |
+
if ( in_array( $screen->base, $where ) && ! $this->is_dissmissed( $notice['id'] ) ) {
|
114 |
$has_notices = true;
|
115 |
break;
|
116 |
};
|
117 |
}
|
118 |
+
|
119 |
if ( $has_notices ) {
|
120 |
+
add_action( 'admin_footer', [ $this, 'print_js_code' ] );
|
121 |
+
|
122 |
if ( $this->plugin->isNetworkActive() ) {
|
123 |
if ( current_user_can( 'manage_network' ) ) {
|
124 |
+
add_action( 'network_admin_notices', [ $this, 'show_notices' ] );
|
125 |
+
add_action( 'admin_notices', [ $this, 'show_notices' ] );
|
126 |
}
|
127 |
} else {
|
128 |
+
add_action( 'admin_notices', [ $this, 'show_notices' ] );
|
129 |
}
|
130 |
}
|
131 |
}
|
132 |
+
|
133 |
/**
|
134 |
* Показывает все зарегистрированные уведомления для текущего плагина.
|
135 |
* Уведомления показываются только на определенных страницах через параметр $notice['where'],
|
136 |
* если уведомление ранее было скрыто или не соотвествует правилам $notice['where'], оно не будет показано!
|
137 |
*/
|
138 |
+
public function show_notices() {
|
139 |
if ( count( $this->notices ) == 0 ) {
|
140 |
return;
|
141 |
}
|
142 |
+
|
143 |
if ( ! current_user_can( 'activate_plugins' ) || ! current_user_can( 'edit_plugins' ) || ! current_user_can( 'install_plugins' ) ) {
|
144 |
return;
|
145 |
}
|
146 |
+
|
147 |
$screen = get_current_screen();
|
148 |
+
|
149 |
foreach ( $this->notices as $notice ) {
|
150 |
+
|
151 |
if ( ! isset( $notice['id'] ) ) {
|
152 |
continue;
|
153 |
}
|
154 |
+
|
155 |
$where = ! isset( $notice['where'] ) || empty( $notice['where'] ) ? $this->default_where : $notice['where'];
|
156 |
+
|
157 |
+
if ( in_array( $screen->base, $where ) && ! $this->is_dissmissed( $notice['id'] ) ) {
|
158 |
+
$this->show_notice( $notice );
|
159 |
};
|
160 |
}
|
161 |
}
|
162 |
+
|
163 |
/**
|
164 |
* Показывает уведомление, по переданным параметрам
|
165 |
*
|
166 |
+
* @param array $data - Параметры уведомления
|
167 |
+
* $data['id'] - Индентификатор уведомления
|
168 |
+
* $data['type'] - Тип уведомления (error, warning, success)
|
169 |
+
* $notice['where'] - На каких страницах показывать уведомление ('plugins', 'dashboard', 'edit')
|
170 |
+
* $data['text'] - Текст уведомления
|
171 |
+
* $data['dismissible'] - Если true, уведомление будет с кнопкой закрыть
|
172 |
+
* $data['dismiss_expires'] - Когда снова показать уведомление, нужно указывать время в unix timestamp.
|
173 |
+
* Пример time() + 3600 (1ч), уведомление будет скрыто на 1 час.
|
174 |
+
* $data['classes'] - Произвольный классы для контейнера уведомления.
|
175 |
*/
|
176 |
+
public function show_notice( $data ) {
|
177 |
+
$settings = wp_parse_args( $data, [
|
178 |
+
'id' => null,
|
179 |
+
'text' => null,
|
180 |
+
'type' => 'error',
|
181 |
+
'dismissible' => false,
|
182 |
+
'dismiss_expires' => 0,
|
183 |
+
'classes' => []
|
184 |
+
] );
|
185 |
+
|
186 |
+
if ( empty( $settings['id'] ) || empty( $settings['text'] ) ) {
|
187 |
return;
|
188 |
}
|
189 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
$plugin_name = str_replace( '_', '-', $this->plugin->getPluginName() );
|
191 |
+
|
192 |
+
$classes = array_merge( [
|
193 |
'notice',
|
194 |
+
'notice-' . $settings['type'],
|
195 |
$plugin_name . '-factory-notice'
|
196 |
+
], $settings['classes'] );
|
197 |
+
|
198 |
+
if ( $settings['dismissible'] ) {
|
199 |
$classes[] = 'is-dismissible';
|
200 |
$classes[] = $plugin_name . '-factory-notice-dismiss';
|
201 |
}
|
202 |
?>
|
203 |
+
<div data-name="wbcr_factory_notice_<?php echo esc_attr( $data['id'] ) ?>" data-expires="<?= esc_attr( $settings['dismiss_expires'] ) ?>" data-nonce="<?php echo wp_create_nonce( $this->plugin->getPluginName() . '_factory_dismiss_notice' ); ?>" class="<?php echo esc_attr( implode( ' ', $classes ) ) ?>">
|
204 |
<?= $data['text'] ?>
|
205 |
</div>
|
206 |
<?php
|
207 |
}
|
208 |
+
|
209 |
/**
|
210 |
* Когда пользователь нажимает кнопку закрыть уведомление,
|
211 |
* отправляется ajax запрос с вызовом текущего метода
|
212 |
*/
|
213 |
+
public function dismiss_notice() {
|
214 |
+
if ( ! current_user_can( 'activate_plugins' ) || ! current_user_can( 'edit_plugins' ) || ! current_user_can( 'install_plugins' ) ) {
|
215 |
+
wp_die( - 1, 403 );
|
216 |
+
}
|
217 |
+
|
218 |
check_admin_referer( $this->plugin->getPluginName() . '_factory_dismiss_notice', 'nonce' );
|
219 |
+
|
220 |
// Имя уведомления (идентификатор)
|
221 |
+
$name = $this->plugin->request->post( 'name', null, true );
|
222 |
+
|
223 |
// Время в Unix timestamp, по истечению, которого уведомление снова будет показано
|
224 |
// Если передан 0, то уведомление будет скрыто навсегда
|
225 |
+
$expires = $this->plugin->request->post( 'expires', 0, 'intval' );
|
226 |
+
|
227 |
if ( empty( $name ) ) {
|
228 |
+
wp_send_json_error( [ 'error_message' => 'You must pass the notification "Name"! Action was rejected.' ] );
|
|
|
229 |
}
|
230 |
+
|
231 |
+
$notices = $this->plugin->getPopulateOption( "factory_dismissed_notices", [] );
|
232 |
+
|
233 |
if ( ! empty( $notices ) ) {
|
234 |
foreach ( (array) $notices as $notice_id => $notice_expires ) {
|
235 |
if ( $notice_expires !== 0 && $notice_expires < time() ) {
|
237 |
}
|
238 |
}
|
239 |
}
|
240 |
+
|
241 |
$notices[ $name ] = $expires;
|
242 |
+
|
243 |
$this->plugin->updatePopulateOption( 'factory_dismissed_notices', $notices );
|
244 |
+
|
245 |
+
wp_send_json_success();
|
|
|
246 |
}
|
247 |
+
|
248 |
/**
|
249 |
* Javascript code
|
250 |
* Печает в подвале страницы код, для взаимодействия с сервером через ajax,
|
251 |
* код используется при нажатии на кнопку закрыть уведомление. *
|
252 |
*/
|
253 |
+
public function print_js_code() {
|
254 |
$plugin_name = str_replace( '_', '-', $this->plugin->getPluginName() );
|
255 |
+
|
256 |
?>
|
257 |
<script type="text/javascript">
|
258 |
jQuery(function($) {
|
270 |
</script>
|
271 |
<?php
|
272 |
}
|
273 |
+
|
274 |
+
|
275 |
/**
|
276 |
* Проверяет скрыто уведоление или нет
|
277 |
*
|
278 |
+
* @param string $notice_id - имя уведомления
|
279 |
*
|
280 |
* @return bool
|
281 |
*/
|
282 |
+
protected function is_dissmissed( $notice_id ) {
|
283 |
if ( ! empty( $this->dissmised_notices ) && isset( $this->dissmised_notices[ 'wbcr_factory_notice_' . $notice_id ] ) ) {
|
284 |
$expires = (int) $this->dissmised_notices[ 'wbcr_factory_notice_' . $notice_id ];
|
285 |
+
|
286 |
return $expires === 0 || $expires > time();
|
287 |
}
|
288 |
+
|
289 |
return false;
|
290 |
}
|
291 |
}
|
libs/factory/core/includes/class-factory-options.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
use Exception;
|
@@ -10,101 +10,137 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
10 |
}
|
11 |
|
12 |
/**
|
13 |
-
*
|
14 |
*
|
15 |
-
*
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
*/
|
20 |
trait Options {
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
abstract public function getPrefix();
|
23 |
-
|
24 |
/**
|
25 |
-
*
|
|
|
|
|
|
|
26 |
*
|
27 |
-
* @since 4.0.8
|
28 |
-
* @return array
|
29 |
*/
|
30 |
public function loadAllOptions() {
|
31 |
global $wpdb;
|
32 |
-
|
33 |
$is_option_loaded = wp_cache_get( $this->getPrefix() . 'all_options_loaded', $this->getPrefix() . 'options' );
|
34 |
-
|
35 |
if ( false === $is_option_loaded ) {
|
36 |
$result = $wpdb->get_results( "SELECT option_name, option_value FROM {$wpdb->options} WHERE option_name LIKE '{$this->getPrefix()}%'" );
|
37 |
-
|
38 |
-
$options =
|
39 |
-
|
40 |
if ( ! empty( $result ) ) {
|
41 |
wp_cache_add( $this->getPrefix() . 'all_options_loaded', 1, $this->getPrefix() . 'options' );
|
42 |
-
|
43 |
foreach ( $result as $option ) {
|
44 |
$value = maybe_unserialize( $option->option_value );
|
45 |
$value = $this->normalizeValue( $value );
|
46 |
-
|
47 |
wp_cache_add( $option->option_name, $value, $this->getPrefix() . 'options' );
|
48 |
$options[ $option->option_name ] = $value;
|
49 |
}
|
50 |
-
|
51 |
/**
|
52 |
-
*
|
|
|
|
|
|
|
|
|
|
|
53 |
*/
|
54 |
do_action( 'wbcr/factory/all_options_loaded', $options, $this->plugin_name );
|
55 |
}
|
56 |
}
|
57 |
}
|
58 |
-
|
59 |
/**
|
60 |
-
*
|
|
|
|
|
|
|
61 |
*
|
62 |
-
* @since 4.0.8
|
63 |
* @return void
|
64 |
*/
|
65 |
public function loadAllNetworkOptions() {
|
66 |
global $wpdb;
|
67 |
-
|
68 |
$network_id = (int) get_current_network_id();
|
69 |
-
|
70 |
$is_option_loaded = wp_cache_get( $network_id . ":" . $this->getPrefix() . 'all_options_loaded', $this->getPrefix() . 'network_options' );
|
71 |
-
|
72 |
if ( false === $is_option_loaded ) {
|
73 |
-
wp_cache_add_global_groups(
|
74 |
-
|
75 |
$result = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} WHERE site_id='{$network_id}' AND meta_key LIKE '{$this->getPrefix()}%'" );
|
76 |
-
|
77 |
-
$options =
|
78 |
if ( ! empty( $result ) ) {
|
79 |
wp_cache_add( $network_id . ":" . $this->getPrefix() . 'all_options_loaded', 1, $this->getPrefix() . 'network_options' );
|
80 |
-
|
81 |
foreach ( $result as $option ) {
|
82 |
$value = maybe_unserialize( $option->meta_value );
|
83 |
$value = $this->normalizeValue( $value );
|
84 |
-
|
85 |
$cache_key = $network_id . ":" . $option->meta_key;
|
86 |
wp_cache_add( $cache_key, $value, $this->getPrefix() . 'network_options' );
|
87 |
$options[ $option->meta_key ] = $value;
|
88 |
}
|
89 |
-
|
90 |
/**
|
91 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
*/
|
93 |
do_action( 'wbcr/factory/all_network_options_loaded', $options, $this->plugin_name );
|
94 |
}
|
95 |
}
|
96 |
}
|
97 |
-
|
98 |
/**
|
99 |
-
*
|
100 |
-
* иначе метод возвращает опцию для текущего сайта.
|
|
|
101 |
*
|
102 |
-
* @since 4.0.8
|
103 |
*
|
104 |
-
* @param string $option_name
|
105 |
-
* @param
|
106 |
*
|
107 |
-
* @return
|
108 |
*/
|
109 |
public function getPopulateOption( $option_name, $default = false ) {
|
110 |
if ( $this->isNetworkActive() ) {
|
@@ -112,57 +148,77 @@ trait Options {
|
|
112 |
} else {
|
113 |
$option_value = $this->getOption( $option_name, $default );
|
114 |
}
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
return apply_filters( "wbcr/factory/populate_option_{$option_name}", $option_value, $option_name, $default );
|
117 |
}
|
118 |
-
|
119 |
/**
|
120 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
*
|
122 |
-
* @param $option_name
|
123 |
-
* @param
|
124 |
*
|
125 |
-
* @return
|
126 |
*/
|
127 |
public function getNetworkOption( $option_name, $default = false ) {
|
128 |
if ( empty( $option_name ) || ! is_string( $option_name ) ) {
|
129 |
throw new Exception( 'Option name must be a string and must not be empty.' );
|
130 |
}
|
131 |
-
|
132 |
if ( ! is_multisite() ) {
|
133 |
return $this->getOption( $option_name, $default );
|
134 |
}
|
135 |
-
|
136 |
$this->loadAllNetworkOptions();
|
137 |
-
|
138 |
$network_id = (int) get_current_network_id();
|
139 |
$cache_key = $network_id . ':' . $this->getPrefix() . $option_name;
|
140 |
$option_value = wp_cache_get( $cache_key, $this->getPrefix() . 'network_options' );
|
141 |
-
|
142 |
if ( false === $option_value ) {
|
143 |
$option_value = $default;
|
144 |
}
|
145 |
-
|
146 |
/**
|
147 |
-
*
|
148 |
-
* @param string $option_name
|
149 |
-
* @param mixed $default
|
150 |
-
* @param int $network_id
|
151 |
*
|
152 |
-
* @since 4.0.
|
|
|
|
|
|
|
|
|
|
|
153 |
*/
|
154 |
-
|
155 |
return apply_filters( "wbcr/factory/network_option_{$option_name}", $option_value, $option_name, $default, $network_id );
|
156 |
}
|
157 |
-
|
158 |
/**
|
159 |
-
*
|
|
|
|
|
160 |
*
|
161 |
-
* @since 4.0.0
|
162 |
-
* @since 4.0.8 -
|
163 |
*
|
164 |
-
* @param string $option_name
|
165 |
-
* @param
|
166 |
*
|
167 |
* @return mixed
|
168 |
*/
|
@@ -170,31 +226,34 @@ trait Options {
|
|
170 |
if ( empty( $option_name ) || ! is_string( $option_name ) ) {
|
171 |
throw new Exception( 'Option name must be a string and must not be empty.' );
|
172 |
}
|
173 |
-
|
174 |
$this->loadAllOptions();
|
175 |
-
|
176 |
$option_value = wp_cache_get( $this->getPrefix() . $option_name, $this->getPrefix() . 'options' );
|
177 |
-
|
178 |
if ( false === $option_value ) {
|
179 |
$option_value = $default;
|
180 |
}
|
181 |
-
|
182 |
/**
|
183 |
-
*
|
184 |
-
* @param string $option_name
|
185 |
-
* @param mixed $default
|
186 |
*
|
187 |
-
* @since 4.0.
|
|
|
|
|
|
|
|
|
188 |
*/
|
189 |
-
|
190 |
return apply_filters( "wbcr/factory/option_{$option_name}", $option_value, $option_name, $default );
|
191 |
}
|
192 |
-
|
193 |
/**
|
194 |
-
*
|
195 |
-
*
|
196 |
*
|
197 |
-
* @
|
|
|
198 |
*/
|
199 |
public function updatePopulateOption( $option_name, $option_value ) {
|
200 |
if ( $this->isNetworkActive() ) {
|
@@ -203,68 +262,69 @@ trait Options {
|
|
203 |
$this->updateOption( $option_name, $option_value );
|
204 |
}
|
205 |
}
|
206 |
-
|
207 |
/**
|
208 |
-
* Обновляет опцию
|
209 |
-
*
|
210 |
-
* @since 4.0.8
|
211 |
*
|
212 |
-
* @
|
213 |
-
* @param mixed $value
|
214 |
*
|
215 |
-
* @
|
|
|
216 |
*/
|
217 |
public function updateNetworkOption( $option_name, $option_value ) {
|
218 |
$network_id = (int) get_current_network_id();
|
219 |
$cache_key = $network_id . ':' . $this->getPrefix() . $option_name;
|
220 |
wp_cache_set( $cache_key, $option_value, $this->getPrefix() . 'network_options' );
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
/**
|
225 |
-
*
|
226 |
-
* @param string $option_name
|
227 |
*
|
228 |
-
* @since 4.0.8
|
|
|
|
|
|
|
229 |
*/
|
230 |
do_action( "wbcr/factory/update_network_option", $option_name, $option_value );
|
231 |
-
|
232 |
-
return $result;
|
233 |
}
|
234 |
-
|
235 |
/**
|
236 |
-
* Обновляет опцию в базе
|
|
|
237 |
*
|
238 |
-
* @since 4.0.0
|
239 |
-
* @since 4.0.8 -
|
240 |
*
|
241 |
-
* @param string $option_name
|
242 |
-
* @param mixed
|
243 |
*
|
244 |
* @return bool
|
245 |
*/
|
246 |
public function updateOption( $option_name, $option_value ) {
|
247 |
wp_cache_set( $this->getPrefix() . $option_name, $option_value, $this->getPrefix() . 'options' );
|
248 |
$result = update_option( $this->getPrefix() . $option_name, $option_value );
|
249 |
-
|
250 |
/**
|
251 |
-
* @
|
|
|
252 |
* @param string $option_name
|
253 |
*
|
254 |
-
* @
|
255 |
*/
|
256 |
do_action( "wbcr/factory/update_option", $option_name, $option_value );
|
257 |
-
|
258 |
return $result;
|
259 |
}
|
260 |
-
|
261 |
/**
|
262 |
-
*
|
263 |
-
*
|
264 |
*
|
265 |
-
* @
|
266 |
*
|
267 |
-
* @
|
268 |
*/
|
269 |
public function deletePopulateOption( $option_name ) {
|
270 |
if ( $this->isNetworkActive() ) {
|
@@ -273,79 +333,91 @@ trait Options {
|
|
273 |
$this->deleteOption( $option_name );
|
274 |
}
|
275 |
}
|
276 |
-
|
277 |
/**
|
278 |
-
* Удаляет
|
279 |
-
* индивидуально удаляет опцию из кеша.
|
280 |
*
|
281 |
-
* @
|
282 |
*
|
283 |
-
* @
|
|
|
|
|
284 |
*/
|
285 |
public function deleteNetworkOption( $option_name ) {
|
286 |
$network_id = (int) get_current_network_id();
|
287 |
$cache_key = $network_id . ':' . $this->getPrefix() . $option_name;
|
288 |
$delete_cache = wp_cache_delete( $cache_key, $this->getPrefix() . 'network_options' );
|
289 |
-
|
290 |
$delete_opt1 = delete_site_option( $this->getPrefix() . $option_name );
|
291 |
-
|
292 |
return $delete_cache && $delete_opt1;
|
293 |
}
|
294 |
-
|
295 |
/**
|
296 |
-
* Удаляет опцию
|
297 |
-
* индивидуально удаляет опцию из кеша.
|
298 |
*
|
299 |
-
* @
|
300 |
*
|
301 |
-
* @
|
|
|
|
|
302 |
*/
|
303 |
public function deleteOption( $option_name ) {
|
304 |
$delete_cache = wp_cache_delete( $this->getPrefix() . $option_name, $this->getPrefix() . 'options' );
|
305 |
-
|
306 |
// todo: удалить, когда большая часть пользователей обновятся до современных релизов
|
307 |
$delete_opt1 = delete_option( $this->getPrefix() . $option_name . '_is_active' );
|
308 |
$delete_opt2 = delete_option( $this->getPrefix() . $option_name );
|
309 |
-
|
310 |
return $delete_cache && $delete_opt1 && $delete_opt2;
|
311 |
}
|
312 |
-
|
313 |
/**
|
314 |
-
* Сбрасывает объектный
|
315 |
*
|
316 |
-
* @
|
|
|
317 |
*/
|
318 |
public function flushOptionsCache() {
|
319 |
return wp_cache_flush();
|
320 |
}
|
321 |
-
|
322 |
/**
|
323 |
-
*
|
|
|
|
|
|
|
324 |
*
|
325 |
-
* @param string $option_name
|
326 |
*
|
327 |
-
* @return null|string
|
328 |
*/
|
329 |
public function getOptionName( $option_name ) {
|
330 |
$option_name = trim( rtrim( $option_name ) );
|
331 |
if ( empty( $option_name ) || ! is_string( $option_name ) ) {
|
332 |
return null;
|
333 |
}
|
334 |
-
|
335 |
return $this->getPrefix() . $option_name;
|
336 |
}
|
337 |
-
|
338 |
/**
|
339 |
-
*
|
|
|
|
|
|
|
|
|
340 |
*
|
341 |
-
* @param mixed $
|
342 |
*
|
343 |
-
* @return
|
|
|
|
|
344 |
*/
|
345 |
public function normalizeValue( $data ) {
|
346 |
if ( is_string( $data ) ) {
|
347 |
$check_string = rtrim( trim( $data ) );
|
348 |
-
|
349 |
if ( $check_string == "1" || $check_string == "0" ) {
|
350 |
return intval( $data );
|
351 |
} else if ( $check_string === 'false' ) {
|
@@ -354,7 +426,7 @@ trait Options {
|
|
354 |
return true;
|
355 |
}
|
356 |
}
|
357 |
-
|
358 |
return $data;
|
359 |
}
|
360 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425;
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
use Exception;
|
10 |
}
|
11 |
|
12 |
/**
|
13 |
+
* Трейт используется для расширения базового класса плагина Wbcr_Factory425_Base, позволяя работать с опциями плагина.
|
14 |
*
|
15 |
+
* Этот трейт является оберткой для Wordpress функций get_option, get_site_option, update_option, update_site_option,
|
16 |
+
* delete_option, delete_site_option. Основная задача была получать, обновлять, удалять опции без использования префиксов,
|
17 |
+
* чтобы класс выполнял эту работу за программиста. В дополнение, трейт содержит методы для полной выгрузки всех опций
|
18 |
+
* плагина, что позволяет при инициализации плагина автоматически выгрузить все существующие опции плагина в объектный
|
19 |
+
* кеш. Все опции, с которыми работает плагин, могут быть отфильтрованы.
|
20 |
+
*
|
21 |
+
* Документация по трейту: https://webcraftic.atlassian.net/wiki/spaces/FFD/pages/393805831/
|
22 |
+
* Документация по созданию плагина: https://webcraftic.atlassian.net/wiki/spaces/CNCFC/pages/327828
|
23 |
+
* Репозиторий: https://github.com/alexkovalevv
|
24 |
+
*
|
25 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
26 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
27 |
+
*
|
28 |
+
* @since 4.0.8 - Добавлен
|
29 |
+
* @package factory-core
|
30 |
*/
|
31 |
trait Options {
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Абстрактный метод, должен быть реализован в классе использующем этот трейт. Метод позволяет получить префикс
|
35 |
+
* плагина для формирования имен опций в базе данных Wordpress. У опций должно быть свое пространство имен,
|
36 |
+
* иначе может быть конфликт с другими плагинами или с сами ядром Wordpress.
|
37 |
+
*
|
38 |
+
* @since 4.0.8 - Добавлен
|
39 |
+
* @return string Возвращает префикс плагина. Пример: wbcr_clearfy_
|
40 |
+
*/
|
41 |
abstract public function getPrefix();
|
42 |
+
|
43 |
/**
|
44 |
+
* Выгружает все опции плагина в объектный кеш. Плагин может получить любую свою опцию без запроса к базе данных.
|
45 |
+
* Метод ускоряет работу плагина, если опций очень много.
|
46 |
+
*
|
47 |
+
* Используется только один раз при инициализации плагина.
|
48 |
*
|
49 |
+
* @since 4.0.8 - Добавлен
|
|
|
50 |
*/
|
51 |
public function loadAllOptions() {
|
52 |
global $wpdb;
|
53 |
+
|
54 |
$is_option_loaded = wp_cache_get( $this->getPrefix() . 'all_options_loaded', $this->getPrefix() . 'options' );
|
55 |
+
|
56 |
if ( false === $is_option_loaded ) {
|
57 |
$result = $wpdb->get_results( "SELECT option_name, option_value FROM {$wpdb->options} WHERE option_name LIKE '{$this->getPrefix()}%'" );
|
58 |
+
|
59 |
+
$options = [];
|
60 |
+
|
61 |
if ( ! empty( $result ) ) {
|
62 |
wp_cache_add( $this->getPrefix() . 'all_options_loaded', 1, $this->getPrefix() . 'options' );
|
63 |
+
|
64 |
foreach ( $result as $option ) {
|
65 |
$value = maybe_unserialize( $option->option_value );
|
66 |
$value = $this->normalizeValue( $value );
|
67 |
+
|
68 |
wp_cache_add( $option->option_name, $value, $this->getPrefix() . 'options' );
|
69 |
$options[ $option->option_name ] = $value;
|
70 |
}
|
71 |
+
|
72 |
/**
|
73 |
+
* Действие, которое будет выполнено, когда все опции плагина будут выгружены.
|
74 |
+
*
|
75 |
+
* @since 4.0.9 - Добавлен
|
76 |
+
*
|
77 |
+
* @param string $plugin_name Имя плагина
|
78 |
+
* @param array $options Ассоциативный массив опций плагина
|
79 |
*/
|
80 |
do_action( 'wbcr/factory/all_options_loaded', $options, $this->plugin_name );
|
81 |
}
|
82 |
}
|
83 |
}
|
84 |
+
|
85 |
/**
|
86 |
+
* Выгружает все сетевые опции плагина в объектный кеш. Плагин может получить любую свою опцию без запроса к базе
|
87 |
+
* данных. Метод ускоряет работу плагина, если опций очень много.
|
88 |
+
*
|
89 |
+
* Используется и работает только в режиме мультисайтов, один раз при инициализации плагина.!
|
90 |
*
|
91 |
+
* @since 4.0.8 - Добавлен
|
92 |
* @return void
|
93 |
*/
|
94 |
public function loadAllNetworkOptions() {
|
95 |
global $wpdb;
|
96 |
+
|
97 |
$network_id = (int) get_current_network_id();
|
98 |
+
|
99 |
$is_option_loaded = wp_cache_get( $network_id . ":" . $this->getPrefix() . 'all_options_loaded', $this->getPrefix() . 'network_options' );
|
100 |
+
|
101 |
if ( false === $is_option_loaded ) {
|
102 |
+
wp_cache_add_global_groups( [ $this->getPrefix() . 'network_options' ] );
|
103 |
+
|
104 |
$result = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} WHERE site_id='{$network_id}' AND meta_key LIKE '{$this->getPrefix()}%'" );
|
105 |
+
|
106 |
+
$options = [];
|
107 |
if ( ! empty( $result ) ) {
|
108 |
wp_cache_add( $network_id . ":" . $this->getPrefix() . 'all_options_loaded', 1, $this->getPrefix() . 'network_options' );
|
109 |
+
|
110 |
foreach ( $result as $option ) {
|
111 |
$value = maybe_unserialize( $option->meta_value );
|
112 |
$value = $this->normalizeValue( $value );
|
113 |
+
|
114 |
$cache_key = $network_id . ":" . $option->meta_key;
|
115 |
wp_cache_add( $cache_key, $value, $this->getPrefix() . 'network_options' );
|
116 |
$options[ $option->meta_key ] = $value;
|
117 |
}
|
118 |
+
|
119 |
/**
|
120 |
+
*
|
121 |
+
* Действие, которое будет выполнено, когда все сетевые опции плагина будут выгружены.
|
122 |
+
*
|
123 |
+
* @since 4.0.9 - Добавлен
|
124 |
+
*
|
125 |
+
* @param array $options Ассоциативный массив опций плагина
|
126 |
+
* @param string $plugin_name Имя плагина
|
127 |
*/
|
128 |
do_action( 'wbcr/factory/all_network_options_loaded', $options, $this->plugin_name );
|
129 |
}
|
130 |
}
|
131 |
}
|
132 |
+
|
133 |
/**
|
134 |
+
* Позволяет получить популярную опцию. В случае если плагин установлен для сети (в режиме мультисайтов),
|
135 |
+
* то метод возвращает опции только для сети, иначе метод возвращает опцию для текущего сайта. Работает
|
136 |
+
* на основе self::getOption и self::getNetworkOption, смотрите полную реализацию в этих методах.
|
137 |
*
|
138 |
+
* @since 4.0.8 - Добавлен
|
139 |
*
|
140 |
+
* @param string $option_name Имя опции без префикса.
|
141 |
+
* @param mixed $default Значение по умолчанию. Если опции нет в базе данных, будет возвращено это значение. По умолчанию false
|
142 |
*
|
143 |
+
* @return mixed Возвращает значение опции, если это сериализованная строка, то автоматически распаковывает ее.
|
144 |
*/
|
145 |
public function getPopulateOption( $option_name, $default = false ) {
|
146 |
if ( $this->isNetworkActive() ) {
|
148 |
} else {
|
149 |
$option_value = $this->getOption( $option_name, $default );
|
150 |
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Фильтр позволяет отфильтровать возвращаемое значение популярной опции.
|
154 |
+
*
|
155 |
+
* @since 4.0.9 - Добавлен
|
156 |
+
*
|
157 |
+
* @param mixed $option_value Значение опции
|
158 |
+
* @param string $option_name Имя опции
|
159 |
+
* @param mixed $default Значение опции по умолчанию
|
160 |
+
*/
|
161 |
return apply_filters( "wbcr/factory/populate_option_{$option_name}", $option_value, $option_name, $default );
|
162 |
}
|
163 |
+
|
164 |
/**
|
165 |
+
* Позволяет получить сетевые опции. Если плагин установлен для сети (в режиме мультисайтов), то
|
166 |
+
* метод возвращает опции только для сети, иначе метод возвращает опцию для текущего сайта.
|
167 |
+
*
|
168 |
+
* Опция вытаскивается из объектного кеша, после выполнения метода self:loadAllNetworkOptions,
|
169 |
+
* а не напрямую из базы данных, из-за чего при работе с некоторыми кеширующими плагинами,
|
170 |
+
* может быть странное поведение в работе плагина.
|
171 |
+
*
|
172 |
+
* @since 4.0.8 - Добавлен
|
173 |
*
|
174 |
+
* @param string $option_name Имя опции без префикса.
|
175 |
+
* @param mixed $default Значение по умолчанию. Если опции нет в базе данных, будет возвращено это значение. По умолчанию false
|
176 |
*
|
177 |
+
* @return mixed Возвращает значение опции, если это сериализованная строка, то автоматически распаковывает ее.
|
178 |
*/
|
179 |
public function getNetworkOption( $option_name, $default = false ) {
|
180 |
if ( empty( $option_name ) || ! is_string( $option_name ) ) {
|
181 |
throw new Exception( 'Option name must be a string and must not be empty.' );
|
182 |
}
|
183 |
+
|
184 |
if ( ! is_multisite() ) {
|
185 |
return $this->getOption( $option_name, $default );
|
186 |
}
|
187 |
+
|
188 |
$this->loadAllNetworkOptions();
|
189 |
+
|
190 |
$network_id = (int) get_current_network_id();
|
191 |
$cache_key = $network_id . ':' . $this->getPrefix() . $option_name;
|
192 |
$option_value = wp_cache_get( $cache_key, $this->getPrefix() . 'network_options' );
|
193 |
+
|
194 |
if ( false === $option_value ) {
|
195 |
$option_value = $default;
|
196 |
}
|
197 |
+
|
198 |
/**
|
199 |
+
* Фильтр позволяет отфильтровать возвращаемое значение сетевой опции.
|
|
|
|
|
|
|
200 |
*
|
201 |
+
* @since 4.0.9 - Добавлен
|
202 |
+
*
|
203 |
+
* @param mixed $option_value Значение опции
|
204 |
+
* @param string $option_name Имя опции
|
205 |
+
* @param mixed $default Значение опции по умолчанию
|
206 |
+
* @param int $network_id ID сети
|
207 |
*/
|
208 |
+
|
209 |
return apply_filters( "wbcr/factory/network_option_{$option_name}", $option_value, $option_name, $default, $network_id );
|
210 |
}
|
211 |
+
|
212 |
/**
|
213 |
+
* Метод позволяет получить опцию для текущего сайта. Опция вытаскивается из объектного кеша, после выполнения метода
|
214 |
+
* self:loadAllOptions, а не напрямую из базы данных, из-за чего при работе с некоторыми кеширующими плагинами,
|
215 |
+
* может быть странное поведение в работе плагина.
|
216 |
*
|
217 |
+
* @since 4.0.0 - Добавлен
|
218 |
+
* @since 4.0.8 - Полностью переделан
|
219 |
*
|
220 |
+
* @param string $option_name Имя опции без префикса.
|
221 |
+
* @param mixed $default Значение по умолчанию. Если опции нет в базе данных, будет возвращено это значение. По умолчанию false
|
222 |
*
|
223 |
* @return mixed
|
224 |
*/
|
226 |
if ( empty( $option_name ) || ! is_string( $option_name ) ) {
|
227 |
throw new Exception( 'Option name must be a string and must not be empty.' );
|
228 |
}
|
229 |
+
|
230 |
$this->loadAllOptions();
|
231 |
+
|
232 |
$option_value = wp_cache_get( $this->getPrefix() . $option_name, $this->getPrefix() . 'options' );
|
233 |
+
|
234 |
if ( false === $option_value ) {
|
235 |
$option_value = $default;
|
236 |
}
|
237 |
+
|
238 |
/**
|
239 |
+
* Фильтр позволяет отфильтровать возвращаемое значение опции сайта.
|
|
|
|
|
240 |
*
|
241 |
+
* @since 4.0.9 - Добавлен
|
242 |
+
*
|
243 |
+
* @param mixed $option_value Значение опции
|
244 |
+
* @param string $option_name Имя опции
|
245 |
+
* @param mixed $default Значение опции по умолчанию
|
246 |
*/
|
247 |
+
|
248 |
return apply_filters( "wbcr/factory/option_{$option_name}", $option_value, $option_name, $default );
|
249 |
}
|
250 |
+
|
251 |
/**
|
252 |
+
* Позволяет обновить популярную опцию в базе данных. Если плагин установлен для сети (в режиме мультисайтов), то метод обновляет опцию
|
253 |
+
* только в таблице sitemeta, иначе в таблице options для текущего сайта.
|
254 |
*
|
255 |
+
* @param string $option_name Имя опции без префикса.
|
256 |
+
* @param mixed $option_value Значение опции. Может принимать массив или объект.
|
257 |
*/
|
258 |
public function updatePopulateOption( $option_name, $option_value ) {
|
259 |
if ( $this->isNetworkActive() ) {
|
262 |
$this->updateOption( $option_name, $option_value );
|
263 |
}
|
264 |
}
|
265 |
+
|
266 |
/**
|
267 |
+
* Обновляет сетевую опцию в БД таблица sitemeta. После успешного обновления опции в базе данных, метод добавляет опцию в объектный кеш,
|
268 |
+
* чтобы плагин мог приступить к работе с этой опцией незамедлительно.
|
|
|
269 |
*
|
270 |
+
* @since 4.0.8 - Добавлен
|
|
|
271 |
*
|
272 |
+
* @param string $option_name Имя опции без префикса.
|
273 |
+
* @param mixed $option_value Значение опции. Может принимать массив или объект.
|
274 |
*/
|
275 |
public function updateNetworkOption( $option_name, $option_value ) {
|
276 |
$network_id = (int) get_current_network_id();
|
277 |
$cache_key = $network_id . ':' . $this->getPrefix() . $option_name;
|
278 |
wp_cache_set( $cache_key, $option_value, $this->getPrefix() . 'network_options' );
|
279 |
+
|
280 |
+
update_site_option( $this->getPrefix() . $option_name, $option_value );
|
281 |
+
|
282 |
/**
|
283 |
+
* Действие будет выполнено, когда сетевая опция будет обновлена.
|
|
|
284 |
*
|
285 |
+
* @since 4.0.8 - Добавлен
|
286 |
+
*
|
287 |
+
* @param string $option_name Имя опции без префикса.
|
288 |
+
* @param mixed $option_value Значение опции. Может принимать массив или объект.
|
289 |
*/
|
290 |
do_action( "wbcr/factory/update_network_option", $option_name, $option_value );
|
|
|
|
|
291 |
}
|
292 |
+
|
293 |
/**
|
294 |
+
* Обновляет опцию сайта в БД таблица options. После успешного обновления опции в базе данных, метод добавляет опцию в объектный кеш,
|
295 |
+
* чтобы плагин мог приступить к работе с этой опцией незамедлительно.
|
296 |
*
|
297 |
+
* @since 4.0.0 - Добавлен
|
298 |
+
* @since 4.0.8 - Полностью переделан
|
299 |
*
|
300 |
+
* @param string $option_name Имя опции без префикса.
|
301 |
+
* @param mixed $option_value Значение опции. Может принимать массив или объект.
|
302 |
*
|
303 |
* @return bool
|
304 |
*/
|
305 |
public function updateOption( $option_name, $option_value ) {
|
306 |
wp_cache_set( $this->getPrefix() . $option_name, $option_value, $this->getPrefix() . 'options' );
|
307 |
$result = update_option( $this->getPrefix() . $option_name, $option_value );
|
308 |
+
|
309 |
/**
|
310 |
+
* @since 4.0.8
|
311 |
+
*
|
312 |
* @param string $option_name
|
313 |
*
|
314 |
+
* @param mixed $option_value
|
315 |
*/
|
316 |
do_action( "wbcr/factory/update_option", $option_name, $option_value );
|
317 |
+
|
318 |
return $result;
|
319 |
}
|
320 |
+
|
321 |
/**
|
322 |
+
* Позволяет удалять популярную опцию в базе данных. Если плагин установлен для сети (в режиме мультисайтов), то метод удаляет опцию
|
323 |
+
* только в таблице sitemeta, иначе в таблице options для текущего сайта.
|
324 |
*
|
325 |
+
* @since 4.0.0 - Добавлен
|
326 |
*
|
327 |
+
* @param string $option_name Имя опции без префикса.
|
328 |
*/
|
329 |
public function deletePopulateOption( $option_name ) {
|
330 |
if ( $this->isNetworkActive() ) {
|
333 |
$this->deleteOption( $option_name );
|
334 |
}
|
335 |
}
|
336 |
+
|
337 |
/**
|
338 |
+
* Удаляет сетевую.опцию в БД таблица sitemeta, а если опция есть в кеше, индивидуально удаляет опцию из кеша.
|
|
|
339 |
*
|
340 |
+
* @since 4.0.0 - Добавлен
|
341 |
*
|
342 |
+
* @param string $option_name Имя опции без префикса.
|
343 |
+
*
|
344 |
+
* @return bool Возвращает true, если опция удалена успешно, false в случае ошибки.
|
345 |
*/
|
346 |
public function deleteNetworkOption( $option_name ) {
|
347 |
$network_id = (int) get_current_network_id();
|
348 |
$cache_key = $network_id . ':' . $this->getPrefix() . $option_name;
|
349 |
$delete_cache = wp_cache_delete( $cache_key, $this->getPrefix() . 'network_options' );
|
350 |
+
|
351 |
$delete_opt1 = delete_site_option( $this->getPrefix() . $option_name );
|
352 |
+
|
353 |
return $delete_cache && $delete_opt1;
|
354 |
}
|
355 |
+
|
356 |
/**
|
357 |
+
* Удаляет опцию сайта в БД таблица options, а если опция есть в кеше, индивидуально удаляет опцию из кеша.
|
|
|
358 |
*
|
359 |
+
* @since 4.0.0 - Добавлен
|
360 |
*
|
361 |
+
* @param string $option_name Имя опции без префикса.
|
362 |
+
*
|
363 |
+
* @return bool Возвращает true, если опция удалена успешно, false в случае ошибки.
|
364 |
*/
|
365 |
public function deleteOption( $option_name ) {
|
366 |
$delete_cache = wp_cache_delete( $this->getPrefix() . $option_name, $this->getPrefix() . 'options' );
|
367 |
+
|
368 |
// todo: удалить, когда большая часть пользователей обновятся до современных релизов
|
369 |
$delete_opt1 = delete_option( $this->getPrefix() . $option_name . '_is_active' );
|
370 |
$delete_opt2 = delete_option( $this->getPrefix() . $option_name );
|
371 |
+
|
372 |
return $delete_cache && $delete_opt1 && $delete_opt2;
|
373 |
}
|
374 |
+
|
375 |
/**
|
376 |
+
* Сбрасывает объектный кеш. Может использоваться для перезагрузки опций плагина и Wordpress в целом.
|
377 |
*
|
378 |
+
* @since 4.0.0 - Добавлен
|
379 |
+
* @return bool Возвращает true, если кеш сброшен успешно, false в случае ошибки.
|
380 |
*/
|
381 |
public function flushOptionsCache() {
|
382 |
return wp_cache_flush();
|
383 |
}
|
384 |
+
|
385 |
/**
|
386 |
+
* Позволяет получить полное имя опции с префиксом. Может быть использовано в тех случаях, где нужно получить
|
387 |
+
* полное имя опции.
|
388 |
+
*
|
389 |
+
* @since 4.0.0 - Добавлен
|
390 |
*
|
391 |
+
* @param string $option_name Имя опции без префикса.
|
392 |
*
|
393 |
+
* @return null|string Возвращает имя опции с префиксом. Например wbcr_clearfy_{options_name}
|
394 |
*/
|
395 |
public function getOptionName( $option_name ) {
|
396 |
$option_name = trim( rtrim( $option_name ) );
|
397 |
if ( empty( $option_name ) || ! is_string( $option_name ) ) {
|
398 |
return null;
|
399 |
}
|
400 |
+
|
401 |
return $this->getPrefix() . $option_name;
|
402 |
}
|
403 |
+
|
404 |
/**
|
405 |
+
* Позволяет нормализовать данные. В некоторых методах этого трейта, ожидаются данные определенного типа, чтобы
|
406 |
+
* выполнить различные логические операции. Как раз в этом случае этот метод можно использовать, чтобы привести
|
407 |
+
* все сырые данные в строгий тип. Такое решение позволит избежать ошибок в работе программиста.
|
408 |
+
*
|
409 |
+
* @since 4.0.0 - Добавлен
|
410 |
*
|
411 |
+
* @param mixed $data Данные, которые нужно нормализовать.
|
412 |
*
|
413 |
+
* @return mixed Возвращает нормализованное значение.
|
414 |
+
* - Если передана строка "true" или "false" вернет булево значение.
|
415 |
+
* - Если передана строка "1" или "0" вернет число.
|
416 |
*/
|
417 |
public function normalizeValue( $data ) {
|
418 |
if ( is_string( $data ) ) {
|
419 |
$check_string = rtrim( trim( $data ) );
|
420 |
+
|
421 |
if ( $check_string == "1" || $check_string == "0" ) {
|
422 |
return intval( $data );
|
423 |
} else if ( $check_string === 'false' ) {
|
426 |
return true;
|
427 |
}
|
428 |
}
|
429 |
+
|
430 |
return $data;
|
431 |
}
|
432 |
}
|
libs/factory/core/includes/class-factory-plugin-abstract.php
CHANGED
@@ -4,82 +4,109 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
-
|
8 |
/**
|
9 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
*
|
11 |
-
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
12 |
* @since 1.0.0
|
13 |
* @package factory-core
|
14 |
-
* @copyright (c) 2018 Webcraftic Ltd
|
15 |
*
|
16 |
*/
|
17 |
-
abstract class
|
18 |
|
19 |
/**
|
20 |
-
* Instance class
|
21 |
*
|
22 |
-
* @
|
|
|
23 |
*/
|
24 |
public $request;
|
25 |
|
26 |
/**
|
27 |
-
* @
|
|
|
28 |
*/
|
29 |
public $premium;
|
30 |
|
31 |
/**
|
32 |
* The Bootstrap Manager class
|
33 |
*
|
34 |
-
* @var
|
35 |
*/
|
36 |
public $bootstrap;
|
37 |
|
38 |
/**
|
39 |
* The Bootstrap Manager class
|
40 |
*
|
41 |
-
* @var
|
42 |
*/
|
43 |
public $forms;
|
44 |
|
45 |
/**
|
46 |
-
*
|
|
|
|
|
47 |
*
|
48 |
-
* @var
|
49 |
*/
|
50 |
protected $activator_class = [];
|
51 |
|
52 |
/**
|
53 |
-
*
|
|
|
54 |
*
|
55 |
* @var array
|
56 |
*/
|
57 |
private $loaded_factory_modules = [];
|
58 |
|
59 |
/**
|
60 |
-
*
|
|
|
61 |
*
|
62 |
-
* @
|
|
|
|
|
63 |
*/
|
64 |
-
private $
|
65 |
|
66 |
/**
|
67 |
-
*
|
68 |
*
|
69 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
*
|
71 |
-
* @param array
|
72 |
*
|
73 |
-
* @param string $plugin_path
|
74 |
*
|
75 |
* @throws Exception
|
|
|
|
|
76 |
*/
|
77 |
public function __construct( $plugin_path, $data ) {
|
78 |
|
79 |
parent::__construct( $plugin_path, $data );
|
80 |
|
81 |
-
$this->request = new
|
82 |
-
//$this->route = new
|
83 |
|
84 |
// INIT PLUGIN FRAMEWORK MODULES
|
85 |
// Framework modules should always be loaded first,
|
@@ -102,45 +129,139 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
102 |
|
103 |
// init actions
|
104 |
$this->register_plugin_hooks();
|
105 |
-
}
|
106 |
|
107 |
-
|
108 |
-
|
|
|
109 |
|
110 |
/**
|
111 |
-
*
|
|
|
|
|
|
|
112 |
*/
|
113 |
-
public function setBootstap(
|
114 |
$this->bootstrap = $bootstrap;
|
115 |
}
|
116 |
|
117 |
/**
|
118 |
-
*
|
|
|
|
|
119 |
*/
|
120 |
-
public function setForms(
|
121 |
$this->forms = $forms;
|
122 |
}
|
123 |
|
124 |
/**
|
125 |
-
* Устанавливает
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
*/
|
127 |
-
|
128 |
-
if ( empty( $
|
129 |
return;
|
130 |
}
|
131 |
|
132 |
-
$locale = apply_filters( 'plugin_locale', is_admin() ? get_user_locale() : get_locale(), $
|
133 |
|
134 |
-
$mofile = $
|
135 |
|
136 |
-
if ( ! load_textdomain( $
|
137 |
-
load_muplugin_textdomain( $
|
138 |
}
|
139 |
}
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
/**
|
142 |
-
*
|
143 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
*
|
145 |
* @throws Exception
|
146 |
*/
|
@@ -160,46 +281,38 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
160 |
throw new Exception( 'A class with this name {' . $class_name . '} does not exist.' );
|
161 |
}
|
162 |
|
163 |
-
if ( ! class_exists( '
|
164 |
-
throw new Exception( 'The
|
165 |
}
|
166 |
|
167 |
-
|
168 |
}
|
169 |
|
170 |
/**
|
171 |
-
*
|
172 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
*
|
174 |
* @throws Exception
|
|
|
175 |
*/
|
176 |
public function registerType( $class_name, $file_path ) {
|
177 |
-
|
178 |
-
if ( ! file_exists( $file_path ) ) {
|
179 |
-
throw new Exception( 'The page file was not found by the path {' . $file_path . '} you set.' );
|
180 |
-
}
|
181 |
-
|
182 |
-
require_once( $file_path );
|
183 |
-
|
184 |
-
if ( ! class_exists( $class_name ) ) {
|
185 |
-
throw new Exception( 'A class with this name {' . $class_name . '} does not exist.' );
|
186 |
-
}
|
187 |
-
|
188 |
-
if ( ! class_exists( 'Wbcr_FactoryTypes000' ) ) {
|
189 |
-
throw new Exception( 'The factory_types_000 module is not included.' );
|
190 |
-
}
|
191 |
-
|
192 |
-
Wbcr_FactoryTypes000::register( $class_name, $this );
|
193 |
}
|
194 |
|
195 |
/**
|
196 |
* Registers a class to activate the plugin.
|
197 |
*
|
198 |
-
* @
|
199 |
-
*
|
200 |
-
* @param string $className class name of the plugin activator.
|
201 |
*
|
202 |
* @return void
|
|
|
|
|
203 |
*/
|
204 |
public function registerActivation( $className ) {
|
205 |
$this->activator_class[] = $className;
|
@@ -211,24 +324,24 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
211 |
/**
|
212 |
* It's invoked on plugin activation. Don't excite it directly.
|
213 |
*
|
214 |
-
* @since 1.0.0
|
215 |
* @return void
|
|
|
216 |
*/
|
217 |
public function activation_hook() {
|
218 |
|
219 |
/**
|
220 |
* @since 4.1.1 - change hook name
|
221 |
*/
|
222 |
-
if ( apply_filters( "wbcr/
|
223 |
return;
|
224 |
}
|
225 |
|
226 |
/**
|
227 |
-
*
|
228 |
*
|
229 |
* @since 4.1.1 - deprecated
|
230 |
*/
|
231 |
-
|
232 |
$this
|
233 |
], '4.1.1', "wbcr/factory/plugin_activation" );
|
234 |
|
@@ -237,7 +350,7 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
237 |
*
|
238 |
* @since 4.1.2 - deprecated
|
239 |
*/
|
240 |
-
|
241 |
$this
|
242 |
], '4.1.2', "wbcr/factory/before_plugin_activation" );
|
243 |
|
@@ -253,16 +366,16 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
253 |
*
|
254 |
* @since 4.1.2 - deprecated
|
255 |
*/
|
256 |
-
|
257 |
$this
|
258 |
], '4.1.2', "wbcr/factory/before_plugin_{$this->plugin_name}_activation" );
|
259 |
|
260 |
/**
|
261 |
-
*
|
262 |
*
|
263 |
* @since 4.1.1 - deprecated
|
264 |
*/
|
265 |
-
|
266 |
$this
|
267 |
], '4.1.1', "wbcr/factory/before_plugin_{$this->plugin_name}_activation" );
|
268 |
|
@@ -294,24 +407,24 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
294 |
/**
|
295 |
* It's invoked on plugin deactionvation. Don't excite it directly.
|
296 |
*
|
297 |
-
* @since 1.0.0
|
298 |
* @return void
|
|
|
299 |
*/
|
300 |
public function deactivation_hook() {
|
301 |
|
302 |
/**
|
303 |
* @since 4.1.1 - change hook name
|
304 |
*/
|
305 |
-
if ( apply_filters( "wbcr/
|
306 |
return;
|
307 |
}
|
308 |
|
309 |
/**
|
310 |
-
*
|
311 |
*
|
312 |
* @since 4.1.1 - deprecated
|
313 |
*/
|
314 |
-
|
315 |
$this
|
316 |
], '4.1.1', "wbcr/factory/plugin_deactivation" );
|
317 |
|
@@ -320,7 +433,7 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
320 |
*
|
321 |
* @since 4.1.2 - deprecated
|
322 |
*/
|
323 |
-
|
324 |
$this
|
325 |
], '4.1.2', "wbcr/factory/before_plugin_deactivation" );
|
326 |
|
@@ -332,11 +445,11 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
332 |
do_action( 'wbcr/factory/plugin_deactivation', $this );
|
333 |
|
334 |
/**
|
335 |
-
*
|
336 |
*
|
337 |
* @since 4.1.1 - deprecated
|
338 |
*/
|
339 |
-
|
340 |
$this
|
341 |
], '4.1.1', "wbcr/factory/before_plugin_{$this->plugin_name}_deactivation" );
|
342 |
|
@@ -345,7 +458,7 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
345 |
*
|
346 |
* @since 4.1.2 - deprecated
|
347 |
*/
|
348 |
-
|
349 |
$this
|
350 |
], '4.1.2', "wbcr/factory/before_plugin_{$this->plugin_name}_deactivation" );
|
351 |
|
@@ -382,8 +495,8 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
382 |
* @throws Exception
|
383 |
*/
|
384 |
public function getPluginPageUrl( $page_id, $args = [] ) {
|
385 |
-
if ( ! class_exists( '
|
386 |
-
throw new Exception( 'The
|
387 |
}
|
388 |
|
389 |
if ( ! is_admin() ) {
|
@@ -392,44 +505,61 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
392 |
return null;
|
393 |
}
|
394 |
|
395 |
-
return
|
396 |
}
|
397 |
|
398 |
-
|
399 |
/**
|
400 |
* Загружает аддоны для плагина, как часть проекта, а не как отдельный плагин
|
|
|
|
|
401 |
*/
|
402 |
-
|
403 |
-
|
|
|
|
|
|
|
404 |
return;
|
405 |
}
|
406 |
|
407 |
-
foreach ( $
|
408 |
-
if ( ! isset( $this->
|
409 |
-
|
410 |
-
// При подключении аддона, мы объявляем константу, что такой аддон уже загружен
|
411 |
-
// $addon_name индентификатор аддона в вверхнем регистре
|
412 |
-
$const_name = strtoupper( 'LOADING_' . str_replace( '-', '_', $addon_name ) . '_AS_ADDON' );
|
413 |
|
414 |
-
if ( !
|
415 |
-
|
416 |
}
|
417 |
|
418 |
-
|
419 |
|
420 |
-
|
421 |
-
|
|
|
422 |
|
423 |
-
|
424 |
-
$plugin_data['as_addon'] = true;
|
425 |
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
|
430 |
-
|
431 |
-
|
432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
}
|
434 |
}
|
435 |
}
|
@@ -470,12 +600,12 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
470 |
/**
|
471 |
* @since 4.1.1 - deprecated
|
472 |
*/
|
473 |
-
|
474 |
|
475 |
/**
|
476 |
* @since 4.1.1 - add
|
477 |
*/
|
478 |
-
do_action( 'wbcr/
|
479 |
}
|
480 |
|
481 |
|
@@ -486,10 +616,22 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
486 |
*/
|
487 |
private function register_plugin_hooks() {
|
488 |
|
489 |
-
add_action( 'plugins_loaded',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
|
491 |
if ( is_admin() ) {
|
492 |
-
add_filter( '
|
493 |
|
494 |
register_activation_hook( $this->get_paths()->main_file, [ $this, 'activation_hook' ] );
|
495 |
register_deactivation_hook( $this->get_paths()->main_file, [ $this, 'deactivation_hook' ] );
|
@@ -499,37 +641,37 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
499 |
/**
|
500 |
* Инициализируем миграции плагина
|
501 |
*
|
502 |
-
* @since 4.1.1
|
503 |
* @return void
|
504 |
* @throws Exception
|
|
|
505 |
*/
|
506 |
protected function init_plugin_migrations() {
|
507 |
-
new WBCR\
|
508 |
}
|
509 |
|
510 |
/**
|
511 |
* Инициализируем уведомления плагина
|
512 |
*
|
513 |
-
* @since 4.1.1
|
514 |
* @return void
|
|
|
515 |
*/
|
516 |
protected function init_plugin_notices() {
|
517 |
-
new Wbcr\
|
518 |
}
|
519 |
|
520 |
/**
|
521 |
-
* Создает нового рабочего для проверки обновлений и апгрейда текущего плагина.
|
522 |
-
*
|
523 |
-
* @since 4.1.1
|
524 |
*
|
525 |
* @param array $data
|
526 |
*
|
527 |
* @return void
|
528 |
* @throws Exception
|
|
|
|
|
529 |
*/
|
530 |
protected function init_plugin_updates() {
|
531 |
if ( $this->has_updates ) {
|
532 |
-
new WBCR\
|
533 |
}
|
534 |
}
|
535 |
|
@@ -540,8 +682,8 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
540 |
* Дополнительно создает рабочего, чтобы совершить апгрейд до премиум версии
|
541 |
* и запустить проверку обновлений для этого модуля.
|
542 |
*
|
543 |
-
* @since 4.1.1
|
544 |
* @throws Exception
|
|
|
545 |
*/
|
546 |
protected function init_plugin_premium_features() {
|
547 |
if ( ! $this->has_premium || ! $this->license_settings ) {
|
@@ -551,49 +693,12 @@ abstract class Wbcr_Factory414_Plugin extends Wbcr_Factory414_Base {
|
|
551 |
}
|
552 |
|
553 |
// Создаем экземляр премиум менеджера, мы сможем к нему обращаться глобально.
|
554 |
-
$this->premium = WBCR\
|
555 |
|
556 |
// Подключаем премиум апгрейдер
|
557 |
if ( isset( $this->license_settings['has_updates'] ) && $this->license_settings['has_updates'] ) {
|
558 |
-
new WBCR\
|
559 |
-
}
|
560 |
-
}
|
561 |
-
|
562 |
-
/**
|
563 |
-
* @since 4.1.1
|
564 |
-
*
|
565 |
-
* @param array | string $dependents
|
566 |
-
*
|
567 |
-
* @throws Exception
|
568 |
-
*/
|
569 |
-
/*protected function modules_dependent( $dependents ) {
|
570 |
-
$modules = array();
|
571 |
-
|
572 |
-
if ( is_array( $dependents ) ) {
|
573 |
-
foreach ( $dependents as $module_name ) {
|
574 |
-
if ( ! isset( $this->loaded_factory_modules[ $module_name ] ) ) {
|
575 |
-
$modules[] = $module_name;
|
576 |
-
}
|
577 |
-
}
|
578 |
-
} else if ( ! isset( $this->loaded_factory_modules[ $dependents ] ) ) {
|
579 |
-
$modules[] = $dependents;
|
580 |
}
|
581 |
-
|
582 |
-
if ( ! empty( $modules ) ) {
|
583 |
-
throw new Exception( "Error in factory framework. Your plugin configuration requires include of additional framework modules: " . implode( ',', $modules ) . "." );
|
584 |
-
}
|
585 |
-
}*/
|
586 |
-
|
587 |
-
// ----------------------------------------------------------------------
|
588 |
-
// Public methods
|
589 |
-
// ----------------------------------------------------------------------
|
590 |
-
|
591 |
-
public function newScriptList() {
|
592 |
-
return new Wbcr_Factory414_ScriptList( $this );
|
593 |
-
}
|
594 |
-
|
595 |
-
public function newStyleList() {
|
596 |
-
return new Wbcr_Factory414_StyleList( $this );
|
597 |
}
|
598 |
}
|
599 |
|
4 |
exit;
|
5 |
}
|
6 |
|
|
|
7 |
/**
|
8 |
+
* Основной класс для создания плагина.
|
9 |
+
*
|
10 |
+
* Это основной класс плагина. который отвечает за подключение модулей фреймворка, линзирование, обновление,
|
11 |
+
* миграции разрабатываемого плагина. При создании нового плагина, вы должны создать основной класс реализующий
|
12 |
+
* функции плагина, этот класс будет наследовать текущий.
|
13 |
+
*
|
14 |
+
* Смотрите подробную инструкцию по созданию плагина и экземпляра основного класса в документации по созданию
|
15 |
+
* плагина для Wordpress.
|
16 |
+
*
|
17 |
+
* Документация по классу: https://webcraftic.atlassian.net/wiki/spaces/FFD/pages/393052164
|
18 |
+
* Документация по созданию плагина: https://webcraftic.atlassian.net/wiki/spaces/CNCFC/pages/327828
|
19 |
+
*
|
20 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
21 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
22 |
*
|
|
|
23 |
* @since 1.0.0
|
24 |
* @package factory-core
|
|
|
25 |
*
|
26 |
*/
|
27 |
+
abstract class Wbcr_Factory425_Plugin extends Wbcr_Factory425_Base {
|
28 |
|
29 |
/**
|
30 |
+
* Instance class Wbcr_Factory425_Request, required manages http requests
|
31 |
*
|
32 |
+
* @see https://webcraftic.atlassian.net/wiki/spaces/FFD/pages/390561806
|
33 |
+
* @var Wbcr_Factory425_Request
|
34 |
*/
|
35 |
public $request;
|
36 |
|
37 |
/**
|
38 |
+
* @see https://webcraftic.atlassian.net/wiki/spaces/FFD/pages/393936924
|
39 |
+
* @var \WBCR\Factory_425\Premium\Provider
|
40 |
*/
|
41 |
public $premium;
|
42 |
|
43 |
/**
|
44 |
* The Bootstrap Manager class
|
45 |
*
|
46 |
+
* @var Wbcr_FactoryBootstrap426_Manager
|
47 |
*/
|
48 |
public $bootstrap;
|
49 |
|
50 |
/**
|
51 |
* The Bootstrap Manager class
|
52 |
*
|
53 |
+
* @var Wbcr_FactoryForms423_Manager
|
54 |
*/
|
55 |
public $forms;
|
56 |
|
57 |
/**
|
58 |
+
* Простой массив со списком зарегистрированных классов унаследованных от Wbcr_Factory425_Activator.
|
59 |
+
* Классы активации используются для упаковки набора функций, которые нужно выполнить во время
|
60 |
+
* активации плагина.
|
61 |
*
|
62 |
+
* @var array[] Wbcr_Factory425_Activator
|
63 |
*/
|
64 |
protected $activator_class = [];
|
65 |
|
66 |
/**
|
67 |
+
* Ассоциативный массив со списком уже загруженных модулей фреймворка. Используется для того, чтобы
|
68 |
+
* проверить, каких модули уже были загружены, а какие еще нет.
|
69 |
*
|
70 |
* @var array
|
71 |
*/
|
72 |
private $loaded_factory_modules = [];
|
73 |
|
74 |
/**
|
75 |
+
* Ассоциативный массив со списком аддонов плагина. Аддоны плагина являются частью одного проекта,
|
76 |
+
* но не как отдельный плагин.
|
77 |
*
|
78 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
79 |
+
* @since 4.2.0
|
80 |
+
* @var array
|
81 |
*/
|
82 |
+
private $loaded_plugin_components = [];
|
83 |
|
84 |
/**
|
85 |
+
* The Adverts Manager class
|
86 |
*
|
87 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
88 |
+
* @since 4.1.9
|
89 |
+
* @var WBCR\Factory_Adverts_106\Base
|
90 |
+
*/
|
91 |
+
private $adverts;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Инициализирует компоненты фреймворка и плагина.
|
95 |
*
|
96 |
+
* @param array $data A set of plugin data.
|
97 |
*
|
98 |
+
* @param string $plugin_path A full path to the main plugin file.
|
99 |
*
|
100 |
* @throws Exception
|
101 |
+
* @since 1.0.0
|
102 |
+
*
|
103 |
*/
|
104 |
public function __construct( $plugin_path, $data ) {
|
105 |
|
106 |
parent::__construct( $plugin_path, $data );
|
107 |
|
108 |
+
$this->request = new Wbcr_Factory425_Request();
|
109 |
+
//$this->route = new Wbcr_Factory425_Route();
|
110 |
|
111 |
// INIT PLUGIN FRAMEWORK MODULES
|
112 |
// Framework modules should always be loaded first,
|
129 |
|
130 |
// init actions
|
131 |
$this->register_plugin_hooks();
|
|
|
132 |
|
133 |
+
// INIT PLUGIN COMPONENTS
|
134 |
+
$this->init_plugin_components();
|
135 |
+
}
|
136 |
|
137 |
/**
|
138 |
+
* Устанавливает класс менеджер, которому плагин будет делегировать подключение ресурсов (картинок,
|
139 |
+
* скриптов, стилей) фреймворка.
|
140 |
+
*
|
141 |
+
* @param Wbcr_FactoryBootstrap426_Manager $bootstrap
|
142 |
*/
|
143 |
+
public function setBootstap( Wbcr_FactoryBootstrap426_Manager $bootstrap ) {
|
144 |
$this->bootstrap = $bootstrap;
|
145 |
}
|
146 |
|
147 |
/**
|
148 |
+
* Устанавливает класс менеджер, которому будет делегирована работа с html формами фреймворка.
|
149 |
+
*
|
150 |
+
* @param Wbcr_FactoryForms423_Manager $forms
|
151 |
*/
|
152 |
+
public function setForms( Wbcr_FactoryForms423_Manager $forms ) {
|
153 |
$this->forms = $forms;
|
154 |
}
|
155 |
|
156 |
/**
|
157 |
+
* Устанавливает класс менеджер, которому будет делегирована работа с объявлениями в Wordpress
|
158 |
+
*
|
159 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
160 |
+
* @since 4.1.9
|
161 |
+
*/
|
162 |
+
public function set_adverts_manager( $class_name ) {
|
163 |
+
if ( empty( $this->adverts ) && $this->render_adverts ) {
|
164 |
+
$this->adverts = new $class_name( $this, $this->adverts_settings );
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Устанавливает класс провайдера лицензий
|
170 |
+
*
|
171 |
+
* С помощью этого класса, мы проверяем валидность лицензий и получаем дополнительную информацию
|
172 |
+
* о лицензии и ее покупателе. Класс используется в премиум менеджере.
|
173 |
+
*
|
174 |
+
* @param string $name Имя провайдер
|
175 |
+
* @param string $class_name Имя класса провайдера
|
176 |
+
*
|
177 |
+
* @since 4.1.6 - Добавлен
|
178 |
+
*
|
179 |
+
*/
|
180 |
+
public function set_license_provider( $name, $class_name ) {
|
181 |
+
if ( ! isset( WBCR\Factory_425\Premium\Manager::$providers[ $name ] ) ) {
|
182 |
+
WBCR\Factory_425\Premium\Manager::$providers[ $name ] = $class_name;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Регистрируем класс репозитория
|
188 |
+
*
|
189 |
+
* С помощью этого класса мы реализиуем доставку и откат обновлений плагина, на сайт пользователя.
|
190 |
+
* Скачиваение премиум версий происходит по защенному каналу. Класс используется в менеджере обновлений.
|
191 |
+
*
|
192 |
+
* @param string $name Имя репозитория
|
193 |
+
* @param string $class_name Имя класса репозитория
|
194 |
+
*
|
195 |
+
* @since 4.1.7 - Добавлен
|
196 |
+
*
|
197 |
+
*/
|
198 |
+
public function set_update_repository( $name, $class_name ) {
|
199 |
+
if ( ! isset( WBCR\Factory_425\Updates\Upgrader::$repositories[ $name ] ) ) {
|
200 |
+
WBCR\Factory_425\Updates\Upgrader::$repositories[ $name ] = $class_name;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Позволяет получить экземпляр менеджера объявления
|
206 |
+
*
|
207 |
+
* Доступен глобально через метод app(), чаще всего используется для создания точек для ротации
|
208 |
+
* рекламных объявлений.
|
209 |
+
*
|
210 |
+
* @return \WBCR\Factory_Adverts_106\Base
|
211 |
+
* @since 1.1
|
212 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
213 |
+
*/
|
214 |
+
public function get_adverts_manager() {
|
215 |
+
return $this->adverts;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Устанавливает текстовый домен для плагина. Текстовый домен берется из заголовка входного
|
220 |
+
* файла плагина.
|
221 |
+
*
|
222 |
+
* @since 4.2.5 - Добавлены 2 аргумента $text_domain, $plugin_dir. Теперь protected
|
223 |
+
* @since 4.0.8 - Добавлен
|
224 |
+
*
|
225 |
+
* @see https://codex.wordpress.org/I18n_for_WordPress_Developers
|
226 |
+
* @see https://webcraftic.atlassian.net/wiki/spaces/CNCFC/pages/327828 - документация по входному файлу
|
227 |
*/
|
228 |
+
protected function set_text_domain( $text_domain, $plugin_dir ) {
|
229 |
+
if ( empty( $text_domain ) || empty( $plugin_dir ) ) {
|
230 |
return;
|
231 |
}
|
232 |
|
233 |
+
$locale = apply_filters( 'plugin_locale', is_admin() ? get_user_locale() : get_locale(), $text_domain );
|
234 |
|
235 |
+
$mofile = $text_domain . '-' . $locale . '.mo';
|
236 |
|
237 |
+
if ( ! load_textdomain( $text_domain, $plugin_dir . '/languages/' . $mofile ) ) {
|
238 |
+
load_muplugin_textdomain( $text_domain );
|
239 |
}
|
240 |
}
|
241 |
|
242 |
+
public function newScriptList() {
|
243 |
+
return new Wbcr_Factory425_ScriptList( $this );
|
244 |
+
}
|
245 |
+
|
246 |
+
public function newStyleList() {
|
247 |
+
return new Wbcr_Factory425_StyleList( $this );
|
248 |
+
}
|
249 |
+
|
250 |
/**
|
251 |
+
* Все страницы плагина создаются через специальную обертку, за которую отвечает модуль
|
252 |
+
* фреймворка pages. Разработчик создает собственный класс, унаследованный от
|
253 |
+
* Wbcr_FactoryPages425_AdminPage, а затем регистрирует его через этот метод.
|
254 |
+
* Метод выполняет подключение класса страницы и регистрирует его в модуле фреймворка
|
255 |
+
* pages.
|
256 |
+
*
|
257 |
+
* Больше информации о создании и регистрации страниц, вы можете узнать из документации по созданию
|
258 |
+
* страниц плагина.
|
259 |
+
*
|
260 |
+
* @see https://webcraftic.atlassian.net/wiki/spaces/CNCFC/pages/222887949 - документация по созданию страниц
|
261 |
+
*
|
262 |
+
* @param string $class_name Имя регистрируемого класса страницы. Пример: WCL_Page_Name.
|
263 |
+
* Регистрируемый класс должен быть унаследован от класса Wbcr_FactoryPages425_AdminPage.
|
264 |
+
* @param string $file_path Абсолютный путь к файлу с классом страницы.
|
265 |
*
|
266 |
* @throws Exception
|
267 |
*/
|
281 |
throw new Exception( 'A class with this name {' . $class_name . '} does not exist.' );
|
282 |
}
|
283 |
|
284 |
+
if ( ! class_exists( 'Wbcr_FactoryPages425' ) ) {
|
285 |
+
throw new Exception( 'The factory_pages_425 module is not included.' );
|
286 |
}
|
287 |
|
288 |
+
Wbcr_FactoryPages425::register( $this, $class_name );
|
289 |
}
|
290 |
|
291 |
/**
|
292 |
+
* Произвольные типы записей в плагине, создаются через специальную обертку, за которую отвечает
|
293 |
+
* модуль фреймворка types. Разработчик создает собственный класс, унаследованный от
|
294 |
+
* Wbcr_FactoryTypes000_Type, а затем регистрирует его через этот метод. Метод выполняет
|
295 |
+
* подключение класса с новым типом записи и регистрирует его в модуле фреймворка types. *
|
296 |
+
*
|
297 |
+
* @param string $class_name Имя регистрируемого класса страницы. Пример: WCL_Type_Name.
|
298 |
+
* Регистрируемый класс должен быть унаследован от класса Wbcr_FactoryTypes000_Type.
|
299 |
+
* @param string $file_path Абсолютный путь к файлу с классом страницы.
|
300 |
*
|
301 |
* @throws Exception
|
302 |
+
* @deprecated 4.1.7 You cannot use it!
|
303 |
*/
|
304 |
public function registerType( $class_name, $file_path ) {
|
305 |
+
throw new Exception( 'As of factory core module 4.1.7, the "registerType" method is deprecated. You cannot use it!' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
}
|
307 |
|
308 |
/**
|
309 |
* Registers a class to activate the plugin.
|
310 |
*
|
311 |
+
* @param string $className class name of the plugin activator.
|
|
|
|
|
312 |
*
|
313 |
* @return void
|
314 |
+
* @since 1.0.0
|
315 |
+
*
|
316 |
*/
|
317 |
public function registerActivation( $className ) {
|
318 |
$this->activator_class[] = $className;
|
324 |
/**
|
325 |
* It's invoked on plugin activation. Don't excite it directly.
|
326 |
*
|
|
|
327 |
* @return void
|
328 |
+
* @since 1.0.0
|
329 |
*/
|
330 |
public function activation_hook() {
|
331 |
|
332 |
/**
|
333 |
* @since 4.1.1 - change hook name
|
334 |
*/
|
335 |
+
if ( apply_filters( "wbcr/factory_425/cancel_plugin_activation_{$this->plugin_name}", false ) ) {
|
336 |
return;
|
337 |
}
|
338 |
|
339 |
/**
|
340 |
+
* wbcr_factory_425_plugin_activation
|
341 |
*
|
342 |
* @since 4.1.1 - deprecated
|
343 |
*/
|
344 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr_factory_425_plugin_activation', [
|
345 |
$this
|
346 |
], '4.1.1', "wbcr/factory/plugin_activation" );
|
347 |
|
350 |
*
|
351 |
* @since 4.1.2 - deprecated
|
352 |
*/
|
353 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr/factory/plugin_activation', [
|
354 |
$this
|
355 |
], '4.1.2', "wbcr/factory/before_plugin_activation" );
|
356 |
|
366 |
*
|
367 |
* @since 4.1.2 - deprecated
|
368 |
*/
|
369 |
+
wbcr_factory_425_do_action_deprecated( "wbcr/factory/plugin_{$this->plugin_name}_activation", [
|
370 |
$this
|
371 |
], '4.1.2', "wbcr/factory/before_plugin_{$this->plugin_name}_activation" );
|
372 |
|
373 |
/**
|
374 |
+
* wbcr_factory_425_plugin_activation_' . $this->plugin_name
|
375 |
*
|
376 |
* @since 4.1.1 - deprecated
|
377 |
*/
|
378 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr_factory_425_plugin_activation_' . $this->plugin_name, [
|
379 |
$this
|
380 |
], '4.1.1', "wbcr/factory/before_plugin_{$this->plugin_name}_activation" );
|
381 |
|
407 |
/**
|
408 |
* It's invoked on plugin deactionvation. Don't excite it directly.
|
409 |
*
|
|
|
410 |
* @return void
|
411 |
+
* @since 1.0.0
|
412 |
*/
|
413 |
public function deactivation_hook() {
|
414 |
|
415 |
/**
|
416 |
* @since 4.1.1 - change hook name
|
417 |
*/
|
418 |
+
if ( apply_filters( "wbcr/factory_425/cancel_plugin_deactivation_{$this->plugin_name}", false ) ) {
|
419 |
return;
|
420 |
}
|
421 |
|
422 |
/**
|
423 |
+
* wbcr_factory_425_plugin_deactivation
|
424 |
*
|
425 |
* @since 4.1.1 - deprecated
|
426 |
*/
|
427 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr_factory_425_plugin_deactivation', [
|
428 |
$this
|
429 |
], '4.1.1', "wbcr/factory/plugin_deactivation" );
|
430 |
|
433 |
*
|
434 |
* @since 4.1.2 - deprecated
|
435 |
*/
|
436 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr/factory/plugin_deactivation', [
|
437 |
$this
|
438 |
], '4.1.2', "wbcr/factory/before_plugin_deactivation" );
|
439 |
|
445 |
do_action( 'wbcr/factory/plugin_deactivation', $this );
|
446 |
|
447 |
/**
|
448 |
+
* wbcr_factory_425_plugin_deactivation_ . $this->plugin_name
|
449 |
*
|
450 |
* @since 4.1.1 - deprecated
|
451 |
*/
|
452 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr_factory_425_plugin_deactivation_' . $this->plugin_name, [
|
453 |
$this
|
454 |
], '4.1.1', "wbcr/factory/before_plugin_{$this->plugin_name}_deactivation" );
|
455 |
|
458 |
*
|
459 |
* @since 4.1.2 - deprecated
|
460 |
*/
|
461 |
+
wbcr_factory_425_do_action_deprecated( "wbcr/factory/plugin_{$this->plugin_name}_deactivation", [
|
462 |
$this
|
463 |
], '4.1.2', "wbcr/factory/before_plugin_{$this->plugin_name}_deactivation" );
|
464 |
|
495 |
* @throws Exception
|
496 |
*/
|
497 |
public function getPluginPageUrl( $page_id, $args = [] ) {
|
498 |
+
if ( ! class_exists( 'Wbcr_FactoryPages425' ) ) {
|
499 |
+
throw new Exception( 'The factory_pages_425 module is not included.' );
|
500 |
}
|
501 |
|
502 |
if ( ! is_admin() ) {
|
505 |
return null;
|
506 |
}
|
507 |
|
508 |
+
return Wbcr_FactoryPages425::getPageUrl( $this, $page_id, $args );
|
509 |
}
|
510 |
|
|
|
511 |
/**
|
512 |
* Загружает аддоны для плагина, как часть проекта, а не как отдельный плагин
|
513 |
+
*
|
514 |
+
* @throws \Exception
|
515 |
*/
|
516 |
+
private function init_plugin_components() {
|
517 |
+
|
518 |
+
$load_plugin_components = $this->get_load_plugin_components();
|
519 |
+
|
520 |
+
if ( empty( $load_plugin_components ) || ! is_array( $load_plugin_components ) ) {
|
521 |
return;
|
522 |
}
|
523 |
|
524 |
+
foreach ( $load_plugin_components as $component_ID => $component ) {
|
525 |
+
if ( ! isset( $this->loaded_plugin_components[ $component_ID ] ) ) {
|
|
|
|
|
|
|
|
|
526 |
|
527 |
+
if ( ! isset( $component['autoload'] ) || ! isset( $component['plugin_prefix'] ) ) {
|
528 |
+
throw new Exception( sprintf( "Component %s cannot be loaded, you must specify the path to the component autoload file and plugin prefix!", $component_ID ) );
|
529 |
}
|
530 |
|
531 |
+
$prefix = rtrim( $component['plugin_prefix'], '_' ) . '_';
|
532 |
|
533 |
+
if ( defined( $prefix . 'PLUGIN_ACTIVE' ) ) {
|
534 |
+
continue;
|
535 |
+
}
|
536 |
|
537 |
+
$autoload_file = trailingslashit( $this->get_paths()->absolute ) . $component['autoload'];
|
|
|
538 |
|
539 |
+
if ( ! file_exists( $autoload_file ) ) {
|
540 |
+
throw new Exception( sprintf( "Component %s autoload file not found!", $component_ID ) );
|
541 |
+
}
|
542 |
|
543 |
+
require_once( $autoload_file );
|
544 |
+
|
545 |
+
if ( defined( $prefix . 'PLUGIN_ACTIVE' ) && class_exists( $prefix . 'Plugin' ) ) {
|
546 |
+
$this->loaded_plugin_components[ $component_ID ] = [
|
547 |
+
'plugin_dir' => constant( $prefix . 'PLUGIN_DIR' ),
|
548 |
+
'plugin_url' => constant( $prefix . 'PLUGIN_URL' ),
|
549 |
+
'plugin_base' => constant( $prefix . 'PLUGIN_BASE' ),
|
550 |
+
'text_domain' => constant( $prefix . 'TEXT_DOMAIN' ),
|
551 |
+
'plugin_version' => constant( $prefix . 'PLUGIN_VERSION' )
|
552 |
+
];
|
553 |
+
|
554 |
+
/**
|
555 |
+
* Оповещает внешние приложения, что компонент плагина был загружен
|
556 |
+
*
|
557 |
+
* @param array $load_plugin_components Информация о загруженном компоненте
|
558 |
+
* @param string $plugin_name Имя плагина
|
559 |
+
*/
|
560 |
+
do_action( "wbcr/factory/component_{$component_ID}_loaded", $this->loaded_plugin_components[ $component_ID ], $this->getPluginName() );
|
561 |
+
} else {
|
562 |
+
throw new Exception( sprintf( "Сomponent %s does not meet development standards!", $component_ID ) );
|
563 |
}
|
564 |
}
|
565 |
}
|
600 |
/**
|
601 |
* @since 4.1.1 - deprecated
|
602 |
*/
|
603 |
+
wbcr_factory_425_do_action_deprecated( 'wbcr_factory_425_core_modules_loaded-' . $this->plugin_name, [], '4.1.1', "wbcr/factory_425/modules_loaded-" . $this->plugin_name );
|
604 |
|
605 |
/**
|
606 |
* @since 4.1.1 - add
|
607 |
*/
|
608 |
+
do_action( 'wbcr/factory_425/modules_loaded-' . $this->plugin_name );
|
609 |
}
|
610 |
|
611 |
|
616 |
*/
|
617 |
private function register_plugin_hooks() {
|
618 |
|
619 |
+
add_action( 'plugins_loaded', function () {
|
620 |
+
$this->set_text_domain( $this->plugin_text_domain, $this->paths->absolute );
|
621 |
+
|
622 |
+
if ( ! empty( $this->loaded_plugin_components ) ) {
|
623 |
+
foreach ( $this->loaded_plugin_components as $component ) {
|
624 |
+
if ( empty( $component['text_domain'] ) ) {
|
625 |
+
continue;
|
626 |
+
}
|
627 |
+
|
628 |
+
$this->set_text_domain( $component['text_domain'], $component['plugin_dir'] );
|
629 |
+
}
|
630 |
+
}
|
631 |
+
} );
|
632 |
|
633 |
if ( is_admin() ) {
|
634 |
+
add_filter( 'wbcr_factory_425_core_admin_allow_multisite', '__return_true' );
|
635 |
|
636 |
register_activation_hook( $this->get_paths()->main_file, [ $this, 'activation_hook' ] );
|
637 |
register_deactivation_hook( $this->get_paths()->main_file, [ $this, 'deactivation_hook' ] );
|
641 |
/**
|
642 |
* Инициализируем миграции плагина
|
643 |
*
|
|
|
644 |
* @return void
|
645 |
* @throws Exception
|
646 |
+
* @since 4.1.1
|
647 |
*/
|
648 |
protected function init_plugin_migrations() {
|
649 |
+
new WBCR\Factory_425\Migrations( $this );
|
650 |
}
|
651 |
|
652 |
/**
|
653 |
* Инициализируем уведомления плагина
|
654 |
*
|
|
|
655 |
* @return void
|
656 |
+
* @since 4.1.1
|
657 |
*/
|
658 |
protected function init_plugin_notices() {
|
659 |
+
new Wbcr\Factory_425\Notices( $this );
|
660 |
}
|
661 |
|
662 |
/**
|
663 |
+
* Создает нового рабочего для проверки обновлений и апгрейда текущего плагина.
|
|
|
|
|
664 |
*
|
665 |
* @param array $data
|
666 |
*
|
667 |
* @return void
|
668 |
* @throws Exception
|
669 |
+
* @since 4.1.1
|
670 |
+
*
|
671 |
*/
|
672 |
protected function init_plugin_updates() {
|
673 |
if ( $this->has_updates ) {
|
674 |
+
new WBCR\Factory_425\Updates\Upgrader( $this );
|
675 |
}
|
676 |
}
|
677 |
|
682 |
* Дополнительно создает рабочего, чтобы совершить апгрейд до премиум версии
|
683 |
* и запустить проверку обновлений для этого модуля.
|
684 |
*
|
|
|
685 |
* @throws Exception
|
686 |
+
* @since 4.1.1
|
687 |
*/
|
688 |
protected function init_plugin_premium_features() {
|
689 |
if ( ! $this->has_premium || ! $this->license_settings ) {
|
693 |
}
|
694 |
|
695 |
// Создаем экземляр премиум менеджера, мы сможем к нему обращаться глобально.
|
696 |
+
$this->premium = WBCR\Factory_425\Premium\Manager::instance( $this, $this->license_settings );
|
697 |
|
698 |
// Подключаем премиум апгрейдер
|
699 |
if ( isset( $this->license_settings['has_updates'] ) && $this->license_settings['has_updates'] ) {
|
700 |
+
new WBCR\Factory_425\Updates\Premium_Upgrader( $this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
701 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
702 |
}
|
703 |
}
|
704 |
|
libs/factory/core/includes/class-factory-plugin-base.php
CHANGED
@@ -5,110 +5,166 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
5 |
}
|
6 |
|
7 |
/**
|
8 |
-
* Базовый класс
|
9 |
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
|
|
|
|
|
|
|
|
|
|
14 |
*/
|
15 |
-
class
|
16 |
-
|
17 |
-
use WBCR\
|
18 |
-
|
19 |
/**
|
20 |
-
*
|
|
|
|
|
|
|
|
|
|
|
21 |
*
|
22 |
* @var string
|
23 |
*/
|
24 |
protected $prefix;
|
25 |
-
|
26 |
/**
|
27 |
-
*
|
|
|
|
|
28 |
*
|
29 |
* @var string
|
30 |
*/
|
31 |
protected $plugin_title;
|
32 |
-
|
33 |
/**
|
34 |
-
*
|
|
|
|
|
|
|
35 |
*
|
36 |
* @var string
|
37 |
*/
|
38 |
protected $plugin_name;
|
39 |
-
|
40 |
/**
|
41 |
-
*
|
42 |
-
* Example: 1.4.5
|
43 |
*
|
44 |
* @var string
|
45 |
*/
|
46 |
protected $plugin_version;
|
47 |
-
|
48 |
/**
|
|
|
|
|
|
|
|
|
49 |
* @since 4.1.1
|
50 |
* @var string
|
51 |
*/
|
52 |
protected $plugin_text_domain;
|
53 |
-
|
54 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
* @var array
|
56 |
*/
|
57 |
protected $support_details;
|
58 |
-
|
59 |
/**
|
|
|
|
|
|
|
|
|
|
|
60 |
* @var bool
|
61 |
*/
|
62 |
protected $has_updates = false;
|
63 |
-
|
64 |
/**
|
65 |
-
*
|
|
|
|
|
|
|
|
|
66 |
*
|
67 |
-
* @var array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
*
|
69 |
-
*
|
|
|
|
|
|
|
|
|
70 |
*
|
71 |
-
*
|
72 |
-
* (wordpress | freemius | other)
|
73 |
*
|
74 |
-
*
|
|
|
|
|
75 |
*
|
76 |
-
*
|
77 |
-
* the plugin, will gain only one option prev_stable_version,
|
78 |
-
* you must specify previous version of the plugin *
|
79 |
-
* }
|
80 |
*/
|
81 |
-
protected $
|
82 |
-
|
83 |
/**
|
84 |
-
*
|
85 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
* @var bool
|
87 |
*/
|
88 |
-
protected $
|
89 |
-
|
90 |
/**
|
91 |
-
*
|
92 |
*
|
93 |
-
* @
|
94 |
-
*
|
95 |
-
*
|
96 |
-
* {type} string public_key Plugin public key, only for freemius
|
97 |
-
* {type} string slug Plugin name, only for freemius
|
98 |
-
*
|
99 |
-
* {type} array premium_plugin_updates {
|
100 |
-
* Update settings for free plugin.
|
101 |
-
*
|
102 |
-
* {type} array rollback Settings for rollback to the previous version of
|
103 |
-
* the plugin, will gain only one option prev_stable_version,
|
104 |
-
* you must specify previous version of the plugin *
|
105 |
-
* }
|
106 |
-
* }
|
107 |
*/
|
108 |
-
protected $
|
109 |
-
|
110 |
/**
|
111 |
-
*
|
|
|
|
|
112 |
*
|
113 |
* @var array {
|
114 |
* Array with information about the loadable module
|
@@ -120,85 +176,133 @@ class Wbcr_Factory414_Base {
|
|
120 |
* all - Module will be loaded everywhere
|
121 |
* }
|
122 |
*/
|
123 |
-
protected $load_factory_modules =
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
/**
|
131 |
-
*
|
|
|
|
|
|
|
|
|
132 |
*/
|
133 |
protected $support;
|
134 |
-
|
135 |
/**
|
136 |
-
*
|
|
|
|
|
|
|
|
|
137 |
*/
|
138 |
protected $paths;
|
139 |
-
|
140 |
/**
|
|
|
|
|
141 |
* @var string
|
142 |
*/
|
143 |
private $plugin_file;
|
144 |
-
|
145 |
/**
|
|
|
|
|
|
|
146 |
* @var array
|
147 |
*/
|
148 |
private $plugin_data;
|
149 |
-
|
150 |
/**
|
|
|
|
|
|
|
|
|
|
|
151 |
* @since 4.1.1 - добавил две сущности support, paths. Удалил свойства, plugin_build
|
152 |
* plugin_assembly, main_file, plugin_root, relative_path, plugin_url
|
153 |
* @since 4.0.8 - добавлена дополнительная логика
|
154 |
*
|
155 |
* @param string $plugin_file
|
156 |
-
* @param array
|
157 |
*
|
158 |
* @throws Exception
|
159 |
*/
|
160 |
public function __construct( $plugin_file, $data ) {
|
161 |
$this->plugin_file = $plugin_file;
|
162 |
$this->plugin_data = $data;
|
163 |
-
|
164 |
foreach ( (array) $data as $option_name => $option_value ) {
|
165 |
if ( property_exists( $this, $option_name ) ) {
|
166 |
$this->$option_name = $option_value;
|
167 |
}
|
168 |
}
|
169 |
-
|
170 |
if ( empty( $this->prefix ) || empty( $this->plugin_name ) || empty( $this->plugin_title ) || empty( $this->plugin_version ) || empty( $this->plugin_text_domain ) ) {
|
171 |
throw new Exception( 'One of the required attributes has not been passed (prefix, plugin_title, plugin_name, plugin_version, plugin_text_domain).' );
|
172 |
}
|
173 |
-
|
174 |
-
$this->support = new \WBCR\
|
175 |
-
$this->paths = new \WBCR\
|
176 |
-
|
177 |
// used only in the module 'updates'
|
178 |
$this->plugin_slug = ! empty( $this->plugin_name ) ? $this->plugin_name : basename( $plugin_file );
|
179 |
}
|
180 |
-
|
181 |
/**
|
182 |
-
*
|
|
|
|
|
|
|
183 |
*
|
184 |
-
* @
|
|
|
|
|
185 |
*/
|
186 |
public function __get( $name ) {
|
187 |
-
|
188 |
-
$deprecated_props =
|
189 |
'plugin_build',
|
190 |
'plugin_assembly',
|
191 |
'main_file',
|
192 |
'plugin_root',
|
193 |
'relative_path',
|
194 |
'plugin_url'
|
195 |
-
|
196 |
-
|
197 |
if ( in_array( $name, $deprecated_props ) ) {
|
198 |
$deprecated_message = 'In version 4.1.1 of the Factory framework, the class properties ';
|
199 |
$deprecated_message .= '(' . implode( ',', $deprecated_props ) . ')';
|
200 |
$deprecated_message .= 'have been removed. To get plugin paths, use the new paths property.' . PHP_EOL;
|
201 |
-
|
202 |
$backtrace = debug_backtrace();
|
203 |
if ( ! empty( $backtrace ) && isset( $backtrace[1] ) ) {
|
204 |
$deprecated_message .= 'BACKTRACE:(';
|
@@ -207,9 +311,9 @@ class Wbcr_Factory414_Base {
|
|
207 |
$deprecated_message .= 'Line: ' . $backtrace[1]['line'];
|
208 |
$deprecated_message .= ')';
|
209 |
}
|
210 |
-
|
211 |
_deprecated_argument( __METHOD__, '4.1.1', $deprecated_message );
|
212 |
-
|
213 |
switch ( $name ) {
|
214 |
case 'plugin_build':
|
215 |
return null;
|
@@ -231,28 +335,32 @@ class Wbcr_Factory414_Base {
|
|
231 |
break;
|
232 |
}
|
233 |
}
|
234 |
-
|
235 |
return null;
|
236 |
}
|
237 |
-
|
238 |
/**
|
239 |
-
*
|
240 |
-
*
|
|
|
|
|
|
|
|
|
241 |
*
|
242 |
* @return stdClass|null
|
243 |
* @throws Exception
|
244 |
*/
|
245 |
public function __call( $name, $arguments ) {
|
246 |
-
|
247 |
-
$deprecated_methods =
|
248 |
'getPluginBuild',
|
249 |
'getPluginAssembly',
|
250 |
'getPluginPathInfo'
|
251 |
-
|
252 |
-
|
253 |
if ( in_array( $name, $deprecated_methods ) ) {
|
254 |
$deprecated_message = 'In version 4.1.1 of the Factory framework, methods (' . implode( ',', $deprecated_methods ) . ') have been removed.';
|
255 |
-
|
256 |
$backtrace = debug_backtrace();
|
257 |
if ( ! empty( $backtrace ) && isset( $backtrace[1] ) ) {
|
258 |
$deprecated_message .= 'BACKTRACE:(';
|
@@ -261,61 +369,87 @@ class Wbcr_Factory414_Base {
|
|
261 |
$deprecated_message .= 'Line: ' . $backtrace[1]['line'];
|
262 |
$deprecated_message .= ')';
|
263 |
}
|
264 |
-
|
265 |
_deprecated_argument( __METHOD__, '4.1.1', $deprecated_message );
|
266 |
-
|
267 |
if ( 'getPluginPathInfo' == $name ) {
|
268 |
$object = new stdClass;
|
269 |
-
|
270 |
$object->main_file = $this->get_paths()->main_file;
|
271 |
$object->plugin_root = $this->get_paths()->absolute;
|
272 |
$object->relative_path = $this->get_paths()->basename;
|
273 |
$object->plugin_url = $this->get_paths()->url;
|
274 |
-
|
275 |
return $object;
|
276 |
}
|
277 |
}
|
278 |
-
|
279 |
throw new Exception( "Method {$name} does not exist" );
|
280 |
}
|
281 |
-
|
282 |
/**
|
283 |
-
*
|
|
|
|
|
|
|
284 |
*/
|
285 |
public function has_premium() {
|
286 |
return $this->has_premium;
|
287 |
}
|
288 |
-
|
289 |
/**
|
290 |
-
*
|
|
|
|
|
291 |
*/
|
292 |
public function getPluginTitle() {
|
293 |
return $this->plugin_title;
|
294 |
}
|
295 |
-
|
296 |
/**
|
297 |
-
*
|
|
|
|
|
298 |
*/
|
299 |
public function getPrefix() {
|
300 |
return $this->prefix;
|
301 |
}
|
302 |
-
|
303 |
/**
|
304 |
-
*
|
|
|
|
|
305 |
*/
|
306 |
public function getPluginName() {
|
307 |
return $this->plugin_name;
|
308 |
}
|
309 |
-
|
310 |
/**
|
311 |
-
*
|
|
|
|
|
312 |
*/
|
313 |
public function getPluginVersion() {
|
314 |
return $this->plugin_version;
|
315 |
}
|
316 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
/**
|
318 |
-
*
|
|
|
|
|
|
|
|
|
319 |
*
|
320 |
* @return null
|
321 |
*/
|
@@ -323,45 +457,72 @@ class Wbcr_Factory414_Base {
|
|
323 |
if ( isset( $this->plugin_data[ $attr_name ] ) ) {
|
324 |
return $this->plugin_data[ $attr_name ];
|
325 |
}
|
326 |
-
|
327 |
return null;
|
328 |
}
|
329 |
-
|
330 |
/**
|
331 |
-
*
|
|
|
|
|
332 |
*/
|
333 |
public function get_support() {
|
334 |
return $this->support;
|
335 |
}
|
336 |
-
|
337 |
/**
|
338 |
-
*
|
|
|
|
|
339 |
*/
|
340 |
public function get_paths() {
|
341 |
return $this->paths;
|
342 |
}
|
343 |
-
|
344 |
/**
|
345 |
-
*
|
|
|
|
|
346 |
*/
|
347 |
public function getPluginInfo() {
|
348 |
return (object) $this->plugin_data;
|
349 |
}
|
350 |
-
|
351 |
/**
|
352 |
-
*
|
353 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
* @return bool
|
355 |
*/
|
356 |
public function isNetworkAdmin() {
|
357 |
return is_multisite() && is_network_admin();
|
358 |
}
|
359 |
-
|
360 |
/**
|
361 |
-
*
|
362 |
-
*
|
363 |
-
* @since 4.0.8
|
364 |
-
* @return bool
|
365 |
*/
|
366 |
public function isNetworkActive() {
|
367 |
// Makes sure the plugin is defined before trying to use it
|
@@ -372,33 +533,32 @@ class Wbcr_Factory414_Base {
|
|
372 |
$activate = is_plugin_active_for_network( $this->get_paths()->basename );
|
373 |
|
374 |
if ( ! $activate && $this->isNetworkAdmin() && isset( $_GET['action'] ) && $_GET['action'] == 'activate' ) {
|
375 |
-
return isset( $_GET['networkwide'] ) && 1 == (int)$_GET['networkwide'];
|
376 |
-
|
377 |
}
|
378 |
|
379 |
return $activate;
|
380 |
}
|
381 |
-
|
382 |
/**
|
383 |
-
*
|
384 |
-
*
|
385 |
* @since 4.0.8
|
386 |
* @return array|int
|
387 |
*/
|
388 |
-
public function getActiveSites( $args =
|
389 |
global $wp_version;
|
390 |
-
|
391 |
if ( version_compare( $wp_version, '4.6', '>=' ) ) {
|
392 |
return get_sites( $args );
|
393 |
} else {
|
394 |
-
$converted_array =
|
395 |
-
|
396 |
$sites = wp_get_sites( $args );
|
397 |
-
|
398 |
if ( empty( $sites ) ) {
|
399 |
return $converted_array;
|
400 |
}
|
401 |
-
|
402 |
foreach ( (array) $sites as $key => $site ) {
|
403 |
$obj = new stdClass();
|
404 |
foreach ( $site as $attr => $value ) {
|
@@ -406,7 +566,7 @@ class Wbcr_Factory414_Base {
|
|
406 |
}
|
407 |
$converted_array[ $key ] = $obj;
|
408 |
}
|
409 |
-
|
410 |
return $converted_array;
|
411 |
}
|
412 |
}
|
5 |
}
|
6 |
|
7 |
/**
|
8 |
+
* Базовый класс для создания нового плагина. Полную реализацию класса смотрите в Wbcr_Factory425_Plugin
|
9 |
*
|
10 |
+
* Документация по классу: https://webcraftic.atlassian.net/wiki/spaces/FFD/pages/392724484
|
11 |
+
* Документация по созданию плагина: https://webcraftic.atlassian.net/wiki/spaces/CNCFC/pages/327828
|
12 |
+
* Репозиторий: https://github.com/alexkovalevv
|
13 |
+
*
|
14 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
15 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
* @package factory-core
|
19 |
*/
|
20 |
+
class Wbcr_Factory425_Base {
|
21 |
+
|
22 |
+
use WBCR\Factory_425\Options;
|
23 |
+
|
24 |
/**
|
25 |
+
* Обязательное свойство. Префикс, используется для создания пространство имен.
|
26 |
+
* Чаще всего используется на именования опций в базе данных. Также может быть
|
27 |
+
* использован для именования полей html форм, создания уникальных имен, хуков.
|
28 |
+
* Пример: wrio_
|
29 |
+
*
|
30 |
+
* Для префикса всегда используете нижнее подчеркивание справа!
|
31 |
*
|
32 |
* @var string
|
33 |
*/
|
34 |
protected $prefix;
|
35 |
+
|
36 |
/**
|
37 |
+
* Обязательное свойство. Заголовок плагина. Используете в интерфейсе плагина,
|
38 |
+
* может быть использован в уведомлениях для администратора, чтобы пользователь
|
39 |
+
* мог понять, с каким плагином он ведет коммуникацию. Пример: Robin image optimizer
|
40 |
*
|
41 |
* @var string
|
42 |
*/
|
43 |
protected $plugin_title;
|
44 |
+
|
45 |
/**
|
46 |
+
* Обязательное свойство. Имя плагина. Используется аналогично префиксу, но с небольшим
|
47 |
+
* отличием. Имя плагина имеет человеку понятную строку, которую можно использовать в
|
48 |
+
* именовании хуков, созданию условной логики. Допустимые символы [A-z0-9_].
|
49 |
+
* Пример: wbcr_clearfy
|
50 |
*
|
51 |
* @var string
|
52 |
*/
|
53 |
protected $plugin_name;
|
54 |
+
|
55 |
/**
|
56 |
+
* Обязательное свойство. Версия плагина в формате 0.0.0. Допустимые символы [0-9.]
|
|
|
57 |
*
|
58 |
* @var string
|
59 |
*/
|
60 |
protected $plugin_version;
|
61 |
+
|
62 |
/**
|
63 |
+
* Обязательное свойство. Текстовый домен плагина, используется для подключения файлов
|
64 |
+
* переводов. Рекомендуется использовать slug плагина, идентичный slug в репозитории
|
65 |
+
* Wordpress.org
|
66 |
+
*
|
67 |
* @since 4.1.1
|
68 |
* @var string
|
69 |
*/
|
70 |
protected $plugin_text_domain;
|
71 |
+
|
72 |
/**
|
73 |
+
* Обязательное свойство. Информация для поддержки клиента. Для начала работы плагина,
|
74 |
+
* достаточно только указать адрес лендинга в атрибут url. На лендинге должны быть
|
75 |
+
* созданы страницы features, pricing, support, docs. Если страницы (features, pricing,
|
76 |
+
* support, docs) не могут иметь такие же адреса, вы можете наложить карту адресов в
|
77 |
+
* атрибуте pages_map. К примеру: я создал страницу "Pro Features" и она имеет адрес
|
78 |
+
* {site}/premium-features, для pages_map в атрибуте features, я указал, что адрес
|
79 |
+
* страницы со списком функций имеет слаг premium-features. Теперь плагин будет понимать,
|
80 |
+
* что адрес страницы со списком функций будет таким:
|
81 |
+
* https://robin-image-optimizer.webcraftic.com/premium-features.
|
82 |
+
*
|
83 |
+
* Это свойство заполняется для того, чтобы в процессе разработки вы могли использовать
|
84 |
+
* экземпляр класса \WBCR\Factory_425\Entities\Support, для получения информации о сайте плагина.
|
85 |
+
* Тем самым вы избавляете себя от жесткого прописывания ссылок на лендинг плагина и
|
86 |
+
* можете изменить все ссылки в одном месте.
|
87 |
+
*
|
88 |
* @var array
|
89 |
*/
|
90 |
protected $support_details;
|
91 |
+
|
92 |
/**
|
93 |
+
* Включение/отключение обновлений для бесплатного плагина. Если вашего плагина нет в репозитори
|
94 |
+
* Wordpress.org, вы можете включить собственный режим обновлений, например через GitHub или
|
95 |
+
* собственный репозиторий. Если установлено true, плагин будет проверять наличие обновлений
|
96 |
+
* для этого плагина.
|
97 |
+
*
|
98 |
* @var bool
|
99 |
*/
|
100 |
protected $has_updates = false;
|
101 |
+
|
102 |
/**
|
103 |
+
* Настройка обновлений для бесплатного плагина. Если вы хотите настроить обновления для
|
104 |
+
* бесплатного плагина через собственный репозиторий (например: github), вам нужно указать имя
|
105 |
+
* репозитория и slug плагина. Slug может быть идентичен имени репозитория в github. Для Wordpress.org
|
106 |
+
* эти настройки не обязательны, так как в wordpress ядре есть встроенные функции для обновлений
|
107 |
+
* плагинов и тем.
|
108 |
*
|
109 |
+
* @var array
|
110 |
+
*/
|
111 |
+
protected $updates_settings = [];
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Включение/отключение премиум версии для плагина. Если вы создаете бесплатный плагин и хотите
|
115 |
+
* реализовать для него премиум версию, вам нужно начать с этого свойства. Если свойство установлено,
|
116 |
+
* как true, при инициализации плагина будут подключены функции лицензирования, проверки обновлений
|
117 |
+
* для премиум версии.
|
118 |
+
*
|
119 |
+
* @var bool
|
120 |
+
*/
|
121 |
+
protected $has_premium = false;
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Настройки лицензирования
|
125 |
*
|
126 |
+
* Лицензирование плагина может быть реализовано для любого провайдера,
|
127 |
+
* к примеру: freemius, codecanyon, templatemonster, вам нужно указать только настройки для
|
128 |
+
* взаимодействия с выбранным вами провайдером. Каждая реализация провайдера лицензий может иметь
|
129 |
+
* индивидуальный настройки, в этом примере приведены настройки для freemius провайдера
|
130 |
+
* WBCR\Factory_425\Premium\Provider > WBCR\Factory_Freemius_113\Premium\Provider
|
131 |
*
|
132 |
+
* На текущий момент существует только реализация для freemius провайдера.
|
|
|
133 |
*
|
134 |
+
* Для премиум плагина вы должны также указать настройки обновлений. Атрибут has_updates
|
135 |
+
* включает/отключает обновления для премиум плагина, в атрибуте updates_settings вы указываете
|
136 |
+
* дополнительные настройки обновлений.
|
137 |
*
|
138 |
+
* @var array
|
|
|
|
|
|
|
139 |
*/
|
140 |
+
protected $license_settings = [];
|
141 |
+
|
142 |
/**
|
143 |
+
* Переключатель внутренней рекламы в плагине
|
144 |
*
|
145 |
+
* Если установить true, то плагин будет показывать рекламу компании в интерфейсе Wordpress.
|
146 |
+
* Рекламный модуль может отображать рекламу внутри инрефейса плагина, на странице dashboard
|
147 |
+
* и создавать сквозные уведомления на всех страницах админ панели Wordpress.
|
148 |
+
*
|
149 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
150 |
+
* @since 4.1.9
|
151 |
* @var bool
|
152 |
*/
|
153 |
+
protected $render_adverts = false;
|
154 |
+
|
155 |
/**
|
156 |
+
* Настройки внутренней рекламы компании
|
157 |
*
|
158 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
159 |
+
* @since 4.1.9
|
160 |
+
* @var array
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
*/
|
162 |
+
protected $adverts_settings = [];
|
163 |
+
|
164 |
/**
|
165 |
+
* Обязательное свойство. Подключаемые модули фреймворка.
|
166 |
+
*
|
167 |
+
* Модули фреймворка позволяют расширять его функциональность.
|
168 |
*
|
169 |
* @var array {
|
170 |
* Array with information about the loadable module
|
176 |
* all - Module will be loaded everywhere
|
177 |
* }
|
178 |
*/
|
179 |
+
protected $load_factory_modules = [
|
180 |
+
[ 'libs/factory/bootstrap', 'factory_bootstrap_426', 'admin' ],
|
181 |
+
[ 'libs/factory/forms', 'factory_forms_423', 'admin' ],
|
182 |
+
[ 'libs/factory/pages', 'factory_pages_425', 'admin' ],
|
183 |
+
];
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Не обязательное свойство. Список подключаемых компонентов плагина.
|
187 |
+
*
|
188 |
+
* Компоненты плагина, это независимые плагины, которые расширяют возможности текущего плагина.
|
189 |
+
* Вы должны указать файл для автозагрузки компонента и префикс плагина, чтобы фреймворк
|
190 |
+
* мог обращаться к классам и константам компонентов.
|
191 |
+
*
|
192 |
+
*
|
193 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
194 |
+
* @since 4.2.0 Добавлен
|
195 |
+
* @var array Пример данных
|
196 |
+
* array(
|
197 |
+
* 'component_ID' => array(
|
198 |
+
* 'autoload' => 'relative_path/autoload_filename.php',
|
199 |
+
* 'plugin_prefix' => 'WPRFX_'
|
200 |
+
* ),
|
201 |
+
* // Реальный пример
|
202 |
+
* 'cyrlitera' => array(
|
203 |
+
* 'autoload' => 'components/cyrlitera/clearfy.php',
|
204 |
+
* 'plugin_prefix' => 'WCTR_'
|
205 |
+
* ),
|
206 |
+
* )
|
207 |
+
*/
|
208 |
+
protected $load_plugin_components = [];
|
209 |
+
|
210 |
+
|
211 |
/**
|
212 |
+
* Экземпляр класса \WBCR\Factory_425\Entities\Support используется для получения информации
|
213 |
+
* о сайте плагина. Чаще всего используется для получения ссылки на страницу с тарифами или
|
214 |
+
* ссылки на форму обратной связи. Встроен механизм отслеживания по utm меткам.
|
215 |
+
*
|
216 |
+
* @var \WBCR\Factory_425\Entities\Support
|
217 |
*/
|
218 |
protected $support;
|
219 |
+
|
220 |
/**
|
221 |
+
* Экземпляр класса \WBCR\Factory_425\Entities\Paths используется для получения информации о
|
222 |
+
* путях плагина. Часто используется для получения путей или ссылок на место хранения плагина
|
223 |
+
* или его входного файла.
|
224 |
+
*
|
225 |
+
* @var \WBCR\Factory_425\Entities\Paths
|
226 |
*/
|
227 |
protected $paths;
|
228 |
+
|
229 |
/**
|
230 |
+
* Абсолютный путь к входному файлу плагина: C://server/site.dev/wp-content/plugins/plugin_name/plugin_name.php
|
231 |
+
*
|
232 |
* @var string
|
233 |
*/
|
234 |
private $plugin_file;
|
235 |
+
|
236 |
/**
|
237 |
+
* Свойство хранит сырые настройки плагина, а также дополнительные настройки, которые не описаны
|
238 |
+
* в интерфейсе класса.
|
239 |
+
*
|
240 |
* @var array
|
241 |
*/
|
242 |
private $plugin_data;
|
243 |
+
|
244 |
/**
|
245 |
+
* Конструктор:
|
246 |
+
* - Заполняет свойства класса из сырых данных плагина
|
247 |
+
* - Выполняет проверку на обязательные настройки
|
248 |
+
* - Инициализирует сущности support и paths
|
249 |
+
*
|
250 |
* @since 4.1.1 - добавил две сущности support, paths. Удалил свойства, plugin_build
|
251 |
* plugin_assembly, main_file, plugin_root, relative_path, plugin_url
|
252 |
* @since 4.0.8 - добавлена дополнительная логика
|
253 |
*
|
254 |
* @param string $plugin_file
|
255 |
+
* @param array $data
|
256 |
*
|
257 |
* @throws Exception
|
258 |
*/
|
259 |
public function __construct( $plugin_file, $data ) {
|
260 |
$this->plugin_file = $plugin_file;
|
261 |
$this->plugin_data = $data;
|
262 |
+
|
263 |
foreach ( (array) $data as $option_name => $option_value ) {
|
264 |
if ( property_exists( $this, $option_name ) ) {
|
265 |
$this->$option_name = $option_value;
|
266 |
}
|
267 |
}
|
268 |
+
|
269 |
if ( empty( $this->prefix ) || empty( $this->plugin_name ) || empty( $this->plugin_title ) || empty( $this->plugin_version ) || empty( $this->plugin_text_domain ) ) {
|
270 |
throw new Exception( 'One of the required attributes has not been passed (prefix, plugin_title, plugin_name, plugin_version, plugin_text_domain).' );
|
271 |
}
|
272 |
+
|
273 |
+
$this->support = new \WBCR\Factory_425\Entities\Support( $this->support_details );
|
274 |
+
$this->paths = new \WBCR\Factory_425\Entities\Paths( $plugin_file );
|
275 |
+
|
276 |
// used only in the module 'updates'
|
277 |
$this->plugin_slug = ! empty( $this->plugin_name ) ? $this->plugin_name : basename( $plugin_file );
|
278 |
}
|
279 |
+
|
280 |
/**
|
281 |
+
* При обновлении фреймворка, некоторые свойства класса были удалены. Однако плагины на старом
|
282 |
+
* фреймворке по прежнему используют удаленные свойства. С помощью этого магического метода мы
|
283 |
+
* добавляем совместимость со старыми плагинами, но при этом выводим предупреждение, что нужно
|
284 |
+
* обновить некоторые свойства.
|
285 |
*
|
286 |
+
* @param string $name Имя свойства класса.
|
287 |
+
*
|
288 |
+
* @return mixed
|
289 |
*/
|
290 |
public function __get( $name ) {
|
291 |
+
|
292 |
+
$deprecated_props = [
|
293 |
'plugin_build',
|
294 |
'plugin_assembly',
|
295 |
'main_file',
|
296 |
'plugin_root',
|
297 |
'relative_path',
|
298 |
'plugin_url'
|
299 |
+
];
|
300 |
+
|
301 |
if ( in_array( $name, $deprecated_props ) ) {
|
302 |
$deprecated_message = 'In version 4.1.1 of the Factory framework, the class properties ';
|
303 |
$deprecated_message .= '(' . implode( ',', $deprecated_props ) . ')';
|
304 |
$deprecated_message .= 'have been removed. To get plugin paths, use the new paths property.' . PHP_EOL;
|
305 |
+
|
306 |
$backtrace = debug_backtrace();
|
307 |
if ( ! empty( $backtrace ) && isset( $backtrace[1] ) ) {
|
308 |
$deprecated_message .= 'BACKTRACE:(';
|
311 |
$deprecated_message .= 'Line: ' . $backtrace[1]['line'];
|
312 |
$deprecated_message .= ')';
|
313 |
}
|
314 |
+
|
315 |
_deprecated_argument( __METHOD__, '4.1.1', $deprecated_message );
|
316 |
+
|
317 |
switch ( $name ) {
|
318 |
case 'plugin_build':
|
319 |
return null;
|
335 |
break;
|
336 |
}
|
337 |
}
|
338 |
+
|
339 |
return null;
|
340 |
}
|
341 |
+
|
342 |
/**
|
343 |
+
* При обновлении фреймворка, некоторые методы класса были удалены. Однако плагины на старом фреймворке
|
344 |
+
* по прежнему используют удаленные методы. С помощью этого магического метода мы добавляем совместимость
|
345 |
+
* со старыми плагинами, но при этом выводим предупреждение, что нужно обновить некоторые методы.
|
346 |
+
*
|
347 |
+
* @param string $name Имя метода класса.
|
348 |
+
* @param array $arguments Массив аргументов метода класса.
|
349 |
*
|
350 |
* @return stdClass|null
|
351 |
* @throws Exception
|
352 |
*/
|
353 |
public function __call( $name, $arguments ) {
|
354 |
+
|
355 |
+
$deprecated_methods = [
|
356 |
'getPluginBuild',
|
357 |
'getPluginAssembly',
|
358 |
'getPluginPathInfo'
|
359 |
+
];
|
360 |
+
|
361 |
if ( in_array( $name, $deprecated_methods ) ) {
|
362 |
$deprecated_message = 'In version 4.1.1 of the Factory framework, methods (' . implode( ',', $deprecated_methods ) . ') have been removed.';
|
363 |
+
|
364 |
$backtrace = debug_backtrace();
|
365 |
if ( ! empty( $backtrace ) && isset( $backtrace[1] ) ) {
|
366 |
$deprecated_message .= 'BACKTRACE:(';
|
369 |
$deprecated_message .= 'Line: ' . $backtrace[1]['line'];
|
370 |
$deprecated_message .= ')';
|
371 |
}
|
372 |
+
|
373 |
_deprecated_argument( __METHOD__, '4.1.1', $deprecated_message );
|
374 |
+
|
375 |
if ( 'getPluginPathInfo' == $name ) {
|
376 |
$object = new stdClass;
|
377 |
+
|
378 |
$object->main_file = $this->get_paths()->main_file;
|
379 |
$object->plugin_root = $this->get_paths()->absolute;
|
380 |
$object->relative_path = $this->get_paths()->basename;
|
381 |
$object->plugin_url = $this->get_paths()->url;
|
382 |
+
|
383 |
return $object;
|
384 |
}
|
385 |
}
|
386 |
+
|
387 |
throw new Exception( "Method {$name} does not exist" );
|
388 |
}
|
389 |
+
|
390 |
/**
|
391 |
+
* Проверяет, включен ли премиум для этого плагина или нет.
|
392 |
+
*
|
393 |
+
* @return bool Возвращает true, если премиум пакет включен для этого плагина.
|
394 |
+
* См. Wbcr_Factory425_Base::has_premium
|
395 |
*/
|
396 |
public function has_premium() {
|
397 |
return $this->has_premium;
|
398 |
}
|
399 |
+
|
400 |
/**
|
401 |
+
* Позволяет получить заголовок плагина.
|
402 |
+
*
|
403 |
+
* @return string Возвращает заголовок плагина. См. Wbcr_Factory425_Base::plugin_title
|
404 |
*/
|
405 |
public function getPluginTitle() {
|
406 |
return $this->plugin_title;
|
407 |
}
|
408 |
+
|
409 |
/**
|
410 |
+
* Позволяет получить префикс плагина.
|
411 |
+
*
|
412 |
+
* @return string Возвращает префикс плагина.См. Wbcr_Factory425_Base::prefix
|
413 |
*/
|
414 |
public function getPrefix() {
|
415 |
return $this->prefix;
|
416 |
}
|
417 |
+
|
418 |
/**
|
419 |
+
* Позволяет получить имя плагина.
|
420 |
+
*
|
421 |
+
* @return string Возвращает имя плагина. См. Wbcr_Factory425_Base::plugin_name
|
422 |
*/
|
423 |
public function getPluginName() {
|
424 |
return $this->plugin_name;
|
425 |
}
|
426 |
+
|
427 |
/**
|
428 |
+
* Позволяет получить версию плагина.
|
429 |
+
*
|
430 |
+
* @return string Возвращает версию плагина. См. Wbcr_Factory425_Base::plugin_version
|
431 |
*/
|
432 |
public function getPluginVersion() {
|
433 |
return $this->plugin_version;
|
434 |
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Позволяет получить список подключаемых к плагином компонентов
|
438 |
+
*
|
439 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
440 |
+
* @since 4.2.0
|
441 |
+
* @return array
|
442 |
+
*/
|
443 |
+
public function get_load_plugin_components() {
|
444 |
+
return $this->load_plugin_components;
|
445 |
+
}
|
446 |
+
|
447 |
/**
|
448 |
+
* Предоставляет доступ к сырым данным плагина. Может быть полезен, если вы хотите получить
|
449 |
+
* какие-то данные не описанные в интерфейсе этого плагина.
|
450 |
+
*
|
451 |
+
* @param string $attr_name Имя атрибута, который нужно получить. Идентично ключу в массиве
|
452 |
+
* Wbcr_Factory425_Base::plugin_data
|
453 |
*
|
454 |
* @return null
|
455 |
*/
|
457 |
if ( isset( $this->plugin_data[ $attr_name ] ) ) {
|
458 |
return $this->plugin_data[ $attr_name ];
|
459 |
}
|
460 |
+
|
461 |
return null;
|
462 |
}
|
463 |
+
|
464 |
/**
|
465 |
+
* Предоставляет доступ к экземпляру класса \WBCR\Factory_425\Entities\Support.
|
466 |
+
*
|
467 |
+
* @return \WBCR\Factory_425\Entities\Support
|
468 |
*/
|
469 |
public function get_support() {
|
470 |
return $this->support;
|
471 |
}
|
472 |
+
|
473 |
/**
|
474 |
+
* Предоставляет доступ к экземпляру класса \WBCR\Factory_425\Entities\Paths.
|
475 |
+
*
|
476 |
+
* @return \WBCR\Factory_425\Entities\Paths
|
477 |
*/
|
478 |
public function get_paths() {
|
479 |
return $this->paths;
|
480 |
}
|
481 |
+
|
482 |
/**
|
483 |
+
* Позволяет получить сырые данные плагина в виде объекта StdClass.
|
484 |
+
*
|
485 |
+
* @return object Возвращает объект с сырыми данными плагина. См. Wbcr_Factory425_Base::plugin_data
|
486 |
*/
|
487 |
public function getPluginInfo() {
|
488 |
return (object) $this->plugin_data;
|
489 |
}
|
490 |
+
|
491 |
/**
|
492 |
+
* Проверяет права пользователя
|
493 |
+
*
|
494 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
495 |
+
* @since 4.2.0 Добавлен
|
496 |
+
* @return bool
|
497 |
+
*/
|
498 |
+
public function current_user_can( $capability = 'manage_options' ) {
|
499 |
+
// Просмотр страниц: read_pages
|
500 |
+
// Просмотр уведомлений: read_notices
|
501 |
+
// Редактирование: edit_forms
|
502 |
+
|
503 |
+
if ( 'manage_options' == $capability && is_multisite() && $this->isNetworkActive() ) {
|
504 |
+
$capability = 'manage_network';
|
505 |
+
}
|
506 |
+
|
507 |
+
return current_user_can( $capability );
|
508 |
+
}
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Проверят, находится ли пользователь в панели усправления сетью сайтов
|
512 |
+
*
|
513 |
+
* @since 4.0.8 Добавлен
|
514 |
+
*
|
515 |
* @return bool
|
516 |
*/
|
517 |
public function isNetworkAdmin() {
|
518 |
return is_multisite() && is_network_admin();
|
519 |
}
|
520 |
+
|
521 |
/**
|
522 |
+
* Проверяет активирован ли плагин для сети. Если проект работает в режиме мультисайтов..
|
523 |
+
*
|
524 |
+
* @since 4.0.8 Добавлен
|
525 |
+
* @return bool Если true, плагин активирован для сети или в текущий момент активируется для сети.
|
526 |
*/
|
527 |
public function isNetworkActive() {
|
528 |
// Makes sure the plugin is defined before trying to use it
|
533 |
$activate = is_plugin_active_for_network( $this->get_paths()->basename );
|
534 |
|
535 |
if ( ! $activate && $this->isNetworkAdmin() && isset( $_GET['action'] ) && $_GET['action'] == 'activate' ) {
|
536 |
+
return isset( $_GET['networkwide'] ) && 1 == (int) $_GET['networkwide'];
|
|
|
537 |
}
|
538 |
|
539 |
return $activate;
|
540 |
}
|
541 |
+
|
542 |
/**
|
543 |
+
* Позволяет получить все активные сайты сети. Если проект работает в режиме мультисайтов.
|
544 |
+
*
|
545 |
* @since 4.0.8
|
546 |
* @return array|int
|
547 |
*/
|
548 |
+
public function getActiveSites( $args = [ 'archived' => 0, 'mature' => 0, 'spam' => 0, 'deleted' => 0 ] ) {
|
549 |
global $wp_version;
|
550 |
+
|
551 |
if ( version_compare( $wp_version, '4.6', '>=' ) ) {
|
552 |
return get_sites( $args );
|
553 |
} else {
|
554 |
+
$converted_array = [];
|
555 |
+
|
556 |
$sites = wp_get_sites( $args );
|
557 |
+
|
558 |
if ( empty( $sites ) ) {
|
559 |
return $converted_array;
|
560 |
}
|
561 |
+
|
562 |
foreach ( (array) $sites as $key => $site ) {
|
563 |
$obj = new stdClass();
|
564 |
foreach ( $site as $attr => $value ) {
|
566 |
}
|
567 |
$converted_array[ $key ] = $obj;
|
568 |
}
|
569 |
+
|
570 |
return $converted_array;
|
571 |
}
|
572 |
}
|
libs/factory/core/includes/class-factory-requests.php
CHANGED
@@ -4,20 +4,27 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
/**
|
10 |
-
* @param null
|
11 |
-
* @param bool|string $sanitize
|
12 |
-
* @param bool
|
13 |
-
* @param string
|
14 |
*
|
15 |
* @return array|bool|mixed
|
16 |
*/
|
17 |
private function getBody( $param = null, $sanitize = false, $default = false, $method_name = 'REQUEST' ) {
|
18 |
$sanitize_function_name = 'sanitize_text_field';
|
19 |
$method = $_REQUEST;
|
20 |
-
|
21 |
switch ( strtoupper( $method_name ) ) {
|
22 |
case 'GET':
|
23 |
$method = $_GET;
|
@@ -29,15 +36,15 @@ class Wbcr_Factory414_Request {
|
|
29 |
$method = $_REQUEST;
|
30 |
break;
|
31 |
}
|
32 |
-
|
33 |
if ( ! empty( $sanitize ) && is_string( $sanitize ) && $sanitize !== $sanitize_function_name ) {
|
34 |
$sanitize_function_name = $sanitize;
|
35 |
}
|
36 |
-
|
37 |
if ( ! function_exists( $sanitize_function_name ) ) {
|
38 |
throw new Exception( 'Function ' . $sanitize_function_name . 'is undefined.' );
|
39 |
}
|
40 |
-
|
41 |
if ( ! empty( $param ) ) {
|
42 |
if ( isset( $method[ $param ] ) && ! empty( $method[ $param ] ) ) {
|
43 |
if ( is_array( $method[ $param ] ) ) {
|
@@ -46,18 +53,18 @@ class Wbcr_Factory414_Request {
|
|
46 |
return ! empty( $sanitize ) ? call_user_func( $sanitize_function_name, $method[ $param ] ) : $method[ $param ];
|
47 |
}
|
48 |
}
|
49 |
-
|
50 |
return $default;
|
51 |
}
|
52 |
-
|
53 |
return ! empty( $sanitize ) ? array_map( $sanitize_function_name, $method ) : $method;
|
54 |
}
|
55 |
-
|
56 |
/**
|
57 |
* Recursive sanitation for an array
|
58 |
*
|
59 |
* @param string $function_name
|
60 |
-
* @param
|
61 |
*
|
62 |
* @return mixed
|
63 |
*/
|
@@ -69,26 +76,26 @@ class Wbcr_Factory414_Request {
|
|
69 |
if ( ! function_exists( $function_name ) ) {
|
70 |
throw new Exception( 'Function ' . $function_name . 'is undefined.' );
|
71 |
}
|
72 |
-
|
73 |
$value = $function_name( $value );
|
74 |
}
|
75 |
}
|
76 |
-
|
77 |
return $array;
|
78 |
}
|
79 |
-
|
80 |
/**
|
81 |
* @param bool|string see method getBody
|
82 |
* @param array $default
|
83 |
*
|
84 |
* @return mixed|null
|
85 |
*/
|
86 |
-
public function requestAll( $sanitize = false, $default =
|
87 |
return $this->getBody( null, $sanitize, $default );
|
88 |
}
|
89 |
-
|
90 |
/**
|
91 |
-
* @param
|
92 |
* @param bool|string see method getBody
|
93 |
* @param bool $default
|
94 |
*
|
@@ -97,17 +104,17 @@ class Wbcr_Factory414_Request {
|
|
97 |
public function request( $param, $default = false, $sanitize = false ) {
|
98 |
return $this->getBody( $param, $sanitize, $default );
|
99 |
}
|
100 |
-
|
101 |
/**
|
102 |
* @param bool|string see method getBody
|
103 |
* @param array $default
|
104 |
*
|
105 |
* @return mixed|null
|
106 |
*/
|
107 |
-
public function getAll( $sanitize = false, $default =
|
108 |
return $this->getBody( null, $sanitize, $default, 'get' );
|
109 |
}
|
110 |
-
|
111 |
/**
|
112 |
* @param null $param
|
113 |
* @param bool|string see method getBody
|
@@ -118,19 +125,19 @@ class Wbcr_Factory414_Request {
|
|
118 |
public function get( $param, $default = false, $sanitize = false ) {
|
119 |
return $this->getBody( $param, $sanitize, $default, 'get' );
|
120 |
}
|
121 |
-
|
122 |
/**
|
123 |
* @param bool|string see method getBody
|
124 |
* @param array $default
|
125 |
*
|
126 |
* @return mixed|null
|
127 |
*/
|
128 |
-
public function postAll( $sanitize = false, $default =
|
129 |
return $this->getBody( null, $sanitize, $default, 'post' );
|
130 |
}
|
131 |
-
|
132 |
/**
|
133 |
-
* @param
|
134 |
* @param bool|string see method getBody
|
135 |
* @param bool $default
|
136 |
*
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
+
/*
|
8 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
9 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
10 |
+
*
|
11 |
+
* @package factory-core
|
12 |
+
*/
|
13 |
+
|
14 |
+
class Wbcr_Factory425_Request {
|
15 |
+
|
16 |
/**
|
17 |
+
* @param null $param
|
18 |
+
* @param bool|string $sanitize true/false or sanitize function name
|
19 |
+
* @param bool $default
|
20 |
+
* @param string $method_name
|
21 |
*
|
22 |
* @return array|bool|mixed
|
23 |
*/
|
24 |
private function getBody( $param = null, $sanitize = false, $default = false, $method_name = 'REQUEST' ) {
|
25 |
$sanitize_function_name = 'sanitize_text_field';
|
26 |
$method = $_REQUEST;
|
27 |
+
|
28 |
switch ( strtoupper( $method_name ) ) {
|
29 |
case 'GET':
|
30 |
$method = $_GET;
|
36 |
$method = $_REQUEST;
|
37 |
break;
|
38 |
}
|
39 |
+
|
40 |
if ( ! empty( $sanitize ) && is_string( $sanitize ) && $sanitize !== $sanitize_function_name ) {
|
41 |
$sanitize_function_name = $sanitize;
|
42 |
}
|
43 |
+
|
44 |
if ( ! function_exists( $sanitize_function_name ) ) {
|
45 |
throw new Exception( 'Function ' . $sanitize_function_name . 'is undefined.' );
|
46 |
}
|
47 |
+
|
48 |
if ( ! empty( $param ) ) {
|
49 |
if ( isset( $method[ $param ] ) && ! empty( $method[ $param ] ) ) {
|
50 |
if ( is_array( $method[ $param ] ) ) {
|
53 |
return ! empty( $sanitize ) ? call_user_func( $sanitize_function_name, $method[ $param ] ) : $method[ $param ];
|
54 |
}
|
55 |
}
|
56 |
+
|
57 |
return $default;
|
58 |
}
|
59 |
+
|
60 |
return ! empty( $sanitize ) ? array_map( $sanitize_function_name, $method ) : $method;
|
61 |
}
|
62 |
+
|
63 |
/**
|
64 |
* Recursive sanitation for an array
|
65 |
*
|
66 |
* @param string $function_name
|
67 |
+
* @param $array
|
68 |
*
|
69 |
* @return mixed
|
70 |
*/
|
76 |
if ( ! function_exists( $function_name ) ) {
|
77 |
throw new Exception( 'Function ' . $function_name . 'is undefined.' );
|
78 |
}
|
79 |
+
|
80 |
$value = $function_name( $value );
|
81 |
}
|
82 |
}
|
83 |
+
|
84 |
return $array;
|
85 |
}
|
86 |
+
|
87 |
/**
|
88 |
* @param bool|string see method getBody
|
89 |
* @param array $default
|
90 |
*
|
91 |
* @return mixed|null
|
92 |
*/
|
93 |
+
public function requestAll( $sanitize = false, $default = [] ) {
|
94 |
return $this->getBody( null, $sanitize, $default );
|
95 |
}
|
96 |
+
|
97 |
/**
|
98 |
+
* @param $param
|
99 |
* @param bool|string see method getBody
|
100 |
* @param bool $default
|
101 |
*
|
104 |
public function request( $param, $default = false, $sanitize = false ) {
|
105 |
return $this->getBody( $param, $sanitize, $default );
|
106 |
}
|
107 |
+
|
108 |
/**
|
109 |
* @param bool|string see method getBody
|
110 |
* @param array $default
|
111 |
*
|
112 |
* @return mixed|null
|
113 |
*/
|
114 |
+
public function getAll( $sanitize = false, $default = [] ) {
|
115 |
return $this->getBody( null, $sanitize, $default, 'get' );
|
116 |
}
|
117 |
+
|
118 |
/**
|
119 |
* @param null $param
|
120 |
* @param bool|string see method getBody
|
125 |
public function get( $param, $default = false, $sanitize = false ) {
|
126 |
return $this->getBody( $param, $sanitize, $default, 'get' );
|
127 |
}
|
128 |
+
|
129 |
/**
|
130 |
* @param bool|string see method getBody
|
131 |
* @param array $default
|
132 |
*
|
133 |
* @return mixed|null
|
134 |
*/
|
135 |
+
public function postAll( $sanitize = false, $default = [] ) {
|
136 |
return $this->getBody( null, $sanitize, $default, 'post' );
|
137 |
}
|
138 |
+
|
139 |
/**
|
140 |
+
* @param $param
|
141 |
* @param bool|string see method getBody
|
142 |
* @param bool $default
|
143 |
*
|
libs/factory/core/includes/class-factory-requirements.php
CHANGED
@@ -3,162 +3,163 @@
|
|
3 |
/**
|
4 |
* Class to check if the current WordPress and PHP versions meet our requirements
|
5 |
*
|
6 |
-
* @see
|
7 |
*
|
8 |
-
* @author
|
9 |
-
* @
|
10 |
-
*
|
11 |
-
* @
|
|
|
12 |
*/
|
|
|
|
|
|
|
13 |
|
14 |
-
if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
15 |
-
class Wbcr_Factory414_Requirements {
|
16 |
-
|
17 |
/**
|
18 |
* Factory framework version
|
19 |
*
|
20 |
* @var string
|
21 |
*/
|
22 |
protected $factory_version;
|
23 |
-
|
24 |
/**
|
25 |
* @var string
|
26 |
*/
|
27 |
protected $plugin_version;
|
28 |
-
|
29 |
/**
|
30 |
* Plugin file path
|
31 |
*
|
32 |
* @var string
|
33 |
*/
|
34 |
protected $plugin_file;
|
35 |
-
|
36 |
/**
|
37 |
* Plugin dir
|
38 |
*
|
39 |
* @var string
|
40 |
*/
|
41 |
protected $plugin_abs_path;
|
42 |
-
|
43 |
/**
|
44 |
* Plugin base dir
|
45 |
*
|
46 |
* @var string
|
47 |
*/
|
48 |
protected $plugin_basename;
|
49 |
-
|
50 |
/**
|
51 |
* Plugin url
|
52 |
*
|
53 |
* @var string
|
54 |
*/
|
55 |
protected $plugin_url;
|
56 |
-
|
57 |
/**
|
58 |
* Plugin prefix
|
59 |
*
|
60 |
* @var string
|
61 |
*/
|
62 |
protected $plugin_prefix;
|
63 |
-
|
64 |
/**
|
65 |
* Plugin name
|
66 |
*
|
67 |
* @var string
|
68 |
*/
|
69 |
protected $plugin_name;
|
70 |
-
|
71 |
/**
|
72 |
* Plugin title
|
73 |
*
|
74 |
* @var string
|
75 |
*/
|
76 |
protected $plugin_title = "(no title)";
|
77 |
-
|
78 |
/**
|
79 |
* @var string
|
80 |
*/
|
81 |
protected $plugin_text_domain;
|
82 |
-
|
83 |
/**
|
84 |
* Required PHP version
|
85 |
*
|
86 |
* @var string
|
87 |
*/
|
88 |
protected $required_php_version = '5.3';
|
89 |
-
|
90 |
/**
|
91 |
* Required WordPress version
|
92 |
*
|
93 |
* @var string
|
94 |
*/
|
95 |
protected $required_wp_version = '4.2.0';
|
96 |
-
|
97 |
/**
|
98 |
* Is this plugin already activated?
|
99 |
*
|
100 |
* @var bool
|
101 |
*/
|
102 |
protected $plugin_already_activate = false;
|
103 |
-
|
104 |
/**
|
105 |
* WFF_Requirements constructor.
|
106 |
*
|
107 |
* @param string $plugin_file
|
108 |
-
* @param array
|
109 |
*/
|
110 |
public function __construct( $plugin_file, array $plugin_info ) {
|
111 |
-
|
112 |
foreach ( (array) $plugin_info as $property => $value ) {
|
113 |
if ( property_exists( $this, $property ) ) {
|
114 |
$this->$property = $value;
|
115 |
}
|
116 |
}
|
117 |
-
|
118 |
$this->plugin_file = $plugin_file;
|
119 |
$this->plugin_abs_path = dirname( $plugin_file );
|
120 |
$this->plugin_basename = plugin_basename( $plugin_file );
|
121 |
$this->plugin_url = plugins_url( null, $plugin_file );
|
122 |
-
|
123 |
$plugin_info = get_file_data( $this->plugin_file, array(
|
124 |
'Version' => 'Version',
|
125 |
'FrameworkVersion' => 'Framework Version',
|
126 |
'TextDomain' => 'Text Domain'
|
127 |
), 'plugin' );
|
128 |
-
|
129 |
if ( isset( $plugin_info['FrameworkVersion'] ) ) {
|
130 |
$this->factory_version = $plugin_info['FrameworkVersion'];
|
131 |
}
|
132 |
-
|
133 |
if ( isset( $plugin_info['Version'] ) ) {
|
134 |
$this->plugin_version = $plugin_info['Version'];
|
135 |
}
|
136 |
-
|
137 |
if ( isset( $plugin_info['TextDomain'] ) ) {
|
138 |
$this->plugin_text_domain = $plugin_info['TextDomain'];
|
139 |
}
|
140 |
-
|
141 |
add_action( 'admin_init', array( $this, 'register_notices' ) );
|
142 |
}
|
143 |
-
|
144 |
public function get_plugin_version() {
|
145 |
return $this->plugin_version;
|
146 |
}
|
147 |
-
|
148 |
public function get_text_domain() {
|
149 |
return $this->plugin_text_domain;
|
150 |
}
|
151 |
-
|
152 |
/**
|
153 |
* @since 4.1.1
|
154 |
* @return void
|
155 |
*/
|
156 |
public function register_notices() {
|
157 |
if ( current_user_can( 'activate_plugins' ) && current_user_can( 'edit_plugins' ) && current_user_can( 'install_plugins' ) ) {
|
158 |
-
|
159 |
if ( is_multisite() ) {
|
160 |
add_action( 'network_admin_notices', array( $this, 'show_notice' ) );
|
161 |
-
|
162 |
if ( ! empty( $this->plugin_basename ) && in_array( $this->plugin_basename, (array) get_option( 'active_plugins', array() ) ) ) {
|
163 |
add_action( 'admin_notices', array( $this, 'show_notice' ) );
|
164 |
}
|
@@ -167,9 +168,10 @@ if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
|
167 |
}
|
168 |
}
|
169 |
}
|
170 |
-
|
171 |
/**
|
172 |
* Shows the incompatibility notification.
|
|
|
173 |
* @since 4.1.1
|
174 |
* @return void
|
175 |
*/
|
@@ -177,18 +179,19 @@ if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
|
177 |
if ( $this->check() ) {
|
178 |
return;
|
179 |
}
|
180 |
-
|
181 |
echo '<div class="notice notice-error"><p>' . $this->get_notice_text() . '</p></div>';
|
182 |
}
|
183 |
-
|
184 |
-
|
185 |
/**
|
186 |
* The method checks the compatibility of the plugin with php and wordpress version.
|
|
|
187 |
* @since 4.1.1
|
188 |
* @return bool
|
189 |
*/
|
190 |
public function check() {
|
191 |
-
|
192 |
// Fix for ithemes sync. When the ithemes sync plugin accepts the request, set the WP_ADMIN constant,
|
193 |
// after which the plugin Clearfy begins to create errors, and how the logic of its work is broken.
|
194 |
// Solution to simply terminate the plugin if there is a request from ithemes sync
|
@@ -196,19 +199,19 @@ if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
|
196 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'ithemes_sync_request' ) {
|
197 |
return false;
|
198 |
}
|
199 |
-
|
200 |
if ( isset( $_GET['ithemes-sync-request'] ) && ! empty( $_GET['ithemes-sync-request'] ) ) {
|
201 |
return false;
|
202 |
}
|
203 |
// ----------------------------------------
|
204 |
-
|
205 |
if ( ! $this->check_php_compat() || ! $this->check_wp_compat() || $this->plugin_already_activate ) {
|
206 |
return false;
|
207 |
}
|
208 |
-
|
209 |
return true;
|
210 |
}
|
211 |
-
|
212 |
/**
|
213 |
* The method checks the compatibility of the plugin with the php version of the server.
|
214 |
*
|
@@ -217,7 +220,7 @@ if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
|
217 |
public function check_php_compat() {
|
218 |
return version_compare( PHP_VERSION, $this->required_php_version, '>=' );
|
219 |
}
|
220 |
-
|
221 |
/**
|
222 |
* The method checks the compatibility of the plugin with the Wordpress version of the site.
|
223 |
*
|
@@ -226,10 +229,10 @@ if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
|
226 |
public function check_wp_compat() {
|
227 |
// Get the WP Version global.
|
228 |
global $wp_version;
|
229 |
-
|
230 |
return version_compare( $wp_version, $this->required_wp_version, '>=' );
|
231 |
}
|
232 |
-
|
233 |
/**
|
234 |
* Method returns notification text
|
235 |
*
|
@@ -238,53 +241,54 @@ if ( ! class_exists( 'Wbcr_Factory414_Requirements' ) ) {
|
|
238 |
protected function get_notice_text() {
|
239 |
$notice_text = $notice_default_text = '';
|
240 |
$notice_default_text .= '<b>' . $this->plugin_title . ' ' . __( 'warning', '' ) . ':</b>' . '<br>';
|
241 |
-
|
242 |
-
$notice_default_text .= sprintf( __( 'The %s plugin has stopped.', '
|
243 |
$notice_default_text .= __( 'Possible reasons:', '' ) . ' <br>';
|
244 |
-
|
245 |
$has_one = false;
|
246 |
-
|
247 |
if ( ! $this->check_php_compat() ) {
|
248 |
$has_one = true;
|
249 |
$notice_text .= '- ' . $this->get_php_incompat_text() . '<br>';
|
250 |
}
|
251 |
-
|
252 |
if ( ! $this->check_wp_compat() ) {
|
253 |
$has_one = true;
|
254 |
$notice_text .= '- ' . $this->get_wp_incompat_text() . '<br>';
|
255 |
}
|
256 |
-
|
257 |
if ( $this->plugin_already_activate ) {
|
258 |
$has_one = true;
|
259 |
$notice_text = '- ' . $this->get_plugin_already_activate_text() . '<br>';
|
260 |
}
|
261 |
-
|
262 |
if ( $has_one ) {
|
263 |
$notice_text = $notice_default_text . $notice_text;
|
264 |
}
|
265 |
-
|
266 |
return $notice_text;
|
267 |
}
|
268 |
-
|
269 |
/**
|
270 |
* @return string
|
271 |
*/
|
272 |
protected function get_php_incompat_text() {
|
273 |
-
return sprintf( __( 'You need to update the PHP version to %s or higher!', '
|
274 |
}
|
275 |
-
|
276 |
/**
|
277 |
* @return string
|
278 |
*/
|
279 |
protected function get_wp_incompat_text() {
|
280 |
-
return sprintf( __( 'You need to update WordPress to %s or higher!', '
|
281 |
}
|
282 |
-
|
283 |
/**
|
284 |
* @return string
|
285 |
*/
|
286 |
protected function get_plugin_already_activate_text() {
|
287 |
-
return sprintf( __( 'Plugin %s is already activated, you are trying to activate it again.', '
|
288 |
}
|
289 |
}
|
290 |
-
}
|
|
3 |
/**
|
4 |
* Class to check if the current WordPress and PHP versions meet our requirements
|
5 |
*
|
6 |
+
* @see Docs https://webcraftic.atlassian.net/wiki/spaces/FFD/pages/21692485/WFF+Requirements
|
7 |
*
|
8 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
9 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
10 |
+
*
|
11 |
+
* @version 2.0.0
|
12 |
+
* @since 4.0.9
|
13 |
*/
|
14 |
+
// @formatter:off
|
15 |
+
if ( ! class_exists( 'Wbcr_Factory425_Requirements' ) ) {
|
16 |
+
class Wbcr_Factory425_Requirements {
|
17 |
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Factory framework version
|
20 |
*
|
21 |
* @var string
|
22 |
*/
|
23 |
protected $factory_version;
|
24 |
+
|
25 |
/**
|
26 |
* @var string
|
27 |
*/
|
28 |
protected $plugin_version;
|
29 |
+
|
30 |
/**
|
31 |
* Plugin file path
|
32 |
*
|
33 |
* @var string
|
34 |
*/
|
35 |
protected $plugin_file;
|
36 |
+
|
37 |
/**
|
38 |
* Plugin dir
|
39 |
*
|
40 |
* @var string
|
41 |
*/
|
42 |
protected $plugin_abs_path;
|
43 |
+
|
44 |
/**
|
45 |
* Plugin base dir
|
46 |
*
|
47 |
* @var string
|
48 |
*/
|
49 |
protected $plugin_basename;
|
50 |
+
|
51 |
/**
|
52 |
* Plugin url
|
53 |
*
|
54 |
* @var string
|
55 |
*/
|
56 |
protected $plugin_url;
|
57 |
+
|
58 |
/**
|
59 |
* Plugin prefix
|
60 |
*
|
61 |
* @var string
|
62 |
*/
|
63 |
protected $plugin_prefix;
|
64 |
+
|
65 |
/**
|
66 |
* Plugin name
|
67 |
*
|
68 |
* @var string
|
69 |
*/
|
70 |
protected $plugin_name;
|
71 |
+
|
72 |
/**
|
73 |
* Plugin title
|
74 |
*
|
75 |
* @var string
|
76 |
*/
|
77 |
protected $plugin_title = "(no title)";
|
78 |
+
|
79 |
/**
|
80 |
* @var string
|
81 |
*/
|
82 |
protected $plugin_text_domain;
|
83 |
+
|
84 |
/**
|
85 |
* Required PHP version
|
86 |
*
|
87 |
* @var string
|
88 |
*/
|
89 |
protected $required_php_version = '5.3';
|
90 |
+
|
91 |
/**
|
92 |
* Required WordPress version
|
93 |
*
|
94 |
* @var string
|
95 |
*/
|
96 |
protected $required_wp_version = '4.2.0';
|
97 |
+
|
98 |
/**
|
99 |
* Is this plugin already activated?
|
100 |
*
|
101 |
* @var bool
|
102 |
*/
|
103 |
protected $plugin_already_activate = false;
|
104 |
+
|
105 |
/**
|
106 |
* WFF_Requirements constructor.
|
107 |
*
|
108 |
* @param string $plugin_file
|
109 |
+
* @param array $plugin_info
|
110 |
*/
|
111 |
public function __construct( $plugin_file, array $plugin_info ) {
|
112 |
+
|
113 |
foreach ( (array) $plugin_info as $property => $value ) {
|
114 |
if ( property_exists( $this, $property ) ) {
|
115 |
$this->$property = $value;
|
116 |
}
|
117 |
}
|
118 |
+
|
119 |
$this->plugin_file = $plugin_file;
|
120 |
$this->plugin_abs_path = dirname( $plugin_file );
|
121 |
$this->plugin_basename = plugin_basename( $plugin_file );
|
122 |
$this->plugin_url = plugins_url( null, $plugin_file );
|
123 |
+
|
124 |
$plugin_info = get_file_data( $this->plugin_file, array(
|
125 |
'Version' => 'Version',
|
126 |
'FrameworkVersion' => 'Framework Version',
|
127 |
'TextDomain' => 'Text Domain'
|
128 |
), 'plugin' );
|
129 |
+
|
130 |
if ( isset( $plugin_info['FrameworkVersion'] ) ) {
|
131 |
$this->factory_version = $plugin_info['FrameworkVersion'];
|
132 |
}
|
133 |
+
|
134 |
if ( isset( $plugin_info['Version'] ) ) {
|
135 |
$this->plugin_version = $plugin_info['Version'];
|
136 |
}
|
137 |
+
|
138 |
if ( isset( $plugin_info['TextDomain'] ) ) {
|
139 |
$this->plugin_text_domain = $plugin_info['TextDomain'];
|
140 |
}
|
141 |
+
|
142 |
add_action( 'admin_init', array( $this, 'register_notices' ) );
|
143 |
}
|
144 |
+
|
145 |
public function get_plugin_version() {
|
146 |
return $this->plugin_version;
|
147 |
}
|
148 |
+
|
149 |
public function get_text_domain() {
|
150 |
return $this->plugin_text_domain;
|
151 |
}
|
152 |
+
|
153 |
/**
|
154 |
* @since 4.1.1
|
155 |
* @return void
|
156 |
*/
|
157 |
public function register_notices() {
|
158 |
if ( current_user_can( 'activate_plugins' ) && current_user_can( 'edit_plugins' ) && current_user_can( 'install_plugins' ) ) {
|
159 |
+
|
160 |
if ( is_multisite() ) {
|
161 |
add_action( 'network_admin_notices', array( $this, 'show_notice' ) );
|
162 |
+
|
163 |
if ( ! empty( $this->plugin_basename ) && in_array( $this->plugin_basename, (array) get_option( 'active_plugins', array() ) ) ) {
|
164 |
add_action( 'admin_notices', array( $this, 'show_notice' ) );
|
165 |
}
|
168 |
}
|
169 |
}
|
170 |
}
|
171 |
+
|
172 |
/**
|
173 |
* Shows the incompatibility notification.
|
174 |
+
*
|
175 |
* @since 4.1.1
|
176 |
* @return void
|
177 |
*/
|
179 |
if ( $this->check() ) {
|
180 |
return;
|
181 |
}
|
182 |
+
|
183 |
echo '<div class="notice notice-error"><p>' . $this->get_notice_text() . '</p></div>';
|
184 |
}
|
185 |
+
|
186 |
+
|
187 |
/**
|
188 |
* The method checks the compatibility of the plugin with php and wordpress version.
|
189 |
+
*
|
190 |
* @since 4.1.1
|
191 |
* @return bool
|
192 |
*/
|
193 |
public function check() {
|
194 |
+
|
195 |
// Fix for ithemes sync. When the ithemes sync plugin accepts the request, set the WP_ADMIN constant,
|
196 |
// after which the plugin Clearfy begins to create errors, and how the logic of its work is broken.
|
197 |
// Solution to simply terminate the plugin if there is a request from ithemes sync
|
199 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'ithemes_sync_request' ) {
|
200 |
return false;
|
201 |
}
|
202 |
+
|
203 |
if ( isset( $_GET['ithemes-sync-request'] ) && ! empty( $_GET['ithemes-sync-request'] ) ) {
|
204 |
return false;
|
205 |
}
|
206 |
// ----------------------------------------
|
207 |
+
|
208 |
if ( ! $this->check_php_compat() || ! $this->check_wp_compat() || $this->plugin_already_activate ) {
|
209 |
return false;
|
210 |
}
|
211 |
+
|
212 |
return true;
|
213 |
}
|
214 |
+
|
215 |
/**
|
216 |
* The method checks the compatibility of the plugin with the php version of the server.
|
217 |
*
|
220 |
public function check_php_compat() {
|
221 |
return version_compare( PHP_VERSION, $this->required_php_version, '>=' );
|
222 |
}
|
223 |
+
|
224 |
/**
|
225 |
* The method checks the compatibility of the plugin with the Wordpress version of the site.
|
226 |
*
|
229 |
public function check_wp_compat() {
|
230 |
// Get the WP Version global.
|
231 |
global $wp_version;
|
232 |
+
|
233 |
return version_compare( $wp_version, $this->required_wp_version, '>=' );
|
234 |
}
|
235 |
+
|
236 |
/**
|
237 |
* Method returns notification text
|
238 |
*
|
241 |
protected function get_notice_text() {
|
242 |
$notice_text = $notice_default_text = '';
|
243 |
$notice_default_text .= '<b>' . $this->plugin_title . ' ' . __( 'warning', '' ) . ':</b>' . '<br>';
|
244 |
+
|
245 |
+
$notice_default_text .= sprintf( __( 'The %s plugin has stopped.', 'wbcr_factory_clearfy_217' ), $this->plugin_title ) . ' ';
|
246 |
$notice_default_text .= __( 'Possible reasons:', '' ) . ' <br>';
|
247 |
+
|
248 |
$has_one = false;
|
249 |
+
|
250 |
if ( ! $this->check_php_compat() ) {
|
251 |
$has_one = true;
|
252 |
$notice_text .= '- ' . $this->get_php_incompat_text() . '<br>';
|
253 |
}
|
254 |
+
|
255 |
if ( ! $this->check_wp_compat() ) {
|
256 |
$has_one = true;
|
257 |
$notice_text .= '- ' . $this->get_wp_incompat_text() . '<br>';
|
258 |
}
|
259 |
+
|
260 |
if ( $this->plugin_already_activate ) {
|
261 |
$has_one = true;
|
262 |
$notice_text = '- ' . $this->get_plugin_already_activate_text() . '<br>';
|
263 |
}
|
264 |
+
|
265 |
if ( $has_one ) {
|
266 |
$notice_text = $notice_default_text . $notice_text;
|
267 |
}
|
268 |
+
|
269 |
return $notice_text;
|
270 |
}
|
271 |
+
|
272 |
/**
|
273 |
* @return string
|
274 |
*/
|
275 |
protected function get_php_incompat_text() {
|
276 |
+
return sprintf( __( 'You need to update the PHP version to %s or higher!', 'wbcr_factory_425' ), $this->required_php_version );
|
277 |
}
|
278 |
+
|
279 |
/**
|
280 |
* @return string
|
281 |
*/
|
282 |
protected function get_wp_incompat_text() {
|
283 |
+
return sprintf( __( 'You need to update WordPress to %s or higher!', 'wbcr_factory_425' ), $this->required_wp_version );
|
284 |
}
|
285 |
+
|
286 |
/**
|
287 |
* @return string
|
288 |
*/
|
289 |
protected function get_plugin_already_activate_text() {
|
290 |
+
return sprintf( __( 'Plugin %s is already activated, you are trying to activate it again.', 'wbcr_factory_425' ), $this->plugin_title );
|
291 |
}
|
292 |
}
|
293 |
+
}
|
294 |
+
// @formatter:on
|
libs/factory/core/includes/entities/class-factory-paths.php
CHANGED
@@ -1,30 +1,29 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
exit;
|
7 |
}
|
8 |
|
9 |
/*
|
10 |
-
* @author
|
11 |
-
* @
|
12 |
-
* @copyright (c) 2018 Webraftic Ltd
|
13 |
* @since 4.1.1
|
14 |
*/
|
15 |
|
16 |
class Paths {
|
17 |
-
|
18 |
public $absolute;
|
19 |
public $main_file;
|
20 |
public $relative;
|
21 |
public $url;
|
22 |
-
|
23 |
protected $plugin_path;
|
24 |
-
|
25 |
public function __construct( $plugin_file ) {
|
26 |
$this->plugin_path = $plugin_file;
|
27 |
-
|
28 |
$this->main_file = $plugin_file;
|
29 |
$this->absolute = dirname( $plugin_file );
|
30 |
$this->basename = plugin_basename( $plugin_file );
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Entities;
|
4 |
|
5 |
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
exit;
|
7 |
}
|
8 |
|
9 |
/*
|
10 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
11 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
|
|
12 |
* @since 4.1.1
|
13 |
*/
|
14 |
|
15 |
class Paths {
|
16 |
+
|
17 |
public $absolute;
|
18 |
public $main_file;
|
19 |
public $relative;
|
20 |
public $url;
|
21 |
+
|
22 |
protected $plugin_path;
|
23 |
+
|
24 |
public function __construct( $plugin_file ) {
|
25 |
$this->plugin_path = $plugin_file;
|
26 |
+
|
27 |
$this->main_file = $plugin_file;
|
28 |
$this->absolute = dirname( $plugin_file );
|
29 |
$this->basename = plugin_basename( $plugin_file );
|
libs/factory/core/includes/entities/class-factory-support.php
CHANGED
@@ -1,28 +1,27 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
exit;
|
7 |
}
|
8 |
|
9 |
/*
|
10 |
-
* @author
|
11 |
-
* @
|
12 |
-
* @copyright (c) 2018 Webraftic Ltd
|
13 |
* @since 4.1.1
|
14 |
*/
|
15 |
|
16 |
class Support {
|
17 |
-
|
18 |
protected $plugin_name;
|
19 |
protected $site_url;
|
20 |
-
|
21 |
protected $features_page_slug = 'premium-features';
|
22 |
protected $pricing_page_slug = 'pricing';
|
23 |
protected $support_page_slug = 'support';
|
24 |
protected $docs_page_slug = 'docs';
|
25 |
-
|
26 |
/**
|
27 |
* Plugin_Site constructor.
|
28 |
*
|
@@ -30,7 +29,7 @@ class Support {
|
|
30 |
*/
|
31 |
public function __construct( array $data ) {
|
32 |
$this->site_url = isset( $data['url'] ) ? $data['url'] : null;
|
33 |
-
|
34 |
if ( isset( $data['pages_map'] ) && is_array( $data['pages_map'] ) ) {
|
35 |
foreach ( $data['pages_map'] as $key => $def_value ) {
|
36 |
$attr = $key . '_page_slug';
|
@@ -38,7 +37,7 @@ class Support {
|
|
38 |
}
|
39 |
}
|
40 |
}
|
41 |
-
|
42 |
/**
|
43 |
* @return string
|
44 |
*/
|
@@ -46,11 +45,11 @@ class Support {
|
|
46 |
if ( $track ) {
|
47 |
return $this->get_tracking_page_url( $this->site_url, $utm_content );
|
48 |
}
|
49 |
-
|
50 |
return $this->site_url;
|
51 |
}
|
52 |
-
|
53 |
-
|
54 |
/**
|
55 |
* @return string
|
56 |
*/
|
@@ -58,11 +57,11 @@ class Support {
|
|
58 |
if ( $track ) {
|
59 |
return $this->get_tracking_page_url( $this->features_page_slug, $utm_content );
|
60 |
}
|
61 |
-
|
62 |
return $this->get_site_url() . '/' . $this->features_page_slug;
|
63 |
}
|
64 |
-
|
65 |
-
|
66 |
/**
|
67 |
* @return string
|
68 |
*/
|
@@ -70,11 +69,11 @@ class Support {
|
|
70 |
if ( $track ) {
|
71 |
return $this->get_tracking_page_url( $this->pricing_page_slug, $utm_content );
|
72 |
}
|
73 |
-
|
74 |
return $this->get_site_url() . '/' . $this->pricing_page_slug;
|
75 |
}
|
76 |
-
|
77 |
-
|
78 |
/**
|
79 |
* @return string
|
80 |
*/
|
@@ -82,11 +81,11 @@ class Support {
|
|
82 |
if ( $track ) {
|
83 |
return $this->get_tracking_page_url( $this->support_page_slug, $utm_content );
|
84 |
}
|
85 |
-
|
86 |
return $this->get_site_url() . '/' . $this->support_page_slug;
|
87 |
}
|
88 |
-
|
89 |
-
|
90 |
/**
|
91 |
* @return string
|
92 |
*/
|
@@ -94,32 +93,32 @@ class Support {
|
|
94 |
if ( $track ) {
|
95 |
return $this->get_tracking_page_url( $this->docs_page_slug, $utm_content );
|
96 |
}
|
97 |
-
|
98 |
return $this->get_site_url() . '/' . $this->docs_page_slug;
|
99 |
}
|
100 |
-
|
101 |
-
|
102 |
/**
|
103 |
-
* @param null
|
104 |
-
* @param null
|
105 |
* @param string $urm_source
|
106 |
*
|
107 |
* @return string
|
108 |
*/
|
109 |
public function get_tracking_page_url( $page = null, $utm_content = null, $urm_source = 'wordpress.org' ) {
|
110 |
-
|
111 |
-
$args =
|
112 |
-
|
113 |
if ( ! empty( $plugin_name ) ) {
|
114 |
$args['utm_campaign'] = $plugin_name;
|
115 |
}
|
116 |
-
|
117 |
if ( ! empty( $utm_content ) ) {
|
118 |
$args['utm_content'] = $utm_content;
|
119 |
}
|
120 |
-
|
121 |
$raw_url = add_query_arg( $args, $this->get_site_url() . '/' . $page . '/' );
|
122 |
-
|
123 |
return esc_url( $raw_url );
|
124 |
}
|
125 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Entities;
|
4 |
|
5 |
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
exit;
|
7 |
}
|
8 |
|
9 |
/*
|
10 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
11 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
|
|
12 |
* @since 4.1.1
|
13 |
*/
|
14 |
|
15 |
class Support {
|
16 |
+
|
17 |
protected $plugin_name;
|
18 |
protected $site_url;
|
19 |
+
|
20 |
protected $features_page_slug = 'premium-features';
|
21 |
protected $pricing_page_slug = 'pricing';
|
22 |
protected $support_page_slug = 'support';
|
23 |
protected $docs_page_slug = 'docs';
|
24 |
+
|
25 |
/**
|
26 |
* Plugin_Site constructor.
|
27 |
*
|
29 |
*/
|
30 |
public function __construct( array $data ) {
|
31 |
$this->site_url = isset( $data['url'] ) ? $data['url'] : null;
|
32 |
+
|
33 |
if ( isset( $data['pages_map'] ) && is_array( $data['pages_map'] ) ) {
|
34 |
foreach ( $data['pages_map'] as $key => $def_value ) {
|
35 |
$attr = $key . '_page_slug';
|
37 |
}
|
38 |
}
|
39 |
}
|
40 |
+
|
41 |
/**
|
42 |
* @return string
|
43 |
*/
|
45 |
if ( $track ) {
|
46 |
return $this->get_tracking_page_url( $this->site_url, $utm_content );
|
47 |
}
|
48 |
+
|
49 |
return $this->site_url;
|
50 |
}
|
51 |
+
|
52 |
+
|
53 |
/**
|
54 |
* @return string
|
55 |
*/
|
57 |
if ( $track ) {
|
58 |
return $this->get_tracking_page_url( $this->features_page_slug, $utm_content );
|
59 |
}
|
60 |
+
|
61 |
return $this->get_site_url() . '/' . $this->features_page_slug;
|
62 |
}
|
63 |
+
|
64 |
+
|
65 |
/**
|
66 |
* @return string
|
67 |
*/
|
69 |
if ( $track ) {
|
70 |
return $this->get_tracking_page_url( $this->pricing_page_slug, $utm_content );
|
71 |
}
|
72 |
+
|
73 |
return $this->get_site_url() . '/' . $this->pricing_page_slug;
|
74 |
}
|
75 |
+
|
76 |
+
|
77 |
/**
|
78 |
* @return string
|
79 |
*/
|
81 |
if ( $track ) {
|
82 |
return $this->get_tracking_page_url( $this->support_page_slug, $utm_content );
|
83 |
}
|
84 |
+
|
85 |
return $this->get_site_url() . '/' . $this->support_page_slug;
|
86 |
}
|
87 |
+
|
88 |
+
|
89 |
/**
|
90 |
* @return string
|
91 |
*/
|
93 |
if ( $track ) {
|
94 |
return $this->get_tracking_page_url( $this->docs_page_slug, $utm_content );
|
95 |
}
|
96 |
+
|
97 |
return $this->get_site_url() . '/' . $this->docs_page_slug;
|
98 |
}
|
99 |
+
|
100 |
+
|
101 |
/**
|
102 |
+
* @param null $page
|
103 |
+
* @param null $utm_content
|
104 |
* @param string $urm_source
|
105 |
*
|
106 |
* @return string
|
107 |
*/
|
108 |
public function get_tracking_page_url( $page = null, $utm_content = null, $urm_source = 'wordpress.org' ) {
|
109 |
+
|
110 |
+
$args = [ 'utm_source' => $urm_source ];
|
111 |
+
|
112 |
if ( ! empty( $plugin_name ) ) {
|
113 |
$args['utm_campaign'] = $plugin_name;
|
114 |
}
|
115 |
+
|
116 |
if ( ! empty( $utm_content ) ) {
|
117 |
$args['utm_content'] = $utm_content;
|
118 |
}
|
119 |
+
|
120 |
$raw_url = add_query_arg( $args, $this->get_site_url() . '/' . $page . '/' );
|
121 |
+
|
122 |
return esc_url( $raw_url );
|
123 |
}
|
124 |
}
|
libs/factory/core/includes/functions.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Factory Function Library
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @
|
7 |
*
|
8 |
-
* @package
|
9 |
-
* @since
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -19,18 +19,18 @@ if ( ! function_exists( 'get_user_locale' ) ) {
|
|
19 |
$user = false;
|
20 |
if ( 0 === $user_id && function_exists( 'wp_get_current_user' ) ) {
|
21 |
$user = wp_get_current_user();
|
22 |
-
}
|
23 |
$user = $user_id;
|
24 |
-
}
|
25 |
$user = get_user_by( 'id', $user_id );
|
26 |
}
|
27 |
-
|
28 |
if ( ! $user ) {
|
29 |
return get_locale();
|
30 |
}
|
31 |
-
|
32 |
$locale = $user->locale;
|
33 |
-
|
34 |
return $locale ? $locale : get_locale();
|
35 |
}
|
36 |
}
|
@@ -46,25 +46,25 @@ if ( ! function_exists( 'get_user_locale' ) ) {
|
|
46 |
*
|
47 |
* @since 1.0.0
|
48 |
*
|
49 |
-
* @
|
50 |
-
*
|
51 |
-
* @param string $
|
52 |
-
* @param
|
53 |
-
* @param string $
|
54 |
-
* @param string $replacement Optional. The hook that should have been used.
|
55 |
-
* @param string $message Optional. A message regarding the change.
|
56 |
*
|
57 |
* @return mixed
|
|
|
|
|
58 |
*/
|
59 |
-
function
|
60 |
if ( function_exists( 'apply_filters_deprecated' ) ) {
|
61 |
return apply_filters_deprecated( $tag, $args, $version, $replacement, $message );
|
62 |
}
|
63 |
if ( ! has_filter( $tag ) ) {
|
64 |
return $args[0];
|
65 |
}
|
66 |
-
|
67 |
-
|
68 |
return apply_filters_ref_array( $tag, $args );
|
69 |
}
|
70 |
|
@@ -79,33 +79,33 @@ function wbcr_factory_414_apply_filters_deprecated( $tag, $args, $version, $repl
|
|
79 |
*
|
80 |
* @since 1.0.0
|
81 |
*
|
82 |
-
* @
|
83 |
-
*
|
84 |
-
* @param string $
|
85 |
-
* @param
|
86 |
-
* @param string $
|
87 |
-
* @param string $replacement Optional. The hook that should have been used.
|
88 |
-
* @param string $message Optional. A message regarding the change.
|
89 |
*
|
90 |
* @return void
|
|
|
|
|
91 |
*/
|
92 |
-
function
|
93 |
if ( function_exists( 'do_action_deprecated' ) ) {
|
94 |
do_action_deprecated( $tag, $args, $version, $replacement, $message );
|
95 |
-
|
96 |
return;
|
97 |
}
|
98 |
if ( ! has_action( $tag ) ) {
|
99 |
return;
|
100 |
}
|
101 |
-
|
102 |
do_action_ref_array( $tag, $args );
|
103 |
}
|
104 |
|
105 |
/**
|
106 |
* Marks a deprecated action or filter hook as deprecated and throws a notice.
|
107 |
*
|
108 |
-
* Use the '
|
109 |
* deprecated hook was called.
|
110 |
*
|
111 |
* Default behavior is to trigger a user error if WP_DEBUG is true.
|
@@ -115,34 +115,34 @@ function wbcr_factory_414_do_action_deprecated( $tag, $args, $version, $replacem
|
|
115 |
*
|
116 |
* This is a copy of `_deprecated_hook` introduced in WP 4.6.
|
117 |
*
|
118 |
-
* @since
|
119 |
* @access private
|
120 |
*
|
121 |
-
* @param string $hook
|
122 |
-
* @param string $version
|
123 |
-
* @param string $replacement
|
124 |
-
* @param string $message
|
125 |
*/
|
126 |
-
function
|
127 |
/**
|
128 |
* Fires when a deprecated hook is called.
|
129 |
*
|
130 |
* @since 1.0.0
|
131 |
*
|
132 |
-
* @param string $hook
|
133 |
-
* @param string $replacement
|
134 |
-
* @param string $version
|
135 |
-
* @param string $message
|
136 |
*/
|
137 |
do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );
|
138 |
-
|
139 |
/**
|
140 |
* Filter whether to trigger deprecated hook errors.
|
141 |
*
|
142 |
* @since 1.0.0
|
143 |
*
|
144 |
-
* @param bool $trigger
|
145 |
-
*
|
146 |
*/
|
147 |
if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) {
|
148 |
$message = empty( $message ) ? '' : ' ' . $message;
|
@@ -157,33 +157,33 @@ function wbcr_factory_414_deprecated_hook( $hook, $version, $replacement = null,
|
|
157 |
if ( ! function_exists( '_sanitize_text_fields' ) ) {
|
158 |
function _sanitize_text_fields( $str, $keep_newlines = false ) {
|
159 |
$filtered = wp_check_invalid_utf8( $str );
|
160 |
-
|
161 |
if ( strpos( $filtered, '<' ) !== false ) {
|
162 |
$filtered = wp_pre_kses_less_than( $filtered );
|
163 |
// This will strip extra whitespace for us.
|
164 |
$filtered = wp_strip_all_tags( $filtered, false );
|
165 |
-
|
166 |
// Use html entities in a special case to make sure no later
|
167 |
// newline stripping stage could lead to a functional tag
|
168 |
$filtered = str_replace( "<\n", "<\n", $filtered );
|
169 |
}
|
170 |
-
|
171 |
if ( ! $keep_newlines ) {
|
172 |
$filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered );
|
173 |
}
|
174 |
$filtered = trim( $filtered );
|
175 |
-
|
176 |
$found = false;
|
177 |
while( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
|
178 |
$filtered = str_replace( $match[0], '', $filtered );
|
179 |
$found = true;
|
180 |
}
|
181 |
-
|
182 |
if ( $found ) {
|
183 |
// Strip out the whitespace that may now exist after removing the octets.
|
184 |
$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
|
185 |
}
|
186 |
-
|
187 |
return $filtered;
|
188 |
}
|
189 |
}
|
@@ -191,14 +191,14 @@ if ( ! function_exists( '_sanitize_text_fields' ) ) {
|
|
191 |
if ( ! function_exists( 'sanitize_textarea_field' ) ) {
|
192 |
function sanitize_textarea_field( $str ) {
|
193 |
$filtered = _sanitize_text_fields( $str, true );
|
194 |
-
|
195 |
/**
|
196 |
* Filters a sanitized textarea field string.
|
197 |
*
|
198 |
* @since 4.7.0
|
199 |
*
|
200 |
-
* @param string $filtered
|
201 |
-
* @param string $str
|
202 |
*/
|
203 |
return apply_filters( 'sanitize_textarea_field', $filtered, $str );
|
204 |
}
|
2 |
/**
|
3 |
* Factory Function Library
|
4 |
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
6 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
7 |
*
|
8 |
+
* @package factory-core
|
9 |
+
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
19 |
$user = false;
|
20 |
if ( 0 === $user_id && function_exists( 'wp_get_current_user' ) ) {
|
21 |
$user = wp_get_current_user();
|
22 |
+
} else if ( $user_id instanceof WP_User ) {
|
23 |
$user = $user_id;
|
24 |
+
} else if ( $user_id && is_numeric( $user_id ) ) {
|
25 |
$user = get_user_by( 'id', $user_id );
|
26 |
}
|
27 |
+
|
28 |
if ( ! $user ) {
|
29 |
return get_locale();
|
30 |
}
|
31 |
+
|
32 |
$locale = $user->locale;
|
33 |
+
|
34 |
return $locale ? $locale : get_locale();
|
35 |
}
|
36 |
}
|
46 |
*
|
47 |
* @since 1.0.0
|
48 |
*
|
49 |
+
* @param string $tag The name of the filter hook.
|
50 |
+
* @param array $args Array of additional function arguments to be passed to apply_filters().
|
51 |
+
* @param string $version The version of BP Block Users that deprecated the hook.
|
52 |
+
* @param string $replacement Optional. The hook that should have been used.
|
53 |
+
* @param string $message Optional. A message regarding the change.
|
|
|
|
|
54 |
*
|
55 |
* @return mixed
|
56 |
+
* @see wbcr_factory_425_deprecated_hook()
|
57 |
+
*
|
58 |
*/
|
59 |
+
function wbcr_factory_425_apply_filters_deprecated( $tag, $args, $version, $replacement = false, $message = null ) {
|
60 |
if ( function_exists( 'apply_filters_deprecated' ) ) {
|
61 |
return apply_filters_deprecated( $tag, $args, $version, $replacement, $message );
|
62 |
}
|
63 |
if ( ! has_filter( $tag ) ) {
|
64 |
return $args[0];
|
65 |
}
|
66 |
+
wbcr_factory_425_deprecated_hook( $tag, $version, $replacement, $message );
|
67 |
+
|
68 |
return apply_filters_ref_array( $tag, $args );
|
69 |
}
|
70 |
|
79 |
*
|
80 |
* @since 1.0.0
|
81 |
*
|
82 |
+
* @param string $tag The name of the action hook.
|
83 |
+
* @param array $args Array of additional function arguments to be passed to do_action().
|
84 |
+
* @param string $version The version of BP Block Users that deprecated the hook.
|
85 |
+
* @param string $replacement Optional. The hook that should have been used.
|
86 |
+
* @param string $message Optional. A message regarding the change.
|
|
|
|
|
87 |
*
|
88 |
* @return void
|
89 |
+
* @see _deprecated_hook()
|
90 |
+
*
|
91 |
*/
|
92 |
+
function wbcr_factory_425_do_action_deprecated( $tag, $args, $version, $replacement = false, $message = null ) {
|
93 |
if ( function_exists( 'do_action_deprecated' ) ) {
|
94 |
do_action_deprecated( $tag, $args, $version, $replacement, $message );
|
95 |
+
|
96 |
return;
|
97 |
}
|
98 |
if ( ! has_action( $tag ) ) {
|
99 |
return;
|
100 |
}
|
101 |
+
wbcr_factory_425_deprecated_hook( $tag, $version, $replacement, $message );
|
102 |
do_action_ref_array( $tag, $args );
|
103 |
}
|
104 |
|
105 |
/**
|
106 |
* Marks a deprecated action or filter hook as deprecated and throws a notice.
|
107 |
*
|
108 |
+
* Use the 'wbcr_factory_425_deprecated_hook_run' action to get the backtrace describing where the
|
109 |
* deprecated hook was called.
|
110 |
*
|
111 |
* Default behavior is to trigger a user error if WP_DEBUG is true.
|
115 |
*
|
116 |
* This is a copy of `_deprecated_hook` introduced in WP 4.6.
|
117 |
*
|
118 |
+
* @since 1.0.0
|
119 |
* @access private
|
120 |
*
|
121 |
+
* @param string $hook The hook that was used.
|
122 |
+
* @param string $version The version of WordPress that deprecated the hook.
|
123 |
+
* @param string $replacement Optional. The hook that should have been used.
|
124 |
+
* @param string $message Optional. A message regarding the change.
|
125 |
*/
|
126 |
+
function wbcr_factory_425_deprecated_hook( $hook, $version, $replacement = null, $message = null ) {
|
127 |
/**
|
128 |
* Fires when a deprecated hook is called.
|
129 |
*
|
130 |
* @since 1.0.0
|
131 |
*
|
132 |
+
* @param string $hook The hook that was called.
|
133 |
+
* @param string $replacement The hook that should be used as a replacement.
|
134 |
+
* @param string $version The version of BP Block Users that deprecated the argument used.
|
135 |
+
* @param string $message A message regarding the change.
|
136 |
*/
|
137 |
do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );
|
138 |
+
|
139 |
/**
|
140 |
* Filter whether to trigger deprecated hook errors.
|
141 |
*
|
142 |
* @since 1.0.0
|
143 |
*
|
144 |
+
* @param bool $trigger Whether to trigger deprecated hook errors. Requires
|
145 |
+
* `WP_DEBUG` to be defined true.
|
146 |
*/
|
147 |
if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) {
|
148 |
$message = empty( $message ) ? '' : ' ' . $message;
|
157 |
if ( ! function_exists( '_sanitize_text_fields' ) ) {
|
158 |
function _sanitize_text_fields( $str, $keep_newlines = false ) {
|
159 |
$filtered = wp_check_invalid_utf8( $str );
|
160 |
+
|
161 |
if ( strpos( $filtered, '<' ) !== false ) {
|
162 |
$filtered = wp_pre_kses_less_than( $filtered );
|
163 |
// This will strip extra whitespace for us.
|
164 |
$filtered = wp_strip_all_tags( $filtered, false );
|
165 |
+
|
166 |
// Use html entities in a special case to make sure no later
|
167 |
// newline stripping stage could lead to a functional tag
|
168 |
$filtered = str_replace( "<\n", "<\n", $filtered );
|
169 |
}
|
170 |
+
|
171 |
if ( ! $keep_newlines ) {
|
172 |
$filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered );
|
173 |
}
|
174 |
$filtered = trim( $filtered );
|
175 |
+
|
176 |
$found = false;
|
177 |
while( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
|
178 |
$filtered = str_replace( $match[0], '', $filtered );
|
179 |
$found = true;
|
180 |
}
|
181 |
+
|
182 |
if ( $found ) {
|
183 |
// Strip out the whitespace that may now exist after removing the octets.
|
184 |
$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
|
185 |
}
|
186 |
+
|
187 |
return $filtered;
|
188 |
}
|
189 |
}
|
191 |
if ( ! function_exists( 'sanitize_textarea_field' ) ) {
|
192 |
function sanitize_textarea_field( $str ) {
|
193 |
$filtered = _sanitize_text_fields( $str, true );
|
194 |
+
|
195 |
/**
|
196 |
* Filters a sanitized textarea field string.
|
197 |
*
|
198 |
* @since 4.7.0
|
199 |
*
|
200 |
+
* @param string $filtered The sanitized string.
|
201 |
+
* @param string $str The string prior to being sanitized.
|
202 |
*/
|
203 |
return apply_filters( 'sanitize_textarea_field', $filtered, $str );
|
204 |
}
|
libs/factory/core/includes/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/includes/premium/class-factory-license-interface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -8,25 +8,25 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
8 |
}
|
9 |
|
10 |
/**
|
11 |
-
* @author
|
12 |
-
* @
|
13 |
* @copyright (c) 2018 Webraftic Ltd
|
14 |
-
* @version
|
15 |
*/
|
16 |
interface License {
|
17 |
-
|
18 |
public function get_key();
|
19 |
-
|
20 |
public function get_hidden_key();
|
21 |
-
|
22 |
public function get_expiration_time( $format = 'time' );
|
23 |
-
|
24 |
public function get_sites_quota();
|
25 |
-
|
26 |
public function get_count_active_sites();
|
27 |
-
|
28 |
public function is_valid();
|
29 |
-
|
30 |
public function is_lifetime();
|
31 |
-
|
32 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Premium\Interfaces;
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
}
|
9 |
|
10 |
/**
|
11 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
12 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
13 |
* @copyright (c) 2018 Webraftic Ltd
|
14 |
+
* @version 1.0
|
15 |
*/
|
16 |
interface License {
|
17 |
+
|
18 |
public function get_key();
|
19 |
+
|
20 |
public function get_hidden_key();
|
21 |
+
|
22 |
public function get_expiration_time( $format = 'time' );
|
23 |
+
|
24 |
public function get_sites_quota();
|
25 |
+
|
26 |
public function get_count_active_sites();
|
27 |
+
|
28 |
public function is_valid();
|
29 |
+
|
30 |
public function is_lifetime();
|
31 |
+
|
32 |
}
|
libs/factory/core/includes/premium/class-factory-manager.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use Exception;
|
6 |
-
use
|
7 |
|
8 |
// Exit if accessed directly
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -11,77 +11,79 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
11 |
}
|
12 |
|
13 |
/**
|
14 |
-
* @author
|
15 |
-
* @
|
16 |
-
* @copyright (c) 2018 Webraftic Ltd
|
17 |
-
* @version 1.0
|
18 |
*/
|
19 |
class Manager {
|
20 |
-
|
21 |
/**
|
22 |
-
* @
|
|
|
|
|
23 |
*/
|
24 |
-
|
25 |
-
|
26 |
/**
|
27 |
-
* @var
|
28 |
*/
|
29 |
-
protected $
|
30 |
-
|
31 |
/**
|
32 |
* @var array
|
33 |
*/
|
34 |
protected $settings;
|
35 |
-
|
36 |
/**
|
37 |
* Manager constructor.
|
38 |
*
|
39 |
-
* @param
|
40 |
-
* @param array
|
41 |
*
|
42 |
* @throws Exception
|
43 |
*/
|
44 |
-
public function __construct(
|
45 |
$this->plugin = $plugin;
|
46 |
$this->settings = $settings;
|
47 |
-
//Plugin_Updates_Manager( $this->plugin, $this->updates['premium'], true );
|
48 |
}
|
49 |
-
|
50 |
/**
|
51 |
-
* @param
|
52 |
-
* @param array
|
53 |
*
|
54 |
-
* @return \WBCR\
|
55 |
* @throws Exception
|
56 |
*/
|
57 |
-
public static function instance(
|
58 |
$premium_manager = new Manager( $plugin, $settings );
|
59 |
-
|
60 |
return $premium_manager->instance_provider();
|
61 |
}
|
62 |
-
|
63 |
/**
|
64 |
* @param $provider_name
|
65 |
*
|
66 |
-
* @return \WBCR\
|
67 |
* @throws Exception
|
68 |
*/
|
69 |
public function instance_provider() {
|
70 |
$provider_name = $this->get_setting( 'provider' );
|
71 |
-
|
72 |
-
if (
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
//return new \WBCR\Factory_Themplatemonster_000\Licensing\Provider( $this->plugin, $this->settings );
|
79 |
-
throw new Exception( 'Templatemonster provider is not supported!' );
|
80 |
}
|
81 |
-
|
82 |
throw new Exception( "Provider {$provider_name} is not supported!" );
|
83 |
}
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
85 |
protected function get_setting( $name ) {
|
86 |
return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : null;
|
87 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Premium;
|
4 |
|
5 |
use Exception;
|
6 |
+
use Wbcr_Factory425_Plugin;
|
7 |
|
8 |
// Exit if accessed directly
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
}
|
12 |
|
13 |
/**
|
14 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
15 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
|
|
|
|
16 |
*/
|
17 |
class Manager {
|
18 |
+
|
19 |
/**
|
20 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
21 |
+
* @since 4.1.6
|
22 |
+
* @var array
|
23 |
*/
|
24 |
+
public static $providers;
|
25 |
+
|
26 |
/**
|
27 |
+
* @var Wbcr_Factory425_Plugin
|
28 |
*/
|
29 |
+
protected $plugin;
|
30 |
+
|
31 |
/**
|
32 |
* @var array
|
33 |
*/
|
34 |
protected $settings;
|
35 |
+
|
36 |
/**
|
37 |
* Manager constructor.
|
38 |
*
|
39 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
40 |
+
* @param array $settings
|
41 |
*
|
42 |
* @throws Exception
|
43 |
*/
|
44 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin, array $settings ) {
|
45 |
$this->plugin = $plugin;
|
46 |
$this->settings = $settings;
|
|
|
47 |
}
|
48 |
+
|
49 |
/**
|
50 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
51 |
+
* @param array $settings
|
52 |
*
|
53 |
+
* @return \WBCR\Factory_Freemius_113\Premium\Provider
|
54 |
* @throws Exception
|
55 |
*/
|
56 |
+
public static function instance( Wbcr_Factory425_Plugin $plugin, array $settings ) {
|
57 |
$premium_manager = new Manager( $plugin, $settings );
|
58 |
+
|
59 |
return $premium_manager->instance_provider();
|
60 |
}
|
61 |
+
|
62 |
/**
|
63 |
* @param $provider_name
|
64 |
*
|
65 |
+
* @return \WBCR\Factory_Freemius_113\Premium\Provider
|
66 |
* @throws Exception
|
67 |
*/
|
68 |
public function instance_provider() {
|
69 |
$provider_name = $this->get_setting( 'provider' );
|
70 |
+
|
71 |
+
if ( isset( self::$providers[ $provider_name ] ) && class_exists( self::$providers[ $provider_name ] ) ) {
|
72 |
+
if ( self::$providers[ $provider_name ] instanceof Provider ) {
|
73 |
+
throw new Exception( "Provider {$provider_name} must extend the class WBCR\Factory_425\Premium\Provider interface!" );
|
74 |
+
}
|
75 |
+
|
76 |
+
return new self::$providers[ $provider_name ]( $this->plugin, $this->settings );
|
|
|
|
|
77 |
}
|
78 |
+
|
79 |
throw new Exception( "Provider {$provider_name} is not supported!" );
|
80 |
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @param string $name
|
84 |
+
*
|
85 |
+
* @return mixed
|
86 |
+
*/
|
87 |
protected function get_setting( $name ) {
|
88 |
return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : null;
|
89 |
}
|
libs/factory/core/includes/premium/class-factory-provider-abstract.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use Exception;
|
6 |
-
use
|
7 |
|
8 |
// Exit if accessed directly
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -13,52 +13,50 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
13 |
/**
|
14 |
* Выполняет проверку обновлений, обновления, скачивание плагинов
|
15 |
*
|
16 |
-
* @author
|
17 |
-
* @
|
18 |
-
*
|
19 |
-
* @version
|
20 |
*/
|
21 |
abstract class Provider {
|
22 |
-
|
23 |
/**
|
24 |
-
* @var
|
25 |
*/
|
26 |
protected $plugin;
|
27 |
-
|
28 |
/**
|
29 |
* @var array
|
30 |
*/
|
31 |
protected $settings;
|
32 |
-
|
33 |
/**
|
34 |
* @var bool
|
35 |
*/
|
36 |
private $is_install_package;
|
37 |
-
|
38 |
/**
|
39 |
* Provider constructor.
|
40 |
*
|
41 |
-
* @param
|
42 |
-
* @param array
|
43 |
*/
|
44 |
-
public function __construct(
|
45 |
$this->plugin = $plugin;
|
46 |
$this->settings = $settings;
|
47 |
-
|
48 |
-
|
49 |
-
add_action( 'wbcr/factory/license_deactivate', array( $this, 'register_cron_hooks' ), 10, 2 );
|
50 |
-
add_action( "{$this->plugin->getPluginName()}_license_autosync", array( $this, 'license_cron_sync' ) );
|
51 |
}
|
52 |
-
|
53 |
/**
|
54 |
* @return array
|
55 |
*/
|
56 |
public function get_settings() {
|
57 |
return $this->settings;
|
58 |
}
|
59 |
-
|
60 |
/**
|
61 |
-
* @param
|
62 |
* @param bool $default
|
63 |
*
|
64 |
* @return bool|mixed
|
@@ -66,46 +64,14 @@ abstract class Provider {
|
|
66 |
public function get_setting( $name, $default = false ) {
|
67 |
return isset( $this->settings[ $name ] ) && ! empty( $this->settings[ $name ] ) ? $this->settings[ $name ] : $default;
|
68 |
}
|
69 |
-
|
70 |
/**
|
71 |
* @return bool|mixed
|
72 |
*/
|
73 |
public function get_price() {
|
74 |
return $this->get_setting( 'price' );
|
75 |
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* todo: Вынести с лицензионный менеджер
|
79 |
-
*
|
80 |
-
* @param array $license_info
|
81 |
-
* @param string $plugin_name
|
82 |
-
*/
|
83 |
-
public function register_cron_hooks( $license_info, $plugin_name ) {
|
84 |
-
if ( $this->plugin->getPluginName() == $plugin_name ) {
|
85 |
-
if ( ! wp_next_scheduled( "{$plugin_name}_license_autosync" ) ) {
|
86 |
-
wp_schedule_event( time(), 'twicedaily', "{$plugin_name}_license_autosync" );
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* todo: вынести в лицензионный менеджер
|
93 |
-
*
|
94 |
-
* @param array $license_info
|
95 |
-
* @param string $plugin_name
|
96 |
-
*/
|
97 |
-
public function clear_cron_hooks( $license_info, $plugin_name ) {
|
98 |
-
if ( $this->plugin->getPluginName() == $plugin_name ) {
|
99 |
-
if ( wp_next_scheduled( "{$plugin_name}_license_autosync" ) ) {
|
100 |
-
wp_clear_scheduled_hook( "{$plugin_name}_license_autosync" );
|
101 |
-
}
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
public function license_cron_sync() {
|
106 |
-
$this->sync();
|
107 |
-
}
|
108 |
-
|
109 |
/**
|
110 |
* @return bool
|
111 |
*/
|
@@ -113,123 +79,156 @@ abstract class Provider {
|
|
113 |
if ( ! is_null( $this->is_install_package ) ) {
|
114 |
return $this->is_install_package;
|
115 |
}
|
116 |
-
|
117 |
$premium_package = $this->get_package_data();
|
118 |
-
|
119 |
if ( ! empty( $premium_package ) && ! empty( $premium_package['basename'] ) ) {
|
120 |
$basename_part = explode( '/', $premium_package['basename'] );
|
121 |
$is_valid_basename = sizeof( $basename_part ) === 2;
|
122 |
-
|
123 |
if ( $is_valid_basename && ! file_exists( WP_PLUGIN_DIR . '/' . $premium_package['basename'] ) ) {
|
124 |
$this->delete_package();
|
125 |
$this->is_install_package = false;
|
126 |
-
|
127 |
return false;
|
128 |
}
|
129 |
}
|
130 |
-
|
131 |
$this->is_install_package = ! empty( $premium_package );
|
132 |
-
|
133 |
return $this->is_install_package;
|
134 |
}
|
135 |
-
|
136 |
/**
|
137 |
* @return bool|mixed|null
|
138 |
*/
|
139 |
public function get_package_data() {
|
140 |
$premium_package = $this->plugin->getPopulateOption( 'premium_package' );
|
141 |
-
|
142 |
if ( ! empty( $premium_package ) ) {
|
143 |
-
return wp_parse_args( $premium_package,
|
144 |
'basename' => null,
|
145 |
'version' => null,
|
146 |
'framework_version' => null
|
147 |
-
|
148 |
}
|
149 |
-
|
150 |
return null;
|
151 |
}
|
152 |
-
|
153 |
/**
|
154 |
* @param $plugin_data
|
155 |
*
|
156 |
* @throws Exception
|
157 |
*/
|
158 |
public function update_package_data( array $package ) {
|
159 |
-
$parsed_args = wp_parse_args( $package,
|
160 |
'basename' => null,
|
161 |
'version' => null,
|
162 |
'framework_version' => null
|
163 |
-
|
164 |
-
|
165 |
if ( empty( $parsed_args['basename'] ) || empty( $parsed_args['version'] ) ) {
|
166 |
throw new Exception( 'You must pass the required attributes (basename, version).' );
|
167 |
}
|
168 |
-
|
169 |
$this->plugin->updatePopulateOption( 'premium_package', $parsed_args );
|
170 |
$this->is_install_package = true;
|
171 |
}
|
172 |
-
|
173 |
public function delete_package() {
|
174 |
$this->plugin->deletePopulateOption( 'premium_package' );
|
175 |
$this->is_install_package = false;
|
176 |
}
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
/**
|
179 |
* @return bool
|
180 |
*/
|
181 |
abstract public function is_activate();
|
182 |
-
|
183 |
/**
|
184 |
* @return bool
|
185 |
*/
|
186 |
abstract public function is_active();
|
187 |
-
|
188 |
/**
|
189 |
* @return string|null
|
190 |
*/
|
191 |
abstract public function get_plan();
|
192 |
-
|
193 |
/**
|
194 |
* @return string|null
|
195 |
*/
|
196 |
abstract public function get_billing_cycle();
|
197 |
-
|
198 |
/**
|
199 |
-
* @return \WBCR\
|
200 |
*/
|
201 |
abstract public function get_license();
|
202 |
-
|
203 |
/**
|
204 |
* @return string|null
|
205 |
*/
|
206 |
abstract public function get_package_download_url();
|
207 |
-
|
208 |
/**
|
209 |
* @param string $key
|
210 |
*
|
211 |
* @return mixed
|
212 |
*/
|
213 |
abstract public function activate( $key );
|
214 |
-
|
215 |
/**
|
216 |
* @return bool
|
217 |
*/
|
218 |
abstract public function deactivate();
|
219 |
-
|
220 |
/**
|
221 |
* @return bool
|
222 |
*/
|
223 |
abstract public function sync();
|
224 |
-
|
225 |
/**
|
226 |
* @return bool
|
227 |
*/
|
228 |
abstract public function has_paid_subscription();
|
229 |
-
|
230 |
/**
|
231 |
* @return bool
|
232 |
*/
|
233 |
abstract public function cancel_paid_subscription();
|
234 |
-
|
235 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Premium;
|
4 |
|
5 |
use Exception;
|
6 |
+
use Wbcr_Factory425_Plugin;
|
7 |
|
8 |
// Exit if accessed directly
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
13 |
/**
|
14 |
* Выполняет проверку обновлений, обновления, скачивание плагинов
|
15 |
*
|
16 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
17 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
18 |
+
*
|
19 |
+
* @version 1.0
|
20 |
*/
|
21 |
abstract class Provider {
|
22 |
+
|
23 |
/**
|
24 |
+
* @var Wbcr_Factory425_Plugin
|
25 |
*/
|
26 |
protected $plugin;
|
27 |
+
|
28 |
/**
|
29 |
* @var array
|
30 |
*/
|
31 |
protected $settings;
|
32 |
+
|
33 |
/**
|
34 |
* @var bool
|
35 |
*/
|
36 |
private $is_install_package;
|
37 |
+
|
38 |
/**
|
39 |
* Provider constructor.
|
40 |
*
|
41 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
42 |
+
* @param array $settings
|
43 |
*/
|
44 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin, array $settings ) {
|
45 |
$this->plugin = $plugin;
|
46 |
$this->settings = $settings;
|
47 |
+
|
48 |
+
$this->register_hooks();
|
|
|
|
|
49 |
}
|
50 |
+
|
51 |
/**
|
52 |
* @return array
|
53 |
*/
|
54 |
public function get_settings() {
|
55 |
return $this->settings;
|
56 |
}
|
57 |
+
|
58 |
/**
|
59 |
+
* @param $name
|
60 |
* @param bool $default
|
61 |
*
|
62 |
* @return bool|mixed
|
64 |
public function get_setting( $name, $default = false ) {
|
65 |
return isset( $this->settings[ $name ] ) && ! empty( $this->settings[ $name ] ) ? $this->settings[ $name ] : $default;
|
66 |
}
|
67 |
+
|
68 |
/**
|
69 |
* @return bool|mixed
|
70 |
*/
|
71 |
public function get_price() {
|
72 |
return $this->get_setting( 'price' );
|
73 |
}
|
74 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/**
|
76 |
* @return bool
|
77 |
*/
|
79 |
if ( ! is_null( $this->is_install_package ) ) {
|
80 |
return $this->is_install_package;
|
81 |
}
|
82 |
+
|
83 |
$premium_package = $this->get_package_data();
|
84 |
+
|
85 |
if ( ! empty( $premium_package ) && ! empty( $premium_package['basename'] ) ) {
|
86 |
$basename_part = explode( '/', $premium_package['basename'] );
|
87 |
$is_valid_basename = sizeof( $basename_part ) === 2;
|
88 |
+
|
89 |
if ( $is_valid_basename && ! file_exists( WP_PLUGIN_DIR . '/' . $premium_package['basename'] ) ) {
|
90 |
$this->delete_package();
|
91 |
$this->is_install_package = false;
|
92 |
+
|
93 |
return false;
|
94 |
}
|
95 |
}
|
96 |
+
|
97 |
$this->is_install_package = ! empty( $premium_package );
|
98 |
+
|
99 |
return $this->is_install_package;
|
100 |
}
|
101 |
+
|
102 |
/**
|
103 |
* @return bool|mixed|null
|
104 |
*/
|
105 |
public function get_package_data() {
|
106 |
$premium_package = $this->plugin->getPopulateOption( 'premium_package' );
|
107 |
+
|
108 |
if ( ! empty( $premium_package ) ) {
|
109 |
+
return wp_parse_args( $premium_package, [
|
110 |
'basename' => null,
|
111 |
'version' => null,
|
112 |
'framework_version' => null
|
113 |
+
] );
|
114 |
}
|
115 |
+
|
116 |
return null;
|
117 |
}
|
118 |
+
|
119 |
/**
|
120 |
* @param $plugin_data
|
121 |
*
|
122 |
* @throws Exception
|
123 |
*/
|
124 |
public function update_package_data( array $package ) {
|
125 |
+
$parsed_args = wp_parse_args( $package, [
|
126 |
'basename' => null,
|
127 |
'version' => null,
|
128 |
'framework_version' => null
|
129 |
+
] );
|
130 |
+
|
131 |
if ( empty( $parsed_args['basename'] ) || empty( $parsed_args['version'] ) ) {
|
132 |
throw new Exception( 'You must pass the required attributes (basename, version).' );
|
133 |
}
|
134 |
+
|
135 |
$this->plugin->updatePopulateOption( 'premium_package', $parsed_args );
|
136 |
$this->is_install_package = true;
|
137 |
}
|
138 |
+
|
139 |
public function delete_package() {
|
140 |
$this->plugin->deletePopulateOption( 'premium_package' );
|
141 |
$this->is_install_package = false;
|
142 |
}
|
143 |
+
|
144 |
+
protected function register_hooks() {
|
145 |
+
/**
|
146 |
+
* Добавляет крон задачу на синхронизацию лицензии
|
147 |
+
*
|
148 |
+
* @param array $license_info
|
149 |
+
* @param string $provider
|
150 |
+
*/
|
151 |
+
add_action( "{$this->plugin->getPluginName()}/factory/premium/license_activate", function ( $provider, $license_info ) {
|
152 |
+
if ( ! wp_next_scheduled( "{$this->plugin->getPluginName()}_license_autosync" ) ) {
|
153 |
+
wp_schedule_event( time(), 'twicedaily', "{$this->plugin->getPluginName()}_license_autosync" );
|
154 |
+
}
|
155 |
+
}, 10, 2 );
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Удаляет крон задачу на синхронизацию лицензии, когда лицензия деактивирована
|
159 |
+
*
|
160 |
+
* @param array $license_info
|
161 |
+
* @param string $provider
|
162 |
+
*/
|
163 |
+
add_action( "{$this->plugin->getPluginName()}/factory/premium/license_deactivate", function ( $provider, $license_info ) {
|
164 |
+
if ( wp_next_scheduled( "{$this->plugin->getPluginName()}_license_autosync" ) ) {
|
165 |
+
wp_clear_scheduled_hook( "{$this->plugin->getPluginName()}_license_autosync" );
|
166 |
+
}
|
167 |
+
}, 10, 2 );
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Обработчик крон задачи на синхронизацию лицензии, выполняется 2 раза в день.
|
171 |
+
*/
|
172 |
+
add_action( "{$this->plugin->getPluginName()}_license_autosync", function () {
|
173 |
+
$this->sync();
|
174 |
+
} );
|
175 |
+
}
|
176 |
+
|
177 |
/**
|
178 |
* @return bool
|
179 |
*/
|
180 |
abstract public function is_activate();
|
181 |
+
|
182 |
/**
|
183 |
* @return bool
|
184 |
*/
|
185 |
abstract public function is_active();
|
186 |
+
|
187 |
/**
|
188 |
* @return string|null
|
189 |
*/
|
190 |
abstract public function get_plan();
|
191 |
+
|
192 |
/**
|
193 |
* @return string|null
|
194 |
*/
|
195 |
abstract public function get_billing_cycle();
|
196 |
+
|
197 |
/**
|
198 |
+
* @return \WBCR\Factory_425\Premium\Interfaces\License
|
199 |
*/
|
200 |
abstract public function get_license();
|
201 |
+
|
202 |
/**
|
203 |
* @return string|null
|
204 |
*/
|
205 |
abstract public function get_package_download_url();
|
206 |
+
|
207 |
/**
|
208 |
* @param string $key
|
209 |
*
|
210 |
* @return mixed
|
211 |
*/
|
212 |
abstract public function activate( $key );
|
213 |
+
|
214 |
/**
|
215 |
* @return bool
|
216 |
*/
|
217 |
abstract public function deactivate();
|
218 |
+
|
219 |
/**
|
220 |
* @return bool
|
221 |
*/
|
222 |
abstract public function sync();
|
223 |
+
|
224 |
/**
|
225 |
* @return bool
|
226 |
*/
|
227 |
abstract public function has_paid_subscription();
|
228 |
+
|
229 |
/**
|
230 |
* @return bool
|
231 |
*/
|
232 |
abstract public function cancel_paid_subscription();
|
233 |
+
|
234 |
}
|
libs/factory/core/includes/premium/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/includes/updates/class-factory-premium-upgrader.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use Exception;
|
6 |
use Plugin_Installer_Skin;
|
7 |
use Plugin_Upgrader;
|
8 |
-
use
|
9 |
-
use
|
10 |
use WP_Filesystem_Base;
|
11 |
use WP_Upgrader;
|
12 |
use WP_Upgrader_Skin;
|
@@ -17,109 +17,114 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
-
* @author
|
21 |
-
* @
|
22 |
* @copyright (c) 2018 Webraftic Ltd
|
23 |
-
* @version
|
24 |
*/
|
25 |
class Premium_Upgrader extends Upgrader {
|
26 |
-
|
27 |
/**
|
28 |
* Тип апгрейдера, может быть default, premium
|
|
|
29 |
* @var string
|
30 |
*/
|
31 |
protected $type = 'premium';
|
32 |
-
|
33 |
/**
|
34 |
* Manager constructor.
|
35 |
*
|
36 |
-
* @param Wbcr_Factory414_Plugin $plugin
|
37 |
-
* @param $args
|
38 |
-
* @param bool $is_premium
|
39 |
-
*
|
40 |
-
* @throws Exception
|
41 |
* @since 4.1.1
|
42 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
*/
|
44 |
-
public function __construct(
|
45 |
parent::__construct( $plugin );
|
46 |
-
|
47 |
$this->plugin_basename = null;
|
48 |
$this->plugin_main_file = null;
|
49 |
$this->plugin_absolute_path = null;
|
50 |
-
|
51 |
if ( $this->plugin->premium->is_activate() && $this->plugin->premium->is_install_package() ) {
|
52 |
$premium_package = $this->plugin->premium->get_package_data();
|
53 |
-
|
54 |
if ( $premium_package ) {
|
55 |
$this->plugin_basename = $premium_package['basename'];
|
56 |
$this->plugin_main_file = WP_PLUGIN_DIR . '/' . $premium_package['basename'];
|
57 |
$this->plugin_absolute_path = dirname( WP_PLUGIN_DIR . '/' . $premium_package['basename'] );
|
58 |
}
|
59 |
}
|
60 |
-
|
61 |
if ( ! $this->repository->is_support_premium() ) {
|
62 |
$settings = $this->get_settings();
|
63 |
throw new Exception( "Repository {$settings['repository']} does not have support premium." );
|
64 |
}
|
65 |
}
|
66 |
-
|
67 |
/**
|
68 |
* @throws Exception
|
69 |
*/
|
70 |
protected function set_repository() {
|
71 |
$settings = $this->get_settings();
|
72 |
$this->repository = $this->get_repository( $settings['repository'] );
|
73 |
-
|
74 |
if ( $this->plugin->premium->is_activate() ) {
|
75 |
$this->repository->init();
|
76 |
}
|
77 |
}
|
78 |
-
|
79 |
/**
|
80 |
-
* @throws Exception
|
81 |
* @since 4.1.1
|
|
|
82 |
*/
|
83 |
protected function init_hooks() {
|
84 |
parent::init_hooks();
|
85 |
-
|
86 |
if ( $this->need_intall_or_activate_premium() || $this->need_renew_license() || $this->need_activate_license() ) {
|
87 |
// Показываем уведомление под бесплатным плагином, если требуется установить или активировать премиум пакет
|
88 |
if ( $this->need_intall_or_activate_premium() ) {
|
89 |
$free_plugin_base = $this->plugin->get_paths()->basename;
|
90 |
-
|
91 |
-
add_action( "after_plugin_row_{$free_plugin_base}",
|
92 |
}
|
93 |
-
|
94 |
// Если установлен премиум пакет, то показываем уведомление под премиум плагином.
|
95 |
if ( ( $this->need_renew_license() || $this->need_activate_license() ) && $this->plugin->premium->is_install_package() ) {
|
96 |
$package = $this->plugin->premium->get_package_data();
|
97 |
$premium_plugin_base = $package['basename'];
|
98 |
-
|
99 |
-
add_action( "after_plugin_row_{$premium_plugin_base}",
|
100 |
}
|
101 |
-
|
102 |
-
add_action( "admin_print_styles-plugins.php",
|
103 |
-
add_action( "
|
104 |
-
add_action( 'wbcr/factory/pages/impressive/print_all_notices',
|
105 |
$this,
|
106 |
'install_notice_in_plugin_interface'
|
107 |
-
|
108 |
}
|
109 |
-
|
110 |
-
add_action( 'admin_init',
|
111 |
-
|
112 |
-
add_action( 'deleted_plugin',
|
113 |
-
add_action( 'upgrader_process_complete',
|
114 |
}
|
115 |
-
|
116 |
/**
|
|
|
117 |
* @since 4.1.1
|
118 |
*/
|
119 |
public function init_admin_actions() {
|
120 |
-
|
121 |
-
|
122 |
-
|
|
|
|
|
123 |
check_admin_referer( "factory_premium_{$action}" );
|
124 |
try {
|
125 |
switch ( $action ) {
|
@@ -137,7 +142,7 @@ class Premium_Upgrader extends Upgrader {
|
|
137 |
break;
|
138 |
case 'cancel_license':
|
139 |
$this->plugin->premium->deactivate();
|
140 |
-
|
141 |
break;
|
142 |
}
|
143 |
} catch( Exception $e ) {
|
@@ -145,99 +150,100 @@ class Premium_Upgrader extends Upgrader {
|
|
145 |
}
|
146 |
}
|
147 |
}
|
148 |
-
|
149 |
/**
|
150 |
* Удаляет данные о пакете, если пользовать удалил премиум плагин
|
151 |
*
|
152 |
-
* @param $plugin_basename
|
153 |
-
* @param $success
|
154 |
-
*
|
155 |
* @since 4.1.1
|
156 |
*
|
|
|
|
|
|
|
157 |
*/
|
158 |
public function delete_plugin_hook( $plugin_basename, $success ) {
|
159 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
160 |
return;
|
161 |
}
|
162 |
-
|
163 |
$package = $this->plugin->premium->get_package_data();
|
164 |
-
|
165 |
if ( $package['basename'] == $plugin_basename && $success ) {
|
166 |
$this->plugin->premium->delete_package();
|
167 |
}
|
168 |
}
|
169 |
-
|
170 |
/**
|
171 |
* Выводит уведомление на всех страницах админ панели Wordpress
|
172 |
*
|
|
|
|
|
173 |
* @param $notices
|
174 |
*
|
175 |
* @return array
|
176 |
-
* @since 4.1.1
|
177 |
-
*
|
178 |
*/
|
179 |
public function admin_notices_hook( $notices, $plugin_name ) {
|
180 |
|
181 |
if ( $plugin_name !== $this->plugin->getPluginName() || ! current_user_can( 'update_plugins' ) ) {
|
182 |
return $notices;
|
183 |
}
|
184 |
-
|
185 |
if ( $this->need_intall_or_activate_premium() ) {
|
186 |
$notice_text = $this->get_notice_text( 'please_activate_premium' );
|
187 |
-
|
188 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
189 |
$notice_text = $this->get_notice_text( 'please_install_premium' );
|
190 |
}
|
191 |
-
|
192 |
-
$notices[] =
|
193 |
'id' => 'please_install_premium_for_' . $this->plugin->getPluginName(),
|
194 |
'type' => 'warning',
|
195 |
'dismissible' => false,
|
196 |
'dismiss_expires' => 0,
|
197 |
'text' => "<p><b>{$this->plugin->getPluginTitle()}:</b> " . $notice_text . '</p>'
|
198 |
-
|
199 |
} else if ( $this->need_activate_license() ) {
|
200 |
-
$notices[] =
|
201 |
'id' => 'need_activate_premium_for_' . $this->plugin->getPluginName(),
|
202 |
'type' => 'warning',
|
203 |
'dismissible' => false,
|
204 |
'dismiss_expires' => 0,
|
205 |
'text' => "<p><b>{$this->plugin->getPluginTitle()}:</b> " . $this->get_notice_text( 'need_activate_license' ) . '</p>'
|
206 |
-
|
207 |
} else if ( $this->need_renew_license() ) {
|
208 |
// todo: может быть перенести уведомление в премиум менеджер?
|
209 |
-
$notices[] =
|
210 |
'id' => 'license_exired_for_' . $this->plugin->getPluginName(),
|
211 |
'type' => 'warning',
|
212 |
'dismissible' => false,
|
213 |
'dismiss_expires' => 0,
|
214 |
'text' => "<p><b>{$this->plugin->getPluginTitle()}:</b> " . $this->get_notice_text( 'need_renew_license' ) . '</p>'
|
215 |
-
|
216 |
}
|
217 |
-
|
218 |
return $notices;
|
219 |
}
|
220 |
-
|
221 |
/**
|
222 |
* Выводит уведомление внутри интерфейса плагина, на всех страницах плагина.
|
223 |
*
|
224 |
-
* @param Wbcr_Factory414_Plugin $plugin
|
225 |
-
* @param Wbcr_FactoryPages414_ImpressiveThemplate $obj
|
226 |
-
*
|
227 |
-
* @return void
|
228 |
* @since 4.1.1
|
229 |
*
|
|
|
|
|
|
|
|
|
|
|
230 |
*/
|
231 |
public function install_notice_in_plugin_interface( $plugin, $obj ) {
|
232 |
if ( $plugin->getPluginName() != $this->plugin->getPluginName() ) {
|
233 |
return;
|
234 |
}
|
235 |
-
|
236 |
$notice_text = '';
|
237 |
-
|
238 |
if ( $this->need_intall_or_activate_premium() ) {
|
239 |
$notice_text = $this->get_notice_text( 'please_activate_premium' );
|
240 |
-
|
241 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
242 |
$notice_text = $this->get_notice_text( 'please_install_premium' );
|
243 |
}
|
@@ -246,34 +252,36 @@ class Premium_Upgrader extends Upgrader {
|
|
246 |
} else if ( $this->need_renew_license() ) {
|
247 |
$notice_text = $this->get_notice_text( 'need_renew_license' );
|
248 |
}
|
249 |
-
|
250 |
$obj->printWarningNotice( $notice_text );
|
251 |
}
|
252 |
-
|
253 |
/**
|
254 |
* Выводит уведомление в строке плагина (на странице плагинов),
|
255 |
* что нужно установить премиум плагин.
|
256 |
*
|
257 |
-
* @
|
258 |
-
*
|
|
|
259 |
* @param string $status
|
260 |
*
|
|
|
|
|
261 |
* @return void
|
262 |
-
* @
|
263 |
-
* @see WP_Plugins_List_Table
|
264 |
*
|
265 |
*/
|
266 |
public function notice_in_plugin_row( $plugin_file, $plugin_data, $status ) {
|
267 |
-
|
268 |
if ( ! current_user_can( 'update_plugins' ) ) {
|
269 |
return;
|
270 |
};
|
271 |
-
|
272 |
$notice_text = '';
|
273 |
-
|
274 |
if ( $this->need_intall_or_activate_premium() ) {
|
275 |
$notice_text = $this->get_notice_text( 'please_activate_premium' );
|
276 |
-
|
277 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
278 |
$notice_text = $this->get_notice_text( 'please_install_premium' );
|
279 |
}
|
@@ -282,7 +290,7 @@ class Premium_Upgrader extends Upgrader {
|
|
282 |
} else if ( $this->need_renew_license() ) {
|
283 |
$notice_text = $this->get_notice_text( 'need_renew_license' );
|
284 |
}
|
285 |
-
|
286 |
?>
|
287 |
<tr class="plugin-update-tr active update wbcr-factory-updates">
|
288 |
<td colspan="3" class="plugin-update colspanchange">
|
@@ -295,21 +303,21 @@ class Premium_Upgrader extends Upgrader {
|
|
295 |
</tr>
|
296 |
<?php
|
297 |
}
|
298 |
-
|
299 |
/**
|
300 |
* Печатает стили для уведомления о загрузке премиум версии на странице плагинов.
|
301 |
*
|
302 |
-
* @return void
|
303 |
* @since 4.1.1
|
|
|
304 |
*/
|
305 |
public function print_styles_for_plugin_row() {
|
306 |
-
|
307 |
if ( ! current_user_can( 'update_plugins' ) ) {
|
308 |
return;
|
309 |
}
|
310 |
-
|
311 |
$plugin_base = $this->plugin->get_paths()->basename;
|
312 |
-
|
313 |
if ( $this->need_intall_or_activate_premium() ) {
|
314 |
$message_background_color = '#f5e9f5';
|
315 |
$message_border_color = '#dab9da';
|
@@ -321,7 +329,7 @@ class Premium_Upgrader extends Upgrader {
|
|
321 |
$plugin_base = $package['basename'];
|
322 |
}
|
323 |
}
|
324 |
-
|
325 |
?>
|
326 |
<style>
|
327 |
tr[data-plugin="<?php echo $plugin_base; ?>"] th,
|
@@ -336,287 +344,302 @@ class Premium_Upgrader extends Upgrader {
|
|
336 |
</style>
|
337 |
<?php
|
338 |
}
|
339 |
-
|
|
|
340 |
/**
|
341 |
* Обновляет данные о премиум пакете в базе данных, после обновления плагина.
|
342 |
*
|
343 |
-
* @param WP_Upgrader $
|
344 |
-
* @param array
|
345 |
*
|
|
|
346 |
* @throws Exception
|
347 |
-
* @since 4.1.1
|
348 |
-
*
|
349 |
*/
|
350 |
-
public function upgrader_process_complete_hook( $upgrader_object, $
|
351 |
-
if ( ! empty( $
|
352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
$this->update_package_data();
|
354 |
}
|
355 |
}
|
356 |
}
|
357 |
-
|
358 |
/**
|
359 |
-
* @return array
|
360 |
* @since 4.1.1
|
|
|
361 |
*/
|
362 |
protected function get_settings() {
|
363 |
$settings = $this->plugin->getPluginInfoAttr( 'license_settings' );
|
364 |
-
|
365 |
-
$updates_settings = isset( $settings['updates_settings'] ) ? $settings['updates_settings'] :
|
366 |
-
|
367 |
if ( is_array( $settings ) ) {
|
368 |
$updates_settings['repository'] = $settings['provider'];
|
369 |
$updates_settings['slug'] = $settings['slug'];
|
370 |
}
|
371 |
-
|
372 |
-
return wp_parse_args( $updates_settings,
|
373 |
'repository' => 'wordpress',
|
374 |
'slug' => '',
|
375 |
'maybe_rollback' => false,
|
376 |
-
'rollback_settings' =>
|
377 |
'prev_stable_version' => '0.0.0'
|
378 |
-
|
379 |
-
|
380 |
}
|
381 |
-
|
382 |
/**
|
383 |
-
* @return string
|
384 |
* @since 4.1.1
|
|
|
385 |
*/
|
386 |
protected function get_plugin_version() {
|
387 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
388 |
return '0.0.0';
|
389 |
}
|
390 |
-
|
391 |
$package = $this->plugin->premium->get_package_data();
|
392 |
-
|
393 |
return $package['version'];
|
394 |
}
|
395 |
-
|
396 |
/**
|
|
|
|
|
397 |
* @param $args
|
398 |
*
|
399 |
* @return string
|
400 |
-
* @since 4.1.1
|
401 |
-
*
|
402 |
*/
|
403 |
protected function get_admin_url( $args ) {
|
404 |
$url = admin_url( 'plugins.php', $args );
|
405 |
-
|
406 |
if ( $this->plugin->isNetworkActive() ) {
|
407 |
$url = network_admin_url( 'plugins.php', $args );
|
408 |
}
|
409 |
-
|
410 |
return add_query_arg( $args, $url );
|
411 |
}
|
412 |
-
|
413 |
/**
|
|
|
|
|
414 |
* @param string $action
|
415 |
*
|
416 |
* @return string
|
417 |
-
* @since 4.1.1
|
418 |
-
*
|
419 |
*/
|
420 |
protected function get_action_url( $action ) {
|
421 |
-
$args =
|
422 |
-
|
|
|
|
|
|
|
423 |
return wp_nonce_url( $this->get_admin_url( $args ), "factory_premium_{$action}" );
|
424 |
}
|
425 |
-
|
426 |
/**
|
427 |
-
* @return string
|
428 |
* @since 4.1.1
|
|
|
429 |
*/
|
430 |
protected function get_activate_premium_url() {
|
431 |
-
$args =
|
432 |
'action' => 'activate',
|
433 |
'plugin' => $this->plugin_basename,
|
434 |
-
|
435 |
-
|
436 |
return wp_nonce_url( $this->get_admin_url( $args ), "activate-plugin_{$this->plugin_basename}" );
|
437 |
}
|
438 |
-
|
439 |
/**
|
440 |
* Нужно установить или обновить премиум?
|
441 |
*
|
442 |
-
* @return bool
|
443 |
* @since 4.1.1
|
|
|
444 |
*/
|
445 |
protected function need_intall_or_activate_premium() {
|
446 |
if ( $this->plugin->premium->is_activate() && $this->plugin->premium->is_active() ) {
|
447 |
if ( $this->plugin->premium->is_install_package() && is_plugin_active( $this->plugin_basename ) ) {
|
448 |
return false;
|
449 |
}
|
450 |
-
|
451 |
return true;
|
452 |
}
|
453 |
-
|
454 |
return false;
|
455 |
}
|
456 |
-
|
457 |
/**
|
458 |
* Требуется активировать лицензию?
|
459 |
*
|
460 |
-
* @return bool
|
461 |
* @since 4.1.1
|
|
|
462 |
*/
|
463 |
protected function need_activate_license() {
|
464 |
return ! $this->plugin->premium->is_activate() && $this->plugin->premium->is_install_package();
|
465 |
}
|
466 |
-
|
467 |
/**
|
468 |
* Нужно продлить лицензию?
|
469 |
*
|
470 |
-
* @return bool
|
471 |
* @since 4.1.1
|
|
|
472 |
*/
|
473 |
protected function need_renew_license() {
|
474 |
return $this->plugin->premium->is_activate() && ! $this->plugin->premium->is_active();
|
475 |
}
|
476 |
-
|
477 |
/**
|
478 |
-
* @throws Exception
|
479 |
* @since 4.1.1
|
|
|
480 |
*/
|
481 |
protected function install() {
|
482 |
global $wp_filesystem;
|
483 |
-
|
484 |
if ( ! current_user_can( 'install_plugins' ) ) {
|
485 |
throw new Exception( 'Sorry, you are not allowed to install plugins on this site.', 'not_allowed_install_plugin' );
|
486 |
}
|
487 |
-
|
488 |
if ( $this->plugin->premium->is_install_package() ) {
|
489 |
return;
|
490 |
}
|
491 |
-
|
492 |
if ( ! $wp_filesystem ) {
|
493 |
if ( ! function_exists( 'WP_Filesystem' ) ) {
|
494 |
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
495 |
}
|
496 |
WP_Filesystem();
|
497 |
}
|
498 |
-
|
499 |
if ( ! WP_Filesystem( false, WP_PLUGIN_DIR ) ) {
|
500 |
throw new Exception( 'You are not allowed to edt folders/files on this site', 'not_allowed_edit_filesystem' );
|
501 |
} else {
|
502 |
-
|
503 |
$download_url = $this->repository->get_download_url();
|
504 |
-
|
505 |
/**
|
506 |
-
* @param string $package Дополнительная информация о лицензии
|
507 |
-
* @param string $plugin_name Имя плагина
|
508 |
-
*
|
509 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
510 |
*/
|
511 |
do_action( 'wbcr/factory/premium/install_package', $download_url, $this->plugin->getPluginName() );
|
512 |
-
|
513 |
// If plugin is installed before we update the premium package in database.
|
514 |
// ------------------------------------------------------------------------
|
515 |
$plugins = get_plugins( $plugin_folder = '' );
|
516 |
-
|
517 |
if ( ! empty( $plugins ) ) {
|
518 |
foreach ( (array) $plugins as $plugin_base => $plugin ) {
|
519 |
$basename_parts = explode( '/', $plugin_base );
|
520 |
if ( sizeof( $basename_parts ) == 2 && $basename_parts[0] == $this->plugin_slug ) {
|
521 |
-
|
522 |
$this->plugin_basename = $plugin_base;
|
523 |
$this->plugin_main_file = WP_PLUGIN_DIR . '/' . $plugin_base;
|
524 |
$this->plugin_absolute_path = dirname( WP_PLUGIN_DIR . '/' . $plugin_base );
|
525 |
-
|
526 |
$this->update_package_data();
|
527 |
-
|
528 |
$package = $this->plugin->premium->get_package_data();
|
529 |
-
|
530 |
/**
|
531 |
-
* @param string $package Дополнительная информация о лицензии
|
532 |
-
* @param string $plugin_name Имя плагина
|
533 |
-
*
|
534 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
535 |
*/
|
536 |
do_action( 'wbcr/factory/premium/installed_package', $package, $this->plugin->getPluginName() );
|
537 |
-
|
538 |
return;
|
539 |
}
|
540 |
}
|
541 |
}
|
542 |
// ------------------------------------------------------------------------
|
543 |
-
|
544 |
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
545 |
require_once( ABSPATH . 'wp-admin/includes/misc.php' );
|
546 |
-
|
547 |
if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
|
548 |
// Include required resources for the installation.
|
549 |
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
550 |
}
|
551 |
-
|
552 |
-
$skin_args =
|
553 |
'type' => 'web',
|
554 |
'title' => sprintf( 'Installing plugin: %s', $this->plugin->getPluginTitle() . ' Premium' ),
|
555 |
'url' => esc_url_raw( $download_url ),
|
556 |
'nonce' => 'install-plugin_' . $this->plugin_slug,
|
557 |
'plugin' => '',
|
558 |
'api' => null,
|
559 |
-
'extra' =>
|
560 |
'slug' => $this->plugin_slug
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
565 |
-
|
566 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
567 |
$skin = new Plugin_Installer_Skin( $skin_args );
|
568 |
} else {
|
569 |
$skin = new WP_Upgrader_Skin( $skin_args );
|
570 |
}
|
571 |
-
|
572 |
$upgrader = new Plugin_Upgrader( $skin );
|
573 |
-
|
574 |
if ( empty( $download_url ) ) {
|
575 |
throw new Exception( 'You must pass the download url to upgrade up premium package.', "not_passed_download_url" );
|
576 |
}
|
577 |
-
|
578 |
$install_result = $upgrader->install( $download_url );
|
579 |
-
|
580 |
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
581 |
-
|
582 |
if ( is_wp_error( $install_result ) ) {
|
583 |
throw new Exception( $install_result->get_error_message(), $install_result->get_error_code() );
|
584 |
-
}
|
585 |
throw new Exception( $skin->result->get_error_message(), $skin->result->get_error_code() );
|
586 |
-
}
|
587 |
global $wp_filesystem;
|
588 |
-
|
589 |
$error_code = 'unable_to_connect_to_filesystem';
|
590 |
$error_message = 'Unable to connect to the filesystem. Please confirm your credentials.';
|
591 |
-
|
592 |
// Pass through the error from WP_Filesystem if one was raised.
|
593 |
if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
|
594 |
$error_message = $wp_filesystem->errors->get_error_message();
|
595 |
}
|
596 |
-
|
597 |
throw new Exception( $error_message, $error_code );
|
598 |
}
|
599 |
-
|
600 |
$this->plugin_basename = $upgrader->plugin_info();
|
601 |
$this->plugin_main_file = WP_PLUGIN_DIR . '/' . $this->plugin_basename;
|
602 |
$this->plugin_absolute_path = dirname( WP_PLUGIN_DIR . '/' . $this->plugin_basename );
|
603 |
-
|
604 |
$this->update_package_data();
|
605 |
-
|
606 |
$package = $this->plugin->premium->get_package_data();
|
607 |
-
|
608 |
/**
|
609 |
-
* @param string $package Дополнительная информация о лицензии
|
610 |
-
* @param string $plugin_name Имя плагина
|
611 |
-
*
|
612 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
613 |
*/
|
614 |
do_action( 'wbcr/factory/premium/installed_package', $package, $this->plugin->getPluginName() );
|
615 |
-
|
616 |
die();
|
617 |
}
|
618 |
}
|
619 |
-
|
620 |
/**
|
621 |
* @return bool
|
622 |
* @throws Exception
|
@@ -625,17 +648,18 @@ class Premium_Upgrader extends Upgrader {
|
|
625 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
626 |
return false;
|
627 |
}
|
628 |
-
|
629 |
$package = $this->plugin->premium->get_package_data();
|
630 |
-
|
631 |
/**
|
632 |
-
* @param string $package Дополнительная информация о лицензии
|
633 |
-
* @param string $plugin_name Имя плагина
|
634 |
-
*
|
635 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
636 |
*/
|
637 |
do_action( 'wbcr/factory/premium/delete_package', $package, $this->plugin->getPluginName() );
|
638 |
-
|
639 |
if ( is_plugin_active( $package['basename'] ) ) {
|
640 |
if ( is_multisite() && is_plugin_active_for_network( $package['basename'] ) ) {
|
641 |
deactivate_plugins( $package['basename'], false, true );
|
@@ -643,122 +667,126 @@ class Premium_Upgrader extends Upgrader {
|
|
643 |
deactivate_plugins( $package['basename'] );
|
644 |
}
|
645 |
}
|
646 |
-
|
647 |
-
$result = delete_plugins(
|
648 |
-
|
649 |
if ( is_wp_error( $result ) ) {
|
650 |
throw new Exception( $result->get_error_message(), $result->get_error_code() );
|
651 |
}
|
652 |
-
|
653 |
$this->plugin->premium->delete_package();
|
654 |
-
|
655 |
/**
|
656 |
-
* @param string $package Дополнительная информация о лицензии
|
657 |
-
* @param string $plugin_name Имя плагина
|
658 |
-
*
|
659 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
660 |
*/
|
661 |
do_action( 'wbcr/factory/premium/deleted_package', $package, $this->plugin->getPluginName() );
|
662 |
-
|
663 |
return true;
|
664 |
}
|
665 |
-
|
666 |
/**
|
667 |
-
* @return bool
|
668 |
* @since 4.1.1
|
|
|
669 |
*/
|
670 |
protected function deactivate() {
|
671 |
if ( ! $this->plugin->premium->is_install_package() || ! is_plugin_active( $this->plugin_basename ) ) {
|
672 |
return false;
|
673 |
}
|
674 |
-
|
675 |
$package = $this->plugin->premium->get_package_data();
|
676 |
-
|
677 |
/**
|
678 |
-
* @param string $package Дополнительная информация о лицензии
|
679 |
-
* @param string $plugin_name Имя плагина
|
680 |
-
*
|
681 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
682 |
*/
|
683 |
do_action( 'wbcr/factory/premium/deactivate_package', $package, $this->plugin->getPluginName() );
|
684 |
-
|
685 |
if ( is_multisite() && is_plugin_active_for_network( $this->plugin_basename ) ) {
|
686 |
deactivate_plugins( $this->plugin_basename, false, true );
|
687 |
} else {
|
688 |
deactivate_plugins( $this->plugin_basename );
|
689 |
}
|
690 |
-
|
691 |
/**
|
692 |
-
* @param string $package Дополнительная информация о лицензии
|
693 |
-
* @param string $plugin_name Имя плагина
|
694 |
-
*
|
695 |
* @since 4.1.1
|
|
|
|
|
|
|
|
|
696 |
*/
|
697 |
do_action( 'wbcr/factory/premium/deactivated_package', $package, $this->plugin->getPluginName() );
|
698 |
-
|
699 |
return true;
|
700 |
}
|
701 |
-
|
702 |
/**
|
|
|
|
|
703 |
* @param array $plugin_data
|
704 |
*
|
705 |
* @throws Exception
|
706 |
-
* @since 4.1.1
|
707 |
-
*
|
708 |
*/
|
709 |
protected function update_package_data() {
|
710 |
-
|
711 |
if ( ! $this->plugin_main_file ) {
|
712 |
return;
|
713 |
}
|
714 |
-
|
715 |
-
$default_headers =
|
716 |
'Version' => 'Version',
|
717 |
'FrameworkVersion' => 'Framework Version'
|
718 |
-
|
719 |
-
|
720 |
$plugin_data = get_file_data( $this->plugin_main_file, $default_headers, 'plugin' );
|
721 |
-
|
722 |
-
$this->plugin->premium->update_package_data(
|
723 |
'basename' => $this->plugin_basename,
|
724 |
'version' => $plugin_data['Version'],
|
725 |
'framework_version' => isset( $plugin_data['FrameworkVersion'] ) ? $plugin_data['FrameworkVersion'] : null,
|
726 |
-
|
727 |
}
|
728 |
-
|
729 |
/**
|
|
|
|
|
730 |
* @param string $type
|
731 |
*
|
732 |
* @return string|null
|
733 |
-
* @since 4.1.1
|
734 |
-
*
|
735 |
*/
|
736 |
private function get_notice_text( $type ) {
|
737 |
$upgrade_url = $this->get_action_url( 'install' );
|
738 |
$activate_plugin_url = $this->get_activate_premium_url();
|
739 |
$cancel_license_url = $this->get_action_url( 'cancel_license' );
|
740 |
-
|
741 |
-
$texts =
|
742 |
-
'need_activate_license' => __( 'License activation required. A license is required to get premium plugin updates, as well as to get additional services.', '
|
743 |
-
'need_renew_license' => __( 'Your license has expired. You can no longer get premium plugin updates, premium support and your access to Webcraftic services has been suspended.', '
|
744 |
'please_install_premium' => sprintf( __( 'Congratulations, you have activated a premium license! Please install premium add-on to use pro features now.
|
745 |
-
<a href="%s">Install</a> premium add-on or <a href="%s">cancel</a> license.', '
|
746 |
'please_activate_premium' => sprintf( __( 'Congratulations, you have activated a premium license! Please activate premium add-on to use pro features now.
|
747 |
-
<a href="%s">Activate</a> premium add-on or <a href="%s">cancel</a> license.', '
|
748 |
-
|
749 |
-
|
750 |
if ( isset( $texts[ $type ] ) ) {
|
751 |
-
|
752 |
/**
|
753 |
-
* @
|
|
|
754 |
* @param string $type
|
755 |
* @param string $plugin_name
|
756 |
*
|
757 |
-
* @
|
758 |
*/
|
759 |
return apply_filters( 'wbcr/factory/premium/notice_text', $texts[ $type ], $type, $this->plugin->getPluginName() );
|
760 |
}
|
761 |
-
|
762 |
return null;
|
763 |
}
|
764 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Updates;
|
4 |
|
5 |
use Exception;
|
6 |
use Plugin_Installer_Skin;
|
7 |
use Plugin_Upgrader;
|
8 |
+
use Wbcr_Factory425_Plugin;
|
9 |
+
use Wbcr_FactoryPages425_ImpressiveThemplate;
|
10 |
use WP_Filesystem_Base;
|
11 |
use WP_Upgrader;
|
12 |
use WP_Upgrader_Skin;
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
21 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
22 |
* @copyright (c) 2018 Webraftic Ltd
|
23 |
+
* @version 1.0
|
24 |
*/
|
25 |
class Premium_Upgrader extends Upgrader {
|
26 |
+
|
27 |
/**
|
28 |
* Тип апгрейдера, может быть default, premium
|
29 |
+
*
|
30 |
* @var string
|
31 |
*/
|
32 |
protected $type = 'premium';
|
33 |
+
|
34 |
/**
|
35 |
* Manager constructor.
|
36 |
*
|
|
|
|
|
|
|
|
|
|
|
37 |
* @since 4.1.1
|
38 |
*
|
39 |
+
* @param $args
|
40 |
+
* @param bool $is_premium
|
41 |
+
*
|
42 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
43 |
+
*
|
44 |
+
* @throws Exception
|
45 |
*/
|
46 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
47 |
parent::__construct( $plugin );
|
48 |
+
|
49 |
$this->plugin_basename = null;
|
50 |
$this->plugin_main_file = null;
|
51 |
$this->plugin_absolute_path = null;
|
52 |
+
|
53 |
if ( $this->plugin->premium->is_activate() && $this->plugin->premium->is_install_package() ) {
|
54 |
$premium_package = $this->plugin->premium->get_package_data();
|
55 |
+
|
56 |
if ( $premium_package ) {
|
57 |
$this->plugin_basename = $premium_package['basename'];
|
58 |
$this->plugin_main_file = WP_PLUGIN_DIR . '/' . $premium_package['basename'];
|
59 |
$this->plugin_absolute_path = dirname( WP_PLUGIN_DIR . '/' . $premium_package['basename'] );
|
60 |
}
|
61 |
}
|
62 |
+
|
63 |
if ( ! $this->repository->is_support_premium() ) {
|
64 |
$settings = $this->get_settings();
|
65 |
throw new Exception( "Repository {$settings['repository']} does not have support premium." );
|
66 |
}
|
67 |
}
|
68 |
+
|
69 |
/**
|
70 |
* @throws Exception
|
71 |
*/
|
72 |
protected function set_repository() {
|
73 |
$settings = $this->get_settings();
|
74 |
$this->repository = $this->get_repository( $settings['repository'] );
|
75 |
+
|
76 |
if ( $this->plugin->premium->is_activate() ) {
|
77 |
$this->repository->init();
|
78 |
}
|
79 |
}
|
80 |
+
|
81 |
/**
|
|
|
82 |
* @since 4.1.1
|
83 |
+
* @throws Exception
|
84 |
*/
|
85 |
protected function init_hooks() {
|
86 |
parent::init_hooks();
|
87 |
+
|
88 |
if ( $this->need_intall_or_activate_premium() || $this->need_renew_license() || $this->need_activate_license() ) {
|
89 |
// Показываем уведомление под бесплатным плагином, если требуется установить или активировать премиум пакет
|
90 |
if ( $this->need_intall_or_activate_premium() ) {
|
91 |
$free_plugin_base = $this->plugin->get_paths()->basename;
|
92 |
+
|
93 |
+
add_action( "after_plugin_row_{$free_plugin_base}", [ $this, "notice_in_plugin_row" ], 100, 3 );
|
94 |
}
|
95 |
+
|
96 |
// Если установлен премиум пакет, то показываем уведомление под премиум плагином.
|
97 |
if ( ( $this->need_renew_license() || $this->need_activate_license() ) && $this->plugin->premium->is_install_package() ) {
|
98 |
$package = $this->plugin->premium->get_package_data();
|
99 |
$premium_plugin_base = $package['basename'];
|
100 |
+
|
101 |
+
add_action( "after_plugin_row_{$premium_plugin_base}", [ $this, "notice_in_plugin_row" ], 100, 3 );
|
102 |
}
|
103 |
+
|
104 |
+
add_action( "admin_print_styles-plugins.php", [ $this, "print_styles_for_plugin_row" ] );
|
105 |
+
add_action( "wbcr/factory/admin_notices", [ $this, "admin_notices_hook" ], 10, 2 );
|
106 |
+
add_action( 'wbcr/factory/pages/impressive/print_all_notices', [
|
107 |
$this,
|
108 |
'install_notice_in_plugin_interface'
|
109 |
+
], 10, 2 );
|
110 |
}
|
111 |
+
|
112 |
+
add_action( 'admin_init', [ $this, 'init_admin_actions' ] );
|
113 |
+
|
114 |
+
add_action( 'deleted_plugin', [ $this, 'delete_plugin_hook' ], 10, 2 );
|
115 |
+
add_action( 'upgrader_process_complete', [ $this, 'upgrader_process_complete_hook' ], 10, 2 );
|
116 |
}
|
117 |
+
|
118 |
/**
|
119 |
+
* @since 4.2.2 Fixed bug with plugins namespace (ISW-4)
|
120 |
* @since 4.1.1
|
121 |
*/
|
122 |
public function init_admin_actions() {
|
123 |
+
$plugin_slug = $this->plugin->request->get( 'wfactory_premium_updates_plugin', null );
|
124 |
+
|
125 |
+
if ( isset( $_GET['wfactory_premium_updates_action'] ) && $this->plugin_slug === $plugin_slug ) {
|
126 |
+
$action = $this->plugin->request->get( 'wfactory_premium_updates_action' );
|
127 |
+
|
128 |
check_admin_referer( "factory_premium_{$action}" );
|
129 |
try {
|
130 |
switch ( $action ) {
|
142 |
break;
|
143 |
case 'cancel_license':
|
144 |
$this->plugin->premium->deactivate();
|
145 |
+
|
146 |
break;
|
147 |
}
|
148 |
} catch( Exception $e ) {
|
150 |
}
|
151 |
}
|
152 |
}
|
153 |
+
|
154 |
/**
|
155 |
* Удаляет данные о пакете, если пользовать удалил премиум плагин
|
156 |
*
|
|
|
|
|
|
|
157 |
* @since 4.1.1
|
158 |
*
|
159 |
+
* @param $success
|
160 |
+
*
|
161 |
+
* @param $plugin_basename
|
162 |
*/
|
163 |
public function delete_plugin_hook( $plugin_basename, $success ) {
|
164 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
165 |
return;
|
166 |
}
|
167 |
+
|
168 |
$package = $this->plugin->premium->get_package_data();
|
169 |
+
|
170 |
if ( $package['basename'] == $plugin_basename && $success ) {
|
171 |
$this->plugin->premium->delete_package();
|
172 |
}
|
173 |
}
|
174 |
+
|
175 |
/**
|
176 |
* Выводит уведомление на всех страницах админ панели Wordpress
|
177 |
*
|
178 |
+
* @since 4.1.1
|
179 |
+
*
|
180 |
* @param $notices
|
181 |
*
|
182 |
* @return array
|
|
|
|
|
183 |
*/
|
184 |
public function admin_notices_hook( $notices, $plugin_name ) {
|
185 |
|
186 |
if ( $plugin_name !== $this->plugin->getPluginName() || ! current_user_can( 'update_plugins' ) ) {
|
187 |
return $notices;
|
188 |
}
|
189 |
+
|
190 |
if ( $this->need_intall_or_activate_premium() ) {
|
191 |
$notice_text = $this->get_notice_text( 'please_activate_premium' );
|
192 |
+
|
193 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
194 |
$notice_text = $this->get_notice_text( 'please_install_premium' );
|
195 |
}
|
196 |
+
|
197 |
+
$notices[] = [
|
198 |
'id' => 'please_install_premium_for_' . $this->plugin->getPluginName(),
|
199 |
'type' => 'warning',
|
200 |
'dismissible' => false,
|
201 |
'dismiss_expires' => 0,
|
202 |
'text' => "<p><b>{$this->plugin->getPluginTitle()}:</b> " . $notice_text . '</p>'
|
203 |
+
];
|
204 |
} else if ( $this->need_activate_license() ) {
|
205 |
+
$notices[] = [
|
206 |
'id' => 'need_activate_premium_for_' . $this->plugin->getPluginName(),
|
207 |
'type' => 'warning',
|
208 |
'dismissible' => false,
|
209 |
'dismiss_expires' => 0,
|
210 |
'text' => "<p><b>{$this->plugin->getPluginTitle()}:</b> " . $this->get_notice_text( 'need_activate_license' ) . '</p>'
|
211 |
+
];
|
212 |
} else if ( $this->need_renew_license() ) {
|
213 |
// todo: может быть перенести уведомление в премиум менеджер?
|
214 |
+
$notices[] = [
|
215 |
'id' => 'license_exired_for_' . $this->plugin->getPluginName(),
|
216 |
'type' => 'warning',
|
217 |
'dismissible' => false,
|
218 |
'dismiss_expires' => 0,
|
219 |
'text' => "<p><b>{$this->plugin->getPluginTitle()}:</b> " . $this->get_notice_text( 'need_renew_license' ) . '</p>'
|
220 |
+
];
|
221 |
}
|
222 |
+
|
223 |
return $notices;
|
224 |
}
|
225 |
+
|
226 |
/**
|
227 |
* Выводит уведомление внутри интерфейса плагина, на всех страницах плагина.
|
228 |
*
|
|
|
|
|
|
|
|
|
229 |
* @since 4.1.1
|
230 |
*
|
231 |
+
* @param Wbcr_FactoryPages425_ImpressiveThemplate $obj
|
232 |
+
*
|
233 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
234 |
+
*
|
235 |
+
* @return void
|
236 |
*/
|
237 |
public function install_notice_in_plugin_interface( $plugin, $obj ) {
|
238 |
if ( $plugin->getPluginName() != $this->plugin->getPluginName() ) {
|
239 |
return;
|
240 |
}
|
241 |
+
|
242 |
$notice_text = '';
|
243 |
+
|
244 |
if ( $this->need_intall_or_activate_premium() ) {
|
245 |
$notice_text = $this->get_notice_text( 'please_activate_premium' );
|
246 |
+
|
247 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
248 |
$notice_text = $this->get_notice_text( 'please_install_premium' );
|
249 |
}
|
252 |
} else if ( $this->need_renew_license() ) {
|
253 |
$notice_text = $this->get_notice_text( 'need_renew_license' );
|
254 |
}
|
255 |
+
|
256 |
$obj->printWarningNotice( $notice_text );
|
257 |
}
|
258 |
+
|
259 |
/**
|
260 |
* Выводит уведомление в строке плагина (на странице плагинов),
|
261 |
* что нужно установить премиум плагин.
|
262 |
*
|
263 |
+
* @since 4.1.1
|
264 |
+
*
|
265 |
+
* @param array $plugin_data
|
266 |
* @param string $status
|
267 |
*
|
268 |
+
* @param string $plugin_file
|
269 |
+
*
|
270 |
* @return void
|
271 |
+
* @see WP_Plugins_List_Table
|
|
|
272 |
*
|
273 |
*/
|
274 |
public function notice_in_plugin_row( $plugin_file, $plugin_data, $status ) {
|
275 |
+
|
276 |
if ( ! current_user_can( 'update_plugins' ) ) {
|
277 |
return;
|
278 |
};
|
279 |
+
|
280 |
$notice_text = '';
|
281 |
+
|
282 |
if ( $this->need_intall_or_activate_premium() ) {
|
283 |
$notice_text = $this->get_notice_text( 'please_activate_premium' );
|
284 |
+
|
285 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
286 |
$notice_text = $this->get_notice_text( 'please_install_premium' );
|
287 |
}
|
290 |
} else if ( $this->need_renew_license() ) {
|
291 |
$notice_text = $this->get_notice_text( 'need_renew_license' );
|
292 |
}
|
293 |
+
|
294 |
?>
|
295 |
<tr class="plugin-update-tr active update wbcr-factory-updates">
|
296 |
<td colspan="3" class="plugin-update colspanchange">
|
303 |
</tr>
|
304 |
<?php
|
305 |
}
|
306 |
+
|
307 |
/**
|
308 |
* Печатает стили для уведомления о загрузке премиум версии на странице плагинов.
|
309 |
*
|
|
|
310 |
* @since 4.1.1
|
311 |
+
* @return void
|
312 |
*/
|
313 |
public function print_styles_for_plugin_row() {
|
314 |
+
|
315 |
if ( ! current_user_can( 'update_plugins' ) ) {
|
316 |
return;
|
317 |
}
|
318 |
+
|
319 |
$plugin_base = $this->plugin->get_paths()->basename;
|
320 |
+
|
321 |
if ( $this->need_intall_or_activate_premium() ) {
|
322 |
$message_background_color = '#f5e9f5';
|
323 |
$message_border_color = '#dab9da';
|
329 |
$plugin_base = $package['basename'];
|
330 |
}
|
331 |
}
|
332 |
+
|
333 |
?>
|
334 |
<style>
|
335 |
tr[data-plugin="<?php echo $plugin_base; ?>"] th,
|
344 |
</style>
|
345 |
<?php
|
346 |
}
|
347 |
+
|
348 |
+
|
349 |
/**
|
350 |
* Обновляет данные о премиум пакете в базе данных, после обновления плагина.
|
351 |
*
|
352 |
+
* @param WP_Upgrader $wp_upgrader WP_Upgrader instance.
|
353 |
+
* @param array $hook_extra Array of bulk item update data.
|
354 |
*
|
355 |
+
* @return void
|
356 |
* @throws Exception
|
|
|
|
|
357 |
*/
|
358 |
+
public function upgrader_process_complete_hook( $upgrader_object, $hook_extra ) {
|
359 |
+
if ( ! empty( $hook_extra ) && $hook_extra['action'] == 'update' && $hook_extra['type'] == 'plugin' ) {
|
360 |
+
|
361 |
+
# if it isn't bulk upgrade
|
362 |
+
if ( isset( $hook_extra['plugin'] ) && $this->plugin_basename === $hook_extra['plugin'] ) {
|
363 |
+
$this->update_package_data();
|
364 |
+
|
365 |
+
return;
|
366 |
+
}
|
367 |
+
|
368 |
+
# if it is bulk upgrade
|
369 |
+
if ( is_array( $hook_extra['plugins'] ) && in_array( $this->plugin_basename, $hook_extra['plugins'] ) ) {
|
370 |
$this->update_package_data();
|
371 |
}
|
372 |
}
|
373 |
}
|
374 |
+
|
375 |
/**
|
|
|
376 |
* @since 4.1.1
|
377 |
+
* @return array
|
378 |
*/
|
379 |
protected function get_settings() {
|
380 |
$settings = $this->plugin->getPluginInfoAttr( 'license_settings' );
|
381 |
+
|
382 |
+
$updates_settings = isset( $settings['updates_settings'] ) ? $settings['updates_settings'] : [];
|
383 |
+
|
384 |
if ( is_array( $settings ) ) {
|
385 |
$updates_settings['repository'] = $settings['provider'];
|
386 |
$updates_settings['slug'] = $settings['slug'];
|
387 |
}
|
388 |
+
|
389 |
+
return wp_parse_args( $updates_settings, [
|
390 |
'repository' => 'wordpress',
|
391 |
'slug' => '',
|
392 |
'maybe_rollback' => false,
|
393 |
+
'rollback_settings' => [
|
394 |
'prev_stable_version' => '0.0.0'
|
395 |
+
]
|
396 |
+
] );
|
397 |
}
|
398 |
+
|
399 |
/**
|
|
|
400 |
* @since 4.1.1
|
401 |
+
* @return string
|
402 |
*/
|
403 |
protected function get_plugin_version() {
|
404 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
405 |
return '0.0.0';
|
406 |
}
|
407 |
+
|
408 |
$package = $this->plugin->premium->get_package_data();
|
409 |
+
|
410 |
return $package['version'];
|
411 |
}
|
412 |
+
|
413 |
/**
|
414 |
+
* @since 4.1.1
|
415 |
+
*
|
416 |
* @param $args
|
417 |
*
|
418 |
* @return string
|
|
|
|
|
419 |
*/
|
420 |
protected function get_admin_url( $args ) {
|
421 |
$url = admin_url( 'plugins.php', $args );
|
422 |
+
|
423 |
if ( $this->plugin->isNetworkActive() ) {
|
424 |
$url = network_admin_url( 'plugins.php', $args );
|
425 |
}
|
426 |
+
|
427 |
return add_query_arg( $args, $url );
|
428 |
}
|
429 |
+
|
430 |
/**
|
431 |
+
* @since 4.1.1
|
432 |
+
*
|
433 |
* @param string $action
|
434 |
*
|
435 |
* @return string
|
|
|
|
|
436 |
*/
|
437 |
protected function get_action_url( $action ) {
|
438 |
+
$args = [
|
439 |
+
'wfactory_premium_updates_action' => $action,
|
440 |
+
'wfactory_premium_updates_plugin' => $this->plugin_slug
|
441 |
+
];
|
442 |
+
|
443 |
return wp_nonce_url( $this->get_admin_url( $args ), "factory_premium_{$action}" );
|
444 |
}
|
445 |
+
|
446 |
/**
|
|
|
447 |
* @since 4.1.1
|
448 |
+
* @return string
|
449 |
*/
|
450 |
protected function get_activate_premium_url() {
|
451 |
+
$args = [
|
452 |
'action' => 'activate',
|
453 |
'plugin' => $this->plugin_basename,
|
454 |
+
];
|
455 |
+
|
456 |
return wp_nonce_url( $this->get_admin_url( $args ), "activate-plugin_{$this->plugin_basename}" );
|
457 |
}
|
458 |
+
|
459 |
/**
|
460 |
* Нужно установить или обновить премиум?
|
461 |
*
|
|
|
462 |
* @since 4.1.1
|
463 |
+
* @return bool
|
464 |
*/
|
465 |
protected function need_intall_or_activate_premium() {
|
466 |
if ( $this->plugin->premium->is_activate() && $this->plugin->premium->is_active() ) {
|
467 |
if ( $this->plugin->premium->is_install_package() && is_plugin_active( $this->plugin_basename ) ) {
|
468 |
return false;
|
469 |
}
|
470 |
+
|
471 |
return true;
|
472 |
}
|
473 |
+
|
474 |
return false;
|
475 |
}
|
476 |
+
|
477 |
/**
|
478 |
* Требуется активировать лицензию?
|
479 |
*
|
|
|
480 |
* @since 4.1.1
|
481 |
+
* @return bool
|
482 |
*/
|
483 |
protected function need_activate_license() {
|
484 |
return ! $this->plugin->premium->is_activate() && $this->plugin->premium->is_install_package();
|
485 |
}
|
486 |
+
|
487 |
/**
|
488 |
* Нужно продлить лицензию?
|
489 |
*
|
|
|
490 |
* @since 4.1.1
|
491 |
+
* @return bool
|
492 |
*/
|
493 |
protected function need_renew_license() {
|
494 |
return $this->plugin->premium->is_activate() && ! $this->plugin->premium->is_active();
|
495 |
}
|
496 |
+
|
497 |
/**
|
|
|
498 |
* @since 4.1.1
|
499 |
+
* @throws Exception
|
500 |
*/
|
501 |
protected function install() {
|
502 |
global $wp_filesystem;
|
503 |
+
|
504 |
if ( ! current_user_can( 'install_plugins' ) ) {
|
505 |
throw new Exception( 'Sorry, you are not allowed to install plugins on this site.', 'not_allowed_install_plugin' );
|
506 |
}
|
507 |
+
|
508 |
if ( $this->plugin->premium->is_install_package() ) {
|
509 |
return;
|
510 |
}
|
511 |
+
|
512 |
if ( ! $wp_filesystem ) {
|
513 |
if ( ! function_exists( 'WP_Filesystem' ) ) {
|
514 |
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
515 |
}
|
516 |
WP_Filesystem();
|
517 |
}
|
518 |
+
|
519 |
if ( ! WP_Filesystem( false, WP_PLUGIN_DIR ) ) {
|
520 |
throw new Exception( 'You are not allowed to edt folders/files on this site', 'not_allowed_edit_filesystem' );
|
521 |
} else {
|
522 |
+
|
523 |
$download_url = $this->repository->get_download_url();
|
524 |
+
|
525 |
/**
|
|
|
|
|
|
|
526 |
* @since 4.1.1
|
527 |
+
*
|
528 |
+
* @param string $plugin_name Имя плагина
|
529 |
+
*
|
530 |
+
* @param string $package Дополнительная информация о лицензии
|
531 |
*/
|
532 |
do_action( 'wbcr/factory/premium/install_package', $download_url, $this->plugin->getPluginName() );
|
533 |
+
|
534 |
// If plugin is installed before we update the premium package in database.
|
535 |
// ------------------------------------------------------------------------
|
536 |
$plugins = get_plugins( $plugin_folder = '' );
|
537 |
+
|
538 |
if ( ! empty( $plugins ) ) {
|
539 |
foreach ( (array) $plugins as $plugin_base => $plugin ) {
|
540 |
$basename_parts = explode( '/', $plugin_base );
|
541 |
if ( sizeof( $basename_parts ) == 2 && $basename_parts[0] == $this->plugin_slug ) {
|
542 |
+
|
543 |
$this->plugin_basename = $plugin_base;
|
544 |
$this->plugin_main_file = WP_PLUGIN_DIR . '/' . $plugin_base;
|
545 |
$this->plugin_absolute_path = dirname( WP_PLUGIN_DIR . '/' . $plugin_base );
|
546 |
+
|
547 |
$this->update_package_data();
|
548 |
+
|
549 |
$package = $this->plugin->premium->get_package_data();
|
550 |
+
|
551 |
/**
|
|
|
|
|
|
|
552 |
* @since 4.1.1
|
553 |
+
*
|
554 |
+
* @param string $plugin_name Имя плагина
|
555 |
+
*
|
556 |
+
* @param string $package Дополнительная информация о лицензии
|
557 |
*/
|
558 |
do_action( 'wbcr/factory/premium/installed_package', $package, $this->plugin->getPluginName() );
|
559 |
+
|
560 |
return;
|
561 |
}
|
562 |
}
|
563 |
}
|
564 |
// ------------------------------------------------------------------------
|
565 |
+
|
566 |
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
567 |
require_once( ABSPATH . 'wp-admin/includes/misc.php' );
|
568 |
+
|
569 |
if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
|
570 |
// Include required resources for the installation.
|
571 |
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
572 |
}
|
573 |
+
|
574 |
+
$skin_args = [
|
575 |
'type' => 'web',
|
576 |
'title' => sprintf( 'Installing plugin: %s', $this->plugin->getPluginTitle() . ' Premium' ),
|
577 |
'url' => esc_url_raw( $download_url ),
|
578 |
'nonce' => 'install-plugin_' . $this->plugin_slug,
|
579 |
'plugin' => '',
|
580 |
'api' => null,
|
581 |
+
'extra' => [
|
582 |
'slug' => $this->plugin_slug
|
583 |
+
],
|
584 |
+
];
|
585 |
+
|
586 |
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
587 |
+
|
588 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
589 |
$skin = new Plugin_Installer_Skin( $skin_args );
|
590 |
} else {
|
591 |
$skin = new WP_Upgrader_Skin( $skin_args );
|
592 |
}
|
593 |
+
|
594 |
$upgrader = new Plugin_Upgrader( $skin );
|
595 |
+
|
596 |
if ( empty( $download_url ) ) {
|
597 |
throw new Exception( 'You must pass the download url to upgrade up premium package.', "not_passed_download_url" );
|
598 |
}
|
599 |
+
|
600 |
$install_result = $upgrader->install( $download_url );
|
601 |
+
|
602 |
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
603 |
+
|
604 |
if ( is_wp_error( $install_result ) ) {
|
605 |
throw new Exception( $install_result->get_error_message(), $install_result->get_error_code() );
|
606 |
+
} else if ( is_wp_error( $skin->result ) ) {
|
607 |
throw new Exception( $skin->result->get_error_message(), $skin->result->get_error_code() );
|
608 |
+
} else if ( is_null( $install_result ) ) {
|
609 |
global $wp_filesystem;
|
610 |
+
|
611 |
$error_code = 'unable_to_connect_to_filesystem';
|
612 |
$error_message = 'Unable to connect to the filesystem. Please confirm your credentials.';
|
613 |
+
|
614 |
// Pass through the error from WP_Filesystem if one was raised.
|
615 |
if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
|
616 |
$error_message = $wp_filesystem->errors->get_error_message();
|
617 |
}
|
618 |
+
|
619 |
throw new Exception( $error_message, $error_code );
|
620 |
}
|
621 |
+
|
622 |
$this->plugin_basename = $upgrader->plugin_info();
|
623 |
$this->plugin_main_file = WP_PLUGIN_DIR . '/' . $this->plugin_basename;
|
624 |
$this->plugin_absolute_path = dirname( WP_PLUGIN_DIR . '/' . $this->plugin_basename );
|
625 |
+
|
626 |
$this->update_package_data();
|
627 |
+
|
628 |
$package = $this->plugin->premium->get_package_data();
|
629 |
+
|
630 |
/**
|
|
|
|
|
|
|
631 |
* @since 4.1.1
|
632 |
+
*
|
633 |
+
* @param string $plugin_name Имя плагина
|
634 |
+
*
|
635 |
+
* @param string $package Дополнительная информация о лицензии
|
636 |
*/
|
637 |
do_action( 'wbcr/factory/premium/installed_package', $package, $this->plugin->getPluginName() );
|
638 |
+
|
639 |
die();
|
640 |
}
|
641 |
}
|
642 |
+
|
643 |
/**
|
644 |
* @return bool
|
645 |
* @throws Exception
|
648 |
if ( ! $this->plugin->premium->is_install_package() ) {
|
649 |
return false;
|
650 |
}
|
651 |
+
|
652 |
$package = $this->plugin->premium->get_package_data();
|
653 |
+
|
654 |
/**
|
|
|
|
|
|
|
655 |
* @since 4.1.1
|
656 |
+
*
|
657 |
+
* @param string $plugin_name Имя плагина
|
658 |
+
*
|
659 |
+
* @param string $package Дополнительная информация о лицензии
|
660 |
*/
|
661 |
do_action( 'wbcr/factory/premium/delete_package', $package, $this->plugin->getPluginName() );
|
662 |
+
|
663 |
if ( is_plugin_active( $package['basename'] ) ) {
|
664 |
if ( is_multisite() && is_plugin_active_for_network( $package['basename'] ) ) {
|
665 |
deactivate_plugins( $package['basename'], false, true );
|
667 |
deactivate_plugins( $package['basename'] );
|
668 |
}
|
669 |
}
|
670 |
+
|
671 |
+
$result = delete_plugins( [ $package['basename'] ] );
|
672 |
+
|
673 |
if ( is_wp_error( $result ) ) {
|
674 |
throw new Exception( $result->get_error_message(), $result->get_error_code() );
|
675 |
}
|
676 |
+
|
677 |
$this->plugin->premium->delete_package();
|
678 |
+
|
679 |
/**
|
|
|
|
|
|
|
680 |
* @since 4.1.1
|
681 |
+
*
|
682 |
+
* @param string $plugin_name Имя плагина
|
683 |
+
*
|
684 |
+
* @param string $package Дополнительная информация о лицензии
|
685 |
*/
|
686 |
do_action( 'wbcr/factory/premium/deleted_package', $package, $this->plugin->getPluginName() );
|
687 |
+
|
688 |
return true;
|
689 |
}
|
690 |
+
|
691 |
/**
|
|
|
692 |
* @since 4.1.1
|
693 |
+
* @return bool
|
694 |
*/
|
695 |
protected function deactivate() {
|
696 |
if ( ! $this->plugin->premium->is_install_package() || ! is_plugin_active( $this->plugin_basename ) ) {
|
697 |
return false;
|
698 |
}
|
699 |
+
|
700 |
$package = $this->plugin->premium->get_package_data();
|
701 |
+
|
702 |
/**
|
|
|
|
|
|
|
703 |
* @since 4.1.1
|
704 |
+
*
|
705 |
+
* @param string $plugin_name Имя плагина
|
706 |
+
*
|
707 |
+
* @param string $package Дополнительная информация о лицензии
|
708 |
*/
|
709 |
do_action( 'wbcr/factory/premium/deactivate_package', $package, $this->plugin->getPluginName() );
|
710 |
+
|
711 |
if ( is_multisite() && is_plugin_active_for_network( $this->plugin_basename ) ) {
|
712 |
deactivate_plugins( $this->plugin_basename, false, true );
|
713 |
} else {
|
714 |
deactivate_plugins( $this->plugin_basename );
|
715 |
}
|
716 |
+
|
717 |
/**
|
|
|
|
|
|
|
718 |
* @since 4.1.1
|
719 |
+
*
|
720 |
+
* @param string $plugin_name Имя плагина
|
721 |
+
*
|
722 |
+
* @param string $package Дополнительная информация о лицензии
|
723 |
*/
|
724 |
do_action( 'wbcr/factory/premium/deactivated_package', $package, $this->plugin->getPluginName() );
|
725 |
+
|
726 |
return true;
|
727 |
}
|
728 |
+
|
729 |
/**
|
730 |
+
* @since 4.1.1
|
731 |
+
*
|
732 |
* @param array $plugin_data
|
733 |
*
|
734 |
* @throws Exception
|
|
|
|
|
735 |
*/
|
736 |
protected function update_package_data() {
|
737 |
+
|
738 |
if ( ! $this->plugin_main_file ) {
|
739 |
return;
|
740 |
}
|
741 |
+
|
742 |
+
$default_headers = [
|
743 |
'Version' => 'Version',
|
744 |
'FrameworkVersion' => 'Framework Version'
|
745 |
+
];
|
746 |
+
|
747 |
$plugin_data = get_file_data( $this->plugin_main_file, $default_headers, 'plugin' );
|
748 |
+
|
749 |
+
$this->plugin->premium->update_package_data( [
|
750 |
'basename' => $this->plugin_basename,
|
751 |
'version' => $plugin_data['Version'],
|
752 |
'framework_version' => isset( $plugin_data['FrameworkVersion'] ) ? $plugin_data['FrameworkVersion'] : null,
|
753 |
+
] );
|
754 |
}
|
755 |
+
|
756 |
/**
|
757 |
+
* @since 4.1.1
|
758 |
+
*
|
759 |
* @param string $type
|
760 |
*
|
761 |
* @return string|null
|
|
|
|
|
762 |
*/
|
763 |
private function get_notice_text( $type ) {
|
764 |
$upgrade_url = $this->get_action_url( 'install' );
|
765 |
$activate_plugin_url = $this->get_activate_premium_url();
|
766 |
$cancel_license_url = $this->get_action_url( 'cancel_license' );
|
767 |
+
|
768 |
+
$texts = [
|
769 |
+
'need_activate_license' => __( 'License activation required. A license is required to get premium plugin updates, as well as to get additional services.', 'wbcr_factory_425' ),
|
770 |
+
'need_renew_license' => __( 'Your license has expired. You can no longer get premium plugin updates, premium support and your access to Webcraftic services has been suspended.', 'wbcr_factory_425' ),
|
771 |
'please_install_premium' => sprintf( __( 'Congratulations, you have activated a premium license! Please install premium add-on to use pro features now.
|
772 |
+
<a href="%s">Install</a> premium add-on or <a href="%s">cancel</a> license.', 'wbcr_factory_425' ), $upgrade_url, $cancel_license_url ),
|
773 |
'please_activate_premium' => sprintf( __( 'Congratulations, you have activated a premium license! Please activate premium add-on to use pro features now.
|
774 |
+
<a href="%s">Activate</a> premium add-on or <a href="%s">cancel</a> license.', 'wbcr_factory_425' ), $activate_plugin_url, $cancel_license_url )
|
775 |
+
];
|
776 |
+
|
777 |
if ( isset( $texts[ $type ] ) ) {
|
778 |
+
|
779 |
/**
|
780 |
+
* @since 4.1.1
|
781 |
+
*
|
782 |
* @param string $type
|
783 |
* @param string $plugin_name
|
784 |
*
|
785 |
+
* @param array $messages
|
786 |
*/
|
787 |
return apply_filters( 'wbcr/factory/premium/notice_text', $texts[ $type ], $type, $this->plugin->getPluginName() );
|
788 |
}
|
789 |
+
|
790 |
return null;
|
791 |
}
|
792 |
}
|
libs/factory/core/includes/updates/class-factory-upgrader.php
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use Exception;
|
6 |
use stdClass;
|
7 |
-
use
|
8 |
-
use WBCR\Factory_Freemius_103\Updates\Freemius_Repository;
|
9 |
|
10 |
// Exit if accessed directly
|
11 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -13,8 +12,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
* @author
|
17 |
-
* @
|
18 |
* @copyright (c) 2018 Webraftic Ltd
|
19 |
* @version 1.0
|
20 |
*/
|
@@ -22,6 +21,19 @@ class Upgrader {
|
|
22 |
|
23 |
const CHECK_UPDATES_INTERVAL = "43200";
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
/**
|
26 |
* Тип апгрейдера, может быть default, premium
|
27 |
*
|
@@ -30,7 +42,7 @@ class Upgrader {
|
|
30 |
protected $type = 'default';
|
31 |
|
32 |
/**
|
33 |
-
* @var
|
34 |
*/
|
35 |
protected $plugin;
|
36 |
|
@@ -78,13 +90,13 @@ class Upgrader {
|
|
78 |
*
|
79 |
* @since 4.1.1
|
80 |
*
|
81 |
-
* @param
|
82 |
* @param $args
|
83 |
* @param bool $is_premium
|
84 |
*
|
85 |
* @throws Exception
|
86 |
*/
|
87 |
-
public function __construct(
|
88 |
|
89 |
$this->plugin = $plugin;
|
90 |
|
@@ -93,6 +105,9 @@ class Upgrader {
|
|
93 |
$this->plugin_absolute_path = $plugin->get_paths()->absolute;
|
94 |
$this->is_debug = defined( 'FACTORY_UPDATES_DEBUG' ) && FACTORY_UPDATES_DEBUG;
|
95 |
|
|
|
|
|
|
|
96 |
$settings = $this->get_settings();
|
97 |
|
98 |
$this->plugin_slug = $settings['slug'];
|
@@ -269,62 +284,16 @@ class Upgrader {
|
|
269 |
* @throws Exception
|
270 |
*/
|
271 |
protected function get_repository( $repository_name ) {
|
272 |
-
switch ( $repository_name ) {
|
273 |
-
case 'wordpress':
|
274 |
-
return new Wordpress_Repository( $this->plugin );
|
275 |
-
break;
|
276 |
-
case 'freemius':
|
277 |
-
if ( ! defined( 'FACTORY_FREEMIUS_103_LOADED' ) ) {
|
278 |
-
throw new Exception( 'If you have to get updates from the Freemius repository, you need to install the freemius module.' );
|
279 |
-
}
|
280 |
-
|
281 |
-
return new Freemius_Repository( $this->plugin );
|
282 |
-
break;
|
283 |
-
default:
|
284 |
-
return $this->instance_other_repository( $repository_name );
|
285 |
-
break;
|
286 |
-
}
|
287 |
-
}
|
288 |
-
|
289 |
-
/**
|
290 |
-
* @since 4.1.1
|
291 |
-
*
|
292 |
-
* @param string $name
|
293 |
-
* @param bool $is_premium
|
294 |
-
*
|
295 |
-
* @return Repository
|
296 |
-
* @throws Exception
|
297 |
-
*/
|
298 |
-
protected function instance_other_repository( $name ) {
|
299 |
-
$other_repositories = [];
|
300 |
-
|
301 |
-
/**
|
302 |
-
* @since 4.1.1
|
303 |
-
* @type array $other_repositories
|
304 |
-
*/
|
305 |
-
$other_repositories = apply_filters( 'wbcr/factory/updates/repositories', $other_repositories );
|
306 |
-
|
307 |
-
if ( ! isset( $other_repositories[ $name ] ) ) {
|
308 |
-
return null;
|
309 |
-
}
|
310 |
|
311 |
-
$
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( ! file_exists( $repository_data['class_path'] ) ) {
|
318 |
-
throw new Exception( 'File with new repository class not found. Please check the correctness of used path: ' . $repository_data['class_path'] );
|
319 |
-
}
|
320 |
|
321 |
-
|
322 |
-
throw new Exception( 'Class ' . $repository_data['class_name'] . ' is not found. Please check if class name is filled out correctly.' );
|
323 |
}
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
return new $repository_data['class_name']( $this->plugin );
|
328 |
}
|
329 |
|
330 |
/**
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Updates;
|
4 |
|
5 |
use Exception;
|
6 |
use stdClass;
|
7 |
+
use Wbcr_Factory425_Plugin;
|
|
|
8 |
|
9 |
// Exit if accessed directly
|
10 |
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
16 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
17 |
* @copyright (c) 2018 Webraftic Ltd
|
18 |
* @version 1.0
|
19 |
*/
|
21 |
|
22 |
const CHECK_UPDATES_INTERVAL = "43200";
|
23 |
|
24 |
+
/**
|
25 |
+
* Список доступных классов для работы с репозиториями
|
26 |
+
*
|
27 |
+
* @author Alexander Kovalev <alex.kovalevv@gmail.com>
|
28 |
+
* @since 4.1.7
|
29 |
+
* @var array хранит имя репозитория и его имя класса
|
30 |
+
* [
|
31 |
+
* 'wordpress' => 'WBCR\Factory_Freemius_113\Updates\Freemius_Repository',
|
32 |
+
* 'freemius' => '\WBCR\Factory_425\Updates\Wordpress_Repository'
|
33 |
+
* ]
|
34 |
+
*/
|
35 |
+
public static $repositories = [];
|
36 |
+
|
37 |
/**
|
38 |
* Тип апгрейдера, может быть default, premium
|
39 |
*
|
42 |
protected $type = 'default';
|
43 |
|
44 |
/**
|
45 |
+
* @var Wbcr_Factory425_Plugin
|
46 |
*/
|
47 |
protected $plugin;
|
48 |
|
90 |
*
|
91 |
* @since 4.1.1
|
92 |
*
|
93 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
94 |
* @param $args
|
95 |
* @param bool $is_premium
|
96 |
*
|
97 |
* @throws Exception
|
98 |
*/
|
99 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
100 |
|
101 |
$this->plugin = $plugin;
|
102 |
|
105 |
$this->plugin_absolute_path = $plugin->get_paths()->absolute;
|
106 |
$this->is_debug = defined( 'FACTORY_UPDATES_DEBUG' ) && FACTORY_UPDATES_DEBUG;
|
107 |
|
108 |
+
# Добавляем Wordpress репозиторий в список доступных репозиториев по умолчанию
|
109 |
+
self::$repositories['wordpress'] = '\WBCR\Factory_425\Updates\Wordpress_Repository';
|
110 |
+
|
111 |
$settings = $this->get_settings();
|
112 |
|
113 |
$this->plugin_slug = $settings['slug'];
|
284 |
* @throws Exception
|
285 |
*/
|
286 |
protected function get_repository( $repository_name ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
|
288 |
+
if ( isset( self::$repositories[ $repository_name ] ) && class_exists( self::$repositories[ $repository_name ] ) ) {
|
289 |
+
if ( self::$repositories[ $repository_name ] instanceof Repository ) {
|
290 |
+
throw new Exception( "Repository {$repository_name} must extend the class WBCR\Factory_425\Updates\Repository interface!" );
|
291 |
+
}
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
+
return new self::$repositories[ $repository_name ]( $this->plugin );
|
|
|
294 |
}
|
295 |
|
296 |
+
throw new Exception( "Repository {$repository_name} is not supported!" );
|
|
|
|
|
297 |
}
|
298 |
|
299 |
/**
|
libs/factory/core/includes/updates/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/includes/updates/repositories/class-factory-repository-abstract.php
CHANGED
@@ -1,60 +1,60 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
-
use
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
11 |
|
12 |
/**
|
13 |
-
* @author
|
14 |
-
* @
|
15 |
* @copyright (c) 2018 Webraftic Ltd
|
16 |
-
* @version
|
17 |
*/
|
18 |
abstract class Repository {
|
19 |
-
|
20 |
/**
|
21 |
* @var bool
|
22 |
*/
|
23 |
protected $initialized = false;
|
24 |
-
|
25 |
/**
|
26 |
-
* @var
|
27 |
*/
|
28 |
protected $plugin;
|
29 |
-
|
30 |
/**
|
31 |
* Repository constructor.
|
32 |
*
|
33 |
-
* @param
|
34 |
-
* @param bool
|
35 |
*/
|
36 |
-
abstract public function __construct(
|
37 |
-
|
38 |
/**
|
39 |
* @return void
|
40 |
*/
|
41 |
abstract public function init();
|
42 |
-
|
43 |
/**
|
44 |
* @return bool
|
45 |
*/
|
46 |
abstract public function need_check_updates();
|
47 |
-
|
48 |
/**
|
49 |
* @return mixed
|
50 |
*/
|
51 |
abstract public function is_support_premium();
|
52 |
-
|
53 |
/**
|
54 |
* @return string
|
55 |
*/
|
56 |
abstract public function get_download_url();
|
57 |
-
|
58 |
/**
|
59 |
* @return string
|
60 |
*/
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Updates;
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
+
use Wbcr_Factory425_Plugin;
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
11 |
|
12 |
/**
|
13 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
14 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
15 |
* @copyright (c) 2018 Webraftic Ltd
|
16 |
+
* @version 1.0
|
17 |
*/
|
18 |
abstract class Repository {
|
19 |
+
|
20 |
/**
|
21 |
* @var bool
|
22 |
*/
|
23 |
protected $initialized = false;
|
24 |
+
|
25 |
/**
|
26 |
+
* @var Wbcr_Factory425_Plugin
|
27 |
*/
|
28 |
protected $plugin;
|
29 |
+
|
30 |
/**
|
31 |
* Repository constructor.
|
32 |
*
|
33 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
34 |
+
* @param bool $is_premium
|
35 |
*/
|
36 |
+
abstract public function __construct( Wbcr_Factory425_Plugin $plugin );
|
37 |
+
|
38 |
/**
|
39 |
* @return void
|
40 |
*/
|
41 |
abstract public function init();
|
42 |
+
|
43 |
/**
|
44 |
* @return bool
|
45 |
*/
|
46 |
abstract public function need_check_updates();
|
47 |
+
|
48 |
/**
|
49 |
* @return mixed
|
50 |
*/
|
51 |
abstract public function is_support_premium();
|
52 |
+
|
53 |
/**
|
54 |
* @return string
|
55 |
*/
|
56 |
abstract public function get_download_url();
|
57 |
+
|
58 |
/**
|
59 |
* @return string
|
60 |
*/
|
libs/factory/core/includes/updates/repositories/class-factory-wordpress.php
CHANGED
@@ -1,68 +1,68 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
-
use
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
11 |
|
12 |
/**
|
13 |
-
* @author
|
14 |
-
* @
|
15 |
* @copyright (c) 2018 Webraftic Ltd
|
16 |
-
* @version
|
17 |
*/
|
18 |
class Wordpress_Repository extends Repository {
|
19 |
-
|
20 |
/**
|
21 |
* Wordpress constructor.
|
22 |
*
|
23 |
-
* @param
|
24 |
-
* @param bool
|
25 |
*/
|
26 |
-
public function __construct(
|
27 |
$this->plugin = $plugin;
|
28 |
}
|
29 |
-
|
30 |
public function init() {
|
31 |
// TODO: Implement init() method.
|
32 |
}
|
33 |
-
|
34 |
/**
|
35 |
* @return bool
|
36 |
*/
|
37 |
public function need_check_updates() {
|
38 |
return false;
|
39 |
}
|
40 |
-
|
41 |
/**
|
42 |
* @return bool
|
43 |
*/
|
44 |
public function is_support_premium() {
|
45 |
return false;
|
46 |
}
|
47 |
-
|
48 |
/**
|
49 |
* @return string
|
50 |
*/
|
51 |
public function get_download_url() {
|
52 |
return '';
|
53 |
}
|
54 |
-
|
55 |
/**
|
56 |
* @return string
|
57 |
*/
|
58 |
public function get_last_version() {
|
59 |
return '0.0.0';
|
60 |
}
|
61 |
-
|
62 |
public function check_updates() {
|
63 |
-
|
64 |
}
|
65 |
-
|
66 |
/**
|
67 |
* @return bool
|
68 |
*/
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_425\Updates;
|
4 |
|
5 |
// Exit if accessed directly
|
6 |
+
use Wbcr_Factory425_Plugin;
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
11 |
|
12 |
/**
|
13 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>, repo: https://github.com/alexkovalevv
|
14 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, site: https://webcraftic.com
|
15 |
* @copyright (c) 2018 Webraftic Ltd
|
16 |
+
* @version 1.0
|
17 |
*/
|
18 |
class Wordpress_Repository extends Repository {
|
19 |
+
|
20 |
/**
|
21 |
* Wordpress constructor.
|
22 |
*
|
23 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
24 |
+
* @param bool $is_premium
|
25 |
*/
|
26 |
+
public function __construct( Wbcr_Factory425_Plugin $plugin ) {
|
27 |
$this->plugin = $plugin;
|
28 |
}
|
29 |
+
|
30 |
public function init() {
|
31 |
// TODO: Implement init() method.
|
32 |
}
|
33 |
+
|
34 |
/**
|
35 |
* @return bool
|
36 |
*/
|
37 |
public function need_check_updates() {
|
38 |
return false;
|
39 |
}
|
40 |
+
|
41 |
/**
|
42 |
* @return bool
|
43 |
*/
|
44 |
public function is_support_premium() {
|
45 |
return false;
|
46 |
}
|
47 |
+
|
48 |
/**
|
49 |
* @return string
|
50 |
*/
|
51 |
public function get_download_url() {
|
52 |
return '';
|
53 |
}
|
54 |
+
|
55 |
/**
|
56 |
* @return string
|
57 |
*/
|
58 |
public function get_last_version() {
|
59 |
return '0.0.0';
|
60 |
}
|
61 |
+
|
62 |
public function check_updates() {
|
63 |
+
|
64 |
}
|
65 |
+
|
66 |
/**
|
67 |
* @return bool
|
68 |
*/
|
libs/factory/core/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/langs/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/core/langs/wbcr_factory_425-ru_RU.mo
ADDED
Binary file
|
libs/factory/core/langs/{wbcr_factory_414-ru_RU.po → wbcr_factory_425-ru_RU.po}
RENAMED
File without changes
|
libs/factory/forms/assets/css/index.php
DELETED
File without changes
|
libs/factory/forms/assets/index.php
DELETED
File without changes
|
libs/factory/forms/boot.php
CHANGED
@@ -1,273 +1,273 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
|
44 |
|
45 |
-
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
/**
|
48 |
-
*
|
49 |
-
* we load the form controls only on pages where the forms are created.
|
50 |
*
|
51 |
-
* @
|
52 |
-
*
|
53 |
-
* @since 3.0.7
|
54 |
*/
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
* @throws Exception
|
60 |
-
*/
|
61 |
-
function wbcr_factory_forms_414_register_default_controls(Wbcr_Factory414_Plugin $plugin)
|
62 |
-
{
|
63 |
-
|
64 |
-
if( $plugin && !isset($plugin->forms) ) {
|
65 |
-
throw new Exception("The module Factory Forms is not loaded for the plugin '{$plugin->getPluginName()}'.");
|
66 |
-
}
|
67 |
-
|
68 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/html-builder.class.php');
|
69 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/form-element.class.php');
|
70 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/control.class.php');
|
71 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/complex-control.class.php');
|
72 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/holder.class.php');
|
73 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/control-holder.class.php');
|
74 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/custom-element.class.php');
|
75 |
-
require_once(FACTORY_FORMS_414_DIR . '/includes/form-layout.class.php');
|
76 |
-
|
77 |
-
// registration of controls
|
78 |
-
$plugin->forms->registerControls(array(
|
79 |
-
array(
|
80 |
-
'type' => 'checkbox',
|
81 |
-
'class' => 'Wbcr_FactoryForms414_CheckboxControl',
|
82 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/checkbox.php'
|
83 |
-
),
|
84 |
-
array(
|
85 |
-
'type' => 'list',
|
86 |
-
'class' => 'Wbcr_FactoryForms414_ListControl',
|
87 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/list.php'
|
88 |
-
),
|
89 |
-
array(
|
90 |
-
'type' => 'dropdown',
|
91 |
-
'class' => 'Wbcr_FactoryForms414_DropdownControl',
|
92 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/dropdown.php'
|
93 |
-
),
|
94 |
-
array(
|
95 |
-
'type' => 'dropdown-and-colors',
|
96 |
-
'class' => 'Wbcr_FactoryForms414_DropdownAndColorsControl',
|
97 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/dropdown-and-colors.php'
|
98 |
-
),
|
99 |
-
array(
|
100 |
-
'type' => 'hidden',
|
101 |
-
'class' => 'Wbcr_FactoryForms414_HiddenControl',
|
102 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/hidden.php'
|
103 |
-
),
|
104 |
-
array(
|
105 |
-
'type' => 'hidden',
|
106 |
-
'class' => 'Wbcr_FactoryForms414_HiddenControl',
|
107 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/hidden.php'
|
108 |
-
),
|
109 |
-
array(
|
110 |
-
'type' => 'radio',
|
111 |
-
'class' => 'Wbcr_FactoryForms414_RadioControl',
|
112 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/radio.php'
|
113 |
-
),
|
114 |
-
array(
|
115 |
-
'type' => 'radio-colors',
|
116 |
-
'class' => 'Wbcr_FactoryForms414_RadioColorsControl',
|
117 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/radio-colors.php'
|
118 |
-
),
|
119 |
-
array(
|
120 |
-
'type' => 'textarea',
|
121 |
-
'class' => 'Wbcr_FactoryForms414_TextareaControl',
|
122 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/textarea.php'
|
123 |
-
),
|
124 |
-
array(
|
125 |
-
'type' => 'textbox',
|
126 |
-
'class' => 'Wbcr_FactoryForms414_TextboxControl',
|
127 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/textbox.php'
|
128 |
-
),
|
129 |
-
array(
|
130 |
-
'type' => 'multiple-textbox',
|
131 |
-
'class' => 'Wbcr_FactoryForms414_MultipleTextboxControl',
|
132 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/multiple-textbox.php'
|
133 |
-
),
|
134 |
-
array(
|
135 |
-
'type' => 'datetimepicker-range',
|
136 |
-
'class' => 'Wbcr_FactoryForms414_DatepickerRangeControl',
|
137 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/datepicker-range.php'
|
138 |
-
),
|
139 |
-
array(
|
140 |
-
'type' => 'url',
|
141 |
-
'class' => 'Wbcr_FactoryForms414_UrlControl',
|
142 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/url.php'
|
143 |
-
),
|
144 |
-
array(
|
145 |
-
'type' => 'wp-editor',
|
146 |
-
'class' => 'Wbcr_FactoryForms414_WpEditorControl',
|
147 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/wp-editor.php'
|
148 |
-
),
|
149 |
-
array(
|
150 |
-
'type' => 'color',
|
151 |
-
'class' => 'Wbcr_FactoryForms414_ColorControl',
|
152 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/color.php'
|
153 |
-
),
|
154 |
-
array(
|
155 |
-
'type' => 'color-and-opacity',
|
156 |
-
'class' => 'Wbcr_FactoryForms414_ColorAndOpacityControl',
|
157 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/color-and-opacity.php'
|
158 |
-
),
|
159 |
-
array(
|
160 |
-
'type' => 'gradient',
|
161 |
-
'class' => 'Wbcr_FactoryForms414_GradientControl',
|
162 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/gradient.php'
|
163 |
-
),
|
164 |
-
array(
|
165 |
-
'type' => 'font',
|
166 |
-
'class' => 'Wbcr_FactoryForms414_FontControl',
|
167 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/font.php'
|
168 |
-
),
|
169 |
-
array(
|
170 |
-
'type' => 'google-font',
|
171 |
-
'class' => 'Wbcr_FactoryForms414_GoogleFontControl',
|
172 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/google-font.php'
|
173 |
-
),
|
174 |
-
array(
|
175 |
-
'type' => 'pattern',
|
176 |
-
'class' => 'Wbcr_FactoryForms414_PatternControl',
|
177 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/pattern.php'
|
178 |
-
),
|
179 |
-
array(
|
180 |
-
'type' => 'integer',
|
181 |
-
'class' => 'Wbcr_FactoryForms414_IntegerControl',
|
182 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/integer.php'
|
183 |
-
),
|
184 |
-
array(
|
185 |
-
'type' => 'control-group',
|
186 |
-
'class' => 'Wbcr_FactoryForms414_ControlGroupHolder',
|
187 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/control-group.php'
|
188 |
-
),
|
189 |
-
array(
|
190 |
-
'type' => 'paddings-editor',
|
191 |
-
'class' => 'Wbcr_FactoryForms414_PaddingsEditorControl',
|
192 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/paddings-editor.php'
|
193 |
-
),
|
194 |
-
));
|
195 |
-
|
196 |
-
// registration of control holders
|
197 |
-
$plugin->forms->registerHolders(array(
|
198 |
-
array(
|
199 |
-
'type' => 'tab',
|
200 |
-
'class' => 'Wbcr_FactoryForms414_TabHolder',
|
201 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/tab.php'
|
202 |
-
),
|
203 |
-
array(
|
204 |
-
'type' => 'tab-item',
|
205 |
-
'class' => 'Wbcr_FactoryForms414_TabItemHolder',
|
206 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/tab-item.php'
|
207 |
-
),
|
208 |
-
array(
|
209 |
-
'type' => 'accordion',
|
210 |
-
'class' => 'Wbcr_FactoryForms414_AccordionHolder',
|
211 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/accordion.php'
|
212 |
-
),
|
213 |
-
array(
|
214 |
-
'type' => 'accordion-item',
|
215 |
-
'class' => 'Wbcr_FactoryForms414_AccordionItemHolder',
|
216 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/accordion-item.php'
|
217 |
-
),
|
218 |
-
array(
|
219 |
-
'type' => 'control-group',
|
220 |
-
'class' => 'Wbcr_FactoryForms414_ControlGroupHolder',
|
221 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/control-group.php'
|
222 |
-
),
|
223 |
-
array(
|
224 |
-
'type' => 'control-group-item',
|
225 |
-
'class' => 'Wbcr_FactoryForms414_ControlGroupItem',
|
226 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/control-group-item.php'
|
227 |
-
),
|
228 |
-
array(
|
229 |
-
'type' => 'form-group',
|
230 |
-
'class' => 'Wbcr_FactoryForms414_FormGroupHolder',
|
231 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/form-group.php'
|
232 |
-
),
|
233 |
-
array(
|
234 |
-
'type' => 'more-link',
|
235 |
-
'class' => 'Wbcr_FactoryForms414_MoreLinkHolder',
|
236 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/more-link.php'
|
237 |
-
),
|
238 |
-
array(
|
239 |
-
'type' => 'div',
|
240 |
-
'class' => 'Wbcr_FactoryForms414_DivHolder',
|
241 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/div.php'
|
242 |
-
),
|
243 |
-
array(
|
244 |
-
'type' => 'columns',
|
245 |
-
'class' => 'Wbcr_FactoryForms414_ColumnsHolder',
|
246 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/holders/columns.php'
|
247 |
-
)
|
248 |
-
));
|
249 |
-
|
250 |
-
// registration custom form elements
|
251 |
-
$plugin->forms->registerCustomElements(array(
|
252 |
-
array(
|
253 |
-
'type' => 'html',
|
254 |
-
'class' => 'Wbcr_FactoryForms414_Html',
|
255 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/customs/html.php',
|
256 |
-
),
|
257 |
-
array(
|
258 |
-
'type' => 'separator',
|
259 |
-
'class' => 'Wbcr_FactoryForms414_Separator',
|
260 |
-
'include' => FACTORY_FORMS_414_DIR . '/controls/customs/separator.php',
|
261 |
-
),
|
262 |
-
));
|
263 |
-
|
264 |
-
// registration of form layouts
|
265 |
-
$plugin->forms->registerFormLayout(array(
|
266 |
-
'name' => 'bootstrap-3',
|
267 |
-
'class' => 'Wbcr_FactoryForms414_Bootstrap3FormLayout',
|
268 |
-
'include' => FACTORY_FORMS_414_DIR . '/layouts/bootstrap-3/bootstrap-3.php'
|
269 |
-
));
|
270 |
}
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Factory Forms
|
4 |
+
*
|
5 |
+
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
6 |
+
* @since 1.0.1
|
7 |
+
* @package factory-forms
|
8 |
+
* @copyright (c) 2018, Webcraftic Ltd
|
9 |
+
*
|
10 |
+
*/
|
11 |
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
|
17 |
+
// the module provides function for the admin area only
|
18 |
|
19 |
+
if ( ! is_admin() ) {
|
20 |
+
return;
|
21 |
+
}
|
22 |
|
23 |
+
// checks if the module is already loaded in order to
|
24 |
+
// prevent loading the same version of the module twice.
|
25 |
+
if ( defined( 'FACTORY_FORMS_423_LOADED' ) ) {
|
26 |
+
return;
|
27 |
+
}
|
28 |
|
29 |
+
define( 'FACTORY_FORMS_423_LOADED', true );
|
30 |
|
31 |
+
define( 'FACTORY_FORMS_423_VERSION', '4.2.3' );
|
32 |
|
33 |
+
// absolute path and URL to the files and resources of the module.
|
34 |
+
define( 'FACTORY_FORMS_423_DIR', dirname( __FILE__ ) );
|
35 |
+
define( 'FACTORY_FORMS_423_URL', plugins_url( null, __FILE__ ) );
|
36 |
|
37 |
+
#comp merge
|
38 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/providers/value-provider.interface.php' );
|
39 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/providers/meta-value-provider.class.php' );
|
40 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/providers/options-value-provider.class.php' );
|
41 |
|
42 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/form.class.php' );
|
43 |
+
#endcomp
|
44 |
|
45 |
+
load_plugin_textdomain( 'wbcr_factory_forms_423', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' );
|
46 |
|
47 |
+
/**
|
48 |
+
* We add this code into the hook because all these controls quite heavy. So in order to get better perfomance,
|
49 |
+
* we load the form controls only on pages where the forms are created.
|
50 |
+
*
|
51 |
+
* @since 3.0.7
|
52 |
+
* @see the 'wbcr_factory_forms_423_register_controls' hook
|
53 |
+
*
|
54 |
+
*/
|
55 |
+
if ( ! function_exists( 'wbcr_factory_forms_423_register_default_controls' ) ) {
|
56 |
+
|
57 |
/**
|
58 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
|
|
59 |
*
|
60 |
+
* @throws Exception
|
|
|
|
|
61 |
*/
|
62 |
+
function wbcr_factory_forms_423_register_default_controls( Wbcr_Factory425_Plugin $plugin ) {
|
63 |
+
|
64 |
+
if ( $plugin && ! isset( $plugin->forms ) ) {
|
65 |
+
throw new Exception( "The module Factory Forms is not loaded for the plugin '{$plugin->getPluginName()}'." );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
+
|
68 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/html-builder.class.php' );
|
69 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/form-element.class.php' );
|
70 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/control.class.php' );
|
71 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/complex-control.class.php' );
|
72 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/holder.class.php' );
|
73 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/control-holder.class.php' );
|
74 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/custom-element.class.php' );
|
75 |
+
require_once( FACTORY_FORMS_423_DIR . '/includes/form-layout.class.php' );
|
76 |
+
|
77 |
+
// registration of controls
|
78 |
+
$plugin->forms->registerControls( [
|
79 |
+
[
|
80 |
+
'type' => 'checkbox',
|
81 |
+
'class' => 'Wbcr_FactoryForms423_CheckboxControl',
|
82 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/checkbox.php'
|
83 |
+
],
|
84 |
+
[
|
85 |
+
'type' => 'list',
|
86 |
+
'class' => 'Wbcr_FactoryForms423_ListControl',
|
87 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/list.php'
|
88 |
+
],
|
89 |
+
[
|
90 |
+
'type' => 'dropdown',
|
91 |
+
'class' => 'Wbcr_FactoryForms423_DropdownControl',
|
92 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/dropdown.php'
|
93 |
+
],
|
94 |
+
[
|
95 |
+
'type' => 'dropdown-and-colors',
|
96 |
+
'class' => 'Wbcr_FactoryForms423_DropdownAndColorsControl',
|
97 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/dropdown-and-colors.php'
|
98 |
+
],
|
99 |
+
[
|
100 |
+
'type' => 'hidden',
|
101 |
+
'class' => 'Wbcr_FactoryForms423_HiddenControl',
|
102 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/hidden.php'
|
103 |
+
],
|
104 |
+
[
|
105 |
+
'type' => 'hidden',
|
106 |
+
'class' => 'Wbcr_FactoryForms423_HiddenControl',
|
107 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/hidden.php'
|
108 |
+
],
|
109 |
+
[
|
110 |
+
'type' => 'radio',
|
111 |
+
'class' => 'Wbcr_FactoryForms423_RadioControl',
|
112 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/radio.php'
|
113 |
+
],
|
114 |
+
[
|
115 |
+
'type' => 'radio-colors',
|
116 |
+
'class' => 'Wbcr_FactoryForms423_RadioColorsControl',
|
117 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/radio-colors.php'
|
118 |
+
],
|
119 |
+
[
|
120 |
+
'type' => 'textarea',
|
121 |
+
'class' => 'Wbcr_FactoryForms423_TextareaControl',
|
122 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/textarea.php'
|
123 |
+
],
|
124 |
+
[
|
125 |
+
'type' => 'textbox',
|
126 |
+
'class' => 'Wbcr_FactoryForms423_TextboxControl',
|
127 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/textbox.php'
|
128 |
+
],
|
129 |
+
[
|
130 |
+
'type' => 'multiple-textbox',
|
131 |
+
'class' => 'Wbcr_FactoryForms423_MultipleTextboxControl',
|
132 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/multiple-textbox.php'
|
133 |
+
],
|
134 |
+
[
|
135 |
+
'type' => 'datetimepicker-range',
|
136 |
+
'class' => 'Wbcr_FactoryForms423_DatepickerRangeControl',
|
137 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/datepicker-range.php'
|
138 |
+
],
|
139 |
+
[
|
140 |
+
'type' => 'url',
|
141 |
+
'class' => 'Wbcr_FactoryForms423_UrlControl',
|
142 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/url.php'
|
143 |
+
],
|
144 |
+
[
|
145 |
+
'type' => 'wp-editor',
|
146 |
+
'class' => 'Wbcr_FactoryForms423_WpEditorControl',
|
147 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/wp-editor.php'
|
148 |
+
],
|
149 |
+
[
|
150 |
+
'type' => 'color',
|
151 |
+
'class' => 'Wbcr_FactoryForms423_ColorControl',
|
152 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/color.php'
|
153 |
+
],
|
154 |
+
[
|
155 |
+
'type' => 'color-and-opacity',
|
156 |
+
'class' => 'Wbcr_FactoryForms423_ColorAndOpacityControl',
|
157 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/color-and-opacity.php'
|
158 |
+
],
|
159 |
+
[
|
160 |
+
'type' => 'gradient',
|
161 |
+
'class' => 'Wbcr_FactoryForms423_GradientControl',
|
162 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/gradient.php'
|
163 |
+
],
|
164 |
+
[
|
165 |
+
'type' => 'font',
|
166 |
+
'class' => 'Wbcr_FactoryForms423_FontControl',
|
167 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/font.php'
|
168 |
+
],
|
169 |
+
[
|
170 |
+
'type' => 'google-font',
|
171 |
+
'class' => 'Wbcr_FactoryForms423_GoogleFontControl',
|
172 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/google-font.php'
|
173 |
+
],
|
174 |
+
[
|
175 |
+
'type' => 'pattern',
|
176 |
+
'class' => 'Wbcr_FactoryForms423_PatternControl',
|
177 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/pattern.php'
|
178 |
+
],
|
179 |
+
[
|
180 |
+
'type' => 'integer',
|
181 |
+
'class' => 'Wbcr_FactoryForms423_IntegerControl',
|
182 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/integer.php'
|
183 |
+
],
|
184 |
+
[
|
185 |
+
'type' => 'control-group',
|
186 |
+
'class' => 'Wbcr_FactoryForms423_ControlGroupHolder',
|
187 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/control-group.php'
|
188 |
+
],
|
189 |
+
[
|
190 |
+
'type' => 'paddings-editor',
|
191 |
+
'class' => 'Wbcr_FactoryForms423_PaddingsEditorControl',
|
192 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/paddings-editor.php'
|
193 |
+
],
|
194 |
+
] );
|
195 |
+
|
196 |
+
// registration of control holders
|
197 |
+
$plugin->forms->registerHolders( [
|
198 |
+
[
|
199 |
+
'type' => 'tab',
|
200 |
+
'class' => 'Wbcr_FactoryForms423_TabHolder',
|
201 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/tab.php'
|
202 |
+
],
|
203 |
+
[
|
204 |
+
'type' => 'tab-item',
|
205 |
+
'class' => 'Wbcr_FactoryForms423_TabItemHolder',
|
206 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/tab-item.php'
|
207 |
+
],
|
208 |
+
[
|
209 |
+
'type' => 'accordion',
|
210 |
+
'class' => 'Wbcr_FactoryForms423_AccordionHolder',
|
211 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/accordion.php'
|
212 |
+
],
|
213 |
+
[
|
214 |
+
'type' => 'accordion-item',
|
215 |
+
'class' => 'Wbcr_FactoryForms423_AccordionItemHolder',
|
216 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/accordion-item.php'
|
217 |
+
],
|
218 |
+
[
|
219 |
+
'type' => 'control-group',
|
220 |
+
'class' => 'Wbcr_FactoryForms423_ControlGroupHolder',
|
221 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/control-group.php'
|
222 |
+
],
|
223 |
+
[
|
224 |
+
'type' => 'control-group-item',
|
225 |
+
'class' => 'Wbcr_FactoryForms423_ControlGroupItem',
|
226 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/control-group-item.php'
|
227 |
+
],
|
228 |
+
[
|
229 |
+
'type' => 'form-group',
|
230 |
+
'class' => 'Wbcr_FactoryForms423_FormGroupHolder',
|
231 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/form-group.php'
|
232 |
+
],
|
233 |
+
[
|
234 |
+
'type' => 'more-link',
|
235 |
+
'class' => 'Wbcr_FactoryForms423_MoreLinkHolder',
|
236 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/more-link.php'
|
237 |
+
],
|
238 |
+
[
|
239 |
+
'type' => 'div',
|
240 |
+
'class' => 'Wbcr_FactoryForms423_DivHolder',
|
241 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/div.php'
|
242 |
+
],
|
243 |
+
[
|
244 |
+
'type' => 'columns',
|
245 |
+
'class' => 'Wbcr_FactoryForms423_ColumnsHolder',
|
246 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/holders/columns.php'
|
247 |
+
]
|
248 |
+
] );
|
249 |
+
|
250 |
+
// registration custom form elements
|
251 |
+
$plugin->forms->registerCustomElements( [
|
252 |
+
[
|
253 |
+
'type' => 'html',
|
254 |
+
'class' => 'Wbcr_FactoryForms423_Html',
|
255 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/customs/html.php',
|
256 |
+
],
|
257 |
+
[
|
258 |
+
'type' => 'separator',
|
259 |
+
'class' => 'Wbcr_FactoryForms423_Separator',
|
260 |
+
'include' => FACTORY_FORMS_423_DIR . '/controls/customs/separator.php',
|
261 |
+
],
|
262 |
+
] );
|
263 |
+
|
264 |
+
// registration of form layouts
|
265 |
+
$plugin->forms->registerFormLayout( [
|
266 |
+
'name' => 'bootstrap-3',
|
267 |
+
'class' => 'Wbcr_FactoryForms423_Bootstrap3FormLayout',
|
268 |
+
'include' => FACTORY_FORMS_423_DIR . '/layouts/bootstrap-3/bootstrap-3.php'
|
269 |
+
] );
|
270 |
+
}
|
271 |
+
|
272 |
+
add_action( 'wbcr_factory_forms_423_register_controls', 'wbcr_factory_forms_423_register_default_controls' );
|
273 |
+
}
|
libs/factory/forms/controls/checkbox.php
CHANGED
@@ -20,9 +20,9 @@
|
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
-
if( !class_exists('
|
24 |
|
25 |
-
class
|
26 |
|
27 |
public $type = 'checkbox';
|
28 |
|
@@ -130,10 +130,10 @@
|
|
130 |
<div <?php $this->attrs() ?>>
|
131 |
<button type="button" class="btn btn-default btn-small btn-sm factory-on <?php if( $value ) {
|
132 |
echo 'active';
|
133 |
-
} ?>"><?php _e('On', '
|
134 |
<button type="button" class="btn btn-default btn-small btn-sm factory-off <?php if( !$value ) {
|
135 |
echo 'active';
|
136 |
-
} ?>" data-value="0"><?php _e('Off', '
|
137 |
<input type="checkbox" style="display: none" id="<?php echo $name_on_form ?>" class="factory-result" name="<?php echo $name_on_form ?>" value="<?= $value ?>" <?php if( $value ) {
|
138 |
echo 'checked="checked"';
|
139 |
} ?>" />
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
+
if( !class_exists('Wbcr_FactoryForms423_CheckboxControl') ) {
|
24 |
|
25 |
+
class Wbcr_FactoryForms423_CheckboxControl extends Wbcr_FactoryForms423_Control {
|
26 |
|
27 |
public $type = 'checkbox';
|
28 |
|
130 |
<div <?php $this->attrs() ?>>
|
131 |
<button type="button" class="btn btn-default btn-small btn-sm factory-on <?php if( $value ) {
|
132 |
echo 'active';
|
133 |
+
} ?>"><?php _e('On', 'wbcr_factory_forms_423') ?></button>
|
134 |
<button type="button" class="btn btn-default btn-small btn-sm factory-off <?php if( !$value ) {
|
135 |
echo 'active';
|
136 |
+
} ?>" data-value="0"><?php _e('Off', 'wbcr_factory_forms_423') ?></button>
|
137 |
<input type="checkbox" style="display: none" id="<?php echo $name_on_form ?>" class="factory-result" name="<?php echo $name_on_form ?>" value="<?= $value ?>" <?php if( $value ) {
|
138 |
echo 'checked="checked"';
|
139 |
} ?>" />
|
libs/factory/forms/controls/color-and-opacity.php
CHANGED
@@ -20,10 +20,10 @@
|
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
-
if( !class_exists('
|
24 |
}
|
25 |
|
26 |
-
class
|
27 |
|
28 |
public $type = 'color-and-opacity';
|
29 |
|
@@ -57,8 +57,8 @@
|
|
57 |
'way' => 'slider'
|
58 |
));
|
59 |
|
60 |
-
$this->color = new
|
61 |
-
$this->opacity = new
|
62 |
|
63 |
$this->innerControls = array($this->color, $this->opacity);
|
64 |
}
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
+
if( !class_exists('Wbcr_FactoryForms423_ColorAndOpacityControl') ) {
|
24 |
}
|
25 |
|
26 |
+
class Wbcr_FactoryForms423_ColorAndOpacityControl extends Wbcr_FactoryForms423_ComplexControl {
|
27 |
|
28 |
public $type = 'color-and-opacity';
|
29 |
|
57 |
'way' => 'slider'
|
58 |
));
|
59 |
|
60 |
+
$this->color = new Wbcr_FactoryForms423_ColorControl($options['color'], $form, $provider);
|
61 |
+
$this->opacity = new Wbcr_FactoryForms423_IntegerControl($options['opacity'], $form, $provider);
|
62 |
|
63 |
$this->innerControls = array($this->color, $this->opacity);
|
64 |
}
|
libs/factory/forms/controls/color.php
CHANGED
@@ -20,9 +20,9 @@
|
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
-
if( !class_exists('
|
24 |
|
25 |
-
class
|
26 |
|
27 |
public $type = 'color';
|
28 |
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
+
if( !class_exists('Wbcr_FactoryForms423_ColorControl') ) {
|
24 |
|
25 |
+
class Wbcr_FactoryForms423_ColorControl extends Wbcr_FactoryForms423_Control {
|
26 |
|
27 |
public $type = 'color';
|
28 |
|
libs/factory/forms/controls/customs/html.php
CHANGED
@@ -14,9 +14,9 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
-
class
|
20 |
|
21 |
public $type = 'html';
|
22 |
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_Html') ) {
|
18 |
|
19 |
+
class Wbcr_FactoryForms423_Html extends Wbcr_FactoryForms423_CustomElement {
|
20 |
|
21 |
public $type = 'html';
|
22 |
|
libs/factory/forms/controls/customs/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/controls/customs/separator.php
CHANGED
@@ -14,8 +14,8 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
-
class
|
19 |
|
20 |
public $type = 'separator';
|
21 |
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_Separator') ) {
|
18 |
+
class Wbcr_FactoryForms423_Separator extends Wbcr_FactoryForms423_CustomElement {
|
19 |
|
20 |
public $type = 'separator';
|
21 |
|
libs/factory/forms/controls/datepicker-range.php
CHANGED
@@ -29,9 +29,9 @@
|
|
29 |
exit;
|
30 |
}
|
31 |
|
32 |
-
if( !class_exists('
|
33 |
|
34 |
-
class
|
35 |
|
36 |
public $type = 'datetimepicker-range';
|
37 |
|
@@ -65,8 +65,8 @@
|
|
65 |
'default' => date('Y/m/d H:i', strtotime("+1 month"))
|
66 |
), $options['range_2']);
|
67 |
|
68 |
-
$this->range_1 = new
|
69 |
-
$this->range_2 = new
|
70 |
$this->inner_controls = array($this->range_1, $this->range_2);
|
71 |
|
72 |
foreach($this->inner_controls as $key => $control) {
|
29 |
exit;
|
30 |
}
|
31 |
|
32 |
+
if( !class_exists('Wbcr_FactoryForms423_DatepickerRangeControl') ) {
|
33 |
|
34 |
+
class Wbcr_FactoryForms423_DatepickerRangeControl extends Wbcr_FactoryForms423_ComplexControl {
|
35 |
|
36 |
public $type = 'datetimepicker-range';
|
37 |
|
65 |
'default' => date('Y/m/d H:i', strtotime("+1 month"))
|
66 |
), $options['range_2']);
|
67 |
|
68 |
+
$this->range_1 = new Wbcr_FactoryForms423_TextboxControl($options['range_1'], $form, $provider);
|
69 |
+
$this->range_2 = new Wbcr_FactoryForms423_TextboxControl($options['range_2'], $form, $provider);
|
70 |
$this->inner_controls = array($this->range_1, $this->range_2);
|
71 |
|
72 |
foreach($this->inner_controls as $key => $control) {
|
libs/factory/forms/controls/dropdown-and-colors.php
CHANGED
@@ -5,14 +5,14 @@
|
|
5 |
*
|
6 |
* Main options:
|
7 |
* name => a name of the control
|
8 |
-
* // see
|
9 |
* 'dropdown' => array(
|
10 |
* // a callback to return items or an array of items to select
|
11 |
* 'data' => OPanda_ThemeManager::getThemes(OPanda_Items::getCurrentItemName(), 'dropdown'),
|
12 |
* 'default' => 'default',
|
13 |
* 'value' => 'value' // a value to show in the control
|
14 |
* ),
|
15 |
-
* // see
|
16 |
* 'colors' => array(
|
17 |
* // a callback to return items or an array of items to select
|
18 |
* 'data' => array(
|
@@ -37,9 +37,9 @@
|
|
37 |
exit;
|
38 |
}
|
39 |
|
40 |
-
if( !class_exists('
|
41 |
|
42 |
-
class
|
43 |
|
44 |
public $type = 'dropdown-and-colors';
|
45 |
|
@@ -69,8 +69,8 @@
|
|
69 |
'name' => $this->options['name'] . '__colors',
|
70 |
));
|
71 |
|
72 |
-
$this->dropdown = new
|
73 |
-
$this->colors = new
|
74 |
$this->inner_controls = array($this->dropdown, $this->colors);
|
75 |
|
76 |
$colors = $this->colors->getOption('data');
|
5 |
*
|
6 |
* Main options:
|
7 |
* name => a name of the control
|
8 |
+
* // see FactoryForms423_DropdownControl
|
9 |
* 'dropdown' => array(
|
10 |
* // a callback to return items or an array of items to select
|
11 |
* 'data' => OPanda_ThemeManager::getThemes(OPanda_Items::getCurrentItemName(), 'dropdown'),
|
12 |
* 'default' => 'default',
|
13 |
* 'value' => 'value' // a value to show in the control
|
14 |
* ),
|
15 |
+
* // see FactoryForms423_RadioColorsControl
|
16 |
* 'colors' => array(
|
17 |
* // a callback to return items or an array of items to select
|
18 |
* 'data' => array(
|
37 |
exit;
|
38 |
}
|
39 |
|
40 |
+
if( !class_exists('Wbcr_FactoryForms423_DropdownAndColorsControl') ) {
|
41 |
|
42 |
+
class Wbcr_FactoryForms423_DropdownAndColorsControl extends Wbcr_FactoryForms423_ComplexControl {
|
43 |
|
44 |
public $type = 'dropdown-and-colors';
|
45 |
|
69 |
'name' => $this->options['name'] . '__colors',
|
70 |
));
|
71 |
|
72 |
+
$this->dropdown = new Wbcr_FactoryForms423_DropdownControl($options['dropdown'], $form, $provider);
|
73 |
+
$this->colors = new Wbcr_FactoryForms423_RadioColorsControl($options['colors'], $form, $provider);
|
74 |
$this->inner_controls = array($this->dropdown, $this->colors);
|
75 |
|
76 |
$colors = $this->colors->getOption('data');
|
libs/factory/forms/controls/dropdown.php
CHANGED
@@ -21,9 +21,9 @@
|
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
-
if ( ! class_exists( '
|
25 |
|
26 |
-
class
|
27 |
|
28 |
public $type = 'dropdown';
|
29 |
|
@@ -123,7 +123,7 @@
|
|
123 |
'url': '<?php echo $data['url'] ?>',
|
124 |
'data': <?php echo json_encode( $data['data'] ) ?>,
|
125 |
'selected': '<?php echo $value ?>',
|
126 |
-
'empty_list': '<?php echo $this->getOption( 'empty', __( 'The list is empty.', '
|
127 |
};
|
128 |
</script>
|
129 |
<?php
|
@@ -268,7 +268,7 @@
|
|
268 |
}
|
269 |
|
270 |
$is_empty = $this->isAjax() || empty( $items );
|
271 |
-
$empty_list = $this->getOption( 'empty', __( '- empty -', '
|
272 |
|
273 |
?>
|
274 |
<select <?php $this->attrs() ?>>
|
@@ -349,7 +349,7 @@
|
|
349 |
}
|
350 |
|
351 |
$value = isset( $item['value'] ) ? $item['value'] : '';
|
352 |
-
$title = isset( $item['title'] ) ? $item['title'] : __( '- empty -', '
|
353 |
|
354 |
$data = isset( $item['data'] ) ? $item['data'] : null;
|
355 |
} else {
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
+
if ( ! class_exists( 'Wbcr_FactoryForms423_DropdownControl' ) ) {
|
25 |
|
26 |
+
class Wbcr_FactoryForms423_DropdownControl extends Wbcr_FactoryForms423_Control {
|
27 |
|
28 |
public $type = 'dropdown';
|
29 |
|
123 |
'url': '<?php echo $data['url'] ?>',
|
124 |
'data': <?php echo json_encode( $data['data'] ) ?>,
|
125 |
'selected': '<?php echo $value ?>',
|
126 |
+
'empty_list': '<?php echo $this->getOption( 'empty', __( 'The list is empty.', 'wbcr_factory_forms_423' ) ) ?>'
|
127 |
};
|
128 |
</script>
|
129 |
<?php
|
268 |
}
|
269 |
|
270 |
$is_empty = $this->isAjax() || empty( $items );
|
271 |
+
$empty_list = $this->getOption( 'empty', __( '- empty -', 'wbcr_factory_forms_423' ) );
|
272 |
|
273 |
?>
|
274 |
<select <?php $this->attrs() ?>>
|
349 |
}
|
350 |
|
351 |
$value = isset( $item['value'] ) ? $item['value'] : '';
|
352 |
+
$title = isset( $item['title'] ) ? $item['title'] : __( '- empty -', 'wbcr_factory_forms_423' );
|
353 |
|
354 |
$data = isset( $item['data'] ) ? $item['data'] : null;
|
355 |
} else {
|
libs/factory/forms/controls/font.php
CHANGED
@@ -20,9 +20,9 @@
|
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
-
if( !class_exists('
|
24 |
|
25 |
-
class
|
26 |
|
27 |
public $type = 'font';
|
28 |
|
@@ -54,9 +54,9 @@
|
|
54 |
'pickerTarget' => '.factory-control-' . $this->options['name'] . ' .factory-picker-target'
|
55 |
);
|
56 |
|
57 |
-
$this->size = new
|
58 |
-
$this->family = new
|
59 |
-
$this->color = new
|
60 |
|
61 |
$this->innerControls = array($this->family, $this->size, $this->color);
|
62 |
}
|
@@ -66,8 +66,8 @@
|
|
66 |
|
67 |
$fonts = $this->getDefaultFonts();
|
68 |
|
69 |
-
$fonts = apply_filters('
|
70 |
-
$fonts = apply_filters('
|
71 |
|
72 |
return $fonts;
|
73 |
}
|
@@ -77,10 +77,10 @@
|
|
77 |
|
78 |
$fonts = array(
|
79 |
|
80 |
-
array('inherit', __('(use default website font)', '
|
81 |
array(
|
82 |
'group',
|
83 |
-
__('Sans Serif:', '
|
84 |
array(
|
85 |
array('Arial, "Helvetica Neue", Helvetica, sans-serif', 'Arial'),
|
86 |
array('"Arial Black", "Arial Bold", Gadget, sans-serif', 'Arial Black'),
|
@@ -131,7 +131,7 @@
|
|
131 |
),
|
132 |
array(
|
133 |
'group',
|
134 |
-
__('Serif:', '
|
135 |
array(
|
136 |
array(
|
137 |
'Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif',
|
@@ -187,7 +187,7 @@
|
|
187 |
),
|
188 |
array(
|
189 |
'group',
|
190 |
-
__('Monospaced:', '
|
191 |
array(
|
192 |
array('"Andale Mono", AndaleMono, monospace', 'Andale Mono'),
|
193 |
array('Consolas, monaco, monospace', 'Consolas'),
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
+
if( !class_exists('Wbcr_FactoryForms423_FontControl') ) {
|
24 |
|
25 |
+
class Wbcr_FactoryForms423_FontControl extends Wbcr_FactoryForms423_ComplexControl {
|
26 |
|
27 |
public $type = 'font';
|
28 |
|
54 |
'pickerTarget' => '.factory-control-' . $this->options['name'] . ' .factory-picker-target'
|
55 |
);
|
56 |
|
57 |
+
$this->size = new Wbcr_FactoryForms423_IntegerControl($option_font_size, $form, $provider);
|
58 |
+
$this->family = new Wbcr_FactoryForms423_DropdownControl($option_font_family, $form, $provider);
|
59 |
+
$this->color = new Wbcr_FactoryForms423_ColorControl($optionFontColor, $form, $provider);
|
60 |
|
61 |
$this->innerControls = array($this->family, $this->size, $this->color);
|
62 |
}
|
66 |
|
67 |
$fonts = $this->getDefaultFonts();
|
68 |
|
69 |
+
$fonts = apply_filters('wbcr_factory_forms_423_fonts', $fonts);
|
70 |
+
$fonts = apply_filters('wbcr_factory_forms_423_fonts-' . $this->options['name'], $fonts);
|
71 |
|
72 |
return $fonts;
|
73 |
}
|
77 |
|
78 |
$fonts = array(
|
79 |
|
80 |
+
array('inherit', __('(use default website font)', 'wbcr_factory_forms_423')),
|
81 |
array(
|
82 |
'group',
|
83 |
+
__('Sans Serif:', 'wbcr_factory_forms_423'),
|
84 |
array(
|
85 |
array('Arial, "Helvetica Neue", Helvetica, sans-serif', 'Arial'),
|
86 |
array('"Arial Black", "Arial Bold", Gadget, sans-serif', 'Arial Black'),
|
131 |
),
|
132 |
array(
|
133 |
'group',
|
134 |
+
__('Serif:', 'wbcr_factory_forms_423'),
|
135 |
array(
|
136 |
array(
|
137 |
'Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif',
|
187 |
),
|
188 |
array(
|
189 |
'group',
|
190 |
+
__('Monospaced:', 'wbcr_factory_forms_423'),
|
191 |
array(
|
192 |
array('"Andale Mono", AndaleMono, monospace', 'Andale Mono'),
|
193 |
array('Consolas, monaco, monospace', 'Consolas'),
|
libs/factory/forms/controls/google-font.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @package core
|
16 |
* @since 1.0.0
|
17 |
*/
|
18 |
-
class
|
19 |
|
20 |
public $type = 'google-font';
|
21 |
const APIKEY = 'AIzaSyB-3vazYv7Q-5QZA04bmSKFrWcw_VhC40w';
|
@@ -30,7 +30,7 @@
|
|
30 |
'cssClass' => 'factory-google-font-data'
|
31 |
);
|
32 |
|
33 |
-
$this->google_font_data = new
|
34 |
$this->inner_controls[] = $this->google_font_data;
|
35 |
}
|
36 |
|
@@ -49,12 +49,12 @@
|
|
49 |
$google_fonts = $this->getGoogleFonts();
|
50 |
|
51 |
$fonts = array(
|
52 |
-
array('inherit', __('(use default website font)', '
|
53 |
);
|
54 |
|
55 |
$fontsCommon = array(
|
56 |
'group',
|
57 |
-
__('Standard:', '
|
58 |
array(
|
59 |
|
60 |
array('Arial, "Helvetica Neue", Helvetica, sans-serif', 'Arial'),
|
@@ -65,7 +65,7 @@
|
|
65 |
)
|
66 |
);
|
67 |
|
68 |
-
$fontsGoogleFonts = array('group', __('Google Fonts:', '
|
69 |
|
70 |
foreach($google_fonts->items as $item) {
|
71 |
|
@@ -115,7 +115,7 @@
|
|
115 |
|
116 |
if( is_wp_error($response) ) {
|
117 |
|
118 |
-
$this->error = __('Unable to retrieve the list of Google Fonts.', '
|
119 |
$this->defailed_error = $response->get_error_message();
|
120 |
|
121 |
return $body;
|
@@ -123,7 +123,7 @@
|
|
123 |
|
124 |
if( !isset($response['body']) ) {
|
125 |
|
126 |
-
$this->error = __('Invalide response from the Google Fonts API.', '
|
127 |
$this->defailed_error = $response['body'];
|
128 |
|
129 |
return $body;
|
@@ -133,7 +133,7 @@
|
|
133 |
|
134 |
if( empty($body->items) ) {
|
135 |
|
136 |
-
$this->error = __('Unexpected error. The list of Google Fonts are empty.', '
|
137 |
|
138 |
return $body;
|
139 |
}
|
15 |
* @package core
|
16 |
* @since 1.0.0
|
17 |
*/
|
18 |
+
class Wbcr_FactoryForms423_GoogleFontControl extends Wbcr_FactoryForms423_FontControl {
|
19 |
|
20 |
public $type = 'google-font';
|
21 |
const APIKEY = 'AIzaSyB-3vazYv7Q-5QZA04bmSKFrWcw_VhC40w';
|
30 |
'cssClass' => 'factory-google-font-data'
|
31 |
);
|
32 |
|
33 |
+
$this->google_font_data = new Wbcr_FactoryForms423_HiddenControl($option_google_font_data, $form, $provider);
|
34 |
$this->inner_controls[] = $this->google_font_data;
|
35 |
}
|
36 |
|
49 |
$google_fonts = $this->getGoogleFonts();
|
50 |
|
51 |
$fonts = array(
|
52 |
+
array('inherit', __('(use default website font)', 'wbcr_factory_forms_423'))
|
53 |
);
|
54 |
|
55 |
$fontsCommon = array(
|
56 |
'group',
|
57 |
+
__('Standard:', 'wbcr_factory_forms_423'),
|
58 |
array(
|
59 |
|
60 |
array('Arial, "Helvetica Neue", Helvetica, sans-serif', 'Arial'),
|
65 |
)
|
66 |
);
|
67 |
|
68 |
+
$fontsGoogleFonts = array('group', __('Google Fonts:', 'wbcr_factory_forms_423'), array());
|
69 |
|
70 |
foreach($google_fonts->items as $item) {
|
71 |
|
115 |
|
116 |
if( is_wp_error($response) ) {
|
117 |
|
118 |
+
$this->error = __('Unable to retrieve the list of Google Fonts.', 'wbcr_factory_forms_423');
|
119 |
$this->defailed_error = $response->get_error_message();
|
120 |
|
121 |
return $body;
|
123 |
|
124 |
if( !isset($response['body']) ) {
|
125 |
|
126 |
+
$this->error = __('Invalide response from the Google Fonts API.', 'wbcr_factory_forms_423');
|
127 |
$this->defailed_error = $response['body'];
|
128 |
|
129 |
return $body;
|
133 |
|
134 |
if( empty($body->items) ) {
|
135 |
|
136 |
+
$this->error = __('Unexpected error. The list of Google Fonts are empty.', 'wbcr_factory_forms_423');
|
137 |
|
138 |
return $body;
|
139 |
}
|
libs/factory/forms/controls/gradient.php
CHANGED
@@ -25,8 +25,8 @@
|
|
25 |
exit;
|
26 |
}
|
27 |
|
28 |
-
if( !class_exists('
|
29 |
-
class
|
30 |
|
31 |
public $type = 'gradient';
|
32 |
|
@@ -66,8 +66,8 @@
|
|
66 |
if( !window.factory.res ) {
|
67 |
window.factory.res = {};
|
68 |
}
|
69 |
-
factory.res.resVertical = '<?php _e( 'vertical', '
|
70 |
-
factory.res.resHorizontal = '<?php _e( 'horizontal', '
|
71 |
</script>
|
72 |
<div <?php $this->attrs() ?>>
|
73 |
<div class="factory-gradient-picker">
|
25 |
exit;
|
26 |
}
|
27 |
|
28 |
+
if( !class_exists('Wbcr_FactoryForms423_GradientControl') ) {
|
29 |
+
class Wbcr_FactoryForms423_GradientControl extends Wbcr_FactoryForms423_Control {
|
30 |
|
31 |
public $type = 'gradient';
|
32 |
|
66 |
if( !window.factory.res ) {
|
67 |
window.factory.res = {};
|
68 |
}
|
69 |
+
factory.res.resVertical = '<?php _e( 'vertical', 'wbcr_factory_forms_423' ) ?>';
|
70 |
+
factory.res.resHorizontal = '<?php _e( 'horizontal', 'wbcr_factory_forms_423' ) ?>';
|
71 |
</script>
|
72 |
<div <?php $this->attrs() ?>>
|
73 |
<div class="factory-gradient-picker">
|
libs/factory/forms/controls/hidden.php
CHANGED
@@ -20,9 +20,9 @@
|
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
-
if( !class_exists('
|
24 |
|
25 |
-
class
|
26 |
|
27 |
public $type = 'hidden';
|
28 |
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
+
if( !class_exists('Wbcr_FactoryForms423_HiddenControl') ) {
|
24 |
|
25 |
+
class Wbcr_FactoryForms423_HiddenControl extends Wbcr_FactoryForms423_Control {
|
26 |
|
27 |
public $type = 'hidden';
|
28 |
|
libs/factory/forms/controls/holders/accordion-item.php
CHANGED
@@ -14,14 +14,14 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
class
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_AccordionItemHolder') ) {
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
class Wbcr_FactoryForms423_AccordionItemHolder extends Wbcr_FactoryForms423_Holder {
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
libs/factory/forms/controls/holders/accordion.php
CHANGED
@@ -13,13 +13,13 @@
|
|
13 |
if( !defined('ABSPATH') ) {
|
14 |
exit;
|
15 |
}
|
16 |
-
if( !class_exists('
|
17 |
/**
|
18 |
* Tab Control Holder
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
-
class
|
23 |
|
24 |
/**
|
25 |
* A holder type.
|
13 |
if( !defined('ABSPATH') ) {
|
14 |
exit;
|
15 |
}
|
16 |
+
if( !class_exists('Wbcr_FactoryForms423_AccordionHolder') ) {
|
17 |
/**
|
18 |
* Tab Control Holder
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
+
class Wbcr_FactoryForms423_AccordionHolder extends Wbcr_FactoryForms423_Holder {
|
23 |
|
24 |
/**
|
25 |
* A holder type.
|
libs/factory/forms/controls/holders/columns.php
CHANGED
@@ -14,13 +14,13 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* Columns Holder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
class
|
24 |
|
25 |
/**
|
26 |
* A holder type.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_ColumnsHolder') ) {
|
18 |
/**
|
19 |
* Columns Holder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
class Wbcr_FactoryForms423_ColumnsHolder extends Wbcr_FactoryForms423_Holder {
|
24 |
|
25 |
/**
|
26 |
* A holder type.
|
libs/factory/forms/controls/holders/control-group-item.php
CHANGED
@@ -14,14 +14,14 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
class
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_ControlGroupItem') ) {
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
class Wbcr_FactoryForms423_ControlGroupItem extends Wbcr_FactoryForms423_Holder {
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
libs/factory/forms/controls/holders/control-group.php
CHANGED
@@ -14,14 +14,14 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
class
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
@@ -61,7 +61,7 @@
|
|
61 |
continue;
|
62 |
}
|
63 |
|
64 |
-
$builder = new
|
65 |
|
66 |
$builder->addCssClass('factory-control-group-nav-label');
|
67 |
$builder->addCssClass('factory-control-group-nav-label-' . $element->getOption('name'));
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_ControlGroupHolder') ) {
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
class Wbcr_FactoryForms423_ControlGroupHolder extends Wbcr_FactoryForms423_ControlHolder {
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
61 |
continue;
|
62 |
}
|
63 |
|
64 |
+
$builder = new Wbcr_FactoryForms423_HtmlAttributeBuilder();
|
65 |
|
66 |
$builder->addCssClass('factory-control-group-nav-label');
|
67 |
$builder->addCssClass('factory-control-group-nav-label-' . $element->getOption('name'));
|
libs/factory/forms/controls/holders/div.php
CHANGED
@@ -14,13 +14,13 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* Div Control Holder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
class
|
24 |
|
25 |
/**
|
26 |
* A holder type.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_DivHolder') ) {
|
18 |
/**
|
19 |
* Div Control Holder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
class Wbcr_FactoryForms423_DivHolder extends Wbcr_FactoryForms423_Holder {
|
24 |
|
25 |
/**
|
26 |
* A holder type.
|
libs/factory/forms/controls/holders/form-group.php
CHANGED
@@ -14,13 +14,13 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* Group Holder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
class
|
24 |
|
25 |
/**
|
26 |
* A holder type.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_FormGroupHolder') ) {
|
18 |
/**
|
19 |
* Group Holder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
class Wbcr_FactoryForms423_FormGroupHolder extends Wbcr_FactoryForms423_Holder {
|
24 |
|
25 |
/**
|
26 |
* A holder type.
|
libs/factory/forms/controls/holders/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/controls/holders/more-link.php
CHANGED
@@ -14,14 +14,14 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* Collapsed Group Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
class
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_MoreLinkHolder') ) {
|
18 |
|
19 |
/**
|
20 |
* Collapsed Group Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
class Wbcr_FactoryForms423_MoreLinkHolder extends Wbcr_FactoryForms423_Holder {
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
libs/factory/forms/controls/holders/tab-item.php
CHANGED
@@ -13,13 +13,13 @@
|
|
13 |
exit;
|
14 |
}
|
15 |
|
16 |
-
if( !class_exists('
|
17 |
/**
|
18 |
* Tab Item Control Holder
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
-
class
|
23 |
|
24 |
/**
|
25 |
* A holder type.
|
13 |
exit;
|
14 |
}
|
15 |
|
16 |
+
if( !class_exists('Wbcr_FactoryForms423_TabItemHolder') ) {
|
17 |
/**
|
18 |
* Tab Item Control Holder
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
+
class Wbcr_FactoryForms423_TabItemHolder extends Wbcr_FactoryForms423_Holder {
|
23 |
|
24 |
/**
|
25 |
* A holder type.
|
libs/factory/forms/controls/holders/tab.php
CHANGED
@@ -14,14 +14,14 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
class
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
@@ -44,7 +44,7 @@
|
|
44 |
*
|
45 |
* @since 1.0.0
|
46 |
* @param mixed[] $options A holder options.
|
47 |
-
* @param
|
48 |
*/
|
49 |
public function __construct($options, $form)
|
50 |
{
|
@@ -88,7 +88,7 @@
|
|
88 |
$tab_icon = $element->options['icon'];
|
89 |
}
|
90 |
|
91 |
-
$builder = new
|
92 |
|
93 |
$builder->addCssClass('factory-tab-item-header');
|
94 |
$builder->addCssClass('factory-tab-item-header-' . $element->getName());
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_TabHolder') ) {
|
18 |
|
19 |
/**
|
20 |
* Tab Control Holder
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
class Wbcr_FactoryForms423_TabHolder extends Wbcr_FactoryForms423_Holder {
|
25 |
|
26 |
/**
|
27 |
* A holder type.
|
44 |
*
|
45 |
* @since 1.0.0
|
46 |
* @param mixed[] $options A holder options.
|
47 |
+
* @param FactoryForms423_Form $form A parent form.
|
48 |
*/
|
49 |
public function __construct($options, $form)
|
50 |
{
|
88 |
$tab_icon = $element->options['icon'];
|
89 |
}
|
90 |
|
91 |
+
$builder = new Wbcr_FactoryForms423_HtmlAttributeBuilder();
|
92 |
|
93 |
$builder->addCssClass('factory-tab-item-header');
|
94 |
$builder->addCssClass('factory-tab-item-header-' . $element->getName());
|
libs/factory/forms/controls/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/controls/integer.php
CHANGED
@@ -32,9 +32,9 @@
|
|
32 |
exit;
|
33 |
}
|
34 |
|
35 |
-
if( !class_exists('
|
36 |
|
37 |
-
class
|
38 |
|
39 |
public $type = 'integer';
|
40 |
|
32 |
exit;
|
33 |
}
|
34 |
|
35 |
+
if( !class_exists('Wbcr_FactoryForms423_IntegerControl') ) {
|
36 |
|
37 |
+
class Wbcr_FactoryForms423_IntegerControl extends Wbcr_FactoryForms423_Control {
|
38 |
|
39 |
public $type = 'integer';
|
40 |
|
libs/factory/forms/controls/list.php
CHANGED
@@ -21,9 +21,9 @@
|
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
-
if( !class_exists('
|
25 |
|
26 |
-
class
|
27 |
|
28 |
public $type = 'list';
|
29 |
|
@@ -93,7 +93,7 @@
|
|
93 |
'url': '<?php echo $data['url'] ?>',
|
94 |
'data': <?php echo json_encode( $data['data'] ) ?>,
|
95 |
'selected': <?php echo json_encode( $value ) ?>,
|
96 |
-
'emptyList': '<?php echo $this->getOption('empty', __('The list is empty.', '
|
97 |
};
|
98 |
</script>
|
99 |
<?php
|
@@ -136,7 +136,7 @@
|
|
136 |
: array();
|
137 |
|
138 |
$is_empty = $this->isAjax() || empty($items);
|
139 |
-
$emptyList = $this->getOption('empty', __('The list is empty.', '
|
140 |
|
141 |
if( $is_empty ) {
|
142 |
$this->addCssClass('factory-empty');
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
+
if( !class_exists('Wbcr_FactoryForms423_ListControl') ) {
|
25 |
|
26 |
+
class Wbcr_FactoryForms423_ListControl extends Wbcr_FactoryForms423_Control {
|
27 |
|
28 |
public $type = 'list';
|
29 |
|
93 |
'url': '<?php echo $data['url'] ?>',
|
94 |
'data': <?php echo json_encode( $data['data'] ) ?>,
|
95 |
'selected': <?php echo json_encode( $value ) ?>,
|
96 |
+
'emptyList': '<?php echo $this->getOption('empty', __('The list is empty.', 'wbcr_factory_forms_423') ) ?>'
|
97 |
};
|
98 |
</script>
|
99 |
<?php
|
136 |
: array();
|
137 |
|
138 |
$is_empty = $this->isAjax() || empty($items);
|
139 |
+
$emptyList = $this->getOption('empty', __('The list is empty.', 'wbcr_factory_forms_423'));
|
140 |
|
141 |
if( $is_empty ) {
|
142 |
$this->addCssClass('factory-empty');
|
libs/factory/forms/controls/multiple-textbox.php
CHANGED
@@ -15,9 +15,9 @@
|
|
15 |
exit;
|
16 |
}
|
17 |
|
18 |
-
if( !class_exists('
|
19 |
|
20 |
-
class
|
21 |
|
22 |
public $type = 'multiple-textbox';
|
23 |
|
@@ -86,7 +86,7 @@
|
|
86 |
<?php endif; ?>
|
87 |
</div>
|
88 |
<button class="btn btn-default btn-small factory-mtextbox-add-item">
|
89 |
-
<i class="fa fa-plus" aria-hidden="true"></i> <?php _e('Add new', '
|
90 |
</button>
|
91 |
</div>
|
92 |
|
15 |
exit;
|
16 |
}
|
17 |
|
18 |
+
if( !class_exists('Wbcr_FactoryForms423_MultipleTextboxControl') ) {
|
19 |
|
20 |
+
class Wbcr_FactoryForms423_MultipleTextboxControl extends Wbcr_FactoryForms423_Control {
|
21 |
|
22 |
public $type = 'multiple-textbox';
|
23 |
|
86 |
<?php endif; ?>
|
87 |
</div>
|
88 |
<button class="btn btn-default btn-small factory-mtextbox-add-item">
|
89 |
+
<i class="fa fa-plus" aria-hidden="true"></i> <?php _e('Add new', 'wbcr_factory_forms_423') ?>
|
90 |
</button>
|
91 |
</div>
|
92 |
|
libs/factory/forms/controls/paddings-editor.php
CHANGED
@@ -14,9 +14,9 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
-
class
|
20 |
|
21 |
public $type = 'paddings-editor';
|
22 |
|
@@ -67,7 +67,7 @@
|
|
67 |
</div>
|
68 |
<div class="factory-slider-container">
|
69 |
<label class="factory-title">
|
70 |
-
<?php _e('Select a side and move the slider to set up:', '
|
71 |
</label>
|
72 |
|
73 |
<div class="factory-slider">
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_PaddingsEditorControl') ) {
|
18 |
|
19 |
+
class Wbcr_FactoryForms423_PaddingsEditorControl extends Wbcr_FactoryForms423_Control {
|
20 |
|
21 |
public $type = 'paddings-editor';
|
22 |
|
67 |
</div>
|
68 |
<div class="factory-slider-container">
|
69 |
<label class="factory-title">
|
70 |
+
<?php _e('Select a side and move the slider to set up:', 'wbcr_factory_forms_423') ?>
|
71 |
</label>
|
72 |
|
73 |
<div class="factory-slider">
|
libs/factory/forms/controls/pattern.php
CHANGED
@@ -15,9 +15,9 @@
|
|
15 |
exit;
|
16 |
}
|
17 |
|
18 |
-
if( !class_exists('
|
19 |
|
20 |
-
class
|
21 |
|
22 |
public $type = 'pattern';
|
23 |
|
@@ -52,12 +52,12 @@
|
|
52 |
$name = $this->getOption('name');
|
53 |
|
54 |
// filters to get available patterns for the given background contols
|
55 |
-
$this->patterns = apply_filters('
|
56 |
-
$this->patterns = apply_filters('
|
57 |
|
58 |
$this->custom_patterns = $this->getOption('patterns', array());
|
59 |
|
60 |
-
$this->color = new
|
61 |
}
|
62 |
|
63 |
/**
|
@@ -102,19 +102,19 @@
|
|
102 |
</div>
|
103 |
<a href="#" class="button button-default factory-button factory-change-color-btn <?php if( $hasColor ) {
|
104 |
echo 'button-active';
|
105 |
-
} ?>" title="<?php _e('Change color', '
|
106 |
<i class="fa fa-flask"></i>
|
107 |
-
<span><?php _e('re-color', '
|
108 |
</a>
|
109 |
<input type="hidden" id="<?php echo $name[0]; ?>" name="<?php echo $name[0]; ?>" value="<?php echo esc_url($values['url']); ?>" class="factory-pattern-result">
|
110 |
<input type="hidden" id="<?php echo $name[1]; ?>" name="<?php echo $name[1]; ?>" value="<?php echo esc_attr($values['color']); ?>" class="factory-color-result">
|
111 |
</div>
|
112 |
<div class="factory-color-panel">
|
113 |
<div class="factory-color-wrap">
|
114 |
-
<span class="factory-color-label"><?php _e('Select color:', '
|
115 |
<?php $this->color->html() ?>
|
116 |
<div class="factory-hint">
|
117 |
-
<i><?php _e('Changing the color may takes a minute or more. Please be patient.', '
|
118 |
</div>
|
119 |
</div>
|
120 |
<div class="factory-picker-target"></div>
|
15 |
exit;
|
16 |
}
|
17 |
|
18 |
+
if( !class_exists('Wbcr_FactoryForms423_PatternControl') ) {
|
19 |
|
20 |
+
class Wbcr_FactoryForms423_PatternControl extends Wbcr_FactoryForms423_Control {
|
21 |
|
22 |
public $type = 'pattern';
|
23 |
|
52 |
$name = $this->getOption('name');
|
53 |
|
54 |
// filters to get available patterns for the given background contols
|
55 |
+
$this->patterns = apply_filters('wbcr_factory_forms_423_patterns', array());
|
56 |
+
$this->patterns = apply_filters('wbcr_factory_forms_423_patterns-' . $name, $this->patterns);
|
57 |
|
58 |
$this->custom_patterns = $this->getOption('patterns', array());
|
59 |
|
60 |
+
$this->color = new Wbcr_FactoryForms423_ColorControl($options['color'], $form, $provider);
|
61 |
}
|
62 |
|
63 |
/**
|
102 |
</div>
|
103 |
<a href="#" class="button button-default factory-button factory-change-color-btn <?php if( $hasColor ) {
|
104 |
echo 'button-active';
|
105 |
+
} ?>" title="<?php _e('Change color', 'wbcr_factory_forms_423') ?>">
|
106 |
<i class="fa fa-flask"></i>
|
107 |
+
<span><?php _e('re-color', 'wbcr_factory_forms_423') ?></span>
|
108 |
</a>
|
109 |
<input type="hidden" id="<?php echo $name[0]; ?>" name="<?php echo $name[0]; ?>" value="<?php echo esc_url($values['url']); ?>" class="factory-pattern-result">
|
110 |
<input type="hidden" id="<?php echo $name[1]; ?>" name="<?php echo $name[1]; ?>" value="<?php echo esc_attr($values['color']); ?>" class="factory-color-result">
|
111 |
</div>
|
112 |
<div class="factory-color-panel">
|
113 |
<div class="factory-color-wrap">
|
114 |
+
<span class="factory-color-label"><?php _e('Select color:', 'wbcr_factory_forms_423') ?></span>
|
115 |
<?php $this->color->html() ?>
|
116 |
<div class="factory-hint">
|
117 |
+
<i><?php _e('Changing the color may takes a minute or more. Please be patient.', 'wbcr_factory_forms_423') ?></i>
|
118 |
</div>
|
119 |
</div>
|
120 |
<div class="factory-picker-target"></div>
|
libs/factory/forms/controls/radio-colors.php
CHANGED
@@ -27,9 +27,9 @@
|
|
27 |
exit;
|
28 |
}
|
29 |
|
30 |
-
if( !class_exists('
|
31 |
|
32 |
-
class
|
33 |
|
34 |
public $type = 'radio-color';
|
35 |
|
27 |
exit;
|
28 |
}
|
29 |
|
30 |
+
if( !class_exists('Wbcr_FactoryForms423_RadioColorsControl') ) {
|
31 |
|
32 |
+
class Wbcr_FactoryForms423_RadioColorsControl extends Wbcr_FactoryForms423_Control {
|
33 |
|
34 |
public $type = 'radio-color';
|
35 |
|
libs/factory/forms/controls/radio.php
CHANGED
@@ -21,9 +21,9 @@
|
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
-
if( !class_exists('
|
25 |
|
26 |
-
class
|
27 |
|
28 |
public $type = 'radio';
|
29 |
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
+
if( !class_exists('Wbcr_FactoryForms423_RadioControl') ) {
|
25 |
|
26 |
+
class Wbcr_FactoryForms423_RadioControl extends Wbcr_FactoryForms423_Control {
|
27 |
|
28 |
public $type = 'radio';
|
29 |
|
libs/factory/forms/controls/textarea.php
CHANGED
@@ -20,9 +20,9 @@
|
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
-
if( !class_exists('
|
24 |
|
25 |
-
class
|
26 |
|
27 |
public $type = 'textarea';
|
28 |
|
20 |
exit;
|
21 |
}
|
22 |
|
23 |
+
if( !class_exists('Wbcr_FactoryForms423_TextareaControl') ) {
|
24 |
|
25 |
+
class Wbcr_FactoryForms423_TextareaControl extends Wbcr_FactoryForms423_Control {
|
26 |
|
27 |
public $type = 'textarea';
|
28 |
|
libs/factory/forms/controls/textbox.php
CHANGED
@@ -29,9 +29,9 @@
|
|
29 |
exit;
|
30 |
}
|
31 |
|
32 |
-
if( !class_exists('
|
33 |
|
34 |
-
class
|
35 |
|
36 |
public $type = 'textbox';
|
37 |
|
29 |
exit;
|
30 |
}
|
31 |
|
32 |
+
if( !class_exists('Wbcr_FactoryForms423_TextboxControl') ) {
|
33 |
|
34 |
+
class Wbcr_FactoryForms423_TextboxControl extends Wbcr_FactoryForms423_Control {
|
35 |
|
36 |
public $type = 'textbox';
|
37 |
|
libs/factory/forms/controls/url.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Url Control
|
5 |
*
|
6 |
* Main options:
|
7 |
-
* @see
|
8 |
*
|
9 |
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
10 |
* @copyright (c) 2018, Webcraftic Ltd
|
@@ -18,9 +18,9 @@
|
|
18 |
exit;
|
19 |
}
|
20 |
|
21 |
-
if( !class_exists('
|
22 |
|
23 |
-
class
|
24 |
|
25 |
public $type = 'url';
|
26 |
|
4 |
* Url Control
|
5 |
*
|
6 |
* Main options:
|
7 |
+
* @see FactoryForms423_TextboxControl
|
8 |
*
|
9 |
* @author Alex Kovalev <alex.kovalevv@gmail.com>
|
10 |
* @copyright (c) 2018, Webcraftic Ltd
|
18 |
exit;
|
19 |
}
|
20 |
|
21 |
+
if( !class_exists('Wbcr_FactoryForms423_UrlControl') ) {
|
22 |
|
23 |
+
class Wbcr_FactoryForms423_UrlControl extends Wbcr_FactoryForms423_TextboxControl {
|
24 |
|
25 |
public $type = 'url';
|
26 |
|
libs/factory/forms/controls/wp-editor.php
CHANGED
@@ -22,9 +22,9 @@
|
|
22 |
exit;
|
23 |
}
|
24 |
|
25 |
-
if( !class_exists('
|
26 |
|
27 |
-
class
|
28 |
|
29 |
public $type = 'wp-editor';
|
30 |
|
@@ -42,7 +42,7 @@
|
|
42 |
}
|
43 |
|
44 |
if( !isset($this->options['tinymce']['content_css']) ) {
|
45 |
-
$this->options['tinymce']['content_css'] =
|
46 |
}
|
47 |
}
|
48 |
|
22 |
exit;
|
23 |
}
|
24 |
|
25 |
+
if( !class_exists('Wbcr_FactoryForms423_WpEditorControl') ) {
|
26 |
|
27 |
+
class Wbcr_FactoryForms423_WpEditorControl extends Wbcr_FactoryForms423_Control {
|
28 |
|
29 |
public $type = 'wp-editor';
|
30 |
|
42 |
}
|
43 |
|
44 |
if( !isset($this->options['tinymce']['content_css']) ) {
|
45 |
+
$this->options['tinymce']['content_css'] = FACTORY_FORMS_423_URL . '/assets/css/editor.css';
|
46 |
}
|
47 |
}
|
48 |
|
libs/factory/forms/includes/complex-control.class.php
CHANGED
@@ -13,13 +13,13 @@
|
|
13 |
if( !defined('ABSPATH') ) {
|
14 |
exit;
|
15 |
}
|
16 |
-
if( !class_exists('
|
17 |
/**
|
18 |
* The base class for all controls.
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
-
abstract class
|
23 |
|
24 |
/**
|
25 |
* Is this element a complex control?
|
@@ -33,7 +33,7 @@
|
|
33 |
* Contains a set of internal controls.
|
34 |
*
|
35 |
* @since 1.0.0
|
36 |
-
* @var
|
37 |
*/
|
38 |
public $inner_controls = array();
|
39 |
|
@@ -41,7 +41,7 @@
|
|
41 |
* Sets a provider for the control.
|
42 |
*
|
43 |
* @since 1.0.0
|
44 |
-
* @param
|
45 |
* @return void
|
46 |
*/
|
47 |
public function setProvider($provider)
|
13 |
if( !defined('ABSPATH') ) {
|
14 |
exit;
|
15 |
}
|
16 |
+
if( !class_exists('Wbcr_FactoryForms423_ComplexControl') ) {
|
17 |
/**
|
18 |
* The base class for all controls.
|
19 |
*
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
+
abstract class Wbcr_FactoryForms423_ComplexControl extends Wbcr_FactoryForms423_Control {
|
23 |
|
24 |
/**
|
25 |
* Is this element a complex control?
|
33 |
* Contains a set of internal controls.
|
34 |
*
|
35 |
* @since 1.0.0
|
36 |
+
* @var Wbcr_FactoryForms423_Control[]
|
37 |
*/
|
38 |
public $inner_controls = array();
|
39 |
|
41 |
* Sets a provider for the control.
|
42 |
*
|
43 |
* @since 1.0.0
|
44 |
+
* @param Wbcr_IFactoryForms423_ValueProvider $provider
|
45 |
* @return void
|
46 |
*/
|
47 |
public function setProvider($provider)
|
libs/factory/forms/includes/control-holder.class.php
CHANGED
@@ -14,19 +14,19 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* The base class for control holders.
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
abstract class
|
24 |
|
25 |
/**
|
26 |
* Holder Elements.
|
27 |
*
|
28 |
* @since 1.0.0
|
29 |
-
* @var
|
30 |
*/
|
31 |
protected $elements = array();
|
32 |
|
@@ -43,7 +43,7 @@
|
|
43 |
*
|
44 |
* @since 1.0.0
|
45 |
* @param mixed[] $options A holder options.
|
46 |
-
* @param
|
47 |
*/
|
48 |
public function __construct($options, $form)
|
49 |
{
|
@@ -60,7 +60,7 @@
|
|
60 |
* Returns holder elements.
|
61 |
*
|
62 |
* @since 1.0.0
|
63 |
-
* @return
|
64 |
*/
|
65 |
public function getElements()
|
66 |
{
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_ControlHolder') ) {
|
18 |
/**
|
19 |
* The base class for control holders.
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
abstract class Wbcr_FactoryForms423_ControlHolder extends Wbcr_FactoryForms423_Control {
|
24 |
|
25 |
/**
|
26 |
* Holder Elements.
|
27 |
*
|
28 |
* @since 1.0.0
|
29 |
+
* @var Wbcr_FactoryForms423_Control[]
|
30 |
*/
|
31 |
protected $elements = array();
|
32 |
|
43 |
*
|
44 |
* @since 1.0.0
|
45 |
* @param mixed[] $options A holder options.
|
46 |
+
* @param Wbcr_FactoryForms423_Form $form A parent form.
|
47 |
*/
|
48 |
public function __construct($options, $form)
|
49 |
{
|
60 |
* Returns holder elements.
|
61 |
*
|
62 |
* @since 1.0.0
|
63 |
+
* @return Wbcr_FactoryForms423_FormElement[].
|
64 |
*/
|
65 |
public function getElements()
|
66 |
{
|
libs/factory/forms/includes/control.class.php
CHANGED
@@ -14,14 +14,14 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* The base class for all controls.
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
abstract class
|
25 |
|
26 |
/**
|
27 |
* Is this element a control?
|
@@ -43,7 +43,7 @@
|
|
43 |
* A provider that is used to get values.
|
44 |
*
|
45 |
* @since 1.0.0
|
46 |
-
* @var
|
47 |
*/
|
48 |
protected $provider = null;
|
49 |
|
@@ -51,7 +51,7 @@
|
|
51 |
* Create a new instance of the control.
|
52 |
*
|
53 |
* @param mixed[] $options
|
54 |
-
* @param
|
55 |
* @param null $provider
|
56 |
* @since 1.0.0
|
57 |
* @return void
|
@@ -66,7 +66,7 @@
|
|
66 |
* Sets a provider for the control.
|
67 |
*
|
68 |
* @since 1.0.0
|
69 |
-
* @param
|
70 |
* @return void
|
71 |
*/
|
72 |
public function setProvider($provider)
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_Control') ) {
|
18 |
|
19 |
/**
|
20 |
* The base class for all controls.
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
abstract class Wbcr_FactoryForms423_Control extends Wbcr_FactoryForms423_FormElement {
|
25 |
|
26 |
/**
|
27 |
* Is this element a control?
|
43 |
* A provider that is used to get values.
|
44 |
*
|
45 |
* @since 1.0.0
|
46 |
+
* @var Wbcr_IFactoryForms423_ValueProvider
|
47 |
*/
|
48 |
protected $provider = null;
|
49 |
|
51 |
* Create a new instance of the control.
|
52 |
*
|
53 |
* @param mixed[] $options
|
54 |
+
* @param FactoryForms423_Form $form
|
55 |
* @param null $provider
|
56 |
* @since 1.0.0
|
57 |
* @return void
|
66 |
* Sets a provider for the control.
|
67 |
*
|
68 |
* @since 1.0.0
|
69 |
+
* @param IFactoryForms423_ValueProvider $provider
|
70 |
* @return void
|
71 |
*/
|
72 |
public function setProvider($provider)
|
libs/factory/forms/includes/custom-element.class.php
CHANGED
@@ -14,13 +14,13 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* The base class for all controls.
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
abstract class
|
24 |
|
25 |
/**
|
26 |
* Is this element a custom form element?
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_CustomElement') ) {
|
18 |
/**
|
19 |
* The base class for all controls.
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
abstract class Wbcr_FactoryForms423_CustomElement extends Wbcr_FactoryForms423_FormElement {
|
24 |
|
25 |
/**
|
26 |
* Is this element a custom form element?
|
libs/factory/forms/includes/form-element.class.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* The base class for all form element (controls, holders).
|
@@ -23,7 +23,7 @@
|
|
23 |
*
|
24 |
* @since 1.0.0
|
25 |
*/
|
26 |
-
abstract class
|
27 |
|
28 |
/**
|
29 |
* A type of an elemnt.
|
@@ -37,7 +37,7 @@
|
|
37 |
* An html attribute builder.
|
38 |
*
|
39 |
* @since 1.0.0
|
40 |
-
* @var
|
41 |
*/
|
42 |
private $html_builder;
|
43 |
|
@@ -53,7 +53,7 @@
|
|
53 |
* A parent form.
|
54 |
*
|
55 |
* @since 1.0.0
|
56 |
-
* @var
|
57 |
*/
|
58 |
protected $form;
|
59 |
|
@@ -61,7 +61,7 @@
|
|
61 |
* A form layout.
|
62 |
*
|
63 |
* @since 1.0.0
|
64 |
-
* @var
|
65 |
*/
|
66 |
protected $layout;
|
67 |
|
@@ -94,7 +94,7 @@
|
|
94 |
*
|
95 |
* @since 1.0.0
|
96 |
* @param mixed[] $options A holder options.
|
97 |
-
* @param
|
98 |
*/
|
99 |
public function __construct($options, $form)
|
100 |
{
|
@@ -102,7 +102,7 @@
|
|
102 |
$this->form = $form;
|
103 |
$this->layout = $form->layout;
|
104 |
|
105 |
-
$this->html_builder = new
|
106 |
|
107 |
if( isset($this->options['cssClass']) ) {
|
108 |
$this->html_builder->addCssClass($this->options['cssClass']);
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_FormElement') ) {
|
18 |
|
19 |
/**
|
20 |
* The base class for all form element (controls, holders).
|
23 |
*
|
24 |
* @since 1.0.0
|
25 |
*/
|
26 |
+
abstract class Wbcr_FactoryForms423_FormElement {
|
27 |
|
28 |
/**
|
29 |
* A type of an elemnt.
|
37 |
* An html attribute builder.
|
38 |
*
|
39 |
* @since 1.0.0
|
40 |
+
* @var Wbcr_FactoryForms423_HtmlAttributeBuilder
|
41 |
*/
|
42 |
private $html_builder;
|
43 |
|
53 |
* A parent form.
|
54 |
*
|
55 |
* @since 1.0.0
|
56 |
+
* @var Wbcr_FactoryForms423_Form
|
57 |
*/
|
58 |
protected $form;
|
59 |
|
61 |
* A form layout.
|
62 |
*
|
63 |
* @since 1.0.0
|
64 |
+
* @var Wbcr_FactoryForms423_FormLayout
|
65 |
*/
|
66 |
protected $layout;
|
67 |
|
94 |
*
|
95 |
* @since 1.0.0
|
96 |
* @param mixed[] $options A holder options.
|
97 |
+
* @param Wbcr_FactoryForms423_Form $form A parent form.
|
98 |
*/
|
99 |
public function __construct($options, $form)
|
100 |
{
|
102 |
$this->form = $form;
|
103 |
$this->layout = $form->layout;
|
104 |
|
105 |
+
$this->html_builder = new Wbcr_FactoryForms423_HtmlAttributeBuilder();
|
106 |
|
107 |
if( isset($this->options['cssClass']) ) {
|
108 |
$this->html_builder->addCssClass($this->options['cssClass']);
|
libs/factory/forms/includes/form-layout.class.php
CHANGED
@@ -14,12 +14,12 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* The base class for all form layouts.
|
21 |
*/
|
22 |
-
abstract class
|
23 |
|
24 |
/**
|
25 |
* A form layout name.
|
@@ -42,7 +42,7 @@
|
|
42 |
*
|
43 |
* @since 1.0.0
|
44 |
* @param mixed[] $options A holder options.
|
45 |
-
* @param
|
46 |
*/
|
47 |
public function __construct($options, $form)
|
48 |
{
|
@@ -52,8 +52,8 @@
|
|
52 |
|
53 |
parent::__construct($options, $form);
|
54 |
|
55 |
-
$this->addCssClass('factory-forms-
|
56 |
-
$this->addCssClass('factory-forms-
|
57 |
}
|
58 |
|
59 |
/**
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_FormLayout') ) {
|
18 |
|
19 |
/**
|
20 |
* The base class for all form layouts.
|
21 |
*/
|
22 |
+
abstract class Wbcr_FactoryForms423_FormLayout extends Wbcr_FactoryForms423_Holder {
|
23 |
|
24 |
/**
|
25 |
* A form layout name.
|
42 |
*
|
43 |
* @since 1.0.0
|
44 |
* @param mixed[] $options A holder options.
|
45 |
+
* @param Wbcr_FactoryForms423_Form $form A parent form.
|
46 |
*/
|
47 |
public function __construct($options, $form)
|
48 |
{
|
52 |
|
53 |
parent::__construct($options, $form);
|
54 |
|
55 |
+
$this->addCssClass('factory-forms-423-' . $this->type);
|
56 |
+
$this->addCssClass('factory-forms-423-' . $this->name);
|
57 |
}
|
58 |
|
59 |
/**
|
libs/factory/forms/includes/form.class.php
CHANGED
@@ -15,16 +15,16 @@
|
|
15 |
}
|
16 |
|
17 |
// creating a license manager for each plugin created via the factory
|
18 |
-
add_action('
|
19 |
|
20 |
-
function
|
21 |
{
|
22 |
-
$plugin->forms = new
|
23 |
}
|
24 |
|
25 |
-
if( !class_exists('
|
26 |
|
27 |
-
class
|
28 |
|
29 |
// ----------------------------------------------------
|
30 |
// Static fields and methods
|
@@ -57,7 +57,7 @@
|
|
57 |
/**
|
58 |
* Registers a set of new controls.
|
59 |
*
|
60 |
-
* @see
|
61 |
*
|
62 |
* @since 1.0.0
|
63 |
* @return void
|
@@ -95,7 +95,7 @@
|
|
95 |
/**
|
96 |
* Registers a set of new holder controls.
|
97 |
*
|
98 |
-
* @see
|
99 |
*
|
100 |
* @since 1.0.0
|
101 |
* @return void
|
@@ -129,7 +129,7 @@
|
|
129 |
/**
|
130 |
* Registers a set of new custom form elements.
|
131 |
*
|
132 |
-
* @see
|
133 |
*
|
134 |
* @since 1.0.0
|
135 |
* @return void
|
@@ -180,11 +180,11 @@
|
|
180 |
public static $controls_registered = false;
|
181 |
}
|
182 |
}
|
183 |
-
if( !class_exists('
|
184 |
/**
|
185 |
* An abstraction for forms.
|
186 |
*/
|
187 |
-
class
|
188 |
|
189 |
// ----------------------------------------------------
|
190 |
// Object fields and methods
|
@@ -194,7 +194,7 @@
|
|
194 |
* A value provider of the form that is used to save and load values.
|
195 |
*
|
196 |
* @since 1.0.0
|
197 |
-
* @var
|
198 |
*/
|
199 |
private $provider;
|
200 |
|
@@ -245,7 +245,7 @@
|
|
245 |
* A current form layout used to render a form.
|
246 |
*
|
247 |
* @since 1.0.0
|
248 |
-
* @var
|
249 |
*/
|
250 |
public $layout;
|
251 |
|
@@ -261,20 +261,20 @@
|
|
261 |
*
|
262 |
* @since 1.0.0
|
263 |
* @param array $options
|
264 |
-
* @param
|
265 |
*/
|
266 |
-
public function __construct(array $options = array(),
|
267 |
{
|
268 |
// register controls once, when the first form is created
|
269 |
-
if( !
|
270 |
|
271 |
-
do_action('
|
272 |
|
273 |
//if( !empty($plugin) ) {
|
274 |
-
do_action('
|
275 |
//}
|
276 |
|
277 |
-
|
278 |
}
|
279 |
|
280 |
$this->scope = isset($options['scope']) ? $options['scope'] : null;
|
@@ -289,14 +289,14 @@
|
|
289 |
$this->form_layout = 'bootstrap-3';
|
290 |
}
|
291 |
|
292 |
-
|
293 |
}
|
294 |
|
295 |
/**
|
296 |
* Sets a provider for the control.
|
297 |
*
|
298 |
* @since 1.0.0
|
299 |
-
* @param
|
300 |
* @return void
|
301 |
*/
|
302 |
public function setProvider($provider)
|
@@ -332,14 +332,14 @@
|
|
332 |
*/
|
333 |
public function getItems()
|
334 |
{
|
335 |
-
return apply_filters('
|
336 |
}
|
337 |
|
338 |
/**
|
339 |
* Returns form controls (control objects).
|
340 |
*
|
341 |
* @since 1.0.0
|
342 |
-
* @return
|
343 |
*/
|
344 |
public function getControls()
|
345 |
{
|
@@ -355,7 +355,7 @@
|
|
355 |
* Builds a form items to the control objects ready to use.
|
356 |
*
|
357 |
* @param null $holder
|
358 |
-
* @return
|
359 |
*/
|
360 |
|
361 |
public function createControls($holder = null)
|
@@ -395,7 +395,7 @@
|
|
395 |
*
|
396 |
* @since 1.0.0
|
397 |
* @param array $item Item data.
|
398 |
-
* @return
|
399 |
*/
|
400 |
public function createElement($item)
|
401 |
{
|
@@ -417,7 +417,7 @@
|
|
417 |
*
|
418 |
* @since 1.0.0
|
419 |
* @param mixed[] $item Data of items.
|
420 |
-
* @return
|
421 |
*/
|
422 |
public function createElements($items = array())
|
423 |
{
|
@@ -433,7 +433,7 @@
|
|
433 |
*
|
434 |
* @since 1.0.0
|
435 |
* @param array $item Item data.
|
436 |
-
* @return
|
437 |
*/
|
438 |
public function createControl($item)
|
439 |
{
|
@@ -441,7 +441,7 @@
|
|
441 |
|
442 |
if( is_array($item) ) {
|
443 |
|
444 |
-
$control_data =
|
445 |
|
446 |
require_once($control_data['include']);
|
447 |
|
@@ -465,7 +465,7 @@
|
|
465 |
*
|
466 |
* @since 1.0.0
|
467 |
* @param array $item Item data.
|
468 |
-
* @return
|
469 |
*/
|
470 |
public function createHolder($item)
|
471 |
{
|
@@ -473,7 +473,7 @@
|
|
473 |
|
474 |
if( is_array($item) ) {
|
475 |
|
476 |
-
$holderData =
|
477 |
require_once($holderData['include']);
|
478 |
|
479 |
$object = new $holderData['class']($item, $this);
|
@@ -491,7 +491,7 @@
|
|
491 |
*
|
492 |
* @since 1.0.0
|
493 |
* @param mixed $item Item data.
|
494 |
-
* @return
|
495 |
*/
|
496 |
public function createCustomElement($item)
|
497 |
{
|
@@ -499,7 +499,7 @@
|
|
499 |
|
500 |
if( is_array($item) ) {
|
501 |
|
502 |
-
$data =
|
503 |
require_once($data['include']);
|
504 |
|
505 |
$options = $item;
|
@@ -523,12 +523,12 @@
|
|
523 |
public function html($options = array())
|
524 |
{
|
525 |
|
526 |
-
if( !isset(
|
527 |
die(sprintf('[ERROR] The form layout %s was not found.', $this->form_layout));
|
528 |
}
|
529 |
|
530 |
// include a render code
|
531 |
-
$layout_data =
|
532 |
require_once($layout_data['include']);
|
533 |
|
534 |
$this->connectAssets();
|
@@ -552,7 +552,7 @@
|
|
552 |
{
|
553 |
|
554 |
$this->connectAssetsForItems();
|
555 |
-
$layout_data =
|
556 |
|
557 |
if( $layout_data['name'] == 'default' ) {
|
558 |
if( isset($layout_data['style']) ) {
|
@@ -602,9 +602,9 @@
|
|
602 |
|
603 |
$haystack = array();
|
604 |
if( self::isControl($type) ) {
|
605 |
-
$haystack =
|
606 |
} elseif( self::isControlHolder($type) ) {
|
607 |
-
$haystack =
|
608 |
}
|
609 |
|
610 |
if( isset($haystack[$type]) ) {
|
@@ -660,7 +660,7 @@
|
|
660 |
*/
|
661 |
public static function isControl($item)
|
662 |
{
|
663 |
-
return isset(
|
664 |
}
|
665 |
|
666 |
/**
|
@@ -672,7 +672,7 @@
|
|
672 |
*/
|
673 |
public static function isControlHolder($item)
|
674 |
{
|
675 |
-
return isset(
|
676 |
}
|
677 |
|
678 |
/**
|
@@ -684,7 +684,7 @@
|
|
684 |
*/
|
685 |
public static function isCustomElement($item)
|
686 |
{
|
687 |
-
return isset(
|
688 |
}
|
689 |
}
|
690 |
}
|
15 |
}
|
16 |
|
17 |
// creating a license manager for each plugin created via the factory
|
18 |
+
add_action('wbcr_factory_forms_423_plugin_created', 'wbcr_factory_forms_423_plugin_created');
|
19 |
|
20 |
+
function wbcr_factory_forms_423_plugin_created($plugin)
|
21 |
{
|
22 |
+
$plugin->forms = new Wbcr_FactoryForms423_Manager($plugin);
|
23 |
}
|
24 |
|
25 |
+
if( !class_exists('Wbcr_FactoryForms423_Manager') ) {
|
26 |
|
27 |
+
class Wbcr_FactoryForms423_Manager {
|
28 |
|
29 |
// ----------------------------------------------------
|
30 |
// Static fields and methods
|
57 |
/**
|
58 |
* Registers a set of new controls.
|
59 |
*
|
60 |
+
* @see FactoryForms423_Form::registerControl()
|
61 |
*
|
62 |
* @since 1.0.0
|
63 |
* @return void
|
95 |
/**
|
96 |
* Registers a set of new holder controls.
|
97 |
*
|
98 |
+
* @see FactoryForms423_Form::registerHolder()
|
99 |
*
|
100 |
* @since 1.0.0
|
101 |
* @return void
|
129 |
/**
|
130 |
* Registers a set of new custom form elements.
|
131 |
*
|
132 |
+
* @see FactoryForms423_Form::registerCustomElement()
|
133 |
*
|
134 |
* @since 1.0.0
|
135 |
* @return void
|
180 |
public static $controls_registered = false;
|
181 |
}
|
182 |
}
|
183 |
+
if( !class_exists('Wbcr_FactoryForms423_Form') ) {
|
184 |
/**
|
185 |
* An abstraction for forms.
|
186 |
*/
|
187 |
+
class Wbcr_FactoryForms423_Form {
|
188 |
|
189 |
// ----------------------------------------------------
|
190 |
// Object fields and methods
|
194 |
* A value provider of the form that is used to save and load values.
|
195 |
*
|
196 |
* @since 1.0.0
|
197 |
+
* @var Wbcr_IFactoryForms423_ValueProvider
|
198 |
*/
|
199 |
private $provider;
|
200 |
|
245 |
* A current form layout used to render a form.
|
246 |
*
|
247 |
* @since 1.0.0
|
248 |
+
* @var Wbcr_FactoryForms423_FormLayout
|
249 |
*/
|
250 |
public $layout;
|
251 |
|
261 |
*
|
262 |
* @since 1.0.0
|
263 |
* @param array $options
|
264 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
265 |
*/
|
266 |
+
public function __construct(array $options = array(), Wbcr_Factory425_Plugin $plugin)
|
267 |
{
|
268 |
// register controls once, when the first form is created
|
269 |
+
if( !Wbcr_FactoryForms423_Manager::$controls_registered ) {
|
270 |
|
271 |
+
do_action('wbcr_factory_forms_423_register_controls', $plugin);
|
272 |
|
273 |
//if( !empty($plugin) ) {
|
274 |
+
do_action('wbcr_factory_forms_423_register_controls_' . $plugin->getPluginName(), $plugin);
|
275 |
//}
|
276 |
|
277 |
+
Wbcr_FactoryForms423_Manager::$controls_registered = true;
|
278 |
}
|
279 |
|
280 |
$this->scope = isset($options['scope']) ? $options['scope'] : null;
|
289 |
$this->form_layout = 'bootstrap-3';
|
290 |
}
|
291 |
|
292 |
+
Wbcr_FactoryForms423_Manager::$temper = 'flat';
|
293 |
}
|
294 |
|
295 |
/**
|
296 |
* Sets a provider for the control.
|
297 |
*
|
298 |
* @since 1.0.0
|
299 |
+
* @param Wbcr_IFactoryForms423_ValueProvider $provider
|
300 |
* @return void
|
301 |
*/
|
302 |
public function setProvider($provider)
|
332 |
*/
|
333 |
public function getItems()
|
334 |
{
|
335 |
+
return apply_filters('wbcr_factory_425_form_items', $this->items, $this->name);
|
336 |
}
|
337 |
|
338 |
/**
|
339 |
* Returns form controls (control objects).
|
340 |
*
|
341 |
* @since 1.0.0
|
342 |
+
* @return Wbcr_FactoryForms423_Control[]
|
343 |
*/
|
344 |
public function getControls()
|
345 |
{
|
355 |
* Builds a form items to the control objects ready to use.
|
356 |
*
|
357 |
* @param null $holder
|
358 |
+
* @return Wbcr_FactoryForms423_Control[]
|
359 |
*/
|
360 |
|
361 |
public function createControls($holder = null)
|
395 |
*
|
396 |
* @since 1.0.0
|
397 |
* @param array $item Item data.
|
398 |
+
* @return Wbcr_FactoryForms423_FormElement|null A form element.
|
399 |
*/
|
400 |
public function createElement($item)
|
401 |
{
|
417 |
*
|
418 |
* @since 1.0.0
|
419 |
* @param mixed[] $item Data of items.
|
420 |
+
* @return Wbcr_FactoryForms423_FormElement[] Created elements.
|
421 |
*/
|
422 |
public function createElements($items = array())
|
423 |
{
|
433 |
*
|
434 |
* @since 1.0.0
|
435 |
* @param array $item Item data.
|
436 |
+
* @return Wbcr_FactoryForms423_Control A control object.
|
437 |
*/
|
438 |
public function createControl($item)
|
439 |
{
|
441 |
|
442 |
if( is_array($item) ) {
|
443 |
|
444 |
+
$control_data = Wbcr_FactoryForms423_Manager::$registered_controls[$item['type']];
|
445 |
|
446 |
require_once($control_data['include']);
|
447 |
|
465 |
*
|
466 |
* @since 1.0.0
|
467 |
* @param array $item Item data.
|
468 |
+
* @return Wbcr_FactoryForms423_Holder A control holder object.
|
469 |
*/
|
470 |
public function createHolder($item)
|
471 |
{
|
473 |
|
474 |
if( is_array($item) ) {
|
475 |
|
476 |
+
$holderData = Wbcr_FactoryForms423_Manager::$registered_holders[$item['type']];
|
477 |
require_once($holderData['include']);
|
478 |
|
479 |
$object = new $holderData['class']($item, $this);
|
491 |
*
|
492 |
* @since 1.0.0
|
493 |
* @param mixed $item Item data.
|
494 |
+
* @return Wbcr_FactoryForms423_FormElement A custom form element object.
|
495 |
*/
|
496 |
public function createCustomElement($item)
|
497 |
{
|
499 |
|
500 |
if( is_array($item) ) {
|
501 |
|
502 |
+
$data = Wbcr_FactoryForms423_Manager::$registered_custom_elements[$item['type']];
|
503 |
require_once($data['include']);
|
504 |
|
505 |
$options = $item;
|
523 |
public function html($options = array())
|
524 |
{
|
525 |
|
526 |
+
if( !isset(Wbcr_FactoryForms423_Manager::$form_layouts[$this->form_layout]) ) {
|
527 |
die(sprintf('[ERROR] The form layout %s was not found.', $this->form_layout));
|
528 |
}
|
529 |
|
530 |
// include a render code
|
531 |
+
$layout_data = Wbcr_FactoryForms423_Manager::$form_layouts[$this->form_layout];
|
532 |
require_once($layout_data['include']);
|
533 |
|
534 |
$this->connectAssets();
|
552 |
{
|
553 |
|
554 |
$this->connectAssetsForItems();
|
555 |
+
$layout_data = Wbcr_FactoryForms423_Manager::$form_layouts[$this->form_layout];
|
556 |
|
557 |
if( $layout_data['name'] == 'default' ) {
|
558 |
if( isset($layout_data['style']) ) {
|
602 |
|
603 |
$haystack = array();
|
604 |
if( self::isControl($type) ) {
|
605 |
+
$haystack = Wbcr_FactoryForms423_Manager::$registered_controls;
|
606 |
} elseif( self::isControlHolder($type) ) {
|
607 |
+
$haystack = Wbcr_FactoryForms423_Manager::$registered_holders;
|
608 |
}
|
609 |
|
610 |
if( isset($haystack[$type]) ) {
|
660 |
*/
|
661 |
public static function isControl($item)
|
662 |
{
|
663 |
+
return isset(Wbcr_FactoryForms423_Manager::$registered_controls[$item['type']]);
|
664 |
}
|
665 |
|
666 |
/**
|
672 |
*/
|
673 |
public static function isControlHolder($item)
|
674 |
{
|
675 |
+
return isset(Wbcr_FactoryForms423_Manager::$registered_holders[$item['type']]);
|
676 |
}
|
677 |
|
678 |
/**
|
684 |
*/
|
685 |
public static function isCustomElement($item)
|
686 |
{
|
687 |
+
return isset(Wbcr_FactoryForms423_Manager::$registered_custom_elements[$item['type']]);
|
688 |
}
|
689 |
}
|
690 |
}
|
libs/factory/forms/includes/holder.class.php
CHANGED
@@ -14,20 +14,20 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* The base class for control holders.
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
-
abstract class
|
25 |
|
26 |
/**
|
27 |
* Holder Elements.
|
28 |
*
|
29 |
* @since 1.0.0
|
30 |
-
* @var
|
31 |
*/
|
32 |
protected $elements = array();
|
33 |
|
@@ -44,7 +44,7 @@
|
|
44 |
*
|
45 |
* @since 1.0.0
|
46 |
* @param mixed[] $options A holder options.
|
47 |
-
* @param
|
48 |
*/
|
49 |
public function __construct($options, $form)
|
50 |
{
|
@@ -56,7 +56,7 @@
|
|
56 |
* Returns holder elements.
|
57 |
*
|
58 |
* @since 1.0.0
|
59 |
-
* @return
|
60 |
*/
|
61 |
public function getElements()
|
62 |
{
|
@@ -84,7 +84,7 @@
|
|
84 |
$is_first_item = false;
|
85 |
}
|
86 |
|
87 |
-
do_action('
|
88 |
|
89 |
// if a current item is a control holder
|
90 |
if( $element->is_holder ) {
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_Holder') ) {
|
18 |
|
19 |
/**
|
20 |
* The base class for control holders.
|
21 |
*
|
22 |
* @since 1.0.0
|
23 |
*/
|
24 |
+
abstract class Wbcr_FactoryForms423_Holder extends Wbcr_FactoryForms423_FormElement {
|
25 |
|
26 |
/**
|
27 |
* Holder Elements.
|
28 |
*
|
29 |
* @since 1.0.0
|
30 |
+
* @var Wbcr_FactoryForms423_Control[]
|
31 |
*/
|
32 |
protected $elements = array();
|
33 |
|
44 |
*
|
45 |
* @since 1.0.0
|
46 |
* @param mixed[] $options A holder options.
|
47 |
+
* @param Wbcr_FactoryForms423_Form $form A parent form.
|
48 |
*/
|
49 |
public function __construct($options, $form)
|
50 |
{
|
56 |
* Returns holder elements.
|
57 |
*
|
58 |
* @since 1.0.0
|
59 |
+
* @return Wbcr_FactoryForms423_Control[].
|
60 |
*/
|
61 |
public function getElements()
|
62 |
{
|
84 |
$is_first_item = false;
|
85 |
}
|
86 |
|
87 |
+
do_action('wbcr_factory_425_form_before_element_' . $element->getOption('name'));
|
88 |
|
89 |
// if a current item is a control holder
|
90 |
if( $element->is_holder ) {
|
libs/factory/forms/includes/html-builder.class.php
CHANGED
@@ -14,13 +14,13 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* Html Attribute Builder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
class
|
24 |
|
25 |
/**
|
26 |
* An array to store css classes.
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_HtmlAttributeBuilder') ) {
|
18 |
/**
|
19 |
* Html Attribute Builder
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
class Wbcr_FactoryForms423_HtmlAttributeBuilder {
|
24 |
|
25 |
/**
|
26 |
* An array to store css classes.
|
libs/factory/forms/includes/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/includes/providers/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/includes/providers/meta-value-provider.class.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
|
19 |
/**
|
20 |
* Factory Meta Value Provider
|
@@ -24,7 +24,7 @@
|
|
24 |
*
|
25 |
* @since 1.0.0
|
26 |
*/
|
27 |
-
class
|
28 |
|
29 |
|
30 |
public $scope;
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_OptionsValueProvider') ) {
|
18 |
|
19 |
/**
|
20 |
* Factory Meta Value Provider
|
24 |
*
|
25 |
* @since 1.0.0
|
26 |
*/
|
27 |
+
class Wbcr_FactoryForms423_MetaValueProvider implements Wbcr_IFactoryForms423_ValueProvider {
|
28 |
|
29 |
|
30 |
public $scope;
|
libs/factory/forms/includes/providers/options-value-provider.class.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
exit;
|
14 |
}
|
15 |
|
16 |
-
if( !class_exists('
|
17 |
|
18 |
/**
|
19 |
* Factory Options Value Provider
|
@@ -22,7 +22,7 @@
|
|
22 |
*
|
23 |
* @since 1.0.0
|
24 |
*/
|
25 |
-
class
|
26 |
|
27 |
/**
|
28 |
* A prefix that will be added to all option names.
|
@@ -43,7 +43,7 @@
|
|
43 |
/**
|
44 |
* Creates a new instance of an options value provider.
|
45 |
*/
|
46 |
-
public function __construct(
|
47 |
{
|
48 |
$this->plugin = $plugin;
|
49 |
}
|
13 |
exit;
|
14 |
}
|
15 |
|
16 |
+
if( !class_exists('Wbcr_FactoryForms423_OptionsValueProvider') ) {
|
17 |
|
18 |
/**
|
19 |
* Factory Options Value Provider
|
22 |
*
|
23 |
* @since 1.0.0
|
24 |
*/
|
25 |
+
class Wbcr_FactoryForms423_OptionsValueProvider implements Wbcr_IFactoryForms423_ValueProvider {
|
26 |
|
27 |
/**
|
28 |
* A prefix that will be added to all option names.
|
43 |
/**
|
44 |
* Creates a new instance of an options value provider.
|
45 |
*/
|
46 |
+
public function __construct(Wbcr_Factory425_Plugin $plugin)
|
47 |
{
|
48 |
$this->plugin = $plugin;
|
49 |
}
|
libs/factory/forms/includes/providers/value-provider.interface.php
CHANGED
@@ -14,13 +14,13 @@
|
|
14 |
if( !defined('ABSPATH') ) {
|
15 |
exit;
|
16 |
}
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* The interface for all value provides.
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
-
interface
|
24 |
|
25 |
/**
|
26 |
* Inits a form a provider to get data from a storage.
|
14 |
if( !defined('ABSPATH') ) {
|
15 |
exit;
|
16 |
}
|
17 |
+
if( !class_exists('Wbcr_IFactoryForms423_ValueProvider') ) {
|
18 |
/**
|
19 |
* The interface for all value provides.
|
20 |
*
|
21 |
* @since 1.0.0
|
22 |
*/
|
23 |
+
interface Wbcr_IFactoryForms423_ValueProvider {
|
24 |
|
25 |
/**
|
26 |
* Inits a form a provider to get data from a storage.
|
libs/factory/forms/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/langs/index.php
DELETED
File without changes
|
libs/factory/forms/langs/{wbcr_factory_forms_414-ru_RU.mo → wbcr_factory_forms_423-ru_RU.mo}
RENAMED
File without changes
|
libs/factory/forms/langs/{wbcr_factory_forms_414-ru_RU.po → wbcr_factory_forms_423-ru_RU.po}
RENAMED
File without changes
|
libs/factory/forms/layouts/bootstrap-3/bootstrap-3.php
CHANGED
@@ -14,11 +14,11 @@
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if( !class_exists('
|
18 |
/**
|
19 |
* A form layout based on Twitter Bootstrap 3
|
20 |
*/
|
21 |
-
class
|
22 |
|
23 |
public $name = 'default';
|
24 |
|
@@ -27,7 +27,7 @@
|
|
27 |
*
|
28 |
* @since 1.0.0
|
29 |
* @param array $options A holder options.
|
30 |
-
* @param
|
31 |
*/
|
32 |
public function __construct($options, $form)
|
33 |
{
|
@@ -68,7 +68,7 @@
|
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
-
* @param
|
72 |
*/
|
73 |
public function beforeControl($control)
|
74 |
{
|
@@ -116,7 +116,7 @@
|
|
116 |
}
|
117 |
|
118 |
/**
|
119 |
-
* @param
|
120 |
*/
|
121 |
public function afterControl($control)
|
122 |
{
|
@@ -168,7 +168,7 @@
|
|
168 |
}
|
169 |
|
170 |
/**
|
171 |
-
* @param
|
172 |
* @param int $index
|
173 |
* @param int $total
|
174 |
*/
|
@@ -193,7 +193,7 @@
|
|
193 |
}
|
194 |
|
195 |
/**
|
196 |
-
* @param
|
197 |
* @param int $index
|
198 |
* @param int $total
|
199 |
*/
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if( !class_exists('Wbcr_FactoryForms423_Bootstrap3FormLayout') ) {
|
18 |
/**
|
19 |
* A form layout based on Twitter Bootstrap 3
|
20 |
*/
|
21 |
+
class Wbcr_FactoryForms423_Bootstrap3FormLayout extends Wbcr_FactoryForms423_FormLayout {
|
22 |
|
23 |
public $name = 'default';
|
24 |
|
27 |
*
|
28 |
* @since 1.0.0
|
29 |
* @param array $options A holder options.
|
30 |
+
* @param Wbcr_FactoryForms423_Form $form A parent form.
|
31 |
*/
|
32 |
public function __construct($options, $form)
|
33 |
{
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
+
* @param Wbcr_FactoryForms423_Control $control
|
72 |
*/
|
73 |
public function beforeControl($control)
|
74 |
{
|
116 |
}
|
117 |
|
118 |
/**
|
119 |
+
* @param Wbcr_FactoryForms423_Control $control
|
120 |
*/
|
121 |
public function afterControl($control)
|
122 |
{
|
168 |
}
|
169 |
|
170 |
/**
|
171 |
+
* @param Wbcr_FactoryForms423_Control $control
|
172 |
* @param int $index
|
173 |
* @param int $total
|
174 |
*/
|
193 |
}
|
194 |
|
195 |
/**
|
196 |
+
* @param Wbcr_FactoryForms423_Control $control
|
197 |
* @param int $index
|
198 |
* @param int $total
|
199 |
*/
|
libs/factory/forms/layouts/bootstrap-3/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/forms/layouts/index.php
CHANGED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
libs/factory/freemius/boot.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Load Freemius module.
|
4 |
*
|
5 |
-
* @author
|
|
|
|
|
6 |
* @copyright (c) 2018, Webcraftic Ltd
|
7 |
*
|
8 |
-
* @package core
|
9 |
-
* @since 1.0.0
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -14,29 +14,39 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
if ( defined( '
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
-
define( '
|
22 |
-
|
23 |
-
define( '
|
|
|
|
|
24 |
|
25 |
#comp merge
|
26 |
// Freemius
|
27 |
-
require_once(
|
28 |
-
require_once(
|
29 |
-
require_once(
|
30 |
-
require_once(
|
31 |
-
require_once(
|
32 |
-
|
33 |
-
require_once(
|
34 |
-
|
35 |
-
require_once( FACTORY_FREEMIUS_103_DIR . '/includes/updates/class-freemius-repository.php' );
|
36 |
|
37 |
if ( ! class_exists( 'Freemius_Api_WordPress' ) ) {
|
38 |
-
require_once
|
39 |
}
|
40 |
|
41 |
-
require_once(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
#endcomp
|
2 |
/**
|
3 |
* Load Freemius module.
|
4 |
*
|
5 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, Alex Kovalev <alex.kovalevv@gmail.com>
|
6 |
+
* @since 1.0.0
|
7 |
+
* @package core
|
8 |
* @copyright (c) 2018, Webcraftic Ltd
|
9 |
*
|
|
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
if ( defined( 'FACTORY_FREEMIUS_113_LOADED' ) ) {
|
18 |
return;
|
19 |
}
|
20 |
|
21 |
+
define( 'FACTORY_FREEMIUS_113_VERSION', '1.1.3' );
|
22 |
+
|
23 |
+
define( 'FACTORY_FREEMIUS_113_LOADED', true );
|
24 |
+
define( 'FACTORY_FREEMIUS_113_DIR', dirname( __FILE__ ) );
|
25 |
+
define( 'FACTORY_FREEMIUS_113_URL', plugins_url( null, __FILE__ ) );
|
26 |
|
27 |
#comp merge
|
28 |
// Freemius
|
29 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/entities/class-freemius-entity.php' );
|
30 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/entities/class-freemius-scope.php' );
|
31 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/entities/class-freemius-user.php' );
|
32 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/entities/class-freemius-site.php' );
|
33 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/entities/class-freemius-license.php' );
|
34 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/licensing/class-freemius-provider.php' );
|
35 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/updates/class-freemius-repository.php' );
|
|
|
|
|
36 |
|
37 |
if ( ! class_exists( 'Freemius_Api_WordPress' ) ) {
|
38 |
+
require_once FACTORY_FREEMIUS_113_DIR . '/includes/sdk/FreemiusWordPress.php';
|
39 |
}
|
40 |
|
41 |
+
require_once( FACTORY_FREEMIUS_113_DIR . '/includes/class-freemius-api.php' );
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
45 |
+
*/
|
46 |
+
add_action( 'wbcr_factory_freemius_113_plugin_created', function ( $plugin ) {
|
47 |
+
# Устанавливаем класс провайдера лицензий для премиум менеджера
|
48 |
+
$plugin->set_license_provider( 'freemius', 'WBCR\Factory_Freemius_113\Premium\Provider' );
|
49 |
+
# Устанавливаем класс репозитория обновлений для менеджера обновлений
|
50 |
+
$plugin->set_update_repository( 'freemius', 'WBCR\Factory_Freemius_113\Updates\Freemius_Repository' );
|
51 |
+
} );
|
52 |
#endcomp
|
libs/factory/freemius/includes/class-freemius-api.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use Freemius_Api_WordPress;
|
6 |
use Freemius_Exception;
|
7 |
-
use
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
exit;
|
@@ -33,7 +33,7 @@ final class Api {
|
|
33 |
private $api;
|
34 |
|
35 |
/**
|
36 |
-
* @var
|
37 |
*/
|
38 |
private $plugin;
|
39 |
|
@@ -48,14 +48,14 @@ final class Api {
|
|
48 |
private static $clock_diff;
|
49 |
|
50 |
/**
|
51 |
-
* @param
|
52 |
* @param string $scope 'app', 'developer', 'user' or 'install'.
|
53 |
* @param number $id Element's id.
|
54 |
* @param string $public_key Public key.
|
55 |
* @param bool|string $secret_key Element's secret key.
|
56 |
* @param bool $is_sandbox
|
57 |
*/
|
58 |
-
private function __construct(
|
59 |
if ( ! class_exists( 'Freemius_Api_WordPress' ) ) {
|
60 |
require_once WP_FS__DIR_SDK . '/FreemiusWordPress.php';
|
61 |
}
|
@@ -73,7 +73,7 @@ final class Api {
|
|
73 |
}
|
74 |
|
75 |
/**
|
76 |
-
* @param
|
77 |
* @param string $scope 'app', 'developer', 'user' or 'install'.
|
78 |
* @param number $id Element's id.
|
79 |
* @param string $public_key Public key.
|
@@ -82,7 +82,7 @@ final class Api {
|
|
82 |
*
|
83 |
* @return Api
|
84 |
*/
|
85 |
-
public static function instance(
|
86 |
$identifier = md5( $plugin->getPluginName() . $scope . $id . $public_key . ( is_string( $secret_key ) ? $secret_key : '' ) . json_encode( $is_sandbox ) );
|
87 |
|
88 |
if ( ! isset( self::$instances[ $identifier ] ) ) {
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_Freemius_113;
|
4 |
|
5 |
use Freemius_Api_WordPress;
|
6 |
use Freemius_Exception;
|
7 |
+
use Wbcr_Factory425_Plugin;
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
exit;
|
33 |
private $api;
|
34 |
|
35 |
/**
|
36 |
+
* @var Wbcr_Factory425_Plugin
|
37 |
*/
|
38 |
private $plugin;
|
39 |
|
48 |
private static $clock_diff;
|
49 |
|
50 |
/**
|
51 |
+
* @param Wbcr_Factory425_Plugin $slug
|
52 |
* @param string $scope 'app', 'developer', 'user' or 'install'.
|
53 |
* @param number $id Element's id.
|
54 |
* @param string $public_key Public key.
|
55 |
* @param bool|string $secret_key Element's secret key.
|
56 |
* @param bool $is_sandbox
|
57 |
*/
|
58 |
+
private function __construct( Wbcr_Factory425_Plugin $plugin, $scope, $id, $public_key, $secret_key, $is_sandbox ) {
|
59 |
if ( ! class_exists( 'Freemius_Api_WordPress' ) ) {
|
60 |
require_once WP_FS__DIR_SDK . '/FreemiusWordPress.php';
|
61 |
}
|
73 |
}
|
74 |
|
75 |
/**
|
76 |
+
* @param Wbcr_Factory425_Plugin $plugin
|
77 |
* @param string $scope 'app', 'developer', 'user' or 'install'.
|
78 |
* @param number $id Element's id.
|
79 |
* @param string $public_key Public key.
|
82 |
*
|
83 |
* @return Api
|
84 |
*/
|
85 |
+
public static function instance( Wbcr_Factory425_Plugin $plugin, $scope, $id, $public_key, $is_sandbox, $secret_key = false ) {
|
86 |
$identifier = md5( $plugin->getPluginName() . $scope . $id . $public_key . ( is_string( $secret_key ) ? $secret_key : '' ) . json_encode( $is_sandbox ) );
|
87 |
|
88 |
if ( ! isset( self::$instances[ $identifier ] ) ) {
|
libs/factory/freemius/includes/entities/class-freemius-entity.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace WBCR\
|
4 |
|
5 |
use stdClass;
|
6 |
|
1 |
<?php
|
2 |
|
3 |
+
namespace WBCR\Factory_Freemius_113\Entities;
|
4 |
|
5 |
use stdClass;
|
6 |
|
libs/factory/freemius/includes/entities/class-freemius-license.php
CHANGED
@@ -1,369 +1,376 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
namespace WBCR\
|
4 |
-
|
5 |
-
use stdClass;
|
6 |
-
|
7 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
-
|
9 |
-
}
|
10 |
-
|
11 |
-
/**
|
12 |
-
* @author Webcraftic <wordpress.webraftic@gmail.com>, Alex Kovalev <alex.kovalevv@gmail.com>
|
13 |
-
* @link https://webcraftic.com
|
14 |
-
* @copyright (c) 2018 Webraftic Ltd, Freemius, Inc.
|
15 |
-
* @version 1.0
|
16 |
-
*/
|
17 |
-
class License extends Entity implements \WBCR\Factory_414\Premium\Interfaces\License {
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @var number
|
21 |
-
*/
|
22 |
-
public $plugin_id;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* @var number
|
26 |
-
*/
|
27 |
-
public $user_id;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* @var number
|
31 |
-
*/
|
32 |
-
public $plan_id;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @var
|
36 |
-
*/
|
37 |
-
public $plan_title;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @var
|
41 |
-
*/
|
42 |
-
public $billing_cycle;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @var number
|
46 |
-
*/
|
47 |
-
public $pricing_id;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* @var int|null
|
51 |
-
*/
|
52 |
-
public $quota;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* @var int
|
56 |
-
*/
|
57 |
-
public $activated;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* @var int
|
61 |
-
*/
|
62 |
-
public $activated_local;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* @var string
|
66 |
-
*/
|
67 |
-
public $expiration;
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @var string
|
71 |
-
*/
|
72 |
-
public $secret_key;
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
|
76 |
-
* license.
|
77 |
-
*/
|
78 |
-
public $is_free_localhost;
|
79 |
-
|
80 |
-
/**
|
81 |
-
* @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
|
82 |
-
* block updates and support.
|
83 |
-
*/
|
84 |
-
public $is_block_features;
|
85 |
-
|
86 |
-
/**
|
87 |
-
* @var bool
|
88 |
-
*/
|
89 |
-
public $is_cancelled;
|
90 |
-
|
91 |
-
/**
|
92 |
-
* @param stdClass|bool $license
|
93 |
-
*/
|
94 |
-
public function __construct( $license = false ) {
|
95 |
-
parent::__construct( $license );
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Get entity type.
|
100 |
-
*
|
101 |
-
* @return string
|
102 |
-
*/
|
103 |
-
public static function get_type() {
|
104 |
-
return 'license';
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Example: #sk_f=>}-5vuHp$3*wPQHxd(AD3<);1&i
|
109 |
-
*
|
110 |
-
* @return string|null
|
111 |
-
*/
|
112 |
-
public function get_key() {
|
113 |
-
return $this->secret_key;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Example: #sk_f=>}-5vuHp$3******d(AD3<);1&i
|
118 |
-
*
|
119 |
-
* @return mixed
|
120 |
-
*/
|
121 |
-
public function get_hidden_key() {
|
122 |
-
return substr_replace( $this->get_key(), '******', 15, 6 );
|
123 |
}
|
124 |
-
|
125 |
/**
|
126 |
-
* @
|
|
|
|
|
|
|
127 |
*/
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
168 |
}
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
1 |
<?php
|
2 |
+
|
3 |
+
namespace WBCR\Factory_Freemius_113\Entities;
|
4 |
+
|
5 |
+
use stdClass;
|
6 |
+
|
7 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
+
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
+
|
11 |
/**
|
12 |
+
* @author Webcraftic <wordpress.webraftic@gmail.com>, Alex Kovalev <alex.kovalevv@gmail.com>
|
13 |
+
* @link https://webcraftic.com
|
14 |
+
* @copyright (c) 2018 Webraftic Ltd, Freemius, Inc.
|
15 |
+
* @version 1.0
|
16 |
*/
|
17 |
+
class License extends Entity implements \WBCR\Factory_425\Premium\Interfaces\License {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var number
|
21 |
+
*/
|
22 |
+
public $plugin_id;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @var number
|
26 |
+
*/
|
27 |
+
public $user_id;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @var number
|
31 |
+
*/
|
32 |
+
public $plan_id;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var
|
36 |
+
*/
|
37 |
+
public $plan_title;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @var
|
41 |
+
*/
|
42 |
+
public $billing_cycle;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @var number
|
46 |
+
*/
|
47 |
+
public $pricing_id;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @var int|null
|
51 |
+
*/
|
52 |
+
public $quota;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @var int
|
56 |
+
*/
|
57 |
+
public $activated;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @var int
|
61 |
+
*/
|
62 |
+
public $activated_local;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @var string
|
66 |
+
*/
|
67 |
+
public $expiration;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @var string
|
71 |
+
*/
|
72 |
+
public $secret_key;
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
|
76 |
+
* license.
|
77 |
+
*/
|
78 |
+
public $is_free_localhost;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
|
82 |
+
* block updates and support.
|
83 |
+
*/
|
84 |
+
public $is_block_features;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* @var bool
|
88 |
+
*/
|
89 |
+
public $is_cancelled;
|
90 |
+
|
91 |
+
/**
|
92 |
+
* @param stdClass|bool $license
|
93 |
+
*/
|
94 |
+
public function __construct( $license = false ) {
|
95 |
+
parent::__construct( $license );
|
96 |
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Get entity type.
|
100 |
+
*
|
101 |
+
* @return string
|
102 |
+
*/
|
103 |
+
public static function get_type() {
|
104 |
+
return 'license';
|
105 |
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Example: #sk_f=>}-5vuHp$3*wPQHxd(AD3<);1&i
|
109 |
+
*
|
110 |
+
* @return string|null
|
111 |
+
*/
|
112 |
+
public function get_key() {
|
113 |
+
return $this->secret_key;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Example: #sk_f=>}-5vuHp$3******d
|