$email, 'plugin' => 'ppwp', ); $args = array( 'body' => json_encode( $data ), 'timeout' => '100', 'redirection' => '5', 'httpversion' => '1.0', 'blocking' => true, 'headers' => array( 'Content-Type' => 'application/json', ), ); $response = wp_remote_post( $ppw_config->subscribe_api, $args ); $status_code = absint( wp_remote_retrieve_response_code( $response ) ); if ( is_wp_error( $response ) ) { return array( 'error_message' => $response->get_error_message(), ); } else if ( $status_code >= 400 ) { return array( 'error_message' => __('Invalid email address', 'password-protect-page'), ); } else { update_user_meta( get_current_user_id(), PPW_Constants::USER_SUBSCRIBE, true ); return array( 'data' => json_decode( wp_remote_retrieve_body( $response ) ), ); } } } }