--- /protect_ori.php +++ /protect.php @@ -499,6 +499,14 @@ 'timeout' => 15 ); + // ----------------------------------------------------------------------- + // Added by NinTechNet: log the POST data sent to the API server: + $jj_msg = date_i18n('M d, Y @ H:i:s O') . + ": POSTing to remote API server api.bruteprotect.com\n"; + $jj_msg.= print_r( $args, true) . "\n\n"; + file_put_contents('/tmp/jack-n-jill-API.txt', $jj_msg, FILE_APPEND); + // ----------------------------------------------------------------------- + $response_json = wp_remote_post( $this->get_api_host(), $args ); $this->last_response_raw = $response_json; $headers = $this->get_headers(); @@ -509,6 +517,15 @@ if ( is_array( $response_json ) ) { $response = json_decode( $response_json['body'], true ); } + + // ----------------------------------------------------------------------- + // Added by NinTechNet: log the response from the API server: + $jj_msg = date_i18n('M d, Y @ H:i:s O') + . ": response from remote API server api.bruteprotect.com\n"; + $jj_msg.= print_r( $response, true); + file_put_contents('/tmp/jack-n-jill-API.txt', $jj_msg . + "\n---------------------------\n\n", FILE_APPEND); + // ----------------------------------------------------------------------- if( isset( $response['blocked_attempts'] ) && $response['blocked_attempts'] ) { update_site_option( 'jetpack_protect_blocked_attempts', $response['blocked_attempts'] );