How to log mysql errors from wordpress core?

You should be using the wpdb class for all your own queries. All core queries also use wpdb. See wpdb Show and Hide SQL Errors <?php $wpdb->show_errors(); ?> <?php $wpdb->hide_errors(); ?> You can also print the error (if any) generated by the most recent query with print_error. <?php $wpdb->print_error(); ?> Also see SAVEQUERIES constant for … Read more

Notice: Use of undefined constant SCRIPT_DEBUG

This is a known bug As far as I’m concerned, you can easily fix it by replacing if ( SCRIPT_DEBUG ) { with if ( defined(‘SCRIPT_DEBUG’) && SCRIPT_DEBUG ) { That should suppress the error for now. When WordPress is updated again, this error may be overwritten, but I believe it will be fixed in … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)