tjomk
Forum Replies Created
-
Thanks for your help!
Nope, zero activity. My wild guess about initialization is that it tries to load as little as possible unlike when a full http request arrives, hence all the issues here. However that’s just a guess.
I think your suggestion returning early is the best one. Since we don’t really need to check (and can’t protect either when having physical access) when user is running wp-cli, then it’s wise to just exit and give way.
It’s not happening in Apache, I’m using wp-cli + cron. The error is triggered in wp-content/plugins/wp-cerber/wp-cerber.php on line 246
I’ve just placed the following code before it to get rid of the error:if ($wp_cerber == null) $wp_cerber = new WP_Cerber();Thanks Gioni for such a quick update but unfortunately it didn’t fix it. Seems like when you use wp-cli it goes through a different path. The error is raised in cerber_access_control() function because $wp_cerber has null value.
My guess is that wp-cli loads files differently than WordPress itself and so the line where you initialise the class is not executed.
A dirty fix would be to check if $wp_cerber is null, and if it is just init it.
Amazing! Thanks Gioni for such a quick reply!