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);

Topic warnings wp-debug cdn Wordpress

Category Web


Thanks all of you for your response the issue got resolved. The problem was with cached copy of this link https://vreqenz-stream.de/shop/ . I had WP Rocket for caching and apparently it is not doing very good job of purging the cache. I got sure that it is cache issue when I defined the WP_CACHE as false which was true earlier and the warnings disappeared.


The WP_DEBUG setting only takes effect when /wp-includes/default-constants.php is loaded.

You are seeing these errors because they are occurring before that, ie. in wp-config.php... (which loads wp-settings.php which then consequently loads /wp-includes/default-constants.php)

If you want to use define constants multiple times without warnings you would need to check if they are already defined first:

if ( !defined( 'WP_MEMORY_LIMIT' ) ) {define( 'WP_MEMORY_LIMIT', '128M' ); }

Of course only the first definition will be in effect, but this way you won't get the warnings and you can use this to allow for multiple fallback conditions.

But your solution is probably just to simply to check for and remove the multiple definitions, as it's doesn't sound like you are trying to do something more complex like this.


Some plugins authors turn on error displaying due to inexperience. Try searching for this exact string in wp-content folder.

'error_reporting('

There are two constants causing the error: WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT , according to the error message I see.

Constants are just that -- 'constant'. They can only be defined once. Once defined, you can't change them. (Cause if you changed them, they wouldn't be 'constant'.)

Check your wp-config.php file first for duplicate definitions of those. Then check your theme's files (functions.php first, other files next), and plugin files for 'extra' DEFINES of those constants.

Added

For instance:

DEFINE ($myconstant,"the value");
echo $myconstant;  // this is ok
$myconstant = 'new value'; // this will cause an 'already defined' error

One DEFINE for a constant. Use it any way you want, but don't change it.


Try checking your php.ini file. display_errors may be turned on there and it might be overriding your wp_config file.

About

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