You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When defining WP_ROCKET_PLUGIN_NAME in wp-config.php to change the WP Rocket name to something else in the WP Admin, the following error is logged:
[12-Dec-2024 04:03:30 UTC] PHP Warning: Constant WP_ROCKET_PLUGIN_NAME already defined in /home/user/example.com/wp-content/plugins/wp-rocket/inc/main.php on line 40
To Reproduce
Add define( 'WP_ROCKET_PLUGIN_NAME', 'Site Cache' ); to wp-config.php
Clear cache and view some pages
Check error log
Expected behavior Here, we should check if WP_ROCKET_PLUGIN_NAME is already defined and only define it if not. Something like the following:
May I ask, what is the reason behind having our constant inside wp-config.php?
From my point of view, I think those constants are forming the base functionality of the plugin so changing them will change the core functionality, and showing a warning is a good thing :)
It's a @wp-media/product call but I can't think of this one as an issue.
Well, maybe not. You would know better than I if allowing that constant to be changed might lead to unexpected bad outcomes. If so, then maybe we shouldn't allow it to be changed or have it in the doc. What do you think?
Describe the bug
When defining WP_ROCKET_PLUGIN_NAME in wp-config.php to change the WP Rocket name to something else in the WP Admin, the following error is logged:
[12-Dec-2024 04:03:30 UTC] PHP Warning: Constant WP_ROCKET_PLUGIN_NAME already defined in /home/user/example.com/wp-content/plugins/wp-rocket/inc/main.php on line 40
To Reproduce
define( 'WP_ROCKET_PLUGIN_NAME', 'Site Cache' );
to wp-config.phpExpected behavior
Here, we should check if
WP_ROCKET_PLUGIN_NAME
is already defined and only define it if not. Something like the following:Additional context
Ticket: https://secure.helpscout.net/conversation/2789608151/530064
The text was updated successfully, but these errors were encountered: