Commit Graph

2857 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90)
8df8cf2df1 Pinking shears.
See #41057.

git-svn-id: https://develop.svn.wordpress.org/trunk@42843 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-18 14:22:09 +00:00
Joe McGill
9f9ff6afed Update unit test following r42839.
This updates the expected version number for Hello Dolly in `Tests_Ajax_Update_Plugin::test_update_plugin` following [42839].

See #43555.


git-svn-id: https://develop.svn.wordpress.org/trunk@42841 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-17 20:57:00 +00:00
Joe McGill
860b45216e Revert max-width styles on caption shortcodes.
This is a partial revert of [41724], so image captions include an
inline `width` style instead of `max-width`.

This returns the caption shortcode to the pre-4.9.0 behavior, while
retaining the extra unit test coverage added in [41724].

Fixes #43123. See #33981.


git-svn-id: https://develop.svn.wordpress.org/trunk@42837 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-16 20:06:41 +00:00
Felix Arntz
8e4bd924d2 Multisite: Introduce metadata for sites.
A new global multisite table `wp_blogmeta` is added to the database schema, and a set of `*_site_meta()` API functions are introduced.

The implementation fails gracefully when the new table is not yet available, which may happen especially shortly after the core update, before the network has been upgraded to the new database schema. The presence of the table is detected once and stored as a global setting on the main network.

Core does not yet use site metadata, but there are several use-cases to be implemented or explored in the near future, and it allows plugins to extend sites with arbitrary data, which will come in particularly handy with the upcoming REST API endpoint for sites.

Props spacedmonkey, johnjamesjacoby, jeremyfelt, flixos90.
Fixes #37923.


git-svn-id: https://develop.svn.wordpress.org/trunk@42836 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-16 02:14:04 +00:00
Felix Arntz
a7b3f5f759 Multisite: Add missing group annotations to tests included in [42833].
This ensures tests are skipped correctly when not using multisite.

See #43506.


git-svn-id: https://develop.svn.wordpress.org/trunk@42834 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-13 17:56:05 +00:00
Felix Arntz
52a77e5254 Multisite: Ensure the {$network_id}:notoptions array is set in cache in get_network_option().
Prior to this change, the `{$network_id}:notoptions` cache would only be fetched, but not set, unless the actual database lookup would be unsuccessful. This enhancement slightly improves performance by preventing unnecessary external object cache lookups if one is used.

Fixes #43506.


git-svn-id: https://develop.svn.wordpress.org/trunk@42833 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-13 15:36:14 +00:00
Felix Arntz
5f56921131 General: Introduce dashboard widget to inform administrators about outdated PHP versions.
This new dashboard widget is shown on WordPress sites which are powered by a PHP version which WordPress considers outdated, in order to inform site owners about the resulting problems and to explain how to upgrade to a supported version. An education page for that purpose has been previously created that the widget links to. The link is translatable so that localized versions of the page can be referred to as they become available.

The nag follows the example of the Browse Happy dashboard widget and is only visible for administrators, or network administrators when using multisite. To determine whether it needs to be displayed, a new wordpress.org API introduced prior is called that handles the version logic in a centralized location.

Props flixos90, hedgefield, schlessera.
Fixes #41191.


git-svn-id: https://develop.svn.wordpress.org/trunk@42832 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-12 16:42:11 +00:00
Sergey Biryukov
1e54b5a2ae Link Template: Apply get_{$adjacent}_post_excluded_terms filter to an empty excluded_terms parameter as well.
Props soulseekah, zottto.
Fixes #43521.

git-svn-id: https://develop.svn.wordpress.org/trunk@42828 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-11 17:31:04 +00:00
Sergey Biryukov
9b713c6d12 Tests: Skip symlinked theme file tests if symlink() is not available, e.g. in PHP 5.2.x on Windows.
See #43508.

git-svn-id: https://develop.svn.wordpress.org/trunk@42819 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-09 17:47:39 +00:00
John Blackbourn
5816caddcf Themes: Revert [42788] as it breaks a lot of things.
See #43228


git-svn-id: https://develop.svn.wordpress.org/trunk@42816 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-09 16:59:57 +00:00
Sergey Biryukov
94e44cd9ed Tests: Skip symlinked theme file tests if the links could not be created.
Fixes #43508.

