Commit Graph

28078 Commits

Author SHA1 Message Date
Gary Pendergast 0013150649 `wpdb::flush()` was not flushing results correctly when using mysqli.
This change also allows stored procedures or queries made with `mysqli_multi_query()` to be flushed.

Includes unit tests.

Fixes #28155.

Props soulseekah.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-10 05:40:23 +00:00
Andrew Ozz 5f27bdc78d TinyMCE: enable direct calls to `_WP_Editors::wp_mce_translation()`. When using TinyMCE directly, this makes it easier to load the translation of the default strings. Fixes #30293.
Built from https://develop.svn.wordpress.org/trunk@30296


git-svn-id: http://core.svn.wordpress.org/trunk@30295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-10 02:07:22 +00:00
Boone Gorges 383c75db29 Fix PHP notice in `Tests_Feed_RSS2::test_items()`.
A notice was being thrown when `get_the_tags()` returned false, and `foreach()`
was run over that return value.

See [30283].
Built from https://develop.svn.wordpress.org/trunk@30295


git-svn-id: http://core.svn.wordpress.org/trunk@30294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-10 02:05:22 +00:00
Andrew Ozz b3da068590 TinyMCE: remove strings that are not translated before outputting the translations. Fixes #27797.
Built from https://develop.svn.wordpress.org/trunk@30294


git-svn-id: http://core.svn.wordpress.org/trunk@30293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-10 02:00:22 +00:00
Andrew Ozz ba10ab197b Heartbeat:
- Use the page visibility API (when available) and document.hasFocus() instead of window.onfocus/onblur. Improves speeding up/slowing down the interval and works for iframes by default.
- Add a setting for minimal interval. Maximum value is 10 min. This overrides all other intervals and cannot be changed after setting it at initialization. Can be used to reduce the frequency of requests on hosts that have low limits for used CPU time, etc.
- Extend the setting of interval to support 120 sec. (60 sec, is still the default).
- Always suspend after one hour of keyboard/mouse/touch inactivity.
Fixes #29779.
Built from https://develop.svn.wordpress.org/trunk@30293


git-svn-id: http://core.svn.wordpress.org/trunk@30292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-10 01:47:24 +00:00
Gary Pendergast f572927353 WPDB's `__get()` function should perform strict comparisons against member names
Built from https://develop.svn.wordpress.org/trunk@30292


git-svn-id: http://core.svn.wordpress.org/trunk@30291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-09 12:04:23 +00:00
Aaron Jorbin 2508d31b81 Remove failing Unbalanced tags tests
Patch with tests added to #6297 for use in the future

Props MikeHansenMe for creating patch of current unit test

see #30284

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


git-svn-id: http://core.svn.wordpress.org/trunk@30290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 23:15:23 +00:00
Aaron Jorbin 70416f2225 Remove failing shortcode unit tests
Test added to #14050 in case we want to include it in a future fix.

see #30284


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


git-svn-id: http://core.svn.wordpress.org/trunk@30289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 22:51:22 +00:00
Aaron Jorbin 2ed6de333b Remove failing uploadfile test in trunk
The test has been added to #11946 and can be readded when that ticket is fixed.

Props MikeHansenMe for creating patch of current unit test

See #30284


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


git-svn-id: http://core.svn.wordpress.org/trunk@30288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 21:56:22 +00:00
Drew Jaynes 3e94d3a931 Fix incorrect documentation in the DocBlocks for `get_lastpostmodified()` and `_get_last_post_time()`.
Props ericlewis for the initial patch.
Fixes #30249.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 21:08:45 +00:00
Jeremy Felt 112f854021 Move tests for ms_files_rewriting to separate group, ms-files
When the `ms_files_rewriting` flag is enabled, `ms_upload_constants()` is required to properly set upload directory constants. Once this fires, it is impossible to clean up for a non `ms_files_rewriting` test by turning the option back off.

Excluding these tests by default offer a more consistent environment overall. Any tests written for uploaded files in multisite should ideally have a correspondign test in this area.

This commit also moves existing `ms_files_rewriting` tests for `test_switch_upload_dir()`.

Fixes #30256

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


git-svn-id: http://core.svn.wordpress.org/trunk@30286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 21:08:24 +00:00
Boone Gorges ef442d8224 Remove failing test related to post galleries.
It relied on the old _WPDataset technique, which is no longer used.

The test has been added to #UT30 as a patch, in case anyone wants to make
future use of it.

See #30284.
Built from https://develop.svn.wordpress.org/trunk@30285


