コード例 #1
0
 /**
  * Class constructor
  *
  * @global  array $wpstg_options
  * @param string  $_file
  * @param string  $_item_name
  * @param string  $_version
  * @param string  $_author
  * @param string  $_optname
  * @param string  $_api_url
  */
 function __construct($_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null)
 {
     global $wpstg_options;
     $this->file = $_file;
     $this->item_name = $_item_name;
     $this->item_shortname = 'wpstg_' . preg_replace('/[^a-zA-Z0-9_\\s]/', '', str_replace(' ', '_', strtolower($this->item_name)));
     $this->version = $_version;
     $this->license = isset($wpstg_options[$this->item_shortname . '_license_key']) ? trim($wpstg_options[$this->item_shortname . '_license_key']) : '';
     $this->author = $_author;
     $this->api_url = is_null($_api_url) ? $this->api_url : $_api_url;
     /**
      * Allows for backwards compatibility with old license options,
      * i.e. if the plugins had license key fields previously, the license
      * handler will automatically pick these up and use those in lieu of the
      * user having to reactive their license.
      */
     if (!empty($_optname)) {
         $opt = wpstg_get_option($_optname, false);
         if (isset($opt) && empty($this->license)) {
             $this->license = trim($opt);
         }
     }
     // Setup hooks
     $this->includes();
     $this->hooks();
     //$this->auto_updater();
 }
コード例 #2
0
/**
 * Uninstall WP-Staging
 *
 * @package     WPSTG
 * @subpackage  Uninstall
 * @copyright   Copyright (c) 2015, René Hermenau
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 * @since       0.9.0
 */
// Exit if accessed directly
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
// Load WPSTG file
include_once 'wp-staging.php';
global $wpdb, $wpstg_options;
/** 
 * Delete all the Plugin Options 
 * 
 */
if (wpstg_get_option('uninstall_on_delete')) {
    delete_option('wpstg_version_upgraded_from');
    delete_option('wpstg_version');
    delete_option('wpstg_installDate');
    delete_option('wpstg_RatingDiv');
    delete_option('wpstg_firsttime');
    delete_option('wpstg_is_staging_site');
    delete_option('wpstg_hide_beta');
    delete_option('wpstg_settings');
    delete_option('wpstg_existing_clones');
}