git-svn-id: https://develop.svn.wordpress.org/trunk@42812 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-09 01:09:17 +00:00
Sergey Biryukov
257048ac71 Tests: Correct assertion in Tests_WP_Customize_Setting::test_constructor_with_args().
Props jipmoors.
See #30988, #43218.

git-svn-id: https://develop.svn.wordpress.org/trunk@42799 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-08 16:37:59 +00:00
Mike Schroder
3a46cba430 Media: Correctly allow changing PDF thumbnail crop value.
Corrects logic that keeping plugins from setting crop value of intermediate image sizes for rendered PDFs.

Adds test.

Props leemon, SergeyBiryukov, chetan200891, birgire.
Fixes #43226.

git-svn-id: https://develop.svn.wordpress.org/trunk@42792 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-07 01:18:08 +00:00
John Blackbourn
d83f786d3c Themes: Ensure the theme roots cache is cleared when registering a theme directory.
Props soulseekah, johnbillion

Fixes #43228


git-svn-id: https://develop.svn.wordpress.org/trunk@42788 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 22:13:36 +00:00
Sergey Biryukov
007a7caad4 Media: Recognize .ico files as displayable images on PHP 5.3+ and allow attachment meta data to be generated for them.
Props remyvv, Guido07111975.
Fixes #43458.

git-svn-id: https://develop.svn.wordpress.org/trunk@42780 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-05 01:02:20 +00:00
Sergey Biryukov
4edda96383 Filesystem API: Allow download_url() to return the response code and body on error as an additional WP_Error object data.
The error response body size is limited to 1 KB by default to avoid taking up too much memory. The size can be increased using `download_url_error_max_body_size` filter.

Props soulseekah, campusboy1987, mihdan, SergeyBiryukov.
Fixes #43329.

git-svn-id: https://develop.svn.wordpress.org/trunk@42773 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-04 17:13:35 +00:00
Andrew Ozz
6d094f61bb Add pre-save content filter to make target=_blank always secure.
Props notnownikki, iseulde, azaozz
Fixes #43187

git-svn-id: https://develop.svn.wordpress.org/trunk@42770 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-02 14:41:04 +00:00
Boone Gorges
e840759df5 Allow LIKE queries against the 'key' value in meta queries.
The new `compare_key=LIKE` parameter works in conjunction with `key` in a
similar way to the `compare=LIKE` and `value`: by doing a "compares" `LIKE`
query. This allows developers to do partial matches against keys when
doing meta queries.

Props mariovalney, chasewg.
Fixes #42409.

git-svn-id: https://develop.svn.wordpress.org/trunk@42768 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-01 04:02:41 +00:00
Ian Dunn
c896326c55 External Libraries: Test for MEjs files in src instead of build.
The `build` task doesn't get run during TravisCI jobs, so the `build` folder doesn't exist in that context. Because of that, the test added in r42762 was failling.

Checking for the files in `src` instead achieves the same goal as that commit, but should pass in Travis.

See #43101
See https://wordpress.slack.com/archives/C02RQBWTW/p1519742993000615


git-svn-id: https://develop.svn.wordpress.org/trunk@42763 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-28 00:25:08 +00:00
Ian Dunn
fde455a89f External Libraries: Test that MediaElement SWF files remain deleted.
The files were removed from Core in r42462 because they're no longer necessary, and have a history of security issues. They remain upstream, though, so this test makes it explicitly clear that they should not be added back in the future without careful consideration and discussion with the Security team.

`Tests_Admin_IncludesUpdateCore::test_new_files_are_not_in_old_files_array_compiled()` would already catch files with the exact same name, but this test will also catch files with new names, just to be extra cautious.

Props iandunn, ocean90, SergeyBiryukov
Fixes 43101


git-svn-id: https://develop.svn.wordpress.org/trunk@42762 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-27 14:37:15 +00:00
Sergey Biryukov
1cc516f2e8 General: Introduce WP_Error::has_errors() method and use it where appropriate.
Props robdxw, DrewAPicture, SergeyBiryukov.
Fixes #42742.

git-svn-id: https://develop.svn.wordpress.org/trunk@42761 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-27 02:30:46 +00:00
Sergey Biryukov
c95b962b77 Tests: Correct a "false positive" assertion in test_media_handle_upload_ignores_page_parent_for_directory_date().
Props birgire.
Fixes #42736.

