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/wp-conte.../plugins/password.../includes/services
File: class-ppw-subscribe.php
<?php
[0] Fix | Delete
if ( ! class_exists( 'PPW_Password_Subscribe' ) ) {
[1] Fix | Delete
class PPW_Password_Subscribe {
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Handle subscriber request(Call api to save data for subscriber)
[5] Fix | Delete
*
[6] Fix | Delete
* @param string $email email user request.
[7] Fix | Delete
*
[8] Fix | Delete
* @return array
[9] Fix | Delete
*/
[10] Fix | Delete
public function handle_subscribe_request( $email ) {
[11] Fix | Delete
$ppw_config = include PPW_DIR_PATH . 'config.php';
[12] Fix | Delete
$data = array(
[13] Fix | Delete
'email' => $email,
[14] Fix | Delete
'plugin' => 'ppwp',
[15] Fix | Delete
);
[16] Fix | Delete
$args = array(
[17] Fix | Delete
'body' => json_encode( $data ),
[18] Fix | Delete
'timeout' => '100',
[19] Fix | Delete
'redirection' => '5',
[20] Fix | Delete
'httpversion' => '1.0',
[21] Fix | Delete
'blocking' => true,
[22] Fix | Delete
'headers' => array(
[23] Fix | Delete
'Content-Type' => 'application/json',
[24] Fix | Delete
),
[25] Fix | Delete
);
[26] Fix | Delete
$response = wp_remote_post(
[27] Fix | Delete
$ppw_config->subscribe_api,
[28] Fix | Delete
$args
[29] Fix | Delete
);
[30] Fix | Delete
$status_code = absint( wp_remote_retrieve_response_code( $response ) );
[31] Fix | Delete
if ( is_wp_error( $response ) ) {
[32] Fix | Delete
return array(
[33] Fix | Delete
'error_message' => $response->get_error_message(),
[34] Fix | Delete
);
[35] Fix | Delete
} else if ( $status_code >= 400 ) {
[36] Fix | Delete
return array(
[37] Fix | Delete
'error_message' => __('Invalid email address', PPW_Constants::DOMAIN),
[38] Fix | Delete
);
[39] Fix | Delete
} else {
[40] Fix | Delete
update_user_meta( get_current_user_id(), PPW_Constants::USER_SUBSCRIBE, true );
[41] Fix | Delete
return array(
[42] Fix | Delete
'data' => json_decode( wp_remote_retrieve_body( $response ) ),
[43] Fix | Delete
);
[44] Fix | Delete
}
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function