This repository was archived by the owner on Mar 17, 2022. It is now read-only.
File tree 2 files changed +3
-28
lines changed
2 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,7 @@ public static function canActivate()
109
109
$ woocommerce = false ;
110
110
111
111
/* check polylang plugin */
112
- if (
113
- (
114
- is_plugin_active ('polylang/polylang.php ' ) ||
115
- is_plugin_active ('polylang-pro/polylang.php ' )
116
- ) ||
117
- (
118
- is_plugin_active_for_network ('polylang/polylang.php ' ) ||
119
- is_plugin_active_for_network ('polylang-pro/polylang.php ' )
120
- )
121
- ) {
112
+ if (class_exists ('Polylang ' )) {
122
113
if (isset ($ GLOBALS ['polylang ' ], \PLL ()->model , PLL ()->links_model )) {
123
114
if (pll_default_language ()) {
124
115
$ polylang = true ;
@@ -127,10 +118,7 @@ public static function canActivate()
127
118
}
128
119
129
120
/* check woocommerce plugin */
130
- if (
131
- is_plugin_active ('woocommerce/woocommerce.php ' ) ||
132
- is_plugin_active_for_network ('woocommerce/woocommerce.php ' )
133
- ) {
121
+ if (class_exists ('WooCommerce ' )) {
134
122
$ woocommerce = true ;
135
123
}
136
124
Original file line number Diff line number Diff line change @@ -226,20 +226,7 @@ public static function woocommerceVersionCheck($version)
226
226
*/
227
227
public static function polylangVersionCheck ($ version )
228
228
{
229
- if (!function_exists ('get_plugin_data ' )) {
230
- require_once ABSPATH . 'wp-admin/includes/plugin.php ' ;
231
- }
232
-
233
- $ filepath = ABSPATH . 'wp-content/plugins/polylang/polylang.php ' ;
234
- if (! file_exists ($ filepath )) {
235
- $ filepath = ABSPATH . 'wp-content/plugins/polylang-pro/polylang.php ' ;
236
- if (! file_exists ($ filepath )) {
237
- error_log ('Polylang version not tested - polylang file not found ' );
238
- return true ;
239
- }
240
- }
241
- $ data = get_plugin_data ($ filepath , false , false );
242
- if (version_compare ($ data ['Version ' ], $ version , '>= ' )) {
229
+ if (defined ('POLYLANG_VERSION ' ) && version_compare (POLYLANG_VERSION , $ version , '>= ' )) {
243
230
return true ;
244
231
}
245
232
You can’t perform that action at this time.
0 commit comments