add_action to wp cron?

Basically every page load looks to see if there is anything scheduled to run, so by that logic the cron is checked and can possibly run on every page load. I can only presume you want to schedule something to run every so often. If that’s the case you need to look at wp_schedule_event() Below … Read more

wp_schedule_event won’t accept args

This is not a fix for your problem, but it might lead you in the right direction to solving the issue. I would suggest checking out this plugin to possibly help you find out what is going on: WP Cron Control It offers a quick view of cron jobs scheduled throughout your site. I recently … Read more

How to use wp_schedule_event in a class?

Add an action outside your class definition: add_action(‘my_unique_plugin_event_hook’, array($this,’hook’)); And then use this in your event: wp_schedule_event(time(), ‘daily’, ‘my_unique_plugin_event_hook’);

Using wp_schedule_single_event with arguments to send email

I think you have mismatch in how you pass arguments and how you expect it to work. You pass array of arguments to schedule and expect your hooked function to receive identical array of arguments. This is not the case. Cron events are processed by do_action_ref_array(), which in turn passes arguments via call_user_func_array(). So your … Read more

WordPress cron isn’t scheduled on amazon web services

As a general principal, you shouldn’t do anything that requires an ‘add_action’ after the plugin activation hook. This is because WP loads and runs all plugins and THEN runs the new added one, and then does a re-direct. You have to set a DB option and hook into that. Here is the discussion from the … Read more

Is there a known vulnerability for wp-cron.php?

In wp-includes/default-filters.php we can find a callback registration: // WP Cron if ( !defined( ‘DOING_CRON’ ) ) add_action( ‘init’, ‘wp_cron’ ); If we go the function wp_cron() now, we see this: $schedules = wp_get_schedules(); foreach ( $crons as $timestamp => $cronhooks ) { if ( $timestamp > $gmt_time ) break; foreach ( (array) $cronhooks as … Read more

PHP Warning on fresh install (Connection timed out)

The answer is apparently YES, I should worry. After some research, I’ve found that the warning seems to be related to misconfigurations on the server that WordPress is hosted on (ie. a problem with my server, not WordPress). Common misconfigurations: Server doesn’t have DNS, and so it can’t figure out who “example.com” is, even though … Read more

Do WordPress cron jobs slow down page loading?

Short answer – Nope. Any page request initializes the scheduled queue. It’s just an initialize request. Wp-cron request is a standalone request. so requesting URL /somepage you just initialize request to /wp-cron.php However – If cron event doesn’t work really well (it’s has 1000 db queries e.g. or its requesting a some really long-to-respond resource), … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)