typisttech / sunny

Automatically purge Cloudflare cache, including cache everything rules.
https://typist.tech/projects/sunny
GNU General Public License v2.0
35 stars 3 forks source link

Cron job #137

Closed studiosx closed 6 years ago

studiosx commented 6 years ago

I've scheduled some posts. None of them was published. (Missed schedule)

From cronjob I got this error: Parse error: syntax error, unexpected ':', expecting '{' in /home/xxxxx/public_html/wp-content/plugins/sunny-purge-extra-urls-example-master/sunny-purge-extra-urls-example.php on line 48

Can you hemp me with that issue? Thank you!

PS: After I deactivated Sunny Purge Extra URLs Example plugin, I got this error from cronjob:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /home/xxxxx/public_html/wp-content/plugins/sunny/src/Sunny.php on line 57

tangrufus commented 6 years ago

Your cron jobs are running on a different PHP version. Sunny requires PHP 7.0 (next release will be 7.1)

If you trigger wp cron via wp cli, see: ~https://github.com/TypistTech/sunny/issues/137~ https://github.com/TypistTech/wp-cloudflare-guard/issues/74

If you trigger wp cron via php /home/xxxxx/public_html/wp-cron.php?doing_wp_cron, then use /full/path/to/php /home/xxxxx/public_html/wp-cron.php?doing_wp_cron

Side note: sunny-purge-extra-urls-example is an example. By default, it doesn't do anything useful.

studiosx commented 6 years ago

Thank you very much! I made the changes and now it works like a charm!

tangrufus commented 6 years ago

Glad to help.

For anyone from the future, if you trigger wp cron via wp cli, see: ~https://github.com/TypistTech/sunny/issues/137~ https://github.com/TypistTech/wp-cloudflare-guard/issues/74 The original link was incorrect.