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/wp-conte.../plugins/content-.../inc/freemius/includes
File: class-freemius.php
) );
[8500] Fix | Delete
}
[8501] Fix | Delete
} else {
[8502] Fix | Delete
if ( false === $this->has_api_connectivity() && ! $this->is_premium() ) {
[8503] Fix | Delete
// Reset connectivity test cache.
[8504] Fix | Delete
$this->clear_connectivity_info();
[8505] Fix | Delete
[8506] Fix | Delete
$storage_keys_for_removal[] = 'connectivity_test';
[8507] Fix | Delete
}
[8508] Fix | Delete
}
[8509] Fix | Delete
[8510] Fix | Delete
if ( $is_network_deactivation ) {
[8511] Fix | Delete
if ( isset( $this->_storage->sticky_optin_added_ms ) ) {
[8512] Fix | Delete
unset( $this->_storage->sticky_optin_added_ms );
[8513] Fix | Delete
}
[8514] Fix | Delete
[8515] Fix | Delete
if ( ! empty( $storage_keys_for_removal ) ) {
[8516] Fix | Delete
$sites = self::get_sites();
[8517] Fix | Delete
[8518] Fix | Delete
foreach ( $sites as $site ) {
[8519] Fix | Delete
$blog_id = self::get_site_blog_id( $site );
[8520] Fix | Delete
[8521] Fix | Delete
foreach ( $storage_keys_for_removal as $key ) {
[8522] Fix | Delete
$this->_storage->remove( $key, false, $blog_id );
[8523] Fix | Delete
}
[8524] Fix | Delete
[8525] Fix | Delete
$this->_storage->save( $blog_id );
[8526] Fix | Delete
}
[8527] Fix | Delete
}
[8528] Fix | Delete
}
[8529] Fix | Delete
[8530] Fix | Delete
// Clear API cache on deactivation.
[8531] Fix | Delete
FS_Api::clear_cache();
[8532] Fix | Delete
[8533] Fix | Delete
$this->remove_sdk_reference();
[8534] Fix | Delete
}
[8535] Fix | Delete
[8536] Fix | Delete
/**
[8537] Fix | Delete
* @author Vova Feldman (@svovaf)
[8538] Fix | Delete
* @since 1.1.6
[8539] Fix | Delete
*/
[8540] Fix | Delete
private function remove_sdk_reference() {
[8541] Fix | Delete
global $fs_active_plugins;
[8542] Fix | Delete
[8543] Fix | Delete
foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) {
[8544] Fix | Delete
if ( $this->_plugin_basename == $data->plugin_path ) {
[8545] Fix | Delete
unset( $fs_active_plugins->plugins[ $sdk_path ] );
[8546] Fix | Delete
break;
[8547] Fix | Delete
}
[8548] Fix | Delete
}
[8549] Fix | Delete
[8550] Fix | Delete
fs_fallback_to_newest_active_sdk();
[8551] Fix | Delete
}
[8552] Fix | Delete
[8553] Fix | Delete
/**
[8554] Fix | Delete
* @author Vova Feldman (@svovaf)
[8555] Fix | Delete
* @since 1.1.3
[8556] Fix | Delete
*
[8557] Fix | Delete
* @param bool $is_anonymous
[8558] Fix | Delete
* @param bool|int $network_or_blog_id Since 2.0.0
[8559] Fix | Delete
*/
[8560] Fix | Delete
private function set_anonymous_mode( $is_anonymous = true, $network_or_blog_id = 0 ) {
[8561] Fix | Delete
// Store information regarding skip to try and opt-in the user
[8562] Fix | Delete
// again in the future.
[8563] Fix | Delete
$skip_info = array(
[8564] Fix | Delete
'is' => $is_anonymous,
[8565] Fix | Delete
'timestamp' => WP_FS__SCRIPT_START_TIME,
[8566] Fix | Delete
'version' => $this->get_plugin_version(),
[8567] Fix | Delete
);
[8568] Fix | Delete
[8569] Fix | Delete
if ( true === $network_or_blog_id ) {
[8570] Fix | Delete
$this->_storage->is_anonymous_ms = $skip_info;
[8571] Fix | Delete
} else {
[8572] Fix | Delete
$this->_storage->store( 'is_anonymous', $skip_info, $network_or_blog_id );
[8573] Fix | Delete
}
[8574] Fix | Delete
[8575] Fix | Delete
$this->network_upgrade_mode_completed();
[8576] Fix | Delete
[8577] Fix | Delete
// Update anonymous mode cache.
[8578] Fix | Delete
$this->_is_anonymous = $is_anonymous;
[8579] Fix | Delete
}
[8580] Fix | Delete
[8581] Fix | Delete
/**
[8582] Fix | Delete
* @author Vova Feldman (@svovaf)
[8583] Fix | Delete
* @since 2.5.1
[8584] Fix | Delete
*
[8585] Fix | Delete
* @param bool|int $network_or_blog_id
[8586] Fix | Delete
*/
[8587] Fix | Delete
private function unset_anonymous_mode( $network_or_blog_id = 0 ) {
[8588] Fix | Delete
if ( true === $network_or_blog_id ) {
[8589] Fix | Delete
unset( $this->_storage->is_anonymous_ms );
[8590] Fix | Delete
} else {
[8591] Fix | Delete
$this->_storage->remove( 'is_anonymous', true, $network_or_blog_id );
[8592] Fix | Delete
}
[8593] Fix | Delete
}
[8594] Fix | Delete
[8595] Fix | Delete
/**
[8596] Fix | Delete
* @author Vova Feldman (@svovaf)
[8597] Fix | Delete
* @since 2.0.0
[8598] Fix | Delete
*
[8599] Fix | Delete
* @param int $blog_id Site ID.
[8600] Fix | Delete
* @param int $user_id User ID.
[8601] Fix | Delete
* @param string $domain Site domain.
[8602] Fix | Delete
* @param string $path Site path.
[8603] Fix | Delete
* @param int $network_id Network ID. Only relevant on multi-network installations.
[8604] Fix | Delete
* @param array $meta Metadata. Used to set initial site options.
[8605] Fix | Delete
*
[8606] Fix | Delete
* @uses Freemius::is_license_network_active() to check if the context license was network activated by the super-admin.
[8607] Fix | Delete
* @uses Freemius::is_network_connected() to check if the super-admin network opted-in.
[8608] Fix | Delete
* @uses Freemius::is_network_anonymous() to check if the super-admin network skipped.
[8609] Fix | Delete
* @uses Freemius::is_network_delegated_connection() to check if the super-admin network delegated the connection to the site admins.
[8610] Fix | Delete
*/
[8611] Fix | Delete
public function _after_new_blog_callback( $blog_id, $user_id, $domain, $path, $network_id, $meta ) {
[8612] Fix | Delete
$this->_logger->entrance();
[8613] Fix | Delete
[8614] Fix | Delete
if ( ! $this->_is_network_active ) {
[8615] Fix | Delete
FS_Clone_Manager::instance()->store_blog_install_info( $blog_id );
[8616] Fix | Delete
return;
[8617] Fix | Delete
}
[8618] Fix | Delete
[8619] Fix | Delete
$site = null;
[8620] Fix | Delete
$new_blog_id = $blog_id;
[8621] Fix | Delete
[8622] Fix | Delete
if ( $this->is_premium() &&
[8623] Fix | Delete
$this->is_network_connected() &&
[8624] Fix | Delete
is_object( $this->_license ) &&
[8625] Fix | Delete
$this->_license->can_activate( FS_Site::is_localhost_by_address( $domain ) ) &&
[8626] Fix | Delete
$this->is_license_network_active( $blog_id )
[8627] Fix | Delete
) {
[8628] Fix | Delete
/**
[8629] Fix | Delete
* Running the premium version, the license was network activated, and the license can also be activated on the current site -> so try to opt-in with the license key.
[8630] Fix | Delete
*/
[8631] Fix | Delete
$current_blog_id = get_current_blog_id();
[8632] Fix | Delete
$license = clone $this->_license;
[8633] Fix | Delete
[8634] Fix | Delete
$this->switch_to_blog( $blog_id );
[8635] Fix | Delete
[8636] Fix | Delete
// Opt-in with network user.
[8637] Fix | Delete
$this->install_with_user(
[8638] Fix | Delete
$this->get_network_user(),
[8639] Fix | Delete
$license->secret_key,
[8640] Fix | Delete
false,
[8641] Fix | Delete
false,
[8642] Fix | Delete
false
[8643] Fix | Delete
);
[8644] Fix | Delete
[8645] Fix | Delete
if ( is_object( $this->_site ) ) {
[8646] Fix | Delete
if ( $this->_site->license_id == $license->id ) {
[8647] Fix | Delete
/**
[8648] Fix | Delete
* If the license was activated successfully, sync the license data from the remote server.
[8649] Fix | Delete
*/
[8650] Fix | Delete
$this->_license = $license;
[8651] Fix | Delete
$this->sync_site_license();
[8652] Fix | Delete
}
[8653] Fix | Delete
}
[8654] Fix | Delete
[8655] Fix | Delete
$site = $this->_site;
[8656] Fix | Delete
[8657] Fix | Delete
$this->switch_to_blog( $current_blog_id );
[8658] Fix | Delete
[8659] Fix | Delete
if ( is_object( $site ) ) {
[8660] Fix | Delete
FS_Clone_Manager::instance()->store_blog_install_info( $blog_id, $site );
[8661] Fix | Delete
[8662] Fix | Delete
// Already connected (with or without a license), so no need to continue.
[8663] Fix | Delete
return;
[8664] Fix | Delete
}
[8665] Fix | Delete
}
[8666] Fix | Delete
[8667] Fix | Delete
if ( $this->is_network_anonymous() ) {
[8668] Fix | Delete
/**
[8669] Fix | Delete
* Opt-in was network skipped so automatically skip the opt-in for the new site.
[8670] Fix | Delete
*/
[8671] Fix | Delete
$this->skip_site_connection( $blog_id );
[8672] Fix | Delete
} else if ( $this->is_network_delegated_connection() ) {
[8673] Fix | Delete
/**
[8674] Fix | Delete
* Opt-in was network delegated so automatically delegate the opt-in for the new site's admin.
[8675] Fix | Delete
*/
[8676] Fix | Delete
$this->delegate_site_connection( $blog_id );
[8677] Fix | Delete
} else if ( $this->is_network_connected() ) {
[8678] Fix | Delete
/**
[8679] Fix | Delete
* Opt-in was network activated so automatically opt-in with the network user and new site admin.
[8680] Fix | Delete
*/
[8681] Fix | Delete
$current_blog_id = get_current_blog_id();
[8682] Fix | Delete
[8683] Fix | Delete
$this->switch_to_blog( $blog_id );
[8684] Fix | Delete
[8685] Fix | Delete
// Opt-in with network user.
[8686] Fix | Delete
$this->install_with_user(
[8687] Fix | Delete
$this->get_network_user(),
[8688] Fix | Delete
false,
[8689] Fix | Delete
false,
[8690] Fix | Delete
false,
[8691] Fix | Delete
false
[8692] Fix | Delete
);
[8693] Fix | Delete
[8694] Fix | Delete
$site = $this->_site;
[8695] Fix | Delete
[8696] Fix | Delete
$this->switch_to_blog( $current_blog_id );
[8697] Fix | Delete
} else {
[8698] Fix | Delete
/**
[8699] Fix | Delete
* If the super-admin mixed different options (connect, skip, delegated):
[8700] Fix | Delete
* a) If at least one site connection was delegated, then automatically delegate connection.
[8701] Fix | Delete
* b) Otherwise, it means that at least one site was skipped and at least one site was connected. For a simplified UX in the initial release of the multisite network integration, skip the connection for the newly created site. If the super-admin will want to opt-in they can still do that from the network level Account page.
[8702] Fix | Delete
*/
[8703] Fix | Delete
$has_delegated_site = false;
[8704] Fix | Delete
[8705] Fix | Delete
$sites = self::get_sites();
[8706] Fix | Delete
foreach ( $sites as $wp_site ) {
[8707] Fix | Delete
$blog_id = self::get_site_blog_id( $wp_site );
[8708] Fix | Delete
[8709] Fix | Delete
if ( $this->is_site_delegated_connection( $blog_id ) ) {
[8710] Fix | Delete
$has_delegated_site = true;
[8711] Fix | Delete
break;
[8712] Fix | Delete
}
[8713] Fix | Delete
}
[8714] Fix | Delete
[8715] Fix | Delete
if ( $has_delegated_site ) {
[8716] Fix | Delete
$this->delegate_site_connection( $blog_id );
[8717] Fix | Delete
} else {
[8718] Fix | Delete
$this->skip_site_connection( $blog_id );
[8719] Fix | Delete
}
[8720] Fix | Delete
}
[8721] Fix | Delete
[8722] Fix | Delete
/**
[8723] Fix | Delete
* Store the new blog's information even if there's no install so that when a clone install is stored in the new blog's storage, we can try to resolve it automatically.
[8724] Fix | Delete
*
[8725] Fix | Delete
* @author Leo Fajardo (@leorw)
[8726] Fix | Delete
* @since 2.5.0
[8727] Fix | Delete
*/
[8728] Fix | Delete
FS_Clone_Manager::instance()->store_blog_install_info( $new_blog_id, $site );
[8729] Fix | Delete
}
[8730] Fix | Delete
[8731] Fix | Delete
/**
[8732] Fix | Delete
* @author Vova Feldman (@svovaf)
[8733] Fix | Delete
* @since 2.5.0
[8734] Fix | Delete
*
[8735] Fix | Delete
* @param \WP_Site $new_site
[8736] Fix | Delete
* @param array $args
[8737] Fix | Delete
*/
[8738] Fix | Delete
public function _after_wp_initialize_site_callback( WP_Site $new_site, $args ) {
[8739] Fix | Delete
$this->_logger->entrance();
[8740] Fix | Delete
[8741] Fix | Delete
$this->_after_new_blog_callback(
[8742] Fix | Delete
$new_site->id,
[8743] Fix | Delete
// Dummy user ID (not in use).
[8744] Fix | Delete
0,
[8745] Fix | Delete
$new_site->domain,
[8746] Fix | Delete
$new_site->path,
[8747] Fix | Delete
$new_site->network_id,
[8748] Fix | Delete
// Dummy meta, not in use.
[8749] Fix | Delete
array()
[8750] Fix | Delete
);
[8751] Fix | Delete
}
[8752] Fix | Delete
[8753] Fix | Delete
/**
[8754] Fix | Delete
* @author Vova Feldman (@svovaf)
[8755] Fix | Delete
* @since 1.1.3
[8756] Fix | Delete
*
[8757] Fix | Delete
* @param bool|int|int[] $network_or_blog_ids Since 2.0.0.
[8758] Fix | Delete
*/
[8759] Fix | Delete
private function reset_anonymous_mode( $network_or_blog_ids = false ) {
[8760] Fix | Delete
if ( true === $network_or_blog_ids ) {
[8761] Fix | Delete
$this->unset_anonymous_mode( true );
[8762] Fix | Delete
[8763] Fix | Delete
if ( fs_is_network_admin() ) {
[8764] Fix | Delete
$this->_is_anonymous = null;
[8765] Fix | Delete
}
[8766] Fix | Delete
[8767] Fix | Delete
// Rest anonymous mode for all non-delegated sub-sites.
[8768] Fix | Delete
$blog_ids = $this->get_non_delegated_blog_ids();
[8769] Fix | Delete
}
[8770] Fix | Delete
else
[8771] Fix | Delete
{
[8772] Fix | Delete
if ( false === $network_or_blog_ids ) {
[8773] Fix | Delete
$network_or_blog_ids = 0;
[8774] Fix | Delete
}
[8775] Fix | Delete
[8776] Fix | Delete
$blog_ids = is_array( $network_or_blog_ids ) ?
[8777] Fix | Delete
$network_or_blog_ids :
[8778] Fix | Delete
array( $network_or_blog_ids );
[8779] Fix | Delete
[8780] Fix | Delete
foreach ( $blog_ids as $blog_id ) {
[8781] Fix | Delete
if ( 0 === $blog_id || get_current_blog_id() == $blog_id ) {
[8782] Fix | Delete
$this->_is_anonymous = null;
[8783] Fix | Delete
}
[8784] Fix | Delete
}
[8785] Fix | Delete
}
[8786] Fix | Delete
[8787] Fix | Delete
foreach ( $blog_ids as $blog_id ) {
[8788] Fix | Delete
$this->unset_anonymous_mode( $blog_id );
[8789] Fix | Delete
}
[8790] Fix | Delete
[8791] Fix | Delete
/**
[8792] Fix | Delete
* Ensure that this field is also "false", otherwise, if the current module's type is "theme" and the module
[8793] Fix | Delete
* has no menus, the opt-in popup will not be shown immediately (in this case, the user will have to click
[8794] Fix | Delete
* on the admin notice that contains the opt-in link in order to trigger the opt-in popup).
[8795] Fix | Delete
*
[8796] Fix | Delete
* @author Leo Fajardo (@leorw)
[8797] Fix | Delete
* @since 1.2.2
[8798] Fix | Delete
*/
[8799] Fix | Delete
if ( ! $this->_is_network_active ) {
[8800] Fix | Delete
$this->_is_anonymous = null;
[8801] Fix | Delete
}
[8802] Fix | Delete
}
[8803] Fix | Delete
[8804] Fix | Delete
/**
[8805] Fix | Delete
* @author Leo Fajardo (@leorw)
[8806] Fix | Delete
* @since 2.5.3
[8807] Fix | Delete
*/
[8808] Fix | Delete
private function update_license_required_permissions_if_anonymous() {
[8809] Fix | Delete
if ( ! $this->is_anonymous() ) {
[8810] Fix | Delete
return;
[8811] Fix | Delete
}
[8812] Fix | Delete
[8813] Fix | Delete
$this->reset_anonymous_mode( fs_is_network_admin() );
[8814] Fix | Delete
[8815] Fix | Delete
FS_Permission_Manager::instance( $this )->update_permissions_tracking_flag( array(
[8816] Fix | Delete
'essentials' => true,
[8817] Fix | Delete
'events' => true,
[8818] Fix | Delete
'diagnostic' => false,
[8819] Fix | Delete
'extensions' => false,
[8820] Fix | Delete
'site' => false,
[8821] Fix | Delete
) );
[8822] Fix | Delete
}
[8823] Fix | Delete
[8824] Fix | Delete
/**
[8825] Fix | Delete
* This is used to ensure that before redirecting to the opt-in page after resetting the anonymous mode or
[8826] Fix | Delete
* deleting the account in the network level, the URL of the page to redirect to is correct.
[8827] Fix | Delete
*
[8828] Fix | Delete
* @author Leo Fajardo (@leorw)
[8829] Fix | Delete
*
[8830] Fix | Delete
* @since 2.1.3
[8831] Fix | Delete
*/
[8832] Fix | Delete
private function maybe_set_slug_and_network_menu_exists_flag() {
[8833] Fix | Delete
if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
[8834] Fix | Delete
$this->_menu->set_slug_and_network_menu_exists_flag( $this->_menu->has_menu() ?
[8835] Fix | Delete
$this->_menu->get_slug() :
[8836] Fix | Delete
$this->_slug
[8837] Fix | Delete
);
[8838] Fix | Delete
}
[8839] Fix | Delete
}
[8840] Fix | Delete
[8841] Fix | Delete
/**
[8842] Fix | Delete
* Clears the anonymous mode and redirects to the opt-in screen.
[8843] Fix | Delete
*
[8844] Fix | Delete
* @author Vova Feldman (@svovaf)
[8845] Fix | Delete
* @since 1.1.7
[8846] Fix | Delete
*/
[8847] Fix | Delete
function connect_again() {
[8848] Fix | Delete
if ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) {
[8849] Fix | Delete
return;
[8850] Fix | Delete
}
[8851] Fix | Delete
[8852] Fix | Delete
if ( $this->is_anonymous() ) {
[8853] Fix | Delete
$this->reset_anonymous_mode( fs_is_network_admin() );
[8854] Fix | Delete
}
[8855] Fix | Delete
[8856] Fix | Delete
$activation_url_params = array();
[8857] Fix | Delete
[8858] Fix | Delete
if ( $this->is_pending_activation() ) {
[8859] Fix | Delete
$this->clear_pending_activation_mode();
[8860] Fix | Delete
[8861] Fix | Delete
if ( fs_request_get_bool( 'require_license' ) ) {
[8862] Fix | Delete
$activation_url_params['require_license'] = true;
[8863] Fix | Delete
}
[8864] Fix | Delete
}
[8865] Fix | Delete
[8866] Fix | Delete
$this->maybe_set_slug_and_network_menu_exists_flag();
[8867] Fix | Delete
[8868] Fix | Delete
fs_redirect( $this->get_activation_url( $activation_url_params ) );
[8869] Fix | Delete
}
[8870] Fix | Delete
[8871] Fix | Delete
/**
[8872] Fix | Delete
* Skip account connect, and set anonymous mode.
[8873] Fix | Delete
*
[8874] Fix | Delete
* @author Vova Feldman (@svovaf)
[8875] Fix | Delete
* @since 1.1.1
[8876] Fix | Delete
*
[8877] Fix | Delete
* @param bool|int|int[] $network_or_blog_ids Since 2.5.1
[8878] Fix | Delete
*/
[8879] Fix | Delete
function skip_connection( $network_or_blog_ids = false ) {
[8880] Fix | Delete
$this->_logger->entrance();
[8881] Fix | Delete
[8882] Fix | Delete
$this->_admin_notices->remove_sticky( 'connect_account' );
[8883] Fix | Delete
[8884] Fix | Delete
if ( true === $network_or_blog_ids ) {
[8885] Fix | Delete
$this->set_anonymous_mode( true, true );
[8886] Fix | Delete
[8887] Fix | Delete
if ( fs_is_network_admin() ) {
[8888] Fix | Delete
$this->_is_anonymous = null;
[8889] Fix | Delete
}
[8890] Fix | Delete
[8891] Fix | Delete
// Rest anonymous mode for all non-delegated sub-sites.
[8892] Fix | Delete
$blog_ids = $this->get_non_delegated_blog_ids();
[8893] Fix | Delete
}
[8894] Fix | Delete
else
[8895] Fix | Delete
{
[8896] Fix | Delete
if ( false === $network_or_blog_ids ) {
[8897] Fix | Delete
$network_or_blog_ids = 0;
[8898] Fix | Delete
}
[8899] Fix | Delete
[8900] Fix | Delete
$blog_ids = is_array( $network_or_blog_ids ) ?
[8901] Fix | Delete
$network_or_blog_ids :
[8902] Fix | Delete
array( $network_or_blog_ids );
[8903] Fix | Delete
[8904] Fix | Delete
foreach ( $blog_ids as $blog_id ) {
[8905] Fix | Delete
if ( 0 === $blog_id || get_current_blog_id() == $blog_id ) {
[8906] Fix | Delete
$this->_is_anonymous = null;
[8907] Fix | Delete
}
[8908] Fix | Delete
}
[8909] Fix | Delete
}
[8910] Fix | Delete
[8911] Fix | Delete
foreach ( $blog_ids as $blog_id ) {
[8912] Fix | Delete
$this->skip_site_connection( $blog_id );
[8913] Fix | Delete
}
[8914] Fix | Delete
[8915] Fix | Delete
$this->network_upgrade_mode_completed();
[8916] Fix | Delete
}
[8917] Fix | Delete
[8918] Fix | Delete
/**
[8919] Fix | Delete
* Skip connection for specific site in the network.
[8920] Fix | Delete
*
[8921] Fix | Delete
* @author Vova Feldman (@svovaf)
[8922] Fix | Delete
* @since 2.0.0
[8923] Fix | Delete
*
[8924] Fix | Delete
* @param int|null $blog_id
[8925] Fix | Delete
* @param bool $send_skip
[8926] Fix | Delete
*/
[8927] Fix | Delete
private function skip_site_connection( $blog_id = null ) {
[8928] Fix | Delete
$this->_logger->entrance();
[8929] Fix | Delete
[8930] Fix | Delete
$this->_admin_notices->remove_sticky( 'connect_account', $blog_id );
[8931] Fix | Delete
[8932] Fix | Delete
$this->set_anonymous_mode( true, $blog_id );
[8933] Fix | Delete
}
[8934] Fix | Delete
[8935] Fix | Delete
/**
[8936] Fix | Delete
* Plugin version update hook.
[8937] Fix | Delete
*
[8938] Fix | Delete
* @author Vova Feldman (@svovaf)
[8939] Fix | Delete
* @since 1.0.4
[8940] Fix | Delete
*/
[8941] Fix | Delete
private function update_plugin_version_event() {
[8942] Fix | Delete
$this->_logger->entrance();
[8943] Fix | Delete
[8944] Fix | Delete
if ( ! $this->is_registered() ) {
[8945] Fix | Delete
return;
[8946] Fix | Delete
}
[8947] Fix | Delete
[8948] Fix | Delete
$this->schedule_install_sync();
[8949] Fix | Delete
// $this->sync_install( array(), true );
[8950] Fix | Delete
}
[8951] Fix | Delete
[8952] Fix | Delete
/**
[8953] Fix | Delete
* Generate an MD5 signature of a plugins collection.
[8954] Fix | Delete
* This helper methods used to identify changes in a plugins collection.
[8955] Fix | Delete
*
[8956] Fix | Delete
* @author Vova Feldman (@svovaf)
[8957] Fix | Delete
* @since 2.0.0
[8958] Fix | Delete
*
[8959] Fix | Delete
* @param array [string]array $plugins
[8960] Fix | Delete
*
[8961] Fix | Delete
* @return string
[8962] Fix | Delete
*/
[8963] Fix | Delete
private function get_plugins_thumbprint( $plugins ) {
[8964] Fix | Delete
ksort( $plugins );
[8965] Fix | Delete
[8966] Fix | Delete
$thumbprint = '';
[8967] Fix | Delete
foreach ( $plugins as $basename => $data ) {
[8968] Fix | Delete
$thumbprint .= $data['slug'] . ',' .
[8969] Fix | Delete
$data['Version'] . ',' .
[8970] Fix | Delete
( $data['is_active'] ? '1' : '0' ) . ';';
[8971] Fix | Delete
}
[8972] Fix | Delete
[8973] Fix | Delete
return md5( $thumbprint );
[8974] Fix | Delete
}
[8975] Fix | Delete
[8976] Fix | Delete
/**
[8977] Fix | Delete
* Return a list of modified plugins since the last sync.
[8978] Fix | Delete
*
[8979] Fix | Delete
* Note:
[8980] Fix | Delete
* There's no point to store a plugins counter since even if the number of
[8981] Fix | Delete
* plugins didn't change, we still need to check if the versions are all the
[8982] Fix | Delete
* same and the activity state is similar.
[8983] Fix | Delete
*
[8984] Fix | Delete
* @author Vova Feldman (@svovaf)
[8985] Fix | Delete
* @since 1.1.8
[8986] Fix | Delete
*
[8987] Fix | Delete
* @return array|false
[8988] Fix | Delete
*/
[8989] Fix | Delete
private function get_plugins_data_for_api() {
[8990] Fix | Delete
// Alias.
[8991] Fix | Delete
$site_active_plugins_option_name = 'active_plugins';
[8992] Fix | Delete
$network_plugins_option_name = 'all_plugins';
[8993] Fix | Delete
[8994] Fix | Delete
/**
[8995] Fix | Delete
* Collection of all site level active plugins.
[8996] Fix | Delete
*/
[8997] Fix | Delete
$site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name );
[8998] Fix | Delete
[8999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function