WordPress/wp-admin/includes
Helen Hou-Sandí 5f6b531f70 Improve oEmbed caching. Introduces the concept of a TTL for oEmbed caches and a filter for `oembed_ttl`.
We will no longer replace previously valid oEmbed responses with an `{{unknown}}` cache value. When this happens due to reaching a rate limit or a service going down, it is data loss, and is not acceptable. This means that oEmbed caches for a post are no longer deleted indiscriminately every time that post is saved.

oEmbed continues to be cached in post meta, with the addition of a separate meta key containing the timestamp of the last retrieval, which is used to avoid re-requesting a recently cached oEmbed response. By default, we consider a valued cached in the past day to be fresh. This can greatly reduce the number of outbound requests, especially in cases where a post containing multiple embeds is saved frequently.

The TTL used to determine whether or not to request a response can be filtered using `oembed_ttl`, thus allowing for the possibility of respecting the optional oEmbed response parameter `cache_age` or altering the period of time a cached value is considered to be fresh.

Now that oEmbeds are previewed in the visual editor as well as the media modal, oEmbed caches are often populated before a post is saved or published. By pre-populating and avoiding having to re-request that response, we also greatly reduce the chances of a stampede happening when a published post is visible before oEmbed caching is complete.

As it previously stood, a stampede was extremely likely to happen, as the AJAX caching was only triggered when `$_GET['message']` was 1. The published message is 6. We now trigger the caching every time `$_GET['message']` is present on the edit screen, as we are able to avoid triggering so many HTTP requests overall.

