The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
388 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
1k 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
192 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: ...
0
votes
1answer
42 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
1answer
136 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 ...
0
votes
1answer
436 views

Is it safe to run wp-cron.php twice if the first instance takes too long?

Let's say I disabled "DISABLE_WP_CRON" in wp-config.php Is it OK to run wp-cron.php twice overlapping? I've noticed sometimes wp-cron.php needs several minutes. I'd give it a full hour but the ...
8
votes
4answers
2k 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: ...
1
vote
1answer
578 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 ...
0
votes
1answer
210 views

”doing_wp_cron” in URL even if ALTERNATE CRON is not in wp-config

The insertion of ?doing_wp_cron in Wordpress’s URL is very well documented here. My problem is a little different. I turned on the ALTERNATE_WP_CRON feature in my wp-config file a few days ago. Then, ...
1
vote
2answers
267 views

Force Cron to run only on one server

Given a site running on server A and server B with a load balancer, shared database/etc, and a regular wp-cron task, how would I make sure that wp-cron only runs on server A, never on server B?
2
votes
1answer
191 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
385 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
308 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 = ...
4
votes
3answers
827 views

Running WP Cron on specific local time

The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday. function add_daily_task(){ if((date('l', time()) != 'Saturday') || (date('l', time()) ...
0
votes
2answers
71 views

How to do some action weekly?

For each new post, I add News category. And I want to delete this category from each post after 7 days. I already know to "delete" the new category but how to run it every week ?
0
votes
1answer
202 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
194 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
0answers
200 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 ...
1
vote
0answers
211 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
293 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
40 views

Problems with cron

I have a this code that delete some post meta at al 7:55 hour of the server: if ( !wp_next_scheduled('borra_meta_datos') ) { wp_schedule_event( mktime(7, 55, 0, date('n'), date('j')), 'daily', ...
1
vote
0answers
21 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') && ...
6
votes
3answers
624 views

Check if function called by cron job

I have a function that I only want to run via a cron job. Is there a way I can check that a particular scheduled event is calling this function and not anything else?
1
vote
2answers
1k views

Delete posts from a post type automatically via Cron

how can I use Cron to delete posts of a certain post type once they reach a certain limit, like keep maximum 50 posts? The reason is that these posts are being imported automatically periodically, so ...
1
vote
2answers
1k views

Sending out scheduled emails

Will wordpress run cron if I have scheduled emails to send? Seems like if no visit (request) is made to the site, scheduled tasks won't run and therefore emails won't be sent eg. hourly. According ...
2
votes
1answer
184 views

How to remove unused avatar uploads in buddypress [closed]

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, ...
3
votes
1answer
339 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 ...
0
votes
1answer
304 views

How to set-up multiple cron task with wp_schedule_event so that they do not overlap?

I'm using a cron to take data from Facebook and i have divided the job into three calls, to avoid making to many call all toghether, now how do i set up calls so that they don't overlap? // Set the ...
2
votes
1answer
415 views

How Do I Make WordPress Run an Event Every Day?

In a plugin I want to build, it deals with contests. A contest has a date on it. Does WordPress have a feature in it where it can run a piece of code every day without requiring someone to create a ...
1
vote
1answer
102 views

Which file do I run a cron job on to make Twitter News Feed update more often?

I have installed the Twitter News Feed plugin which only updates once an hour. There is a button to press though that updates it immediately. I presume therefore that there is a file that I can call ...
3
votes
1answer
216 views

Hourly WP schedule, do I need at least 1 visitor hourly?

I am planning to schedule an hourly task from my wp plugin, as I understand these tasks are triggered by visits to the website. So for an hourly task I will need at least one visitor hourly. Does it ...
0
votes
1answer
616 views

How does one programmatically manage posts from a external php script?

How does one create a post, assign it to a category, add tags to it and set the featured image from a PHP script that exists somewhere on disk (say /usr/local/process.php) and isn't part of the ...
1
vote
1answer
75 views

Remind a user about their account if they have not used it for 6 months

I have a website working with a user registration/login system all working also. I wish to automatically send all users an email that have not used their account for 6 months. I have an idea, but ...
0
votes
1answer
2k views

How to Automatically import external images to Upload

Hi to all I would like to have a simple plugin, hook, anything that Automatically caches external images. Simple explanation: Actually I'm using this plugin: ...
1
vote
2answers
370 views

WordPress Caching - Transients API or “update_user_meta ” Cronjob?

I'm trying to set user meta based on queries. Basically, things like IF the query returns true, set this or if not, set this (or don't set it, if it is true). This works great but the problem is I ...
1
vote
0answers
261 views

wp_insert_post not completing when run via cron [closed]

I have created a plugin that accesses an XML feed that contains articles and saves the articles from that feed as posts. You can set a time interval for the plugin to run via WP cron and access the ...
1
vote
1answer
463 views

Cronjob not working as expected - issue with hook?

Today I've tried to write a Wordpress Cronjob. For testing purposes I wrote a function that sends me an email every hour, but it's not working. I've got a plugin called 'Core Control' which shows me ...
1
vote
1answer
492 views

Schedule event every second thursday of the month

I'm working on an email system and they want it automated to send out emails every second thursday of the month. I've got the PHP sorted out and ready to fire a callback to send the emails, but I'm a ...
5
votes
1answer
1k views

Delete all scheduled events with a particular hook

I have several cron jobs all hooked to the same hook, but each with a different argument (a post ID). It appears wp_clear_scheduled_hook only clears job which match the argument passed with it (or ...
6
votes
2answers
835 views

Running WordPress on the Command Line - Turn off Delayed Output?

I'm creating a cron job that runs outside of WordPress. From a development perspective, this makes it really easy to debug and create cleanup scripts or cron jobs, by just running a command like the ...
0
votes
2answers
2k views

wp_schedule_event / cron_schedules - custom recurrence time not working in Plugin

I am trying to add custom intervals for the WP cron in a plugin. It run with "hourly", "daily" default recurrence time. It dont' run when I add my own custom recurrence time for the function ...
0
votes
1answer
495 views

A unique wp_schedule_single_event() for each post?

I'm building a site for a client that requires sending out emails about each post at various dates (i.e. two weeks before after the post was published, then again four weeks after the post was ...
0
votes
1answer
2k views

Run W3 Total Cache Flush Function with Crontab [closed]

Ok. I'm really stumped on this one. Basically, I need to call a function for the Wordpress plugin W3 Total Cache as part of a cron job in crontab. I'd like to automatically clear the entire page ...
1
vote
3answers
385 views

Transients vs CRON +Custom Fields: Caching Data Per Post

Wanted some opinions on a solution I'm trying to come up with: I have a fan/enthusiast plugin I'm working on for fans of TV shows. One of the custom post types attached to the plugin is a release ...
0
votes
1answer
249 views

wp_schedule_event only when admin is visited

On the documentation page it says "The action will trigger when someone visits your WordPress site, if the scheduled time has passed." Is it possible to make this action trigger only when the admin ...
2
votes
1answer
216 views

How do you load WordPress from an external script when using MultiSite? [duplicate]

Possible Duplicate: Using WordPress functions on other sites I have an external script that needs to load up WordPress in order to have access to WordPress functionality. In the past I ...
0
votes
1answer
84 views

Generate Email if No Posts Within Time Period

I want an email to be sent to a specific list of email addresses if/when there have been no posts on the blog within the past 1 week. Any ideas on how I could do this?
1
vote
2answers
325 views

WP_cron won't trigger my action

I'm in a dead end with a schedualed task in a wordpress plugin for a multisite. Somehow the action I added don't get triggered. The task is getting schedualed and returns a timestamp when I run ...
0
votes
2answers
405 views

WP Cron is “half-failing” to insert posts

I built a plugin for my company, which basically goes to tube sites, scrapes them for content, and posts them automatically in whatever state is defined (publish, draft, future, etc). Now, everything ...
1
vote
2answers
1k views

Initialize WordPress environment to use in a real cron script

I have to run a PHP script through real cron (WP cron being too unreliable). Within that script, I need $wpdb to insert data into WordPress table. But of course $wpdb will not be available as ...