Commit Graph

40040 Commits

Author SHA1 Message Date
Gary Pendergast 6acb0c6402 Coding Standards: Fix all `WordPress.WhiteSpace.PrecisionAlignment` issues.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45602 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 05:20:52 +00:00
Gary Pendergast 027c9dae90 Coding Standards: Fix all `WordPress.CodeAnalysis.AssignmentInCondition` issues.
`WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition` can be ignored, as this is allowed in Core.

See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45601 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 03:13:31 +00:00
Gary Pendergast e6b7205a8f Coding Standards: Upgrade WPCS to 2.1.1.
Noteable changes:
- WPCS now throws warnings when non-strict comparisons are used. There are quite a few of them in Core. 🙃
- WPCS now detects and warns for assignments in loop conditions.

See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45600 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 02:49:53 +00:00
Gary Pendergast 6b61c34ded Coding Standards: Mark the handful of hook names with uppercase characters or hyphens as ignored.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45599 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-05 01:44:41 +00:00
Sergey Biryukov 93be654dbd Text Changes: Use consistent question wording in database connection error messages.
Props Presskopp.
See #44878.

git-svn-id: https://develop.svn.wordpress.org/trunk@45598 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 10:57:03 +00:00
Sergey Biryukov e083a928fc Text Changes: Use consistent question wording for plugin and theme deletion confirmations.
Props johnjamesjacoby, Presskopp.
Fixes #44878.

git-svn-id: https://develop.svn.wordpress.org/trunk@45597 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 09:55:13 +00:00
Sergey Biryukov fdc5010ba3 Twenty Nineteen: Fix markup errors in `twentynineteen_add_ellipses_to_nav()`:
* Add missing i18n for `aria-label` attribute.
* Remove redundant screen reader text superseded by `aria-label`.
* Remove unnecessary `id` and `class` attributes.

Props afercia, chetan200891, ianbelanger.
Fixes #47067.

git-svn-id: https://develop.svn.wordpress.org/trunk@45596 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 09:22:17 +00:00
Sergey Biryukov 2aeab4216e Twenty Nineteen: Adjust markup in `twentynineteen_add_ellipses_to_nav()` for better readability.
See #47067.

git-svn-id: https://develop.svn.wordpress.org/trunk@45595 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 09:14:08 +00:00
Sergey Biryukov 5fea17ba03 Twenty Nineteen: Update `package.json` with the latest package versions to pass `npm audit`.
Props netweb.
Fixes #47631.

git-svn-id: https://develop.svn.wordpress.org/trunk@45594 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 00:37:48 +00:00
Sergey Biryukov f56c63a5d2 Script Loader: Remove unnecessary `jquery` dependency for `wp-sanitize.js`.
The file is written in plain JavaScript.

Props sstoqnov.
Fixes #47324.

git-svn-id: https://develop.svn.wordpress.org/trunk@45593 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 00:32:40 +00:00
Sergey Biryukov 68a41a5eae Bundled Themes: Remove extra semicolons from CSS files.
Props shashank3105, ianbelanger.
Fixes #47178.

git-svn-id: https://develop.svn.wordpress.org/trunk@45592 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-04 00:26:21 +00:00
Sergey Biryukov b2ad702410 Query: Make sure `$climits` variable in `WP_Query::get_posts()` is always defined to avoid a PHP notice.
Props juiiee8487, agengineering.
Fixes #47638.

