Commit Graph

35136 Commits

Author SHA1 Message Date
Scott Taylor
02319efa71 Unit Tests:
* Automatically delete objects that we were created during `wpSetUpBeforeClass` - posts, comments, terms (except 1), and user (except 1)
* The amount of leftover data between tests was breathtaking - use the new function: `_delete_all_data()`
* Commit database transactions for all `TestCase`s, not just those that implement `wpSetUpBeforeClass` and `wpTearDownAfterClass`
* The tests run 10-20 seconds faster now

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38398 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 08:35:16 +00:00
Scott Taylor
f0af25bd80 Press This: the file for the WP_Press_This class should not produce side effects. Similar to what we did in r38355 for WP_Site_Icon, drop the instances of global instantiation for $wp_press_this via loading the file. The variable can be set inline when necessary. In most of those places, if the global is already set, the file does not load and stomp it currently.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38397 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 06:06:50 +00:00
Weston Ruter
a8b98b7924 Customize: Circumvent the customizer attempting to preview links to static assets (such as uploaded images).
The customizer's preview POST requests to static assets result in 405 Method Not Allowed responses.

Fixes #37828.


git-svn-id: https://develop.svn.wordpress.org/trunk@38396 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 06:04:42 +00:00
Scott Taylor
5d4485b184 Bootstrap: exclude more files from the autoloader.classmap in composer.json.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38395 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 05:39:31 +00:00
Scott Taylor
0da2aa2434 Bootstrap: add composer.lock and src/wp-vendor files. Nothing is using this code yet, just going through the motions. Ignore the files in src/wp-vendor/composer that will explode in PHP 5.2.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38394 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 03:48:08 +00:00
Scott Taylor
1c52ad1196 Bootstrap: run composer require xrstf/composer-php52 to get the updated suggested version. Change the vendor-dir to wp-vendor.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38393 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-27 03:35:35 +00:00
Scott Taylor
c6731b76ac List Tables: move _WP_List_Table_Compat into its own file.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38392 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 22:22:58 +00:00
Scott Taylor
07fe41b23d Bootstrap: exclude some files from the Composer autoload setup via exclude-from-classmap.
See #36335.



git-svn-id: https://develop.svn.wordpress.org/trunk@38391 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 22:21:00 +00:00
johnbillion
8139765b1f Themes: Begin introducing unit tests for the expected theme template hierarchy. More to come.
See #14310


git-svn-id: https://develop.svn.wordpress.org/trunk@38390 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 22:19:16 +00:00
Scott Taylor
0ff32a41b0 XML-RPC: break up class-IXR.php into individual class files.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38389 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 22:07:14 +00:00
Scott Taylor
55f5577813 Multisite: move get_current_site() to load.php so that it can be used in more places, instead of importing global $current_site.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38388 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 21:34:36 +00:00
Scott Taylor
aa2fcba472 Roles: set a property, $db, on WP_Roles to reduce global imports.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38387 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 21:15:22 +00:00
Scott Taylor
3586ac294f Bootstrap: load option.php in wp-settings.php, not in functions.php.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38386 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 21:10:30 +00:00
John Blackbourn
9df1424d88 Themes: Make the template hierarchy for a given template type filterable.
This introduces a `{$type}_template_hierarchy` filter that allows the hierarchy of candidate template filenames for a given template type to be filtered.

This allows the hierarchy to be added to or altered completely without resorting to re-building the hierarchy from scratch within the `template_include` filter, which is common and prone to conflicts between plugins and prone to getting out of sync with core's hierarchy.

Fixes #14310


git-svn-id: https://develop.svn.wordpress.org/trunk@38385 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 21:02:08 +00:00
Scott Taylor
39a145e0e1 Bootstrap: add a composer.json file to the project. No code relies on it (yet), and no vendor dir is checked in (yet). No autoloader is being used (yet). Taking this first step will hopefully encourage the perfectionists of our world to scrutinize each line.
To fiddle around with what it does, run `composer install` from the project root. If you do not have Composer installed:
https://getcomposer.org/doc/00-intro.md#locally

tl;dr for Mac/Homebrew users: `brew install composer`

Classes from `wp-includes` and `wp-admin` are eligible for autoloading via `autoload.classmap`. Through a tornado of recent commits, many unsuitable files have been transitioned into a more acceptable state for autoloading: 1 file per class, no side effects.

The file bootstrap in `wp-settings.php` can transition into `autoload.files`. This will be done with care and attention.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38384 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 20:59:54 +00:00
Scott Taylor
db0e1ed0af Unit Tests: after r38303, replace usage of global $_wp_additional_image_sizes with wp_get_additional_image_sizes().
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38383 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 20:50:24 +00:00
John Blackbourn
e795f6da1d Build/Test Tools: Remove many unnecessary calls to rand_str() which can, in theory, fail at random. Static strings are much more appropriate.
See #37371


