PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.12.8
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.12.8
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / admin / modules / setup-wizard / class-wpfnl-activate-plugin.php

class-wpfnl-activate-plugin.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.12.8, at admin/modules/setup-wizard/class-wpfnl-activate-plugin.php

67 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WPFunnels\Admin\SetupWizard;
3
4 /**
5 * Activate Plugins
6 *
7 * @since 3.3.1
8 */
9 class ActivatePlugin {
10
11 protected $plugins = [];
12
13
14 /**
15 * Constructor
16 *
17 * @param array $plugins
18 * @since 3.3.1
19 */
20 public function __construct( $plugins = [] ){
21 $this->plugins = $plugins;
22 }
23
24 /**
25 * Activate plugins
26 *
27 * @return array
28 * @since 3.3.1
29 */
30 public function activate_plugins(){
31
32 if( empty($this->plugins) && !is_array($this->plugins) ){
33 return;
34 }
35
36 $response = [
37 'suceess' => true,
38 ];
39 foreach( $this->plugins as $key=>$plugin ){
40
41 if( !isset($plugin['name'],$plugin['status'],$plugin['path'],$plugin['type']) && ($plugin['status'] == 'activated' || $plugin['status'] == 'uninstalled') ){
42 continue;
43 }
44
45 if( 'bricks' === $plugin['name'] ){
46 if (wp_get_theme($plugin['path'])->exists()) {
47 switch_theme($plugin['path']);
48 }
49 }else{
50 \activate_plugin( $plugin['path'] );
51
52 if( isset($plugin['slug']) ){
53 if( 'woocommerce' === $plugin['slug'] ){
54 delete_transient( '_wc_activation_redirect' );
55 }
56
57 if( 'elementor' === $plugin['slug'] ){
58 update_option('elementor_onboarded',true);
59 }
60 }
61 }
62 }
63 return $response;
64 }
65 }
66
67 ?>