Resetting comment count

Try this code: WARNING: THIS IS JUST PSEUDOCODE! $entries = $wpdb->get_results(“SELECT * FROM wp_posts WHERE post_type IN (‘post’, ‘page’)”); foreach($entries as $entry) { $post_id = $entry->ID; $comment_count = $wpdb->get_var(“SELECT COUNT(*) AS comment_cnt FROM wp_comments WHERE comment_post_ID = ‘$post_id’ AND comment_approved = ‘1’”); $wpdb->query(“UPDATE wp_posts SET comment_count=”$comment_count” WHERE ID = ‘$post_id'”); } Or you might want … Read more

How to fix “There has been a critical error on your website. Please check your site admin email inbox for instructions”?

You should troubleshoot your website for plugins and WordPress Themes. Make sure your PHP version is 7.3 or above. As you are unable to access your WordPress admin area so please try to access your file manager in cPanel or access public_html directory via FTP. Plugins and Themes directories are inside wp-content/ directories. Go to … Read more

WordPress 5.5 – ReferenceError: commonL10n is not defined error

This is Trac ticket 51223: commonL10n and other JS globals removed without backwards compatibility In WordPress 5.5, the localized translations under commonL10n were replaced by wp.i18n.__ without deprecation notice or backwards compatibility. Plugins using commonL10n now have JavaScript errors introduced by updating WordPress which can break site functionality. It was fixed in 5.5.1 by adding … Read more

Connection lost. Saving has been disabled… (Updating Posts/Pages)

That message is a result of your server throwing a 503 error and the WordPress Heartbeat API catching that error. See https://core.trac.wordpress.org/ticket/25660 for the background on the fix that WordPress introduced to save offline edits. Things to check on your computer are if WAMP is actually running when you’re getting this message (check the status … Read more

Displaying PHP Errors from admin-ajax.php

WordPress by default hide errors for ajax request call. This can be confirmed from the source file wp-includes/load.php#L352, here: if ( defined( ‘XMLRPC_REQUEST’ ) || defined( ‘REST_REQUEST’ ) || ( defined( ‘WP_INSTALLING’ ) && WP_INSTALLING ) || wp_doing_ajax() ) { @ini_set( ‘display_errors’, 0 ); } See the function wp_doing_ajax() is being used in the conditional … Read more

Suppress deprecated notices

As mmm stated: in which file appears the first notice? Wherever the notice is mentioning the location of this deprecated function (path/to/some/file.php), you would insert the following just below the <?php tag which starts off the file: error_reporting(0); I’ve tried the above functions you mentioned and inserted them in my wp-config.php when I experience something … Read more