git-svn-id: https://develop.svn.wordpress.org/trunk@45591 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-03 01:13:21 +00:00
Gary Pendergast 4503f93961 Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-includes`.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45590 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 23:41:16 +00:00
Gary Pendergast a00c69458b Formatting: Revert the changes to `wpautop()` in [45585,45587].
See #27350.


git-svn-id: https://develop.svn.wordpress.org/trunk@45589 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 11:21:53 +00:00
Gary Pendergast fe28df65e3 Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `tests`.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45588 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 04:43:01 +00:00
Gary Pendergast 969c17d82d Formatting: Improve performance of `wpautop()` on large paragraphs.
Following [45585], older versions of PHP could segfault when attempting to autop paragraphs with 10,000+ characters.

Rather than having to negative lookahead for every character in the paragraph (which could run into recursion limits), we can quickly jump ahead to the next tag and start checking from there.

See #27350.



git-svn-id: https://develop.svn.wordpress.org/trunk@45587 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 03:28:03 +00:00
Gary Pendergast 008630e97a Docs: Update some function docs and signatures.
- Update the `_wp_specialchars()` docs to match the function signature.
- Update the `human_time_diff()` function signature to match the docs.

Props subrataemfluence.
Fixes #46845.



git-svn-id: https://develop.svn.wordpress.org/trunk@45586 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 01:44:06 +00:00
Gary Pendergast 8298f9dad0 Clean up stray `<p>` tags added by `wpautop()` inside block level tags.
`autop()` can sometimes get confused and not clean up stray `<p>` or `</p>` tags inside block level elements, which produces sub-optimal HTML. While browsers can generally handle it, there's no need to make things harder for them if we don't have to.

Props pento, ayubi, pbearne, jond, azaozz, 1994rstefan, dionysous, MikeHansenMe, jorbin, miqrogroove, niallkennedy.
Fixes #27350.




git-svn-id: https://develop.svn.wordpress.org/trunk@45585 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-02 01:30:15 +00:00
Adam Silverstein b97899a07f Taxonomy: add a new 'terms_pre_query' filter to short circuit WP_Term_Query 'get_terms' queries.
Add a new `terms_pre_query` filter which returns null by default. Return a non-null value to bypass WordPress's default `get_terms` queries.

Props jarocks, boonebgorges, spacedmonkey.
Fixes #41246.



git-svn-id: https://develop.svn.wordpress.org/trunk@45584 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 20:47:21 +00:00
Gary Pendergast 9a1549767e Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-admin`.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45583 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 12:50:14 +00:00
Gary Pendergast 5fe76184f2 Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in the base directory.
See #47632.



git-svn-id: https://develop.svn.wordpress.org/trunk@45582 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:26:25 +00:00
Gary Pendergast 99e5c1e9ed Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in the default themes.
See #47632



git-svn-id: https://develop.svn.wordpress.org/trunk@45581 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:22:31 +00:00
Gary Pendergast ef5a9dfda6 Coding Standards: Fix/ignore the `WordPress.NamingConventions.ValidFunctionName` violations.
See #47632



git-svn-id: https://develop.svn.wordpress.org/trunk@45580 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 08:00:12 +00:00
Gary Pendergast d2c4198623 Multisite: Use `size_format()` in `display_space_usage()`.
Deleted code is the best code.

Fixes #28239.



git-svn-id: https://develop.svn.wordpress.org/trunk@45579 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:46:30 +00:00
Gary Pendergast 78e096fe98 Formatting: Trim leading whitespace in `esc_url()`.
Props toszcze.
Fixes #36369.



git-svn-id: https://develop.svn.wordpress.org/trunk@45578 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:28:21 +00:00
Gary Pendergast 77f9bf0aeb Formatting: Don't add `<p>` tags inside `<svg>` tags.
Inline `<svg>`s should generally work, as browsers should just ignore `<p>` or `<br/>` tags that shouldn't be inside the `<svg>`. To keep things neat, however, it's better not add them in the first place.

Props jared_smith, nacin, pento.
Fixes #9437.



git-svn-id: https://develop.svn.wordpress.org/trunk@45577 602fd350-edb4-49c9-b593-d223f7449a82
2019-07-01 03:18:28 +00:00
Sergey Biryukov b87bdbe9ba Twenty Seventeen: Correct the CSS selectors intended to fix hover colors for MediaElement controls.
This is a follow-up to the previous fix in [45146], which didn't work as expected.

Props ryokuhi.
Fixes #47543. See #40843.

git-svn-id: https://develop.svn.wordpress.org/trunk@45576 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-29 00:50:55 +00:00
Riad Benguella ed1233d05f Build/Test Tools: Fix the hello e2e test assertion.
The previous assertion was always valid because we assumed it returned a single object,
while in reality it was returning an array.

