@@ -65,13 +65,13 @@ public function set_phpcs_standard( $standard ) {
6565 }
6666
6767 public function set_excluded_extensions ( $ excluded_exts ) {
68- if ( false === is_array ( $ excluded_exts ) ) {
68+ if ( false === is_array ( $ excluded_exts ) ) {
6969 $ excluded_exts = explode ( ', ' , $ excluded_exts );
7070 }
7171 $ this ->excluded_extensions = $ excluded_exts ;
7272 }
7373
74- public function run ( $ oldest_rev , $ newest_rev , $ directory = '' ) {
74+ public function run ( $ oldest_rev , $ newest_rev , $ directory = '' , $ excluded_exts = '' ) {
7575
7676 if ( true !== $ this ->nocache ) {
7777 $ found_issues = false ; //wp_cache_get( $cache_key, $cache_group );
@@ -80,6 +80,10 @@ public function run( $oldest_rev, $newest_rev, $directory = '' ) {
8080 }
8181 }
8282
83+ if ( '' !== $ excluded_exts ) {
84+ $ this ->set_excluded_extensions ( $ excluded_exts );
85+ }
86+
8387 $ diff = trim ( $ this ->version_control ->get_diff ( $ directory , $ newest_rev , $ oldest_rev , [] ) );
8488
8589 $ this ->stop_the_insanity ();
@@ -146,7 +150,13 @@ private function process_file( $filename, $oldest_rev, $newest_rev, $is_new_file
146150 }
147151
148152 foreach ( $ this ->excluded_extensions as $ excluded_ext ) {
149- if ( function_exists ( 'wp_endswith ' ) && wp_endswith ( $ filename , $ excluded_ext ) ) {
153+ if (
154+ (
155+ function_exists ( 'wp_endswith ' ) &&
156+ wp_endswith ( $ filename , $ excluded_ext )
157+ ) ||
158+ $ excluded_ext === pathinfo ( $ filename , PATHINFO_EXTENSION )
159+ ) {
150160 return false ;
151161 }
152162 }
0 commit comments