cron.php being constantly deleted [closed]
cron.php being constantly deleted [closed]
cron.php being constantly deleted [closed]
After some testing I figured out that yes, it will use the new schedule, updated using the ‘cron_schedules’ filter.
What version of BP are you using? Changing your avatar should result in the uploaded file being deleted after the creation of the thumb and full versions. And those versions should over-write the old versions. Avatars don’t have a db entry, so what file names are you seeing in an avatar folder? You should only … Read more
AS said by Fleuv you can use wp_schedule_event() function to execute your code like this add_action(‘my_twfours_action’, ‘my_twfours_action_fn’); my_twfours_action_fn (){ //this code will execute every 24 hours } wp_schedule_event( time(), ‘daily’, ‘my_twfours_action’ ); //adding new cron schedule event To create your 2 minutes filter and then scheduling a cron jo is like function my_two_minutes_filter( $schedules ) … Read more
You’re getting Undefined index errors because you’re loading the files directly and not rendered through the server. The server typically populates those values and it’s actually more secure to run with less elevated privileges (through an HTTP request). Throw your manual cron to a curl or wget — whichever you have installed on your server. … Read more
I’ve done something similar flagging content ingestion issues. I would caution against sending emails from a cron unless it’s in a digest form from a specified interval of time as you’ll get email fatigue pretty quickly. I created a queue of sorts in a separate post type that linked to the the flagged post or … Read more
I would create a constant in the wp_config.php defining which Server you are on. So far so good, not really magic. The tricky part, as you mentioned is to get the cron running for sure, and not aborting if it’s accidentally the wrong server. Try the function like this: function my_cron_callback() { if ( MY_SERVER_SETUP … Read more
I think setting a cron job to automatically turn permissions on and off might be a bit of an extreme workround 🙂 I think it is probably worth spending the time to set up working permissions on your server, rather than a cron job which could introduce other problems. This has been a good resource … Read more
wp_schedule_event takes a hook as parameter, not a function. Try: wp_schedule_event(time(), ‘daily’, ‘my_daily_event’); add_action(‘my_daily_event’, array(&$this, ‘my_widget_cron’)); if ( !wp_next_scheduled( ‘my_daily_event’ ) ) { wp_schedule_event(time(), ‘hourly’, ‘my_daily_event’) } If you remove the widget from the sidebar, the cron will still continue to run. You can run the following code (outside of the widget class) to clear … Read more
Creating your own schedules is a little messy (because they need to be persistent and stored in database), but it is quite easy to hop on one of the native schedules that run twice a day. add_action( ‘wp_version_check’, ‘my_function’ ); function my_function() { //stuff } As for running actual queries you should use $wpdb for … Read more