' . sprintf(__('Parent theme %1$s not found! You have to have parent AND child-theme installed!', 'themecheck'), $data[ 'Template' ] ) . ''; return; } $parent_data = tc_get_theme_data( $parent . '/style.css' ); $themename = basename( $parent ); $files = array_merge( listdir( $parent ), $files ); } if ( $files ) { foreach( $files as $key => $filename ) { if ( substr( $filename, -4 ) == '.php' ) { $php[$filename] = php_strip_whitespace( $filename ); } else if ( substr( $filename, -4 ) == '.css' ) { $css[$filename] = file_get_contents( $filename ); } else { $other[$filename] = ( ! is_dir($filename) ) ? file_get_contents( $filename ) : ''; } } // run the checks $failed = !run_themechecks($php, $css, $other); global $checkcount; // second loop, to display the errors echo '

' . __( 'Theme Info', 'themecheck' ) . ':

'; echo '
'; if (file_exists( trailingslashit( WP_CONTENT_DIR . '/themes' ) . trailingslashit( basename( $theme ) ) . 'screenshot.png' ) ) { $image = getimagesize( $theme . '/screenshot.png' ); echo '
'; echo '
' . $image[0] . 'x' . $image[1] . ' ' . round( filesize( $theme . '/screenshot.png' )/1024 ) . 'k
'; } echo ( !empty( $data[ 'Title' ] ) ) ? '

' . $data[ 'Title' ] . '

' : ''; echo ( !empty( $data[ 'Version' ] ) ) ? '

' . $data[ 'Version' ] . '

' : ''; echo ( !empty( $data[ 'AuthorName' ] ) ) ? '

' . $data[ 'AuthorName' ] . '

' : ''; echo ( !empty( $data[ 'AuthorURI' ] ) ) ? '

' . $data[ 'AuthorURI' ] . '' . '

' : ''; echo ( !empty( $data[ 'URI' ] ) ) ? '

' . $data[ 'URI' ] . '' . '

' : ''; echo ( !empty( $data[ 'License' ] ) ) ? '

' . $data[ 'License' ] . '

' : ''; echo ( !empty( $data[ 'License URI' ] ) ) ? '

' . $data[ 'License URI' ] . '

' : ''; echo ( !empty( $data[ 'Tags' ] ) ) ? '

' . implode( $data[ 'Tags' ], ', ') . '

' : ''; echo ( !empty( $data[ 'Description' ] ) ) ? '

' . $data[ 'Description' ] . '

' : ''; if ( $data[ 'Template' ] ) { if ( $data['Template Version'] > $parent_data['Version'] ) { echo '

' . sprintf(__('This child theme requires at least version %1$s of theme %2$s to be installed. You only have %3$s please update the parent theme.', 'themecheck'), $data['Template Version'], $parent_data['Title'], $parent_data['Version'] ) . '

'; } echo '

' . sprintf(__( 'This is a child theme. The parent theme is: %1$s. These files have been included automatically!', 'themecheck'), $data[ 'Template' ] ) . '

'; if ( empty( $data['Template Version'] ) ) { echo '

' . __('Child theme does not have the Template Version tag in style.css.', 'themecheck') . '

'; } else { echo ( $data['Template Version'] < $parent_data['Version'] ) ? '

' . sprintf(__('Child theme is only tested up to version %1$s of %2$s breakage may occur! %3$s installed version is %4$s', 'themecheck'), $data['Template Version'], $parent_data['Title'], $parent_data['Title'], $parent_data['Version'] ) . '

' : ''; } } echo '
'; $plugins = get_plugins( '/theme-check' ); $version = explode( '.', $plugins['theme-check.php']['Version'] ); echo '

' . sprintf(__(' Running %1$s tests against %2$s using Guidelines Version: %3$s Plugin revision: %4$s', 'themecheck'), $checkcount, $data[ 'Title' ], $version[0], $version[1] ) . '

'; $results = display_themechecks(); $success = true; if (strpos( $results, 'WARNING') !== false) $success = false; if (strpos( $results, 'REQUIRED') !== false) $success = false; if ( $success === false ) { echo '

' . sprintf(__('One or more errors were found for %1$s.', 'themecheck'), $data[ 'Title' ] ) . '

'; } else { echo '

' . sprintf(__('%1$s passed the tests', 'themecheck'), $data[ 'Title' ] ) . '

'; tc_success(); } if ( !defined( 'WP_DEBUG' ) || WP_DEBUG == false ) echo '
WARNING ' . __( 'WP_DEBUG is not enabled! Please test your theme with debug enabled before you upload!
', 'themecheck' ); echo '
'; echo '
'; } } function tc_intro() { _e( '

About

', 'themecheck' ); _e( '

The theme check plugin is an easy way to test your theme and make sure it\'s up to spec with the latest theme review standards.
', 'themecheck' ); _e( 'With it, you can run all the same automated testing tools on your theme that WordPress.org uses for theme submissions.

', 'themecheck' ); _e( '

Contact

', 'themecheck' ); _e( '

Theme-Check is maintained by Pross and Otto42
', 'themecheck' ); _e( 'If you have found a bug or would like to make a suggestion or contribution why not join the theme-reviewers mailing list
', 'themecheck' ); _e( 'or leave a post on the WordPress forums.

', 'themecheck' ); _e( '

Contributors

', 'themecheck' ); _e( '

localization

', 'themecheck' ); echo ''; _e( '

Testers

', 'themecheck' ); _e( '

The WordPress Theme Review Team

', 'themecheck' ); } function tc_success() { _e( '

Now your theme has passed the basic tests you need to check it properly using the test data before you upload to the WordPress Themes Directory.

', 'themecheck' ); echo '
'; _e( '

Make sure to review the guidelines at Theme Review before uploading a Theme.

', 'themecheck' ); _e( '

Codex Links

', 'themecheck' ); echo '
'; } function tc_form() { $themes = tc_get_themes(); echo '
'; echo ''; echo ''; if ( defined( 'TC_PRE' ) || defined( 'TC_POST' ) ) echo ' ' . __( 'Output in Trac format.', 'themecheck' ); echo ' ' . __( 'Suppress INFO.', 'themecheck' ); echo '
'; }