#61465 closed defect (bug) (fixed)
New plugins list item breaks if WP version is incompatible
Reported by: | wojtekn | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | minor | Version: | 6.4 |
Component: | Plugins | Keywords: | has-patch commit |
Focuses: | administration | Cc: |
Description
The plugin list layout becomes broken when there is a plugin found that is incompatible with a current WordPress version. For example:
- Install WordPress 6.4.3
- Navigate to Plugins -> Add New Plugin
- Search for Create Block Theme
It's caused by printf
used instead of sprintf
in the code that generates that block.
Attachments (1)
Change History (9)
This ticket was mentioned in PR #6858 on WordPress/wordpress-develop by @wojtekn.
6 months ago
#1
- Keywords has-patch added
@
6 months ago
broken message for plugin that requires newer WordPress version (using 6.4.3 and plugin requires 6.5)
#2
@
6 months ago
- Focuses administration added
- Keywords commit added
- Milestone changed from Awaiting Review to 6.6
- Summary changed from Plugin block breaks if WP version is incompatible to New plugins list item breaks if WP version is incompatible
- Version changed from trunk to 6.4
Hi and thanks for the ticket and patch!
[56571] missed updating that message fragment to sprintf
. (I did not find any other = printf
results when searching in wp-admin
or wp-includes
.) "86" in the error message apparently was the string length for the link.
To test the patch in trunk, you could replace is_wp_version_compatible
(currently on line 553):
$compatible_wp = false;
#3
@
6 months ago
"86" in the error message apparently was the string length for the link.
Nice TIL! I was wondering where this number comes from, but I didn't explore this part further. It seems that https://www.php.net/manual/en/function.printf.php in addition to outputting string, returns string length as int:
Returns the length of the outputted string.
#4
@
6 months ago
I have tested the fix PR 6858
Before: https://prnt.sc/GbssKMU4jNyq
After: https://prnt.sc/3LA95_j6sFVj
The patch is working as expected. ✅
@SergeyBiryukov commented on PR #6858:
6 months ago
#7
Thanks for the PR! Merged in r58446.
Trac ticket: https://core.trac.wordpress.org/ticket/61465