git-svn-id: http://core.svn.wordpress.org/trunk@30285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 21:02:22 +00:00
Drew Jaynes 92c153aa8c Fix the syntax for some status-related documentation introduced in [30155].
* Variables in DocBlocks should be backtick-escaped
* Parameter and return types should be as specific as possible
* `@param` types and variables should align with each other, but not intentionally with the `@return` description

See #30230.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:56:22 +00:00
Boone Gorges 77e2821d54 Improve `Tests_Feed_RSS2::test_items()`.
* Better reference to post author, to avoid PHP notices.
* Code styling.
* More reliable checking of tags and categories.

Props kurtpayne.
Fixes #UT32. See #30284.
Built from https://develop.svn.wordpress.org/trunk@30283


git-svn-id: http://core.svn.wordpress.org/trunk@30283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:55:22 +00:00
Boone Gorges 9e5cb0301c Remove failing unit tests from 'canonical' group.
Each removed test has been turned into a patch and posted to the open ticket
that it belongs to.

See #30284.
Built from https://develop.svn.wordpress.org/trunk@30282


git-svn-id: http://core.svn.wordpress.org/trunk@30282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:37:22 +00:00
Drew Jaynes e7b465046a Cross-reference `WP_Comment_Query::query()` as the location for finding information on default arguments for `WP_Comment_Query`.
Also updates the return types on `get_comments()` and `get_approved_comments()`, as an integer can also be returned if the `$count` argument is true.

Fixes #30111.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:35:22 +00:00
Drew Jaynes 35e509b0c8 Document default arguments for `WP_Comment_Query` class as a hash notation.
Props boonebgorges, DrewAPicture.
See #30111.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:19:23 +00:00
Jeremy Felt bd3a0b33b1 Use `remove_added_uploads()` in `tearDown()` for XMLRPC tests
This cleanup avoids false test failures due to incrementing filenames in the uploads directory.

Fixes #30290

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


git-svn-id: http://core.svn.wordpress.org/trunk@30279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 20:18:22 +00:00
Boone Gorges 0b90415e75 In unit tests, use `wpmu_delete_user()` to delete users when `is_multisite()`.
`wp_delete_user()` doesn't remove the user from the database, which causes all
sorts of problems in certain cases.

Props jeremyfelt.
See [30277], #30017.
Built from https://develop.svn.wordpress.org/trunk@30278


git-svn-id: http://core.svn.wordpress.org/trunk@30278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 19:56:22 +00:00
Boone Gorges b5b923c347 Share fixtures across 'canonical' automated tests.
Sharing these fixtures results in a speed improvement of almost one minute per
run of the test suite.

My hope is that future WordPress developers will spend this extra minute with
their loved ones, for life on this earth is short, my friends, and the moments
you spend watching WP generate test data can never again be reclaimed from the
grizzled clutches of Time, and none of us are really getting younger, I mean,
geez, have you looked in the mirror lately, Gandalf?

See #30017.
Built from https://develop.svn.wordpress.org/trunk@30277


git-svn-id: http://core.svn.wordpress.org/trunk@30277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 19:29:22 +00:00
Boone Gorges b6d3190be2 Share fixtures across a number of query-related test classes.
This shaves 10-20 seconds off the running time for the suite.

See #30017.
Built from https://develop.svn.wordpress.org/trunk@30276


git-svn-id: http://core.svn.wordpress.org/trunk@30276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-08 15:30:25 +00:00
Ian Stewart 68a6a69a91 Twenty Fifteen: updates to customize-preview.js missed in r30274.
Props celloexpressions, See #29988.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 21:11:25 +00:00
Ian Stewart fa81522cb2 Twenty Fifteen: add instant updating of color schemes to the customizer with postMessage.
Props celloexpressions, bradyvercher, westonruter, fixes #29988.



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


git-svn-id: http://core.svn.wordpress.org/trunk@30274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 20:55:23 +00:00
Ian Stewart 066967be6c Twenty Fifteen: Removing email obfuscation from social links menu.
We really should be doing this in all menus, at which point this becomes core or plugin functionality, not a theme feature.

