Questions tagged [cron]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
21 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
12 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
21 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
37 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
17 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
11 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
16 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
22 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
15 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
65 views

How to trigger a url in WordPress cron?

I want to trigger an url . Basically I am trying to automate an import using the wp cron for wp all import. I have to urls , one trigger url and processing url. The trigger URL will look something ...
0
votes
0answers
23 views

Wordpress cron being run from a different subdomain

I manage four websites on four separate servers - each has the same domain, but a different subdomain. One is the main public website, the others are for different stages of development. Three of ...
0
votes
0answers
37 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
25 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 ...
0
votes
0answers
55 views

What is the result of a bot attacking the wp-cron.php file?

I am trying to understand the wp-cron system better. I have recently had instances of my server resources being used up, throwing 503 errors, and on investigation this always appeared to happen ...
1
vote
1answer
11 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
55 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
8 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
35 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
15 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
17 views

wp_schedule_event not running or visible when viewing _get_cron_array()

I have seen various similar questions with answers, but still unable to get this working. I just have a simple email which is meant to be sent out weekly with a list of new quotes. The email ...
0
votes
0answers
39 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 ...
0
votes
0answers
62 views

change time interval of scheduled woocommerce cron job

Since woocommerce version 3.4 it is possible to anonymize order data either manually or via a scheduled interval (Days / Weeks / Months / Years). Now I would like to customize the interval to twice ...
1
vote
1answer
140 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
71 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
0answers
96 views

delete cronjob events with no action (wp-control)

I am quite new to Wordpress Cronjobs. I deactivated the wp-cron function via wp-config.php and set a server cronjob to run wp-cron.php To add new cronjobs, i installed the wp-crontrol plugin. I was ...
0
votes
0answers
58 views

WP Cron intervals multiple times a day?

I would like to run a custom interval for a cronjob where it runs every day at 5 minutes after 6am, 10am, 2pm and 6pm. The timing for this on a crontab would be 5 6,10,14,18 * * * However I'm stuck ...
0
votes
1answer
41 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
131 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
11 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
42 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
204 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
26 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
171 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
81 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
143 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
834 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
244 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
179 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
18 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
3answers
73 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
100 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-...
0
votes
1answer
25 views

Automated mark posts as featured every day

Hello Wordpress Community, I want to build myself a "recipe of the day" functionality. I'm looking for a way to mark 3 Custom Post Types per day as "Featured Posts" by a plugin or Cronjob. The ...
1
vote
1answer
638 views

Check if event was scheduled - schedule event only once

I have some programming error in my wordpress plugin. When its running, then it keeps registering cron job to the wordpress. I wrote the plugin as a class: class Cleverstart_Woofio extends ...
0
votes
1answer
589 views

Most efficient way to trigger wp-cron through system cron.

I have recently decided it would be best if i disable the built in wordpress cron function and move to the system cron which will activate the wordpress cron every 15 minutes. I am wondering which ...
3
votes
2answers
149 views

WP CRON runs only the first time

Here is my code function cron_add_weekly( $schedules ) { $schedules['seconds'] = array( 'interval' => 5, 'display' => __( '5 Seconds' ) ); return $schedules; } ...
1
vote
1answer
78 views

Detect if Cron is Running

Many times I have code and I want to make sure it only runs in a cron context, or it never runs in a cron context. Is there an is_cron_running style function?
0
votes
1answer
64 views

WP_CRON issue with UTC and local time

I have made a plugin to change some user metadata on a schedule according to the wp_cron function. If the current time is say between their lunch hours (that is in their user profile as date('g:i a', ...
0
votes
1answer
86 views

Call a PHP file from Cronjob

I'm using the MEC Events Calendar. I am trying to auto sync my events to Google Calendar. Here is what the event plugin says: Important Note: Set a cronjob to call /www/wp-content/plugins/modern-...

1
2 3 4 5 6