No result update a custom field using wp_schedule_event

It think that your problem is the you are passing the post ID as url parameter to facebook API: $url = get_the_ID(); Also, as get_posts return an array of post objects, you could use this code: $posts = get_posts(array(‘numberposts’ => -1) ); foreach($posts as $post) { $url = get_permalink( $post->ID ); $fbcount = json_decode( file_get_contents( … Read more

WP Cron not executing after timespan

Your custom hook is never triggered because you are not subscribing to it the right way! Context Although you are calling it in your class function, it is never executed beyond that point. Place the add_action function somewhere else like in a plugins_loaded hook. Put it outside your class where it can be seen. Dependencies … Read more

WP-Cron system broken

For what it’s worth, I was running into the issue of the same message within WP-Cron Events but instead with a 404 “not found” code…it’s hunting for the file http://yourdomain.com/wp-cron.php. My issue turned out to be an improper file permission on my wp-cron.php file (644 instead of 666) which caused the wp-cron.php file to give … Read more

WordPress plugin cron working only if admin is logged in

The WP Cron .. which runs when user hit website .. Thus if there are no website visits, WP Cron never runs. Now you can use 2 solutions. Disable WP-Cron and use real cron job and then custom real cron job https://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job use custom interval in wp_schedule_event add_filter( ‘cron_schedules’, ‘myprefix_add_a_cron_schedule’ ); function myprefix_add_a_cron_schedule( $schedules ) … Read more