PluginProbe
Plugin Check (PCP) / 0.2.1
Plugin Check (PCP) v0.2.1
2.1.0 trunk 0.1 0.2.0 0.2.1 0.2.2 0.2.3 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.3.0 1.3.1 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 ci-artifacts
plugin-check / checks / localhost.php

localhost.php in Plugin Check (PCP) 0.2.1, at checks/localhost.php

21 lines 504 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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