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

learn more… | top users | synonyms

1
vote
1answer
347 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'); ...
0
votes
1answer
23 views

How to know if a script started by wp_cron is still active?

I have a plugin that uses wp_cron to run jobs, these jobs are quite large sometimes and they seem to have stopped without any indication (0 errors in apache log as well as in the plugin's own log) So ...
0
votes
1answer
413 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
298 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 ( ! ...
3
votes
2answers
1k 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 ...
0
votes
1answer
28 views

how to crate cronjo not depending on user access

i want to use wordpress cron job but it depending on user or admin entering the site, can i override this and make independnt cron on wordpress? now i use a simple timer when admin enter the admin ...
0
votes
1answer
289 views

Set post to draft after set period based on post_modified date

I have a custom post type for the user 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 ...
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
0answers
14 views

Constantly schedule posts for two weeks in advance

I was wondering if there was a way to automatically and constantly have posts scheduled for two weeks in the future. Example: I have a post that I want published every Tuesday at 1pm, and I want ...
2
votes
0answers
79 views

How to run WP Cron the right way?

I have WordPress Multisite with several sites. I set up DISABLE_WP_CRON to true in my wp-config.php. How to run wp-cron.php the right way? If we set up cron task with wget or curl we have 30 sec ...
0
votes
0answers
63 views

Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?

I'm trying to update the post meta of all published posts hourly (via wp_cron) with the code below: if ( ! wp_next_scheduled( 'postviews_updatedcounts_hourly_event' ) ) { wp_schedule_event( ...
0
votes
0answers
16 views

Cron job disappering without notice?

I have a cron job (doing an sync against an external system) running every 10th minute in a multisite-install. For 2 out of 3 sites it is working perfectly. On the third site the scheduled job is ...
0
votes
3answers
292 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 ...
0
votes
2answers
42 views

Hook/Cron Problem

I have this function in my functions.php <?php if ( !wp_next_scheduled('re-post2') ) { wp_schedule_event( time(), 'hourly', 'rep-post2' ); } function repostads() { global $wpdb; ...
0
votes
3answers
68 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 ...
4
votes
4answers
13k views

Why is ?doing_wp_cron being appended to my URLs

I'm finding this string appended to the end of my URLs sometimes: /?doing_wp_cron Does anyone know what it for? How can I remove it?
0
votes
1answer
56 views

automatic send email at custom time

I want to send an automatic email every day at 10:00 I tried this code $timeN = date('H:i'); $timeS = date('10:00'); if ($timeS == $timeN) { $to = get_option('admin_email'); $nfrom = "my ...
0
votes
0answers
31 views

Custom Event for Wordpress Cron Job Not executing

Method to Execute at Certain Interval function informant_main_action(){ die('working'); } Custom Schedule for Cron Job function my_cron_definer($schedules){ $schedules['weekly'] = ...
0
votes
2answers
33 views

How to make a cronjob type plugin

Hi i am new on wordpress and has been given a task to make such a script that will fetch posts by categories and shoot email to subscribers. The table structure for subscriber is below Subscriber Id ...
0
votes
0answers
33 views

wp_next_scheduled not working with variables

Here is the code: <?php while ($parent->have_posts() ) : $parent->the_post(); ?> <?php $timi = get_field('timi', $post->ID); ?> <?php $timi2 = $timi / 2; ...
0
votes
0answers
27 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
165 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 ...
0
votes
0answers
34 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
112 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
28 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
47 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
33 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 ...
4
votes
1answer
303 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
24 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
249 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
44 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
187 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
49 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
70 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
160 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
57 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
440 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
89 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
121 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
139 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
171 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
128 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 ...
6
votes
3answers
4k 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
113 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
252 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
344 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
45 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
58 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 ...