wp-plugin-version

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WordPress Plugin Version

WordPress 插件版本

Use this skill to suggest and apply semantic version updates for a WordPress plugin.
使用此skill来建议并为WordPress插件应用语义化版本更新。

Inputs

输入项

  • Optional: action (analyze, update, list files), target version.
  • If no action is provided, start with analysis and recommend a version.
  • 可选:操作类型(analyze<分析>、update<更新>、list files<列出文件>),目标版本。
  • 如果未提供操作类型,则从分析开始并推荐版本。

Safety Rules

安全规则

  • Ask before modifying files.
  • Update only version references that match the current version.
  • Do not commit or tag; the user decides when to commit.
  • 修改文件前需询问用户。
  • 仅更新与当前版本匹配的版本引用。
  • 不要提交或打标签;由用户决定何时提交。

Workflow

工作流程

  1. Identify the main plugin file
    • Look for a PHP file in repo root containing a
      Plugin Name:
      header.
    • If multiple candidates exist, ask the user to choose.
  2. Read current version
    • Extract
      Version:
      from the plugin header.
    • Warn if it is not in MAJOR.MINOR.PATCH format.
  3. Analyze changes
    • Prefer comparing against the latest version tag when available.
    • If no tags exist, compare against the default branch.
    • Recommend a SemVer bump:
      • MAJOR: removed or breaking public APIs, hooks, or behavior.
      • MINOR: new features, new hooks/endpoints, backward compatible.
      • PATCH: bug fixes, internal improvements.
  4. List version references
    • Search for the current version string across plugin files and docs.
    • Present the list for confirmation.
  5. Update version
    • Propose the new version and ask for confirmation.
    • Update:
      • Main plugin header
        Version:
      • Any defined version constants
      • readme.txt and README files
      • package.json if present
    • Keep changes minimal and review with
      git diff
      .
  6. Report
    • Summarize files updated and next steps.
    • Suggest running
      /wp-plugin-changelog
      and
      /wp-plugin-tag
      when ready.
  1. 识别主插件文件
    • 在仓库根目录中查找包含
      Plugin Name:
      头信息的PHP文件。
    • 如果存在多个候选文件,请询问用户选择。
  2. 读取当前版本
    • 从插件头信息中提取
      Version:
      字段。
    • 如果版本不符合MAJOR.MINOR.PATCH格式,发出警告。
  3. 分析变更
    • 优先与最新版本标签进行对比(如果可用)。
    • 如果没有标签,则与默认分支对比。
    • 推荐SemVer版本升级类型:
      • MAJOR:移除或破坏了公共API、钩子或行为。
      • MINOR:新增功能、新钩子/端点,且向后兼容。
      • PATCH:修复bug、内部改进。
  4. 列出版本引用
    • 在插件文件和文档中搜索当前版本字符串。
    • 展示列表供确认。
  5. 更新版本
    • 提议新版本并请求确认。
    • 更新以下内容:
      • 主插件头信息中的
        Version:
      • 任何已定义的版本常量
      • readme.txt和README文件
      • 若存在则更新package.json
    • 尽量减少变更,并通过
      git diff
      进行审查。
  6. 报告
    • 总结已更新的文件和后续步骤。
    • 建议准备就绪时运行
      /wp-plugin-changelog
      /wp-plugin-tag

Output Template

输出模板

Use the summary template when reporting changes.
报告变更时使用此总结模板。