wp-cron refers to a WordPress subsystem that allows for the scheduled execution of code

learn more… | top users | synonyms

0
votes
1answer
138 views

Can wp_schedule_single_event be used to run background proccess?

I got a plugin that let users send invitations to their friends. If the user have like 4000 friends we run into trouble. At the moment i use a simple batch like the following for emails. But we also ...
0
votes
1answer
144 views

Need to execute a cron job

I need a cron job to execute the following url http://www.mywebsite.com/wp-admin/admin.php?page=myvideoblog/mvb_main.php&action=processfeed&updatefeed=67 The problem is that it requires ...
1
vote
1answer
101 views

Cron jobs in a class

Having: pluginname.php // If this file is called directly, abort. if ( ! defined( 'ABSPATH' ) ) { die(); } define('PLUGINNAME_PLUGIN_URL', plugin_dir_url( __FILE__ )); ...
0
votes
1answer
126 views

How to use wp cron job to run a function

I have one function: "update_user_like" to sum ​​all facebook likes from all user's posts. How to run that function at 3am every day by wp cron job? Thanks much!
2
votes
2answers
338 views

What happens when wp_cron is deactivated in Wordpress?

In a Wordpress 3.5.1 the apache log generates the following error related to wp-cron.php: [18/Jun/2013:10:53:21 +0200] "POST /wp-cron.php?doing_wp_cron=1371545601.7393701076507568359375 HTTP/1.0" ...
3
votes
1answer
105 views

Using wp_cron with custom time interval and the register activation hook

Scenario 1: fails Adding a cron task wp_schedule_event with a custom interval on plugin activation using register_activation_hook outside the class definition fails to work because the custom ...
0
votes
1answer
97 views

WordPress Cron Schedule the if and else statement