git-svn-id: https://develop.svn.wordpress.org/trunk@38382 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 20:21:30 +00:00
Boone Gorges
6eaa56f3d4 Don't improperly cast IDs when fetching post, user, or term objects.
Blindly casting passed IDs to integers can generate false positives
when the ID is cast to `1`.

Props deeptiboddapati.
Fixes #37738.

git-svn-id: https://develop.svn.wordpress.org/trunk@38381 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 19:08:23 +00:00
Scott Taylor
8b431f6859 FTP: ensure that there is only one class named ftp, which is what is expected in the loading of this arcane library. This ensures that an autoload generator, something along the lines of Composer, won't hiccup when it gets to these files.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38380 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 18:46:17 +00:00
Scott Taylor
a581574b3a Upgrade/Install: wp-admin/includes/class-wp-upgrader-skins.php is unused, remove it. All of the same includes are loaded in class-wp-upgrader.php.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38379 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 18:24:40 +00:00
John Blackbourn
5e71c349af Role/Capability: Only users who can manage options should be able to trash/delete the page for posts or the front page, as they are the only users who can restore it or subsequently alter the "Front page displays" setting.
Fixes #37580
Props JakePT


git-svn-id: https://develop.svn.wordpress.org/trunk@38378 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 18:22:28 +00:00
Boone Gorges
f21f8c1076 Eliminate unnecessary variable in WP_Term_Query.
Props ocean90.
Fixes #37544.

git-svn-id: https://develop.svn.wordpress.org/trunk@38377 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 18:10:56 +00:00
Scott Taylor
d227752665 Load: move WP_MatchesMapRegex into its own file.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38376 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 18:10:23 +00:00
Scott Taylor
c82c1b828b Script Loader: move _WP_Dependency into its own file.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38375 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 18:05:29 +00:00
Scott Taylor
aad8b9805e Load: remove class-feed.php (There is no class named Feed or WP_Feed, it just loads other classes) and, instead, move the require calls to the only place they are ever included: inside fetch_feed(). This simplifies the include path.
Tested with this feed in a widget: `http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml`.

See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38374 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 17:52:05 +00:00
wonderboymusic
223b79162c Load: remove session.php and, instead, move the 2 require calls to wp-settings.php. This simplifies the include path.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38373 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 17:43:03 +00:00
Boone Gorges
ff0386b5c1 Use shared fixture in comment_exists() tests.
Props Frank Klein.
Fixes #37842.

git-svn-id: https://develop.svn.wordpress.org/trunk@38372 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 17:41:51 +00:00
Scott Taylor
3a4811afb4 Load: load class-phpass.php (PasswordHash class) early in wp-settings.php, instead of require_once()'ing it in several places.
See #36335.


git-svn-id: https://develop.svn.wordpress.org/trunk@38371 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 17:39:37 +00:00
John Blackbourn
dac30944ff Docs: Alignment after [38369].
See #37770


git-svn-id: https://develop.svn.wordpress.org/trunk@38370 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 16:50:58 +00:00
John Blackbourn
87c1b26ee7 Docs: Correct various documentation around object and stdClass types.
See #37770


git-svn-id: https://develop.svn.wordpress.org/trunk@38369 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 16:48:17 +00:00
John Blackbourn
bc38f711cf Embeds: Add a missing regex delimiter for Facebook URLs.
See #34737


git-svn-id: https://develop.svn.wordpress.org/trunk@38368 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 12:16:56 +00:00
John Blackbourn
cb0048a6c5 Embeds: Add support for embedding Facebook posts and videos via oEmbed.
Fixes #34737
Props pento, GaryJ


git-svn-id: https://develop.svn.wordpress.org/trunk@38367 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 11:56:47 +00:00
John Blackbourn
d9b3ae759a Embeds: Many of our oEmbed providers now default to HTTPS embeds, redirect to the HTTPS oEmbed endpoint, or have complete support for HTTPS even if they don't default to HTTPS.
This change defaults to using HTTPS endpoints for oEmbeds for those providers that have full HTTPS support and don't redirect back to HTTP when clicking through from the embed. It covers:

* Vimeo
* SmugMug
* Scribd
* WordPress.tv
* SoundCloud
* Meetup
* issuu
* Mixcloud
* TED

See #28507


