{"id":191163,"date":"2024-03-22T23:47:37","date_gmt":"2024-03-22T23:47:37","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/optimization-detective\/"},"modified":"2026-02-27T20:19:09","modified_gmt":"2026-02-27T20:19:09","slug":"optimization-detective","status":"publish","type":"plugin","link":"https:\/\/kk.wordpress.org\/plugins\/optimization-detective\/","author":20220395,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0-beta5","stable_tag":"1.0.0-beta5","tested":"7.0","requires":"6.6","requires_php":"7.2","requires_plugins":null,"header_name":"Optimization Detective","header_author":"WordPress Performance Team","header_description":"Uses real user metrics to improve heuristics WordPress applies on the frontend to improve image loading priority.","assets_banners_color":"68bede","last_updated":"2026-02-27 20:19:09","external_support_url":"","external_repository_url":"https:\/\/github.com\/WordPress\/performance","donate_link":"","header_plugin_uri":"https:\/\/github.com\/WordPress\/performance\/tree\/trunk\/plugins\/optimization-detective","header_author_uri":"https:\/\/make.wordpress.org\/performance\/","rating":4.3,"author_block_rating":0,"active_installs":70000,"downloads":389630,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1.0":{"tag":"0.1.0","author":"westonruter","date":"2024-03-22 23:47:04"},"0.1.1":{"tag":"0.1.1","author":"performanceteam","date":"2024-04-15 17:10:27"},"0.2.0":{"tag":"0.2.0","author":"performanceteam","date":"2024-05-20 17:12:16"},"0.3.0":{"tag":"0.3.0","author":"performanceteam","date":"2024-06-05 18:19:06"},"0.3.1":{"tag":"0.3.1","author":"performanceteam","date":"2024-06-12 05:26:03"},"0.4.0":{"tag":"0.4.0","author":"performanceteam","date":"2024-07-15 17:17:26"},"0.4.1":{"tag":"0.4.1","author":"performanceteam","date":"2024-07-19 03:23:01"},"0.5.0":{"tag":"0.5.0","author":"performanceteam","date":"2024-08-19 17:15:21"},"0.6.0":{"tag":"0.6.0","author":"performanceteam","date":"2024-09-23 17:49:22"},"0.7.0":{"tag":"0.7.0","author":"westonruter","date":"2024-11-12 00:47:08"},"0.8.0":{"tag":"0.8.0","author":"performanceteam","date":"2024-11-18 18:38:07"},"0.9.0":{"tag":"0.9.0","author":"performanceteam","date":"2024-12-18 18:22:47"},"1.0.0-beta1":{"tag":"1.0.0-beta1","author":"performanceteam","date":"2025-01-27 18:23:16"},"1.0.0-beta2":{"tag":"1.0.0-beta2","author":"performanceteam","date":"2025-02-13 19:42:05"},"1.0.0-beta3":{"tag":"1.0.0-beta3","author":"performanceteam","date":"2025-12-02 22:35:06"},"1.0.0-beta4":{"tag":"1.0.0-beta4","author":"performanceteam","date":"2026-01-09 00:12:34"},"1.0.0-beta5":{"tag":"1.0.0-beta5","author":"performanceteam","date":"2026-02-27 20:19:09"}},"upgrade_notice":{"0.3.0":"<p>Image loading optimizations have been moved to a new dependent plugin called Image Prioritizer. The Optimization Detective plugin now serves as a dependency.<\/p>"},"ratings":{"1":0,"2":0,"3":1,"4":0,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3098164,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3098164,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":3098164,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3098164,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3098164,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.2.0","0.3.0","0.3.1","0.4.0","0.4.1","0.5.0","0.6.0","0.7.0","0.8.0","0.9.0","1.0.0-beta1","1.0.0-beta2","1.0.0-beta3","1.0.0-beta4","1.0.0-beta5"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[187,247,31207],"plugin_category":[50,54],"plugin_contributors":[77594],"plugin_business_model":[216239],"class_list":["post-191163","plugin","type-plugin","status-publish","hentry","plugin_tags-optimization","plugin_tags-performance","plugin_tags-rum","plugin_category-media","plugin_category-security-and-spam-protection","plugin_contributors-wordpressdotorg","plugin_business_model-community","plugin_committers-adamsilverstein","plugin_committers-performanceteam","plugin_committers-westonruter","plugin_support_reps-mukesh27"],"banners":{"banner":"https:\/\/ps.w.org\/optimization-detective\/assets\/banner-772x250.png?rev=3098164","banner_2x":"https:\/\/ps.w.org\/optimization-detective\/assets\/banner-1544x500.png?rev=3098164","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/optimization-detective\/assets\/icon.svg?rev=3098164","icon":"https:\/\/ps.w.org\/optimization-detective\/assets\/icon.svg?rev=3098164","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin captures real user metrics about what elements are displayed on the page across a variety of device form factors (e.g. desktop, tablet, and phone) in order to apply loading optimizations which are not possible with WordPress\u2019s current server-side heuristics.<\/p>\n\n<p>This plugin is a framework dependency which does not provide optimization functionality on its own. For that, please install the <a href=\"https:\/\/wordpress.org\/plugins\/image-prioritizer\/\">Image Prioritizer<\/a> and <a href=\"https:\/\/wordpress.org\/plugins\/embed-optimizer\/\">Embed Optimizer<\/a> dependent plugins (among <a href=\"https:\/\/github.com\/WordPress\/performance\/labels\/%5BPlugin%5D%20Optimization%20Detective\">others<\/a> to come from the WordPress Core Performance team). There are currently <strong>no settings<\/strong> and no user interface for this plugin since it is designed to work without any configuration.<\/p>\n\n<p>Your site must currently have the <strong>REST API accessible<\/strong> to unauthenticated frontend visitors since this is how real user metrics are collected about pages on your site; nevertheless, <a href=\"https:\/\/github.com\/WordPress\/performance\/issues\/1311\">exploration<\/a> is underway for providing alternative mechanisms for collecting the metrics. Also, please note that no metrics are currently collected from Safari since it does not yet support the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/LargestContentfulPaint\">Largest Contentful Paint<\/a> metric, but support for this <a href=\"https:\/\/web.dev\/explore\/learn-core-web-vitals\">Core Web Vitals<\/a> metric is coming this year <a href=\"https:\/\/webkit.org\/blog\/16458\/announcing-interop-2025\/#core-web-vitals\">via Interop 2025<\/a>.<\/p>\n\n<p>Please refer to the <a href=\"https:\/\/github.com\/WordPress\/performance\/blob\/trunk\/plugins\/optimization-detective\/docs\/README.md\">full plugin documentation<\/a> for a <a href=\"https:\/\/github.com\/WordPress\/performance\/blob\/trunk\/plugins\/optimization-detective\/docs\/introduction.md\">technical introduction<\/a>, <a href=\"https:\/\/github.com\/WordPress\/performance\/blob\/trunk\/plugins\/optimization-detective\/docs\/hooks.md\">filter\/action hooks<\/a>, and <a href=\"https:\/\/github.com\/WordPress\/performance\/blob\/trunk\/plugins\/optimization-detective\/docs\/extensions.md\">extensions<\/a> that show use cases and examples. You can also watch the talk from WordCamp Asia 2025: <a href=\"https:\/\/weston.ruter.net\/2025\/02\/21\/boosting-performance-with-optimization-detective\/\">Boosting Performance with Optimization Detective<\/a>.<\/p>\n\n<!--section=installation-->\n<h4>Installation from the directory within WordPress<\/h4>\n\n<ol>\n<li>Visit <strong>Plugins &gt; Add New<\/strong> in the WordPress Admin.<\/li>\n<li>Search for <strong>Optimization Detective<\/strong>.<\/li>\n<li>Install and activate the <strong>Optimization Detective<\/strong> plugin.<\/li>\n<\/ol>\n\n<h4>Manual installation<\/h4>\n\n<ol>\n<li>Download the plugin <a href=\"https:\/\/downloads.wordpress.org\/plugin\/optimization-detective.zip\">ZIP from WordPress.org<\/a> or, after following the <a href=\"https:\/\/make.wordpress.org\/performance\/handbook\/performance-lab\/\">Getting Started instructions<\/a>, create a ZIP build from a clone of the <a href=\"https:\/\/github.com\/WordPress\/performance\">GitHub repo<\/a> via <code>npm run build:plugin:optimization-detective --env zip=true<\/code>.<\/li>\n<li>Visit <strong>Plugins &gt; Add New Plugin<\/strong> in the WordPress Admin.<\/li>\n<li>Click <strong>Upload Plugin<\/strong><\/li>\n<li>Select the <code>optimization-detective.zip<\/code> file on your system from step 1 and click <strong>Install Now<\/strong>.<\/li>\n<li>Click the <strong>Active Plugin<\/strong> button.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"where%20can%20i%20submit%20my%20plugin%20feedback%3F\"><h3>Where can I submit my plugin feedback?<\/h3><\/dt>\n<dd><p>Feedback is encouraged and much appreciated, especially since this plugin may contain future WordPress core features. If you have suggestions or requests for new features, you can <a href=\"https:\/\/github.com\/WordPress\/performance\/issues\/new\/choose\">submit them as an issue in the WordPress Performance Team's GitHub repository<\/a>. If you need help with troubleshooting or have a question about the plugin, please <a href=\"https:\/\/wordpress.org\/support\/plugin\/optimization-detective\/#new-topic-0\">create a new topic on our support forum<\/a>.<\/p><\/dd>\n<dt id=\"where%20can%20i%20report%20security%20bugs%3F\"><h3>Where can I report security bugs?<\/h3><\/dt>\n<dd><p>The Performance team and WordPress community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.<\/p>\n\n<p>To report a security issue, please visit the <a href=\"https:\/\/hackerone.com\/wordpress\">WordPress HackerOne<\/a> program.<\/p><\/dd>\n<dt id=\"how%20can%20i%20contribute%20to%20the%20plugin%3F\"><h3>How can I contribute to the plugin?<\/h3><\/dt>\n<dd><p>Contributions are always welcome! Learn more about how to get involved in the <a href=\"https:\/\/make.wordpress.org\/performance\/handbook\/get-involved\/\">Core Performance Team Handbook<\/a>.<\/p>\n\n<p>The <a href=\"https:\/\/github.com\/WordPress\/performance\/tree\/trunk\/plugins\/optimization-detective\">plugin source code<\/a> is located in the <a href=\"https:\/\/github.com\/WordPress\/performance\">WordPress\/performance<\/a> repo on GitHub.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0-beta5<\/h4>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Prevent fatal error in <code>od_get_current_url_metrics_etag()<\/code> when <code>$wp_query-&gt;posts<\/code> is <code>null<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2347\">2347<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Add support for dns-prefetch links. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2256\">2256<\/a>)<\/li>\n<\/ul>\n\n<h4>1.0.0-beta4<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Add URL Metric mutation helpers to extension initialization API. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1951\">1951<\/a>)<\/li>\n<li>Add gzip compression for URL metrics using Compression Streams API. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1959\">1959<\/a>)<\/li>\n<li>Allow disabling timestamp-based freshness checks by using negative TTL values. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1940\">1940<\/a>)<\/li>\n<li>Bump web-vitals from 5.0.3 to 5.1.0. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2116\">2116<\/a>)<\/li>\n<li>Change default garbage collection TTL of <code>od_url_metrics<\/code> posts from 1 month to 3 months and add the filter to customize expiration. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1950\">1950<\/a>)<\/li>\n<li>Enhance Optimization Detective meta generator tag with all disabled reasons. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1979\">1979<\/a>)<\/li>\n<li>Amend URL metrics to the generator meta tag content. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1954\">1954<\/a>)<\/li>\n<li>Improve construction of inline scripts with <code>sourceURL<\/code>, hardened JSON encoding, and exporting JSON in separate script. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2169\">2169<\/a>)<\/li>\n<li>Improve discoverability and user guidance for Optimization Detective extensions. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2261\">2261<\/a>)<\/li>\n<li>Remove deprecated <code>url_metrics_group_collection<\/code> and class aliases and bump required OD version in Image Prioritizer. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1943\">1943<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Avoid possible error when reading groups in debug mode. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2108\">2108<\/a>)<\/li>\n<li>Delay loading detect module until page is loaded and idle. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/2017\">2017<\/a>)<\/li>\n<li>Ensure URL Metric is initially constructed with all elements prior to initializing extensions. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1968\">1968<\/a>)<\/li>\n<li>Short-circuit detection when page is opened in background tab since web-vitals.js will not report LCP. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1927\">1927<\/a>)<\/li>\n<\/ul>\n\n<h4>1.0.0-beta3<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Fire actions before and after Optimization Detective processes a document. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1919\">1919<\/a>)<\/li>\n<li>Update <code>OD_HTML_Tag_Processor::next_tag()<\/code> to allow <code>$query<\/code> arg and prepare to skip visiting tag closers by default. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1872\">1872<\/a>)<\/li>\n<li>Expose the logging functions to client-side extensions and automatically account for the value of <code>isDebug<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1895\">1895<\/a>)<\/li>\n<li>Update URL Metric storage REST API endpoint to return status code <code>423 Locked<\/code> instead of <code>403 Forbidden<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1863\">1863<\/a>)<\/li>\n<li>De-duplicate logic between REST API and URL Metrics post type. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1867\">1867<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Fix URL encoding in Link HTTP response header. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1907\">1907<\/a>)<\/li>\n<li>Fix triggering post update actions after storing a URL Metric and refactor REST API endpoint logic into class. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1865\">1865<\/a>)<\/li>\n<li>Fix unpredictable LCP element being identified in a URL Metric Group. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1903\">1903<\/a>)<\/li>\n<li>Handle missing Web Crypto API in non-HTTPS contexts when generating the already-submitted <code>sessionStorage<\/code> key. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1911\">1911<\/a>)<\/li>\n<\/ul>\n\n<h4>1.0.0-beta2<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Account for 64 KiB limit for sending beacon data. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1851\">1851<\/a>)<\/li>\n<li>Add post ID for the <code>od_url_metrics<\/code> post to the tag visitor context. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1847\">1847<\/a>)<\/li>\n<li>Change minimum viewport width to be exclusive whereas the maximum width remains inclusive. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1839\">1839<\/a>)<\/li>\n<li>Disable URL Metric storage locking by default for administrators. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1835\">1835<\/a>)<\/li>\n<li>Include active plugins in ETag data and increase default freshness TTL from 1 day to 1 week. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1854\">1854<\/a>)<\/li>\n<li>Make ETag a required property of the URL Metric. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1824\">1824<\/a>)<\/li>\n<li>Use CSS range syntax in media queries. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1833\">1833<\/a>)<\/li>\n<li>Use <code>IFRAME<\/code> to display HTML responses for REST API storage request failures in Site Health test. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1849\">1849<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Prevent URL in <code>Link<\/code> header from including invalid characters. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1802\">1802<\/a>)<\/li>\n<li>Prevent optimizing post previews by default. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1848\">1848<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Documentation<\/strong><\/p>\n\n<ul>\n<li>Improve Optimization Detective documentation. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1782\">1782<\/a>)<\/li>\n<\/ul>\n\n<h4>1.0.0-beta1<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Add site health check to detect blocked REST API and short-circuit optimization when unavailable. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1762\">1762<\/a>)<\/li>\n<li>Allow extensions to opt in to using the web-vitals attribution build via the <code>od_use_web_vitals_attribution_build<\/code> filter. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1759\">1759<\/a>)<\/li>\n<li>Disambiguate XPaths for children of <code>BODY<\/code> with <code>id<\/code>, <code>class<\/code>, or <code>role<\/code> attributes. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1797\">1797<\/a>)<\/li>\n<li>Eliminate varying URL Metrics by logged-in state and discontinue disabling optimization by default for admins. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1788\">1788<\/a>)<\/li>\n<li>Improve test coverage for Optimization Detective. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1817\">1817<\/a>)<\/li>\n<li>Introduce <code>OD_Tag_Visitor_Context::track_tag()<\/code> method as alternative for returning <code>true<\/code> in tag visitor callback. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1821\">1821<\/a>)<\/li>\n<li>Omit element node index in XPaths up to children of BODY. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1790\">1790<\/a>)<\/li>\n<li>Skip visiting tags in the Admin Bar when optimizing a page. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1816\">1816<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Ensure optimization is performed in the wp-env local environment and log debug messages to console when disabled. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1822\">1822<\/a>)<\/li>\n<li>Skip visiting any tags inside of <code>NOSCRIPT<\/code> elements. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1783\">1783<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Documentation<\/strong><\/p>\n\n<ul>\n<li>Move Optimization Detective docs into <a href=\"https:\/\/github.com\/WordPress\/performance\/tree\/trunk\/plugins\/optimization-detective\/docs\"><code>README.md<\/code><\/a>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1763\">1763<\/a>)<\/li>\n<\/ul>\n\n<h4>0.9.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Add <code>fetchpriority=high<\/code> to <code>IMG<\/code> when it is the LCP element on desktop and mobile with other viewport groups empty. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1723\">1723<\/a>)<\/li>\n<li>Improve debugging stored URL Metrics in Optimization Detective. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1656\">1656<\/a>)<\/li>\n<li>Incorporate page state into ETag computation. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1722\">1722<\/a>)<\/li>\n<li>Mark existing URL Metrics as stale when a new tag visitor is registered. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1705\">1705<\/a>)<\/li>\n<li>Set development mode to 'plugin' in the dev environment and allow pages to be optimized when admin is logged-in (when in plugin dev mode). (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1700\">1700<\/a>)<\/li>\n<li>Add <code>get_xpath_elements_map()<\/code> helper methods to <code>OD_URL_Metric_Group_Collection<\/code> and <code>OD_URL_Metric_Group<\/code>, and add <code>get_all_element_max_intersection_ratios<\/code>\/<code>get_element_max_intersection_ratio<\/code> methods to <code>OD_URL_Metric_Group<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1654\">1654<\/a>)<\/li>\n<li>Add <code>get_breadcrumbs()<\/code> method to <code>OD_HTML_Tag_Processor<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1707\">1707<\/a>)<\/li>\n<li>Add <code>get_sample_size()<\/code> and <code>get_freshness_ttl()<\/code> methods to <code>OD_URL_Metric_Group<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1697\">1697<\/a>)<\/li>\n<li>Expose <code>onTTFB<\/code>, <code>onFCP<\/code>, <code>onLCP<\/code>, <code>onINP<\/code>, and <code>onCLS<\/code> from web-vitals.js to extension JS modules via args their <code>initialize<\/code> functions. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1697\">1697<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Prevent submitting URL Metric if viewport size changed. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1712\">1712<\/a>)<\/li>\n<li>Fix construction of XPath expressions for implicitly closed paragraphs. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1707\">1707<\/a>)<\/li>\n<\/ul>\n\n<h4>0.8.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Serve unminified scripts when <code>SCRIPT_DEBUG<\/code> is enabled. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1643\">1643<\/a>)<\/li>\n<li>Bump web-vitals from 4.2.3 to 4.2.4. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1628\">1628<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Eliminate the detection time window which prevented URL Metrics from being gathered when page caching is present. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1640\">1640<\/a>)<\/li>\n<li>Revise the use of nonces in requests to store a URL Metric and block cross-origin requests. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1637\">1637<\/a>)<\/li>\n<li>Send post ID of queried object or first post in loop in URL Metric storage request to schedule page cache validation. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1641\">1641<\/a>)<\/li>\n<li>Fix phpstan errors. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1627\">1627<\/a>)<\/li>\n<\/ul>\n\n<h4>0.7.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Send gathered URL Metric data when the page is hidden\/unloaded as opposed to once the page has loaded; this enables the ability to track layout shifts and INP scores over the life of the page. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1373\">1373<\/a>)<\/li>\n<li>Introduce client-side extensions in the form of script modules which are loaded when the detection logic runs. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1373\">1373<\/a>)<\/li>\n<li>Add an <code>od_init<\/code> action for extensions to load their code. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1373\">1373<\/a>)<\/li>\n<li>Introduce <code>OD_Element<\/code> class and improve PHP API. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1585\">1585<\/a>)<\/li>\n<li>Add group collection helper methods to get the first\/last groups. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1602\">1602<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Fix Optimization Detective compatibility with WooCommerce when Coming Soon page is served. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1565\">1565<\/a>)<\/li>\n<li>Fix storage of URL Metric when plain non-pretty permalinks are enabled. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1574\">1574<\/a>)<\/li>\n<\/ul>\n\n<h4>0.6.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Allow URL Metric schema to be extended. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1492\">1492<\/a>)<\/li>\n<li>Clarify docs around a tag visitor's boolean return value. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1479\">1479<\/a>)<\/li>\n<li>Include UUID with each URL Metric. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1489\">1489<\/a>)<\/li>\n<li>Introduce get_cursor_move_count() to use instead of get_seek_count() and get_next_token_count(). (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1478\">1478<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Add missing global documentation for <code>delete_all_posts()<\/code>. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1522\">1522<\/a>)<\/li>\n<li>Introduce viewport aspect ratio validation for URL Metrics. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1494\">1494<\/a>)<\/li>\n<\/ul>\n\n<h4>0.5.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Bump web-vitals from 4.2.1 to 4.2.2. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1386\">1386<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Disable Optimization Detective by default on the embed template. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1472\">1472<\/a>)<\/li>\n<li>Ensure only HTML documents are processed by Optimization Detective. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1442\">1442<\/a>)<\/li>\n<li>Ensure the entire template is passed to the output buffer callback for Optimization Detective to process. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1317\">1317<\/a>)<\/li>\n<li>Implement full support for intersectionRect\/boundingClientRect, fix viewportRect typing, and harden JSON schema. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1411\">1411<\/a>)<\/li>\n<\/ul>\n\n<h4>0.4.1<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Upgrade web-vitals.js from <a href=\"https:\/\/github.com\/GoogleChrome\/web-vitals\/blob\/main\/CHANGELOG.md#v350-2023-09-28\">v3.5.0<\/a> to <a href=\"https:\/\/github.com\/GoogleChrome\/web-vitals\/blob\/main\/CHANGELOG.md#v422-2024-07-17\">v4.2.1<\/a>.<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Fix logic for seeking during optimization loop to prevent emitting seek() notices. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1376\">1376<\/a>)<\/li>\n<\/ul>\n\n<h4>0.4.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Avoid passing positional parameters in Optimization Detective. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1338\">1338<\/a>)<\/li>\n<li>Send preload links via HTTP Link headers in addition to LINK tags. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1323\">1323<\/a>)<\/li>\n<\/ul>\n\n<h4>0.3.1<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Log URL Metrics group collection to console when debugging is enabled (<code>WP_DEBUG<\/code> is true). (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1295\">1295<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Include non-intersecting elements in URL Metrics to fix lazy-load optimization. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1293\">1293<\/a>)<\/li>\n<\/ul>\n\n<h4>0.3.0<\/h4>\n\n<ul>\n<li>The image optimization features have been split out into a new dependent plugin called <a href=\"https:\/\/wordpress.org\/plugins\/image-prioritizer\/\">Image Prioritizer<\/a>, which also now optimizes image lazy-loading. (<a href=\"https:\/\/github.com\/WordPress\/performance\/issues\/1088\">1088<\/a>)<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<p><strong>Enhancements<\/strong><\/p>\n\n<ul>\n<li>Add optimization_detective_disabled query var to disable behavior. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1193\">1193<\/a>)<\/li>\n<li>Facilitate embedding Optimization Detective in other plugins\/themes. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1185\">1185<\/a>)<\/li>\n<li>Use PHP 7.2 features in Optimization Detective. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1162\">1162<\/a>)<\/li>\n<li>Improve overall code quality with stricter static analysis checks. (<a href=\"https:\/\/github.com\/WordPress\/performance\/issues\/775\">775<\/a>)<\/li>\n<li>Bump minimum PHP requirement to 7.2. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1130\">1130<\/a>)<\/li>\n<\/ul>\n\n<p><strong>Bug Fixes<\/strong><\/p>\n\n<ul>\n<li>Avoid _doing_it_wrong() for Server-Timing in Optimization Detective when output buffering is not enabled. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1194\">1194<\/a>)<\/li>\n<li>Ensure only HTML responses are optimized. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1189\">1189<\/a>)<\/li>\n<li>Fix XPath indices to be 1-based instead of 0-based. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1191\">1191<\/a>)<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Use plugin slug for generator tag. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1103\">1103<\/a>)<\/li>\n<li>Prevent detection script injection from breaking import maps in classic themes. (<a href=\"https:\/\/github.com\/WordPress\/performance\/pull\/1084\">1084<\/a>)<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Provides a framework for leveraging real user metrics to detect optimizations for improving page performance.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/191163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=191163"}],"author":[{"embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/performanceteam"}],"wp:attachment":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=191163"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=191163"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=191163"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=191163"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=191163"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=191163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}