props markjaquith. fixes #14759. see #17210.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-03 16:45:14 +00:00
..
admin.php Load the new admin and network admin mo files, if present. see #19852 2012-01-27 22:19:56 +00:00
ajax-actions.php Improve oEmbed caching. Introduces the concept of a TTL for oEmbed caches and a filter for `oembed_ttl`. 2014-07-03 16:45:14 +00:00
bookmark.php Fix wp_insert_link(), broken in [28406]/[28408]. 2014-05-18 09:56:15 +00:00
class-ftp-pure.php First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin. 2013-12-24 18:57:12 +00:00
class-ftp-sockets.php First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin. 2013-12-24 18:57:12 +00:00
class-ftp.php "LGPL License" is redundant. 2013-02-15 16:26:46 +00:00
class-pclzip.php Associate subdirector of whitespace trims trailing whites with pinking shears. 2009-10-15 20:26:21 +00:00
class-wp-comments-list-table.php Prevent bulk actions from being performed when Filter button is clicked. 2014-06-30 01:10:15 +00:00
class-wp-filesystem-base.php `WP_Filesystem_Base->abspath()` should use the `WPINC` constant 2014-06-29 22:16:15 +00:00
class-wp-filesystem-direct.php Add access modifier (`public`) to methods in `WP_Filesystem_Direct`. 2014-05-19 00:09:14 +00:00
class-wp-filesystem-ftpext.php Add access modifier (`public`) to members and methods in `WP_Filesystem_FTPext`. 2014-05-19 00:12:15 +00:00
class-wp-filesystem-ftpsockets.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
class-wp-filesystem-ssh2.php Add access modifier (`public`) to members and methods in `WP_Filesystem_SSH2`. 2014-05-19 00:18:14 +00:00
class-wp-importer.php Restore `$val` in `WP_Importer::bump_request_timeout()` - even though the parent class and `WP_Import` ignore the parameter, it creates an incompatible interface notice in the plugin. 2014-05-30 19:35:16 +00:00
class-wp-links-list-table.php Prevent bulk actions from being performed when Filter button is clicked. 2014-06-30 01:10:15 +00:00
class-wp-list-table.php Prevent bulk actions from being performed when Filter button is clicked. 2014-06-30 01:10:15 +00:00
class-wp-media-list-table.php Prevent bulk actions from being performed when Filter button is clicked. 2014-06-30 01:10:15 +00:00
class-wp-ms-sites-list-table.php Set date format before going into the loop to avoid a PHP notice if 'lastupdated' column is filtered out. 2014-06-29 18:11:14 +00:00
class-wp-ms-themes-list-table.php Add access modifiers to methods and members of list table classes: 2014-05-19 01:17:15 +00:00
class-wp-ms-users-list-table.php Add access modifiers to methods and members of list table classes: 2014-05-19 01:17:15 +00:00
class-wp-plugin-install-list-table.php Add a new 'Beta Testing' tab on the plugin installer, for features as plugins such as Press This. 2014-06-12 18:09:13 +00:00
class-wp-plugins-list-table.php Remove redundant 'Visit author homepage' title attributes for plugins and themes. 2014-06-05 04:52:16 +00:00
class-wp-posts-list-table.php Pass $post object to 'preview_post_link' filter. 2014-07-03 14:42:15 +00:00
class-wp-terms-list-table.php Remove some dead variable assignments. 2014-05-30 16:59:14 +00:00
class-wp-theme-install-list-table.php Cleanup for `switch` statements: 2014-05-30 17:58:15 +00:00
class-wp-themes-list-table.php Add access modifiers to methods and members of list table classes: 2014-05-19 01:17:15 +00:00
class-wp-upgrader-skins.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
class-wp-upgrader.php Remove non-breaking spaces from auto update email text. 2014-07-02 12:46:17 +00:00
class-wp-users-list-table.php `hackificator` doesn't like mixed quote styles in some generated HTML. The switch from single to double allows these files to be parsed. 2014-05-19 01:59:15 +00:00
comment.php Inline documentation for hooks in wp-admin/includes/comment.php. 2013-09-14 01:01:08 +00:00
continents-cities.php Give continents-cities their own textdomain. Props nbachiyski, Denis-de-Bernardy . fixes #9794 2009-05-14 20:05:25 +00:00
dashboard.php Don't use variable variables in `wp_dashboard_plugins_output()`. Variable variables aren't the worst thing about this function. 2014-06-11 18:55:14 +00:00
deprecated.php Use correct function name. 2014-05-22 07:59:16 +00:00
export.php Only include relevant post authors in WXR exports. Fixes #20206. Props jeremyfelt. 2014-06-10 19:15:13 +00:00
file.php Normalise the schemes used in `get_home_path()` so it returns the correct path for sites using SSL in the admin area but not the front end. Fixes #25767. Props GregLone for the initial patch. 2014-06-29 10:29:14 +00:00
image-edit.php Avoid a notice in `wp_save_image()` by checking `$meta['sizes']['thumbnail']` for `! empty()` before setting a variable to it. 2014-05-11 03:42:14 +00:00
image.php Remove mbstring_binary_safe_strlen(). Use mbstring_binary_safe_encoding() and reset_mbstring_encoding() directly. 2014-06-23 22:21:15 +00:00
import.php `hackificator` complains if you call `include 'file.php'` without the parens, needs to be `include( 'file.php' )` 2014-05-18 20:52:15 +00:00
list-table.php Upgrade `_WP_List_Table_Compat` to PHP5-style constructor. 2014-05-19 17:20:17 +00:00
media.php In deprecated media iframe code, `attachment_fields_to_save` filter should not be called twice after initial image upload in post. 2014-06-27 21:32:16 +00:00
menu.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
meta-boxes.php Pass $post object to 'preview_post_link' filter. 2014-07-03 14:42:15 +00:00
misc.php Secure embeds in the editor (first run): 2014-06-30 05:49:16 +00:00
ms-deprecated.php Remove ms-files.php rewriting from WordPress multisite. fixes #19235. 2012-09-11 22:22:20 +00:00
ms.php In `update_option_new_admin_email()`, `$email` is set and never used. 2014-05-06 16:48:14 +00:00
nav-menu.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
plugin-install.php Add a new 'Beta Testing' tab on the plugin installer, for features as plugins such as Press This. 2014-06-12 18:09:13 +00:00
plugin.php Remove redundant 'Visit author homepage' title attributes for plugins and themes. 2014-06-05 04:52:16 +00:00
post.php Pass $post object to 'preview_post_link' filter. 2014-07-03 14:42:15 +00:00
revision.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
schema.php Bring the list of `upload_filetypes` for multisite into modernity based on .com upgrades and supported extensions for audio and video. 2014-06-25 18:00:15 +00:00
screen.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
taxonomy.php In `get_terms_to_edit()`, call `get_object_term_cache()` before priming cache with `wp_get_object_terms()`. 2014-05-23 19:29:14 +00:00
template.php Fix feature pointer positioning issues for both LTR and RTL. 2014-06-29 16:06:14 +00:00
theme-install.php Bring the theme browsing experience from 3.8 to the theme installer. First pass. 2014-03-11 07:47:15 +00:00
theme.php Use a time constant in get_theme_feature_list() and File_Upload_Upgrader. 2014-05-05 08:26:24 +00:00
update-core.php Update $_old_files for 3.9. see #27775. 2014-04-12 18:27:17 +00:00
update.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
upgrade.php Allow a language to be chosen before installing WordPress. First pass. 2014-06-18 19:58:15 +00:00
user.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00
widgets.php Fix some `hackificator` odds and ends in `wp-admin`: 2014-05-19 05:04:16 +00:00