Commit Graph

7746 Commits

Author SHA1 Message Date
Sergey Biryukov
54184bf872 Docs: Fix typo in the $image parameter description in is_gd_image().
Follow-up to [48798].

See #50833.
Built from https://develop.svn.wordpress.org/trunk@48799


git-svn-id: http://core.svn.wordpress.org/trunk@48561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 14:02:03 +00:00
Sergey Biryukov
12c8f0e678 Code Modernization: Introduce is_gd_image() to check for PHP 8 GdImage object instances.
In PHP 8, the GD extension uses `GdImage` objects instead of resources for its underlying data structures.

This updates the existing `is_resource()` calls for image resources in core to accomodate for `GdImage` instances as well.

Props ayeshrajans, jrf.
Fixes #50833.
Built from https://develop.svn.wordpress.org/trunk@48798


git-svn-id: http://core.svn.wordpress.org/trunk@48560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 13:33:09 +00:00
Sergey Biryukov
a5edb2a8a1 Filesystem API: Use correct variable when closing the file handle in WP_Filesystem_FTPext::get_contents().
Props gothick@gothick.org.uk.
Fixes #51029.
Built from https://develop.svn.wordpress.org/trunk@48797


git-svn-id: http://core.svn.wordpress.org/trunk@48559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 20:56:02 +00:00
Sergey Biryukov
440eb31bb7 Site Health: Recognize define( 'WP_AUTO_UPDATE_CORE', 'minor' ) as an acceptable value.
Previously, it was only incidentally recognized as valid due to a loose comparison with `true`.

With the strict comparison added to `WP_Site_Health_Auto_Updates::test_constants()`, this was no longer the case.

Follow-up to [47841].

Props sterndata, mukesh27, avixansa, desrosj, SergeyBiryukov.
Fixes #50912.
Built from https://develop.svn.wordpress.org/trunk@48792


git-svn-id: http://core.svn.wordpress.org/trunk@48554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-14 20:39:08 +00:00
Sergey Biryukov
1f85e7484f Docs: Consistently use third-person singular verbs for various filter descriptions, per the documentation standards.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48782


git-svn-id: http://core.svn.wordpress.org/trunk@48544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-11 00:34:08 +00:00
Sergey Biryukov
5c0361aeb1 Coding Standards: Remove a few more extra brackets from some conditions in wp-admin/includes/plugin.php.
Follow-up to [48764].

See #50767.
Built from https://develop.svn.wordpress.org/trunk@48766


git-svn-id: http://core.svn.wordpress.org/trunk@48528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-09 01:56:05 +00:00
Sergey Biryukov
004e3f897f Coding Standards: Fix WPCS issues in wp-admin/includes/plugin.php.
Includes minor code layout fixes for better readability.

Props rnaby for initial patch.
See #50767, #43848.
Built from https://develop.svn.wordpress.org/trunk@48764


git-svn-id: http://core.svn.wordpress.org/trunk@48526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 21:04:04 +00:00
Sergey Biryukov
f5a4ac614e Coding Standards: Simplify some parts of user_can_access_admin_page() for better readability.
Props rnaby, valentinbora, khag7.
Fixes #43848.
Built from https://develop.svn.wordpress.org/trunk@48762


git-svn-id: http://core.svn.wordpress.org/trunk@48524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 20:24:05 +00:00
Sergey Biryukov
132942b9fa Docs: Document the return value of get_settings_errors() using hash notation.
Props stevenlinx, webdevmattcrom, atachibana.
Fixes #42786.
Built from https://develop.svn.wordpress.org/trunk@48760


git-svn-id: http://core.svn.wordpress.org/trunk@48522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 12:39:06 +00:00
Sergey Biryukov
961f455a00 Comments: Update DB version number used to trigger the upgrade routine for changing the comment_type DB field value in comments table.
Follow-up to [47597], [47626], [48225], [48227], [48748].

Props desrosj.
See #49236.
Built from https://develop.svn.wordpress.org/trunk@48751


git-svn-id: http://core.svn.wordpress.org/trunk@48513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 16:32:03 +00:00
Sergey Biryukov
6b5e748dee Docs: Correct usage of the dynamic auto_update_{$type} filter.
This ensures that the canonical name of the filter is used in Site Health debug data, as well as on plugin and theme screens, so the developer reference site remains correct.

Props johnbillion.
Fixes #50868.
Built from https://develop.svn.wordpress.org/trunk@48750


git-svn-id: http://core.svn.wordpress.org/trunk@48512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 16:14:03 +00:00
Sergey Biryukov
5221a27593 Site Health: Consistently pass an object to the auto_update_{$type} filter in Site Health debug data.
Previously, some instances of the filter received an array from a plugin or theme update response, potentially triggering PHP notices.

Props bpayton, pbiron.
Fixes #50852.
Built from https://develop.svn.wordpress.org/trunk@48745


git-svn-id: http://core.svn.wordpress.org/trunk@48507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 13:28:05 +00:00
Sergey Biryukov
3a32284b26 Posts, Post Types: Use a consistent wording in messages about a locked post.
Props ramiy.
Fixes #50859.
Built from https://develop.svn.wordpress.org/trunk@48743


git-svn-id: http://core.svn.wordpress.org/trunk@48505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-06 13:14:08 +00:00
Sergey Biryukov
7e1e4f379a Site Health: Check if session_status() exists before calling it.
Props bgermann.
Fixes #50862.
Built from https://develop.svn.wordpress.org/trunk@48742


git-svn-id: http://core.svn.wordpress.org/trunk@48504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-06 00:25:07 +00:00
Sergey Biryukov
ee213e333b Comments: Remove a few more unnecessary instances of esc_html() in WP_Comments_List_Table::comment_status_dropdown().
Core translations are considered safe, and these labels are not escaped in any other instances.

Follow-up to [48521], [48722], [48724].

See #40188, #50815.
Built from https://develop.svn.wordpress.org/trunk@48741


git-svn-id: http://core.svn.wordpress.org/trunk@48503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-05 13:53:06 +00:00
Sergey Biryukov
aaf49752b2 Plugins: Move the "Successfully installed the plugin" string to the correct Plugin_Upgrader method.
The string refers to the installation, and belongs in the `::install_strings()` method, not in `::upgrade_strings()`.

Props sswebster, nateinaction, SergeyBiryukov.
Fixes #50837.
Built from https://develop.svn.wordpress.org/trunk@48734


git-svn-id: http://core.svn.wordpress.org/trunk@48496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:54:04 +00:00
whyisjake
b84d7f1fd3 Site Health: Display auto-update properly for plugins that don't support auto-updates.
Properly filter `auto_update_plugin` when displaying the table.

Fixes #50822.
Props Gwendydd, pbiron, audrasjb, SergeyBiryukov, whyisjake.


Built from https://develop.svn.wordpress.org/trunk@48731


git-svn-id: http://core.svn.wordpress.org/trunk@48493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:37:02 +00:00
Sergey Biryukov
315db55458 Comments: Restore the ::has_items() call in WP_Comments_List_Table::extra_tablenav() for now, until unit tests are updated accordingly.
Follow-up to [48722].

Fixes #40188. See #50815.
Built from https://develop.svn.wordpress.org/trunk@48724


git-svn-id: http://core.svn.wordpress.org/trunk@48486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 16:26:03 +00:00
Sergey Biryukov
b615c45103 Comments: Use the existing static variable instead of calling ::has_items() again in WP_Comments_List_Table::extra_tablenav().
Additionally, removed unnecessary `esc_html()` on the Filter button label. Core translations are considered safe, and this label is not escaped in any other instance.

Props whyisjake, SergeyBiryukov.
Fixes #40188.
Built from https://develop.svn.wordpress.org/trunk@48722


git-svn-id: http://core.svn.wordpress.org/trunk@48484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 15:58:06 +00:00
Sergey Biryukov
e2c8e2fa5a Administration: Allow wp_credits() to accept $version and $locale parameters.
This can be helpful for plugin developers to get credits information for older versions or different locales.

Props ramiy.
Fixes #35910.
Built from https://develop.svn.wordpress.org/trunk@48715


git-svn-id: http://core.svn.wordpress.org/trunk@48477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-03 12:53:08 +00:00
whyisjake
224fdb27b8 Upgrade/Install: Ensure the proper count of plugins that have auto-update enabled.
As certain plugins may not support updates, this count needs to accurately reflect that in the navbar.

Fixes 50808.
Props knutsp, audrasjb, pbiron, dd32, apedog, afragen, chriscct7, garyc40, whyisjake, SergeyBiryukov.

Built from https://develop.svn.wordpress.org/trunk@48703


git-svn-id: http://core.svn.wordpress.org/trunk@48465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 17:21:04 +00:00
whyisjake
b4497ef13f Upgrade/Install: Allow for WordPress.org to remotely disable auto-updates for plugins/themes
As auto-updates are rolled out across WordPress.org, the API response can modulate the response, ensuring that a rolled out could be stalled or staggered if needed for security or performance reasons.

Fixes #50824.
Props dd32, whyisjake, SergeyBiryukov.


Built from https://develop.svn.wordpress.org/trunk@48701


git-svn-id: http://core.svn.wordpress.org/trunk@48463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 17:03:05 +00:00
whyisjake
078db63c4b Upgrade/Install: Pass the plugin file path into the plugin_auto_update_debug_string filter.
Adds better tooling for when user specific plugins can be updated, but platform specific ones cannot.

Fixes #50821.
Props bpayton, pbiron, audrasjb, SergeyBiryukov, whyisjake. 


Built from https://develop.svn.wordpress.org/trunk@48696


git-svn-id: http://core.svn.wordpress.org/trunk@48458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-30 21:50:02 +00:00
Sergey Biryukov
cf137e7c1b Comments: Pass the $which parameter to the manage_comments_nav action.
This brings some consistency with the  `manage_users_extra_tablenav` and `manage_users_extra_tablenav` actions.

Props Tkama, wpgurudev.
Fixes #50736.
Built from https://develop.svn.wordpress.org/trunk@48693


git-svn-id: http://core.svn.wordpress.org/trunk@48455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-30 13:27:04 +00:00
Sergey Biryukov
72b87b3d74 Themes: Pass correct variable to is_php_version_compatible() in wp_theme_update_row().
This applies to the Themes screen in Multisite network admin.

Follow-up to [48660].

Props pbiron, afragen.
Fixes #48507. See #48491.
Built from https://develop.svn.wordpress.org/trunk@48689


git-svn-id: http://core.svn.wordpress.org/trunk@48451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-29 21:08:02 +00:00
whyisjake
e6bfdde581 Upgrade/Install: Only show auto-update for themes that support the feature.
Similar to the changes for plugins in [48669], let's only show the UI for themes when updates are supported for that theme.

See #50280.
Props dd32.

Built from https://develop.svn.wordpress.org/trunk@48688


git-svn-id: http://core.svn.wordpress.org/trunk@48450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-29 20:01:08 +00:00
Sergey Biryukov
d351100eba Upgrade/Install: Pass correct argument to clear_destination in Theme_Upgrader::install().
Follow-up to [48390].

Props afragen, sabernhardt.
Fixes #9757.
Built from https://develop.svn.wordpress.org/trunk@48685


git-svn-id: http://core.svn.wordpress.org/trunk@48447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-29 13:09:04 +00:00
Sergey Biryukov
c5ef3b7976 Media: Pass the $rel parameter to image_send_to_editor filter.
Props mihdan, pputzer.
Fixes #50765.
Built from https://develop.svn.wordpress.org/trunk@48684


git-svn-id: http://core.svn.wordpress.org/trunk@48446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 21:21:05 +00:00
whyisjake
d8fd6d05a3 Upgrade/Install: Swap auto-update-supported to update-supported in update checks.
Ensures backwards compatability with external updaters.

See #50280.
Props everyone-in-the-core-updates-channel. 


Built from https://develop.svn.wordpress.org/trunk@48678


git-svn-id: http://core.svn.wordpress.org/trunk@48440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 18:28:06 +00:00
desrosj
6209a40fd9 Upgrade/Install: Clarify the descriptions for install_(plugin|theme)_overwrite_actions.
See #9757.
Built from https://develop.svn.wordpress.org/trunk@48677


git-svn-id: http://core.svn.wordpress.org/trunk@48439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 18:16:07 +00:00
desrosj
1aa48c68f5 Upgrade/Install: Correct spelling of “overwrite” in new hooks and array indexes.
See #9757.
Built from https://develop.svn.wordpress.org/trunk@48676


git-svn-id: http://core.svn.wordpress.org/trunk@48438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 17:56:04 +00:00
Sergey Biryukov
e4b2ad02b6 Administration: Don't override the $mode global in WP_Screen::render_view_mode() if it's already set.
Follow-up to [48398], [48423], [48424], [48450].

See #49715.
Built from https://develop.svn.wordpress.org/trunk@48670


git-svn-id: http://core.svn.wordpress.org/trunk@48432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 16:55:04 +00:00
whyisjake
0f1f9bdb03 Upgrade/Install: Enhance auto-updates to be disabled for plugins that don't suport updates.
This removes the toggle UI when updates aren't available. When plugins use the filter, the UI is updated to show that they are being controlled via code. And then removed entirely when not available.

See #50798.
Fixes #50280.

Props elrae, pbiron, SergeyBiryukov, audrasjb, azaozz, StephenCronin, whyisjake, dd32, TimothyBlynJacobs, desrosj.


Built from https://develop.svn.wordpress.org/trunk@48669


git-svn-id: http://core.svn.wordpress.org/trunk@48431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 16:32:01 +00:00
Sergey Biryukov
2bf5b5749f Administration: Pull the table_view_mode filter for now.
The extensibility of list table view modes will be explored in a future release.

Props audrasjb.
See #49715.
Built from https://develop.svn.wordpress.org/trunk@48668


git-svn-id: http://core.svn.wordpress.org/trunk@48430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 16:19:03 +00:00
Sergey Biryukov
3db534a988 Upgrade/Install: Disable the plugin/theme auto-updates UI if AUTOMATIC_UPDATER_DISABLED is defined and set as true.
Props pbiron, dd32.
Fixes #50798. See #50280.
Built from https://develop.svn.wordpress.org/trunk@48667


git-svn-id: http://core.svn.wordpress.org/trunk@48429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 16:15:03 +00:00
Sergey Biryukov
4cfc383544 Upgrade/Install: Check WordPress and PHP version requirements when uploading a plugin or theme from ZIP file.
Props mariovalney, desrosj.
See #50593.
Built from https://develop.svn.wordpress.org/trunk@48666


git-svn-id: http://core.svn.wordpress.org/trunk@48428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 16:07:02 +00:00
Sergey Biryukov
0dd2f9f5c5 Docs: Add missing documentation for various upgrade/install class properties and methods.
Props ramiy.
Fixes #42923.
Built from https://develop.svn.wordpress.org/trunk@48661


git-svn-id: http://core.svn.wordpress.org/trunk@48423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 11:57:03 +00:00
Sergey Biryukov
a745f035ab Themes: Display a message on Themes list table if a theme update requires a higher version of PHP or WordPress.
This applies to the Themes screen in Multisite network admin.

Props afragen, SergeyBiryukov.
Fixes #48507. See #48491.
Built from https://develop.svn.wordpress.org/trunk@48660


git-svn-id: http://core.svn.wordpress.org/trunk@48422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 11:34:04 +00:00
Sergey Biryukov
e349d92b53 Themes: Include theme name in available update messages, for better accessibility and consistency with other similar messages.
Follow-up to [48652-48654].

See #48491.
Built from https://develop.svn.wordpress.org/trunk@48659


git-svn-id: http://core.svn.wordpress.org/trunk@48421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 11:31:01 +00:00
Mike Schroder
8c3d56919e Upgrade/Install: Improve wp_opcache_invalidate() performance.
Changes from using `preg_match()` based `.php` extension checking to using `substr()` in `wp_opcache_invalidate()`.

Props jnylen0, aaroncampbell, SergeyBiryukov, desrosj, mikeschroder.
Fixes #50784.
Built from https://develop.svn.wordpress.org/trunk@48657


git-svn-id: http://core.svn.wordpress.org/trunk@48419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 08:09:05 +00:00
whyisjake
26b706e27f Site Health: Incorrect file path in require_once.
Ensure that background updater can be loaded for testing to see if auto-updates can enable automatic updates.

