Repository navigation
Commit eed6f20
committed
Rewrites: Reinstate split the query for random redirects.
Removes the filtering of `split_the_query` to `false` on random post redirects. As sorting queries randomly generates a temporary table, selecting `*` places all data in the temporary table, whereas selecting `ID` only places the post ID in the temporary table. The unsplit query can become inefficient on sites with a relatively few posts (ie, thousands not millions).
This removes the function `wp_random_content_split_the_query()` with a hard deprecation as it was not released to a production version of WordPress.
Additionally, the following changes have been made to the test suite:
* Tests ensuring random redirects are not cached are refactored to avoid the `$this->go_to()` method in the test suite as the helper method flushes the cache, causing the tests to be invalid
* Introduces tests covering `WP::handle_random()` specifically
* Adds docblocks to each and every test in `Tests_Query_RandomContentRedirect`
Developed in WordPress#14809.
Follow-up to r63767, r63906, r64402.
Props aryanjasala, peterwilsoncc, dhrupo, westonruter.
Fixes #64498.
git-svn-id: https://develop.svn.wordpress.org/trunk@65042 602fd350-edb4-49c9-b593-d223f7449a821 parent 63cd9ce commit eed6f20
4 files changed
Lines changed: 601 additions & 94 deletions
File tree
- src/wp-includes
- tests/phpunit/tests
- query
- wp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
500 | 499 | | |
501 | 500 | | |
502 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | 1464 | | |
1486 | 1465 | | |
1487 | 1466 | | |
| |||
0 commit comments