Diff
14 years ago
whois
12 years ago
.htaccess
14 years ago
Diff.php
14 years ago
GeoIP.dat
11 years ago
IPTraf.php
11 years ago
conntest.php
11 years ago
dashboard.php
11 years ago
diffResult.php
11 years ago
email_genericAlert.php
11 years ago
email_newIssues.php
11 years ago
email_unlockRequest.php
11 years ago
menuHeader.php
11 years ago
menu_activity.php
11 years ago
menu_blockedIPs.php
11 years ago
menu_countryBlocking.php
11 years ago
menu_options.php
11 years ago
menu_rangeBlocking.php
11 years ago
menu_scan.php
11 years ago
menu_scanSchedule.php
11 years ago
menu_sitePerf.php
11 years ago
menu_sitePerfStats.php
11 years ago
menu_twoFactor.php
11 years ago
menu_whois.php
11 years ago
pageTitle.php
13 years ago
schedWeekEntry.php
12 years ago
sysinfo.php
11 years ago
unknownFiles.php
11 years ago
viewFullActivityLog.php
11 years ago
wf503.php
12 years ago
wfAPI.php
11 years ago
wfAction.php
14 years ago
wfArray.php
13 years ago
wfBrowscap.php
11 years ago
wfBrowscapCache.php
11 years ago
wfBulkCountries.php
13 years ago
wfCache.php
11 years ago
wfConfig.php
11 years ago
wfCountryMap.php
13 years ago
wfCrawl.php
11 years ago
wfDB.php
11 years ago
wfDict.php
14 years ago
wfGeoIP.php
13 years ago
wfIssues.php
11 years ago
wfLockedOut.php
13 years ago
wfLog.php
11 years ago
wfRate.php
14 years ago
wfScan.php
11 years ago
wfScanEngine.php
11 years ago
wfSchema.php
11 years ago
wfUnlockMsg.php
11 years ago
wfUtils.php
11 years ago
wfViewResult.php
11 years ago
wordfenceClass.php
11 years ago
wordfenceConstants.php
11 years ago
wordfenceHash.php
11 years ago
wordfenceScanner.php
11 years ago
wordfenceURLHoover.php
11 years ago
conntest.php
85 lines
| 1 | <?php if(! wfUtils::isAdmin()){ exit(); } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> |
| 3 | <head> |
| 4 | <title>Wordfence Connectivity Tester</title> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <body> |
| 7 | <h1>Wordfence connectivity tester</h1> |
| 8 | <br /><br /> |
| 9 | DNS lookup for noc1.wordfence.com returns: <?php echo gethostbyname('noc1.wordfence.com'); ?><br /><br /> |
| 10 | <?php |
| 11 | $curlContent = ""; |
| 12 | function curlWrite($h, $d){ |
| 13 | global $curlContent; |
| 14 | $curlContent .= $d; |
| 15 | return strlen($d); |
| 16 | } |
| 17 | function doWPostTest($protocol){ |
| 18 | echo "<br /><b>Starting wp_remote_post() test</b><br />\n"; |
| 19 | $cronURL = admin_url('admin-ajax.php'); |
| 20 | $cronURL = preg_replace('/^(https?:\/\/)/i', '://noc1.wordfence.com/scanptest/', $cronURL); |
| 21 | $cronURL .= '?action=wordfence_doScan&isFork=0&cronKey=47e9d1fa6a675b5999999333'; |
| 22 | $cronURL = $protocol . $cronURL; |
| 23 | $result = wp_remote_post($cronURL, array( |
| 24 | 'timeout' => 10, //Must be less than max execution time or more than 2 HTTP children will be occupied by scan |
| 25 | 'blocking' => true, //Non-blocking seems to block anyway, so we use blocking |
| 26 | 'sslverify' => false, |
| 27 | 'headers' => array() |
| 28 | )); |
| 29 | if( (! is_wp_error($result)) && $result['response']['code'] == 200 && strpos($result['body'], "scanptestok") !== false){ |
| 30 | echo "wp_remote_post() test to noc1.wordfence.com passed!<br />\n"; |
| 31 | } else if(is_wp_error($result)){ |
| 32 | echo "wp_remote_post() test to noc1.wordfence.com failed! Response was: " . $result->get_error_message() . "<br />\n"; |
| 33 | } else { |
| 34 | echo "wp_remote_post() test to noc1.wordfence.com failed! Response was: " . $result['response']['code'] . " " . $result['response']['message'] . "<br />\n"; |
| 35 | echo "This likely means that your hosting provider is blocking requests to noc1.wordfence.com or has set up a proxy that is not behaving itself.<br />\n"; |
| 36 | echo "This additional info may help you diagnose the issue. The response headers we received were:<br />\n"; |
| 37 | foreach($result['headers'] as $key => $value){ |
| 38 | echo "$key => $value<br />\n"; |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | function doCurlTest($protocol){ |
| 43 | if(! function_exists('curl_init')){ |
| 44 | echo "<br /><b style='color: #F00;'>CURL is not installed</b>. Asking your hosting provider to install and enable CURL may improve any connection problems.</b><br />\n"; |
| 45 | return; |
| 46 | } |
| 47 | echo "<br /><b>STARTING CURL $protocol CONNECTION TEST....</b><br />\n"; |
| 48 | global $curlContent; |
| 49 | $curlContent = ""; |
| 50 | $curl = curl_init($protocol . '://noc1.wordfence.com/'); |
| 51 | if(defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT') && wfUtils::hostNotExcludedFromProxy('noc1.wordfence.com') ){ |
| 52 | curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 0); |
| 53 | curl_setopt($curl, CURLOPT_PROXY, WP_PROXY_HOST . ':' . WP_PROXY_PORT); |
| 54 | if(defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD')){ |
| 55 | curl_setopt($curl, CURLOPT_PROXYUSERPWD, WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | curl_setopt ($curl, CURLOPT_TIMEOUT, 900); |
| 60 | curl_setopt ($curl, CURLOPT_USERAGENT, "Wordfence.com UA " . (defined('WORDFENCE_VERSION') ? WORDFENCE_VERSION : '[Unknown version]') ); |
| 61 | curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE); |
| 62 | curl_setopt ($curl, CURLOPT_HEADER, 0); |
| 63 | curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, false); |
| 64 | curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, false); |
| 65 | curl_setopt ($curl, CURLOPT_WRITEFUNCTION, 'curlWrite'); |
| 66 | $curlResult = curl_exec($curl); |
| 67 | $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); |
| 68 | if(strpos($curlContent, 'Your site did not send an API key') !== false){ |
| 69 | echo "Curl connectivity test passed.<br /><br />\n"; |
| 70 | } else { |
| 71 | $curlErrorNo = curl_errno($curl); |
| 72 | $curlError = curl_error($curl); |
| 73 | echo "Curl connectivity test failed with response: <pre>$curlContent</pre>"; |
| 74 | echo "<br />Curl HTTP status: $httpStatus<br />Curl error code: $curlErrorNo<br />Curl Error: $curlError<br /><br />\n"; |
| 75 | } |
| 76 | } |
| 77 | doCurlTest('http'); |
| 78 | doCurlTest('https'); |
| 79 | doWPostTest('http'); |
| 80 | doWPostTest('https'); |
| 81 | ?> |
| 82 | </body> |
| 83 | </html> |
| 84 | |
| 85 |