Questions tagged [cron]
The cron tag has no usage guidance.
298
questions
0
votes
0
answers
11
views
Creating a background process that doesn't need HTTP
I want to fetch data from an ERP system and use that to fill the Woocommerce products. This operation is quite memory intensive and lengthy. So I'd like to run this through a cron that just calls a ...
0
votes
0
answers
14
views
‘wp_site_health_scheduled_check’ Causes Failure Of Other Scripts
I introduced a heartbeat monitoring system on all my websites late last year. The system involves using a wp-cron action to send a GET request to an API hosted by Better Uptime, triggered by crontab ...
0
votes
0
answers
10
views
Update last created post in custom post types with wp_cron()?
I have a question about wordpress cron job.
I have created a website using elementor page builder. I made a form for client which my client used to send invoices to their clients.
Once my client ...
0
votes
0
answers
63
views
Error code 499 on specific cron job
I am getting error code 499 in my website's access logs. The site is built with WordPress. The logs are mostly coming from bg.googleusercontent.com which is I think google's analytics tool or some ...
0
votes
1
answer
59
views
WP CRON Fails At 13:00 Every Day
TL;DR; Advice please on troubleshooting this issue
I have setup a real CRON scheduler (linux crontab) instead of relying on wp-cron scheduling - further info here. All it does is reliably initiate any ...
1
vote
1
answer
70
views
Does DISABLE_WP_CRON prevent plugins from registering new cron tasks?
If I set DISABLE_WP_CRON to true in my wp-config.php file, then will it block plugins from registering new cron events (eg with calls to wp_schedule_event())
define( 'DISABLE_WP_CRON', true );
I've ...
0
votes
0
answers
131
views
How to know if WP cron is currently running my hook?
I have an action that calls a function which takes about 20 seconds to complete (uploading file to remote server). How can I code it in such a way so that it could check if WP cron is running the same ...
0
votes
1
answer
31
views
Cron event running more than once if triggered from WP Crontrol
This is just a sample plugin I created in order to track this issue down in a real plugin, but I am experience the same behavior:
<?php // cron-test.php
/**
* Author: me
* Description: CRON Test ...
0
votes
1
answer
141
views
wp_mail sending only once inside foreach loop
I have written and re-written this code several times. I've tried removing the wp_mail function from the loop and putting it in it's own function. I've moved all the variables in to the loop. At one ...
2
votes
2
answers
219
views
Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?
I have a plugin that needs to do a "database update" sort of operation, going through all users and performing a particular database operation on each one. It's designed for sites with large ...
0
votes
0
answers
11
views
Offloading cron jobs
My site needs to run several cron jobs that take up a lot of resources, so my VPS is under heavy load 🙁
The cron jobs mostly retrieve files, process them and saves data to the database, i.e. they don’...
0
votes
0
answers
9
views
Indicate image sizes for upload by post type
I would like to do this :
add_filter('intermediate_image_sizes_advanced', 'manage_image_sizes', 99 );
function manage_image_sizes($sizes ){
if( ( $_REQUEST['post_type'] === 'foo' ){
$...
0
votes
0
answers
29
views
Certain lines added to our wp-config.php file are being removed, every day
It seems that certain lines added to our wp-config.php file are being removed, every day at 01:00.
The line that's being removed is
define('WP_ENVIRONMENT_TYPE', 'staging');
Which is added just ...
0
votes
0
answers
31
views
3,840 cronjobs with no action!
I have a site which constantly has nearly 4,000 cronjobs with no action. If I delete a number of these jobs they come right back, generally to the same number.
I've tried switching back to the Twenty ...
0
votes
0
answers
36
views
How can i find the cron jobs that run on my site and then move them to the server side?
I am trying to find all the cron jobs on my site and then, move them to the server-side, as my hosting provider gives me the option, to schedule them on the server. I am aware of some plugins like ...
0
votes
0
answers
209
views
Wordpress cron job running more than once
I developed a plugin to read some XML files and publish their itens as post but for some reason, sometimes, it is duplicating posts. Basically that is what I have:
// function one is scheduled (hourly)...
0
votes
0
answers
39
views
Unzip file in functions.php, and add it to cron
I have a file in the root folder of my wordpress installation (myfolder, wp-content, wp-config, and all other).
I want unzip a test.zip archive in my myfolder folder in root directory.
I try this ...
0
votes
1
answer
60
views
Auto Delete Users (auto_delete_users)
I need some help cause I couldn't find any solution for my problem and haven't the knowledge to solve the problem on my own.
What I'm trying to do:
I want to delte every WordPress user (subscriber) ...
0
votes
1
answer
143
views
How to run wp_insert_post() & wpdb on the background?
I have created a code to fetch data from a remote API then echo certain data & import those data into a post type using wp_insert_post() & post meta** using wpdb->query().
Here's my current ...
1
vote
1
answer
76
views
Does using WP-cron make the site slower for the user?
Forgive my "beginnerness" in this matter but I have 2 options to trigger a heavy task (massive update on users' properties to solve an issue between 2 plugins that weren't meant to cooperate)...
1
vote
1
answer
115
views
File Type Is Not Permitted - Cronjob
I am currently developing a cron job that downloads a xml file from an external source and stores it within wordpress media.
For debugging proposals, I have installed the plugin Advanced Cron Manager, ...
0
votes
1
answer
682
views
Time limit on long cron job?
I'm working on a membership system which is going to process renewal payments.
If I use set_time_limit(0) inside the wp_schedule_event (cron) function, is that enough to ensure that it has the time it ...
0
votes
0
answers
176
views
WP Cron Working, but Function Not Working
I have a plugin I built for events. I set up the plugin with WP Cron to run a function. The function checks the events posts to see if it's recurring then if the start date has passed it updates the ...
0
votes
0
answers
93
views
Solution for processing lots of data with CRON/API, dealing with memory/timeout issues
Using a custom CRON job set up in my Wordpress site I am connecting to an external API to refresh some data. The API only allows for a certain amount of records to be read at a time so I have to "...
0
votes
0
answers
57
views
Run function with schedule is not working correctly
i´m trying to run a function with a schedule but the response is empty. I am developing a plugin where i will send a json encoded array to my IoT service. The service is fine. All other functions are ...
1
vote
0
answers
131
views
export a csv file from the database with a cronjob
I'm using an event plugin, which doesn't have a user-friendly function for showing a list of bookings. That's why I wrote a php+js script myself to display that data in a nice way.
But to use my own ...
0
votes
1
answer
284
views
Strange cron job behavior and how to solve it?
My site health said cron evens has missed schedule, so I installed “Wp control” plugin to check the cron evens.
Normally “next run” will show the future time, but in my case it shows a time in the ...
0
votes
0
answers
301
views
Wordpress cron not getting executed when called by external service (but ok from browser)
I'm trying to set up an external cron service to run cron in my WP site.
I have disabled WP's own cron using define('DISABLE_WP_CRON', true); in wp-config.php.
As for the URL to call from the external ...
1
vote
1
answer
56
views
Update Content based on expiration time or queued processing
every hour by cron, I call a function that updates the contents.
If on post have custom field with auto,so work.(to distinguish it from those written manually).
function aggiorna_dati() {
...
0
votes
1
answer
48
views
Cron: Update four post at Hour
I have function that update post content automatically based from custom field like this:
function update_content(){
$mycustomfield = get_post_meta( get_the_ID(), 'customfield', true);
$...
0
votes
1
answer
115
views
Bulk updating a group of WordPress Pages every 10 minutes
I need to bulk update 86 specific WordPress Pages every 10 minutes, with the term updating I mean the same thing as clicking the Blue Update Button on each page, and having them all update at the same ...
0
votes
1
answer
372
views
Activate Plugin Automatically After Set Time
please how do I activate a plugin after a set period of time automatically. For example, let's say I want to activate Jetpack automatically after 3 weeks. Thanks
0
votes
1
answer
52
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
1
answer
34
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
2
answers
219
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
1
answer
77
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
0
answers
56
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
0
answers
420
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
0
answers
35
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
1
answer
473
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
1
answer
152
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
1
answer
250
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
0
answers
30
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
1
answer
945
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
1
answer
17
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
0
answers
79
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
0
answers
279
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
1
answer
25
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
1
answer
78
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
0
answers
236
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 ...