Commit Graph

24 Commits

Author SHA1 Message Date
John Blackbourn 1c6ca0998c Docs: Various fixes and improvements to inline documentation.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48695 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-30 19:12:02 +00:00
Sergey Biryukov e72fff9cef Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov f243dc38c0 Coding Standards: Use strict comparison and Yoda conditions in the root directory files.
Props pikamander2.
Fixes #48965.

git-svn-id: https://develop.svn.wordpress.org/trunk@47054 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-09 00:53:29 +00:00
Sergey Biryukov e879f7d457 Docs: Improve a comment about `$doing_wp_cron` global in `wp-cron.php`.
Props chinteshprajapati, subrataemfluence, nielslange.
Fixes #46104.

git-svn-id: https://develop.svn.wordpress.org/trunk@46733 602fd350-edb4-49c9-b593-d223f7449a82
2019-11-15 08:57:03 +00:00
Aaron Jorbin 466937669a Cron: Prevent sending headers when using ALTERNATE_WP_CRON
ALTERNATE_WP_CRON echos things which causes a "Headers already sent" warning. This adds a check to ensure headers haven't already been sent.

Previously: [45560]

See: #45560. Fixes #48283.
Props dlh.



git-svn-id: https://develop.svn.wordpress.org/trunk@46458 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-10 22:50:05 +00:00
Sergey Biryukov 927098e5aa Code Modernisation: Replace `call_user_func_array()` in `wp-cron.php` with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46142 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:47:38 +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
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
Peter Wilson f3b7b7f966 Cron: Fix undefined variable notice.
Restore `$gmt_time` variable removed in error from [44483].

Props afragen.
Fixes #45870.



git-svn-id: https://develop.svn.wordpress.org/trunk@44505 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 08:36:07 +00:00
Alex Shiels e06121f2ed Cron API: Make wp-cron.php non-blocking where possible.
This should make cron spawning faster by ensuring requests to wp-cron.php return immediately regardless of transport method. It is enabled only on recent PHP versions with fastcgi, due to historical bugs and availability of `fastcgi_finish_request()`. This needs testing on a range of platforms, to help determine if it's safe to use in other contexts also.

Props vnsavage, johnbillion, jnylen0.
See #18738, #41358


git-svn-id: https://develop.svn.wordpress.org/trunk@44488 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-09 01:05:16 +00:00
Peter Wilson 0bc20594c7 Cron API: Add function and filter to return ready cron jobs.
Add the function `wp_get_ready_cron_jobs()` to return a modified version of the cron array limited to jobs ready to be run, ie with a timestamp of `time()` or earlier.

The new function includes the filter `pre_get_ready_cron_jobs` to allow for custom cron storage systems. This rounds out the functionality added in #32656.

Props Pento for code review.
Fixes #45797.



git-svn-id: https://develop.svn.wordpress.org/trunk@44483 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 21:48:07 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
Drew Jaynes 6ebef9f76f Docs: Improve the usefulness and accuracy of the file header for wp-cron.php.
Props stevenlinx for the initial patch.
Fixes #31401.


git-svn-id: https://develop.svn.wordpress.org/trunk@41276 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:36:39 +00:00
Sergey Biryukov c0346dc748 Docs: Add a `@global` entry for `$wpdb` in `_get_cron_lock`.
Props tejas5989.
Fixes #41433.

git-svn-id: https://develop.svn.wordpress.org/trunk@41146 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-25 12:55:34 +00:00
Drew Jaynes eb60152449 Improve inline documentation for the cron lock behavior.
Props ericlewis.
Fixes #32478.


git-svn-id: https://develop.svn.wordpress.org/trunk@32580 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-24 17:25:52 +00:00
Drew Jaynes a2d7c3fa58 Add a missing DocBlock for the core utility function `_get_cron_lock()`.
Props mordauk, valendesigns.
Fixes #31646.


git-svn-id: https://develop.svn.wordpress.org/trunk@31804 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-17 23:37:58 +00:00
Drew Jaynes (DrewAPicture) 9b0cf1bd5b Ensure we're using the correct `@ignore` phpDocumentor tag to mark elements that should be skipped when parsing.
Up to this point, various core elements' DocBlocks incorrectly included an `@internal` tag as a means for skipping the parsing process. When paired with a description (inline or otherwise), `@internal` is a valid tag meant to provide internal-only context, but not necessarily to skip parsing the entire element.

See #30987.


git-svn-id: https://develop.svn.wordpress.org/trunk@31170 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 00:50:32 +00:00
Drew Jaynes (DrewAPicture) 6a63c5b59d Fix a phpdoc typo and multi-line comment syntax in wp-cron.php.
Props rclations.
Fixes #28231.


git-svn-id: https://develop.svn.wordpress.org/trunk@28380 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 04:38:15 +00:00
Drew Jaynes (DrewAPicture) 0f759f0c01 Mark the `$hook` and `$page_hook` hooks as `@internal` to skip parsing.
See #26869.


git-svn-id: https://develop.svn.wordpress.org/trunk@28216 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 07:53:09 +00:00
Andrew Nacin 8d72ad52ff Don't rely on include_path to include files.
Always use dirname() or, once available, ABSPATH.

props ketwaroo, hakre.
fixes #17092.


git-svn-id: https://develop.svn.wordpress.org/trunk@25616 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-25 00:17:40 +00:00
Andrew Nacin 63f35ba4b4 Document the event hook in wp-cron.php. see #25229.
git-svn-id: https://develop.svn.wordpress.org/trunk@25290 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 20:51:09 +00:00
Scott Taylor 22278ec6a9 Introduce `wp_using_ext_object_cache()` - mimic `wp_suspend_cache_invalidation()` and discourage direct access to `$_wp_using_ext_object_cache`, cleaning up importing of globals in functions and provides function to modify that global. Loads the packaged object cache when an external cache hasn't been loaded or doesn't contain `wp_cache_init()`.
Fixes #21401.



git-svn-id: https://develop.svn.wordpress.org/trunk@25289 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 18:09:24 +00:00
Andrew Nacin b43712e0f7 New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
 * New task runner (Grunt), configured to copy a built WordPress to build/.
 * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
 * Remove Akismet external from develop.svn. Still exists in core.svn.
 * Drop minified files from src/. The build process will now generate these.

props koop.
see #24976.

and see http://wp.me/p2AvED-1AI.



git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-07 05:25:25 +00:00