Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/content-.../inc/freemius/includes
File: class-freemius.php
if ( is_object( $install ) ) {
[8000] Fix | Delete
$blog_2_install_map[ $blog_id ] = $install;
[8001] Fix | Delete
} else {
[8002] Fix | Delete
$site_ids[] = $blog_id;
[8003] Fix | Delete
}
[8004] Fix | Delete
}
[8005] Fix | Delete
[8006] Fix | Delete
if ( ( count( $blog_2_install_map ) + count( $site_ids ) ) > $license->left() ) {
[8007] Fix | Delete
return;
[8008] Fix | Delete
}
[8009] Fix | Delete
[8010] Fix | Delete
$user = $this->get_current_or_network_user();
[8011] Fix | Delete
[8012] Fix | Delete
if ( ! empty( $blog_2_install_map ) ) {
[8013] Fix | Delete
$result = $this->activate_license_on_many_installs( $user, $license->secret_key, $blog_2_install_map );
[8014] Fix | Delete
[8015] Fix | Delete
if ( true !== $result ) {
[8016] Fix | Delete
return;
[8017] Fix | Delete
}
[8018] Fix | Delete
}
[8019] Fix | Delete
[8020] Fix | Delete
if ( ! empty( $site_ids ) ) {
[8021] Fix | Delete
$this->activate_license_on_many_sites( $user, $license->secret_key, $site_ids );
[8022] Fix | Delete
}
[8023] Fix | Delete
}
[8024] Fix | Delete
}
[8025] Fix | Delete
[8026] Fix | Delete
/**
[8027] Fix | Delete
* Tries to activate a bundle license for all supported products if the current product is activated with a bundle license. This is called after activating an available license (not via the license activation dialog but by clicking on a license activation button) for a product via its "Account" page.
[8028] Fix | Delete
*
[8029] Fix | Delete
* @author Leo Fajardo (@leorw)
[8030] Fix | Delete
* @since 2.4.0
[8031] Fix | Delete
*
[8032] Fix | Delete
* @param FS_Plugin_License $license
[8033] Fix | Delete
* @param array $sites
[8034] Fix | Delete
* @param int $blog_id
[8035] Fix | Delete
*/
[8036] Fix | Delete
private function maybe_activate_bundle_license( FS_Plugin_License $license = null, $sites = array(), $blog_id = 0 ) {
[8037] Fix | Delete
if ( ! is_object( $license ) && $this->has_active_valid_license() ) {
[8038] Fix | Delete
$license = $this->_license;
[8039] Fix | Delete
}
[8040] Fix | Delete
[8041] Fix | Delete
if ( ! is_object( $license ) ) {
[8042] Fix | Delete
return;
[8043] Fix | Delete
}
[8044] Fix | Delete
[8045] Fix | Delete
$parent_license = ( ! empty( $license->products ) ) ?
[8046] Fix | Delete
$license :
[8047] Fix | Delete
$this->get_active_parent_license( $license->secret_key );
[8048] Fix | Delete
[8049] Fix | Delete
if ( is_object( $parent_license ) ) {
[8050] Fix | Delete
$this->activate_bundle_license( $parent_license, $sites, $blog_id );
[8051] Fix | Delete
}
[8052] Fix | Delete
}
[8053] Fix | Delete
[8054] Fix | Delete
/**
[8055] Fix | Delete
* Try to activate a bundle license for all the bundle products installed on the site.
[8056] Fix | Delete
* (1) If a child product install already has a license, the bundle license won't be activated.
[8057] Fix | Delete
* (2) On multi-site networks, if the attempt to activate the bundle license is triggered from the network admin, the bundle license activation will only work for non-delegated sites and only if none of them is associated with a license. Even if one of the sites has the product installed with a license key, skip the bundle license activation for the product.
[8058] Fix | Delete
* (3) On multi-site networks, if the attempt to activate the bundle license is triggered from a site-level admin, only activate the license if the product is site-level activated or delegated, and the product installation is not yet associated with a license.
[8059] Fix | Delete
*
[8060] Fix | Delete
* @author Leo Fajardo (@leorw)
[8061] Fix | Delete
* @since 2.4.0
[8062] Fix | Delete
*
[8063] Fix | Delete
* @param FS_Plugin_License $license
[8064] Fix | Delete
* @param array $sites
[8065] Fix | Delete
* @param int $current_blog_id
[8066] Fix | Delete
*/
[8067] Fix | Delete
private function activate_bundle_license( $license, $sites = array(), $current_blog_id = 0 ) {
[8068] Fix | Delete
$is_network_admin = fs_is_network_admin();
[8069] Fix | Delete
[8070] Fix | Delete
$installs_by_blog_map = array();
[8071] Fix | Delete
$site_info_by_blog_map = array();
[8072] Fix | Delete
[8073] Fix | Delete
/**
[8074] Fix | Delete
* Try to activate the license for all supported products.
[8075] Fix | Delete
*
[8076] Fix | Delete
* @author Leo Fajardo
[8077] Fix | Delete
*/
[8078] Fix | Delete
foreach ( $license->products as $product_id ) {
[8079] Fix | Delete
$fs = self::get_instance_by_id( $product_id );
[8080] Fix | Delete
[8081] Fix | Delete
if ( ! is_object( $fs ) ) {
[8082] Fix | Delete
continue;
[8083] Fix | Delete
}
[8084] Fix | Delete
[8085] Fix | Delete
if ( ! $fs->has_paid_plan() ) {
[8086] Fix | Delete
continue;
[8087] Fix | Delete
}
[8088] Fix | Delete
[8089] Fix | Delete
if (
[8090] Fix | Delete
! $fs->is_addon() &&
[8091] Fix | Delete
! FS_Plan_Manager::instance()->has_paid_plan( $fs->_plans )
[8092] Fix | Delete
) {
[8093] Fix | Delete
/**
[8094] Fix | Delete
* The parent product can be free-only but can have its `has_paid_plan` flag set to `true` when
[8095] Fix | Delete
* there is a context bundle.
[8096] Fix | Delete
*/
[8097] Fix | Delete
continue;
[8098] Fix | Delete
}
[8099] Fix | Delete
[8100] Fix | Delete
if ( $current_blog_id > 0 ) {
[8101] Fix | Delete
$fs->switch_to_blog( $current_blog_id );
[8102] Fix | Delete
}
[8103] Fix | Delete
[8104] Fix | Delete
if ( $fs->has_active_valid_license() ) {
[8105] Fix | Delete
continue;
[8106] Fix | Delete
}
[8107] Fix | Delete
[8108] Fix | Delete
if ( ! $is_network_admin || $current_blog_id > 0 ) {
[8109] Fix | Delete
if ( $fs->is_network_active() && ! $fs->is_delegated_connection( $current_blog_id ) ) {
[8110] Fix | Delete
// Do not try to activate the license in the site level if the product is network active and the connection was not delegated.
[8111] Fix | Delete
continue;
[8112] Fix | Delete
}
[8113] Fix | Delete
} else {
[8114] Fix | Delete
if ( ! $fs->is_network_active() ) {
[8115] Fix | Delete
// Do not try to activate the license in the network level if the product is not network active.
[8116] Fix | Delete
continue;
[8117] Fix | Delete
}
[8118] Fix | Delete
[8119] Fix | Delete
if ( $fs->is_network_delegated_connection() ) {
[8120] Fix | Delete
// Do not try to activate the license in the network level if the activation has been delegated to site admins.
[8121] Fix | Delete
continue;
[8122] Fix | Delete
}
[8123] Fix | Delete
[8124] Fix | Delete
$has_install_with_license = false;
[8125] Fix | Delete
[8126] Fix | Delete
// Collection of sites that have an install entity that is not activated with a license or non-delegated sites that have no install entity, or both types of site.
[8127] Fix | Delete
$filtered_sites = array();
[8128] Fix | Delete
[8129] Fix | Delete
if ( empty( $sites ) ) {
[8130] Fix | Delete
$all_sites = self::get_sites();
[8131] Fix | Delete
[8132] Fix | Delete
foreach ( $all_sites as $site ) {
[8133] Fix | Delete
$sites[] = array( 'blog_id' => self::get_site_blog_id( $site ) );
[8134] Fix | Delete
}
[8135] Fix | Delete
} else {
[8136] Fix | Delete
// Populate the map here to avoid calling `$fs->get_site_info( $site );` in the other `for` loop below.
[8137] Fix | Delete
foreach ( $sites as $site ) {
[8138] Fix | Delete
if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) {
[8139] Fix | Delete
continue;
[8140] Fix | Delete
}
[8141] Fix | Delete
[8142] Fix | Delete
$site_info_by_blog_map[ $site['blog_id'] ] = $site;
[8143] Fix | Delete
}
[8144] Fix | Delete
}
[8145] Fix | Delete
[8146] Fix | Delete
foreach ( $sites as $site ) {
[8147] Fix | Delete
if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) {
[8148] Fix | Delete
continue;
[8149] Fix | Delete
}
[8150] Fix | Delete
[8151] Fix | Delete
$blog_id = $site['blog_id'];
[8152] Fix | Delete
[8153] Fix | Delete
if ( ! isset( $installs_by_blog_map[ $blog_id ] ) ) {
[8154] Fix | Delete
$installs_by_blog_map[ $blog_id ] = self::get_all_sites( $fs->get_module_type(), $blog_id );
[8155] Fix | Delete
}
[8156] Fix | Delete
[8157] Fix | Delete
$installs = $installs_by_blog_map[ $blog_id ];
[8158] Fix | Delete
$install = null;
[8159] Fix | Delete
[8160] Fix | Delete
if ( isset( $installs[ $fs->get_slug() ] ) ) {
[8161] Fix | Delete
$install = $installs[ $fs->get_slug() ];
[8162] Fix | Delete
[8163] Fix | Delete
if (
[8164] Fix | Delete
is_object( $install ) &&
[8165] Fix | Delete
(
[8166] Fix | Delete
! FS_Site::is_valid_id( $install->id ) ||
[8167] Fix | Delete
! FS_User::is_valid_id( $install->user_id ) ||
[8168] Fix | Delete
! FS_Plugin_Plan::is_valid_id( $install->plan_id )
[8169] Fix | Delete
)
[8170] Fix | Delete
) {
[8171] Fix | Delete
$install = null;
[8172] Fix | Delete
}
[8173] Fix | Delete
}
[8174] Fix | Delete
[8175] Fix | Delete
if (
[8176] Fix | Delete
is_object( $install ) &&
[8177] Fix | Delete
FS_Plugin_License::is_valid_id( $install->license_id )
[8178] Fix | Delete
) {
[8179] Fix | Delete
$has_install_with_license = true;
[8180] Fix | Delete
break;
[8181] Fix | Delete
}
[8182] Fix | Delete
[8183] Fix | Delete
if ( $fs->is_site_delegated_connection( $blog_id ) ) {
[8184] Fix | Delete
// Site activation delegated, don't activate bundle license on the site in the network admin.
[8185] Fix | Delete
continue;
[8186] Fix | Delete
}
[8187] Fix | Delete
[8188] Fix | Delete
if ( ! isset( $site_info_by_blog_map[ $blog_id ] ) ) {
[8189] Fix | Delete
$site_info_by_blog_map[ $blog_id ] = $fs->get_site_info( $site );
[8190] Fix | Delete
}
[8191] Fix | Delete
[8192] Fix | Delete
$filtered_sites[] = $site_info_by_blog_map[ $blog_id ];
[8193] Fix | Delete
}
[8194] Fix | Delete
[8195] Fix | Delete
if ( $has_install_with_license || empty( $filtered_sites ) ) {
[8196] Fix | Delete
// Do not try to activate the license at the network level if there's any install with a license or there's no site to activate the license on.
[8197] Fix | Delete
continue;
[8198] Fix | Delete
}
[8199] Fix | Delete
[8200] Fix | Delete
$sites = $filtered_sites;
[8201] Fix | Delete
}
[8202] Fix | Delete
[8203] Fix | Delete
$fs->activate_migrated_license(
[8204] Fix | Delete
$license->secret_key,
[8205] Fix | Delete
null,
[8206] Fix | Delete
null,
[8207] Fix | Delete
$sites,
[8208] Fix | Delete
( $current_blog_id > 0 ? $current_blog_id : null )
[8209] Fix | Delete
);
[8210] Fix | Delete
}
[8211] Fix | Delete
}
[8212] Fix | Delete
[8213] Fix | Delete
/**
[8214] Fix | Delete
* Returns a parent license that can be activated for the context product.
[8215] Fix | Delete
*
[8216] Fix | Delete
* @author Leo Fajardo (@leorw)
[8217] Fix | Delete
* @since 2.3.0
[8218] Fix | Delete
*
[8219] Fix | Delete
* @param string|null $license_key
[8220] Fix | Delete
* @param bool $flush
[8221] Fix | Delete
*
[8222] Fix | Delete
* @return FS_Plugin_License
[8223] Fix | Delete
*/
[8224] Fix | Delete
function get_active_parent_license( $license_key = null, $flush = true ) {
[8225] Fix | Delete
$parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable";
[8226] Fix | Delete
[8227] Fix | Delete
$fs = $this;
[8228] Fix | Delete
[8229] Fix | Delete
if ( $this->is_addon() ) {
[8230] Fix | Delete
$parent_instance = $this->get_parent_instance();
[8231] Fix | Delete
[8232] Fix | Delete
if ( is_object( $parent_instance ) && $parent_instance->is_registered() ) {
[8233] Fix | Delete
$fs = $parent_instance;
[8234] Fix | Delete
}
[8235] Fix | Delete
}
[8236] Fix | Delete
[8237] Fix | Delete
$foreign_licenses = $fs->get_foreign_licenses_info(
[8238] Fix | Delete
self::get_all_licenses( $this->get_parent_id() )
[8239] Fix | Delete
);
[8240] Fix | Delete
[8241] Fix | Delete
if ( ! empty ( $foreign_licenses ) ) {
[8242] Fix | Delete
$foreign_licenses = array(
[8243] Fix | Delete
// Prefix with `+` to tell the server to include foreign licenses in the licenses collection.
[8244] Fix | Delete
'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ),
[8245] Fix | Delete
'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) )
[8246] Fix | Delete
);
[8247] Fix | Delete
[8248] Fix | Delete
$parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint );
[8249] Fix | Delete
}
[8250] Fix | Delete
[8251] Fix | Delete
$result = $fs->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, $flush );
[8252] Fix | Delete
[8253] Fix | Delete
if (
[8254] Fix | Delete
! $this->is_api_result_object( $result, 'licenses' ) ||
[8255] Fix | Delete
! is_array( $result->licenses ) ||
[8256] Fix | Delete
empty( $result->licenses )
[8257] Fix | Delete
) {
[8258] Fix | Delete
return null;
[8259] Fix | Delete
}
[8260] Fix | Delete
[8261] Fix | Delete
$parent_license = null;
[8262] Fix | Delete
[8263] Fix | Delete
if ( empty( $license_key ) ) {
[8264] Fix | Delete
$parent_license = $result->licenses[0];
[8265] Fix | Delete
} else {
[8266] Fix | Delete
foreach ( $result->licenses as $license ) {
[8267] Fix | Delete
if ( $license_key === $license->secret_key ) {
[8268] Fix | Delete
$parent_license = $license;
[8269] Fix | Delete
break;
[8270] Fix | Delete
}
[8271] Fix | Delete
}
[8272] Fix | Delete
}
[8273] Fix | Delete
[8274] Fix | Delete
if ( ! is_null( $parent_license ) ) {
[8275] Fix | Delete
$parent_license = new FS_Plugin_License( $parent_license );
[8276] Fix | Delete
}
[8277] Fix | Delete
[8278] Fix | Delete
return $parent_license;
[8279] Fix | Delete
}
[8280] Fix | Delete
[8281] Fix | Delete
/**
[8282] Fix | Delete
* @author Leo Fajardo (@leorw)
[8283] Fix | Delete
* @since 2.3.0
[8284] Fix | Delete
*
[8285] Fix | Delete
* @return array
[8286] Fix | Delete
*/
[8287] Fix | Delete
function get_sites_for_network_level_optin() {
[8288] Fix | Delete
$sites = array();
[8289] Fix | Delete
$all_sites = self::get_sites();
[8290] Fix | Delete
[8291] Fix | Delete
foreach ( $all_sites as $site ) {
[8292] Fix | Delete
$blog_id = self::get_site_blog_id( $site );
[8293] Fix | Delete
[8294] Fix | Delete
if ( ! $this->is_site_delegated_connection( $blog_id ) &&
[8295] Fix | Delete
! $this->is_installed_on_site( $blog_id )
[8296] Fix | Delete
) {
[8297] Fix | Delete
$sites[] = $this->get_site_info( $site );
[8298] Fix | Delete
}
[8299] Fix | Delete
}
[8300] Fix | Delete
[8301] Fix | Delete
return $sites;
[8302] Fix | Delete
}
[8303] Fix | Delete
[8304] Fix | Delete
/**
[8305] Fix | Delete
* Delete account.
[8306] Fix | Delete
*
[8307] Fix | Delete
* @author Vova Feldman (@svovaf)
[8308] Fix | Delete
* @since 1.0.3
[8309] Fix | Delete
*
[8310] Fix | Delete
* @param bool $check_user Enforce checking if user have plugins activation privileges.
[8311] Fix | Delete
*/
[8312] Fix | Delete
function delete_account_event( $check_user = true ) {
[8313] Fix | Delete
$this->_logger->entrance( 'slug = ' . $this->_slug );
[8314] Fix | Delete
[8315] Fix | Delete
if ( $check_user && ! $this->is_user_admin() ) {
[8316] Fix | Delete
return;
[8317] Fix | Delete
}
[8318] Fix | Delete
[8319] Fix | Delete
$this->do_action( 'before_account_delete' );
[8320] Fix | Delete
[8321] Fix | Delete
// Clear all admin notices.
[8322] Fix | Delete
$this->_admin_notices->clear_all_sticky( false );
[8323] Fix | Delete
[8324] Fix | Delete
$this->_delete_site( false );
[8325] Fix | Delete
[8326] Fix | Delete
$delete_network_common_data = true;
[8327] Fix | Delete
[8328] Fix | Delete
if ( $this->_is_network_active ) {
[8329] Fix | Delete
$installs = $this->get_blog_install_map();
[8330] Fix | Delete
[8331] Fix | Delete
// Don't delete common network data unless no other installs left.
[8332] Fix | Delete
$delete_network_common_data = empty( $installs );
[8333] Fix | Delete
}
[8334] Fix | Delete
[8335] Fix | Delete
if ( $delete_network_common_data ) {
[8336] Fix | Delete
$this->_delete_plans( false );
[8337] Fix | Delete
[8338] Fix | Delete
$this->_delete_licenses( false );
[8339] Fix | Delete
[8340] Fix | Delete
// Delete add-ons related to plugin's account.
[8341] Fix | Delete
$this->_delete_account_addons( false );
[8342] Fix | Delete
}
[8343] Fix | Delete
[8344] Fix | Delete
// @todo Delete plans and licenses of add-ons.
[8345] Fix | Delete
[8346] Fix | Delete
self::$_accounts->store();
[8347] Fix | Delete
[8348] Fix | Delete
/**
[8349] Fix | Delete
* IMPORTANT:
[8350] Fix | Delete
* Clear crons must be executed before clearing all storage.
[8351] Fix | Delete
* Otherwise, the cron will not be cleared.
[8352] Fix | Delete
*/
[8353] Fix | Delete
if ( $delete_network_common_data ) {
[8354] Fix | Delete
$this->clear_sync_cron();
[8355] Fix | Delete
}
[8356] Fix | Delete
[8357] Fix | Delete
$this->clear_install_sync_cron();
[8358] Fix | Delete
[8359] Fix | Delete
// Clear all storage data.
[8360] Fix | Delete
$this->_storage->clear_all( true, array(
[8361] Fix | Delete
'is_delegated_connection',
[8362] Fix | Delete
'connectivity_test',
[8363] Fix | Delete
'is_on',
[8364] Fix | Delete
), false );
[8365] Fix | Delete
[8366] Fix | Delete
// Send delete event.
[8367] Fix | Delete
$this->get_api_site_scope()->call( '/', 'delete' );
[8368] Fix | Delete
[8369] Fix | Delete
$this->do_action( 'after_account_delete' );
[8370] Fix | Delete
}
[8371] Fix | Delete
[8372] Fix | Delete
/**
[8373] Fix | Delete
* Delete network level account.
[8374] Fix | Delete
*
[8375] Fix | Delete
* @author Vova Feldman (@svovaf)
[8376] Fix | Delete
* @since 2.0.0
[8377] Fix | Delete
*
[8378] Fix | Delete
* @param bool $check_user Enforce checking if user have plugins activation privileges.
[8379] Fix | Delete
*/
[8380] Fix | Delete
function delete_network_account_event( $check_user = true ) {
[8381] Fix | Delete
$this->_logger->entrance( 'slug = ' . $this->_slug );
[8382] Fix | Delete
[8383] Fix | Delete
if ( $check_user && ! $this->is_user_admin() ) {
[8384] Fix | Delete
return;
[8385] Fix | Delete
}
[8386] Fix | Delete
[8387] Fix | Delete
$this->do_action( 'before_network_account_delete' );
[8388] Fix | Delete
[8389] Fix | Delete
// Clear all admin notices.
[8390] Fix | Delete
$this->_admin_notices->clear_all_sticky();
[8391] Fix | Delete
[8392] Fix | Delete
$this->_delete_plans( false, false );
[8393] Fix | Delete
[8394] Fix | Delete
$this->_delete_licenses( false );
[8395] Fix | Delete
[8396] Fix | Delete
// Delete add-ons related to plugin's account.
[8397] Fix | Delete
$this->_delete_account_addons( false );
[8398] Fix | Delete
[8399] Fix | Delete
// @todo Delete plans and licenses of add-ons.
[8400] Fix | Delete
[8401] Fix | Delete
self::$_accounts->store( true );
[8402] Fix | Delete
[8403] Fix | Delete
/**
[8404] Fix | Delete
* IMPORTANT:
[8405] Fix | Delete
* Clear crons must be executed before clearing all storage.
[8406] Fix | Delete
* Otherwise, the cron will not be cleared.
[8407] Fix | Delete
*/
[8408] Fix | Delete
$this->clear_sync_cron( true );
[8409] Fix | Delete
$this->clear_install_sync_cron( true );
[8410] Fix | Delete
[8411] Fix | Delete
$sites = self::get_sites();
[8412] Fix | Delete
[8413] Fix | Delete
$install_ids = array();
[8414] Fix | Delete
foreach ( $sites as $site ) {
[8415] Fix | Delete
$blog_id = self::get_site_blog_id( $site );
[8416] Fix | Delete
[8417] Fix | Delete
if ( $this->is_site_delegated_connection( $blog_id ) ) {
[8418] Fix | Delete
continue;
[8419] Fix | Delete
}
[8420] Fix | Delete
[8421] Fix | Delete
$install_id = $this->_delete_site( true, $blog_id );
[8422] Fix | Delete
[8423] Fix | Delete
// Clear all storage data.
[8424] Fix | Delete
$this->_storage->clear_all( true, array( 'connectivity_test' ), $blog_id );
[8425] Fix | Delete
[8426] Fix | Delete
if ( FS_Site::is_valid_id( $install_id ) ) {
[8427] Fix | Delete
$install_ids[] = $install_id;
[8428] Fix | Delete
}
[8429] Fix | Delete
[8430] Fix | Delete
switch_to_blog( $blog_id );
[8431] Fix | Delete
[8432] Fix | Delete
$this->do_action( 'after_account_delete' );
[8433] Fix | Delete
[8434] Fix | Delete
restore_current_blog();
[8435] Fix | Delete
}
[8436] Fix | Delete
[8437] Fix | Delete
$this->_storage->clear_all( true, array(
[8438] Fix | Delete
'connectivity_test',
[8439] Fix | Delete
'is_on',
[8440] Fix | Delete
), true );
[8441] Fix | Delete
[8442] Fix | Delete
// Send delete event.
[8443] Fix | Delete
if ( ! empty( $install_ids ) ) {
[8444] Fix | Delete
$result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', $install_ids ), 'delete' );
[8445] Fix | Delete
}
[8446] Fix | Delete
[8447] Fix | Delete
$this->do_action( 'after_network_account_delete' );
[8448] Fix | Delete
}
[8449] Fix | Delete
[8450] Fix | Delete
/**
[8451] Fix | Delete
* Plugin deactivation hook.
[8452] Fix | Delete
*
[8453] Fix | Delete
* @author Vova Feldman (@svovaf)
[8454] Fix | Delete
* @since 1.0.1
[8455] Fix | Delete
*/
[8456] Fix | Delete
function _deactivate_plugin_hook() {
[8457] Fix | Delete
$this->_logger->entrance( 'slug = ' . $this->_slug );
[8458] Fix | Delete
[8459] Fix | Delete
if ( ! $this->is_user_admin() ) {
[8460] Fix | Delete
return;
[8461] Fix | Delete
}
[8462] Fix | Delete
[8463] Fix | Delete
$is_network_deactivation = fs_is_network_admin();
[8464] Fix | Delete
$storage_keys_for_removal = array();
[8465] Fix | Delete
[8466] Fix | Delete
$this->_admin_notices->clear_all_sticky();
[8467] Fix | Delete
[8468] Fix | Delete
$storage_keys_for_removal[] = 'sticky_optin_added';
[8469] Fix | Delete
if ( isset( $this->_storage->sticky_optin_added ) ) {
[8470] Fix | Delete
unset( $this->_storage->sticky_optin_added );
[8471] Fix | Delete
}
[8472] Fix | Delete
[8473] Fix | Delete
if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
[8474] Fix | Delete
// Remember that plugin was already installed.
[8475] Fix | Delete
$this->_storage->is_plugin_new_install = false;
[8476] Fix | Delete
}
[8477] Fix | Delete
[8478] Fix | Delete
// Hook to plugin uninstall.
[8479] Fix | Delete
register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) );
[8480] Fix | Delete
[8481] Fix | Delete
$this->clear_module_main_file_cache();
[8482] Fix | Delete
$this->clear_sync_cron( $this->_is_network_active );
[8483] Fix | Delete
$this->clear_install_sync_cron();
[8484] Fix | Delete
[8485] Fix | Delete
if ( $this->is_registered() ) {
[8486] Fix | Delete
if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
[8487] Fix | Delete
FS_Plugin_Updater::instance( $this )->delete_update_data();
[8488] Fix | Delete
}
[8489] Fix | Delete
[8490] Fix | Delete
if ( $is_network_deactivation ) {
[8491] Fix | Delete
// Send deactivation event.
[8492] Fix | Delete
$this->sync_installs( array(
[8493] Fix | Delete
'is_active' => false,
[8494] Fix | Delete
) );
[8495] Fix | Delete
} else {
[8496] Fix | Delete
// Send deactivation event.
[8497] Fix | Delete
$this->sync_install( array(
[8498] Fix | Delete
'is_active' => false,
[8499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function