Example #1
0
 private static function single_uninstall($network_wide)
 {
     if (!current_user_can('activate_plugins')) {
         return;
     }
     $url = self::SERVER_URL . 'wc_update_site_state';
     $args = array('body' => array('site' => get_option('siteurl'), 'site_id' => get_option('wcis_site_id'), 'store_id' => get_current_blog_id(), 'authentication_key' => get_option('authentication_key'), 'email' => get_option('admin_email'), 'site_status' => 'uninstall'));
     $resp = wp_remote_post($url, $args);
     WCISPlugin::reset_database();
 }
/**
 *
 * @package   WCISPlugin
 * @license   GPL-2.0+
 * @copyright 2014 InstantSearchPlus
 *
 * @wordpress-plugin
 * Plugin Name:       Instant Search + for WooCommerce Search
 * Plugin URI:        www.instantsearchplus.com 
 * Description:       Best search plugin for WooCommerce
 * Version:           1.4.5
 * Author:            Fast Simon Inc
 * Author URI:        www.instantsearchplus.com
 * Text Domain:       WCISPlugin
 * License:           GPL-2.0+
 * Domain Path:       /languages
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/*----------------------------------------------------------------------------*
 * Public-Facing Functionality
 *----------------------------------------------------------------------------*/
require_once plugin_dir_path(__FILE__) . 'public/wcis_plugin.php';
require_once plugin_dir_path(__FILE__) . 'widget/instantsearch-for-woocommerce-widget.php';
register_activation_hook(__FILE__, array(WCISPlugin::get_instance(), 'activate'));
register_deactivation_hook(__FILE__, array(WCISPlugin::get_instance(), 'deactivate'));
register_uninstall_hook(__FILE__, array('WCISPlugin', 'uninstall'));
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array('WCISPlugin', 'wcis_add_action_links'));
add_shortcode('isp_search_box', array('WCISPlugin', 'get_isp_search_box_form'));
Example #3
0
 /**
  * Fired when the plugin is uninstalled.
  *
  * @since    1.0.0
  *
  * @param    boolean    $network_wide    True if WPMU superadmin uses
  *                                       "Network Deactivate" action, false if
  *                                       WPMU is disabled or plugin is
  *                                       deactivated on an individual blog.
  */
 public static function uninstall($network_wide)
 {
     if (function_exists('is_multisite') && is_multisite()) {
         $blog_ids = array();
         $sites = wp_get_sites();
         foreach ($sites as $site) {
             $blog_ids[] = $site['blog_id'];
         }
         foreach ($blog_ids as $blog_id) {
             switch_to_blog($blog_id);
             WCISPlugin::single_uninstall($network_wide);
             restore_current_blog();
         }
     } else {
         WCISPlugin::single_uninstall($network_wide);
     }
 }