/**
  * Register plugins for update tab
  *
  * @return void
  * @since    1.0.0
  * @author   Andrea Grillo <*****@*****.**>
  */
 public function register_plugin_for_updates()
 {
     if (!class_exists('YIT_Upgrade')) {
         require_once 'plugin-fw/lib/yit-upgrade.php';
     }
     YIT_Upgrade()->register(YWCPS_SLUG, YWCPS_INIT);
 }
Пример #2
0
 public function licence_after_check()
 {
     /* === Regenerate Update Plugins Transient === */
     YIT_Upgrade()->force_regenerate_update_transient();
 }
Пример #3
0
            $title = __('Update Plugin', 'yith-plugin-fw');
            $parent_file = 'plugins.php';
            $submenu_file = 'plugins.php';
            wp_enqueue_script('updates');
            require_once ABSPATH . 'wp-admin/admin-header.php';
            $nonce = 'upgrade-plugin-multisite_' . $plugin;
            $url = 'update.php?action=upgrade-plugin-multisite&plugin=' . urlencode($plugin);
            $upgrader = new Plugin_Upgrader(new Plugin_Upgrader_Skin(compact('title', 'nonce', 'url', 'plugin')));
            $upgrader->upgrade($plugin);
            include ABSPATH . 'wp-admin/admin-footer.php';
        }
    }
}
if (!function_exists('YIT_Upgrade')) {
    /**
     * Main instance of plugin
     *
     * @return object
     * @since  1.0
     * @author Andrea Grillo <*****@*****.**>
     */
    function YIT_Upgrade()
    {
        return YIT_Upgrade::instance();
    }
}
/**
 * Instance a YIT_Upgrade object
 */
YIT_Upgrade();
Пример #4
0
 /**
  * Update Plugins Information
  *
  * Send a request to API server to check activate plugins and update the informations
  *
  * @return void
  * @use YIT_Theme_Licence->check()
  *
  * @since  1.0
  * @author Andrea Grillo <*****@*****.**>
  */
 public function update_licence_information()
 {
     foreach ($this->_products as $init => $info) {
         $this->check($init);
     }
     /* === Regenerate Update Plugins Transient === */
     YIT_Upgrade()->force_regenerate_update_transient();
     do_action('yit_licence_after_check');
     $response['template'] = $this->show_activation_panel();
     wp_send_json($response);
 }
Пример #5
0
 /**
  * Update Plugins Information
  *
  * Send a request to API server to check activate plugins and update the informations
  *
  * @return void
  * @use YIT_Theme_Licence->check()
  *
  * @since  1.0
  * @author Andrea Grillo <*****@*****.**>
  */
 public function update_licence_information()
 {
     /* Check licence information for alla products */
     $this->check_all();
     /* === Regenerate Update Plugins Transient === */
     YIT_Upgrade()->force_regenerate_update_transient();
     do_action('yit_licence_after_check');
     if ($this->is_ajax()) {
         $response['template'] = $this->show_activation_panel();
         wp_send_json($response);
     }
 }