Skip to content

WordPress 7.2 compatibility fixes and minimum bump to 7.0 - #1292

Merged
dkotter merged 9 commits into
developfrom
fix/wp-7.2-compat
Dec 3, 2026
Merged

dkotter merged 9 commits into
developfrom
fix/wp-7.2-compat

Conversation

@jeffpaul

@jeffpaul jeffpaul commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Requested by JP · project thread

Description of the Change

Compatibility fixes found while testing ClassifAI on WordPress 7.2 (RC3), plus the "Tested up to" bump to 7.2 and a WordPress minimum bump from 6.9 to 7.0.

Note that this bumps the WordPress minimum from 6.9 to 7.0. It is updated in the plugin header, both readmes, the docs, and the PHPCS and PHPStan configs. The "WP minimum" E2E job already runs on 7.0.

Excerpt Generation button missing on 7.2

WordPress 7.2 renders the excerpt as a field of the post summary and no longer renders the excerpt panel that holds the PluginPostExcerpt slot. The "Generate excerpt" button was added through that slot, so it did not show on 7.2.

  • On 7.2+, ExcerptGeneration uses the new Entity Fields API (wp_update_entity_fields() on wp_entity_fields_api_init) to provide the edit control of the excerpt field. The control is the same textarea with the generate button below it. It is provided by a small script module, assets/js/excerpt-field.js, which picks up the component from the excerpt generation script. On screens where that script is not loaded, the core control is used.
  • The existing PluginPostExcerpt fill stays, so 7.0 and 7.1 behave as before.
  • The "ClassifAI: Generate excerpt" command is now registered with useCommand from the excerpt generation script. The old one looked for a button class that no longer exists, so it never showed.

Other fixes found during testing (these also happen on 7.1)

  • The recommended content settings script was enqueued on every admin page and threw Cannot destructure property 'services' of 'window.classifAISettings'. It now loads on the ClassifAI settings page only.
  • The embeddings_in_progress REST route caused a fatal error when the embeddings scheduler was not set up. It now returns false.
  • Guard against missing models in GoogleAI::get_models() and TogetherAI\Images::sanitize_settings() (PHP warnings).
  • TermCleanupEPIntegration no longer passes a null Elasticsearch version to version_compare() (PHP 8.1+ deprecation).

E2E helpers updated for the 7.2 editor markup

  • New posts start with an empty paragraph block and no default block appender.
  • The excerpt is opened with the "Edit Excerpt" button of the post summary.
  • The featured image control is a role="button" element in the post summary.
  • Core term panels render terms as chips, not FormTokenField tokens.

Each selector keeps the previous markup too, so the suite runs on 7.0 to 7.2.

Closes #1283

How to test the Change

  1. On WordPress 7.2 (RC3 or later), turn on Excerpt Generation with any provider.
  2. Edit a post and click the "Edit Excerpt" button in the post summary. The "Generate excerpt" button shows below the textarea, and clicking it fills in the excerpt.
  3. Open the command palette and run "ClassifAI: Generate excerpt".
  4. Repeat steps 2 and 3 on WordPress 7.1. The button shows in the excerpt dropdown as before.
  5. Open any admin page other than the ClassifAI settings and check the console for errors.

Changelog Entry

Fixed - The generate excerpt button not showing in the block editor on WordPress 7.2.
Fixed - A JavaScript error on admin pages caused by the Recommended Content settings script loading outside of the settings page.
Fixed - A fatal error on the embeddings status REST route when the embeddings scheduler is not set up.
Fixed - PHP warnings when no models are returned for the Google AI and Together AI providers.
Fixed - PHP deprecation in Term Cleanup when the Elasticsearch version is unknown.
Changed - Bump WordPress "tested up to" version to 7.2.
Changed - Bump WordPress minimum from 6.9 to 7.0.

Credits

Props @jeffpaul

Checklist:

<a href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2F10up%2Fclassifai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1292-103a0090a222ab2e75730f527a358cc97e8f8eb3.zip%22%7D%7D%5D%7D" target="_blank" rel="noopener noreferrer">
Open WordPress Playground Preview


Generated by Claude Code

WordPress 7.2 renders the excerpt as a field of the post summary and no
longer renders the PluginPostExcerpt slot, so the button was not shown.
Provide the edit control of the excerpt field through the Entity Fields
API instead, and register the generate excerpt command from the hook
rather than from a DOM lookup.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Vk5tcg3sz5RAa99h6WB8K
- Only enqueue the recommended content settings script on the settings page.
- Don't fatal on the embeddings status route when the scheduler isn't set up.
- Guard against missing models in the Google AI and Together AI providers.
- Don't pass a null Elasticsearch version to version_compare().

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Vk5tcg3sz5RAa99h6WB8K
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Vk5tcg3sz5RAa99h6WB8K
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Vk5tcg3sz5RAa99h6WB8K
@jeffpaul jeffpaul self-assigned this Nov 30, 2026
@github-actions github-actions Bot added this to the 4.0.0 milestone Nov 30, 2026
@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Updated WordPress tested version in badges.
@jeffpaul
jeffpaul marked this pull request as ready for review November 30, 2026 19:33
@jeffpaul
jeffpaul requested review from a team and dkotter as code owners November 30, 2026 19:33
@github-actions github-actions Bot added the needs:code-review This requires code review. label Nov 30, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Vk5tcg3sz5RAa99h6WB8K
@jeffpaul jeffpaul changed the title WordPress 7.2 compatibility fixes WordPress 7.2 compatibility fixes and minimum bump to 7.0 Dec 1, 2026
dkotter
dkotter previously approved these changes Dec 3, 2026

jeffpaul commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

The red checks on the latest head are not caused by this PR. Every E2E job and every PHPUnit job on PHP 8.2+ fails in the "Start the Docker testing environment" step, before any test runs:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2097152 bytes)
in /var/www/html/wp-includes/rest-api/class-wp-rest-server.php on line 1686

WP-CLI hits its 128M limit while wp-env start runs its setup commands with all the plugins from .wp-env.json active. One job shows the same error inside woocommerce/src/StoreApi/Schemas/V1/AbstractSchema.php. The jobs on PHP 7.4, 8.0 and 8.1 pass, as do lint, PHPStan, PHPCS and Plugin Check.

The same failure, on the same set of jobs, shows on unrelated branches since Dec 2, for example this run on enhancement/1126-action-scheduler-4-2-0 and this run on php-8.2-8.5-compat. This PR's previous head (4a9b774) passed all 32 checks on Dec 1, and the commits added since only merge develop and trim comments. I did not re-run the jobs, because each one already retried three times.

Proposed fix, as its own PR so every branch gets it: raise the memory limit for the test environments in .wp-env.json, which wp-env writes to wp-config.php before it activates the plugins:

"config": {
  "WP_MEMORY_LIMIT": "256M"
}

I have not been able to run this against the failing setup, since it only fails in CI, so it needs a CI run to confirm.


Generated by Claude Code

@dkotter
dkotter merged commit 40a51ac into develop Dec 3, 2026
31 checks passed
@dkotter
dkotter deleted the fix/wp-7.2-compat branch December 3, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The plugin hasn't been tested with an upcoming version of WordPress

3 participants