/** * Class constructor * * @global array $quads_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 $quads_options; $this->file = $_file; $this->item_name = $_item_name; $this->item_shortname = 'quads_' . preg_replace('/[^a-zA-Z0-9_\\s]/', '', str_replace(' ', '_', strtolower($this->item_name))); $this->version = $_version; $this->license = isset($quads_options[$this->item_shortname . '_license_key']) ? trim($quads_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 = quads_get_option($_optname, false); if (isset($opt) && empty($this->license)) { $this->license = trim($opt); } } // Setup hooks $this->includes(); $this->hooks(); //$this->auto_updater(); }
<?php /** * Uninstall Quick adsense reloaded * * @package quads * @subpackage Uninstall * @copyright Copyright (c) 2015, René Hermenau * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License * @since 1.0.0 */ // Exit if accessed directly if (!defined('WP_UNINSTALL_PLUGIN')) { exit; } // Load QUADS file include_once 'quick-adsense-reloaded.php'; if (quads_get_option('uninstall_on_delete')) { /** Delete all the Plugin Options */ delete_option('quads_settings'); delete_option('quads_install_date'); delete_option('quads_rating_div'); delete_option('quads_version'); delete_option('quads_version_upgraded_from'); /* Delete all post meta options */ delete_post_meta_by_key('quads_timestamp'); delete_post_meta_by_key('quads_shares'); delete_post_meta_by_key('quads_jsonshares'); }