Repository navigation
Report hook-only deprecations generically and run the Tools tab hooks on the General tab - #2009
Merged
Merged
Conversation
Contributor
|
Coverage report for commit: b571ce2 Summary - Lines: 93.99% | Methods: 90.96% | Branches: 85.66%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
from
November 5, 2026 03:45
b75bcdb to
933d885
Compare
Contributor
|
Coverage report for commit: b571ce2 Summary - Lines: 90.18% | Methods: 95.91%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
2 times, most recently
from
November 6, 2026 00:34
e722e41 to
2e3aa47
Compare
gravitypdf-bot
changed the base branch from
feature/core-font-upgrade-prune
to
feature/font-file-conflict-rename
November 6, 2026 00:35
jakejackson1
force-pushed
the
feature/font-file-conflict-rename
branch
from
November 6, 2026 03:07
f7acf3e to
74c3b06
Compare
gravitypdf-bot
force-pushed
the
feature/font-file-conflict-rename
branch
3 times, most recently
from
November 9, 2026 06:09
62cbe50 to
38e02af
Compare
Base automatically changed from
feature/font-file-conflict-rename
to
development
November 9, 2026 06:12
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
3 times, most recently
from
November 9, 2026 23:03
f00aa8f to
addb4de
Compare
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
from
November 9, 2026 23:34
addb4de to
ebff3b4
Compare
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
from
November 9, 2026 23:44
ebff3b4 to
884a941
Compare
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
4 times, most recently
from
November 10, 2026 00:35
d2d730a to
8fc2639
Compare
… on the General tab A removal that leaves nothing behind but its hooks no longer needs a detector of its own: Deprecation reports the third-party listeners on a feature's `hooks` (plus `hook_prefix`, minus `internal_callbacks`) when it declares no `detect`, and View_System_Report describes such a feature by its listener counts instead of looking its ID up in get_deprecated_feature_descriptions(), so a new hook feature left out of that map keeps its counts. Both ask Deprecation::is_hook_only(), so a feature with hooks and its own detector keeps its own description. - New Deprecation_Hooks provider holds `tools_tab_hooks`, and is where any later hook-only round goes. It replaces Deprecation_Tools_Tab, which is deleted outright as it has never been in a release. - The Tools tab hooks keep running at the bottom of the General tab until 7.0, for users who can edit settings: gfpdf_settings_tools' fields under a Tools heading in their own form, as they were never saved through options.php, followed by gfpdf_post_tools_settings_page. As they still work the feature moves to the deprecated group, which gives Site Health Info a Deprecated panel. - Deprecation_V3's `deprecated_filters` drops its `detect` and takes the generic path. get_active_deprecated_filters() is left with no internal caller, so it is deprecated in favour of Deprecation::get_signals(), and still works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gravitypdf-bot
force-pushed
the
refactor/hook-only-deprecations
branch
from
November 10, 2026 00:38
8fc2639 to
b571ce2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-ups from the
/simplifypasses on #1996 and #1997. A removal that leaves nothing behind but its hooks is now a singleget_features()entry: when a feature declareshooksand nodetect,Deprecationfinds the third-party listeners itself and the System Report shows their counts. The Tools tab and v3 hook features both use that path now, andget_active_deprecated_filters(), which that replaces, is deprecated rather than deleted. The Tools tab hooks keep running at the bottom of the General tab until 7.0.Deprecation::get_signals()falls back toget_hooks_with_listeners( hooks, hook_prefix, internal_callbacks )for a hook-only feature.Deprecation::is_hook_only()holds the "hooksand nodetect" rule. The engine andView_System_Reportboth call it.View_System_Reportusesget_deprecated_filter_feature()for a hook-only feature.deprecated_filtersandtools_tab_hooksleaveget_deprecated_feature_descriptions().Deprecation_Hooksprovider: holdstools_tab_hooks, and is where any later hook-only removal goes.Deprecation_Tools_Tabis deleted.Deprecation_Hooksreplaces it, and the class has never been in a release, so nothing can be calling it.gfpdf_settings_toolsfields render under a Tools heading, in their own form below the General form, thengfpdf_post_tools_settings_pagefires at the bottom of the page. Both need thegravityforms_edit_settingscapability, as the Tools tab did.Deprecation::do_action()fires the action through the same path asDeprecation::apply_filters(), so both hooks read their versions and replacements from the registration and log a third-party listener. The shared messages now say "hook" rather than "filter".tools_tab_hooksmoves to the deprecated group, removed in 7.0, and its notice says where the settings went.Deprecation_V3'sdeprecated_filtersdrops itsdetectand uses the generic path. With no caller left,get_active_deprecated_filters()is deprecated in favour ofDeprecation::get_signals(). It still works.Try it
add_filter( 'gfpdf_settings_tools', function ( $s ) { $s['my_tool'] = [ 'id' => 'my_tool', 'name' => 'My Tool', 'type' => 'button', 'std' => 'Run' ]; return $s; } ); add_action( 'gfpdf_post_tools_settings_page', function () { echo 'Tools action'; } ); add_filter( 'gfpdf_rtl', '__return_true' );gfpdf_rtl has 1 listener) is listed as unsupported and "Tools Tab Actions and Filters" (gfpdf_settings_tools has 1 listener) as deprecated.Test plan
development, forTest_Options_API,Test_Actions,Test_Deprecation*,Test_View_Actions,Test_View_System_Report,Test_Controller_Actions,Test_Public_Api*,Test_Upgrade_Routines,Test_Site_Health*,Test_Removed_Methods,Test_Settings,Test_Controller_System_Report,Test_Hook_Inventory,Test_View_GravityForm_Settings_MarkupandTest_Form_Settings. Single site: 294 tests pass, 1 skipped. Multisite: 291 tests pass.More info
get_active_deprecated_filters(). It still callsget_hooks_with_listeners()with the v3 hook map and prefix, so it uses the same lookup as the engine. Its three behaviour tests now readDeprecation::get_signals()['deprecated_filters'], and a fourth asserts that the method is deprecated but still works.is_hook_only(). A feature with hooks and its own detector keeps its own description. A registration with neitherhooksnordetectfails visibly rather than silently reporting nothing.options.phpinstead.gfpdf_settings_toolsruns fromView_Settings::general(), notget_registered_fields(), which also runs on every REST request. Thetoolskey therefore stays out of the registered fields, as it is ondevelopment.Test_Deprecation::test_a_hook_only_feature_reports_its_listenerscovers the generic path throughFake_Internal_Listener_Features. That fixture lost itsdetectand gained ahook_prefix.