Delete all plugin licenses.

@author Vova Feldman (@svovaf)
@since  1.0.9

@param bool $store
548636
private function _delete_licenses( $store = true ) {
            $this->_logger->entrance();

            $all_licenses = self::get_all_licenses();

            unset( $all_licenses[ $this->_module_id ] );

            self::$_accounts->set_option( 'all_licenses', $all_licenses, $store );
        }
509405
private function removePermissions()
    {
        $this->pluginsService->removePluginPermissions($this->pluginsService->collectPermissions($this->translator->trans('plugin.ingest.permissions.label')));
    }
855221
private static function is_active_valid_license( $license ) {
            return (
                is_object( $license ) &&
                FS_Plugin_License::is_valid_id( $license->id ) &&
                $license->is_active() &&
                $license->is_valid()
            );
        }
1040949
public function removeAll()
    {
        $this->_validate();
        if (!$this->isLocked()) {
            $_SESSION[$this->publicStorage]['store'][$this->_namespaceName] = array();
            return true;
        }
        return false;
    }
519052
public function unregister(PluginBundleInterface $plugin)
    {
        $pluginFqcn = get_class($plugin);
        $this->dbWriter->delete($pluginFqcn);
    }
487547
public function purge() {
        $this->flush_store_by_id($this->storeid);
        $this->store = &self::register_store_id($this->storeid);
        // Don't worry about checking if we're using max size just set it as thats as fast as the check.
        $this->storecount = 0;
        return true;
    }
660240
public function deleteAllCompile()
    {
        $a = array("dev", "prod");
        for ($i = 0; $i < count($a); $i++) {
            $this->callDelCreaServer($a[$i]);
        }
    }
360819
private static function uninstall( $plugin_base_name ) {
		$app = self::find_plugin( $plugin_base_name );
		if ( ! isset( $app ) ) {
			return;
		}

		$app->_is_uninstall = true;
		$app->plugins_loaded();
		$app->main_init();
		$app->uninstall->uninstall();
	}
114435
public function canDelete($store_id)
    {
        if ($this->isDefault($store_id)) {
            return false;
        }

        $sql = 'SELECT NOT EXISTS (SELECT store_id FROM product WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM category_group WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM page WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM orders WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM cart WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM user WHERE store_id=:id)';

        return (bool) $this->db->fetchColumn($sql, array('id' => $store_id));
    }
1011164
public function set_license($license) {
        $filerecord = new stdClass;
        $filerecord->license = $license;
        $this->update($filerecord);
    }
295773
private function deleteStore($key)
    {
        if (isset($this->storage[$key])) {
            unset($this->storage[$key]);
            return $this->save();
        }

        return true;
    }
1128795
public void deleteStore() throws BlockStoreException {
        maybeConnect();
        try {
            Statement s = conn.get().createStatement();
            for(String sql : getDropTablesSQL()) {
                s.execute(sql);
            }
            s.close();
        } catch (SQLException ex) {
            throw new RuntimeException(ex);
        }
    }
974723
public function unregister(PluginBundle $plugin)
    {
        $pluginFqcn = get_class($plugin);
        $this->dbWriter->delete($pluginFqcn);
    }
347863
protected function _deactivate_license( $show_notice = true ) {
            $this->_logger->entrance();

            $hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...';

            if ( ! FS_Plugin_License::is_valid_id( $this->_site->license_id ) ) {
                $this->_admin_notices->add(
                    sprintf( $this->get_text_inline( 'It looks like your site currently doesn\'t have an active license.', 'no-active-license-message' ), $this->get_plan_title() ),
                    $hmm_text
                );

                return;
            }

            $api     = $this->get_api_site_scope();
            $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' );

            $this->handle_license_deactivation_result( $license, $hmm_text, $show_notice );
        }
985823
public static function unregisterApp(?string $app = null): void
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        if (self::isAppRegistered($app)) {
            unset(self::$repositories[$app]);
        }
    }
734739
public function delete($sOXID = null)
    {
        if (parent::delete($sOXID)) {
            \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer::class)->onDeleteManufacturer($this);

            return true;
        }

        return false;
    }
1100006
private function deactivate_premium_only_addon_without_license( $is_after_trial_cancel = false ) {
            if ( ! $this->has_free_plan() &&
                 ! $this->has_features_enabled_license() &&
                 ! $this->_has_premium_license()
            ) {
                if ( $this->is_registered() ) {
                    // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons).
                    //                if (empty($this->_storage->activation_timestamp) ||
                    //                    (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30
                    //                ) {
                    /**
                     * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation.
                     *
                     * Retry syncing the user add-on licenses.
                     */
                    // Sync licenses.
                    $this->_sync_licenses();
                    //                }

                    // Try to activate premium license.
                    $this->_activate_license( true );
                }

                if ( ! $this->has_free_plan() &&
                     ! $this->has_features_enabled_license() &&
                     ! $this->_has_premium_license()
                ) {
                    // @todo Check if deactivate plugins also call the deactivation hook.

                    $this->_parent->_admin_notices->add_sticky(
                        sprintf(
                            ( $is_after_trial_cancel ?
                                $this->_parent->get_text_inline(
                                    '%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you\'ll have to purchase a license.',
                                    'addon-trial-cancelled-message'
                                ) :
                                $this->_parent->get_text_inline(
                                    '%s is a premium only add-on. You have to purchase a license first before activating the plugin.',
                                    'addon-no-license-message'
                                )
                            ),
                            '<b>' . $this->_plugin->title . '</b>'
                        ) . ' ' . sprintf(
                            '<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s &nbsp;&#10140;</a>',
                            $this->_parent->addon_url( $this->_slug ),
                            esc_attr( sprintf( $this->_parent->get_text_inline( 'More information about %s', 'more-information-about-x' ), $this->_plugin->title ) ),
                            $this->_parent->get_text_inline( 'Purchase License', 'purchase-license' )
                        ),
                        'no_addon_license_' . $this->_slug,
                        ( $is_after_trial_cancel ? '' : $this->_parent->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' ),
                        ( $is_after_trial_cancel ? 'success' : 'error' )
                    );

                    deactivate_plugins( array( $this->_plugin_basename ), true );

                    return true;
                }
            }

            return false;
        }