git-svn-id: https://develop.svn.wordpress.org/trunk@42743 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 18:46:44 +00:00
Sergey Biryukov
557103ede6 Tests: Avoid hardcoded domain name in test_media_handle_upload_uses_post_parent_for_directory_date().
Props birgire.
See #42736.

git-svn-id: https://develop.svn.wordpress.org/trunk@42742 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 18:42:26 +00:00
Adam Silverstein
d8a4215abb Unit Tests: add a DIR_TESTROOT constant to avoid relative paths.
Fix an issue that prevents tests from running correctly when run outside their normal context.

Props PressLabs, johnbillion.
Fixes #40071.



git-svn-id: https://develop.svn.wordpress.org/trunk@42741 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 18:06:49 +00:00
Adam Silverstein
74ccb68c56 Taxonomy: restore TagSearch unit tests and correct deprecated version string.
Reverts unit test removal, instead changing them to expect the function to be deprecated.
Correct the version the ajax callback was deprecated.

Amends [42614].

Props dlh, ocean90.
Fixes #38922.



git-svn-id: https://develop.svn.wordpress.org/trunk@42737 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-25 16:27:57 +00:00
Sergey Biryukov
3f4fe54b43 Menus: When checking if a Custom Link matches the current URL to add the current-menu-item class, check for decoded URL as well.
Props soulseekah, campusboy1987.
Fixes #43401.

git-svn-id: https://develop.svn.wordpress.org/trunk@42732 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-24 13:43:07 +00:00
Gary Pendergast
1e3781cd71 REST API: Show taxonomy visibility settings.
For Gutenberg and other admin-type interfaces, it's useful to be able to see the visibility settings for taxonomies.

Props joehoyle, pento.
Fixes #42707.



git-svn-id: https://develop.svn.wordpress.org/trunk@42729 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-22 00:24:00 +00:00
Aaron Jorbin
53a61339e4 Community Events Dashboard: Always show a WordCamp if one is coming up
WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.

Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Fixes #41112.



git-svn-id: https://develop.svn.wordpress.org/trunk@42726 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 23:00:50 +00:00
Sergey Biryukov
9e31509293 Tests: Replace use of $this->server with rest_get_server() for better memory recycling.
Props danielbachhuber.
Fixes #41641.

git-svn-id: https://develop.svn.wordpress.org/trunk@42724 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-21 16:24:30 +00:00
Sergey Biryukov
0711e585fb Media: After [42693], update HTML4 markup in img_caption_shortcode() to avoid an empty ID attribute as well.
Add a unit test for `aria-describedby` in `img_caption_shortcode()`.

See #34595.

git-svn-id: https://develop.svn.wordpress.org/trunk@42694 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-11 15:39:20 +00:00
Helen Hou-Sandi
05b37069a4 Options: Use strings in the test suite that follow community guidelines.
Also somewhat explain to future maintainers why this pairing of strings was chosen, besides this committer's musical preferences. Social opinions on cancer are fairly clear, as are commonly accepted definitions of profanity and family-friendly language.

Shout out to the close contender, which would have been particularly appropriate here: "You could be the king // But watch the queen conquer".

see #43207, #38176


git-svn-id: https://develop.svn.wordpress.org/trunk@42667 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-07 22:41:48 +00:00
Aaron Jorbin
2c6f1b18f4 Options: Use most appropriate language in the test suite.
The test suite's opinion of cancer should be clear.

Reverts r42659.

See #43207, #38176




git-svn-id: https://develop.svn.wordpress.org/trunk@42663 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-07 20:58:21 +00:00
John Blackbourn
9b46512501 Options: Use more appropriate language in the test suite.
See #43207, #38176


git-svn-id: https://develop.svn.wordpress.org/trunk@42659 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-07 18:51:55 +00:00
Felix Arntz
ea13c56d7f Options: Unhook default option filter when setting is unregistered.
Fixes #43207.


git-svn-id: https://develop.svn.wordpress.org/trunk@42655 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-06 14:48:46 +00:00
John Blackbourn
d512973c84 Canonical: Add $x_redirect_by parameter to wp_safe_redirect().
See [42633] and [42408].

Fixes #42313.


git-svn-id: https://develop.svn.wordpress.org/trunk@42647 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-04 16:04:10 +00:00
Drew Jaynes
311531a964 Tests: Simplify @covers annotations for WP_Error test coverage. Also fix a typo in a test method name.
See #42742.


