Questions tagged [cron]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

run wc_get_orders() in none wordpress cron job

I need to run a cron job not using WordPress built in cron functionality. Basically, I need to get all the orders and send some email. I've set up my cron on the server it runs at the desired interval,...
0
votes
0answers
23 views

Auto Update all the posts of specific Custom Post Type

In one of my Clients website, they were using Awesome Gallery in their posts. They wanted to use custom gallery so, I provided them with a custom post type gallery. The main huddle here was ...
0
votes
1answer
22 views

How to protect a script execution on Wordpress?

Recently I have created a script to update records on my Wordpress database. I basically use wpdb to connect to another database, grap some records, and update the Wordpress database. Using only ...
0
votes
1answer
13 views

Cron job to change CPT

I'm hoping to write a cron to automatically change the custom post type for any items that match a particular CPT each night at midnight. For instance: I have a CPT called "members," but at ...
0
votes
0answers
16 views

Wordpress schedule event function not running

I am totally new with the schedule event from Wordpress. For my theme I created a function that must run every minute. To test my scheduler I created a test function that send me an email. But I do ...
0
votes
2answers
31 views

Large Wordpress CRON job

I'm programming the integration with external API (real estate). I have one CRON job which is planned for at 1 o'clock am. It's running very well because I'm using server CRON initialize instead WP ...
0
votes
1answer
26 views

Manually running cron from the server

I have a staging server begind basic auth and I'd like to run system cron instead of WordPress 'cron'. I've placed the define('DISABLE_WP_CRON', true); in my wp-config.php, and first I've added */5 * *...
0
votes
0answers
23 views

Wp_Schedule_Event every few minutes doesn't work

I wrote the folowing timer in my function.php file. It should be called every certain time (3 minutes) but it doesn't work at all. function myprefix_custom_cron_schedule( $schedules ) { $schedules['...
0
votes
0answers
49 views

Setting up a cron job to auto update a custom field