Props hideokamoto.
Fixes #47622.


git-svn-id: https://develop.svn.wordpress.org/trunk@45575 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-28 11:33:13 +00:00
Gary Pendergast 77764a5754 Formatting: Add correct `<p>` tags near `<hr>` tags.
It can be tricky to know when `wpautop()` should add `<p>` tags, but one thing we can be certain about is that they really shouldn't be anywhere near `<hr>` tags.

Now they aren't.

Props solarissmoke, MattyRob, pento.
Fixes #14674.



git-svn-id: https://develop.svn.wordpress.org/trunk@45574 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-28 07:15:31 +00:00
Gary Pendergast b9cd66f483 Formatting: Add support for seconds to `human_time_diff()`.
The web has gotten so much faster since `human_time_diff()` was created, we need to be able to measure time differences with much finer granularity. Now, we can.

Props johnjamesjacoby, pento.
Fixes #35655.



git-svn-id: https://develop.svn.wordpress.org/trunk@45573 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-28 06:43:27 +00:00
Andrea Fercia 66d9c7e491 Accessibility: Make the Media modal an ARIA modal dialog.
For a number of years, the Media modal missed an explicit ARIA role and the required attributes for modal dialogs.

This was confusing for assistive technology users, since they may not realize they're inside a dialog, and that consequently the keyboard interactions may be different from the rest of the page. Lack of an explicit label for the dialog was confusing as well, since assistive technology users didn't have an immediate sense of what the dialog is for.

This change makes the Media modal meet the ARIA Authoring Practices recommendations, helping users better understand the purpose and interactions with the modal. Also, it makes sure to hide the rest of the page content from assistive technologies, until support for `aria-modal="true"` improves.

Additionally:
- moves the modal H1 heading to the beginning of the modal content 
- changes the modal left menu position to make visual and DOM order match 
- improves the `wp.media.view.FocusManager` documentation

Fixes #47145.


git-svn-id: https://develop.svn.wordpress.org/trunk@45572 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 12:32:28 +00:00
Riad Benguella f8228d3116 Build/Test Tools: Make the local env scripts executable.
See #45165.


git-svn-id: https://develop.svn.wordpress.org/trunk@45571 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 12:05:44 +00:00
Riad Benguella 42a8715471 Build/Test Tools: Add the e2e tests setup.
- Adds a local environment based on docker
 - Adds the e2e tests setup
 - Adds a "Hello World" e2e test to serve as a template

Props gziolo, herregroen, mcsf.
Fixes #45165.


git-svn-id: https://develop.svn.wordpress.org/trunk@45570 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 11:26:58 +00:00
Gary Pendergast 3202f9f37e Formatting: Don't convert smilies in ignored tags that have attributes.
Smilies in ignored tags are not supposed to be converted to emoji, but this can malfunction if the tag has attributes. For example, the Preformatted block with add a `class` to the `<pre>` tag.

Props pento, jikamens.
Fixes #47489.



git-svn-id: https://develop.svn.wordpress.org/trunk@45569 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 02:04:17 +00:00
Sergey Biryukov 4512e94f9c Users: Pass `$length`, `$special_chars`, and `$extra_special_chars` parameters to the `random_password` filter in `wp_generate_password()`.
Props roytanck.
Fixes #47092.

git-svn-id: https://develop.svn.wordpress.org/trunk@45568 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-27 00:47:41 +00:00
Sergey Biryukov 115c496a9a Docs: Correct `@since` for `admin/edit-comments.js`, introduced in [3736].
See #47581.

git-svn-id: https://develop.svn.wordpress.org/trunk@45567 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-26 18:18:21 +00:00
Sergey Biryukov 5118e5e266 REST API: Call `WP_REST_Server::get_compact_response_links()` and `::get_raw_data()` static methods the right way.
Props andizer, TimothyBlynJacobs.
Fixes #47578.

git-svn-id: https://develop.svn.wordpress.org/trunk@45566 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-26 18:06:32 +00:00
John Blackbourn fc10b6bbcd Docs: Correct and improve the docs for a few nonce-related functions.
See #47110


