/**
         * Outputs License deactivation checkbox field
         */
        public function wc_am_deactivate_textarea()
        {
            $ame = swifty_get_ame_plugin_settings($this->plugin_key_name);
            echo '<input type="checkbox" id="' . $ame->ame_deactivate_checkbox . '" name="' . $ame->ame_deactivate_checkbox . '" value="on"';
            echo checked(get_option($ame->ame_deactivate_checkbox), 'on');
            echo '/>';
            ?>
<span
            class="description"><?php 
            _e('Deactivates an API License Key so it can be used on another blog.', 'swifty');
            ?>
</span>
            <?php 
        }
Ejemplo n.º 2
0
    /**
     * Displays an inactive notice when the software is inactive. page=swifty_content_creator_admin&tab=
     */
    public function prot_inactive_notice()
    {
        if (!current_user_can('manage_options')) {
            return;
        }
        if (isset($_GET['page']) && $this->swifty_admin_page === $_GET['page']) {
            return;
        }
        $settings = swifty_get_ame_plugin_settings($this->plugin_key_name);
        ?>
        <div id="message" class="error">
            <p><?php 
        printf(__('The license key for <b>%s</b> has not been activated, so the plugin is inactive! %sClick here%s to activate the license key and the plugin.', 'swifty'), $this->plugin_name, '<a href="' . esc_url(admin_url('admin.php?page=' . $settings->setting_menu_page . '&link=' . $this->plugin_key_name . '_dashboard')) . '">', '</a>');
        ?>
</p>
        </div>
        <?php 
    }
Ejemplo n.º 3
0
 /**
  * Checks if the software is activated or deactivated
  * @param  array $args
  * @return array
  */
 public function status($args)
 {
     $ame = swifty_get_ame_plugin_settings($this->plugin_name);
     $defaults = array('request' => 'status', 'product_id' => $ame->ame_product_id, 'instance' => $ame->ame_instance_id, 'platform' => $ame->ame_domain);
     $args = wp_parse_args($defaults, $args);
     $target_url = esc_url_raw(self::create_software_api_url($args));
     $request = wp_safe_remote_get($target_url);
     if (is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200) {
         // Request failed
         return false;
     }
     $response = wp_remote_retrieve_body($request);
     return $response;
 }