you can use this filter to add attributes too.
e.g. like that with you own counter :
add_filter("wp_get_loading_optimization_attributes", function ($loading_attrs, $tag_name, $attr, $context) {
if (!isset($GLOBALS["MY_PLUGIN"]["fetchpriority_count"])) {
$GLOBALS["MY_PLUGIN"]["fetchpriority_count"] = 0;
}
if ($GLOBALS["MY_PLUGIN"]["fetchpriority_count"] < 5) {
$GLOBALS["MY_PLUGIN"]["fetchpriority_count"]++;
$loading_attrs["fetchpriority"] = "high";
}
return $loading_attrs;
}, 10, 4);
Related Posts:
- What is the difference between set and hashset in C++ STL?
- When should we use Radix sort?
- What is the best way to profile javascript execution?
- How to parallelize downloads across hostnames on WordPress?
- How to parallelize downloads across hostnames on WordPress?
- Steps to optimize WordPress in regard to server load and website speed?
- What are the best practices for using a caching plugin on a shared host?
- How can I debug the TTFB in WP?
- What’s the difference between wp_insert_user() and wp_create_user()
- How to fix wordpress slow first time load (Local Server)?
- What’s the ideal way to profile WordPress memory usage?
- Localized WordPress is much slower?
- W3 Leverage browser caching not working for google pagespeed [closed]
- get_adjacent_post alternative on a very large db
- Website is slow: advice on optimization
- Can we have a post without a slug?
- Refresh external feeds only in cron?
- Use override_load_textdomain for cache translation and improve performance
- Combine JS and CSS for WordPress admin
- Any reason why wp_cache_set not to work?
- Will removing revisions positively impact database performance?
- Is WordPress fast enough for a heavy traffic project?
- Does a WP site consumes memory resources when there are NO visitors?
- Extremely slow WordPress website with 6000 posts
- In terms of performance – Is unmanaged VPS better than a managed one – for WP sites?
- How can WordPress be made more memory efficient?
- Get Y random authors’ ID/Object with more than X number of posts
- What is a reasonable get_num_queries() result?
- Disable Outbound Web Requests
- WordPress performance issue. Can I debug it?
- Hardcoding and WordPress Performance
- What should be disabled to run on an internal network with no access to the Internet?
- Does running WordPress on Nginx do “squat” for its performance?
- The effect of spam comments on hosting resource usage (CPU)
- How much will mounting wp-content on a separate NFS server impact performance?
- Could a higher number of registered image sizes affect performance?
- How many caching plugins should be used?
- Image Preloading
- Performance impact of using global $post
- WordPress Scalability – One Instance or Several?
- What Is The Best Method/Tool To Investigate WordPress Internal Performance?
- Do WP_debug notices explain why my site runs so slow?
- cross-host benchmarking with wordpress
- Performance problem with first load
- WordPress Caching On Demand
- Is there a real benefit in using wordpress optimized hosting?
- What is better to use, user meta, custom taxonomies or new database structure? [closed]
- How to disable Vary cache header on W3Total Cache plugin [closed]
- Point static content like css and js to cookieless subdomain
- upper limit on concurrent editing?
- Native Lazy Loading on Safari
- Page taking time in loading. Also used lazy loading but doesn’t work?
- Identify running process that constantly use 5% CPU
- Debugging high CPU usage during periods of inactivity
- How accurate is P3 Plugin profiler
- Suggestion to improve slow WordPress page
- Optimizing site speed by localizing paths
- get_the_id, get_the_permalink, and get_the_title all with one DB call
- Long wait times in first part of call to WordPress on Azure
- How to optimize on-the-fly theme switching for mobile browsers?
- Wordress importing scripts
- Server Hardware for WordPress [closed]
- How to test site speed?
- Measure WordPress performance on different hosts
- Performance testing a WordPress site locally?
- wordpress extremely slow on NAS
- Minifing js files with w3 total cache and expiring the combined file [closed]
- Does fixing PHP notices improves website performance?
- How do you make a site load faster when offloading is not an option?
- how to embed Pdf and Video Without effecting page speed?
- Slow issues with Website running WordPress on Azure
- WordPress is very slow, even it’s not opening sometimes
- Write/saved logs in WordPress
- Favicon is loading very late
- Website slow : my fault or the host?
- Best way of coding a theme with multiple languages in WordPress
- Website Load Time takes forever
- How fast can I expect WordPress to be on a fresh install locally?
- Change loading order of blocks
- get_template_part calls amount and performance?
- REST api v2 how can modify respond types and make custom DTO for better performance
- Website is loading twice unnecessarily
- Why is the server response time slowing my site down? [closed]
- High I/O load when hosting lots of wordpress sites
- How to handle high load of traffic of my server
- How to preload the entire site with javascript?
- How we can reduce wordpress page loading time? [closed]
- How to Aggregate, minify and compress (AMC) static and dynamic resources?
- How to improve my site’s loading time?
- How to resolve google page speed issues for wordpress website
- WordPress and TTFB (time to first byte) stats
- What’s a good tool for speed benchmarking? [closed]
- How can we remove “unused”/no long used calls when loading the homepage?
- Are networks now faster than disks?
- How can a single disk in a hardware SATA RAID-10 array bring the entire array to a screeching halt?
- High load average, low CPU usage – why?
- Very long initial loading (20sec)
- How can I optimize my website for improved speed? [closed]
- Identifying Issues in Pagespeed Insights: Server Response Time and Long Main Thread Tasks
- Page loads but doesn’t often doesn’t render until interacted with