git-svn-id: https://develop.svn.wordpress.org/trunk@45565 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 17:06:57 +00:00
Andrew Ozz ec44c57afa Editor: Fix undefined `$locked` var in edit-form-blocks.php when the `show_post_locked_dialog` filter is used to disable displaying of the dialog.
Props aprea.
Fixes #47604.

git-svn-id: https://develop.svn.wordpress.org/trunk@45564 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 15:02:34 +00:00
Andrea Fercia 725c77a13d Plugins: Fix the plugin details modal layout after [45520].
Props mukesh27, marybaum, audrasjb.
Fixes #47561.


git-svn-id: https://develop.svn.wordpress.org/trunk@45563 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-25 14:10:29 +00:00
Peter Wilson 6ee8a99b6a Cron: Fix condition reversed in [45559].
In [45559] a test for not-falsey was reversed to a falsey check.

Props obenland.
Fixes #47589.


git-svn-id: https://develop.svn.wordpress.org/trunk@45562 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 13:42:58 +00:00
Anton Timmermans 3099359887 Docs: Improve JSDoc for `media/views/attachment/details.js`.
Props maartenleenders, boblinthorst, dfangstrom.
Fixes #47588.


git-svn-id: https://develop.svn.wordpress.org/trunk@45561 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 13:01:22 +00:00
Peter Wilson 183b4b6212 Cron API: Prevent caching of WP Cron requests.
Add `Cache-Control` and `Expires` HTTP headers to prevent caching of requests to WP Cron on systems supporting fastcgi_finish_request(). 

The fastcgi_finish_request() call prevents the setting of further HTTP headers by caching plugins subsequently loaded.

Props kingkero.
Fixes 47396.



git-svn-id: https://develop.svn.wordpress.org/trunk@45560 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 11:12:58 +00:00
Peter Wilson e37aff4320 Code is Poetry: CS Fixes required in wp-cron.php.
See #47396, #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@45559 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-22 11:11:26 +00:00
Anton Timmermans a912ef9642 Docs: Improve JSDoc for `admin/edit-comments.js`.
Props manuelaugustin, diedeexterkate, thulshof, Xyfi, ireneyoast.
Fixes #47581.


git-svn-id: https://develop.svn.wordpress.org/trunk@45558 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 14:44:30 +00:00
Adam Silverstein 0dc3295e29 Themes: improve search by trimming search string.
Fix an issue where searching installed themes for an empty string resulted in matching all themes.

Props afercia, desrosj, hesyifei, evalarumbe.
Fixes #39041.


git-svn-id: https://develop.svn.wordpress.org/trunk@45557 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 14:14:59 +00:00
Sergey Biryukov e9fc71bbbe Date/Time: Eliminate use of `date_default_timezone_set()` for determining DST status on General Options screen.
Time calculations should not need to rely on manipulating global PHP configuration state.

Props Rarst.
Fixes #46483.

git-svn-id: https://develop.svn.wordpress.org/trunk@45556 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 14:10:44 +00:00
Sergey Biryukov e283457e45 Date/Time: Add more supported formats to `wp_maybe_decline_date()`.
Props SergeyBiryukov, Rarst.
Fixes #37411.

git-svn-id: https://develop.svn.wordpress.org/trunk@45555 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 13:46:20 +00:00
Jonathan Desrosiers 97b90a454c XML-RPC: Merge similar translation strings.
Props ramiy.
Fixes #47039.

git-svn-id: https://develop.svn.wordpress.org/trunk@45554 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 12:52:52 +00:00
Anton Timmermans 7a9af3a4ed Comments: Open comment quick edit on double click.
In [42767] the quick edit button changed from a link to a button. This caused the jQuery code that selects on a link to no longer work. This commit restores the previous behavior.

Fixes #47572.
See #43382, #38677.


git-svn-id: https://develop.svn.wordpress.org/trunk@45553 602fd350-edb4-49c9-b593-d223f7449a82
2019-06-20 10:05:03 +00:00