From 672142585d55b471fe669ce3f8f38384ecda7e02 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Fri, 22 Apr 2016 09:58:46 +0200 Subject: [PATCH] Remove duplicated checks All of the checks exist in more_deprecated.php --- checks/required.php | 31 ------------------------------- checks/suggested.php | 43 ------------------------------------------- 2 files changed, 74 deletions(-) delete mode 100644 checks/required.php delete mode 100644 checks/suggested.php diff --git a/checks/required.php b/checks/required.php deleted file mode 100644 index e9779997..00000000 --- a/checks/required.php +++ /dev/null @@ -1,31 +0,0 @@ - 'home_url()', - '/\s?get_option\(\s?("|\')site_url("|\')\s?\)/' => 'site_url()', - ); - - foreach ( $php_files as $php_key => $phpfile ) { - foreach ( $checks as $key => $check ) { - checkcount(); - if ( preg_match( $key, $phpfile, $matches ) ) { - $filename = tc_filename( $php_key ); - $matches[0] = str_replace(array('"',"'"),'', $matches[0]); - $error = esc_html( rtrim($matches[0], '(' ) ); - $grep = tc_grep( rtrim($matches[0], '(' ), $php_key ); - $this->error[] = sprintf(''.__('REQUIRED','theme-check').': '.__('%1$s was found in the file %2$s. Use %3$s instead.%4$s', 'theme-check'), '' . $error . '', '' . $filename . '', '' . $check . '', $grep); - $ret = false; - } - } - } - return $ret; - } - function getError() { return $this->error; } -} -$themechecks[] = new Required; \ No newline at end of file diff --git a/checks/suggested.php b/checks/suggested.php deleted file mode 100644 index 3a5b3596..00000000 --- a/checks/suggested.php +++ /dev/null @@ -1,43 +0,0 @@ - 'home_url()', - '/[\s|]get_bloginfo\(\s?("|\')wpurl("|\')\s?\)/' => 'site_url()', - '/[\s|]get_bloginfo\(\s?("|\')stylesheet_directory("|\')\s?\)/' => 'get_stylesheet_directory_uri()', - '/[\s|]get_bloginfo\(\s?("|\')template_directory("|\')\s?\)/' => 'get_template_directory_uri()', - '/[\s|]get_bloginfo\(\s?("|\')template_url("|\')\s?\)/' => 'get_template_directory_uri()', - '/[\s|]get_bloginfo\(\s?("|\')text_direction("|\')\s?\)/' => 'is_rtl()', - '/[\s|]get_bloginfo\(\s?("|\')feed_url("|\')\s?\)/' => 'get_feed_link( \'feed\' ) (feed = rss, rss2, atom)', - '/[\s|]bloginfo\(\s?("|\')url("|\')\s?\)/' => 'echo home_url()', - '/[\s|]bloginfo\(\s?("|\')wpurl("|\')\s?\)/' => 'echo site_url()', - '/[\s|]bloginfo\(\s?("|\')stylesheet_directory("|\')\s?\)/' => 'get_stylesheet_directory_uri()', - '/[\s|]bloginfo\(\s?("|\')template_directory("|\')\s?\)/' => 'get_template_directory_uri()', - '/[\s|]bloginfo\(\s?("|\')template_url("|\')\s?\)/' => 'get_template_directory_uri()', - '/[\s|]bloginfo\(\s?("|\')text_direction("|\')\s?\)/' => 'is_rtl()', - '/[\s|]bloginfo\(\s?("|\')feed_url("|\')\s?\)/' => 'get_feed_link( \'feed\' ) (feed = rss, rss2, atom)', - ); - - foreach ( $php_files as $php_key => $phpfile ) { - foreach ( $checks as $key => $check ) { - checkcount(); - if ( preg_match( $key, $phpfile, $matches ) ) { - $filename = tc_filename( $php_key ); - $matches[0] = str_replace(array('"',"'"),'', $matches[0]); - $error = trim( esc_html( rtrim($matches[0], '(' ) ) ); - $grep = tc_grep( rtrim( $matches[0], '(' ), $php_key ); - $this->error[] = sprintf('' . __( 'RECOMMENDED', 'theme-check' ) . ': '. __( '%1$s was found in the file %2$s. Use %3$s instead.%4$s', 'theme-check'), '' . $error . '', '' . $filename . '', '' . $check . '', $grep); - } - } - } - return $ret; - } - - function getError() { return $this->error; } -} -$themechecks[] = new Suggested; \ No newline at end of file