Shelob9/headless-mode

Defining the constant in the wp-config file throws a bunch of PHP notices.

Benunc opened this issue · 3 comments

I thought that wp-config was evaluated before plugins. But on a SpinupWP site I have (gatsby.wpsteward.com) I am getting tons of PHP notices in the logs that say

[16-Nov-2019 20:47:01 UTC] PHP Notice: Constant HEADLESS_MODE_CLIENT_URL already defined in /sites/gatsby.wpsteward.com/files/wp-content/plugins/headless-mode/headless-mode.php on line 15

This should be fixed, before more than 13 people are using the plugin.

The original problem was that you had the close paren after the entire if statement not just the condition. That meant that in the end, the if statement was actually applying to the subsequent line with: add_action( 'admin_menu', 'headless_mode_settings' ).

Fleuv commented

Still got a notice with v0.0.4:

Notice: Constant HEADLESS_MODE_CLIENT_URL already defined in /wp-content/plugins/headless-mode/headless-mode.php on line 15
Fleuv commented

Please merge #8 to be able to close this issue.