diff --git a/checks/class-title-check.php b/checks/class-title-check.php index 2d7bae6..f76b872 100644 --- a/checks/class-title-check.php +++ b/checks/class-title-check.php @@ -29,10 +29,12 @@ class Title_Check implements themecheck { */ public function check( $php_files, $css_files, $other_files ) { - $php = implode( ' ', $php_files ); - foreach ( $php_files as $file_path => $file_content ) { + if ( ! is_string( $file_content ) || '' === $file_content ) { + continue; + } + // Check whether there is a call to wp_title(). checkcount(); if ( preg_match( '/\bwp_title\b/', $file_content ) ) { @@ -52,6 +54,10 @@ public function check( $php_files, $css_files, $other_files ) { // Look for anything that looks like ... and exclude it (inline svg's have titles too). $file_content = preg_replace( '/.*<\/svg>/s', '', $file_content ); + if ( ! is_string( $file_content ) ) { + continue; + } + // Look for and tags. checkcount(); if ( ( false !== strpos( $file_content, '' ) ) || ( false !== strpos( $file_content, '' ) ) ) {