andergmartins
Forum Replies Created
-
Hi, thank you for using PublishPress Future.
Sorry, on version 3 we modified the engine that runs the actions, and we didn’t make it clear how to extend it.
In addition to the filter you are using, you have to use the filterpublishpressfuture_expiration_action_factory
. It should return an instance of a class that implements the interfacePublishPress\Future\Modules\Expirator\Interfaces\ExpirationActionInterface
, available atYou can see an example of a class implementation on the following link. Each custom status, should have its own action class:
And the callback for the filter could be something like:
add_filter('publishpressfuture_expiration_action_factory', 'my_action_factory', 10, 3); /** * @param \PublishPress\Future\Modules\Expirator\Interfaces\ExpirationActionInterface $action The action class * @param string $actionName * @param \PublishPress\Future\Modules\Expirator\Models\ExpirablePostModel $postModel * @return \PublishPress\Future\Modules\Expirator\Interfaces\ExpirationActionInterface function my_action_factor($action, $actionName, $postModel) { switch ($actionName) { case 'custom_status_expired': return new MyExpiredActionClass(); break; case 'custom_status_archived': return new MyArchivedActionClass(); break; } }
When the action is triggered by the plugin, it will execute the method
execute
of the respective custom class.Please, let us know if that works for you.
Thanks
Hi, thanks for the information.
We found a typo in the PT-BR translation. We are preparing a release to fix it and other bugs. In the meantime, could you try replacing the file
languages/post-expirator-pt_BR.po
?You can download it from https://github.com/publishpress/PublishPress-Future/files/13339228/post-expirator-pt_BR.mo.zip
More details on the issue https://github.com/publishpress/PublishPress-Future/issues/567.
Thanks guys. Please, could you try the new version 3.1.3, and confirm the bug is fixed?
Thanks for the information.
Please, could you also check the browser console and send us the message you see there?
Thanks
Hi @janwill
Cool, sure thing. You can try the following code. I left both formats, UNIX time, and your custom format. You can remove or customize according to your need.add_action('publishpressfuture_post_expired', function ($postId) { $actionDate = (int)get_post_meta($postId, '_expiration-date', true); update_post_meta($postId, '_last_expiration_date', $actionDate); update_post_meta($postId, '_last_expiration_date_NEW', gmdate("d.m.Y H:i", $actionDate)); });
Hi @chamois_blanc,
Thanks for the feedback and for suggesting a fix.
We already implemented a fix for this which is planned to be released this week.Thanks
@janwill we don’t store the expiration date in the metadata after a post has expired, but you can use an action that is triggered when that happens, before the data is deleted. You could then grab the date and store in a different metadata.
You can try something like this:add_action('publishpressfuture_post_expired', function ($postId) { $actionDate = (int)get_post_meta($postId, '_expiration-date', true); update_post_meta($postId, '_last_expiration_date', $actionDate); });
Hi, @thefridgeful
Please, could you try loading the admin menu Future, Settings, Diagnosticsand Tools tab, Database Schema Check. Does it display a button to try creating the missed table?
If so, please, could you click and check the results?
Hi @onetonet, please, could you let us know if you are using a composer-based site and if you have WooCommerce installed (that plugin is not required, but important to know if it is there)?
Hi @jremsa, please, could you let us know if you are using a composer-based site? Or is it a regular WordPress installation?
Thanks for the information @streettb
Please, could you try to replicate the bug using the beta package?
Please, could you let us know if that package fixes the issue?
Thanks
Hi @przemyslawcioch sorry for the inconvenience.
We just released a new version fixing other bugs.
Please, could you double-check? If you still see the issue, please could you send us more details?
Thanks
Thanks for the information. We still can’t replicate, or find the path it is following to break.
Is there any chance to temporarily activate XDebug on the site in order to retrieve a trace of the files and methods executed when that exception occurs?
We have a new beta package addressing other bugs, feel free to test it and check if it fixes the bug you found.
https://1drv.ms/u/s!AsIYGyKS9Y3YozD5oAoprfXTJmXf?e=RW9IKF
Please, let us know the results.
Thanks
No problem, thanks @rmolina79
Thanks for double checking.
No, it WooCommerce is not required. It is part of that path because WooCommerce is the author of the referenced library.
This is the only report we have for now for the issue and we can’t replicate it here. Please, could you let us know if that happens on every page load, or only on post expiration tasks that run in the background?
Please, could you also try disabling all the other plugins on a staging site to see if you still have the issue?
Hi @achaleil
Sure thing, there is a new documentation page we wrote for helping on that:
https://publishpress.com/knowledge-base/checking-scheduled-future-action-or-expiration/Please, let us know if that works for you, or if you have any questions.
Thanks