Questions tagged [wp-cron]
wp-cron refers to a WordPress subsystem that allows for the scheduled execution of code
473
questions
0
votes
1
answer
24
views
Wordpress "wp cron event run" as Siteground cron job
Is there a syntax that will allow me to run "wp cron event run" as a Siteground cron job?
I found this example that runs through a third party application. I'm wondering if this command can ...
0
votes
1
answer
19
views
Execute scheduled cron with ajax call to wp-cron.php
According to this question where my doubt on how to schedule an email sending each 24 hours, I've modified my plugin code to use a custom action hook and the wp_schedule_single_event() to achive the ...
0
votes
0
answers
27
views
Wordpress Cron job hook running multiple times
Here is my code in its basic form for a wp cron job I want to run only once daily:
add_filter('cron_schedules', function ($schedules) {
$schedules['daily_reminder_check'] = array(
'...
0
votes
0
answers
24
views
How to upload files on s3 Bucket in Background Task uisng PHP WordPress?
I have a website where users upload their videos. Videos length is more than 600 MB so I want to run videos upload in background and update in database. Users will also be notified via email. So cron ...
0
votes
0
answers
14
views
WP Cron, how to speed it up
On my site, I have quite a few cron jobs running. Everything is running smoothly, except the cron jobs end up queuing all time.
My server load is only at 40%, so I assume I can handle more cron jobs ...
0
votes
1
answer
14
views
CPU Overloading due to some hooks
I have some functions restricted in some hooks. The purpose of these hooks was to have consistent author name in the DB(which is a product attribute) and also update the display name. I placed this in ...
0
votes
0
answers
16
views
Custom set interval is not working
I want to published custom post type schedule articles after an hour interval in between if any schedule articles was there need not to be published. I have created a cron schedule which is working in ...
2
votes
1
answer
29
views
Cron Register everytime if i reload admin if i pass some extra argument in wp_schedule_event function
Cron Register everytime if i reload admin if i pass some extra argument in wp_schedule_event function.
Here you can check the scrrenshot
I have checked the cron using the plugin WP Control.
function ...
3
votes
0
answers
169
views
How to find code responsible for warnings from wp_cron runs?
I have a website created using wordpress, which is hosted on accuwebhosting.com
Recently I have been getting emails with the subject line
"Cron user@server cd wpfolder && /usr/local/bin/...
2
votes
2
answers
352
views
wp_schedule_single_event not working
I don't know why my scheduled cron events not working anymore, it used to before with the same code.
I wrote a plugin that updates a CRM with the order note, if the communication fails I setup a ...
0
votes
0
answers
19
views
WordPress Cron Job not importing products
I think this issue is related to WordPres Cron System , because the function runs fine without cron but it doesn't work as expected when run via cron , please have a look : https://wordpress.org/...
0
votes
1
answer
159
views
What is the correct way to implement wp-cron server-side in Kubernetes?
I'm not sure if this is the correct place to ask the question, but since this is specific to deploying WordPress, I thought I'd ask here first. What is the correct way to implement wp-cron server-side ...
0
votes
0
answers
53
views
How WP works with DB during cron job running?
I have to create script for daily import data from external source to WordPress website.
It worked fine on my local machine. But when I run this import on wpengine, I get duplicate entries despite ...
0
votes
0
answers
74
views
wp cron does not run when i am not logged in to wp admin
I create a cronjob with my plugin but it is very very strange when I am not logged in to wp admin dashboard the cronjob is not running and when i am not logged in to wp admin dashboard it is running ...
0
votes
0
answers
18
views
Custom cronjob not executing at all, but manually
In my themes function.php, I've added that code to load a custom code based on the cron:
add_action( 'wp', 'schedule_test_cron' );
function schedule_test_cron() {
if ( !wp_next_scheduled( 'test_cron'...
0
votes
0
answers
158
views
Protect wp-cron from hackers
I would like to get help on protecting wp-cron against hackers.
Set up: Lightsail Bitnami Apache server, headless Wordpress CMS, frontend is on AWS Amplify.
My wp-admin folder is protected with ...
0
votes
0
answers
33
views
Not getting expected email when running cron hook
I'm following the tutorial at https://wpshout.com/wp_schedule_event-examples/
I want to ensure my cron job works and is run at approximately a certain time of day. I have inserted debug code to send ...
0
votes
0
answers
36
views
Background Tasks in a WP Cronjob?
I have specific tasks which I want to perform every 15s in the background to update some cache / transients. I already use an external Cronjob service that triggers the Cron runs in WP - but ...
0
votes
1
answer
123
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
8
views
Multiple conditional logic in Custom Event In WP_ Cron not working
Im new on cron and I want to update a custom field every 5 mins and my code only works once and it doesn't continue on elseif. please help
function bf_do_something_on_schedule()
{
global $post;
...
0
votes
0
answers
27
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
47
views
Running a function using Crown WordPress on one day a week, for example, Mondays of every week
Hello friends
I am trying to write a plugin to be able to publish a post on a specific day. I need to be able to publish a specific text as a post on Mondays every week.
The searches I did on the ...
1
vote
0
answers
59
views
Definition of page load for WP-Cron?
My site is extremely low traffic for the time being. For the sake of this question, let us assume it is no traffic.
I have a .php file on my server which is executed every five minutes via crontab on ...
0
votes
1
answer
61
views
HELP: Code To Check Status And Write Debug Entry
I use a simple function to send out a 'heartbeat' to a website uptime monitoring service (Better Uptime):
function my_better_uptime_heartbeat() {
wp_remote_get( 'https://betteruptime.com/api/v1/...
0
votes
1
answer
96
views
wp_schedule_event with dynamic names but same function
I am creating a plugin where I am getting records from the database and dynamically creating events with wp_schedule_event, some sample names:
ls00_lorem
ls00_john_doe
ls00_jane_doe
I am them ...
0
votes
0
answers
198
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
0
answers
66
views
How to Auto Update Wordpress Post after specific time?
I hope you all are doing well.
I need some help to update my post automatically after 1 year. I read alot of articles and hope this can be achive using wp-cron-jobs.
Problem Explanation:
Here are my ...
0
votes
1
answer
139
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 ...
0
votes
1
answer
193
views
understanding wp_next_scheduled
I have a function that I've been attempting to get to work with wp_schedule_event. The function sends a notification to the admin. I see the event get added to the wp cron event list, but it never ...
1
vote
1
answer
679
views
Change a Post's Status based on the date from a custom field? (for Event posts)
I've found many posts on this topic and tried to use their solution, but none has worked so far...
I have an Event custom post type with an event_end_date custom field. I'm trying to create a PHP ...
0
votes
1
answer
114
views
Working function() doesn't execute when triggered by WP CRON
I've built the following before and have referenced my own code to see if I missed anything and from what I can tell I have not.
I have a WP CRON scheduled and it executes as the scheduled intervals. ...
0
votes
0
answers
64
views
Update post meta with wp cron
I am trying to create a function (which I will trigger through the WP Cron) but no values are passed and the database values remain NULL. Could anyone point me in the right direction of where I'm ...
0
votes
0
answers
55
views
Error resetting database index using ALTER TABLE in $wpdb->query
I'm running a Cron job every hour that clears all posts of a particular CPT and then re-inserts data by accessing a third party API.
I'm worried that this will lead to huge indexes, so I would like to ...
1
vote
1
answer
144
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
287
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 ...
1
vote
0
answers
1k
views
wp_privacy_delete_old_export_files, failed to run
The scheduled event, wp_privacy_delete_old_export_files, failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended.
0
votes
1
answer
72
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 ...
2
votes
2
answers
782
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
1
answer
12
views
WordPress cron creation during plugin installation results with initial execution
I'm currently developing a plugin which uses WP cron. During the installation of the plugin, I'm creating 2 needed cron jobs with a timestamp of midnight -2 and a and midnight -1 hour, since job 2 ...
0
votes
0
answers
354
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
1
answer
241
views
Scheduling an event inside plugin class is not working
wp_schedule_single_event is not firing.
I wrote a function that is posting to external API, if it failed I schedule the same posting function to run 5 seconds later in cases of timeouts.
Here's the ...
0
votes
1
answer
4k
views
When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?
I use Ubuntu 20.04 LEMP stack VPS. In this server, I run 13 WordPress sites. Every 10 minutes I have set up to run each site cron job with a 20 seconds interval. So every site does not execute cron ...
0
votes
1
answer
72
views
How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
I created a custom plugin and I need to schedule add_action using Crontrol Plugin, the Setup class is from different php class. But the schedule action cant read the Crontrol even if I execute ...
4
votes
0
answers
597
views
Is doing_wp_cron a necessary query string when scheduling cron.php as a cron job?
I have seen various ways to schedule the WordPress cron so that it is triggered by the server. Some will run the php file directory from the crontab and others will use a wget and reference the url. I ...
0
votes
0
answers
198
views
Delete all posts with a specific custom field using meta_query
I'm building a listings website using WooCommerce.
A listing is either set to live or sold inside of a custom field key status
Once a listing is sold then the custom field status is updated with sold. ...
0
votes
0
answers
58
views
Delete all users when they don't update profile_fields
I create a profile_fields named name, when users sign up for an account they will receive an email containing the nickname.
When the user logs in, there will be a page to enter profile_fields (name), ...
0
votes
1
answer
93
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
32
views
Email alert with wp_cron and wp_mail if new data (external API) - Pseudo code
I would like to check twice daily if there is some new data published and send me an email if this is the case.
In pseudo code here what I thought I could do:
Get new list of movies (external API ...
0
votes
1
answer
196
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 ...
0
votes
1
answer
150
views
WP Cron scheduling doesn't work reliably on hosted server
The following code is part of a save_post action. It works as expected in my local dev environment, but doesn't work reliably on a hosted server. (By unreliably I mean it sometimes work, but without ...