How to Fix WordPress Debugging Errors - wordpress

I have been having some weird behavior in the dashboard of my WordPress site. Out of the blue, my site started to appear corrupted. When writing a post, the publish button would dim after a minute or two and I had to exit the page and redo the post, saving immediately. Then my widgets stopped saving. I tried enabling accessibility under screen options but then I couldn't disable it. Then I couldn't even save a new post at all.
What I have done is: 1) rename plugins folder, 2) tried everything in the Twenty Twelve theme, 3) installed clean copy of WordPress from fresh download. None of these things worked. I ended up having to change my user settings in PHPAdmin to turn off the accessibility option for the widgets. So, after more research I added the Debug Bar and this is what it said:
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /hsphere/local/home/boniandk/amorysabor.com/wp-includes/functions.php on line 3041 Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /hsphere/local/home/boniandk/amorysabor.com/wp-includes/functions.php on line 3041 Notice: Constant WP_MEMORY_LIMIT already defined in /hsphere/local/home/boniandk/amorysabor.com/wp-config.php on line 92
But now I don't know what to do. I don't even know if any of these errors have to do with my issues.
Site link is: http://amorysabor.com

Related

Product quantity doesn’t update on WooCommerce's cart page

after reading many similar topics, I still can’t solve this problem; the quantities in the cart don’t update with the new values once the “update cart” button is clicked.
I’ve already tried disabling themes and plugins, but even as the only extension installed and with default theme (tried both StoreFront & Twenty Twenty-one), the WooCommerce cart continues to behave this way. I have also enabled the WordPress debugging logs and I can’t find anything there, just like in the console.
Someone already run a debug on my cart and think that I am a victim of a code conflict, he found this error :
Element.querySelectorAll: '\' is not a valid selector
I don't know where to look for the source of this error or what procedure to follow to recover the expected behavior...
You can try the bug here.
Mini-update : I created a new Wordpress project and installed WooCommerce. I then transferred all the files of this new WooCommerce on my site and the problem still persists.
I also noticed that the columns of the woocommerce_sessions table were not updated when the quantity was changed. I assume that the script responsible for writing to this database could be the cause of this bug.
As I could not find the source of the problem, I started from scratch by changing my hosting solution. Once the files were uploaded on the new server and the configuration files were adapted, the shopping cart works normally again.

Notice: register_rest_route was called incorrectly

In my Wordpress site, this issue appears when adding or editing posts.
Notice: register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.) in /project/wp/wp-includes/functions.php on line 5167
Note: I didn't make any WP update or any plugin update on the site.
Any idea to fix this issue? Thank you.
In WordPress 5.5, a change was made to how REST routes are registered and now required a permission_callback.
The reason you may see it the notice on one site and not all is that notices only appear when WordPress is run in DEBUG mode, confirm by checking the value of wp-config.php for
define( 'WP_DEBUG', true );
If the site showing the notices should not be in debug mode, simply change the value of WP_DEBUG to false.
A plugin or your theme are creating a REST-Api route in a wrong hook.
This is correctly done by using add_action('rest_api_init', 'function_to_create_end_endpoint');
function_to_create_endpoint contains the function register_rest_route().
In your case it's something else ('init' or 'plugins_loaded' instead of 'rest_api_init')
Some solutions:
Update all Plugins/your Theme to a current Version
If this doesn't help you can: Deactivate Plugins one by one, to see which one causes the issue, than maybe replace it or check if is abandoned
Search for "register_rest_route" in your wp-content folder and find the plugin that calls it in a hook something other than "rest_api_init".
Lastly Notices only show up when you turn on full debugging in your wp-config, this isn't meant for sites running in production. You could turn it off.

I keep getting a blank admin page?

I have a WordPress site and now for some reason it no longer allows me to make changes via the admin backend. I just have this blank GUI, none of which make any change if you click on them
I just added a plugin called Monster insights to align the site with google analytics and since then I get this result. I have tried to rename the plugins folder to manually remove them out of the equation and still no luck. I have reviewed the Log file with little luck as well.
[04-Jun-2019 08:57:05 UTC] PHP Fatal error: Call to undefined function wp_is_recovery_mode() in /home/erwinb411/public_html/wp-admin/includes/update.php on line 840
[04-Jun-2019 08:18:10 UTC] PHP Warning: include_once(): Failed opening '/home/erwinb411/public_html/wp-content/themes/theme52521/includes/register-plugins.php' for inclusion (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in
i think is a problem of plugin's compatibility in your site.
Have you try to update wordpress core, plugin and theme?
if after update all you have the same problem is an compatibility issue.
Let me know.

Can't load WP admin panel and can't figure out why..?

I have a WordPress site that is having some sort of an issue I can't seem to figure out. When I try to load the admin panel I get the following:
Notice: wp_enqueue_script was called incorrectly. Scripts and styles
should not be registered or enqueued until the wp_enqueue_scripts,
admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see
Debugging in WordPress for more information. (This message was added
in version 3.3.) in
/home/airassoc/public_html/wp-includes/functions.php on line 3370
Notice: register_sidebar_widget is deprecated since version 2.8! Use
wp_register_sidebar_widget() instead. in
/home/airassoc/public_html/wp-includes/functions.php on line 3201
Notice: register_widget_control is deprecated since version 2.8! Use
wp_register_widget_control() instead. in
/home/airassoc/public_html/wp-includes/functions.php on line 3201
Warning: Cannot modify header information - headers already sent by
(output started at
/home/airassoc/public_html/wp-includes/functions.php:3370) in
/home/airassoc/public_html/wp-includes/pluggable.php on line 1179
All of those notices are referring to core WP files, though, and WP itself has been updated to the latest version as of a week or two ago.
I'm thinking I must have something (theme or plugin) causing this, but the PHP notices aren't giving me any help. I've been going through (from the server) and deleting any plugins I think may be causing it but I haven't had any luck.
Any tip on how to troubleshoot this sort of thing would be greatly appreciated. Thanks!
Most likely if you have changed any files for your theme this can cause the dashboard and site to go down and not load, you may need to restore the default files for your theme you can do so by going to the public_html folder thru cpanel of your host and upload the theme files back again.

Cannot drag and drop widgets in admin

I'm currently helping someone with their Wordpress site. They are running Wordpress 3.5.1. The problem is that I cannot drag and drop any widgets into their widget areas. I ran the Javascript console and found this error:
Uncaught TypeError: Object [object Object] has no method 'hoverIntent'
load-scripts.php?c=0&load%5B%5D=admin-bar,hoverIntent,common,jquery-ui-core,jquery-ui-widget,jquery…:3
I have moved the whole Wordpress site to a testing server. The problem is that this Wordpress site is running a custom theme, and a bunch of plugins (even som custom as well), so I guess updating the WordPress-script is not an option, if I don't want to mess up things completely.
I have deactivated and removed both the theme and all plugins, and the problem still persists. I can't understand why, as it should technically be a clean WordPress install.
Any suggestions would be appreciated though!
Try deactivating plugins one by one and check to see if everything is ok. I has happened alot that plugins break javascript or css in the backend that cause some js functionalities to break.
Seems like I was missing some necessarry JS files in the wp-includes/js/ folder. Downloaded files from http://wordpress.org/download/release-archive/.

Resources