定制 wpcompatibility/wp-compatibility 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wpcompatibility/wp-compatibility

最新稳定版本:0.0.3

Composer 安装命令:

composer require wpcompatibility/wp-compatibility

包简介

WPCompatibility has a collection of PHPCS sniffs which will tell you if your plugin/theme code is compatible with a specific wordpress version

README 文档

README

wpcompatibility is a collection of PHP_CodeSniffer (PHPCS) sniffs designed to check if your WordPress plugin/theme code is compatible with specific WordPress versions.

Table of Contents

Installation:

composer require wpcompatibility/wp-compatibility 

Usage:

Command

# For single wp version
WP_COMPAT_PHPCS_SUPPORTED_VERSIONS='5.0.0' vendor/bin/phpcs --standard=WPCompatibility your-plugin-or-theme-folder/

# To test against multiple wp versions you can separate versions by comma
WP_COMPAT_PHPCS_SUPPORTED_VERSIONS='5.0.1,6.0' vendor/bin/phpcs --standard=WPCompatibility your-plugin-or-theme-folder/

Ruleset File

<rule ref="WPCompatibility.Signature.Function">
    <properties>
        <property name="versions" value="4.3,6.1" />
    </properties>
</rule>

Functions

  • Detect if a wordpress function is present in specific version. For example if you have a plugin file with the below code which is set to be compatible with 5.0, this will throw an error
<?php wp_date(); ?>
Function: wp_date is not available in wordpress version 5.0.0
  • Verify wordpress function signature, if you pass less number of arguments to a wordpress function then it will raise an error.

Buy me a coffee ☕

F_TwK0vbIAAShWP

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-05-30