コード例 #1
0
 /**
  * Plugin deactivation hook.
  *
  * @author Vova Feldman (@svovaf)
  * @since  1.0.1
  */
 function _deactivate_plugin_hook()
 {
     $this->_logger->entrance('slug = ' . $this->_slug);
     if (!current_user_can('activate_plugins')) {
         return;
     }
     $this->_admin_notices->clear_all_sticky();
     if (!$this->has_api_connectivity()) {
         // Reset connectivity test cache.
         unset($this->_storage->connectivity_test);
     }
     if ($this->is_registered()) {
         // Send deactivation event.
         $this->get_api_site_scope()->call('/', 'put', array('is_active' => false, 'is_premium' => $this->is_premium(), 'version' => $this->get_plugin_version()));
     }
     // Clear API cache on deactivation.
     FS_Api::clear_cache();
 }
コード例 #2
0
 /**
  * Plugin deactivation hook.
  *
  * @author Vova Feldman (@svovaf)
  * @since  1.0.1
  */
 function _deactivate_plugin_hook()
 {
     $this->_logger->entrance('slug = ' . $this->_slug);
     if (!current_user_can('activate_plugins')) {
         return;
     }
     $this->_admin_notices->clear_all_sticky();
     if (isset($this->_storage->sticky_optin_added)) {
         unset($this->_storage->sticky_optin_added);
     }
     if (!isset($this->_storage->is_plugin_new_install)) {
         // Remember that plugin was already installed.
         $this->_storage->is_plugin_new_install = false;
     }
     // Hook to plugin uninstall.
     register_uninstall_hook($this->_plugin_main_file_path, array('Freemius', '_uninstall_plugin_hook'));
     $this->clear_module_main_file_cache();
     $this->clear_sync_cron();
     $this->clear_install_sync_cron();
     if ($this->is_registered()) {
         // Send deactivation event.
         $this->sync_install(array('is_active' => false));
     } else {
         if (!$this->has_api_connectivity()) {
             // Reset connectivity test cache.
             unset($this->_storage->connectivity_test);
         }
     }
     // Clear API cache on deactivation.
     FS_Api::clear_cache();
     $this->remove_sdk_reference();
 }
コード例 #3
0
 /**
  * Plugin deactivation hook.
  *
  * @author Vova Feldman (@svovaf)
  * @since  1.0.1
  */
 function _deactivate_plugin_hook()
 {
     $this->_logger->entrance('slug = ' . $this->_slug);
     if (!current_user_can('activate_plugins')) {
         return;
     }
     $this->_admin_notices->clear_all_sticky();
     if (!$this->has_api_connectivity()) {
         // Reset connectivity test cache.
         unset($this->_storage->connectivity_test);
     }
     if (!isset($this->_storage->is_plugin_new_install)) {
         // Remember that plugin was already installed.
         $this->_storage->is_plugin_new_install = false;
     }
     if ($this->is_registered()) {
         // Send deactivation event.
         $this->sync_install(array('is_active' => false));
     }
     // Clear API cache on deactivation.
     FS_Api::clear_cache();
 }