Closes #30214.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 17:38:21 +00:00
Ian Stewart c3ec04c532 Twenty Fifteen: adding help text to explain how color changes to header and sidebar are affected by responsive design.
Props iamtakashi, iandstewart, fixes #30165.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 17:31:22 +00:00
Ian Stewart 78c26017c6 Twenty Fifteen: improve naming and documentation of customizer js files to match core filenaming conventions.
Props celloexpressions, fixes #30160.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 17:20:22 +00:00
Ian Stewart 1b0b11b593 Twenty Fifteen: use antispambot to obfuscate email adresses in the social links menu.
Props tywayne, fixes #30214.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 16:46:21 +00:00
Ian Stewart 85fd2fa467 Twenty Fifteen: update earlier patch to borders on linked images so we're not affecting the display of linked icons in widgets.
Props iamtakashi, fixes #29963.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 16:34:24 +00:00
Boone Gorges 7ca9e7d428 Correct variable name in `WP_UnitTestCase::temp_filename()`.
Built from https://develop.svn.wordpress.org/trunk@30268


git-svn-id: http://core.svn.wordpress.org/trunk@30268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 01:37:21 +00:00
Boone Gorges 88de93790b Unset the default permalink structure after installing Multisite for automated tests.
Most of our unit tests that involve permalinks expect non-pretty permalinks;
this is the default setting for WP. However, when the test suite installs
multisite, `populate_network()` is run before WP recogizes itself as multisite,
which leads to pretty permalinks being set. This breaks a number of unit
tests in ways that are difficult to trace.
Built from https://develop.svn.wordpress.org/trunk@30267


git-svn-id: http://core.svn.wordpress.org/trunk@30267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-07 01:25:22 +00:00
Boone Gorges 0b1cd9a67a Use `assertEqualSets()` for some `WP_Comment_Query` tests.
Built from https://develop.svn.wordpress.org/trunk@30266


git-svn-id: http://core.svn.wordpress.org/trunk@30266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-06 22:28:25 +00:00
Boone Gorges c357de63ef Don't force child_of=0 for non-hierarchical taxonomies in `get_terms()`.
This forcing appears to have been introduced to save unnecessary queries, but
(a) in some cases it appeared to be causing *more* queries, and (b) it caused
incorrect results when the 'exclude_tree' param of `get_terms()` called
`get_terms()` on each item in the tree using the 'child_of' param.

Fixes #30275.
Built from https://develop.svn.wordpress.org/trunk@30265


git-svn-id: http://core.svn.wordpress.org/trunk@30265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-06 21:47:23 +00:00
Boone Gorges 5ce7ae59df Add tests for `get_adjacent_post_link()` wrappers.
Props MikeHansenMe.
See #29663.
Built from https://develop.svn.wordpress.org/trunk@30264


git-svn-id: http://core.svn.wordpress.org/trunk@30264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-06 20:17:22 +00:00
Boone Gorges 4743ee9326 In `get_adjacent_post()`, `$excluded_terms` should check term_id rather than term_taxonom_id.
See #29663, #22112.
Built from https://develop.svn.wordpress.org/trunk@30263


git-svn-id: http://core.svn.wordpress.org/trunk@30263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-06 20:12:22 +00:00
Ian Stewart cd0ba24e95 Twenty Fifteen: Our next-previous labels were reversed.
Props iamtakashi, fixes #30265.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 20:31:22 +00:00
Scott Taylor 03ea739661 In `get_page_children()`, only check `$page->ancestors` once to avoid duplicates when the function recurses. Adds an argument, `$ancestors`.
Fixes #18962.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 20:05:24 +00:00
Scott Taylor d5a9d63114 Improve `wp.media` documentation.
Props ericlewis.
See #28459.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 19:39:22 +00:00
Scott Taylor 2d1080aed1 Improve `wp.Uploader` documentation.
Props ericlewis.
See #30260.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 19:37:23 +00:00
Ian Stewart 6ad06ca03d Twenty Fifteen: "detach" widgets from the header in mobile views.
Props iamtakashi, fixes #30252.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 18:03:23 +00:00
Jeremy Felt c47552dc6d Create new $wp_roles object in install_blog() to avoid protected _init() call
Our call to `$wp_roles->_init()` relied on the `__call()` method in `WP_Roles` to handle the link to the protected method. This works back to PHP 5.2.9, when a bug was fixed allowing access to protected methods through this exact approach.

`install_blog()` needs a fresh `$wp_roles` object after `populate_roles()` resets everything in its path. We can create this new object from scratch, effectively doing the same thing with the call to `_init()` via the constructor.

Fixes #29692 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 05:12:22 +00:00
Boone Gorges 3706590afb Split shared taxonomy terms during term update.
When updating an existing taxonomy term that shares its `term_id` with
another term, we generate a new row in `wp_terms` and associate the updated
term_taxonomy_id with the new term. This separates the terms, such that
updating the name of one term does not change the name of any others.

