Post Expirator unable to handle correctly expiration by category (FAILED in log)
-
Hi!
I’ve created a PHP script where I can see only a list of posts that have the category “archived”.
The posts needs to be “expired”, and when this happens, the plugin needs to handle the expiration of that post and remove all the categories present (becouse i dont what the post to be reached outside the archive page where is correctly listed and handled) and assign the category “archived” to my expired post.Where is the problem?
Well, after hours trying to understand what the problem is, the solution is:
The plugin cannot assign ANY post category to the post when the CronEvent gets triggered.To reach this point I’ve checked many times the post category creation, even assigned manually, by query in the wp_term_relationships table, the new category create for debug purpose, to the article to see if theres some kind of problem when the plugin or wp go to assign a category to the post, but everything is fine and works properly.
I also have activated the debug/log mode inside the plugin.
This is what comes out when I try to:
– Remove all existing categories, and add new categories.
– Keep all existing categories, and add new categories.
– Keep all existing categories, except for those specified in this change.___________________________________________________
LOG:
2021-10-28 13:09:20 2403 -> FAILED category-add Array ( [expireType] => category-add [category] => Array ( [0] => 120 [1] => 7 [2] => 10 ) [categoryTaxonomy] => ) 2021-10-28 13:08:25 2403 -> SCHEDULED at Gio, 28 Ott 2021 11:09:00 +0200 (1635419340) with options Array ( [expireType] => category-add [category] => Array ( [0] => 120 [1] => 7 [2] => 10 ) [categoryTaxonomy] => ) no error 2021-10-28 13:06:02 2403 -> FAILED category-add Array ( [expireType] => category-add [category] => Array ( [0] => 12 ) [categoryTaxonomy] => ) 2021-10-28 13:05:19 2403 -> SCHEDULED at Gio, 28 Ott 2021 11:06:00 +0200 (1635419160) with options Array ( [expireType] => draft [category] => Array ( [0] => 120 [1] => 7 [2] => 10 ) [categoryTaxonomy] => ) no error 2021-10-28 13:04:03 2403 -> PROCESSED draft Array ( [expireType] => draft [category] => Array ( [0] => 120 [1] => 7 [2] => 10 ) [categoryTaxonomy] => ) 2021-10-28 13:03:55 2403 -> SCHEDULED at Gio, 28 Ott 2021 11:04:00 +0200 (1635419040) with options Array ( [expireType] => category-add [category] => Array ( [0] => 120 ) [categoryTaxonomy] => ) no error 2021-10-28 13:02:26 2403 -> FAILED category-add Array ( [expireType] => category-add [category] => Array ( [0] => 120 ) [categoryTaxonomy] => ) 2021-10-28 13:01:33 2403 -> SCHEDULED at Gio, 28 Ott 2021 11:02:00 +0200 (1635418920) with options Array ( [expireType] => category-add [category] => Array ( [0] => 120 ) [categoryTaxonomy] => ) no error 2021-10-28 12:52:25 2403 -> FAILED category Array ( [expireType] => category [category] => Array ( [0] => 120 ) [categoryTaxonomy] => ) 2021-10-28 12:51:31 2403 -> SCHEDULED at Gio, 28 Ott 2021 10:52:00 +0200 (1635418320) with options Array ( [expireType] => category [category] => Array ( [0] => 120 ) [categoryTaxonomy] => ) no error
___________________________________________________
I’ve also noticed that the plugin handles WRONG the Hours.
In the edit/creation page of the post the time is in UTC.
in the fast edit section of the post the time is handled in local time.
the time is also some minutes wrong when reported in the log. (-30 min if im correct.)Since I already know what the problem is, but have spent time to know all this, I’m writing here in search of a solution from the dev and to help other people with the same problem.
Thanks.
edit: I’ve also read this wiki: https://publishpress.com/knowledge-base/troubleshooting-unpublish/
- The topic ‘Post Expirator unable to handle correctly expiration by category (FAILED in log)’ is closed to new replies.