0

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

Site snipshot with warning on top

0

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

  • in php.ini I only have these two settings zlib.output_compression = Off memory_limit = 128M – veetrag Jun 17 at 17:44
  • Thanks for commenting the issue got resolved please check my comment. – veetrag Jun 18 at 11:46
0

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.

  • Thanks for answering I will check that but the issue is even after setting the debug mode to false I am receiving these warnings. do you think that there is some cache issue or something else? – veetrag Jun 17 at 17:56
  • The errors are probably occuring anyway - by setting the debug values you get to see them on the screen, rather than having to look in the error.log file. The debug settings are not causing the errors, the setting is just allowing you to see them on the screen. The issue is that there are two DEFINE statements for the same constant variable. You can only have one DEFINE for a constant. Then you can't change the constant anywhere else. Look for a statement that is changing the constant to a new value. See my revised answer. – Rick Hellewell Jun 17 at 18:38
  • Thanks for commenting the issue got resolved please check my comment. – veetrag Jun 18 at 11:46
0

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

'error_reporting('
  • Thanks for commenting the issue got resolved please check my comment. – veetrag Jun 18 at 11:45
0

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.

  • Thanks for commenting the issue got resolved please check my comment. – veetrag Jun 18 at 11:45
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.