Better Resource Hints
Better Resource Hints will make your WordPress site or application faster and generally more performant by intelligently leveraging resource hints like prefetch, preload, preconnect, and server push. As it stands, WordPress isn’t that bad about providing a base level of these hints. In fact, a basic, dedicated API has been shipped since version 4.6.. However, this functionality only scratches the service, providing only dns-prefetch tags out of the box, and there’s growing opportunity to take advantage of different hints as they are introduced and gain more browser support. Specifically, this plugin focuses on the following types of hints for your styles and JavaScript assets: Preconnecting – This hint is similar to “dns-prefetch,” but a beefier version. Instead of just resolving the DNS, the preconnect hint handles TLS negotiations and TCP handshakes, resulting in reduced page latency. Preloading – Preloading occurs when the browser is told it can start downloading an asset in the background early during page load, instead of waiting until the asset is explicitly called to start the process. This hint is most beneficial for assets loaded later on in the page, but are nonetheless essential to the page’s functionality. More often than not, this is a JavaScript file. Enabling this results in an overall faster load time, and quicker time to interactive. Prefetching – Prefetching assets is similar to preloading, but the assets are downloaded in low priority for the purpose of caching them for later use. For example, if a user hits your home page and is likely to go to a page that uses a heavy JavaScript file, it’s wise to prefetch that asset on the home page, so it’s cached and ready to go on the next. Again, the result is a quicker subsequent page load, quicker time to interactive, and an improved overall user experience. This is different from DNS prefetching, which will only resolve the DNS of a resource’s host, and not actually download the resource itself. Server Push – If enabled, server push will tell your server to start delivering an asset before the browser even asks for it. This results in a much faster delivery of key assets, and be toggled on for both preloaded, prefetched, and preconnected assets. Note: This feature requires a server that supports server push, and is the most experimental strategy this plugin provides. As with any sort of performance-enhancing technique, just be aware that they should be used judiciously, and that the results you see will depend on the size the of resources your site loads, as well as how your server is configured. For additional reading, see some of the resources below: Preload, Prefetch, & Priorities in Chrome Preloading Key Requests Preload: What’s It Good For? Resource Hints – What is Preload, Prefetch, and Preconnect? What Makes This Plugin Stand Apart? There’s no shortage of plugins out there that aim to leverage resource hints for boosting performance. However, I’ve seen that several of them make the following mistakes: Inflexible Hint Management Many similar plugins only provide very limited flexibility in their options, and only allow setting hints globally for every page, regardless of whether the resources are actually needed on the page. This can often result in unecessarily bloaging your bandwidth, since hints on several pages are effectively useless. In some cases, this could actually lead to a less performant site. This plugin attempts to provide options to manage hints more flexibily and intelligently, meaning you won’t be unecessarily preloading assets in the background when they’re not even needed on the page. Misunderstanding What Different Hints Do I’ve come across some plugins that fail to understand and leverage different hints like they were designed. For example, promising that assets are being preloaded, when they’re actually being prefetched. These and other hints have very different purposes, and should not be interchangably used if you want them to impact your site in the most effective way. This plugin attempts to leverage these hints in way to maximize their effectiveness. For example, BHR won’t prefetch any assets that are enqueued on the page, because that’s just not how the prefetch hint is designed to be used. Is Better Resource Hints perfect? Absolutely not. That’s why I encourage any constructive feedback or bug reports to be sent my way immediately, so that I can’t improve this plugin as quickly as possible. A Note About Preloading CSS Because of their high placement on a page, if the option is enabled, your CSS files will be asyncronously preloaded, and then turned into a stylesheet once they’ve completely loaded. The advantage to doing this is that while the files are downloading, they won’t block the rest of the page from rendering, resulting an overall faster page load. However, this also means that there may be a flash of unstyled content on the page for a brief moment as the files download. To prevent this, it’s recommended to only preload CSS files that are not critical to the initial view of the page. This will allow you to gain some performance points without sacrificing use experience as the page loads. Filters The following filters are exposed for your use. /** * Modify the HTML link generated for preconnecting hosts. * * @param string $link (HTML tag) * @param string $url (URL of the host) * @return string */ add_filter('better_resource_hints_preconnect_tag', function ($link, $url) { return $url; }, 10, 2); /** * Modify the HTML link generated for prefetching hosts. * * @param string $link (HTML tag) * @param string $handle (WP handle of the resource * @param string $type (script or style) * @return string */ add_filter('better_resource_hints_prefetch_tag', function ($link, $handle, $type) { return $url; }, 10, 3); /** * Modify the HTML link generated for preloading hosts. * * @param string $link (HTML tag) * @param string $handle (WP handle of the resource * @param string $type (script or style) * @return string */ add_filter('better_resource_hints_preload_tag', function ($link, $handle, $type) { return $url; }, 10, 3); What Happens Out of the Box? Upon activation, Better Resource Hints will optimize your resource hints in a conservative, low-risk way by only doing two things out of the box: Preloading JavaScript assets enqueued in the footer. Setting preconnect hints for all third party hosts that already have dns-preconnect hints. Using the Plugin After activation, you are able to adjust settings to tweak optimization as seen fit. As a means of testing your optimizations, use a tool like Google Lighthouse to measure the impact of these changes on your site’s performance. As mentioned, the techniques used here are largely supported by modern browsers, but your results may vary depending on the amount of assets being loaded on your site, as well as your server configuration. Feedback You like it? Email or tweet me. You hate it? Email or tweet me. Regardless of how you feel, your review would be greatly appreciated!
Plugin Detective – Troubleshooting Conflicts
Plugin Detective helps you troubleshoot issues on your site quickly and easily to find the cause of a problem. Once the culprit is found, the problem plugin can be quickly deactivated. You can even fix your site when it has the white screen of death (fatal error). You’ll want to have Plugin Detective installed, so if your site crashes from a conflict or bad plugin update, you can get it back up and running quickly! Plugin Detective is your best friend when you need to: – Troubleshoot WordPress plugin conflicts – Remove stuck .maintenance files – Recover your site from fatal errors caused by plugins We’ve all been there–something’s broken on your site. You’ve looked around the web for advice about what to do and have stumbled across the typical wisdom: deactivate all your plugins and then reactivate them one by one, checking your site for the problem after each reactivation. Ugh. Sure, it works. But who has time for that? Find Plugin Conflicts with Detective Otto Bot Detective Otto Bot walks you through solving your case one step at a time, all from one single screen. Open a case and tell Detective Otto where you’re seeing the problem. If your site requires any plugins to run correctly, tell Otto about those, too. Then, Otto will interrogate the suspects and track clues, checking in with you from time to time. All you need to do is answer “Yes, it’s fixed” or “No, it’s still broken” each time. Otto will do the rest and find the culprit in minutes. Best of all – Plugin Detective can work even if you’re seeing the White Screen of Death on your site or if all you can see are PHP errors. Please have a look at the FAQ’s for how to access Plugin Detective and log into WordPress even if you can’t get to your login screen. Once Otto has identified the culprit, you can quickly deactivate the troublesome plugin and go about your day. Remove Stuck .Maintenance File or Scheduled Maintenance Have you gotten stuck in maintenance mode on WordPress? The dreaded “Briefly unavailable for scheduled maintenance. Check back in a minute” message haunts you; the minute never ends! With Plugin Detective installed you can quickly get out of these situations without the hassle of deleting files via your host or FTP. Just tack on this slug to the end of your website URL: /wp-content/plugins/plugin-detective/troubleshoot/?restore=1 So that your URL looks like this: https://yoursite.com/wp-content/plugins/plugin-detective/troubleshoot/?restore=1 This will prompt you to log in and automatically remove that stuck maintenance file for you. Who Can Use This Troubleshooting Tool? Plugin Detective is a tool that requires no coding experience or technical knowledge to use. For that reason, Plugin Detective is the ideal troubleshooting and conflict-checking tool for: Any WordPress website owner Developers and technical support engineers Plugin and theme owners and their support teams Debug Tool Features Strategically activate and deactivate plugins on your site to help you find the plugin causing trouble Open Plugin Detective for troubleshooting on any page on your site – both in the backend and the frontend! Choose any subset of your active plugins as the baseline for your testing Loved by Plugin Support Teams The Simply Schedule Appointments and Draw Attention support teams love to share this conflict-checking tool with their customers. Plugin Detective makes it easy for their clients to debug performance issues and figure out plugin conflicts in a jiffy! 1.2.14 – 2023-06-10 Features and Improvements Fix PHP 8.2 compatibility 1.2.13 – 2023-05-25 Features and Improvements Update required WP version to 6.1 1.2.12 – 2023-05-25 Features and Improvements Update required WP version to 6.1 1.2.11 – 2023-04-27 Features and Improvements PR:#25 – Compatibility with WordPress 6.2 1.2.10 – 2023-04-11 Fixes PR:#19 – Prevent fatal error on WP versions where WP_Textdomain_Registry doesn… Features and Improvements 1.2.9 – 2023-03-28 Fixes Features and Improvements 1.2.8 – 2023-03-28 Fixes Features and Improvements 1.2.7 – 2023-03-28 Fixes Features and Improvements 1.2.6 – 2023-02-24 no changes 1.2.3 Fixed for WP 6.1 compatibility 1.2.1 Fixed for WP 5.9 compatibility 1.1.8 Fixed for WP 5.8 compatibility 1.1.8 For older changelog entries, please see the additional changelog.txt file delivered with the plugin.