WordPress 中文文档

Theme Review

出自WordPress Chinese 中文文档

跳转到: 导航, 搜索

Anyone can submit a GPL-based WordPress Theme to the WordPress Theme Directory. Before new Themes are displayed publicly, they are reviewed by members of the WordPress community. This page describes the process that Theme reviewers take when they are evaluating Themes. Note that this page is new as of June 2010, and that the process may change as it is still evolving.

目录

The Process

  • Once a Theme author is ready to release a Theme to the public, they can upload it to the directory system. Be sure to follow the Theme development standards at Theme Development and test your theme with the Theme Unit Test before you upload your Theme.
  • Submitted Themes are automatically checked to make sure they meet a few basic requirements.
  • Theme authors receive an automated e-mail message, indicating that their Theme files have been received.
  • Submitted Themes are assigned a ticket in the Theme Review Trac system, and entered into a review queue.
  • Theme reviewers test Themes, using the method described below.
  • Theme reviewers will either approve Themes or contact Theme authors with feedback and/or questions.
  • Theme authors can submit any changes via the upload page they used when they initially uploaded the Theme, either before or after a Theme has been approved.
  • If a Theme is not initially approved, Theme authors can rework the Theme and resubmit it.

If you have any questions or suggestions about the process, don't hesitate to contact us. Thank you for your contributions!

Scope of the Process

  • The Theme directory is a repository of GPL-licensed WordPress Themes. The review process, by community members, ensures Themes conform to modern web standards, WordPress standards, and are, in general, of high quality.
  • While the goal of the design review is to ensure that Themes are functional and meet standards much of the review will surround technical issues. Themes will also be checked for factors, such as:
    • Ensuring that all standards are met to a satisfactory standard.
    • Designs are logical, and user-friendly.
    • All Theme files must be GPL-licensed, or use a GPL-compatible license.
    • Any links to author's website(s) are relevant, accurate, and not advertisement-like in nature.
      • An appropriate way to ask for Theme users to keep a link to the author's website is as follows: It is completely optional, but if you like the Theme I would appreciate it if you keep the credit link at the bottom. Themes authors may not require that these links be kept by Theme users.
  • Theme reviewers will provide feedback to Theme authors in a timely manner; and, Theme authors will have the opportunity to revise their Themes at any time.

Guidelines

Please be clear about the following in your Theme documentation (a README file included with your Theme helps many users over any potential stumbling blocks):

  1. Indicate precisely what your Theme and template files will achieve.
  2. Adhere to the naming conventions of the standard Theme hierarchy.
  3. Indicate deficiencies in your Themes, if any.
  4. Clearly reference any special modifications in comments within the template and stylesheet files. Add comments to modifications, template sections, and CSS styles, especially those which cross template files.
  5. If you have any special requirements, which may include custom Rewrite Rules, or the use of some additional, special templates, images or files, please explicitly state the steps of action a user should take to get your Theme working.
  6. Try and test your Theme across browsers to catch at least a few of the problems the users of the Theme may find later.
  7. Provide contact information (website or email), if possible, for support information and questions.

Licensing

  • All Theme files must be licensed under the GPL or a GPL-compatible license.
    • This requirement includes all PHP, HTML, CSS, and image files contained in the Theme.
  • The Theme must also clearly indicate license, using one of the following methods:
    • Including License and License URI slugs in the Theme information of the stylesheet (style.css) header; or,
    • Including license.txt

An example of style.css header slugs: pre

/pre

Bundled Icons

Icons bundled with Themes must be licensed under GPL or a GPL-compatible license.

Bundled Fonts

Fonts bundled with Themes (e.g. for use with @font-face) are not required to be licensed under GPL or a GPL-compatible license. However, such fonts must be generally compatible with the SIL Open Font License. The GNU Foundation and the Fedora Project maintain lists of acceptable licenses for use with GPL (see also: this list). Fonts bundled with Themes submitted to the WordPress Theme directory must be licensed under one of the following font licenses:

  • Arphic Public License (Arphic)
  • Baekmuk License (Baekmuk)
  • Bitstream Vera License (Bitstream Vera)
  • Creative Commons Attribution License (CC-BY)
  • GNU GPL (with font exception) (GPL)
  • GUST e-Foundry Font License/LaTeX Project Public License (LPPL)
  • IPA Font License (IPA)
  • Liberation Font License (Liberation)
  • LaTeX Project Public License (LPPL)
  • mplus Font License (mplus)
  • ParaType Font License (PTFL)
  • SIL Open Font License (OFL)
  • STIX Fonts User License (STIX)
  • Wadalab Fonts License (Wadalab)
  • XANO Mincho Font License (XANO)

WordPress Version-Specific Features

Upon the release of each new version of WordPress, the Theme review process will be updated. To ensure newly submitted themes support current WordPress features and functionality, all themes submitted one month after a new WordPress version must support the updated review criteria.

WordPress 3.0

