url = $url; $this->opts = $opts; $this->tenonResponse = ''; } /** * Submits the HTML source for testing * * @param bool $printInfo whether or not to print the output from curl_getinfo (usually for debugging only) * * @return string the results, formatted as JSON */ public function submit( $printInfo = false ) { if ( true == $printInfo ) { echo '
'; } $args = array( 'method'=>'POST', 'body' => $this->opts, 'headers' => '', 'sslverify' => false, 'timeout' => 60 ); $result = wp_remote_post( $this->url, $args ); if ( true == $printInfo ) { echo '
'; var_dump( $this->opts ); echo '
';
print_r( $result );
echo '';
}
if ( is_wp_error( $result ) ) {
$this->tenonResponse = $result->errors;
} else {
//the test results
$this->tenonResponse = $result;
}
}
}