Home › Forums › Support › Conflict with PublishPress Future: Automatically Unpublish WordPress Posts
- This topic has 5 replies, 2 voices, and was last updated 4 months, 3 weeks ago by
David.
-
AuthorPosts
-
October 23, 2022 at 11:51 pm #2383721
Lindsay
I am not sure you can help looking at your support policy – but worth an ask as the plugin developer said he can’t help either due to WordPress.org prohibiting him giving support for a commercial product.
There appears to be a conflict with GeneratePress Premium and PublishPress Future: Automatically Unpublish WordPress Posts.
I’ve disabled all plugins and it’s only when GP is enabled do I get the Cron event not found!
In the Diagnostics tab of PublishPress:
WP-Cron Status Enabled
Current Cron Schedule – No cron events found for the plugin.It seems to be a problem when setting up/editing in the post itself. If I use Quick Edit to set the Enable Post Expiration all is fine.
If there is an existing item with Cron event not found! that also seems to be an issue for any following items I try to add – even if I use Quick Edit.
If I go to their View Debug Logs this is what I see (not sure if any help to you).
2022-10-23 11:27:44 7229 -> CRON EVENT SCHEDULED at Sun, 23 Oct 2022 11:27:00 +0100 (1666520820) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7229 ) no error
2022-10-23 11:27:48 Called postexpirator_expire_post with id=7229
2022-10-23 11:27:48 7229 -> PROCESSED trash Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 )
2022-10-23 11:49:53 7260 -> NO PAYLOAD ON SAVE_POST
2022-10-23 11:50:25 7260 -> CRON EVENT SCHEDULED at Wed, 26 Oct 2022 11:49:00 +0100 (1666781340) with options Array ( [expireType] => trash [category] => Array ( ) [categoryTaxonomy] => [id] => 7260 ) no error
2022-10-23 11:50:25 7260 -> EXISTING CRON EVENT FOUND – UNSCHEDULED – no error
2022-10-23 11:50:25 7260 -> CRON EVENT SCHEDULED at Wed, 26 Oct 2022 11:49:00 +0100 (1666781340) with options Array ( [expireType] => trash [category] => Array ( [0] => ) [categoryTaxonomy] => [enabled] => 1 ) no error
2022-10-23 11:50:29 7260 -> NO PAYLOAD ON SAVE_POST
2022-10-23 11:51:12 7202 -> CRON EVENT SCHEDULED at Fri, 25 Nov 2022 09:00:00 +0000 (1669366800) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7202 ) no error
2022-10-23 11:52:36 7201 -> CRON EVENT SCHEDULED at Wed, 23 Nov 2022 11:51:00 +0000 (1669204260) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7201 ) no error
2022-10-23 11:53:05 7201 -> EXISTING CRON EVENT FOUND – UNSCHEDULED – no error
2022-10-23 11:53:05 7201 -> CRON EVENT SCHEDULED at Fri, 18 Nov 2022 09:00:00 +0000 (1668762000) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7201 ) no error
2022-10-23 11:53:18 7229 -> NO PAYLOAD ON SAVE_POST
2022-10-23 11:53:49 7229 -> CRON EVENT SCHEDULED at Fri, 23 Dec 2022 11:53:00 +0000 (1671796380) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7229 ) no error
2022-10-23 11:53:55 7260 -> NO PAYLOAD ON SAVE_POST
2022-10-23 11:54:10 7229 -> EXISTING CRON EVENT FOUND – UNSCHEDULED – no error
2022-10-23 11:54:10 7229 -> CRON EVENT SCHEDULED at Fri, 09 Dec 2022 11:53:00 +0000 (1670586780) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7229 ) no error
2022-10-23 11:54:26 7229 -> EXISTING CRON EVENT FOUND – UNSCHEDULED – no error
2022-10-23 11:54:26 7229 -> CRON EVENT SCHEDULED at Fri, 09 Dec 2022 10:00:00 +0000 (1670580000) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7229 ) no error
2022-10-23 11:55:01 7200 -> CRON EVENT SCHEDULED at Wed, 23 Nov 2022 09:00:00 +0000 (1669194000) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7200 ) no error
2022-10-23 11:55:05 5875 -> NO PAYLOAD ON SAVE_POST
2022-10-23 11:58:16 7262 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:00:32 7263 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:01:56 7263 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 21:00:00 +0000 (1667163600) with options Array ( [expireType] => trash [category] => Array ( ) [categoryTaxonomy] => [id] => 7263 ) no error
2022-10-23 12:01:56 7263 -> EXISTING CRON EVENT FOUND – UNSCHEDULED – no error
2022-10-23 12:01:56 7263 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 21:00:00 +0000 (1667163600) with options Array ( [expireType] => trash [category] => Array ( [0] => ) [categoryTaxonomy] => [enabled] => 1 ) no error
2022-10-23 12:01:59 7263 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:02:53 7263 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 09:00:00 +0000 (1667120400) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7263 ) no error
2022-10-23 12:03:54 7263 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 09:00:00 +0000 (1667120400) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7263 ) no error
2022-10-23 12:04:20 7263 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:05:53 7264 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:06:30 7264 -> CRON EVENT SCHEDULED at Sun, 23 Oct 2022 12:05:53 +0100 (1666523153) with options Array ( [expireType] => trash [category] => Array ( ) [categoryTaxonomy] => [id] => 7264 ) no error
2022-10-23 12:06:33 7264 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:08:05 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:08:35 7265 -> CRON EVENT SCHEDULED at Sun, 23 Oct 2022 12:08:05 +0100 (1666523285) with options Array ( [expireType] => trash [category] => Array ( [0] => 0 ) [categoryTaxonomy] => [id] => 7265 ) no error
2022-10-23 12:08:41 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:09:27 7264 -> CRON EVENT SCHEDULED at Sun, 23 Oct 2022 12:09:03 +0100 (1666523343) with options Array ( [expireType] => trash [category] => Array ( [0] => 0 ) [categoryTaxonomy] => [id] => 7264 ) no error
2022-10-23 12:09:34 7264 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:09:35 Called postexpirator_expire_post with id=7264
2022-10-23 12:09:35 7264 -> PROCESSED trash Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 )
2022-10-23 12:09:50 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:11:35 7266 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:13:05 7266 -> CRON EVENT SCHEDULED at Mon, 31 Oct 2022 21:00:00 +0000 (1667250000) with options Array ( [expireType] => trash [category] => Array ( [0] => 0 ) [categoryTaxonomy] => [id] => 7266 ) no error
2022-10-23 12:13:11 7266 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:13:27 7266 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:15:40 7267 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:16:26 7267 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:17:06 7267 -> CRON EVENT SCHEDULED at Mon, 31 Oct 2022 09:00:00 +0000 (1667206800) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7267 ) no error
2022-10-23 12:19:34 5875 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:19:54 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:20:47 7267 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:20:55 7265 -> CRON EVENT SCHEDULED at Sun, 23 Oct 2022 12:08:00 +0100 (1666523280) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7265 ) no error
2022-10-23 12:21:00 Called postexpirator_expire_post with id=7265
2022-10-23 12:21:00 7265 -> PROCESSED trash Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 )
2022-10-23 12:21:26 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:25:18 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:25:54 7265 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 12:25:00 +0000 (1667132700) with options Array ( [expireType] => trash [category] => Array ( [0] => 0 ) [categoryTaxonomy] => [id] => 7265 ) no error
2022-10-23 12:25:58 7265 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:28:51 7268 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:30:26 7268 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 10:00:00 +0000 (1667124000) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7268 ) no error
2022-10-23 12:31:14 7268 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 10:00:00 +0000 (1667124000) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7268 ) no error
2022-10-23 12:31:43 7268 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:33:57 7265 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 12:25:00 +0000 (1667132700) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7265 ) no error
2022-10-23 12:34:08 7269 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:34:55 7269 -> NO PAYLOAD ON SAVE_POST
2022-10-23 12:35:35 7269 -> CRON EVENT SCHEDULED at Sun, 30 Oct 2022 09:00:00 +0000 (1667120400) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => [id] => 7269 ) no error
2022-10-23 12:36:03 7269 -> EXISTING CRON EVENT FOUND – UNSCHEDULED – no error
2022-10-23 12:36:03 7269 -> CRON EVENT SCHEDULED at Mon, 31 Oct 2022 09:00:00 +0000 (1667206800) with options Array ( [expireType] => trash [category] => [categoryTaxonomy] => [enabled] => 1 [id] => 7269 ) no error
2022-10-23 12:36:42 7269 -> NO PAYLOAD ON SAVE_POSTI have also tried to add PHP code to Snippets to look at a custom field in my CPT Events and if that event date is less than today to change the post status. It doesn’t work which is why I ended up trying the plug-in.
wp_schedule_event(time(), 'hourly', 'my_hourly_event'); //add_action('init','my_hourly_event'); function my_hourly_event() { $the_query = get_posts( 'post_type=event' ); foreach($the_query as $single_post) { $id=$single_post->ID; $event_date=get_post_meta($id, 'wpcf-event-date', true ); if($event_date!=''){ $today = strtotime('today'); // $today=date("F j, Y"); if($event_date<$today){ $update_post = array( 'ID' => $id, 'post_status' => 'private', 'post_type' => 'event' ); wp_update_post($update_post); } } } }
I know this is getting more and more unrelated to GP – but any pointers re why a cron job may cause an issue with a GP post or any advise on how to automatically change a post status would be gratefully received. Equally I understand too if you just can’t help at all as totally outside your remit. Thank you.
October 24, 2022 at 3:31 am #2383906David
StaffCustomer SupportHi there,
question – is the issue resolved when you disable GP Premium or when you switch themes ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 24, 2022 at 11:02 am #2384559Lindsay
It’s when I disable GP.
I’m just about to test with amended PHP code so I don’t have to use a plug-in at all. If it works I’ll report back as could be helpful to others.
Thanks for your help so far though.
October 25, 2022 at 2:11 am #2385120David
StaffCustomer SupportIts very peculiar, as we don’t interfere with this kind of thing, its a WP core function that saves the post data and we stay clear of messing with that.
When you say disable GP – is that the GP Premium plugin ? Or is it the GP theme?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 25, 2022 at 9:40 am #2385812Lindsay
Hi there, it’s the GP Premium Plugin.
I’ve added the code below and it appears to work well and might be useful to others – i.e. it looks for the date field (wpcf-event-date) of a custom post and if it’s less than or equal to today it moves the CPT (event) post to trash. I’ve now disabled the PublishPress Future plugin… but if you’d like me to problem solve this any further let me know.
// register the recurring event if (! wp_next_scheduled ( 'my_hourly_event' )) { wp_schedule_event(time(), 'hourly', 'my_hourly_event'); } // register the action to execute when the recurring event takes place add_action( 'my_hourly_event', 'my_hourly_event_func' ); function my_hourly_event_func() { $the_query = get_posts( 'post_type=event' ); foreach($the_query as $single_post) { $id=$single_post->ID; $event_date=get_post_meta($id, 'wpcf-event-date', true ); if($event_date!=''){ $today = strtotime('today'); if($event_date<=$today){ $update_post = array( 'ID' => $id, 'post_status' => 'trash', 'post_type' => 'event' ); wp_update_post($update_post); } } } }
October 26, 2022 at 3:17 am #2387277David
StaffCustomer SupportAre you happy with that code ( thanks for sharing BTW ) as a replacement to the plugin ?
For the plugin if you want to debug further, then keep GP Premium active, and disable all the modules in Appearance > GeneratePress. Check if the issue goes away.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.