wptrt/wpthemereview
Composer 安装命令:
composer require wptrt/wpthemereview
包简介
PHP_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org
README 文档
README
WPThemeReview Standard for PHP_CodeSniffer
Introduction
WordPress Themes for which a hosting application has been made for the theme to be hosted in the theme repository on wordpress.org have to comply with a set of requirements before such an application can be approved. Additionally, there are also recommendations for best practices for themes.
This project attempts to automate the code analysis part of the Theme Review Process as much as possible using static code analysis.
PHP_CodeSniffer is the base tool upon which this project is build and is a PHP command-line tool.
This project is a work in progress and passing the checks is no guarantee that your theme will be approved.
Requirements
The WPThemeReview Standard requires:
- PHP 5.4 or higher.
- PHP_CodeSniffer version 3.3.1 or higher.
- WordPress Coding Standards version 2.2.0 or higher.
- PHPCompatibilityWP version 2.0.0 or higher.
Installation
The only supported installation method is via Composer.
- Make sure you have PHP installed on your system.
- If not installed yet, install Composer.
Installing WPThemeReview globally
If you would like to have the WPThemeReview standard available to all projects on your system, you can install it in a central location.
From the command-line, run the following command:
$ php composer.phar global require wptrt/wpthemereview dealerdirect/phpcodesniffer-composer-installer
Installing WPThemeReview as a project dependency
If you use Composer to manage dependencies from your project anyway or are considering using it, you can also choose to install the WPThemeReview standard for an individual project.
From the command-line, run the following command from the root directory of your project:
$ php composer.phar require --dev wptrt/wpthemereview:* dealerdirect/phpcodesniffer-composer-installer:^0.7
Note:
- The
--devmeans that WPThemeReview will be installed as a development requirement, not as a requirement for using the Theme.- The second package -
dealerdirect/phpcodesniffer-composer-installer-, is a Composer plugin which will automatically sort out that PHP_CodeSniffer recognizes the WPThemeReview standard and the various WordPress standards.
Checking your installation was successful
# For a global install: $ phpcs -i # For a project install: $ vendor/bin/phpcs -i
If everything went well, the output should look something like this:
The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, PHPCompatibility,
PHPCompatibilityParagonieRandomCompat, PHPCompatibilityParagonieSodiumCompat, PHPCompatibilityWP,
WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra and WPThemeReview
Using the WPThemeReview standard
You can now test your theme code against the WPThemeReview standard by running the following command from the root directory of your theme:
# For a global install: $ phpcs -p . --standard=WPThemeReview # For a project install: $ vendor/bin/phpcs -p . --standard=WPThemeReview
If any issues are found, PHP_CodeSniffer will display a report with all the errors (must fix) and warnings (recommended to fix) for each file.
More information about running PHP_CodeSniffer can be found in the PHP_CodeSniffer Wiki.
Contributing
See CONTRIBUTING, including information about unit testing the standard.
License
See LICENSE (MIT).
wptrt/wpthemereview 适用场景与选型建议
wptrt/wpthemereview 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 788.27k 次下载、GitHub Stars 达 214, 最近一次更新时间为 2018 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「themes」 「wordpress」 「standards」 「phpcs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wptrt/wpthemereview 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wptrt/wpthemereview 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wptrt/wpthemereview 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP_CodeSniffer custom Sniff for Laravel coding standard
Laravel Themes
A set of abstractions that define core services provided by the DVSA
WordPress mu-plugin to register the theme directory for the default WordPress themes.
This is twig version of Flow Theme for OXID eShop.
Test theme for Altis DXP, based on Automattic/_s starter theme.
统计信息
- 总下载量: 788.27k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 217
- 点击次数: 30
- 依赖项目数: 34
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-23