Note that this term splitting only occurs on installations whose database
schemas have been upgraded to version 30133 or higher. Note also that shared
terms are only split when run through `wp_update_term()`, as on edit-tags.php;
we will wait until a future release of WordPress to force the splitting of all
shared taxonomy terms.

Props boonebgorges, rmccue, greuben, garyc40, wonderboymusic, imath, jesin.
Fixes #5809.
Built from https://develop.svn.wordpress.org/trunk@30241


git-svn-id: http://core.svn.wordpress.org/trunk@30241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 02:03:23 +00:00
Boone Gorges 32db3d1fe5 Do not create shared taxonomy terms.
A "shared" term occurs when two entries in the `wp_term_taxonomy` table share a
single `term_id`, and thereby correspond to the same row in `wp_terms`. This
changeset stops the practice of creating shared terms: each new row in
`wp_term_taxonomy` will receive its own row in `wp_terms`. The new strategy
for term creation depends on whether the installation's database schema is up
to date for 4.1:

* If so, terms are allowed to be created with the same slug as an existing term, as long as they are in different taxonomies and do not share a parent. Thus, a new tag with the slug 'wordpress' can exist alongside a category with the slug 'wordpress'.
* If not, new terms will be forced to have unique slugs. Thus, on an installation containing a category with the slug 'wordpress', a new tag 'WordPress' will get the slug 'wordpress-2'.

Fixes #21950. See #5809.
Built from https://develop.svn.wordpress.org/trunk@30240


git-svn-id: http://core.svn.wordpress.org/trunk@30240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 01:42:22 +00:00
Boone Gorges ef13be6f27 Enforce ORDER BY and LIMIT clauses in `term_exists()` queries.
In case of edge cases where a duplicate term might exist in a replicated
database for a split second, these explicit query clauses ensure that
`term_exists()` will always recognize the oldest matched term as the
canonical one. See [30238] for background.

Props pento.
See #22023, #5809.
Built from https://develop.svn.wordpress.org/trunk@30239


git-svn-id: http://core.svn.wordpress.org/trunk@30239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 01:09:21 +00:00
Boone Gorges 4ce9db9ce8 In `wp_insert_term()`, clean up accidental duplicate terms after insert.
In [30056], the UNIQUE index was removed from the 'slug' column of `wp_terms`.
While we have numerous checks in place to avoid the creation of unwanted
duplicate term+term_taxonomy pairs, it's possible that in certain edge cases -
such as during the lag caused by database replication, or a race condition
involving near-simultaneous creation of more than one term - we'll end up
unwittingly inserting two identical rows.

The current changeset minimizes this risk by introducing a failsafe mechanism
into `wp_insert_term()`. After a term and term_taxonomy are INSERTed, we check
to see whether the term just created is a duplicate of an existing term; if so,
we delete the new one and keep the old one. This prevents problems caused by
replication lag, because SELECT queries that take place after an INSERT will
hit the master database; it mitigates race conditions by enforcing that the
term that was created first (ie, the one with the lowest `term_id`) is
always the "canonical" one.

Props nacin, markjaquith.
See #22023, #5809.
Built from https://develop.svn.wordpress.org/trunk@30238


git-svn-id: http://core.svn.wordpress.org/trunk@30238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 01:00:24 +00:00
Ian Stewart 1483e80848 Twenty Fifteen: use continue reading links for auto-generated excerpts to provide a readable link for screenreaders.
Props davidakennedy, kraftbj, fixes #30135.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-04 21:19:22 +00:00
Ian Stewart 2047ff9e5a Twenty Fifteen: Use the new archive template tags and make archive template titling way simpler!
Props obenland, fixes #30246.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-04 21:01:23 +00:00
Ian Stewart 0952952ef7 Twenty Fifteen: adding licensing info for the image used in the screenshot.
Props sakinshrestha, fixes #30156.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-04 20:55:22 +00:00
Scott Taylor 8fa0755584 Add some docs to `wp.media.view.EditorUploader`.
Props ericlewis.
See #29951.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-04 20:48:23 +00:00
Ian Stewart d21ea0a251 Twenty Fifteen: Formatting cleanup for documentation, crossing eyes, dotting tees.
Props lancewillett, MikeHansenMe, fixes #30149.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-04 20:26:23 +00:00
Ian Stewart e2d03edb0d Twenty Fifteen: missing spaces for code standards.
Props Jayjdk, fixes #30076.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-04 20:16:22 +00:00