All Projects → WPTT → Theme Sniffer

WPTT / Theme Sniffer

Licence: mit
Theme Sniffer plugin using sniffs.

Projects that are alternatives of or similar to Theme Sniffer

Wordpress Ajax Load More
🔥 WordPress infinite scroll with Ajax Load More - the ultimate solution to add infinite scroll functionality to your WordPress powered website.
Stars: ✭ 222 (-2.63%)
Mutual labels:  wordpress, wordpress-plugin
Co Cart
🛒 CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.
Stars: ✭ 198 (-13.16%)
Mutual labels:  wordpress, wordpress-plugin
Classifai
Enhance your WordPress content with Artificial Intelligence and Machine Learning services.
Stars: ✭ 188 (-17.54%)
Mutual labels:  wordpress, wordpress-plugin
Nginx Helper
Nginx Helper for WordPress caching, permalinks & efficient file handling in multisite
Stars: ✭ 170 (-25.44%)
Mutual labels:  wordpress, wordpress-plugin
Glotpress Wp
🌍 🌎 🌏 GlotPress is a WordPress plugin to let you set up your own collaborative, web-based software translation tool.
Stars: ✭ 205 (-10.09%)
Mutual labels:  wordpress, wordpress-plugin
Gcf
Gutenberg Custom Fields... wait what?
Stars: ✭ 185 (-18.86%)
Mutual labels:  wordpress, wordpress-plugin
List Category Posts
WordPress plugin which allows you to list posts from a category into a post/page using the [catlist] shortcode.
Stars: ✭ 212 (-7.02%)
Mutual labels:  wordpress, wordpress-plugin
Wp Graphql Gutenberg
Query gutenberg blocks with wp-graphql
Stars: ✭ 158 (-30.7%)
Mutual labels:  wordpress, wordpress-plugin
Redis Cache
A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Credis, HHVM, replication and clustering.
Stars: ✭ 205 (-10.09%)
Mutual labels:  wordpress, wordpress-plugin
Nrkbetaquiz
Require the reader to pass a quiz before being able to comment on an article
Stars: ✭ 202 (-11.4%)
Mutual labels:  wordpress, wordpress-plugin
Wp Multi Network
A network management interface for global multisite administrators
Stars: ✭ 168 (-26.32%)
Mutual labels:  wordpress, wordpress-plugin
Wp Jamstack Deployments
A WordPress plugin for JAMstack deployments
Stars: ✭ 222 (-2.63%)
Mutual labels:  wordpress, wordpress-plugin
Accelerated Mobile Pages
Automatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress.
Stars: ✭ 167 (-26.75%)
Mutual labels:  wordpress, wordpress-plugin
Vue Wp Starter
A WordPress Vue.js starter plugin
Stars: ✭ 214 (-6.14%)
Mutual labels:  wordpress, wordpress-plugin
Models
WordPress plugin to create custom post types and taxonomies using JSON, YAML or PHP files
Stars: ✭ 167 (-26.75%)
Mutual labels:  wordpress, wordpress-plugin
Syntaxhighlighter
WordPress plugin that makes it easy to post syntax-highlighted code snippets.
Stars: ✭ 194 (-14.91%)
Mutual labels:  wordpress, wordpress-plugin
Gitium
Keep all your WordPress code on git with a simple plugin and a repo
Stars: ✭ 159 (-30.26%)
Mutual labels:  wordpress, wordpress-plugin
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-29.82%)
Mutual labels:  wordpress, wordpress-plugin
Awesome Elementor
A collection of third party add-ons for the Elementor page builder plugin.
Stars: ✭ 201 (-11.84%)
Mutual labels:  wordpress, wordpress-plugin
The Events Calendar
The Events Calendar WordPress plugin by Modern Tribe
Stars: ✭ 208 (-8.77%)
Mutual labels:  wordpress, wordpress-plugin

Travis License: MIT GitHub All Releases

Minimum PHP Version Tested on PHP 7.0 to nightly Number of Contributors

Theme Sniffer

Description

Theme Sniffer is a plugin utilizing custom sniffs for PHP_CodeSniffer that statically analyzes your theme and ensures that it adheres to WordPress coding conventions, as well as checking your code against PHP version compatibility.

Requirements

The Theme Sniffer requires:

  • PHP 7.0 or higher.
  • WordPress 4.7 or higher.

Installation - development

For themes development and checking

  • Download zip file. Note: Please use this distribution plugin zip. GitHub provided zip will not work.
  • Install this as you normally install a WordPress plugin
  • Activate plugin

For Theme Sniffer development

  • Clone this repository under wp-content/plugins/
  • Run composer install
  • Run npm install
  • Run npm run build
  • Activate plugin

On Windows

  • When developing on Windows machine you might run into various issues with CLI when not installed globally. Installing following items globally might help, but use it with caution:

    • Run npm install --global eslint-cli
    • Run npm install --global stylelint
    • Run composer global require "squizlabs/php_codesniffer=*" & make sure that you have installed WordPress Coding Standards and PHPCompatibility by running phpcs -i. When PHPCS installed globally, you might need clone both repositories and add them to PHPCS with phpcs --config-set installed_paths /path/to/PHPCompatibility,/path/to/wpcs

Note: If you build the plugin this way you'll have extra node_modules/ folders which are not required for the plugin to run, and just take up space. They are to be used for the development purposes mainly. Some of the vendor/ folders are necessary for Theme Sniffer to run

Screenshot

Usage

  • Go to Theme Sniffer
  • Select theme from the dropdown
  • Select options
  • Click GO

Options

  • Select Standard - Select the standard with which you would like to sniff the theme
  • Hide Warning - Enable this to hide warnings
  • Raw Output - Enable this to display sniff report in plain text format. Suitable to copy/paste report to trac ticket
  • Ignore annotations - Ignores any comment annotation that might disable the sniff
  • Check only PHP files - Only checks PHP files, not CSS and JS - use this to prevent any possible memory leaks
  • Minimum PHP version - Select the minimum PHP Version to check if your theme will work with that version

Development

Development prerequisites:

All of the development asset files are located in the assets/dev/ folder. We have refactored the plugin to use the latest JavaScript development methods. This is why we are using webpack to bundle our assets.

When wanting to add a new feature fork the plugin. If you are a maintainer create a feature/* branch.

To start developing, first clone this repo under wp-content/plugins/. Then run in the terminal:

composer install npm install

Then you can run:

npm run start

This will run webpack in the watch mode, so your changes will be saved in the build folder on the fly. After you're done making changes, run:

npm run build

This will create the assets/build/ folder with js and css files that the plugin will use and a zip file for installation.

If you want to skip creating the zip file, you can use

npm run dev

This command behaves like the build one, but it skips creation of the zip file.

When developing JavaScript code keep in mind the separation of concerns principle - data access and business logic should be separate from the presentation. If you 'sniff' (no pun intended) through the js code, you'll see that index.js holds all event triggers and calls the method for sniff start that is located in the separate ThemeSniffer class. Business logic modules should contain plain JavaScript (no framework), which makes it reusable. Of course, there is still room for improvement, so if you notice something that could be improved we encourage you to make a PR.

The same is valid for PHP code. The business logic is stored in the src/ folder, the JS and CSS are located in assets/ folder and the views are located in the views/ folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].