When various methods parameters in child classes were renamed to `$item` to match the parent class for PHP 8 named parameter support, most of the methods restored the more descriptive, specific name at the beginning for better readability, with several exceptions for methods consisting only of a few lines.
To avoid confusion about why some methods do that and some don't, this commit aims to bring more consistency to the code, specifically in list tables' `::column_default()` methods.
Follow-up to [51728], [51737], [51786].
See #58831.
Built from https://develop.svn.wordpress.org/trunk@56586
git-svn-id: http://core.svn.wordpress.org/trunk@56098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In `WP_Upgrader::delete_temp_backup()`, a malformed `sprintf()` call did not pass the value, triggering a Warning in PHP 7 and a Fatal Error in PHP 8.
This fixes the malformed `sprintf()` call by correctly passing the value.
Follow-up to [55720].
Props akihiroharai, afragen.
Fixes#59320.
Built from https://develop.svn.wordpress.org/trunk@56550
git-svn-id: http://core.svn.wordpress.org/trunk@56062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replaces `trigger_error()` with `wp_trigger_error()` in each of the `WP_List_Table` magic methods.
[56349] added the dynamic properties deprecation messages to the `__get()`, `__set()`, `__isset()`, `__unset()` magic methods. Since that commit, `wp_trigger_error()` was introduced (see [56530]) as a wrapper for `trigger_error()`.
Follow-up to [56349], [56356], [56530].
See #58896, #57686.
Built from https://develop.svn.wordpress.org/trunk@56542
git-svn-id: http://core.svn.wordpress.org/trunk@56054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, bulk upgrades did not verify that a plugin package was compatible with the site's WordPress version or the server's PHP version. This could lead to incompatible updates being installed, causing various compatibility issues and errors.
This change implements the following checks:
- If available, the API response's `requires` and `requires_php` values are checked for compatibility. This saves time, diskspace, memory and file operations by failing the upgrade before the package is downloaded and unpacked.
- If the API check passes, the downloaded and unpacked package is verified using `Plugin_Upgrader::check_package()` to ensure a plugin file is present, and the plugin's "RequiresWP" and "RequiresPHP" headers are compatible, if present. This ensures that a mismatch between the API response and the plugin file's headers does not cause an incompatible plugin to be installed.
Props salcode, afragen, mukesh27, iammehedi1, zunaid321, johnbillion, SergeyBiryukov, costdev.
Fixes#59198.
Built from https://develop.svn.wordpress.org/trunk@56525
git-svn-id: http://core.svn.wordpress.org/trunk@56037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introducing Font Face, a server-side `@font-face` styles generator and printer.
tl;dr:
* Introduces Font Face.
* Deprecates `_wp_theme_json_webfonts_handler()`.
**Introduce Font Face**
From an array of fonts (i.e. each font-family and its font variations to be processed), it:
1. Validates each `font-face` declaration, i.e. the CSS property and value pairing. If validation fails, processing stops with no font-face styles printed.
3. Generates the `@font-face` CSS for each font-family.
4. Prints the CSS within a `<style id="wp-fonts-local">` element.
The entry point into Font Face is through a new global function called `wp_print_font_faces()`, which is automatically called:
* when the `'wp_head'` hook runs (for the front-end).
* when the `'admin_print_styles'` hook runs (for the back-end).
* when `_wp_get_iframed_editor_assets()` runs to inject the `@font-face` styles into the iframed editor.
Once called, it gets the fonts from Theme_JSON merged data layer, which includes theme defined fonts and user activated fonts (once the Font Library #59166 is introduced into Core).
For classic sites, themes and plugins can directly call `wp_print_font_faces()` and pass their fonts array to it for processing.
**Deprecates `_wp_theme_json_webfonts_handler()`.**
As Font Face is a direct replacement, the stopgap code in `_wp_theme_json_webfonts_handler()` (introduced in 6.0.0 via [53282]) is deprecated and unused in Core.
**Props note:**
There's a long multiple year history baked into Font Face, which dates back to the early versions of a web font API (see #46370 and [https://github.com/WordPress/gutenberg/issues/41479 roadmap]. The props list includes those who contributed from those early versions up to this commit.
**References:**
* #46370 original (Web)Fonts API proposal for registering and enqueuing web fonts.
* [https://github.com/WordPress/gutenberg/issues/41479 Gutenberg tracking issue] which includes the evolution from Webfonts API to Fonts API to Font Face.
* [53282] / #55567 Added the stopgap code `_wp_theme_json_webfonts_handler()` in 6.0.
* [https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face @font-face on mdn web docs]
* #59166 Font Library: Font manager for WordPress
Follow-up to [53282].
Props aristath, jonoaldersonwp, hellofromTonya, andraganescu, annezazu, antonvlasenko, arena, askdesign, azaozz, bph, bradley2083, colorful-tones, costdev, davidbaumwald, desrosj, dingo_d, djcowan, domainsupport, dryanpress, elmastudio, flixos90, francina, garrett-eclipse, gigitux, grantmkin, grapplerulrich, gziolo, ironprogrammer, jb510, jeffpaul, jeremyyip, jffng, joostdevalk, jorgefilipecosta, juanmaguitar, mamaduka, matveb, mburridge, mitogh, ndiego, ntsekouras, oandregal, ocean90, oglekler, paaljoachim, pagelab, peterwilsoncc, poena, priethor, scruffian, SergeyBiryukov, shiloey, simison, skorasaurus, soean, westonruter, wildworks, zaguiini.
Fixes#59165.
Built from https://develop.svn.wordpress.org/trunk@56500
git-svn-id: http://core.svn.wordpress.org/trunk@56012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- `__construct()` gets the new `_deprecated_class()` function
- `WP_User_Search` PHP4 style constructor is changed from `_deprecated_function()` to `_deprecated_constructor()`
Adds a test to confirm `WP_User_Search` class is testable as deprecated.
Props jrf, DrewAPicture.
Fixes#41125.
Built from https://develop.svn.wordpress.org/trunk@56469
git-svn-id: http://core.svn.wordpress.org/trunk@55981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change the 'x' in the Help message that instructs a user how to remove an item from a group of bulk edit items to use the dashicon and text equivalent that matches the visual and accessible control name.
Props Presskopp, costdev, sabernhardt, matthewfarlymn, bvreeman22.
Fixes#58785.
Built from https://develop.svn.wordpress.org/trunk@56460
git-svn-id: http://core.svn.wordpress.org/trunk@55972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves a few WPCS warnings:
{{{
Variable "$sX" is not in valid snake_case format, try "$s_x"
Variable "$sY" is not in valid snake_case format, try "$s_y"
}}}
The `$sX` and `$sY` variables are renamed to `$original_width` and `$original_height`, respectively.
Additionally, the `$fwidth` and `$fheight` variables are renamed to `$full_width` and `$full_height`, for clarity.
Follow-up to [11965], [22094], [56400].
See #58831.
Built from https://develop.svn.wordpress.org/trunk@56411
git-svn-id: http://core.svn.wordpress.org/trunk@55923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add functions `wp_get_admin_notice()` and `wp_admin_notice()` to create and output admin notices & tests for usage. New functions accept a message and array of optional arguments. This commit does not implement the functions. Include new filters: `wp_admin_notice_args`, `wp_admin_notice_markup` and action: `wp_admin_notice`.
Props joedolson, costdev, sakibmd, dasnitesh780, sabernhardt.
Fixes#57791.
Built from https://develop.svn.wordpress.org/trunk@56408
git-svn-id: http://core.svn.wordpress.org/trunk@55920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If the available disk space exceeds the `PHP_INT_MAX` value, i.e. a 32-bit PHP version is in use with more than 2 GB free, the type casting to `(int)` could cause an overflow, and the Site Health test would then erroneously report that there is not enough free space.
This commit removes the unnecessary type casting and uses the result from `disk_free_space()` directly.
Includes optimizing the logic to skip further checks if the available disk space could not be determined.
Follow-up to [55720].
Props mathsgrinds, Presskopp, rajinsharwar, SergeyBiryukov.
Fixes#59116.
Built from https://develop.svn.wordpress.org/trunk@56401
git-svn-id: http://core.svn.wordpress.org/trunk@55913 1a063a9b-81f0-0310-95a4-ce76da25c4cd