git-svn-id: https://develop.svn.wordpress.org/trunk@42646 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-03 17:37:51 +00:00
Drew Jaynes
86d486d67d Tests: Fix two typos introduced for a get_term_field() test in [35270].
See #33968.


git-svn-id: https://develop.svn.wordpress.org/trunk@42645 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-03 17:10:51 +00:00
Sergey Biryukov
59e1b7318d Tests: Correct erroneous @covers and @use tags.
Props jipmoors.
Fixes #43203.

git-svn-id: https://develop.svn.wordpress.org/trunk@42636 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 16:08:04 +00:00
Sergey Biryukov
07bff5d8bd Tests: Improve tests for wp_get_post_parent_id() added in [42397].
Props frank-klein.
Fixes #42797.

git-svn-id: https://develop.svn.wordpress.org/trunk@42635 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 16:02:26 +00:00
Sergey Biryukov
40f76ae917 Canonical: Add $x_redirect_by parameter to wp_redirect() that allows applications doing the redirect to identify themselves.
This complements the `x_redirect_by` filter added in [42408].

Props NathanAtmoz, johnbillion.
Fixes #42313.

git-svn-id: https://develop.svn.wordpress.org/trunk@42633 602fd350-edb4-49c9-b593-d223f7449a82
2018-02-01 15:05:50 +00:00
Adam Silverstein
1c4f57f425 Remove unit tests for deprecated ajax tag search function.
Fixes unit tests failing since r42614.

Ammends [42614].
See #38922.


git-svn-id: https://develop.svn.wordpress.org/trunk@42619 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 02:28:14 +00:00
Weston Ruter
bba8d65216 Widgets: Fix Text widget unit test which broke due to global scope not being cleaned.
Amends [42613].
See #42495.


git-svn-id: https://develop.svn.wordpress.org/trunk@42617 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 00:33:03 +00:00
Weston Ruter
0e818c7aee Customize: Ensure customize_autosaved requests only use revision of logged-in user.
Props dlh, westonruter.
See #42433, #39896.
Fixes #42450.


git-svn-id: https://develop.svn.wordpress.org/trunk@42615 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 00:20:37 +00:00
Weston Ruter
07e4b7565e Customize: Ensure media playlists get initialized after selective refresh; expose new wp.playlist.initialize() API.
In particular allows audio and video playlists to be added to the Text widget and previewed.

Props bpayton, westonruter.
See #40854.
Fixes #42495.


git-svn-id: https://develop.svn.wordpress.org/trunk@42613 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-29 23:55:44 +00:00
Weston Ruter
b31563e561 Customize: Include nav menu item for Home custom link in search results for "Home".
Props audrasjb, westonruter.
Fixes #42991.


git-svn-id: https://develop.svn.wordpress.org/trunk@42611 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-29 22:09:55 +00:00
Aaron Jorbin
47f6031fbd Query: Improve tests for set_found_posts dealing with non arrays
Use a data provider and include tests for `false` and `''`.

Previous: [42581] [42585]

See #42860



git-svn-id: https://develop.svn.wordpress.org/trunk@42594 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 20:51:06 +00:00
Sergey Biryukov
dd9122b011 Tests: Update emoji base URL in Tests_Formatting_Emoji after [42590].
See #42862.

git-svn-id: https://develop.svn.wordpress.org/trunk@42592 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 17:25:03 +00:00
Gary Pendergast
33a3d61b22 Tests: Improve the old date redirect tests.
Props frank-klein.
See #15397.



git-svn-id: https://develop.svn.wordpress.org/trunk@42587 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 06:38:58 +00:00
Dion Hulse
f35ed94605 Tests: Skip newly added tests from [42581] on PHP 5.2 as they require ReflectionMethod.
See #42860.


git-svn-id: https://develop.svn.wordpress.org/trunk@42585 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 04:20:26 +00:00
Aaron Jorbin
818a0f1ccf Query: Fix warning on counting non countable
Adds tests to continue the behavior for both null and strings.

See https://wiki.php.net/rfc/counting_non_countables for information on the PHP change.

Fixes #42860.
Props janak007 and ayeshrajans for initial patches.





git-svn-id: https://develop.svn.wordpress.org/trunk@42581 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 01:20:24 +00:00