Is it necessary to use escape functions on everything or is it only necessary if you’re taking input from a 3rd party? (End Users, APIs, Etc.)

that wordpress.org page was probably written by someone that do not get security. Escaping is done to make sure that your output, when is part of an HTML page, is displayed to the user as you intend it to be which means converting thing like “<” to the appropriate HTML entity. Yes, if you do … Read more

How to add fetchpriority to first 2 images in wordpress?

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);

Initial Connection takes 42 seconds

First I would visit a single file in the browser, like an image file, to see if the server loads that quickly or not. If the image loads slowly, you will know it is a server speed problem. But if the image is fine, most likely there will be a PHP code slowing the website … Read more