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

learn more… | top users | synonyms

1
vote
1answer
655 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 ...
1
vote
1answer
12 views

Triggering wp-cron by cronjab directly rather than with wget?

Can you just trigger wp-cron.php using "php /path/to/publichtml/wp-cron.php" rather than going through the wget method (e.g. "wget -q -O - http://example.com/wp-cron.php>/dev/null 2>&1")?
0
votes
0answers
9 views

Countdown Timer to Publish Draft

I am attempting to create a way for specific draft posts to be published after a 36-hour countdown. Basically, the site allows post submissions which are voted on, and the winning post gets ...
0
votes
0answers
12 views

WP Cron does not work on MAMP server

Using PHP 5.5.10 and WordPress 4.3. No matter what, I can not get Wp-cron to work. If I visit wp-cron.php or wp-cron.php?doing_wp_cron it works after a few seconds of waiting. I.e. it echos "Hello". ...
0
votes
1answer
450 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 ...
2
votes
2answers
276 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 ...
3
votes
1answer
421 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 ( ! ...
5
votes
3answers
435 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, ...
0
votes
0answers
25 views

WordPress Cron scheduled but not running?

I know that WP Cron is not a real cron and I am testing it by visiting it at when it is scheduled to run. I can see that it is scheduled using the crontrol plugin but clicking execute now does nothing ...
1
vote
1answer
2k 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
1answer
215 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
2answers
30 views

How to Insert data with wp cron

I am using wp_schedule_event for Insert data every 1 Minutes in a teble. But here is some confusion where i have to add code for Insert. Here is my code which add in functions.php in my theme. ...
2
votes
1answer
17 views

Can't access wp_filesystem in cron function

I'm writing a plugin for integrating WP with Visma. It will basically spit out an XML file every third hour using wp cron (going to setup server cron for wp-cron.php on the live site) and save it to ...
0
votes
0answers
20 views

Run function with linux cron job in Wordpress

I know that WordPress has a faux cron that is called like so when a user visits the page. register_activation_hook(__FILE__, 'my_activation'); add_action('my_hourly_event', 'do_this_hourly'); ...
0
votes
0answers
18 views

must save twice to trigger the wp_schedule_single_event

Code is as below. I set a custom field named sliderScheduledClosed stored a datetime. I want to schedule an event when I publish the post. add_action('publish_slider', 'IUI_schedule_event', 10, 1); ...
5
votes
3answers
2k 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' ) ) { ...
0
votes
4answers
415 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
1answer
444 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
0answers
34 views

wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all

I am a bit lost while dealing with a open source plugin implementing wp cron. You can read about the problem on github https://github.com/nekojira/wp-currencies/issues/6#issuecomment-116735909 - I ...
4
votes
3answers
895 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( ...
0
votes
0answers
27 views

Trigger Cron Job

I've created a custom field called "auto_expiry_date" within a post type "collection". I'm trying to setup a cron job on a daily scheduled to check if a post has a "auto_expiry_date" older than the ...
0
votes
1answer
17 views

Is WP-Cron / wp_schedule_event suitable for time-consuming actions?

I want to schedule an action to be run daily. This action can take up to a few seconds. Question is: is WP-Cron the suitable mechanism (compared to, say, classic Unix cron) for such action? The ...
2
votes
1answer
123 views

Schedule WordPress Auto-Updates to only run during business hours

We've turned on WordPress Auto-Updates (yey!), but, just in case this does break anything, we'd like to only run Auto-Updates during daylight hours (e.g. 09:00 - 17:30). We have the "on init" WP-Cron ...
0
votes
1answer
39 views

Is it OK to use a system cron to trigger a function hooked into the AJAX API

I have a real cron job setup and it seems to work. I have outlined the basics below. The reason I ask is I don't see this method mentioned often and I'm wondering if that is because doing so is a bad ...
1
vote
0answers
26 views

Set post to unpublished after one week depending on condition

I have a post type with a custom field checkbox. If this checkbox is checked and the post is published, I want to unpublish when one week has passed since last modified date. How would I go about ...
0
votes
1answer
529 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
0answers
37 views

Post expire by gravity fields

I'm using gravity forms to let users publish some content from front-end. But I need to let then set expiration date. So I've installed Content Scheduler and Post Expirator plugins, because plugin's ...
1
vote
1answer
1k views

Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929

I'm writing a theme and almost every time I reload a page, WordPress is giving the following error Warning: ...
0
votes
1answer
121 views

Sending email to all users

What is the best practice to send an email to a large number of users? I am developing a plugin for the website of an association and one of the things needed is to be able to send an email to all ...
0
votes
1answer
110 views

Best Way to get facebook share count and update using wp_schedule_event or any other method

I recently developed a news blog, and my client needs facebook share count. I Successfully able to get the share count and update the custom field using below code.(with the help of cybermeta). What ...
0
votes
1answer
58 views

How to make WordPress emails async

I recently had an issue on my site where emails were failing to send. That was a problem, but the bigger problem was that the failure caused the script to timeout which really put a damper on the user ...
1
vote
1answer
82 views

WP cron doesn't pass through my arguments

I've been trying to import some posts trough a cron action. The problem is my last step. Everything is going well, except for the execution of the cron. It is only passing trough the first argument. ...
3
votes
2answers
512 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 ...
1
vote
1answer
544 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
49 views

No result update a custom field using wp_schedule_event

I recently developed a news blog. My client asked for a facebook share count of an article. I am able to get the share count using facebook api, However, according to the information I found from ...
6
votes
4answers
7k 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 ...
0
votes
1answer
82 views

my wp schedule event is not working

function wp_cron_define(){ add_filter('cron_schedules', function($schedules){ $schedules['mine'] = array( 'interval' => 30, 'display' => 'once in a week' ...
0
votes
1answer
30 views

Detect each active instance of a widget

Is it possible to detect each active instance of a particular widget? As part of a plugin I'm working on, I want to run a for each loop on each widget instance Each widget is a Twitter feed and the ...
0
votes
1answer
29 views

Run Wordpress Plugin in the Specified time

I write the wordpress plugin . That Contains curl code... When I open wordpress site Ex(http://localhost/wordpress or http://localhost/wordpress/wp-admin ,...) this plugin running. But I Want Run ...
0
votes
1answer
47 views

Using cron for multiple queries

If I have something like the following in my single.php file (as a very basic example): <?php $a = the_field('test1'); ?> $b = the_field('test2'); ?> $c = the_field('test3'); ?> $d = ...
0
votes
2answers
73 views

WP-Cron function not firing

I am trying to get a simple php function working with cron (based on a tutorial). I have the following: <?php if (!wp_next_scheduled('please_just_work')) { wp_schedule_event( time(), 'daily', ...
0
votes
0answers
39 views

Wordpress Multisite Cron Issue

I'm having some very weird cron issues. I was looking to run cron on a multisite subfolder install. And I user Debug Bar Cron plugin to see my cron jobs. I can see that the cron jobs are running fine ...
1
vote
1answer
113 views

Schedule cron don't work

I try to set up a cronjob. It seems like it run the le_schedule function but not the le_do_this function. I also tried some cronjob plugins, some says it runs and some says it fails. In this case it ...
0
votes
1answer
552 views

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

I am using WordPress v.4.1 and all the plugins and the theme are up to date. I see in my log files too many of these... xxx.xxx.xxx.xxx - - [02/Jan/2015:13:30:27 +0200] "POST ...
3
votes
1answer
117 views

Wordpress scheduled task is called but not executed

I created a plugin with a cron to update all posts of a certain type every 5 minutes. I installed WP Crontrol to check if the cron is registered correctly and everything seems to be okay. This is how ...
3
votes
1answer
117 views

wp_schedule_event is executing but the function related to the hook is not running

I have an OOP plugin, The purpose of the plugin is to catch scheduled posts, save them in cron, then 2 minutes after they are published, to run a custom function on them. This is the stripped-down ...
0
votes
0answers
43 views

wp_cron inside a class not correctly calling method

I have been trying this for a few hours today, reading a few different posts on the subject and several blog posts that each had their own method. I've managed to get the hook "recurring_cron_job" ...
0
votes
3answers
34 views

what effective ways are there to debug cron

Right now about 25% of the entries in my access log (which do not show resource like css, images, etc) are requests to wp-cron.php. I assume there is some process event that got "stuck" and keep ...
0
votes
1answer
78 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 ...
4
votes
2answers
4k 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 ...