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

learn more… | top users | synonyms

0
votes
1answer
314 views

wp_schedule_event in a class

This is my (stripped down) plugin, in OOP: <?php /* Plugin Name: Cron Test Plugin URI: http://www.mywebsite.com/ Description: Test Version: 1.0 Requires at least: 3.0 */ class CronTest { public ...
3
votes
1answer
257 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 ( ! ...
0
votes
0answers
15 views

How do i set cron job for my WordPress site?

My target is to run a file to be executed on each day whether the WordPress site runs or not. How to execute cron file? I have got stuck in this is issue. This is new task for me and i don't got ...
2
votes
1answer
119 views

WP Cron and wp_insert_post

I'm trying to insert posts using a cron job, but I keep running into errors where WP is missing functions (is_user_logged_in, wp_get_current_user). Is there a proper way to run wp_insert_post using a ...
1
vote
1answer
263 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'); ...
1
vote
1answer
1k views

Wordpress schedule posting not working

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
2answers
41 views

setting up a wp cron job

I am a bit new to wp-cron job. I think i understand the concept but lack the implementation. i read a lot of tutorials on how to implement including this post: Run function at specific time but still ...
0
votes
0answers
26 views

Cron job not firing

I'm having this problem where cron jobs doens't seem to post delayed posts.. I'm using this cron job wget -O /dev/null http://domain.com/wp-cron.php?doing_wp_cron Am i doing something wrong?
1
vote
1answer
84 views

How to Better Control WordPress Cron Jobs?

I have a bunch of standalone WordPress sites, and WordPress Multisite Network of Sites on my server. There are times where there are too many sites all running cron jobs too soon in proximity. I am ...
0
votes
0answers
14 views

Cron job to delete post by title

I've searched a lot and I didn't find nothing that could help me. So, I want a cron job to automatically delete posts that have no title. Why I want that? I have a IFTTT recipe that automatically post ...
0
votes
1answer
38 views

Display a random tag but using cron to control frequency of change

Background - I have created a shortcode in functions.php which adds a single random tag with it's link and description to a widget in my sidebar. This is my existing code... function ...
0
votes
0answers
22 views

Scheduled event occurring each page load, but supposed to happen daily

I have a scheduled event that is supposed to occur only once a day at 12am. However, for some reason my scheduled event is happening on each page load and I can't figure out why. The default ...
0
votes
1answer
210 views

set post to draft after set period based on post_modified date

I have a custom post type for a users profile page. My client wants all users to update their profile at least once a month. So we want their profile (custom post) to be automatically set to draft ...
4
votes
1answer
214 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
0
votes
2answers
22 views

Pages for Cron use Only?

so I've got a bunch of custom page templates that are scripts that are meant to be run by cron to update various things on my wordpress site, there are not meant to be viewed by regular site users. ...
5
votes
1answer
180 views

wp_schedule_event won't accept args

I'm trying to schedule event on hourly basis but it doesn't work. Why, I can't understand. Here is a function that i use to schedule event. add_action( 'scheduled_update_feeds', 'update_feeds', 10, ...
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): ...
0
votes
0answers
33 views

Expire a post with meta_value after two weeks

I am trying to use the below code to query for some posts and then change a meta_value in order to "expire" it after two weeks time. I can't get this to work and it's difficult to test since I can ...
1
vote
1answer
86 views

When to use wp_schedule_single_event for async / non-blocking processes?

I have noticed this pattern in some plugins lately: <?php function MY_CRON(){ wp_schedule_single_event(time(), 'MY_ACTION'); } add_action('save_post', 'MY_CRON'); function MY_FUNCTION(){ // ...
0
votes
0answers
41 views

custom cron interval is not working

I am trying to create custom interval for cron schedule with below code but it is not working, function cronschedules($schedules) { $schedules['custom'] = array( 'interval' => 36000, // seconds ...
0
votes
1answer
50 views

Custom interval is not working

I am trying to create custom interval for cron schedule with given user input, but its not working. Here is the code: add_filter( 'cron_schedules', 'custom_cron_schedule' ); function ...
2
votes
1answer
101 views

Send email daily from WordPress site

I customized a calendar plugin which shows today's birthdays and current month's list of wedding anniversaries in the home page of the site. I wrote a code in that plugin's displaying page using ...
0
votes
0answers
50 views

WP Cron debug issue - running on staging, not on live

I realised a plugin's wordpress cron wasn't running on my live site, so I installed WP Debug Cron to investigate the issue. All the custom and core events show Next Execution as being in the past. In ...
0
votes
1answer
234 views

Make posts automatically from an Online XML file through wp cron job

I want to import posts from a RSS feed using the WP Cron API. Here is the link to the XML Feed. I activated different Feed Aggregator wordpress plugin but it gives error. Problem: FeedWordPress ...
0
votes
1answer
66 views

Issue with wp_schedule_event()

I am trying to set up an event on a custom interval that will grab new posts from an Instagram search and create them as wordpress posts. I had the code working on its own page, and now I am trying to ...
0
votes
0answers
55 views

wp-cron.php - timeout

I found via Query Monitor plugin, that there is some HTTP request error during page load. I looked at the error table, and here I found that problem is with this: FULL_IMAGE How can I delete this ...
0
votes
1answer
75 views

wp-cron still running even though DISABLE_WP_CRON is true

I have created a cron job to run wp-cron.php for me but I am seeing in my FPM logs where it's still running. From what I understand, is that with the cron job it wouldn't be hitting FPM to create any ...
0
votes
1answer
122 views

WP Cron: Save third party data as user meta

Editors note: Twitter ID and Google Analytics only serve as examples and are exchangeable. TL;DR I want to save external data in a user profile once or twice a day. I added two custom fields in my ...
0
votes
0answers
18 views

Save automatically data to user profile once or twice a day [duplicate]

The main goal : I am working on a panel which will display statistics of my user websites (external website). For that, I use the Google Analytics API. I save the Google Analytics profile number in a ...
0
votes
1answer
105 views

What is the use of wp_schedule_event hook?

I want to do a cron(executes function at specific time, like email,db backup etc) job. I searched in wordpress, i got this wp_schedule_event Here they say it will execute job when someone visits ...
5
votes
3answers
3k 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 ...
1
vote
1answer
91 views

WP_Cron script not updating all posts in loop

I've had an issue with this piece of script for a month now http://pastebin.com/f6LqgqQS. What the script is supposed to do is loop through all my posts, pull the like count from the facebook graph ...
1
vote
1answer
211 views

Getting this code to work in Multisite

I'd like to run this code via cron on multisite. When I use the admin_init hook the code executes and works perfectly, deleting the blogs, however when I set it as a cron, and then run the event with ...
0
votes
0answers
114 views

WP-Cron tasks scheduled but not running

I'm working on a particularly large WordPress multisite network, and have been struggling with WP-Cron. It seems that WP-Cron tasks are being scheduled, but not run. The WP-Cron tasks are not being ...
0
votes
1answer
39 views

How can I prove if wp cron is running my task if I have DISABLE_WP_CRON set to true

I am trying to trigger a wp cron task via a real (linux) server cron and have followed online instructions to add this to wp-config: define('DISABLE_WP_CRON', true); My cron job does this : wget ...
0
votes
1answer
53 views

what is firing cron

I've been having problems while trying to setup a simple cronjob. A lot of the WordPress tutorials like this one http://tommcfarlin.com/wordpress-cron-jobs/ specify a crontab with some time schedule ...
0
votes
0answers
84 views

Cron Lock Timeout, when to use?

When is it a good idea to use this constant in relation to WordPress Cron? WP_CRON_LOCK_TIMEOUT
0
votes
1answer
185 views

Do WordPress cron jobs slow down page loading?

If a user visits a site and his visit triggers a cron job that is quite intensive, the page load speed will be slower for him right? As I understand the page doesn't wait for the cron job to execute ...
0
votes
1answer
88 views

Cron jobs repeating themselves

If I have a function set to run every 5 minutes via a WP cron job, and I have only one visitor during a day, does his visit trigger just one run of that function or all the runs that have been amassed ...
0
votes
0answers
25 views

Break a Wordpress function to run in patches and re-continue

I am new to PHP and coding and I am really not a coder but I try to modify and use existing codes. I have a function which I am trying to run when needed for all users within Wordpress to do an ...
0
votes
0answers
64 views

wp_schedule_single_event running twice

I have set up a meta box with a checkbox, so when checked and the post is saved, a scheduled event is registered to send an email to all users (around 1200) in the background. Sometimes the emails ...
0
votes
0answers
216 views

Using wp_cron with wp_mail to send bulk email

I am working on a custom plugin to send recurring invoices on the 1st of every month. So far, the plugin is working pretty well. It creates new invoices for each user based on their order and does ...
0
votes
2answers
30 views

Hook/Cron Problem

I have this fuction in my fuctions.php <?php if ( !wp_next_scheduled('re-post2') ) { wp_schedule_event( time(), 'hourly', 'rep-post2' ); } function repostads() { global $wpdb; $querystr ...
0
votes
1answer
227 views

Adding custom cron_schedule prior to wp_schedule_event

I am trying to add a custom cron_schedule interval inside a plugin and then use that custom interval to schedule a cron event when the plugin is activated. It seems that the custom interval is not ...
5
votes
2answers
1k 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
153 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 ...
0
votes
1answer
60 views

Using a Cron Job to dynamically populate a field ONCE, and then making the field blank the next time someone visits page

I'm probably going to butcher explaining what I'm trying to do, so bare with me. Essentially I'm working on a custom Contest type of solution for a client. I'm using Gravity Forms for the users to ...
0
votes
1answer
83 views

Manually trigger a wp_schedule_event item?

I have successfully added an event via wp_schedule_event and I'd like to trigger it manually without disrupting the existing schedule. Is there a way to tell WP to execute an event immediately ...
0
votes
0answers
28 views

Daily class register with monthly invoicing

I'm about to take on the task of creating a daily class register the features of which I have listed below. I am mostly a novice when it comes to wordpress development and I can do some PHP ...
1
vote
0answers
56 views

Get frequency of scheduled event

How do I get the frequency of a scheduled event? I am writing a plugin, that would do something in a user defined schedule. The way I am trying to do this, is creating a custom cron schedule, which ...