Skip to content

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Nov 26, 2025

What?

Removes the Ability API as a composer dependency and updates our code to account for this. Also bumps our minimum WordPress version to 6.9

Why?

We initially bundled all the various AI projects into this plugin (Abilities API, MCP Adapter, WP AI Client) to make it easy to build on those. With the Abilities API going into WP 6.9 though, we can instead rely on that and not have to worry about maintaining that dependency.

How?

  • Removes the Ability API from our composer.json file and updates the composer.lock file to remove that
  • Bump the minimum version of WordPress to 6.9 so we can be sure the Abilities API is available
  • Add a better version check, using the core is_wp_version_compatible function
  • Switch back to using apiFetch instead of executeAbility when title generation is triggered from the post edit screen. The latter doesn't exist yet in 6.9
  • Add a new method that builds the API path for an Ability and use that to pass the path to our script

Testing Instructions

  1. Pull changes and run npm i && npm run build && composer install --no-dev
  2. Go to Settings > AI Credentials and ensure you add at least one valid API key
  3. Go to Settings > AI Experiments and ensure the Title Generation Experiment is enabled
  4. Add a new post or edit an existing post
  5. Click into the title field and ensure you see a toolbar with a button that says either Generate or Re-generate depending on if you have an existing title or not
  6. Click on that button and ensure a loading state shows
  7. Once the request completes, ensure a modal opens with title suggestions. Ensure you can select a title (and optionally edit a title first) and that title is set within the post

Test using WordPress Playground

The changes in this pull request can be previewed and tested using this WordPress Playground instance:

Click here to test this pull request.

@dkotter dkotter added this to the 0.2.0 milestone Nov 26, 2025
@dkotter dkotter self-assigned this Nov 26, 2025
@github-actions
Copy link

github-actions bot commented Nov 26, 2025

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: dkotter <[email protected]>
Co-authored-by: JasonTheAdams <[email protected]>
Co-authored-by: jeffpaul <[email protected]>

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding this as a stub for PHPStan. Hopefully we can remove this after WP 6.9 is released and https://github.com/php-stubs/wordpress-stubs is updated

Copy link
Member

Choose a reason for hiding this comment

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

The latest version of the stubs has been released. We can update that and remove this! 🎉

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed this in 5995fdf and updated to the latest version of that package here: f5b1892

@jeffpaul
Copy link
Member

Note that this stems from the discussion in #106 (review).

@jeffpaul jeffpaul modified the milestones: 0.1.1, 0.2.0 Dec 2, 2025
Copy link
Member

@JasonTheAdams JasonTheAdams left a comment

Choose a reason for hiding this comment

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

Now that the new stubs is out, let's update this. Then I'll approve and we're good to go!

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.83%. Comparing base (ae23fcc) to head (f5b1892).
⚠️ Report is 34 commits behind head on develop.

Files with missing lines Patch % Lines
includes/Abstracts/Abstract_Ability.php 0.00% 2 Missing ⚠️
.../Experiments/Title_Generation/Title_Generation.php 0.00% 1 Missing ⚠️
includes/bootstrap.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #107      +/-   ##
=============================================
- Coverage      38.91%   38.83%   -0.08%     
- Complexity       176      177       +1     
=============================================
  Files             16       16              
  Lines           1010     1012       +2     
=============================================
  Hits             393      393              
- Misses           617      619       +2     
Flag Coverage Δ
unit 38.83% <0.00%> (-0.08%) ⬇️

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 the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Dec 10, 2025
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Dec 10, 2025
Copy link
Member

@JasonTheAdams JasonTheAdams left a comment

Choose a reason for hiding this comment

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

Thanks, @dkotter!

@JasonTheAdams JasonTheAdams merged commit 27eb249 into WordPress:develop Dec 10, 2025
27 of 30 checks passed
@github-project-automation github-project-automation bot moved this from Needs review to Done in WordPress AI Planning & Roadmap Dec 10, 2025
@dkotter dkotter deleted the remove/abilities-api-dependency branch December 10, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants