Previously, when clicking "Update now" the callbacks were erroneously removed. This prevented opening the filesystem credentials modal for a second time.
Fixes#37285.
git-svn-id: https://develop.svn.wordpress.org/trunk@38019 602fd350-edb4-49c9-b593-d223f7449a82
There is a bug in PHP 5.2.6 - 5.2.17 (https://bugs.php.net/bug.php?id=44936, https://3v4l.org/IL0A2) which changes the access level of a setting to 63 after `ini_set()` was called.
To continue comparing the access value against `INI_ALL` and `INI_USER` use the bit operator `& 7`:
* `1 & 7 === 1` (INI_USER)
* `2 & 7 === 2` (INI_PERDIR)
* `4 & 7 === 4` (INI_SYSTEM)
* `7 & 7 === 7` (INI_ALL)
* `63 & 7 === 7` (INI_ALL)
See [38015].
See #32075.
git-svn-id: https://develop.svn.wordpress.org/trunk@38017 602fd350-edb4-49c9-b593-d223f7449a82
40M isn't enough and can lead to an "out of memory" error. Change `test_wp_raise_memory_limit()` to test that `wp_raise_memory_limit()` doesn't *lower* the memory limit.
See [38015].
See #32075.
git-svn-id: https://develop.svn.wordpress.org/trunk@38016 602fd350-edb4-49c9-b593-d223f7449a82
* Don't lower memory limit if the current limit is greater than `WP_MAX_MEMORY_LIMIT`.
* Set `WP_MEMORY_LIMIT` and `WP_MAX_MEMORY_LIMIT` to current limit if the `memory_limit` setting can't be changed at runtime.
* Use `wp_convert_hr_to_bytes()` when parsing the value of the `memory_limit` setting because it can be a shorthand or an integer value.
* Introduce `wp_raise_memory_limit( $context )` to raise the PHP memory limit for memory intensive processes. This DRYs up some logic and includes the existing `admin_memory_limit` and `image_memory_limit` filters. The function can also be used for custom contexts, the `{$context}_memory_limit` filter allows to customize the limit.
* Introduce `wp_is_ini_value_changeable( $setting )` to determine whether a PHP ini value is changeable at runtime.
* Remove a `function_exists( 'memory_get_usage' )` check. Since PHP 5.2.1 support for memory limit is always enabled.
Related commits: [38011-38013]
Props jrf, A5hleyRich, swissspidy, ocean90.
Fixes#32075.
git-svn-id: https://develop.svn.wordpress.org/trunk@38015 602fd350-edb4-49c9-b593-d223f7449a82
`wp_convert_hr_to_bytes()` was previously defined in wp-includes/media.php because it's only used by `wp_max_upload_size()` in the same file.
Moving this function to load.php allows us to improve core's memory limit handling.
See #32075.
git-svn-id: https://develop.svn.wordpress.org/trunk@38012 602fd350-edb4-49c9-b593-d223f7449a82
Fire `locale_stylesheet` action after the `wp_print_styles` action in the embeds header to match the order in `wp_head`.
Props swissspidy.
Fixes#36839.
git-svn-id: https://develop.svn.wordpress.org/trunk@38010 602fd350-edb4-49c9-b593-d223f7449a82
Fixes bug introduced in [23639] where autosaves are not restored if revisions are disabled.
Props adamsilverstein.
Fixes#36262.
git-svn-id: https://develop.svn.wordpress.org/trunk@38009 602fd350-edb4-49c9-b593-d223f7449a82
Previously, if a user was added with the checkbox for no confirmation selected and an error was then encountered in `wpmu_activate_signup()`, a fatal error would trigger because `$new_user` was a `WP_Error` object rather than a user.
Fixes#37223.
git-svn-id: https://develop.svn.wordpress.org/trunk@38007 602fd350-edb4-49c9-b593-d223f7449a82
This prevents false positives when the ID column's incrementor has exceeded the
hardcoded invalid ID.
Fixes#37308.
git-svn-id: https://develop.svn.wordpress.org/trunk@38005 602fd350-edb4-49c9-b593-d223f7449a82
This prevents a PHP fatal error on the Nav Menus screen where `$args` is an object.
Props elrae.
Fixes#35021.
git-svn-id: https://develop.svn.wordpress.org/trunk@38004 602fd350-edb4-49c9-b593-d223f7449a82
When comment IDs are fetched from the cache rather than the database,
the subsequent `SELECT FOUND_ROWS()` query will not return the correct value.
To avoid unnecessary queries, we cache the results of the `found_comments`
query alongside the comment IDs.
Props spacedmonkey.
Fixes#37184.
git-svn-id: https://develop.svn.wordpress.org/trunk@38001 602fd350-edb4-49c9-b593-d223f7449a82
In doing this, non-core object types are no longer forcibly blocked and are instead checked against `wp_object_type_exists()` which has a filterable return value. Still, filter that at your own risk.
props Faison for the initial patch.
see 35658.
git-svn-id: https://develop.svn.wordpress.org/trunk@37991 602fd350-edb4-49c9-b593-d223f7449a82
The array-compatibility object we started returning in r37428 unfortunately isn't enough like an array. In particular, `is_array()` checks fail, despite the object implementing ArrayAccess. Mea culpa.
This moves the WP_HTTP_Response object to a new http_response key in the array, and changes the value back to an actual array.
Fixes#37097.
See #33055.
git-svn-id: https://develop.svn.wordpress.org/trunk@37989 602fd350-edb4-49c9-b593-d223f7449a82
When enabled, the switch would override the theme's pseudo-plural `'% Comments'` string with a correct form of `_n( '%s Comment', '%s Comments', $number )`.
Historically, `comments_popup_link()` and `get_comments_number_text()` did not support plural forms and used a pseudo-plural style instead, so some locales were forced to come up with workarounds to display the number of comments in their language correctly.
This change should make those functions more i18n-friendly.
Fixes#13651.
git-svn-id: https://develop.svn.wordpress.org/trunk@37987 602fd350-edb4-49c9-b593-d223f7449a82
In `wp_calculate_image_srcset()` we get an array of image sizes
associated with an attachment and then add the original image's
information to the array before processing the `srcset`. In doing
so, we set the original data to a `$image_sizes['full']` key, which
could stomp on any custom image sizes using `full` as a size name.
This avoid the issues by adding the original data without a named
key, which is never referenced anyway.
Props jaspermdegroot.
Fixes#36345.
git-svn-id: https://develop.svn.wordpress.org/trunk@37986 602fd350-edb4-49c9-b593-d223f7449a82
In Firefox on Windows the menus and widgets panel weren't fully visible due to a miscalculation of the width of a panel, caused by a visible scrollbar.
Props wpfo.
Fixes#34622.
git-svn-id: https://develop.svn.wordpress.org/trunk@37984 602fd350-edb4-49c9-b593-d223f7449a82
`arsort()` sorts the paths reverse-alphabetically while preserving the keys. It results in a longer path being listed before a shorter one with the same base directory(ies).
Props jdgrimes, ocean90.
Fixes#28441.
git-svn-id: https://develop.svn.wordpress.org/trunk@37983 602fd350-edb4-49c9-b593-d223f7449a82
Placeholder nav menus (ones that have yet to be saved into the DB) have negative integer IDs.
Fixes#37293.
Props valendesigns, stubgo, westonruter.
git-svn-id: https://develop.svn.wordpress.org/trunk@37981 602fd350-edb4-49c9-b593-d223f7449a82
`wp_plugin_update_rows()` and `wp_theme_update_rows()` are using the site transients `update_plugins` and `update_themes` which are set by `wp_update_plugins()` and `wp_update_themes()`. Both functions are hooked into `load-plugins.php` and `load-themes.php`. Therefore the update rows need to be registered after the transients were populated.
See #13071.
git-svn-id: https://develop.svn.wordpress.org/trunk@37978 602fd350-edb4-49c9-b593-d223f7449a82
This prevents conflicts with third-party messages (e.g. sent by browser extensions). The updates script expects a specific JSON-encoded message and now bails early if it's not valid JSON.
Fixes#37125.
git-svn-id: https://develop.svn.wordpress.org/trunk@37976 602fd350-edb4-49c9-b593-d223f7449a82