Fixes #50793.
Props dd32.

Built from https://develop.svn.wordpress.org/trunk@48655


git-svn-id: http://core.svn.wordpress.org/trunk@48417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 02:21:06 +00:00
Sergey Biryukov
0122e035b0 Themes: Display a message in theme grid and Theme Details modal if a theme update requires a higher version of PHP or WordPress.
This applies to the Themes screen and the Customizer theme browser.

Props afragen, SergeyBiryukov.
See #48491.
Built from https://develop.svn.wordpress.org/trunk@48652


git-svn-id: http://core.svn.wordpress.org/trunk@48414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-28 00:09:02 +00:00
Sergey Biryukov
1f89186a3d Themes: Display a message in Theme Details modal if a theme requires a higher version of PHP or WordPress.
Props afragen, desrosj, SergeyBiryukov.
See #48491.
Built from https://develop.svn.wordpress.org/trunk@48636


git-svn-id: http://core.svn.wordpress.org/trunk@48398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-27 13:12:04 +00:00
Mike Schroder
9ec7f2febd Docs: Correct wp_opcache_invalidate_file filter docs.
Changes incorrectly named `$filename` variable to `$filepath` and adjusts wording to align with PHP docs.

See #36455.
Built from https://develop.svn.wordpress.org/trunk@48632


git-svn-id: http://core.svn.wordpress.org/trunk@48394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-27 09:08:05 +00:00
Sergey Biryukov
d8c62b5647 Posts, Post Types: Move get_post_states() back to the admin for now, require the file in WP_Customize_Nav_Menus::customize_register() instead.
This provides a minor performance improvement by only running the function in contexts where it's needed.

Follow-up to [47211], [47213], [47763], [48619].

See #46829, #49374.
Built from https://develop.svn.wordpress.org/trunk@48620


git-svn-id: http://core.svn.wordpress.org/trunk@48382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-26 10:51:06 +00:00
Sergey Biryukov
aab535a576 Posts, Post Types: Make get_post_states() available on frontend.
This allows special pages to be denoted as such when editing a menu in the Customizer.

This applies to the Front Page, Posts Page, and Privacy Policy Page.

Follow-up to [47211], [47213], [47763].

Props dlh, whyisjake, SergeyBiryukov.
Fixes #46829. See #49374.
Built from https://develop.svn.wordpress.org/trunk@48619


git-svn-id: http://core.svn.wordpress.org/trunk@48381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-26 01:14:06 +00:00
Sergey Biryukov
609acd89ed I18N: Merge duplicate "List view" and "Grid view" strings.
Props ramiy.
Fixes #50757.
Built from https://develop.svn.wordpress.org/trunk@48618


git-svn-id: http://core.svn.wordpress.org/trunk@48380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-25 21:32:05 +00:00
Sergey Biryukov
c40a645510 Docs: Correct @see references for privacy hooks:
* `wp_privacy_personal_data_export_page`
* `wp_privacy_personal_data_erasure_page`

Hooks should be single-quoted when referenced.

Props pbiron, coffee2code.
See #49572, #meta5318.
Built from https://develop.svn.wordpress.org/trunk@48616


git-svn-id: http://core.svn.wordpress.org/trunk@48378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-25 19:14:03 +00:00
Sergey Biryukov
7d305c8ff9 Docs: Correct @since tags for some WP_List_Table hooks:
* `views_{$this->screen->id}`
* `bulk_actions-{$this->screen->id}`
* `manage_{$this->screen->id}_sortable_columns`

Follow-up to [15491], [15578], [26401].

See #49572.
Built from https://develop.svn.wordpress.org/trunk@48615


git-svn-id: http://core.svn.wordpress.org/trunk@48377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-25 18:55:03 +00:00
Sergey Biryukov
0ef0a1905b Docs: Remove outdated statement in bulk_actions-{$this->screen->id} filter description.
As of WordPress 4.7, developers can register their own bulk actions on list table screens.

Follow-up to [17297], [38647].

Props joyously, pbiron.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48614


git-svn-id: http://core.svn.wordpress.org/trunk@48376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-25 18:13:02 +00:00