johnbillion / wp-crontrol

Take control of the cron events on your WordPress website
https://wp-crontrol.com
GNU General Public License v2.0
210 stars 36 forks source link

Feature request: disable "check hash" #103

Closed tylercollier closed 1 year ago

tylercollier commented 1 year ago

Hi there,

Awesome plugin!

Can you add a feature to allow disabling the "check hash"?

I'm talking about the setInterval() call in wp-crontrol.js that does an ajax post.

The problem with it for me is that during development, if I'm using the debugger, an extra hit will happen every 20 seconds, and it distracts the debug session I'm already mentally into. I use define('DISABLE_WP_CRON', true); anyway, so the "check hash" thing isn't useful for me. So, even if you had a rule that said "you are only allowed to disable the check-hash feature if DISABLE_WP_CRON is set to 'true'", that'd be fine with me.

Thanks for the consideration!

johnbillion commented 1 year ago

I have my debugger configured to ignore requests to admin-ajax.php, you might want to do the same (when you're not debugging ajax requests of course) as a more general fix for this problem. It'll avoid the debugger kicking in when the WordPress heartbeat fires too.

I've never been entirely happy with this feature of WP Crontrol. It usually proves to be an annoyance more than a help, especially on sites where those admin notifications are stacking up one on top of another.

The reason it was introduced is to help avoid confusion if you try to run, edit, or delete a cron event that fired in between you loading the page and then performing an action, but to be honest it doesn't really avoid that. I might just remove it altogether.

tylercollier commented 1 year ago

Good ideas. I already avoid issues with the heartbeat by using the Heartbeat Control plugin and using the Disable Heartbeat setting :-) So this is the only heartbeat-like call to admin-ajax.php I have to deal with. I actually want to debug non-heartbeat calls to admin-ajax.php. My debugger lets me ignore paths but not anything further, like if a query string parameter has a certain value. That'd be handy, but alas.

In the meantime, I'll see if I can get Nginx to intercept the calls before they reach my PHP-FPM and debugger. Or it might just be simpler for me to remove the setInterval() line of code.

Please don't remove the checkHash thing for only my sake! That's why I was asking for a feature flag. But... if you do ever remove it and happen to remember me, if you ping me somehow, I'd appreciate it. Thanks! :-)

johnbillion commented 1 year ago

I've removed this feature entirely. New version will be released soon.