Wordpres debug.log PHP Notice: is_singular was called

I have started to get alot of "is_singular was called" and "is_page was called" in my debug.log [31-May-2020 12:10:27 UTC] PHP Notice: is_page was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /wp-includes/functions.php on line 5167 [31-May-2020 12:10:27 UTC] PHP Notice: is_singular was called <strong>incorrectly</strong>. Conditional query tags do not work before …
Category: Web

WordPress customizer Preview not loading

I'm creating a WordPress website, today I have tried to add some new features but I'm not able to add because customizer live preview is not loading I have done some steps Update all theme and plugin uninstall all the plugin after some time again install all plugin one by one. 3)Take a back up of whole site and reset the website by "WP reset plugin" upload again after sometime. Check the hosting space but not the space problem. check …
Category: Web

How to display only specific Error types in debug.log? No notices, warnings, etc

I can't find the right way to make it work. I tried many things, like putting this in wp-config.php define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', false); define('WP_DEBUG_LOG', 'wp-content/themes/mytheme/mylog.log' ); // yeah, customized it a bit. It logs everything ini_set('error_reporting', E_ERROR ); also tried to set it in the php.ini on various websites i manage. Not on managed hosting. Or at least not on the well known international ones. Can it be server side or syntax error, or not even possible what i want? …
Category: Web

error log is going to the wrong location, WP_DEBUG_LOG is ignored

My WordPress error log is going to /var/log/php-fpm/www-error.log. That's not where I want it. In fact, it took me too long to figure that out. (I'm new to WP and PHP). I've tried to redirect it with the following in my wp-config.php define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', '/var/www/html/wordpress/wp-content/wp-errors.log' ); error_log("hello from wp-config\n"); but it has no effect. This code is placed before/above the "stop editing" warning. I've tried other log file locations like /tmp, still, my WP_DEBUG_LOG setting is …
Category: Web

Wordpress not writing error.log

My local development WordPress install on ServerPress is not writing error logs. I made changes to my wp-config.php file to enable error log writing for WordPress, and also tried editing the php.ini file for xampplite to try and enable error tracking, But still, I could not get any logs going, so I reverted that to its original settings. My website currently displays There has been a critical error on your website. in the front-end. I added the following code before …
Category: Web

How do you change error reporting to only show errors in WordPress?

I'm working on a development site that has some plugins that produce notices. It's a bit annoying during development when you only want to see the errors your own code produces. How can you turn off notices in WordPress but keep reporting of errors enabled? I thought this should work, but it doesn't: define( 'WP_DEBUG', true ); error_reporting(E_ALL & ~E_NOTICE); Edit: I should point out that I added this code to the wp-config.php, just to be clear.
Category: Web

WP_DEBUG is not set, but I'm still getting warnings

If WP_DEBUG is not set, as I understand it, you should never ever see warnings. But on some sites on some servers, I'm still seeing a few. Not all the warnings that would be displayed if WP_DEBUG was set, but a select few. I've tried changing the error level in php.ini, but that seems to have no effect on whether warnings appear or not, but they do appear in differing amounts on different servers (i.e. no warnings on development, one …
Category: Web

Suppress deprecated notices

When I use: define('WP_DEBUG', 1); In my wp-config.php, it works fine, but I am hacking an old theme and I would like to suppress deprecated notices. My understanding is that adding this: error_reporting( E_ERROR | E_NOTICE | E_PARSE ) Should do the trick. I have added it to wp-config.php and to header.php in my theme. Unfortunately, it has no effect. Is this something set at server level? Also the following makes no difference as well: ini_set('display_errors', 1); As asked in …
Category: Web

Warnings even when the WP_DEBUG set to false

The link https://vreqenz-stream.de/shop/ throws warning when opened on some devices and not on others. I thought it may be a cahce issue but I have cleared cache from WP-rocket and also browser. Just for the info I am using Plesk web admin tool. Below is my WP_Config settings ini_set('log_errors','On'); ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('WP_DEBUG', false); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
Category: Web

notices and warnings displayed with WP_DEBUG false

My WordPress sites suddenly started displaying notices and warnings publicly. even when WP_DEBUG is set to false. Even when I set it to true I normally do WP_DEBUG_DISPLAY false. Either way, sites are displaying all sorts of deprecated function notices and other info I dont want shown publicly. Tried reverting to WP 5.7.2. Contacted Siteground to ask if it could have something to do with php upgrade, but rolling that bac didn't help r ither. I run some custom plugins, …
Category: Web

WordPress Error Message

I am getting below error message in debug.log file. [19-Jun-2021 14:12:52 UTC] PHP Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /var/www/html/wordpresstest/wp-includes/update.php on line 410 How can I solve the issue ?
Category: Web

website has a bug

Wordpress website Red Bug shown in top line, I have an error message: NOTICE: wp-includes/functions.php:5313 - WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.) require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/twentyseventeen/index.php'), get_header, locate_template, load_template, require_once('/themes/twentyseventeen/header.php'), wp_head, do_action('wp_head'), WP_Hook->do_action, WP_Hook->apply_filters, wp_enqueue_scripts, do_action('wp_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, ClefUserSettings->register_assets, wp_localize_script, WP_Scripts->localize, _doing_it_wrong, trigger_error. I tried to deactivate plugins for trouble …
Category: Web

Define WP_DEBUG conditionally / for admins only / log errors (append query arg for all links?)

I'm developing a site on a server that the client has access to as well and what I'd like to do is show WP_DEBUG only for administrators. Referencing Yoast's article on a way around this: if ( isset($_GET['debug']) && $_GET['debug'] == 'true') define('WP_DEBUG', true); would show WP_DEBUG only for URLs that have ?debug=true attached to them, like http://domain.com/?debug=true I was thinking that the Debug Bar might hold some of this information in there by default (whether or not WP_DEBUG is …
Category: Web

There is no any line related the error but it says critical error

My website says critical error on website after add my custom code but there is no any line related my custom code in log file.There are only 2 repater lines and they are standard for my website, not big problems. also Wordpress doesn't show error message on browser except "critical error...". how can I detect the code problem? define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'SAVEQUERIES', true ); define( 'SCRIPT_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', true ); error_reporting(E_ALL); ini_set('display_errors', …
Category: Web

Why does WordPress keep showing me error messages?

I'm trying to hide error messages on a WordPress installation on a shared hosting. I added the following code to my config. ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('WP_DEBUG', false); define('WP_DEBUG_DISPLAY', false); This is pretty much what I find in any article regarding this topic. However, it doesn't work. I keep getting error messages. What could be the reason it isn't working for me? A little update. One error I sometimes get is a "notice". When I keep all these three lines …
Category: Web

Same log message keeps on printing to debug.log file thousand of times

So i was debugging my PHP code while working with Wordpress site by writing to debug.log with error_log($message) or trigger_error($message). My message in these log statements keeps on printing thousand of times in debug.log file from a same single statement declared in functions.php (for example purpose here i am logging from themes's functions.php which results in same issue of multiple printing though i was debugging from some snippet plugin) Accordingly to check if this issue is caused by my code …
Category: Web

Wordpress: Adding Security

Regarding this answer, is correct to add the file debug.log in this way? RewriteRule (?:debug|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html|log?) - [R=404,NC,L] Kind Regards
Category: Web

White screen on front page only

I've got the famous white screen, but only on my home page. Deeper pages load just fine. I moved my themes directory to themes-old and made a new themes directory that only has twentyten in it. I changed my theme to twenty ten. I don't have any plugins enabled, but I moved my plugins directory and created a new, empty plugins directory. I turned debugging on. I'm at a total loss here. I did make some theme tweaks today, but …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.