Clearfy – WordPress optimization plugin and disable ultimate tweaker - Version 1.6.4

Version Description

(12.02.2020) = * Fixed: Minor bugs.

Download this release

Release Info

Developer alexkovalevv
Plugin Icon 128x128 Clearfy – WordPress optimization plugin and disable ultimate tweaker
Version 1.6.4
Comparing to
See all releases

Code changes from version 1.6.3 to 1.6.4

clearfy.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wordpress.org/plugins/clearfy/
5
  * Description: Disables unused Wordpress features, improves performance and increases SEO rankings, using Clearfy, which makes WordPress very easy.
6
  * Author: Webcraftic <wordpress.webraftic@gmail.com>
7
- * Version: 1.6.3
8
  * Text Domain: clearfy
9
  * Domain Path: /languages/
10
  * Author URI: http://clearfy.pro
@@ -25,90 +25,90 @@ if ( ! defined( 'ABSPATH' ) ) {
25
  * -----------------------------------------------------------------------------
26
  */
27
 
28
- require_once( dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php' );
29
 
30
  // @formatter:off
31
  $plugin_info = array(
32
- 'prefix' => 'wbcr_clearfy_',
33
- 'plugin_name' => 'wbcr_clearfy',
34
- 'plugin_title' => __( 'Clearfy', 'clearfy' ),
35
  // PLUGIN SUPPORT
36
- 'support_details' => array(
37
- 'url' => 'http://clearfy.pro',
38
  'pages_map' => array(
39
  'features' => 'premium-features', // {site}/premium-features
40
- 'pricing' => 'pricing', // {site}/prices
41
- 'support' => 'support', // {site}/support
42
- 'docs' => 'docs' // {site}/docs
43
  )
44
  ),
45
  //todo: for compatibility with Robin image optimizer
46
- 'freemius_plugin_id' => '2315',
47
- 'freemius_public_key' => 'pk_70e226af07d37d2b9a69720e0952c',
48
 
49
  // PLUGIN PREMIUM SETTINGS
50
- 'has_premium' => true,
51
- 'license_settings' => array(
52
- 'provider' => 'freemius',
53
- 'slug' => 'clearfy_package',
54
- 'plugin_id' => '2315',
55
- 'public_key' => 'pk_70e226af07d37d2b9a69720e0952c',
56
- 'price' => 29,
57
- 'has_updates' => true,
58
  'updates_settings' => array(
59
- 'maybe_rollback' => true,
60
  'rollback_settings' => array(
61
  'prev_stable_version' => '0.0.0'
62
  )
63
  )
64
  ),
65
  // PLUGIN ADVERTS
66
- 'render_adverts' => true,
67
- 'adverts_settings' => array(
68
  'dashboard_widget' => true, // show dashboard widget (default: false)
69
- 'right_sidebar' => true, // show adverts sidebar (default: false)
70
- 'notice' => true, // show notice message (default: false)
71
  ),
72
  // FRAMEWORK MODULES
73
- 'load_factory_modules' => array(
74
- array( 'libs/factory/bootstrap', 'factory_bootstrap_426', 'admin' ),
75
- array( 'libs/factory/forms', 'factory_forms_423', 'admin' ),
76
- array( 'libs/factory/pages', 'factory_pages_425', 'admin' ),
77
- array( 'libs/factory/clearfy', 'factory_clearfy_217', 'all' ),
78
- array( 'libs/factory/freemius', 'factory_freemius_113', 'all' ),
79
- array( 'libs/factory/adverts', 'factory_adverts_106', 'admin' )
80
  ),
81
  'load_plugin_components' => array(
82
- 'disable_notices' => array(
83
- 'autoload' => 'components/disable-admin-notices/clearfy.php',
84
  'plugin_prefix' => 'WDN_'
85
  ),
86
- 'cyrlitera' => array(
87
- 'autoload' => 'components/cyrlitera/clearfy.php',
88
  'plugin_prefix' => 'WCTR_'
89
  ),
90
- 'updates_manager' => array(
91
- 'autoload' => 'components/updates-manager/clearfy.php',
92
  'plugin_prefix' => 'WUPM_'
93
  ),
94
- 'comments_tools' => array(
95
- 'autoload' => 'components/comments-plus/clearfy.php',
96
  'plugin_prefix' => 'WCM_'
97
  ),
98
- 'ga_cache' => array(
99
- 'autoload' => 'components/ga-cache/clearfy.php',
100
  'plugin_prefix' => 'WGA_'
101
  ),
102
- 'assets_manager' => array(
103
- 'autoload' => 'components/assets-manager/clearfy.php',
104
  'plugin_prefix' => 'WGZ_'
105
  ),
106
  'minify_and_combine' => array(
107
- 'autoload' => 'components/minify-and-combine/clearfy.php',
108
  'plugin_prefix' => 'WMAC_'
109
  ),
110
- 'html_minify' => array(
111
- 'autoload' => 'components/html-minify/clearfy.php',
112
  'plugin_prefix' => 'WHTM_'
113
  ),
114
  )
@@ -116,18 +116,18 @@ $plugin_info = array(
116
 
117
 
118
 
119
- $clearfy_compatibility = new Wbcr_Factory425_Requirements( __FILE__, array_merge( $plugin_info, array(
120
- 'plugin_already_activate' => defined( 'WCL_PLUGIN_ACTIVE' ),
121
- 'required_php_version' => '5.4',
122
- 'required_wp_version' => '4.2.0',
123
  'required_clearfy_check_component' => false
124
- ) ) );
125
 
126
  /**
127
  * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
128
  * and the user will throw a warning.
129
  */
130
- if ( ! $clearfy_compatibility->check() ) {
131
  return;
132
  }
133
 
@@ -140,18 +140,18 @@ if ( ! $clearfy_compatibility->check() ) {
140
  */
141
 
142
  // This plugin is activated
143
- define( 'WCL_PLUGIN_ACTIVE', true );
144
 
145
  // For for compatibility with old plugins
146
- define( 'WBCR_CLEARFY_PLUGIN_ACTIVE', true );
147
 
148
  // Plugin version
149
- define( 'WCL_PLUGIN_VERSION', $clearfy_compatibility->get_plugin_version() );
150
- define( 'WCL_FRAMEWORK_VER', 'FACTORY_425_VERSION' );
151
 
152
- define( 'WCL_PLUGIN_DIR', dirname( __FILE__ ) );
153
- define( 'WCL_PLUGIN_BASE', plugin_basename( __FILE__ ) );
154
- define( 'WCL_PLUGIN_URL', plugins_url( null, __FILE__ ) );
155
 
156
 
157
 
@@ -161,27 +161,27 @@ define( 'WCL_PLUGIN_URL', plugins_url( null, __FILE__ ) );
161
  * -----------------------------------------------------------------------------
162
  */
163
  try {
164
- require_once( WCL_PLUGIN_DIR . '/includes/helpers.php' );
165
 
166
  // creating a plugin via the factory
167
- require_once( WCL_PLUGIN_DIR . '/libs/factory/core/boot.php' );
168
- require_once( WCL_PLUGIN_DIR . '/includes/class.plugin.php' );
169
 
170
- new WCL_Plugin( __FILE__, array_merge( $plugin_info, array(
171
- 'plugin_version' => WCL_PLUGIN_VERSION,
172
  'plugin_text_domain' => $clearfy_compatibility->get_text_domain(),
173
- ) ) );
174
  } catch( Exception $e ) {
175
  // Plugin wasn't initialized due to an error
176
- define( 'WRIO_PLUGIN_THROW_ERROR', true );
177
 
178
- $clearfy_plugin_error_func = function () use ( $e ) {
179
- $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Clearfy', $e->getMessage(), $e->getCode() );
180
  echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
181
  };
182
 
183
- add_action( 'admin_notices', $clearfy_plugin_error_func );
184
- add_action( 'network_admin_notices', $clearfy_plugin_error_func );
185
  }
186
  // @formatter:on
187
 
4
  * Plugin URI: https://wordpress.org/plugins/clearfy/
5
  * Description: Disables unused Wordpress features, improves performance and increases SEO rankings, using Clearfy, which makes WordPress very easy.
6
  * Author: Webcraftic <wordpress.webraftic@gmail.com>
7
+ * Version: 1.6.4
8
  * Text Domain: clearfy
9
  * Domain Path: /languages/
10
  * Author URI: http://clearfy.pro
25
  * -----------------------------------------------------------------------------
26
  */
27
 
28
+ require_once(dirname(__FILE__) . '/libs/factory/core/includes/class-factory-requirements.php');
29
 
30
  // @formatter:off
31
  $plugin_info = array(
32
+ 'prefix' => 'wbcr_clearfy_',
33
+ 'plugin_name' => 'wbcr_clearfy',
34
+ 'plugin_title' => __('Clearfy', 'clearfy'),
35
  // PLUGIN SUPPORT
36
+ 'support_details' => array(
37
+ 'url' => 'http://clearfy.pro',
38
  'pages_map' => array(
39
  'features' => 'premium-features', // {site}/premium-features
40
+ 'pricing' => 'pricing', // {site}/prices
41
+ 'support' => 'support', // {site}/support
42
+ 'docs' => 'docs' // {site}/docs
43
  )
44
  ),
45
  //todo: for compatibility with Robin image optimizer
46
+ 'freemius_plugin_id' => '2315',
47
+ 'freemius_public_key' => 'pk_70e226af07d37d2b9a69720e0952c',
48
 
49
  // PLUGIN PREMIUM SETTINGS
50
+ 'has_premium' => true,
51
+ 'license_settings' => array(
52
+ 'provider' => 'freemius',
53
+ 'slug' => 'clearfy_package',
54
+ 'plugin_id' => '2315',
55
+ 'public_key' => 'pk_70e226af07d37d2b9a69720e0952c',
56
+ 'price' => 29,
57
+ 'has_updates' => true,
58
  'updates_settings' => array(
59
+ 'maybe_rollback' => true,
60
  'rollback_settings' => array(
61
  'prev_stable_version' => '0.0.0'
62
  )
63
  )
64
  ),
65
  // PLUGIN ADVERTS
66
+ 'render_adverts' => true,
67
+ 'adverts_settings' => array(
68
  'dashboard_widget' => true, // show dashboard widget (default: false)
69
+ 'right_sidebar' => true, // show adverts sidebar (default: false)
70
+ 'notice' => true, // show notice message (default: false)
71
  ),
72
  // FRAMEWORK MODULES
73
+ 'load_factory_modules' => array(
74
+ array('libs/factory/bootstrap', 'factory_bootstrap_426', 'admin'),
75
+ array('libs/factory/forms', 'factory_forms_423', 'admin'),
76
+ array('libs/factory/pages', 'factory_pages_425', 'admin'),
77
+ array('libs/factory/clearfy', 'factory_clearfy_217', 'all'),
78
+ array('libs/factory/freemius', 'factory_freemius_113', 'all'),
79
+ array('libs/factory/adverts', 'factory_adverts_106', 'admin')
80
  ),
81
  'load_plugin_components' => array(
82
+ 'disable_notices' => array(
83
+ 'autoload' => 'components/disable-admin-notices/clearfy.php',
84
  'plugin_prefix' => 'WDN_'
85
  ),
86
+ 'cyrlitera' => array(
87
+ 'autoload' => 'components/cyrlitera/clearfy.php',
88
  'plugin_prefix' => 'WCTR_'
89
  ),
90
+ 'updates_manager' => array(
91
+ 'autoload' => 'components/updates-manager/clearfy.php',
92
  'plugin_prefix' => 'WUPM_'
93
  ),
94
+ 'comments_tools' => array(
95
+ 'autoload' => 'components/comments-plus/clearfy.php',
96
  'plugin_prefix' => 'WCM_'
97
  ),
98
+ 'ga_cache' => array(
99
+ 'autoload' => 'components/ga-cache/clearfy.php',
100
  'plugin_prefix' => 'WGA_'
101
  ),
102
+ 'assets_manager' => array(
103
+ 'autoload' => 'components/assets-manager/clearfy.php',
104
  'plugin_prefix' => 'WGZ_'
105
  ),
106
  'minify_and_combine' => array(
107
+ 'autoload' => 'components/minify-and-combine/clearfy.php',
108
  'plugin_prefix' => 'WMAC_'
109
  ),
110
+ 'html_minify' => array(
111
+ 'autoload' => 'components/html-minify/clearfy.php',
112
  'plugin_prefix' => 'WHTM_'
113
  ),
114
  )
116
 
117
 
118
 
119
+ $clearfy_compatibility = new Wbcr_Factory425_Requirements(__FILE__, array_merge($plugin_info, array(
120
+ 'plugin_already_activate' => defined('WCL_PLUGIN_ACTIVE'),
121
+ 'required_php_version' => '5.4',
122
+ 'required_wp_version' => '4.2.0',
123
  'required_clearfy_check_component' => false
124
+ )));
125
 
126
  /**
127
  * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
128
  * and the user will throw a warning.
129
  */
130
+ if( !$clearfy_compatibility->check() ) {
131
  return;
132
  }
133
 
140
  */
141
 
142
  // This plugin is activated
143
+ define('WCL_PLUGIN_ACTIVE', true);
144
 
145
  // For for compatibility with old plugins
146
+ define('WBCR_CLEARFY_PLUGIN_ACTIVE', true);
147
 
148
  // Plugin version
149
+ define('WCL_PLUGIN_VERSION', $clearfy_compatibility->get_plugin_version());
150
+ define('WCL_FRAMEWORK_VER', 'FACTORY_425_VERSION');
151
 
152
+ define('WCL_PLUGIN_DIR', dirname(__FILE__));
153
+ define('WCL_PLUGIN_BASE', plugin_basename(__FILE__));
154
+ define('WCL_PLUGIN_URL', plugins_url(null, __FILE__));
155
 
156
 
157
 
161
  * -----------------------------------------------------------------------------
162
  */
163
  try {
164
+ require_once(WCL_PLUGIN_DIR . '/includes/helpers.php');
165
 
166
  // creating a plugin via the factory
167
+ require_once(WCL_PLUGIN_DIR . '/libs/factory/core/boot.php');
168
+ require_once(WCL_PLUGIN_DIR . '/includes/class.plugin.php');
169
 
170
+ new WCL_Plugin(__FILE__, array_merge($plugin_info, array(
171
+ 'plugin_version' => WCL_PLUGIN_VERSION,
172
  'plugin_text_domain' => $clearfy_compatibility->get_text_domain(),
173
+ )));
174
  } catch( Exception $e ) {
175
  // Plugin wasn't initialized due to an error
176
+ define('WRIO_PLUGIN_THROW_ERROR', true);
177
 
178
+ $clearfy_plugin_error_func = function () use ($e) {
179
+ $error = sprintf("The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Clearfy', $e->getMessage(), $e->getCode());
180
  echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
181
  };
182
 
183
+ add_action('admin_notices', $clearfy_plugin_error_func);
184
+ add_action('network_admin_notices', $clearfy_plugin_error_func);
185
  }
186
  // @formatter:on
187
 
components/assets-manager/gonzales.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wordpress.org/plugins/gonzales/
5
  * Description: Increase the speed of the pages by disabling unused scripts (.JS) and styles (.CSS). Make your website REACTIVE!
6
  * Author: Webcraftic <wordpress.webraftic@gmail.com>
7
- * Version: 2.0.4
8
  * Text Domain: gonzales
9
  * Domain Path: /languages/
10
  * Author URI: https://webcraftic.com
4
  * Plugin URI: https://wordpress.org/plugins/gonzales/
5
  * Description: Increase the speed of the pages by disabling unused scripts (.JS) and styles (.CSS). Make your website REACTIVE!
6
  * Author: Webcraftic <wordpress.webraftic@gmail.com>
7
+ * Version: 2.0.5
8
  * Text Domain: gonzales
9
  * Domain Path: /languages/
10
  * Author URI: https://webcraftic.com
components/assets-manager/includes/classes/class-assets-manager-global.php CHANGED
@@ -876,7 +876,7 @@ class WGZ_Assets_Manager_Public {
876
  $s['select_control_classes'] = " js-wam-select--disable";
877
  $s['settings_button_classes'] = "";
878
 
879
- if ( $plugin_load_mode && 'enable' !== $plugin_load_mode ) {
880
  $s['settings_button_classes'] = " js-wam-button--hidden";
881
  }
882
  } else {
876
  $s['select_control_classes'] = " js-wam-select--disable";
877
  $s['settings_button_classes'] = "";
878
 
879
+ if ( isset($plugin_load_mode) && 'enable' !== $plugin_load_mode ) {
880
  $s['settings_button_classes'] = " js-wam-button--hidden";
881
  }
882
  } else {
components/assets-manager/migrations/020005.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php #comp-page builds: premium
2
+
3
+ /**
4
+ * Updates for altering the table used to store statistics data.
5
+ * Adds new columns and renames existing ones in order to add support for the new social buttons.
6
+ */
7
+ class WGZUpdate020005 extends Wbcr_Factory425_Update {
8
+
9
+ public function install() {
10
+ $settings = get_option( $this->plugin->getPrefix() . 'assets_states', [] );
11
+
12
+ if ( ! empty( $settings ) ) {
13
+ if ( ! function_exists( 'wbcr_gnz_deploy_mu_plugin' ) ) {
14
+ require_once WGZ_PLUGIN_DIR . '/includes/functions.php';
15
+ }
16
+
17
+ wbcr_gnz_deploy_mu_plugin();
18
+ }
19
+ }
20
+ }
components/assets-manager/mu-plugins/assets-manager.php CHANGED
@@ -2,16 +2,16 @@
2
  /**
3
  * Webcraftic AM plugin load filter
4
  * Dynamically activated only plugins that you have selected in each page. [Note] Webcraftic AM has been automatically installed/deleted by Activate/Deactivate of "load filter plugin".
5
- * Version: 1.0.8
6
  * Framework Version: FACTORY_425_VERSION
7
  */
8
 
9
  // todo: проверить, как работает кеширование
10
  // todo: замерить, скорость работы этого решения
11
 
12
- defined( 'ABSPATH' ) || exit;
13
 
14
- if ( defined( 'WP_SETUP_CONFIG' ) || defined( 'WP_INSTALLING' ) || isset( $_GET['wbcr_assets_manager'] ) ) {
15
  return;
16
  }
17
 
@@ -29,24 +29,25 @@ class WGNZ_Plugins_Loader {
29
  protected $settings;
30
  protected $active_plugins = array();
31
 
32
- public function __construct() {
 
33
  # We must always load the plugin if it is an ajax request, a cron
34
  # task or a rest api request. Otherwise, the user may have problems
35
  # with the work of plugins.
36
- if ( $this->doing_ajax() || $this->doing_cron() || $this->doing_rest_api() ) {
37
  return;
38
  }
39
 
40
- $is_clearfy_active = false;
41
 
42
  $this->active_plugins = $this->get_active_plugins();
43
 
44
- add_filter( 'wam/conditions/call_method', [ $this, 'check_conditions_method' ], 10, 4 );
45
 
46
- if ( $this->is_active_clearfy() ) {
47
  $deactivate_components = $this->get_clearfy_deactivate_components();
48
 
49
- if ( empty( $deactivate_components ) || ! in_array( 'assets_manager', $deactivate_components ) ) {
50
  $is_clearfy_active = true;
51
  }
52
  }
@@ -58,30 +59,31 @@ class WGNZ_Plugins_Loader {
58
  }
59
 
60
  # Disable plugins only if Asset Manager and Clearfy are activated
61
- if ( $is_clearfy_active || $this->is_active_assets_manager_standalone() ) {
62
  $this->settings = $this->get_assets_manager_options();
63
 
64
- if ( ! empty( $this->settings ) ) {
65
- if ( is_multisite() ) {
66
- add_filter( 'site_option_active_sitewide_plugins', array($this, 'disable_network_plugins' ), 1 );
67
  }
68
 
69
- add_filter( 'option_active_plugins', array( $this, 'disable_plugins' ), 1 );
70
- add_filter( 'option_hack_file', array( $this, 'hack_file_filter' ), 1 );
71
- add_action( 'plugins_loaded', array( $this, 'remove_plugin_filters' ), 1 );
72
  }
73
  }
74
  }
75
 
76
  /**
77
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
78
- * @since 1.0.0
79
- *
80
  * @param $hackFile
81
  *
82
  * @return mixed
 
 
 
83
  */
84
- public function hack_file_filter( $hackFile ) {
 
85
  $this->remove_plugin_filters();
86
 
87
  return $hackFile;
@@ -91,8 +93,9 @@ class WGNZ_Plugins_Loader {
91
  * @author Alexander Kovalev <alex.kovalevv@gmail.com>
92
  * @since 1.0.0
93
  */
94
- public function remove_plugin_filters() {
95
- remove_action( 'option_active_plugins', array( $this, 'disable_plugins' ), 1 );
 
96
  }
97
 
98
  /**
@@ -101,16 +104,17 @@ class WGNZ_Plugins_Loader {
101
  * @author Alexander Kovalev <alex.kovalevv@gmail.com>
102
  * @since 1.0.0
103
  */
104
- public function disable_network_plugins( $plugins_list ) {
 
105
  $new_plugin_list = $plugins_list;
106
 
107
- if ( is_array( $plugins_list ) && ! empty( $plugins_list ) ) {
108
- $temp_plugin_list = array_keys( $plugins_list );
109
- $temp_plugin_list = $this->disable_plugins( $temp_plugin_list );
110
 
111
  $new_plugin_list = array();
112
- foreach ( (array) $temp_plugin_list as $plugin_file ) {
113
- $new_plugin_list[ $plugin_file ] = $plugins_list[ $plugin_file ];
114
  }
115
  }
116
 
@@ -120,21 +124,22 @@ class WGNZ_Plugins_Loader {
120
  /**
121
  * We control the disabling of plugins that are activated for blog.
122
  *
123
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
124
- * @since 1.0.0
125
- *
126
  * @param $plugins_list
127
  *
128
  * @return mixed
 
 
 
129
  */
130
- public function disable_plugins( $plugins_list ) {
131
- if ( ! is_array( $plugins_list ) || empty( $plugins_list ) ) {
 
132
  return $plugins_list;
133
  }
134
 
135
- foreach ( (array) $plugins_list as $key => $plugin_base ) {
136
- if ( $this->is_disabled_plugin( $plugin_base ) ) {
137
- unset( $plugins_list[ $key ] );
138
  }
139
  }
140
 
@@ -144,26 +149,27 @@ class WGNZ_Plugins_Loader {
144
  /**
145
  * Extra method for extend WGZ_Check_Conditions class.
146
  *
147
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
148
- * @since 1.0.7
149
- *
150
  * @param mixed $default
151
  * @param string $method_name
152
  * @param string $operator
153
  * @param mixed $value
154
  *
155
  * @return mixed
 
 
 
156
  */
157
- public function check_conditions_method( $default, $method_name, $operator, $value ) {
 
158
  $premium_plugin_dir = $this->get_parent_premium_plugin_dir();
159
 
160
  if( $premium_plugin_dir && file_exists($premium_plugin_dir) ) {
161
  require_once $premium_plugin_dir . '/includes/class-check-conditions.php';
162
- if(class_exists('WGNZP_Check_Conditions')) {
163
  $conditions = new WGNZP_Check_Conditions();
164
 
165
- if ( method_exists( $conditions, $method_name ) ) {
166
- return $conditions->$method_name( $operator, $value );
167
  }
168
  }
169
  }
@@ -174,33 +180,35 @@ class WGNZ_Plugins_Loader {
174
  /**
175
  * Get a list of active plugins.
176
  *
177
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
178
- * @since 1.0.0
179
  * @return array
 
 
180
  */
181
- private function get_active_plugins() {
182
- if ( is_multisite() ) {
183
- $active_network_plugins = (array) get_site_option( 'active_sitewide_plugins' );
184
- $active_network_plugins = array_keys( $active_network_plugins );
185
- $active_blog_plugins = (array) get_option( 'active_plugins' );
186
-
187
- return array_unique( array_merge( $active_network_plugins, $active_blog_plugins ) );
 
188
  }
189
 
190
- return (array) get_option( 'active_plugins' );
191
  }
192
 
193
  /**
194
  * Determines whether the current plugin is disabled
195
  *
196
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
197
- * @since 1.0.0
198
- *
199
  * @param $plugin_base
200
  *
201
  * @return bool
 
 
 
202
  */
203
- private function is_disabled_plugin( $plugin_base ) {
 
204
 
205
  $white_plgins_list = array(
206
  'clearfy', // prod
@@ -210,19 +218,19 @@ class WGNZ_Plugins_Loader {
210
  'clearfy_package' // premium package
211
  );
212
 
213
- $plugin_base_part = explode( '/', $plugin_base );
214
 
215
  # If plugin base is incorrect or plugin name in the white list
216
- if ( 2 !== sizeof( $plugin_base_part ) || in_array( $plugin_base_part[0], $white_plgins_list ) ) {
217
  return false;
218
  }
219
 
220
- if ( ! empty( $this->settings['plugins'] ) && isset( $this->settings['plugins'][ $plugin_base_part[0] ] ) && 'disable_plugin' === $this->settings['plugins'][ $plugin_base_part[0] ]['load_mode'] ) {
221
  require_once $this->get_parent_plugin_dir() . '/includes/classes/class-check-conditions.php';
222
 
223
- if ( ! empty( $this->settings['plugins'][ $plugin_base_part[0] ]['visability'] ) ) {
224
- $condition = new WGZ_Check_Conditions( $this->settings['plugins'][ $plugin_base_part[0] ]['visability'] );
225
- if ( $condition->validate() ) {
226
  return true;
227
  }
228
  }
@@ -243,180 +251,194 @@ class WGNZ_Plugins_Loader {
243
  * @since 1.0.0
244
  * @return boolean
245
  */
246
- private function doing_rest_api() {
 
247
  $prefix = rest_get_url_prefix();
248
 
249
- $rest_route = isset( $_GET['rest_route'] ) ? $_GET['rest_route'] : null;
250
 
251
- if ( defined( 'REST_REQUEST' ) && REST_REQUEST // (#1)
252
- || ! is_null( $rest_route ) // (#2)
253
- && strpos( trim( $rest_route, '\\/' ), $prefix, 0 ) === 0 ) {
254
  return true;
255
  }
256
 
257
  // (#3)
258
- $rest_url = wp_parse_url( site_url( $prefix ) );
259
- $current_url = wp_parse_url( add_query_arg( array() ) );
260
 
261
- return strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
262
  }
263
 
264
  /**
265
  * Determines whether the current request is a WordPress Ajax request.
266
  *
267
- * @since 1.0.0
268
  * @return bool True if it's a WordPress Ajax request, false otherwise.
 
269
  */
270
- private function doing_ajax() {
271
- if ( function_exists( 'wp_doing_ajax' ) ) {
 
272
  return wp_doing_ajax();
273
  }
274
 
275
- return defined( 'DOING_AJAX' ) && DOING_AJAX;
276
  }
277
 
278
  /**
279
  * Determines whether the current request is a WordPress cron request.
280
  *
281
- * @since 1.0.0
282
  * @return bool True if it's a WordPress cron request, false otherwise.
 
283
  */
284
- private function doing_cron() {
285
- if ( function_exists( 'wp_doing_cron' ) ) {
 
286
  return wp_doing_cron();
287
  }
288
 
289
- return defined( 'DOING_CRON' ) && DOING_CRON;
290
  }
291
 
292
  /**
293
  * Is Clearfy plugin actives?
294
  *
295
- * @since 1.0.7
296
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
297
  * @return string|null
 
 
298
  */
299
- private function is_active_clearfy() {
 
300
  return $this->is_active_clearfy_dev() || $this->is_active_clearfy_prod();
301
  }
302
 
303
  /**
304
  * Is Clearfy Dev plugin actives?
305
  *
306
- * @since 1.0.7
307
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
308
  * @return string|null
 
 
309
  */
310
- private function is_active_clearfy_dev() {
311
- return in_array( 'wp-plugin-clearfy/clearfy.php', $this->active_plugins );
 
312
  }
313
 
314
  /**
315
  * Is Clearfy Prod plugin actives?
316
  *
317
- * @since 1.0.7
318
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
319
  * @return string|null
 
 
320
  */
321
- private function is_active_clearfy_prod() {
322
- return in_array( 'clearfy/clearfy.php', $this->active_plugins );
 
323
  }
324
 
325
  /**
326
  * Is Assets Manager standalone actives?
327
  *
328
- * @since 1.0.7
329
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
330
  * @return string|null
 
 
331
  */
332
- private function is_active_assets_manager_standalone() {
 
333
  return $this->is_active_assets_manager_standalone_prod() || $this->is_active_assets_manager_standalone_dev();
334
  }
335
 
336
  /**
337
  * Is Assets Manager standalone prod actives?
338
  *
339
- * @since 1.0.7
340
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
341
  * @return string|null
 
 
342
  */
343
- private function is_active_assets_manager_standalone_prod() {
344
- return in_array( 'gonzales/gonzales.php', $this->active_plugins );
 
345
  }
346
 
347
  /**
348
  * Is Assets Manager standalone dev actives?
349
  *
350
- * @since 1.0.7
351
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
352
  * @return string|null
 
 
353
  */
354
- private function is_active_assets_manager_standalone_dev() {
355
- return in_array( 'wp-plugin-gonzales/gonzales.php', $this->active_plugins );
 
356
  }
357
 
358
  /**
359
  * Get options prefix
360
  *
361
- * @since 1.0.7
362
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
363
  * @return string|null
 
 
364
  */
365
- private function get_options_prefix() {
 
366
  if( $this->is_active_clearfy() ) {
367
  return self::CLEARFY_OPTIONS_PREFIX;
368
  }
 
369
  return self::DEFAULT_OPTIONS_PREFIX;
370
  }
371
 
372
  /**
373
  * Get Clearfy deactivated components
374
  *
375
- * @since 1.0.7
376
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
377
  * @return array|null
 
 
378
  */
379
- private function get_clearfy_deactivate_components() {
380
- if ( is_multisite() ) {
381
- return get_site_option( $this->get_options_prefix() . 'deactive_preinstall_components', array() );
 
382
  }
383
 
384
- return get_option( $this->get_options_prefix() . 'deactive_preinstall_components', array() );
385
  }
386
 
387
  /**
388
  * Get Assets Manager options
389
  *
390
- * @since 1.0.7
391
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
392
  * @return string|null
 
 
393
  */
394
- private function get_assets_manager_options() {
 
395
  if( is_multisite() && is_network_admin() ) {
396
- return get_site_option( $this->get_options_prefix() . 'backend_assets_states', array() );
397
  } else if( is_admin() ) {
398
- return get_option( $this->get_options_prefix() . 'backend_assets_states', array() );
399
  }
400
 
401
- return get_option( $this->get_options_prefix() . 'assets_states', array() );
402
  }
403
 
404
  /**
405
  * Get parent plugin dir
406
  *
407
- * @since 1.0.7
408
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
409
  * @return string|null
 
 
410
  */
411
- private function get_parent_plugin_dir() {
412
- if ( $this->is_active_clearfy() ) {
413
- if ( $this->is_active_clearfy_dev() ) {
 
414
  return WP_PLUGIN_DIR . '/wp-plugin-clearfy/components/assets-manager/';
415
  }
416
 
417
  return WP_PLUGIN_DIR . '/clearfy/components/assets-manager/';
418
- } else if ( $this->is_active_assets_manager_standalone() ) {
419
- if ( $this->is_active_assets_manager_standalone_dev() ) {
420
  return WP_PLUGIN_DIR . '/wp-plugin-gonzales/';
421
  }
422
 
@@ -429,24 +451,25 @@ class WGNZ_Plugins_Loader {
429
  /**
430
  * Get premium plugin dir in dependence on environment
431
  *
432
- * @since 1.0.7
433
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
434
  * @return string|null
 
 
435
  */
436
- private function get_parent_premium_plugin_dir() {
437
- $is_active_prod = in_array( 'clearfy_package/clearfy-package.php', $this->active_plugins );
438
- $is_active_dev = in_array( 'wp-plugin-clearfy-package/clearfy-package.php', $this->active_plugins );
439
- $is_active_stand_alone_prod = in_array( 'assets-manager-premium/assets-manager-premium.php', $this->active_plugins );
440
- $is_active_stand_alone_dev = in_array( 'wp-plugin-assets-manager-premium/assets-manager-premium.php', $this->active_plugins );
441
-
442
- if($is_active_dev) {
443
- $premium_plugin_dir = WP_PLUGIN_DIR .'/wp-plugin-clearfy-package/plugins/assets-manager-premium';
444
- } else if($is_active_prod) {
445
- $premium_plugin_dir = WP_PLUGIN_DIR .'/clearfy_package/assets-manager-premium';
446
- } else if($is_active_stand_alone_prod){
447
- $premium_plugin_dir = WP_PLUGIN_DIR .'/assets-manager-premium/';
448
- } else if($is_active_stand_alone_dev) {
449
- $premium_plugin_dir = WP_PLUGIN_DIR .'/wp-plugin-assets-manager-premium/';
 
450
  } else {
451
  return null;
452
  }
2
  /**
3
  * Webcraftic AM plugin load filter
4
  * Dynamically activated only plugins that you have selected in each page. [Note] Webcraftic AM has been automatically installed/deleted by Activate/Deactivate of "load filter plugin".
5
+ * Version: 1.0.9
6
  * Framework Version: FACTORY_425_VERSION
7
  */
8
 
9
  // todo: проверить, как работает кеширование
10
  // todo: замерить, скорость работы этого решения
11
 
12
+ defined('ABSPATH') || exit;
13
 
14
+ if( defined('WP_SETUP_CONFIG') || defined('WP_INSTALLING') || isset($_GET['wbcr_assets_manager']) ) {
15
  return;
16
  }
17
 
29
  protected $settings;
30
  protected $active_plugins = array();
31
 
32
+ public function __construct()
33
+ {
34
  # We must always load the plugin if it is an ajax request, a cron
35
  # task or a rest api request. Otherwise, the user may have problems
36
  # with the work of plugins.
37
+ if( $this->doing_ajax() || $this->doing_cron() || $this->doing_rest_api() ) {
38
  return;
39
  }
40
 
41
+ $is_clearfy_active = false;
42
 
43
  $this->active_plugins = $this->get_active_plugins();
44
 
45
+ add_filter('wam/conditions/call_method', [$this, 'check_conditions_method'], 10, 4);
46
 
47
+ if( $this->is_active_clearfy() ) {
48
  $deactivate_components = $this->get_clearfy_deactivate_components();
49
 
50
+ if( empty($deactivate_components) || !in_array('assets_manager', $deactivate_components) ) {
51
  $is_clearfy_active = true;
52
  }
53
  }
59
  }
60
 
61
  # Disable plugins only if Asset Manager and Clearfy are activated
62
+ if( $is_clearfy_active || $this->is_active_assets_manager_standalone() ) {
63
  $this->settings = $this->get_assets_manager_options();
64
 
65
+ if( !empty($this->settings) ) {
66
+ if( is_multisite() ) {
67
+ add_filter('site_option_active_sitewide_plugins', array($this, 'disable_network_plugins'), 1);
68
  }
69
 
70
+ add_filter('option_active_plugins', array($this, 'disable_plugins'), 1);
71
+ add_filter('option_hack_file', array($this, 'hack_file_filter'), 1);
72
+ add_action('plugins_loaded', array($this, 'remove_plugin_filters'), 1);
73
  }
74
  }
75
  }
76
 
77
  /**
 
 
 
78
  * @param $hackFile
79
  *
80
  * @return mixed
81
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
82
+ * @since 1.0.0
83
+ *
84
  */
85
+ public function hack_file_filter($hackFile)
86
+ {
87
  $this->remove_plugin_filters();
88
 
89
  return $hackFile;
93
  * @author Alexander Kovalev <alex.kovalevv@gmail.com>
94
  * @since 1.0.0
95
  */
96
+ public function remove_plugin_filters()
97
+ {
98
+ remove_action('option_active_plugins', array($this, 'disable_plugins'), 1);
99
  }
100
 
101
  /**
104
  * @author Alexander Kovalev <alex.kovalevv@gmail.com>
105
  * @since 1.0.0
106
  */
107
+ public function disable_network_plugins($plugins_list)
108
+ {
109
  $new_plugin_list = $plugins_list;
110
 
111
+ if( is_array($plugins_list) && !empty($plugins_list) ) {
112
+ $temp_plugin_list = array_keys($plugins_list);
113
+ $temp_plugin_list = $this->disable_plugins($temp_plugin_list);
114
 
115
  $new_plugin_list = array();
116
+ foreach((array)$temp_plugin_list as $plugin_file) {
117
+ $new_plugin_list[$plugin_file] = $plugins_list[$plugin_file];
118
  }
119
  }
120
 
124
  /**
125
  * We control the disabling of plugins that are activated for blog.
126
  *
 
 
 
127
  * @param $plugins_list
128
  *
129
  * @return mixed
130
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
131
+ * @since 1.0.0
132
+ *
133
  */
134
+ public function disable_plugins($plugins_list)
135
+ {
136
+ if( !is_array($plugins_list) || empty($plugins_list) ) {
137
  return $plugins_list;
138
  }
139
 
140
+ foreach((array)$plugins_list as $key => $plugin_base) {
141
+ if( $this->is_disabled_plugin($plugin_base) ) {
142
+ unset($plugins_list[$key]);
143
  }
144
  }
145
 
149
  /**
150
  * Extra method for extend WGZ_Check_Conditions class.
151
  *
 
 
 
152
  * @param mixed $default
153
  * @param string $method_name
154
  * @param string $operator
155
  * @param mixed $value
156
  *
157
  * @return mixed
158
+ * @since 1.0.7
159
+ *
160
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
161
  */
162
+ public function check_conditions_method($default, $method_name, $operator, $value)
163
+ {
164
  $premium_plugin_dir = $this->get_parent_premium_plugin_dir();
165
 
166
  if( $premium_plugin_dir && file_exists($premium_plugin_dir) ) {
167
  require_once $premium_plugin_dir . '/includes/class-check-conditions.php';
168
+ if( class_exists('WGNZP_Check_Conditions') ) {
169
  $conditions = new WGNZP_Check_Conditions();
170
 
171
+ if( method_exists($conditions, $method_name) ) {
172
+ return $conditions->$method_name($operator, $value);
173
  }
174
  }
175
  }
180
  /**
181
  * Get a list of active plugins.
182
  *
 
 
183
  * @return array
184
+ * @since 1.0.0
185
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
186
  */
187
+ private function get_active_plugins()
188
+ {
189
+ if( is_multisite() ) {
190
+ $active_network_plugins = (array)get_site_option('active_sitewide_plugins');
191
+ $active_network_plugins = array_keys($active_network_plugins);
192
+ $active_blog_plugins = (array)get_option('active_plugins');
193
+
194
+ return array_unique(array_merge($active_network_plugins, $active_blog_plugins));
195
  }
196
 
197
+ return (array)get_option('active_plugins');
198
  }
199
 
200
  /**
201
  * Determines whether the current plugin is disabled
202
  *
 
 
 
203
  * @param $plugin_base
204
  *
205
  * @return bool
206
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
207
+ * @since 1.0.0
208
+ *
209
  */
210
+ private function is_disabled_plugin($plugin_base)
211
+ {
212
 
213
  $white_plgins_list = array(
214
  'clearfy', // prod
218
  'clearfy_package' // premium package
219
  );
220
 
221
+ $plugin_base_part = explode('/', $plugin_base);
222
 
223
  # If plugin base is incorrect or plugin name in the white list
224
+ if( 2 !== sizeof($plugin_base_part) || in_array($plugin_base_part[0], $white_plgins_list) ) {
225
  return false;
226
  }
227
 
228
+ if( !empty($this->settings['plugins']) && isset($this->settings['plugins'][$plugin_base_part[0]]) && 'disable_plugin' === $this->settings['plugins'][$plugin_base_part[0]]['load_mode'] ) {
229
  require_once $this->get_parent_plugin_dir() . '/includes/classes/class-check-conditions.php';
230
 
231
+ if( !empty($this->settings['plugins'][$plugin_base_part[0]]['visability']) ) {
232
+ $condition = new WGZ_Check_Conditions($this->settings['plugins'][$plugin_base_part[0]]['visability']);
233
+ if( $condition->validate() ) {
234
  return true;
235
  }
236
  }
251
  * @since 1.0.0
252
  * @return boolean
253
  */
254
+ private function doing_rest_api()
255
+ {
256
  $prefix = rest_get_url_prefix();
257
 
258
+ $rest_route = isset($_GET['rest_route']) ? $_GET['rest_route'] : null;
259
 
260
+ if( defined('REST_REQUEST') && REST_REQUEST // (#1)
261
+ || !is_null($rest_route) // (#2)
262
+ && strpos(trim($rest_route, '\\/'), $prefix, 0) === 0 ) {
263
  return true;
264
  }
265
 
266
  // (#3)
267
+ $rest_url = wp_parse_url(site_url($prefix));
268
+ $current_url = wp_parse_url(add_query_arg(array()));
269
 
270
+ return strpos($current_url['path'], $rest_url['path'], 0) === 0;
271
  }
272
 
273
  /**
274
  * Determines whether the current request is a WordPress Ajax request.
275
  *
 
276
  * @return bool True if it's a WordPress Ajax request, false otherwise.
277
+ * @since 1.0.0
278
  */
279
+ private function doing_ajax()
280
+ {
281
+ if( function_exists('wp_doing_ajax') ) {
282
  return wp_doing_ajax();
283
  }
284
 
285
+ return defined('DOING_AJAX') && DOING_AJAX;
286
  }
287
 
288
  /**
289
  * Determines whether the current request is a WordPress cron request.
290
  *
 
291
  * @return bool True if it's a WordPress cron request, false otherwise.
292
+ * @since 1.0.0
293
  */
294
+ private function doing_cron()
295
+ {
296
+ if( function_exists('wp_doing_cron') ) {
297
  return wp_doing_cron();
298
  }
299
 
300
+ return defined('DOING_CRON') && DOING_CRON;
301
  }
302
 
303
  /**
304
  * Is Clearfy plugin actives?
305
  *
 
 
306
  * @return string|null
307
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
308
+ * @since 1.0.7
309
  */
310
+ private function is_active_clearfy()
311
+ {
312
  return $this->is_active_clearfy_dev() || $this->is_active_clearfy_prod();
313
  }
314
 
315
  /**
316
  * Is Clearfy Dev plugin actives?
317
  *
 
 
318
  * @return string|null
319
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
320
+ * @since 1.0.7
321
  */
322
+ private function is_active_clearfy_dev()
323
+ {
324
+ return in_array('wp-plugin-clearfy/clearfy.php', $this->active_plugins);
325
  }
326
 
327
  /**
328
  * Is Clearfy Prod plugin actives?
329
  *
 
 
330
  * @return string|null
331
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
332
+ * @since 1.0.7
333
  */
334
+ private function is_active_clearfy_prod()
335
+ {
336
+ return in_array('clearfy/clearfy.php', $this->active_plugins);
337
  }
338
 
339
  /**
340
  * Is Assets Manager standalone actives?
341
  *
 
 
342
  * @return string|null
343
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
344
+ * @since 1.0.7
345
  */
346
+ private function is_active_assets_manager_standalone()
347
+ {
348
  return $this->is_active_assets_manager_standalone_prod() || $this->is_active_assets_manager_standalone_dev();
349
  }
350
 
351
  /**
352
  * Is Assets Manager standalone prod actives?
353
  *
 
 
354
  * @return string|null
355
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
356
+ * @since 1.0.7
357
  */
358
+ private function is_active_assets_manager_standalone_prod()
359
+ {
360
+ return in_array('gonzales/gonzales.php', $this->active_plugins);
361
  }
362
 
363
  /**
364
  * Is Assets Manager standalone dev actives?
365
  *
 
 
366
  * @return string|null
367
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
368
+ * @since 1.0.7
369
  */
370
+ private function is_active_assets_manager_standalone_dev()
371
+ {
372
+ return in_array('wp-plugin-gonzales/gonzales.php', $this->active_plugins);
373
  }
374
 
375
  /**
376
  * Get options prefix
377
  *
 
 
378
  * @return string|null
379
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
380
+ * @since 1.0.7
381
  */
382
+ private function get_options_prefix()
383
+ {
384
  if( $this->is_active_clearfy() ) {
385
  return self::CLEARFY_OPTIONS_PREFIX;
386
  }
387
+
388
  return self::DEFAULT_OPTIONS_PREFIX;
389
  }
390
 
391
  /**
392
  * Get Clearfy deactivated components
393
  *
 
 
394
  * @return array|null
395
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
396
+ * @since 1.0.7
397
  */
398
+ private function get_clearfy_deactivate_components()
399
+ {
400
+ if( is_multisite() ) {
401
+ return get_site_option($this->get_options_prefix() . 'deactive_preinstall_components', array());
402
  }
403
 
404
+ return get_option($this->get_options_prefix() . 'deactive_preinstall_components', array());
405
  }
406
 
407
  /**
408
  * Get Assets Manager options
409
  *
 
 
410
  * @return string|null
411
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
412
+ * @since 1.0.7
413
  */
414
+ private function get_assets_manager_options()
415
+ {
416
  if( is_multisite() && is_network_admin() ) {
417
+ return get_site_option($this->get_options_prefix() . 'backend_assets_states', array());
418
  } else if( is_admin() ) {
419
+ return get_option($this->get_options_prefix() . 'backend_assets_states', array());
420
  }
421
 
422
+ return get_option($this->get_options_prefix() . 'assets_states', array());
423
  }
424
 
425
  /**
426
  * Get parent plugin dir
427
  *
 
 
428
  * @return string|null
429
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
430
+ * @since 1.0.7
431
  */
432
+ private function get_parent_plugin_dir()
433
+ {
434
+ if( $this->is_active_clearfy() ) {
435
+ if( $this->is_active_clearfy_dev() ) {
436
  return WP_PLUGIN_DIR . '/wp-plugin-clearfy/components/assets-manager/';
437
  }
438
 
439
  return WP_PLUGIN_DIR . '/clearfy/components/assets-manager/';
440
+ } else if( $this->is_active_assets_manager_standalone() ) {
441
+ if( $this->is_active_assets_manager_standalone_dev() ) {
442
  return WP_PLUGIN_DIR . '/wp-plugin-gonzales/';
443
  }
444
 
451
  /**
452
  * Get premium plugin dir in dependence on environment
453
  *
 
 
454
  * @return string|null
455
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
456
+ * @since 1.0.7
457
  */
458
+ private function get_parent_premium_plugin_dir()
459
+ {
460
+ $is_active_prod = in_array('clearfy_package/clearfy-package.php', $this->active_plugins);
461
+ $is_active_dev = in_array('wp-plugin-clearfy-package/clearfy-package.php', $this->active_plugins);
462
+ $is_active_stand_alone_prod = in_array('assets-manager-premium/assets-manager-premium.php', $this->active_plugins);
463
+ $is_active_stand_alone_dev = in_array('wp-plugin-assets-manager-premium/assets-manager-premium.php', $this->active_plugins);
464
+
465
+ if( $is_active_dev ) {
466
+ $premium_plugin_dir = WP_PLUGIN_DIR . '/wp-plugin-clearfy-package/plugins/assets-manager-premium';
467
+ } else if( $is_active_prod ) {
468
+ $premium_plugin_dir = WP_PLUGIN_DIR . '/clearfy_package/plugins/assets-manager-premium';
469
+ } else if( $is_active_stand_alone_prod ) {
470
+ $premium_plugin_dir = WP_PLUGIN_DIR . '/assets-manager-premium/';
471
+ } else if( $is_active_stand_alone_dev ) {
472
+ $premium_plugin_dir = WP_PLUGIN_DIR . '/wp-plugin-assets-manager-premium/';
473
  } else {
474
  return null;
475
  }
components/assets-manager/readme.txt CHANGED
@@ -59,6 +59,9 @@ We invite you to check out a few other related free plugins that our team has al
59
  2. Assets manager
60
 
61
  == Changelog ==
 
 
 
62
  = 2.0.4 (10.12.2019) =
63
  * Fixed: Bug "[Warning message when open the Customize](https://wordpress.org/support/topic/warning-message-when-open-the-customize/)".
64
  * Fixed: Conditional logic in the premium plugin didn't work in previous version due an error.
59
  2. Assets manager
60
 
61
  == Changelog ==
62
+ = 2.0.5 (12.02.2020) =
63
+ * Fixed: Minor bug
64
+
65
  = 2.0.4 (10.12.2019) =
66
  * Fixed: Bug "[Warning message when open the Customize](https://wordpress.org/support/topic/warning-message-when-open-the-customize/)".
67
  * Fixed: Conditional logic in the premium plugin didn't work in previous version due an error.
migrations/010108.php CHANGED
@@ -6,16 +6,15 @@
6
  */
7
 
8
  // Exit if accessed directly
9
- if ( ! defined( 'ABSPATH' ) ) {
10
  exit;
11
  }
12
 
13
  class WCLUpdate010108 extends Wbcr_Factory425_Update {
14
 
15
- public function install() {
16
- global $wpdb, $wbcr_clearfy_plugin;
17
-
18
- delete_option( $wbcr_clearfy_plugin->pluginName . '_quick_modes' );
19
- delete_option( $wbcr_clearfy_plugin->pluginName . '_disable_admin_notices' );
20
  }
21
  }
6
  */
7
 
8
  // Exit if accessed directly
9
+ if( !defined('ABSPATH') ) {
10
  exit;
11
  }
12
 
13
  class WCLUpdate010108 extends Wbcr_Factory425_Update {
14
 
15
+ public function install()
16
+ {
17
+ delete_option($this->plugin->getPluginName() . '_quick_modes');
18
+ delete_option($this->plugin->getPluginName() . '_disable_admin_notices');
 
19
  }
20
  }
migrations/010604.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php #comp-page builds: premium
2
+
3
+ /**
4
+ * Updates for altering the table used to store statistics data.
5
+ * Adds new columns and renames existing ones in order to add support for the new social buttons.
6
+ */
7
+
8
+ // Exit if accessed directly
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class WCLUpdate010604 extends Wbcr_Factory425_Update {
14
+
15
+ public function install() {
16
+ $this->assets_manager_migration();
17
+ }
18
+
19
+ /**
20
+ * Перенос данных из старого менеджера скриптов в новый
21
+ *
22
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
23
+ * @since 1.6.0
24
+ */
25
+ private function assets_manager_migration() {
26
+ if ( ! defined( 'WGZ_PLUGIN_DIR' ) ) {
27
+ define( 'WGZ_PLUGIN_DIR', WCL_PLUGIN_DIR . '/components/assets-manager' );
28
+ }
29
+
30
+ /**
31
+ * Миграция для аддона Assets manager
32
+ */
33
+ require_once( WCL_PLUGIN_DIR . '/components/assets-manager/migrations/020005.php' );
34
+
35
+ $wupm_updates = new WGZUpdate020005( $this->plugin );
36
+ $wupm_updates->install();
37
+ }
38
+ }
readme.txt CHANGED
@@ -238,6 +238,9 @@ Of course! To do this, email us your wishes with address, which you will find in
238
 
239
 
240
  == Changelog ==
 
 
 
241
  = 1.6.3 (21.01.2020) =
242
  * Fixed: Minor bugs.
243
  * Fixed: Compatibility with Robin image optimizer 1.4.2
238
 
239
 
240
  == Changelog ==
241
+ = 1.6.4 (12.02.2020) =
242
+ * Fixed: Minor bugs.
243
+
244
  = 1.6.3 (21.01.2020) =
245
  * Fixed: Minor bugs.
246
  * Fixed: Compatibility with Robin image optimizer 1.4.2