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
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/password.../includes
File: class-ppw-uninstall.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* PPWP Class for Uninstall plugin
[2] Fix | Delete
*/
[3] Fix | Delete
if ( ! class_exists( 'PPW_Uninstall' ) ) {
[4] Fix | Delete
class PPW_Uninstall {
[5] Fix | Delete
/**
[6] Fix | Delete
* Uninstall plugin
[7] Fix | Delete
*/
[8] Fix | Delete
public static function uninstall() {
[9] Fix | Delete
self::handle_uninstall_plugin();
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Handle uninstall plugin
[14] Fix | Delete
*/
[15] Fix | Delete
private static function handle_uninstall_plugin() {
[16] Fix | Delete
if ( is_multisite() ) {
[17] Fix | Delete
foreach ( get_sites() as $site ) {
[18] Fix | Delete
$blog_id = $site->blog_id;
[19] Fix | Delete
if ( ppw_core_get_setting_type_bool( PPW_Constants::REMOVE_DATA, $blog_id ) ) {
[20] Fix | Delete
global $wpdb;
[21] Fix | Delete
self::delete_general_option( $blog_id );
[22] Fix | Delete
self::delete_entire_site_option( $blog_id );
[23] Fix | Delete
$wp_prefix = $wpdb->get_blog_prefix( $blog_id );
[24] Fix | Delete
ppw_core_delete_data_in_post_meta_by_meta_key( PPW_Constants::POST_PROTECTION_ROLES, $wp_prefix );
[25] Fix | Delete
ppw_core_delete_data_in_post_meta_by_meta_key( PPW_Constants::GLOBAL_PASSWORDS, $wp_prefix );
[26] Fix | Delete
}
[27] Fix | Delete
}
[28] Fix | Delete
} else {
[29] Fix | Delete
if ( ppw_core_get_setting_type_bool( PPW_Constants::REMOVE_DATA ) ) {
[30] Fix | Delete
self::delete_general_option();
[31] Fix | Delete
self::delete_entire_site_option();
[32] Fix | Delete
ppw_core_delete_data_in_post_meta_by_meta_key( PPW_Constants::POST_PROTECTION_ROLES );
[33] Fix | Delete
ppw_core_delete_data_in_post_meta_by_meta_key( PPW_Constants::GLOBAL_PASSWORDS );
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Handle delete general option
[40] Fix | Delete
*
[41] Fix | Delete
* @param $site_id
[42] Fix | Delete
*/
[43] Fix | Delete
private static function delete_general_option( $site_id = false ) {
[44] Fix | Delete
$settings = ! $site_id ? get_option( PPW_Constants::GENERAL_OPTIONS ) : get_blog_option( $site_id, PPW_Constants::GENERAL_OPTIONS );
[45] Fix | Delete
if ( ! $settings ) {
[46] Fix | Delete
return;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
$options = json_decode( $settings );
[50] Fix | Delete
if ( ! is_object( $options ) ) {
[51] Fix | Delete
return;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
$new_options = (array) $options;
[55] Fix | Delete
unset( $new_options[ PPW_Constants::COOKIE_EXPIRED ] );
[56] Fix | Delete
unset( $new_options[ PPW_Constants::REMOVE_DATA ] );
[57] Fix | Delete
if ( ! $site_id ) {
[58] Fix | Delete
update_option( PPW_Constants::GENERAL_OPTIONS, wp_json_encode( $new_options ) );
[59] Fix | Delete
} else {
[60] Fix | Delete
update_blog_option( $site_id, PPW_Constants::GENERAL_OPTIONS, wp_json_encode( $new_options ) );
[61] Fix | Delete
}
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Handle delete entire site option
[66] Fix | Delete
*
[67] Fix | Delete
* @param $site_id
[68] Fix | Delete
*/
[69] Fix | Delete
private static function delete_entire_site_option( $site_id = false ) {
[70] Fix | Delete
$options = ! $site_id ? get_option( PPW_Constants::ENTIRE_SITE_OPTIONS ) : get_blog_option( $site_id, PPW_Constants::ENTIRE_SITE_OPTIONS );
[71] Fix | Delete
if ( ! $options ) {
[72] Fix | Delete
return;
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
if ( ! is_array( $options ) ) {
[76] Fix | Delete
return;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
unset( $options[ PPW_Constants::IS_PROTECT_ENTIRE_SITE ] );
[80] Fix | Delete
unset( $options[ PPW_Constants::PASSWORD_ENTIRE_SITE ] );
[81] Fix | Delete
if ( ! $site_id ) {
[82] Fix | Delete
update_option( PPW_Constants::ENTIRE_SITE_OPTIONS, $options );
[83] Fix | Delete
} else {
[84] Fix | Delete
update_blog_option( $site_id, PPW_Constants::ENTIRE_SITE_OPTIONS, $options );
[85] Fix | Delete
}
[86] Fix | Delete
}
[87] Fix | Delete
}
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function