I need help to setup a cron job to update a custom field (created with Advanced Custom Field) every 8 hours. This is the function to define the custom time schedule: function cron_schedule_eight_hours(...
1
vote
0answers
10 views

Scheduling update post daily

I have created a function to change the post category to archive after expiry date. And it will update every time when I save a post. But the question is that how can I schedule an update for posts ...
0
votes
1answer
58 views

How to force 'cron_schedules' every minute instead 1 hour?

I have a problem because I try to run my function every minute... And there are my two codes which I tried: function my_cron_schedules($schedules){ if(!isset($schedules["61sec"])){ ...
1
vote
1answer
40 views

Wp Maintenance mode and external cron job

I am using this code add_action( 'wp_loaded', function() { global $pagenow; // - - - - - - - - - - - - - - - - - - - - - - // Turn on/off you Maintenance Mode (true/false) define('...
0
votes
1answer
39 views

How to run SQL query from Wordpress 'WP Crontrol' plugin

I have a SQL query which does exactly what I want if I run it directly in the database: UPDATE wp_pmpro_memberships_users SET wp_pmpro_memberships_users.status = 'admin_cancelled' WHERE ...
0
votes
0answers
12 views

What is the relationship between UFW (firewall) being enabled and cron job running?

I have a very specific problem on my server and can't wrap my head around it. I use BackUpWordpress as a backup solution for my site. Recently I noticed cron jobs were not firing properly to backup ...
0
votes
1answer
266 views

Cron jobs when running multiple instances on the same DB

I have a user using my plugin that has multiple AWS instances hosting WP and pointing to the same database. One of the jobs of my plugins is to run a large number of small jobs. I was thinking of ...
0
votes
1answer
14 views

Is there a delay to include call function modification in a scheduled cron task?

I´m testing my cron task. I´m not sure but it seems to be the effect of a previous code. So, I´m wondering when you modify you call function and you run now your cron task (I´m using WP Control) and ...
0
votes
0answers
23 views

How to pass variable from other function?

I want to pass the $job_id variable to the expire_job_featured function (for wp single cron event) but I don't know how can I do that. This is the full code of setting job's post meta value "...
0
votes
0answers
67 views

Cron and request with wp_remote_post

I have a problem with a plugin I'm working on, I have implemented a cron that 2 times a day makes a call to update the data, the call is made with the wp_remote_post function. $response = ...
0
votes
0answers
23 views

How performant is update_option relative to update_post_meta when updating on each post load?

I've created an AJAX function that updates the views count of each post load. public function updateViewCount() { // ... $postID = $_REQUEST['post_id']; $key = 'post_views_count'; $...
0
votes
0answers
13 views

Execute admin request every certain time

One of the plugins I use is a currency converter and has only manual rate updates. It fecthes the data from yahoo finance or somewhere but you do have to click a button to get it to update. I have ...
0
votes
1answer
18 views

Wordpress Console Application (ability to excecute a custom function via crontab only)

I have a few custom tables in the database and I need to clean expired data from time to time. If I was using WP-Cron, it would be easy, but WP-Cron sucks and is a no-go (especially for what I am ...
0
votes
0answers
26 views

WP Cron Scheduled not excuted - but mark as executed in several plugins

I made a cron task to import json data using an external api to create/update/delete posts/taxonomies etc... I scheduled this cron task every day at an hour chosen in settings. I used two plugins of ...
0
votes
0answers
13 views

Action not included in the cron task

For some reasons, my cron task is registered with the right hook but the action does not exist. I would like to use a class method. So I have some questions... Do I need to wrap add_action() inside a ...
0
votes
1answer
20 views

Cron task with scheduled timestamp in the past

I´m doing some setting to enable/disable a cron task and choose a time to run this task. When I disable the cron task and enable it after without changed the time, my timestamp is in the past and make ...
0
votes
0answers
79 views

Cron task gets removed from the schedule

I have a plugin which I have deployed on four different websites. Part of that extension is a Cron job which triggers every hour. On one of my deployments my job gets removed from the schedule. I ...
0
votes
0answers
77 views

Manual Cron job occasionally outputting WP die message

I have some manual cron jobs running on my server hourly - they seem to generally fire fine, but occasionally they output the WP die message page html (see below) to the cron output logs which i have ...
1
vote
1answer
13 views

Cron job for creating posts not excecuting properly

I've written a PHP script to create custom posts programmatically from Google Calendar events, and an action hook that purges all existing events and repopulates it with current ones. This works fine ...
0
votes
0answers
172 views

Flush rewrite rules with scheduled event (cron)

I'm trying to flush rewrite rule with a wp_schedule_event function el_custom_cron_schedule( $schedules ) { $schedules['el_every_5mn'] = array( 'interval' => 5*60, 'display' =&...
1
vote
0answers
34 views

Programmatically save one/any post

I am using WP All import in order to import listings in a website. Everything works well except displaying all listings in a map. If i edit any listing, and then click Update (without making any ...
0
votes
0answers
85 views

Use wp_remote_get() with a private or password protected page?

Is there any way to use the wp_remote_get() function to access a WordPress page that is either set to Private -OR- password protected (using the native password option in the post visibility settings)?...
0
votes
1answer
19 views

How to Set a Condition via Page Template Name in WP Cron Job?

I have created a Cron Job Function. But, I can't set a condition for Cron Job. Basically I want Cron Job need to work if the Template File Name is page-delete.php So, How can I set Condition using ...
0
votes
0answers
161 views

Real cron killed my cron system. Only define( 'ALTERNATE_WP_CRON', true ); works

my host recommended me to disable wp cron for a real cron due to excessive executions. the cron system broken immediately and scheduled tasks were not happening. deleting real cron and turning on ...
1
vote
1answer
411 views

Why is wp-cron only executing on page visit?

As I have understood wp-cron runs after a HTTP-Request to the given domain. Can someone explain to me why this is the case? I don't quite understand why the execution of (scheduled) wp-cron events are ...
0
votes
1answer
173 views

Server cron job not working

I want to setup server cron job for my WordPress website. This is what I have done so far. I added this line to my wp-config file. define('DISABLE_WP_CRON', true); I added this command for setting ...
0
votes
1answer
48 views

my hook or my function wont run in the cronjob

i have made a cron job to run a function but the function wont run. i did run the code that is inside the function, outside to see if it works and it did, it just wont do nothing if inside the ...
0
votes
0answers
250 views

execute cron jobs when .htaccess login protected?

My client is not able to execute cron-jobs in his wordpress dashboard because he gets 401 not authorized. This is because he has an .htacess file blocking normal access to the site (it's a member ...
0
votes
1answer
15 views

Cron job shedules replace?

I was watching this: Wp_Schedule_Event every day at specific time and im wondering if I do the following will it replace all my schedules? function myprefix_custom_cron_schedule( $schedules ) { $...
1
vote
0answers
131 views

wp_schedule_single_event not working: cron job is triggered but nothing gets executed

I'm trying to execute a piece of code asynchronous. I tried to use wp_schedule_single_event like this in my WP plugin: function my_async_test(){ $fp = fopen(wp_upload_dir()['basedir'] . '/log.txt', '...
0
votes
1answer
480 views

How to Schedule Cronjobs for start of every month and year

I have been trying to run a function at first of every month, and first of every year. And i wanted to run at 12am exact. Below I have shown the function. When is schedule it for daily it works ...
0
votes
0answers
23 views

wp-cron event doesn't run when custom login API is enabled

I have a cron job on my wordpress site. which I would like to run every hour. I also have a custom login function on my site: users are directed to my site via another site which passes login ...
0
votes
0answers
30 views

CRON job to update wp_usermeta value each day or week based on server time

My Wordpress site has a registration field that asks members how many weeks pregnant they are. If a member insert 5 then 7 days later that integer needs to increase to 6. Pseudo code for what I ...
0
votes
1answer
249 views

wp delete duplicate entries of custom post types every 15 minutes

looking for some assistance. I have searched the usual sites but not come across this specific question and was wondering if anybody could help. I have a scrape system that collects data and saves it ...
1
vote
1answer
118 views

Issues When Recursively Calling wp_schedule_single_event()

I run a site where I make an external API call. I want to have a failure case such that, if the API call fails, it will call wp_schedule_single_event() to re-try the API call in +4 hours. If that ...
1
vote
0answers
235 views

WP All Import manual Cron

I am having problem to set up Cron to import stock. In Plugin WP-All Import i have two urls. One which starts import, another one is checking process and if it's stuck it kicks it back on. I'm runing ...
0
votes
2answers
1k views

Cron not sending wp-mail()

I have a problem with a cron schedule function, it does not want to send an email with the wp_mail() function. This is my code: It is placed in the functions.php <?php add_filter('...
1
vote
1answer
422 views

Update CPT post meta with update_post_meta and cron job

I'm attempting to regularly update a custom field ($company_rating) in a CPT with update_post_meta(). The cronjob is assigned and working. I've tested the function and it prints correctly (I've ...
1
vote
1answer
388 views

How to bypass maintenance mode with external cron?

I'm using crontab to run a php script loaded with wp-load.php with absolute path. However, when I go to maintenance mode, the file can't run. I'm using Coming soon plugin. Is there a way to exclude ...
0
votes
1answer
22 views

Schedule an action callback

I have a function in which I want to send out emails of expiring account. Is there a way of scheduling a "doaction()" or similar. What I want is this: doaction('Something here', ...
0
votes
4answers
93 views

Scheduling WP cron jobs

I am new with cron jobs and I have to schedule cron jobs. There are a lot of cron jobs in my website which are running randomly but I want all these to run at specific time. Actually I do not want ...
0
votes
0answers
123 views

Php cron job (wp-cron) not working

I try to create a php cron job with help of the WP Control plugin. The purpose is to delete all files in the uploads directory for the current year and month. I use this code: $files = glob('./wp-...

1
2 3 4 5 6