Post Expirator
[resolved] WordPress 3.5 - broken post expirator :( (29 posts)

  1. Specialk72
    Posted 3 years ago #

    Since upgrading WordPress the post expirator doesn't seem to work :(


  2. blazeman
    Posted 3 years ago #

    I've noticed the same thing. The WP-CRON is there, but does not seem to be running.

    If I run the cron task manually it works fine.

  3. Specialk72
    Posted 3 years ago #

    I've just reset the cron in the settings and now seems to be working again :)

  4. sneader
    Posted 3 years ago #

    Looks like the plug-in author needs to make some changes to be compatible with WordPress 3.5.

    Seeing this on the Diagnostics/debug pages:

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/username/public_html/wp-content/plugins/post-expirator/post-expirator-debug.php on line 46 and defined in /home/username/public_html/wp-includes/wp-db.php on line 990

  5. hete
    Posted 3 years ago #

    the unix time (expiration of the post) in the database doesn't fit with the date i choose...

  6. BosmaMultimedia
    Posted 3 years ago #

    I've having problems too... Is running the cronjob in WP 3.5? The posts arent send to te deletebox :-(. I did get de wpdb::prepare() error... I've found the call in post-expirator-debug.php line 46 and line 63... I've added ", $post_id" in the prepare function. I'm not getting an error anymore but the plugin doesn't work anymore :-(.

  7. Michael Albers
    Posted 3 years ago #

    As for the debug error, line 46 of post-expirator-debug.php should read:
    $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$this->debug_table} ORDER BYid=%d DESC", $id ));

    Unfortunately, it looks like cron is not checking every minute even when plugin settings are set to once per minute.

    If i check the cron, it states the cron job should run an hour after saving plugin settings.

    Any ideas about this anyone?

  8. BosmaMultimedia
    Posted 3 years ago #

    After setting de cronjob in de hour modus, it works again. I hope de minutes issue is solved in the future.

  9. Aaron Axelsen
    Plugin Author

    Posted 3 years ago #

    I am not able to reproduce that line 46 error on my installation with the latest WP 3.5.1.

    I just tested on a single WP install and a MS enabled install and it is running every minute ... as there any other weird things about your setup?

  10. sneader
    Posted 3 years ago #

    Apparently WordPress 3.5.1 fixes this problem, as the Debug page no longer gives errors, once I upgrade to WP 3.5.1. Guess sometimes it pays to ignore problems for a few weeks. :-)

    - Scott

  11. webmaster@fernuni-hagen.de
    Posted 3 years ago #

    Got the same problem, updated to WP3.5.1 but nothing changes... :-(

    Any ideas? Any hint? Where to set the cronjob in another mode?

    - Jens

  12. Michael Albers
    Posted 3 years ago #

    Sorry i didn't reply earlier. I had to move on with the project.

    Using WP 3.5 (nl_NL), i got the error on the View Debug Logs tab unless i change line 46 of post-expirator-debug.php from

    $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$this->debug_table} ORDER BY <code>id</code> DESC"));


    $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$this->debug_table} ORDER BYid=%d DESC", $id ));

    After checking that, i upgraded WP to 3.5.1 (nl_NL) seems to have solved the issue.

    Still i think line 46 should be changed. See also:


  13. Michael Albers
    Posted 3 years ago #

  14. Aaron Axelsen
    Plugin Author

    Posted 3 years ago #

    absolutely - this is already changed in my dev version - lots of new changes on the way!

  15. grem001
    Posted 3 years ago #

    I'm in wordpress 3.5.1
    I'm hardly searching for this kind of plugin but...
    I've installed the plugin
    I add a post
    Set the expiration date
    The default time is H-1 (the default time is 8h38 but the time of my computer is 9h38)
    I've tried to set expiration at 8h39.... it does't works
    I've tried to set expiration at 10h39.... it doesn't works
    No error, my post is still published
    I reset the cron.... it doesn't works
    I've changed line 46 of post-expirator-debug.php.... it doesn't works

    I've called my host, they told me there wasn't any problem with time

    Please, please help me

  16. rcrweb
    Posted 3 years ago #

    same here,
    It doesn't work. Please help!

  17. Shawn Heats
    Posted 3 years ago #

    same here too, nothing works

  18. mpwita
    Posted 3 years ago #

    just had another post that should have expire not expire again, i'm up to date on all the updates with wp 3.5.1 but something that should have expired on the 26th is still up and it is the 28th.

  19. Aaron Axelsen
    Plugin Author

    Posted 3 years ago #

    Anything in the debug logs?

  20. Aaron Axelsen
    Plugin Author

    Posted 3 years ago #

    MS or single installs? Anything else out of the ordinary on your installations?

  21. mpwita
    Posted 3 years ago #

    Single Site... nothing else out of the ordinary that I can think of. I didn't check the debug logs, but after very very carefully reviewing the plugin notes/etc, I believe i may have accidentally caused my own issue. Perhaps a wording change on the interface or an alternate checkbox might keep others from having this problem. I believe that in the posts that didn't expire, I had checked a category even though i had no memory of doing such. I found that the posts that didn't expire had a category checked and those that did expire had no category.

    I never checked a category listing, so not sure if a category check is default. My suggestion might be to add another checkbox that says expire post OR (and then the category listings) whereby checking the expire could uncheck all the ones below. If that had been the case I don't think i would have missed it.

    In the meantime i disabled the "expire to category" option so now there is just a date. In doing so i might have unintentionally revealed a bug or other oddity. If the option to default expiration is set to on for new posts, if i have the checkbox UNCHECKED to expire, when i save the post, the box is checked with the current date/time and the post is immediately expired. Just wouldn't expect having the checkbox UNCHECKED to expire the post AFTER i click update. That may be a seperate issue, so feel free to move/copy this post to another category/etc.

  22. Aaron Axelsen
    Plugin Author

    Posted 3 years ago #

    Alot of these oddities should be fixed in the 2.0.0 release - which I'm currently asking people to test.


  23. insertvisionhere
    Posted 3 years ago #

    Mine isn't working either, it seems the schedule is being unscheduled as soon as it's created

    2013-06-06 02:34:57 673 -> SCHEDULED at Thu, 06 Jun 2013 02:35:00 +0000 (1370486100) with options Array ( [expireType] => draft [id] => 673 )
    2013-06-06 02:34:57 673 -> UNSCHEDULED

    Any ideas here mate?

  24. Aaron Axelsen
    Plugin Author

    Posted 3 years ago #

    Any other plugins you have a that maybe acting up? Thats the first i've heard of this issue

  25. insertvisionhere
    Posted 3 years ago #

    Only other plugin is All in One SEO Pack.

  26. wordpork
    Posted 3 years ago #

    What do I have to set, to run post expirator correctly on a custom post type?

    			'labels' => array(
    				'name' => 'Events',
    				'singular_name' => 'Events Item',
    				'add_new' => 'Add New Event',
    				'add_new_item' => 'Add New Event Item',
    				'edit' => 'Edit',
    				'edit_item' => 'Edit Event Item',
    				'new_item' => 'New Event Item',
    				'view' => 'View',
    				'view_item' => 'View Events Item',
    				'search_items' => 'Search Events Items',
    				'not_found' => 'No Event items found',
    				'not_found_in_trash' => 'No Event items found in Trash',
    				'parent' => 'Parent Events Item'
    			'description' => 'Easily lets you create some beautiful events.',
    			'public' => true,
    			'show_ui' => true,
    			'_builtin' => false,
    			'capability_type' => 'page',
    			'hierarchical' => true,
    			'rewrite' => array('slug' => $url_rewrite),
    			'supports' => array('title', 'editor', 'thumbnail', 'comments'),

    or are there other plugins existing that could disturb expirator?

  27. ShiftComputerSolutions
    Posted 3 years ago #

    So I installed WP-CRONTROL. I saw that I had set the expiration time and date correctly, but the cron job is still in the list after it was due to run, and the post is still there (ie, not expired)

    Using WP-CRONTROL to run the cron job, the post is still there, although WP-CRONTROL reports success in running the job

    I can't think of anything else to try.

  28. ShiftComputerSolutions
    Posted 3 years ago #

    Whoops, wrong thread. Sorry.

  29. jvarela
    Posted 3 years ago #

    For me this gets unscheduled at the moment you set the expiration in the post.
    This is the debug log:
    2013-07-24 11:54:05
    2153 -> SCHEDULED at Wed, 24 Jul 2013 10:56:00 +0000 (1374663360) with options Array ( [expireType] => delete [id] => 2153 )
    2013-07-24 11:54:05
    2153 -> UNSCHEDULED

    Most of the comments are referring to the need to reset cron in our server, and actually this make sense because the plugin works perfect in my local machine...
    To be able to manage the cron in the server I installed this other plugin:
    Author's website with instructions: http://yoast.com/review/wp-cron-control/

    But at some point I need to setup a system cron job in the server...  it's very tricky to me to commit it... Bellow you have some instructions about how to do it...

    You enabled WP-Cron Control. To make sure that scheduled tasks are still executed correctly, you will need to setup a system cron job that will call wp-cron.php with the secret parameter defined in the settings.
    You can use the function defined in this script and set up a cron job that calls either:
    php /home/www_poc/www/wp-content/plugins/wp-cron-control/wp-cron-control.php http://exampleofmysite.comfd91919551cb3a3ddd44dfc2caa8e241
    wget -q "http://exampleofmysite/wp-cron.php?doing_wp_cron&fd91919551cb3a3ddd44dfc2caa8e241"
    You can set an interval as low as one minute, but should consider a reasonable value of 5-15 minutes as well.
    If you need help setting up a cron job please refer to the documentation that your provider offers.
    Anyway, chances are high that either the CPanel, Plesk, or crontab documentation will help you.

    I tried to do it through the terminal following this instructions... http://wiki.kayako.com/display/DOCS/Setting+up+a+server+cron+or+scheduled+task
    But I'm stuck as I'm not very familiar with cron and setting stuff on my server using the command-line interface
    Any thoughts about how to do it?
    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post Expirator
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.