Repository navigation
Add link, Heartbeat, pattern directory, and AI support settings - #186
Conversation
Six new settings, each with the three-part help text: - Remove REST API Link: the API address in the page head and the Link response header. The REST API keeps working. - Remove oEmbed Discovery Links: removed at both priorities WordPress adds them (4 and 10). - Remove Feed Links: the feed discovery links in the page head. The feeds keep working. - Limit Heartbeat: deregistered on the front end; every 120 seconds instead of core's 60 on admin screens, except the post editor, the site editor, and the Customizer. A slower interval is kept. - Disable Pattern Directory Patterns: should_load_remote_block_patterns. - Disable WordPress AI Support: wp_supports_ai, read from init on. The header removals are now one table, so each option lists the hook, callback, and priority it removes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 19 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.24% coverage variation
Metric Results Coverage variation ✅ +0.24% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (d145c95) 900 870 96.67% Head commit (58eef03) 971 (+71) 941 (+71) 96.91% (+0.24%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#186) 80 80 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Thanks for contributing to EngineScript Site Optimizer! Before we review:
Security Reminder
We'll review your PR soon. |
The generated test_native_bootstrap_mode_and_optimizer_hooks still expected 13 fields and 11 on/off options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Six new settings. Each one shows the three-part help text from #185: what it does, its effect on the site, and its performance gain or cost.
rest_output_link_wp_head(wp_head, 10) andrest_output_link_header(template_redirect, 11). The REST API keeps working.wp_oembed_add_discovery_linksat both priorities core uses, 4 and 10.feed_links(2) andfeed_links_extra(3). The feeds keep working.wp_deregister_script( 'heartbeat' )onwp_enqueue_scriptsat priority 100. Admin:heartbeat_settingssets 120 seconds, except onpost.php,post-new.php,site-editor.phpandcustomize.php. A slower interval set by another plugin is kept.should_load_remote_block_patternsreturnsfalse(PHP_INT_MAX).wp_supports_aireturnsfalse(PHP_INT_MAX). Core reads it frominiton, when it sets up its connectors.The new filters follow the plugin's existing pattern: they return the incoming value unchanged when their option is off. Header removals now come from one table,
es_optimizer_get_header_removals(). The existing options remove exactly what they removed before, and the unit tests check that.All of this was checked against WordPress 7.0 and 7.1.5 core:
adjacent_posts_rel_link_wp_head()has been "No longer used in core" since 5.6, so no option was added for it.Testing
composer check-allpasses: PHPCS, PHPMD, Psalm and its taint analysis, PHPStan, Rector, and PHPUnit with 181 tests and 823 assertions. The new unit tests cover:Linkheader, 1 → 0; oEmbed links, 2 → 0; feed links, 3 → 0;wp_supports_ai(),true→false; the pattern filter,true→false;msgfmt -con the regenerated POT (138 strings) are clean. gitleaks finds no leaks.The changelog entries are under "Unreleased", and the README and
readme.txtfeature lists are updated.🤖 Generated with Claude Code