eduardovillao/wp-since
Composer 安装命令:
composer require eduardovillao/wp-since
包简介
Check WordPress plugin compatibility by analyzing used functions, classes, hooks and comparing against the minimum required WP version.
README 文档
README
Make sure your plugin works with the right WordPress version — automatically.
Scans your WordPress plugin to detect all used core symbols and validates them against their official @since versions for accurate compatibility checks.
✨ How It Works
Ever struggled to define the correct minimum WordPress version for your plugin?
Worried about accidentally using functions or APIs that don’t exist in declared minimum WP version?
wp-since helps you avoid those headaches by automatically analyzing your plugin’s code and checking compatibility against real WordPress versions.
Here’s what it does:
- 🧠 Scans your plugin for used:
- Functions
- Classes
- Class methods (static and instance)
- Action and filter hooks
- 📖 Reads the declared Requires at least: version from your
readme.txt - 🗂️ Compares those symbols with a version map built from WordPress core using
@sincetags - 🚨 Reports any used symbols that require a newer WP version than what’s declared
Example Output
Let’s say your plugin uses register_setting() (introduced in WP 5.5), but your readme.txt declares compatibility with WordPress 5.4:
🔍 Scanning plugin files...
✅ Found readme.txt → Minimum version declared: 5.4
🚨 Compatibility issues found:
┌──────────────────────┬──────────────────┐
│ Symbol │ Introduced in WP │
├──────────────────────┼──────────────────┤
│ register_setting │ 5.5.0 │
└──────────────────────┴──────────────────┘
📌 Suggested version required: 5.5.0
Now imagine your code is fully aligned with your declared version:
🔍 Scanning plugin files...
✅ Found readme.txt → Minimum version declared: 5.5
🎉 No compatibility issues found!
Simple. Powerful. Automatic.
Because your plugin deserves reliable compatibility.
🚀 Usage
Requirements
- PHP 7.4+
- Composer
🛠️ Install via Composer (recommended)
composer require --dev eduardovillao/wp-since
▶️ Run the compatibility check
./vendor/bin/wp-since check ./path-to-your-plugin
🧹 Ignore Files & Folders
By default, wp-since scans all .php files in your plugin directory.
But what about files that don’t make it into your final plugin zip — like tests or dev tools? No worries — wp-since respects your ignore rules.
Supported ignore sources:
.distignore.gitattributeswithexport-ignore
If any of those files are present, wp-since will automatically ignore the listed files or folders during analysis — just like svn export or plugin deployment.
Example: .gitattributes
/tests/ export-ignore /tools/debug.php export-ignore
Example: .distignore
/tests /tools/debug.php
These paths will be excluded from compatibility checks. This helps avoid false positives caused by test or development files.
📝 Inline Ignore
You can ignore specific lines from the scan by adding a special inline comment.
This is useful when you conditionally use a newer function but know it’s safe, like:
if (function_exists('wp_some_new_func')) { return wp_some_new_func(); // @wp-since ignore }
Only inline comments on the same line will be considered — comments above the line won’t trigger ignores.
🛠️ Coming Soon
- GitHub Action integration
- HTML/Markdown reports
- Export for CI/CD pipelines
📜 License
MIT © Eduardo Villão
Use freely, contribute gladly.
eduardovillao/wp-since 适用场景与选型建议
eduardovillao/wp-since 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4k 次下载、GitHub Stars 达 78, 最近一次更新时间为 2025 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eduardovillao/wp-since 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eduardovillao/wp-since 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 78
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-08