Implementing a cron job within plugin folder

Hi there,
I try to make the autopublish plugin by @bvdputte to work with a cron job.
It seems that my webhoster can’t access the worker.php file in the plugin folder due to .htaccess settings, I guess.

If I comment out the following line from .htaccess file, it works:

# block all files in the site folder from being accessed directly
# RewriteRule ^site/(.*) index.php [L]

But then I enable direct access to files in the site folder.

So, I’m not sure if it is a plugin related issue or if I’m doing anything wrong on my side.
Thanks for help!

Sounds like your hoster runs the cronjob by calling a public URL (not calling the script internally within the server environment); I’ve seen that before, it’s not technically a “cron job”, more like a “scheduled URL ping”.

For this particular plugin, look at the Webhook setup – once configured, that URL should be reachable from the outside.

Thanks!

Sounds like your hoster runs the cronjob by calling a public URL

Yes, that’s true.
So, if I set up the web hook token with the secret token, is this the URL I then use for the cronjob at my hoster?

Yes, that should work in that case. The web hook token creates a public (but “secret”) URL that can be reached from the outside.

Unfortunately, that doesn’t seem to work.
Maybe there is away to exclude the worker.php in the plugin folder from mod rewrite?
Otherwise, I have to live with the poormanscron provide with the plugin, that works just fine.

Sorry to hear that, and this is rather surprising. The magic happens here in the source code, and according to that it’s a default Kirby route setup which should be very much reachable without further ado.

What response headers do you get when you call that token URL from your browser?

What response headers do you get when you call that token URL from your browser?

Sorry for my late reply. I get a 404.