Work on requirements automation update #1

I will be leading the initiative to automate the requirements so to reduce the amount of manual checking.

The first steps that we have taken is to remove duplicate requirements on three topics:

The second step was to work on the template requirements as they were previously too vague.


After discussing the requirments with the other admins this is the list of requirments that we could automate. The information below are the requirments with the type of notice that the check would output in bold and then how we could check for this requirement in italics. We will be discussing this further on Tuesday at the team meeting. I have published this today so that you can read through the proposal and prepare some thoughts for the team meeting. At the end of the discussion I will open a GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ issue for each of the requirements to track the progress. Everyone is welcome to help writting pull requests to complete these checks.

Code

  • No PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. http://php.net/manual/en/intro-whatis.php. or JS errors. – RequiredRun PHP and JS validator to catch code errors like with the plugins
  • No removing or modifying non-presentational hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same.. – RequiredCheck for `remove_action(‘wp_head’)`
  • Provide a unique prefix for everything the Theme defines in the public namespace, including options, functions, global variables, constants, post metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress., etc. – InfoCheck if contains theme slug

CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Functionality and Features

  • Use WordPress functionality and features first, if available. – InfoExtend list to include favicon and logo
  • Don’t include admin/feature pointers. – RequiredCheck for `
    wp_enqueue_style( ‘wp-pointer’ ); wp_enqueue_script( ‘wp-pointer’ );`
  • No disabling of the admin toolbar. – RequiredCheck for `add_filter(‘show_admin_bar’, ‘__return_false’);` and `show_admin_bar(false)`
  • The theme tags in style.css and description must match the what the theme actually does in respect to functionality and design. (See: Theme Tag List) – InfoAdd checks for buddypress, featured-images, custom-headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes., custom-background, custom-menu, editor-style, flexible-header, post-formats, theme-options and threaded-comments

Presentation vs Functionality

  • The theme options should not be pseudo custom post types and save non-trivial user data. Non-design related functionality is not allowed. (See: Plugin territory examples) – WarningChecks for user_contactmethods and metaboxes

Language

  • Include a text domain in style.css –  RequiredSelf explanatory

Naming

  • Theme names must not use: WordPress, Theme. – RequiredA check has already been written by @poena which need to be added in the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party.
  • Spell “WordPress” correctly in all public facing text: all one word, with both an uppercase W and P. – Warning – Self explanatory

Options and Settings

  • Use edit_theme_options capability for determining user permission to edit options, rather than rely on a role (e.g. “administrator”), or a different capability (e.g. “edit_themes”, “manage_options”). – Required – Check for `current_user_can()` & `user_can()` with roles & `get_role()`
  • Use the Customizer for implementing theme options. – RequiredCheck for `add_settings_section`, `add_settings_field`, `register_setting`, `settings_fields` and `do_settings_sections`

Plugins

  • Don’t include any plugins. A theme can recommend plugins but not include those plugins in the theme code. –  RequiredCheck for bundled zip files.

Stylesheets and Scripts

  • Required to use core-bundled scripts rather than including their own version of that script. For example jQuery. –  Warning @poena has already written a check for `wp_dequeue_script`