git-svn-id: https://develop.svn.wordpress.org/trunk@38366 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 11:24:38 +00:00
John Blackbourn
acc91a60e0 Embeds: Always use the HTTPS endpoint for YouTube embeds. The scheme parameter is no longer required as all YouTube assets now use HTTPS.
See #36274, #28507
Props zsusag, tollmanz


git-svn-id: https://develop.svn.wordpress.org/trunk@38365 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 10:38:05 +00:00
Scott Taylor
4de1595d47 i18n: move is_rtl() to l10n.php (which loads way earlier). Load WP_Locale file in wp-settings.php. Retire wp-includes/locale.php - it only loaded the class and the one function, is_rtl(). If someone loaded this file for fun somewhere else, it would be a fatal error.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38364 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 10:19:26 +00:00
Scott Taylor
a048646021 Load: move is_wp_error() to load.php so that WP_Error is in a file by itself.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38363 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:57:47 +00:00
Scott Taylor
1b292c965a Embed: wp-settings.php loads class-wp-embed.php, which currently produces side effects. Move the global instantiation to wp-settings.php. WP_Embed is then in a file by itself.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38362 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:52:18 +00:00
Scott Taylor
1ff3356d22 OEmbed: move _wp_oembed_get_object() to embed.php, where all of the other embed functions live. WP_oEmbed is then in a file by itself. Load class-oembed.php in wp-settings.php and remove extraneous include calls.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38361 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:48:32 +00:00
Scott Taylor
05cd65dd82 L10N: improve accuracy of docs.
Props johnbillion.
Fixes #37585.


git-svn-id: https://develop.svn.wordpress.org/trunk@38360 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:37:30 +00:00
Scott Taylor
8a667f3036 Formatting: for a performance boost in remove_accents(), convert chr() calls to string literals.
Props gitlost.
Fixes #37643.


git-svn-id: https://develop.svn.wordpress.org/trunk@38359 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:34:44 +00:00
Scott Taylor
62fe5001ba Editor: improve word-count.js documentation.
Props jipmoors, andizer.
Fixes #37718.


git-svn-id: https://develop.svn.wordpress.org/trunk@38358 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:24:34 +00:00
Scott Taylor
9bb9ea8185 Cron: clarify descriptions for Cron API functions.
Props johnbillion.
Fixes #37769.


git-svn-id: https://develop.svn.wordpress.org/trunk@38357 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-26 09:21:33 +00:00
Scott Taylor
b16dcd954d Query: collapse several of the is_* methods using __call(). Add @method annotations.
Fixes #37830.


git-svn-id: https://develop.svn.wordpress.org/trunk@38356 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 19:41:42 +00:00
Scott Taylor
a02d79cf73 Site Icon: There is no good reason for class-wp-site-icon.php to drop a global instance of itself whenever the file is loaded. The lone use of the global instance of WP_Site_Icon is in an AJAX action that provides virtually no way to override - the file is loaded immediately before the global is used.
Let us remove the `$wp_site_icon` global. I will fall on the sword if this comes back to bite us (waiting with bated breath).

See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38355 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 19:08:38 +00:00
Scott Taylor
9e9cc9d07a Feed: move 'WP_Feed_Cache', 'WP_Feed_Cache_Transient', WP_SimplePie_File and WP_SimplePie_Sanitize_KSES into their own files via svn cp. If we move forard with autoloading, class-feed.php is useless. We could even remove it now, and just load these new files in wp-settings.php. That can be decided post-mortem. class-feed.php is an interesting name: there is no Feed or WP_Feed class.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38354 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 18:18:01 +00:00
Scott Taylor
9c722d92cc Session: move WP_Session_Tokens and WP_User_Meta_Session_Tokens into their own files via svn cp. If we move forard with autoloading, session.php is useless. We could even remove it now, and just load these new files in wp-settings.php. That can be decided post-mortem.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38353 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 17:43:41 +00:00
Scott Taylor
b71117fdc7 Diff: move WP_Text_Diff_Renderer_inline (behold that lowercase "i") and WP_Text_Diff_Renderer_Table into their own files via svn cp.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38352 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 17:36:22 +00:00
Scott Taylor
3638dd6716 Query: move WP_Query into its own file via svn cp.
See #37827.


git-svn-id: https://develop.svn.wordpress.org/trunk@38351 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 17:19:47 +00:00
Drew Jaynes
66ac1f40ed Docs: Add a missing parenthesis in an example in the DocBlock for wp_redirect().
Props shayanys.
See #37770.


git-svn-id: https://develop.svn.wordpress.org/trunk@38350 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 07:35:15 +00:00
Andrew Ozz
861bdc722f TinyMCE: fix toolbars alignment in RTL.
Fixes #37760 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@38349 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-25 01:19:24 +00:00