• Resolved jeeya1609

    (@jeeya1609)


    Hello there,

    Recently i am encountering an issue on my website as am not able to save setting in wp-admin/customize.php

    Everytime am trying to save css, it is giving me Looks like something’s gone wrong. Wait a couple seconds, and then try again.

    While inspecting i found the following error :

    Failed to load resource: the server responded with a status of 400 (Bad Request)

    /wp-admin/admin-ajax.php

    POST /wp-admin/admin-ajax.php 404 (Not Found)
    jquery.min.js?ver=3.7.1

    I tried to disable all plugins except Wordfence and am still getting the error.

    So, i suspect the issue is with Wordfence. I have sent you the diagnosis under the name jeeya1609.

    Your assistance will be helpful.

    Regards,

    Jeeya

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609,

    Thanks for sending those diagnostics.  Wordfence would not cause admin-ajax.php to return a 404 error.   If you deactivate Wordfence on the site and you have the same problem with WordPress AJAX functionality then Wordfence is not involved and you can ask for help on the forum below:

    https://www.ads-software.com/support/forum/how-to-and-troubleshooting/ 

    From your description, I suspect this may be related to ModSecurity on the server.  ModSecurity is an open source web application firewall that can generally be configured to augment what a recommended WordPress security plugin like Wordfence does in a compatible way. Please reach out to your host to review the server logs for any errors occurring at the time of the 404 error.

    Thanks,
    Margaret

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello Margaret,

    Thank you for your reply.

    I have disabled all plugins except wordfence, and i could experience same issue.

    I have also disable ModSecurity on the server and the issue still persists.

    I have removed wordfence completely including the tables in database and re-install, and i see that once i add the license key, the issue appears again

    Can you please advise.

    Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609,

    Thank you for testing with ModSecurity disabled.  To confirm, if Wordfence is deactivated, are you still seeing a 404 error response from admin-ajax.php when editing your CSS?

    If not, are you seeing any new errors reported in your PHP error log when editing the CSS?  You can view the location of this log file in Wordfence > Diagnostics > Log Files.

    Thanks,
    Margaret

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    No, when wordfence is disabled, there is no issue 404 page not found for the admin-ajax.php.

    In the log, i can see only these warning:

    PHP Warning: Uncaught wfWAFAllowException in /home/sitename/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php:1053
    Stack trace: 0 /home/sitename/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php(604): wfWAF->allow(Object(wfWAFRule), Object(wfWAFRuleComparisonFailure)) 1 /home/sitename/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/rules.php(160): wfWAF->tripRule(Object(wfWAFRule)) 2 /home/sitename/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php(396): wfWAFRule->evaluate() 3 /home/sitename/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php(281): wfWAF->runRules() 4 /home/sitename/public_html/wp-content/plugins/wordfence/waf/bootstrap.php(998): wfWAF->run() 5 /home/sitename/public_html/wp-content/plugins/wordfence/wordfence.php(117): require_once(‘/home/sitenamemupr…’) 6 /home/sitename/public_html/wp-settings.php(517): include_once(‘/home/sitenamemupr…’) 7 /home/sitename/public_html/wp-config.php(98): require_once(‘/home/sitenamemupr…’) 8 /home/sitename/public_html/wp-load.php(50): require_once(‘/home/sitenamemupr…’) 9 /home/sitename/public_html/wp-admin/admin-ajax.php(22): require_once(‘/home/sitenamemupr…’) 10 {main}

    thrown in /home/sitename/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 1053

    Also, when deleting the plugin wordfence complete including the table and database and i re-install it. I don’t have the issue with the admin-ajax.php.

    But the issue arises when i add the free license key.

    Can you please advise.

    Kind regards,

    Jeeya

    Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609,

    Thanks for providing us with that additional information.  When adding the license key back and editing your CSS again, is a new warning generated in your PHP error logs?  If so, please try restarting PHP-FPM on the server if possible.

    I’d also like to rule out a theme conflict.  Please try activating a default theme such as Twenty Twenty-Four and let us know if the issue continues.

    Please also review any blocked traffic from your IP in Wordfence > Tools > Live Traffic.  You can obtain your IP at https://www.whatismyipaddress.com/.  If you see any blocked actions that you know are safe, you can click the “Add param to firewall allowlist” button to allow those actions in the future.

    If you’re not seeing any blocked attempts, you may benefit from switching the firewall back to Learning Mode temporarily in Wordfence > Firewall > Manage WAF > Web Application Firewall Status > Learning Mode.  Please ensure you configure a date to enable the firewall again by checking Automatically enable on, and then click Save Changes to save.

    Thanks,
    Margaret

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    ?is a new warning generated in your PHP error logs? – No, nothing new

    ?Please try activating a default theme such as Twenty Twenty-Four and let us know if the issue continues. – the issue still perists

    Please also review any blocked traffic from your IP in?Wordfence > Tools > Live Traffic. – there is not blocked IP

    If you’re not seeing any blocked attempts, you may benefit from switching the firewall back to Learning Mode? – Still having same issue.

    After some testing i saw that when i disable the whitelist url rule in wordfence, i don;t have the issue with admin-aja.php 404.

    I have disabled all firewall on server, i still having same issue.

    Can you please advise further.

    Kind regards,

    Jeeya

    Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609, thanks for checking over everything!

    We believe, given the PHP error you sent previously, as well as the issues you’re still seeing ongoing, that there may be an issue with OPcache or PHP-FPM impacting the site. Please try restarting PHP-FPM or reach out to your host to request they restart PHP-FPM. Let us know if the issue continues or changes once PHP-FPM has been restarted.

    Thanks,
    Margaret

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    Please note that even after restarting PHP-FPM, this doesn’t resolve the issue.

    I don’t understand the cause and neither finding a solution to the problem.

    Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609,

    Thanks for getting back to us and I appreciate your patience.? We’d like to try to get some more context on the error you’re seeing, please.

    Can you give us details on how PHP-FPM was restarted, please?? If you’re on cPanel-based hosting, can you try stopping PHP-FPM, waiting several seconds, and then starting it again?? We want to ensure it was fully restarted, rather than just reloaded.

    Since restarting PHP-FPM, have you seen any new errors in your PHP error log, particularly near the time you try to save settings in customize.php?  If so, please paste those here or email us a copy of those at wftest @ wordfence . com with your forum username in the subject.

    Can you also try saving your settings while keeping a Browser Console open to see if you can detect any JavaScript errors or files that fail to load? If you see any red text in the console, please take a screenshot of it and send it to me.

    Thanks,
    Margaret

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello Margaret,

    Please find below erros found in console log while saving css in customize.php

    admin-ajax.php 404 xhr jquery.min.js?ver=3.7.1:2

    POST /wp-admin/admin-ajax.php 404 (Not Found) jquery.min.js?ver=3.7.1:2

    Kind regards,

    Jeeya

    Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609,

    Thanks for following up with us, I appreciate you sending those again. If possible, we’d still like to get more information on what’s happening with PHP on the server at this time as well.

    Can you give us details on how PHP-FPM was restarted, please?  If you’re on cPanel-based hosting, can you try stopping PHP-FPM, waiting several seconds, and then starting it again?  We want to ensure it was fully restarted, rather than just reloaded.

    Since restarting PHP-FPM, have you seen any new errors in your PHP error log, particularly near the time you try to save settings in customize.php?? If so, please paste those here or email us a copy of those at?wftest @ wordfence . com?with your forum username in the subject.

    Thanks,
    Margaret

    Thread Starter jeeya1609

    (@jeeya1609)

    Hello,

    On ?cPanel, I have disable the php-fpm, waited for several seconds and re-activated it, still facing the same issue.

    I have sent the errors on wftest @ wordfence . com

    I hope it get resolves as soon as possible as many websites are being impacted.

    Kind regards,
    Jeeya

    Plugin Support wfmargaret

    (@wfmargaret)

    Hi @jeeya1609,

    Thank you for sending the screenshots and that explanation.? To try to save you some time, there’s quite a bit of information I’d like to ask you, so please read through this carefully to make sure we have everything we need to best help you.

    The screenshot you sent was for a different site than the diagnostic you had initially sent.  Please send diagnostics for the new site. You can find the link to do so at the top of the Wordfence > Tools > Diagnostics page. Then click on “Send Report by Email”. Send that to wftest @ wordfence . com.  Include your forum username where indicated.

    As you reported this is impacting multiple sites, are all the impacted sites using load balancing?

    What is the total server memory on the server for the recent site?  We’re seeing long load times before the admin-ajax.php file returns a 404 error.  We want to rule out a runaway PHP process, so I’d like to have you make a couple of adjustments on the site.

    From the initial diagnostics you sent, the PHP memory_limit is set to 3072M.? Please adjust this to 256M or 512M.

    Your max_execution_time is set to 800 seconds.? Please adjust this to 30 or 60.

    Please restart PHP-FPM after making those updates.

    Please note that, while it’s rare, if your site does require a large amount of memory, you can update the settings back to the initial values to undo the changes.??

    We would then like a copy of any recent errors in your PHP log, please.? Once you’ve updated the max_execution_time and memory_limit, please recreate the 404 error and send us a copy of any recent errors in the PHP error log at wftest @ wordfence . com.? Please include your forum username in the subject.

    If possible, please also review the syslog for any errors around the time you’re seeing the 404 error.? The syslog is typically located at /var/log/messages.? Your host can help review this if needed.? Please send a copy of that to wftest @ wordfence . com with your forum username in the subject.

    If you’re willing to share it with us, we’d also like to request a copy of the CSS you’re trying to save so that we can try to replicate the error.? You can send a copy of that to wftest @ wordfence . com with your forum username in the subject.

    Thanks for your patience,
    Margaret

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘admin-ajax.php 404 (Not Found)’ is closed to new replies.