| 1 |
<?php |
| 2 |
namespace WordPressdotorg\Plugin_Check\Checks; |
| 3 |
use WordPressdotorg\Plugin_Check\{Error, Guideline_Violation, Message, Notice, Warning}; |
| 4 |
|
| 5 |
class Localhost extends Check_Base { |
| 6 |
|
| 7 |
function check_localhost() { |
| 8 |
$found = $this->scan_matching_files_for_needle( '#https?://(localhost|127.0.0.1)#', '\.php$' ); |
| 9 |
if ( $found ) { |
| 10 |
return new Error( |
| 11 |
'localhost_code_detected', |
| 12 |
sprintf( |
| 13 |
__( 'Do not use Localhost in your code. Detected: %s', 'plugin-check' ), |
| 14 |
$found |
| 15 |
) |
| 16 |
); |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
} |
| 21 |
|