WordPress/wp-admin
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
..
css Only apply metabox handle styles and JS events to .postbox .hndle, as opposed to all h3s in a .postbox. 2014-07-01 16:23:15 +00:00
images Convert the post lock icon to a dashicon. 2014-03-04 06:53:14 +00:00
includes 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
js Only apply metabox handle styles and JS events to .postbox .hndle, as opposed to all h3s in a .postbox. 2014-07-01 16:23:15 +00:00
maint Remove the WordPress logo from the focusable elements on the install/update screens. Fixes #28674. Props stompweb 2014-06-29 14:10:15 +00:00
network Add new action 'delete_user_form' in wp-admin/users.php and wp-admin/network/users.php. 2014-06-28 04:43:16 +00:00
user Add missing Dashicons classes to User Admin menu. 2014-05-06 07:58:15 +00:00
about.php The About page has a <div> that doesn't close. Also, <hr>s should self-close. hackificator complains about these things. 2014-05-18 20:33:15 +00:00
admin-ajax.php Don't pass embeds through the_content() when trying to render MCE previews, leverage WP_Embed and do_shortcode() instead. 2014-05-26 23:43:15 +00:00
admin-footer.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
admin-functions.php
admin-header.php Correct misleading verbiage in 'print' hook docs. 2014-03-25 08:05:15 +00:00
admin-post.php Because the WP_ADMIN constant name can be bound in multiple files, all instances should check ! defined first. wp-admin/admin.php already has this check. 2014-05-18 20:42:16 +00:00
admin.php Because the WP_ADMIN constant name can be bound in multiple files, all instances should check ! defined first. wp-admin/admin.php already has this check. 2014-05-18 20:42:16 +00:00
async-upload.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
comment.php hackificator bails on this file because of mixed quote styles on some HTML attributes. 2014-05-18 21:47:14 +00:00
credits.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
custom-background.php Classes that have __set() also need __isset() and __unset(). 2014-05-19 06:52:14 +00:00
custom-header.php Classes that have __set() also need __isset() and __unset(). 2014-05-19 06:52:14 +00:00
customize.php Customizer: Introduce a "panel" API to organize multiple sections into a one section. 2014-06-26 20:17:15 +00:00
edit-comments.php Comments: Update border color and help text. 2014-03-27 05:08:14 +00:00
edit-form-advanced.php In media_buttons(), add a static var $instance to increment the id attribute of insert-media-button-%d on each call. 2014-06-26 01:05:14 +00:00
edit-form-comment.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
edit-link-form.php In edit-link-form.php, hackificator bails because there is a </form> with no open <form>. It exists, but is needlessly constructed with PHP. It always returns a <form>, only the id and name are different. The dynamic piece just returns the ID now. 2014-05-18 22:07:15 +00:00
edit-tag-form.php Remove all "valign" attributes from tables in wp-admin, props MikeHansenMe, Marventus. Fixes #22712. 2014-01-24 19:06:15 +00:00
edit-tags.php Remove unreachable break statements in wp-admin/edit-tags.php. break is unnecessary after die, exit, and wp_die. 2014-05-06 14:52:16 +00:00
edit.php edit.php?post_type=attachment should redirect to upload.php. Without the redirect, the user is presented with an empty list table. There are probably other issues to address overall, but this accomplishes what the ticket wants. 2014-06-10 18:48:15 +00:00
export.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
freedoms.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
import.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
index.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
install-helper.php Remove all @package and @subpackage PHPDoc tags not at the file- or class-levels in core. 2014-02-25 17:14:14 +00:00
install.php Admin screens should use the WPINC constant 2014-06-29 22:21:15 +00:00
link-add.php
link-manager.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
link-parse-opml.php Remove unused globals from link-parse-opml.php after [28743]. 2014-06-20 17:26:14 +00:00
link.php In wp-admin/link.php, break is unreachabled after exit. 2014-05-06 18:06:14 +00:00
load-scripts.php
load-styles.php Admin screens should use the WPINC constant 2014-06-29 22:21:15 +00:00
media-new.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
media-upload.php Inline documentation for hooks in wp-admin/media-upload.php. 2014-01-08 04:00:11 +00:00
media.php Cleanup for switch statements: 2014-05-30 17:58:15 +00:00
menu-header.php Restore the ability to pass classes to admin menu submenu items, important for the Customize link. Accidentally left out in [24048]. fixes #28583. 2014-06-19 02:18:15 +00:00
menu.php Introduce a .dashicons-before CSS class. 2014-03-05 20:04:14 +00:00
moderation.php
ms-admin.php
ms-delete-site.php Always decode special characters for email subjects. 2014-03-28 02:44:15 +00:00
ms-edit.php
ms-options.php
ms-sites.php
ms-themes.php
ms-upgrade-network.php
ms-users.php
my-sites.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
nav-menus.php Use '&mdash; Select &mdash;' instead of '-- Select --' for nav menus. Looks nicer. 2014-04-25 00:35:25 +00:00
network.php Admin screens should use the WPINC constant 2014-06-29 22:21:15 +00:00
options-discussion.php Priority fixes for various existing hook documentation. 2014-04-12 00:01:15 +00:00
options-general.php Replace Y/m/d date format in general settings with a more popular one, Y-m-d. 2014-06-26 14:29:17 +00:00
options-head.php
options-media.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
options-permalink.php Permalink Settings: Don't show "update your .htaccess now" if nothing needs to change. 2014-03-15 04:35:16 +00:00
options-reading.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
options-writing.php Priority fixes for various existing hook documentation. 2014-04-12 00:01:15 +00:00
options.php Add braces missed while adding docs for the option_page_capability_{$option_page} hook. 2014-06-25 21:48:15 +00:00
plugin-editor.php In wp-admin/plugin-editor.php, break is unreachabled after exit. 2014-05-06 18:12:14 +00:00
plugin-install.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
plugins.php Plugin activation/deletion errors should be styled as such. 2014-05-31 20:10:15 +00:00
post-new.php
post.php In wp-admin/post.php, break is unreachabled after exit. 2014-05-06 18:15:15 +00:00
press-this.php Make sure inputs in Press This have a type so they are styled appropriately. see #18380. 2014-03-27 02:39:14 +00:00
profile.php
revision.php Fix some hackificator odds and ends in wp-admin: 2014-05-19 05:04:16 +00:00
setup-config.php Admin screens should use the WPINC constant 2014-06-29 22:21:15 +00:00
theme-editor.php Fix some hackificator odds and ends in wp-admin: 2014-05-19 05:04:16 +00:00
theme-install.php Update help text on Add Themes screen. 2014-05-17 23:44:15 +00:00
themes.php Show a "No themes found" message if the search for an installed theme doesn't produce any results. 2014-06-29 09:16:14 +00:00
tools.php Use SSL when linking to WordPress.org. see #27115. 2014-03-08 04:14:15 +00:00
update-core.php hackificator doesn't like mixed single/double-quoted attributes. These were 2 lingering instances in the admin. 2014-05-19 17:10:15 +00:00
update.php Fix some hackificator odds and ends in wp-admin: 2014-05-19 05:04:16 +00:00
upgrade-functions.php
upgrade.php Remove the WordPress logo from the focusable elements on the install/update screens. Fixes #28674. Props stompweb 2014-06-29 14:10:15 +00:00
upload.php Grid view for the media library, first pass. This is alpha; expect imperfection. We will be iterating further. 2014-06-05 22:01:18 +00:00
user-edit.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
user-new.php Don't use variable variables in user-new.php. Test by causing errors when creating a new user. 2014-06-11 19:54:13 +00:00
users.php Add new action 'delete_user_form' in wp-admin/users.php and wp-admin/network/users.php. 2014-06-28 04:43:16 +00:00
widgets.php The sidebar_admin_setup hook should only be documented once in wp-admin/widgets.php. All others are duplicates. 2014-03-28 19:47:15 +00:00