| 1 |
<?php |
| 2 |
/** |
| 3 |
* Theme Compatibility |
| 4 |
* |
| 5 |
* @package WPFunnels\Compatibility\Plugin |
| 6 |
*/ |
| 7 |
namespace WPFunnels\Compatibility\Plugin; |
| 8 |
|
| 9 |
use WPFunnels\Wpfnl_functions; |
| 10 |
use WPFunnels\Traits\SingletonTrait; |
| 11 |
|
| 12 |
|
| 13 |
class Wpfnl_Plugin_Compatibility { |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* Init all supported theme class |
| 18 |
* |
| 19 |
*/ |
| 20 |
public function init_classes(){ |
| 21 |
$plugins = $this->get_all_compatible_plugins(); |
| 22 |
if( is_array( $plugins ) ){ |
| 23 |
foreach( $plugins as $plugin ){ |
| 24 |
if( isset( $plugin['class_name'] ) ){ |
| 25 |
$class_name = "WPFunnels\\Compatibility\\Plugin\\".$plugin['class_name']; |
| 26 |
if (class_exists(ucfirst($class_name))) { |
| 27 |
if( $class_name::getInstance()->maybe_activate() ){ |
| 28 |
$class_name::getInstance()->init(); |
| 29 |
} |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
/** |
| 39 |
* List of compatible plugins |
| 40 |
* |
| 41 |
* @since 2.7.7 |
| 42 |
* @return Array |
| 43 |
*/ |
| 44 |
public function get_all_compatible_plugins(){ |
| 45 |
$plugins = [ |
| 46 |
[ |
| 47 |
'name' => 'Cart Lift', |
| 48 |
'class_name' => 'CartLift' |
| 49 |
], |
| 50 |
[ |
| 51 |
'name' => 'Slim Seo', |
| 52 |
'class_name' => 'SlimSeo' |
| 53 |
], |
| 54 |
[ |
| 55 |
'name' => 'Electro Extension', |
| 56 |
'class_name' => 'ElectroExtension' |
| 57 |
], |
| 58 |
[ |
| 59 |
'name' => 'WooCommerce Multilingual', |
| 60 |
'class_name' => 'Wcml' |
| 61 |
], |
| 62 |
[ |
| 63 |
'name' => 'Product Addon', |
| 64 |
'class_name' => 'ProductAddon' |
| 65 |
], |
| 66 |
[ |
| 67 |
'name' => 'Astra Pro', |
| 68 |
'class_name' => 'AstraPro' |
| 69 |
], |
| 70 |
[ |
| 71 |
'name' => 'Elementor Pro', |
| 72 |
'class_name' => 'ElementorPro' |
| 73 |
], |
| 74 |
[ |
| 75 |
'name' => 'Tutor LMS', |
| 76 |
'class_name' => 'Tutor' |
| 77 |
], |
| 78 |
[ |
| 79 |
'name' => 'Google Site Kit', |
| 80 |
'class_name' => 'GoogleSiteKit' |
| 81 |
], |
| 82 |
[ |
| 83 |
'name' => 'Fox Currency Switcher', |
| 84 |
'class_name' => 'FoxCurrencySwitcher' |
| 85 |
], |
| 86 |
[ |
| 87 |
'name' => 'WooCommerce Germanized', |
| 88 |
'class_name' => 'WooCommerceGermanized' |
| 89 |
] |
| 90 |
]; |
| 91 |
return $plugins; |
| 92 |
} |
| 93 |
} |
| 94 |
|