Ashutosh Sharma
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: wordpress update error messageIf you’re sure that the updated was installed successfully, but the warning is still there, you will have to delete
.maintenance
file from your WP root directory. You can follow this guide to delete the file using cPanel, or FTP.You also have WP Maintenance Mode & Site Under Construction plugin, and that should be deactivated to disable maintenance mode as well.
You have either used custom code, or a plugin to defer JS:
URLs are no longer valid, resulting in JS errors and request failures. You need to remove that code, or disable the plugin.
Forum: Fixing WordPress
In reply to: Unexpected ‘Related Images’ Content on All Pages and PostsYou can use String Locator to search for this text in all the files. If there are no matches, try Search Regex to search your DB. Be careful while using Search Regex as it also allows you to replace text in the DB.
Forum: Fixing WordPress
In reply to: Not able to login admin panelAdd the following to
wp-config.php
file while working locally:define('COOKIEPATH', ''); define('SITECOOKIEPATH', '');
Forum: Fixing WordPress
In reply to: static page without any plugins involvedI guess you can use https://www.ads-software.com/plugins/freesoul-deactivate-plugins/ to deactivate all the plugins on that “empty” page.
Forum: Fixing WordPress
In reply to: Cloned site in subdirectory keeps redirecting to rootAFAIK, WordPress is handling the redirect because
/index.php
is being used. When you are visiting/old/
nginx finds the “old” directory, and then/old/index.php
file is used. But when you have/old/some-page
nginx won’t find that “some-page” in the “old” directory, therefore, the request will again be handled by/index.php
. You have to tell nginx to use/old/index.php
to handle the requests when/old/
is requested. Something like this:location /old/ { try_files $uri $uri/ /old/index.php; }
Forum: Fixing WordPress
In reply to: Cloned site in subdirectory keeps redirecting to rootYes, the pages are being redirected by WP. Check
.htaccess
file inside the “old” directory, theRewriteBase
line should beRewriteBase /old
and not justRewriteBase /
but if your server is only using Nginx, then the.htaccess
file won’t work, and you will have to update Nginx config instead.Forum: Fixing WordPress
In reply to: Cron not working on wordpress hosted on AWS lightsailTry using WP-CLI instead:
wp --path=/opt/bitnami/wordpress cron event run --due-now
Forum: Fixing WordPress
In reply to: Why is WordPress setting high fetch priority on images?I was in a similar situation where WP was adding
fetchpriority
attribute to an image that was positioned near the center of the page. While searching for a solution, I foundwp_maybe_add_fetchpriority_high_attr()
. Upon examining the code, I discovered that there is a filter calledwp_min_priority_img_pixels
. You can use this filter to define “the minimum square-pixels threshold for an image to be eligible as the high-priority image”. This threshold defaults to “50000px” (width
×height
), which explains why it may be added to a different image than what you expect.However, WP actually uses
wp_get_loading_optimization_attributes()
to add various “optimization” attributes to images.AFAIK, there are two ways to stop WP from including
fetchpriority
attribute, or having some control over it:- You can adjust the threshold value by using the
wp_min_priority_img_pixels
filter. Consider setting it to a large value likePHP_INT_MAX
to remove the attribute. Additionally, if you simply want to lower the threshold to prioritize a better image, this filter will come in handy. - Use
wp_get_loading_optimization_attributes
filter to modify the$loading_attrs
array and removefetchpriority
from it.
- You can adjust the threshold value by using the