Skip to content

dev!: rename plugin constants to WPAI_*#317

Merged
dkotter merged 20 commits intodevelopfrom
dev/rename-constants
Mar 18, 2026
Merged

dev!: rename plugin constants to WPAI_*#317
dkotter merged 20 commits intodevelopfrom
dev/rename-constants

Conversation

@justlevine
Copy link
Copy Markdown
Contributor

@justlevine justlevine commented Mar 18, 2026

What?

Replaces the AI_EXPERIMENTS_* prefix with WPAI_*

Important

This PR is based on #316 which should be merged first.

Why?

Plugin rename makes AI_EXPERIMENTS non-sensical. While these are technically breaking changes it's rare for 3pp to use plugins.

How?

Use of AI Tools

GitHub Copilot Autocomplete

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Before After
Open WordPress Playground Preview

justlevine and others added 12 commits March 18, 2026 02:21
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: justlevine <justlevine@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the plugin’s global naming/prefixing from the legacy AI_EXPERIMENTS_* constants to WPAI_*, aligning runtime constants and PHPCS configuration, and adjusts related code/tests accordingly.

Changes:

  • Renames plugin constants (AI_EXPERIMENTS_*WPAI_*) and updates references across bootstrap and core classes.
  • Updates PHPCS global-prefix configuration to enforce the new WPAI constant prefix.
  • Adjusts credential migration version-writing and the corresponding integration test expectation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Integration/Includes/Migrations/Credential_MigrationTest.php Updates migration version assertion (now hard-coded).
phpcs.xml.dist Changes required global constant prefix to WPAI.
includes/Migrations/Credential_Migration.php Writes migration version (now hard-coded).
includes/bootstrap.php Renames/rewires plugin constants and their usages.
includes/Asset_Loader.php Updates asset paths/URLs to use new constants.
includes/Abstracts/Abstract_Ability.php Switches ability category constant to WPAI_*.
includes/Abilities/Utilities/Posts.php Switches ability category constant to WPAI_*.
ai.php Renames base dir constant to WPAI_DIR and updates bootstrap include.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

justlevine and others added 3 commits March 18, 2026 03:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 22.22222% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.15%. Comparing base (c04a8bf) to head (b32272a).
⚠️ Report is 21 commits behind head on develop.

Files with missing lines Patch % Lines
includes/bootstrap.php 0.00% 8 Missing ⚠️
includes/Asset_Loader.php 0.00% 4 Missing ⚠️
ai.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #317   +/-   ##
==========================================
  Coverage      57.15%   57.15%           
  Complexity       589      589           
==========================================
  Files             41       41           
  Lines           3076     3076           
==========================================
  Hits            1758     1758           
  Misses          1318     1318           
Flag Coverage Δ
unit 57.15% <22.22%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeffpaul jeffpaul added this to the 0.6.0 milestone Mar 18, 2026
@jeffpaul jeffpaul requested review from dkotter and gziolo March 18, 2026 13:28
gziolo
gziolo previously approved these changes Mar 18, 2026
Copy link
Copy Markdown
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The constant renaming is clean and straightforward. As noted in the inline comment, I'm not familiar with this particular logic: #317 (comment).

@jeffpaul jeffpaul mentioned this pull request Mar 18, 2026
33 tasks
@justlevine justlevine force-pushed the feat/refactor-feature-namespace branch from 0eaba59 to b361d2d Compare March 18, 2026 19:20
Base automatically changed from feat/refactor-feature-namespace to develop March 18, 2026 20:12
@dkotter dkotter dismissed gziolo’s stale review March 18, 2026 20:12

The base branch was changed.

@dkotter dkotter merged commit e60b15f into develop Mar 18, 2026
16 checks passed
@dkotter dkotter deleted the dev/rename-constants branch March 18, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename plugin from “AI Experiments” to “AI” and define feature vs experiment classification

5 participants