The reason is rather straight forward: Access on $_SERVER on array members that don’t exist in CLI (PHP-CLI-SAPI) to construct some URL.
When you try to reproduce enable PHP error reporting to the highest level, that should show it.
It requires to run the WP cron via crontab.
To quote from my extended feedback in the other thread:
To add a bit more information, the issue manifested when running within cron and the PHP 8.0 language level. With the PHP 7.4 language level I didn’t see this notice. As PHP 7.4 will be out of main project support this year, and the plugin should be forward compatible with PHP 8.0 / 8.1 language levels, I think it is worth to address this notice.
A first fix I’m currently running is to have the function return void (as in the phpdoc which also looks like an error) in case HTTP_HOST is not within $_SERVER.
I must admit I have no clue why the function is called in the cron context anyway, but this is perhaps something that rings a bell on your end.
This type of fix prevents the notice naturally and it didn’t produce any other notices as a side-effect so far.
-
This reply was modified 2 years, 3 months ago by hakre.
-
This reply was modified 2 years, 3 months ago by hakre.
-
This reply was modified 2 years, 3 months ago by hakre.
-
This reply was modified 2 years, 3 months ago by hakre.