I have a custom php loop/function written that works in the following way $start = strtotime(date("Y-m-d H:i:s", strtotime("+5 hours"))); $end = get_post_meta( $post->ID, '_limited_dates_to', true ...
0
votes
1answer
91 views

Interrupted cron script sending me hourly emails. Please help!

One of my Wordpress installs (cPanel VPS) had a cron job (backup to Dropbox script) that was interrupted. Ever since the interruption I receive hourly emails from root@ cPanel/WHM: -Excessive resource ...
0
votes
2answers
170 views

WP Cron doesn't save <iframe> or <object> in post body

I am using wp_cron to auto grab posts from a remote website and save them in my wp db. NOTICE! I am executing my code from my plugin, not from my template functions.php or somewhere else. I have my ...
3
votes
1answer
141 views

Which action for triggering cron “wp”or “init”?

Which one do you recommend using within a plugin and why? add_action( 'wp', 'trigger_me' ); function trigger_me() { if ( !wp_next_scheduled( 'my_plugin_cron' ) ) { ...
3
votes
1answer
235 views

run a cron task without obstructing page load?

I have a plugin that lets users upload post attachments via AJAX in the admin area. I later try to push these files to DropBox via their REST API. It almost works. The issue is with WP cron task ...
0
votes
1answer
681 views

Better handling of WP-CRON server load abuse

There are multiple reports on how wp-cron is a far from ideal solution because it runs every time a page is loaded, which is unnecessary in most scenarios (one scenario in which it would be necessary ...
2
votes
1answer
66 views

Scheduling a task using class methods

I need to implement a scheduled task in my plugin, and I tried to follow the examples in the documentation, passing one of class methods as the target. I installed Cron Manager plugin, and I see that ...
2
votes
1answer
168 views

WP Cron emails not working

Running wp 3.5.1. I have 2 plugins that work in part. They do everything nice. If I click to send emails, they send the emails. However the scheduled emails are not being sent. The plugins are: ...
2
votes
1answer
209 views

Is there a quick way to view the wp-cron schedule

I'm trying to work which plugin is triggering wp-cron. I know about the code: http://codex.wordpress.org/Function_Reference/wp_get_schedules , but I'd prefer to do something in the sql backend rather ...
1
vote
0answers
65 views

Wordpress daily cron is executing more frequently than once a day

I have a wp cron job scheduled based on what's in the options. In this case its schedule daily. add_action('init', function(){ if( !wp_next_scheduled('product_posting_cron') ){ ...
0
votes
1answer
39 views

Are uploads directories created on a schedule?

I have a cron job that alerts me to modified files on a couple of WordPress installs. Two of them alerted me tonight to the creation of apparently empty folders like ...
0
votes
0answers
43 views

Scheduling daily refresh of posts

So here's my situation: I'm using AmazonSimpleAdmin to display products using the Amazon API. I have one product per post. The API limits 1 request per second. Meaning my front page can only have one ...
0
votes
1answer
160 views

wp-cron: freeze at “now”

sorry for the silly question. Briefly I have a wp (v. 3.5.1) blog using a heavily modified (by myself) theme. Everything works fine except for wp-cron. Listed jobs appears in (for instance) crontrol ...
0
votes
1answer
103 views

How to make wp cron job not fire immediately?

I'm scheduling a job in wp cron: add_action('my_cron_hook', 'my_cron_action'); wp_schedule_event( time(), 'interval1', 'my_cron_hook' ); function my_cron_action(){ //do something } The ...
3
votes
3answers
2k views

Converting timestamps to local time with date_l18n()

I've got a WordPress cron job that sends an email periodically and saves the timestamp when it was sent as an option, and I'd like to display a date on a settings page. Something like, "The last ...
8
votes
4answers
1k views

WP Cron doesn't execute when time elapses

The goal I want to use wp_schedule_single_event( ) to execute a single event that sends me an e-mail 8 minutes after the user submits a form. The issue The following code is in my functions.php: ...
2
votes
1answer
211 views

Change post status based on meta value

I have this cron set up to trash posts x days after it is posted. This works. Edit: Added my answer to my question. add_action( 'wp', 'do_trash_ads' ); function do_trash_ads() { if ( ! ...
1
vote
1answer
327 views

How do i schedule cron in wordpress for each second?

I want to schedule a cron job in Wp3.5.1 to sending email to those customer whose appointment is pending. here some code am trying: For the testing am scheduling corn for each second to insert row ...
1
vote
1answer
906 views

Wordpress schedule posting not working, if i added define('DISABLE_WP_CRON', false); how do i fix it?

I have Wordpress 3.5.1 and I use Bluehost hosting service. When I schedule posts after that time passed, WP posts dashboard shows "Missed schedule" message under the date. Then I checked my ...
0
votes
1answer
198 views

Managing scheduled tasks

I want users of my plugin to be able to define whether a task operates daily, twice daily, hourly or not at all as per the standard WP set-up. I'm storing these as 'daily', 'twicedaily', 'hourly' or ...
1
vote
1answer
201 views

wp_next_scheduled returning a past timestamp

So, here is my entire code in wp_content/plugins/my_plugin/my_plugin.php : register_activation_hook(__FILE__, 'comunity_mails_activation'); add_action('check_mails_to_send', 'do_this_daily'); ...
2
votes
1answer
161 views

Scheduled Posts and wp-cron - Why don't scheduled posts publish if too old?

I notice that the documentation for wp_schedule_single_event mentions the following:- The action will fire off when someone visits your WordPress site, if the schedule time has passed. However ...
4
votes
1answer
336 views

When does next Cron Job run (time from now)?

I would need to know how much time is left between now and the next time a specifc Cron Job is done. For another answer I built a basic cron inspector plugin which can be found here. Reason I'm ...
3
votes
1answer
217 views

Trigger a cron every 24h GMT -8

I' like to run a cron every 24 hours at midnight PST ( = GMT -8 ) This is what I have if ( !wp_next_scheduled( 'cron_hook' ) ) { //reset on 00:00 PST ( GMT -8 ) == GMT +16 $timeoffset = ...
1
vote
1answer
210 views

How to fix missing function in wp-cron?

One of my sites consistently fails to publish scheduled posts. I've tried disabling plugins, using Twenty Twelve, etc. with no luck. I installed the Core Control plugin and noticed that there is no ...
0
votes
1answer
143 views

Create wp_cront events dynamically upon user submission

Is it possible to set up new wp_cron jobs dynamically upon a certain action? I have a form submission (I'm using Gravity Forms, so have several functions set up on several of their hooks already) ...
1
vote
2answers
129 views

How is WP Cron Locking implemented?

WordPress takes measures to ensure that a cron task doesn't run twice when it should run once, e.g. once every hour when an hourly schedule is given, rather than the occasional twice at the scheduled ...
1
vote
1answer
223 views

Getting Error “invalid secret string” by running wp-cron.php manually

I am trying to run the wp-cron.php manually by calling it that way: http://mysite.com/wp-cron.php?doing_wp_cron Disabling the auto cron function with : define('DISABLE_WP_CRON', TRUE); produces ...
1
vote
0answers
121 views

wp_schedule_single_event function not working

I am testing the wp_schedule_single_event function and it is currently not working on my upgraded version of wordpress. It looks like the event is being scheduled but the code in my hook is never ...
2
votes
1answer
109 views

Long running action from plugin

I'm creating a WordPress plugin that will copy posts data to a remote database, I know it will take a while to transfer all the posts. How should I create copy functionality so it won't timeout? ...
1
vote
1answer
178 views

How to code schedule / cron job

I am using wp_schedule_event to hourly insert items from an rss news feed into my client's blog. Here is how I am setting it up in my functions.php: add_action('init', function(){ $timescheduled ...
1
vote
0answers
188 views

Is it possible to use `wp_schedule_event` with real cronjobs?

I hate the way Wordpress Cron Jobs run, so I disabled them: define('DISABLE_WP_CRON', true); and want to run a real cron job instead: wget http://www.myserver.com/wp-cron.php > /dev/null ...
2
votes
1answer
222 views

get_posts inside cron

Edited to rewrite my question I'll try to be as clear as possible, as I need to get this resolved quickly. I disabled WordPress' cron, and added a real cron job on my server to call wp-cron.php ...
1
vote
0answers
19 views

How ( and mostly at what time ) can i prevent the alternate cron from running?

I'm using the alternate cron version, but i need to prevent it from running on some calls, how can i do this? In the cron.php file i've seen on line 225 if ( defined('ALTERNATE_WP_CRON') && ...
3
votes
2answers
358 views

Run WP Cron Weekly (but on a certain day)

I'm looking add-in a bit more speficity to the WP Cron intervals. To add a "weekly" interval, I've done the following: function re_not_add_weekly( $schedules ) { $schedules['weekly'] = array( ...
2
votes
1answer
292 views

Do wp-cron scheduled tasks run asynchronously?

I have a task scheduled to run daily using wp-cron. The task takes over a minute to run (between downloading and parsing a very large file with cURL). According to the WP documentation, "The ...
1
vote
1answer
377 views

How to make sure a wp-cron job runs

I am using a plugin to send emails to a relatively large email list. Because we have a low per-hour email threshold from our host we have to use a setting in the plugin to throttle the emails down to ...
5
votes
2answers
817 views

How to use wp_schedule_event in a class?

This is first time that I tried the OOP method of writing an application. I don't quite understand it yet. Currently I have this cron hook: if( !wp_next_scheduled( 'my_cron_hook' ) ) { ...
1
vote
2answers
163 views

How to set up WP Cron in this scenario

I wanted to use Wordpress built in WP Cron to update currency rates daily. I use this function currently, require_once(WP_PLUGIN_DIR . '/autocurupdate/currencyexchange_class.php'); $cx=new ...
1
vote
0answers
54 views

Cron job not run on activation [duplicate]

The code i am pasting is supposed to run the function exporting once on activation of plugin and then hourly. But it doesn't run on activation nor hourly. I do see it in the list of cron jobs that are ...
1
vote
2answers
617 views

Cron Job not working in plugin

I have written a plugin that will convert posts to excel format and then email the .xls to an email id. I can make it work with when function is declared in functions.php but does not work with ...
2
votes
1answer
152 views

How to remove unused avatar uploads in buddypress

Im seeing in my wp-content/uploads/avatars folder that there are tons of avatars from when I created test users, but changed the avatars. So, i’m assuming that even if the user changes their avatar, ...
10
votes
1answer
2k views

PHP Warning on fresh install (Connection timed out)

I get this PHP Warning when accessing my fresh WordPress 3.4.1 install (Norwegian language). Warning: fopen(URL_TO_MY_WORDPRESS_PAGE/wp-cron.php?doing_wp_cron=1341476616.7605190277099609375000): ...
3
votes
1answer
320 views

Recurring scheduled task help

I'm trying to set up a scheduled task in my Wordpress installation which will (eventually) run a script to send an email once a day with a load of data in. However I can't seem to get a scheduled ...