mep_chk_plugin_folder_exist($_GET['mep_plugin_install']) == false){ $slug = $_GET['mep_plugin_install']; $action = 'install-plugin'; $url = wp_nonce_url( add_query_arg( array( 'action' => $action, 'plugin' => $slug ), admin_url( 'update.php' ) ), $action.'_'.$slug ); if(isset($url)){ echo ''; } } else{ return false; } } public function mep_plugin_activate(){ if(isset($_GET['mep_plugin_activate']) && !is_plugin_active( $_GET['mep_plugin_activate'] )){ $slug = $_GET['mep_plugin_activate']; $activate = activate_plugin( $slug ); $url = admin_url('plugins.php'); echo ''; } else{ return false; } } public function mep_admin_notices(){ $slug = 'woocommerce'; $style = 'background: #f8d7da; font-size: 13px; color: #721c24;'; if( $this->mep_chk_plugin_folder_exist($slug) == false ){ $this->mep_requested_plugin_install($slug); $wc_btn = 'Install Now'; printf( '

%s '.$wc_btn.'

', __('You must install the WooCommerce plugin before activating Event Manager For WooCommerce. Because it is dependent on the WooCommerce plugin.','mage-eventpress') ); } elseif($this->mep_chk_plugin_folder_exist($slug) == true && !is_plugin_active( 'woocommerce/woocommerce.php')){ $plugin = 'woocommerce/woocommerce.php'; $url = admin_url('plugins.php').'?mep_plugin_activate='.$plugin; $wc_btn = 'Active Now'; printf( '

%s '.$wc_btn.'

', __('You must activate the WooCommerce plugin before activating Event Manager For WooCommerce. Because it is dependent on the WooCommerce plugin.','mage-eventpress') ); } else{ return false; } } } } new MEP_Required_Plugins();