Commit 142adbf
The plugin header already declares every requirement the custom function
checked:
Requires at least: 7.0
Requires PHP: 8.2
Requires Plugins: agents-api
WordPress core (6.5+ for `Requires at least`/`Requires PHP`, 6.6+ for
`Requires Plugins`) reads these headers and:
* Refuses to activate the plugin if WP or PHP is below the minimum.
* Refuses to activate if `agents-api` is missing.
* Surfaces user-friendly admin notices on the plugins screen.
* Compares versions via `is_wp_version_compatible()` /
`is_php_version_compatible()`, the canonical contract for "does this
version satisfy the requirement."
`datamachine_check_requirements()` reimplemented a strict subset of this
with worse behavior:
* Naive `version_compare( $wp, '7.0', '<' )` rejected WP 7.0 RC nightlies
because PHP treats `7.0-RC3` as < `7.0` (RC sorts before final). This
was the bug that motivated #1919 — DM 0.107.0 silently no-op'd on every
WP 7.0 RC site, no fatal, no frontend-visible signal, and no CLI
commands registered.
* The vendor/autoload.php existence check was redundant — if the file is
missing, the next `require_once` at line 26 fatals immediately, which
is a louder, better signal to the developer than a buried admin notice.
* The admin_notices callbacks only fired in `wp-admin`, so frontend
operators never saw the failure mode.
Delete the function and the early-return guard. Trust the plugin header.
Removed:
* Lines 21-23: `if ( ! datamachine_check_requirements() ) { return; }`
* Lines 829-861: the `datamachine_check_requirements()` function
Net: -39 lines, no functional regressions on any supported WP/PHP version.
Closes #1919
Co-authored-by: homeboy-ci[bot] <266378653+homeboy-ci[bot]@users.noreply.github.com>
1 parent 54224db commit 142adbf
1 file changed
Lines changed: 0 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
824 | 820 | | |
825 | 821 | | |
826 | 822 | | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
0 commit comments