Themes are strongly suggested to support the following customization features:

Themes must support the following functionality:

Themes should replace the following functions:

  • codeinclude( TEMPLATEPATH . '/file.php' )/code - use ttget_template_part()/tt instead. Note that ttsearchform.php/tt should be called with ttget_search_form()/tt and not ttget_template_part()/tt.

Themes must replace the following deprecated functions:

  • ttget_bloginfo( 'text_direction' )/tt: use ttis_rtl()/tt
  • ttget_alloptions()/tt
  • ttget_profile()/tt: use ttget_the_author_meta()/tt
  • ttadd_option_update_handler()/tt: use ttregister_setting()/tt
  • ttremove_option_update_handler()/tt: use ttunregister_setting()/tt
  • ttclean_url()/tt: use ttesc_url()/tt and ttesc_url_raw()/tt - see Data Validation
  • ttis_term()/tt: use ttterm_exists()/tt
  • ttis_taxonomy()/tt: use tttaxonomy_exists()/tt

Themes may optionally include:

  • New template files: ttfront-page.php/tt, tttaxonomy.php/tt

WordPress 2.9

Themes must support the following features:

  • Widget sidebar descriptions
  • Post Thumbnails ( add_theme_support( 'post-thumbnails’ ); the_post_thumbnail( 'thumbnail' ) )
  • Comment metadata
  • Excerpt filters (excerpt_length, excerpt_more)

WordPress 2.8

Themes must support the following features:

  • the_widget()

WordPress 2.7

Themes must support the following features:

  • Widgets
  • Comment Threading/Paging ( wp_list_comments() )

Template Files

These files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser.

Themes Must Include, At A Minimum:

  • index.php
  • screenshot.png
  • style.css

Themes Are Recommended To Include The Following Template Files:

  • 404.php
  • archive.php
  • comments.php
  • footer.php
  • header.php
  • page.php
  • search.php
  • sidebar.php (or appropriate variations, e.g. leftcolumn.php and rightcolumn.php)
  • single.php

Themes May Optionally Include:

  • attachment.php
  • author.php
  • category.php
  • date.php
  • editor-style.css
  • image.php
  • tag.php

Custom Template Naming Conventions

Themes should not include files named like the following:

  • page-foobar.php
  • category-foobar.php
  • tag-foobar.php
  • taxonomy-foobar.php

The reason this template naming convention is not good practice is to avoid surprising users that create a page with the -foobar slug and expect the default template. See Template_Hierarchy#Page_display.

Code Quality and Validity

Review Theme Development for WordPress Theme code standards.

Theme must:

  • Generate no PHP errors or notices (use define(WP_DEBUG, true); in wp-config).
  • Use no deprecated WordPress functions (use define(WP_DEBUG, true); in wp-config).
  • Output valid HTML per the W3C Validator.
    • Exceptions:
      • Validation errors caused by the Theme Unit Test data. Such errors currently include:
        • [gallery] shortcode places style declaration outside of head
        • comment_form() outputs form fields with aria=required
  • Use valid CSS per the W3C CSS Validator
    • Exceptions:
      • Browser-supported, draft style declarations, such as -border-radius and -box-shadow, etc.
  • Generate no JavaScript errors

WordPress Hooks and Template Tags

Theme must include these hooks/tags in the document head (e.g. in header.php, or similar template part):

  • nowikiwp_head() – immediately before /head/nowiki

Theme is recommended to include these hooks/tags (usually in sidebar.php):

  • wp_meta()

Theme must include these hooks/tags in index.php, single.php, archive.php, search.php, page.php, attachment.php, category.php, and tag.php (as appropriate):

  • nowikibody_class() – inside body/nowiki tag
  • get_header()
  • nowikipost_class() – inside div id=post/nowiki tag or container
  • nowikiwp_link_pages() – inside div id=post /nowiki container
  • nowikicomments_template() – inside the Loop (usually after div id=post) /nowiki
  • get_sidebar()
  • get_footer()

Theme must include these hooks/tags in comments.php:

  • wp_list_comments() – with or without custom callback
  • nowikicomment_class() – inside li id=comment (if using callback for wp_list_comments())/nowiki
  • comment_form()

Theme must include these hooks/tags in footer.php:

  • nowikiwp_footer() – immediately before /body/nowiki

Theme must include the following functions in sidebar.php (and any other widgetized template file):

  • dynamic_sidebar()

Theme must include the following variables and functions in functions.php:

  • $content_width
  • register_sidebar()
  • add_action(widgets_init), register_widget() – (if Theme uses custom widgets)
  • add_theme_support('automatic-feed-links’)
  • add_theme_support('post-thumbnails’)
  • add_theme_support('menus’)

Theme may optionally include the following functions in functions.php:

  • add_theme_support('custom-background’)
  • add_theme_support('custom-header’)
  • add_custom_image_header()
  • add_custom_background()
  • add_editor_style()

Resources

wordpress