WordPress Post Expirator 1.5.2 Released

This is a minor bugfix release.  There was an issue with including the shortcode in the template that was displaying the expiration date in the incorrect time zone which has now been corrected.

The plugin can be downloaded at the WordPress Plugins Page.

This entry was posted in WP Post Expirator. Bookmark the permalink.

13 Responses to WordPress Post Expirator 1.5.2 Released

  1. nobita says:

    Hi

    I’m japanese.

    I’m try plugin Post Expirator but works improperly.

    using like below
    my themes functions.php add.
    update_option( ‘timezone_string’ , ‘UTC+9’ );
    Why default timezone_string is null. Japan time is UTC+9.

    But Time to change into a draft has shifted for 9 hours.

    and next change below.


    function expirationdate_delete_expired_posts() {
    global $wpdb;
    postExpiratorTimezoneSetup();
    $time_delete = time() + 60*60*9;

    It makes Post Expirator works appropriate.

    • nobita says:

      Add

      The specification change by WordPress 2.9 has influenced.
      It came to be carried out by wp-settings.php date_default_timezone_set (‘UTC’).
      date() A function and time() The function is being fixed to UTC.

  2. Robert says:

    Almost perfect, but have a closer look at line 74. Just spent 2 hours debugging and turned out you have SQL syntax error. Line looks like this:

    $processed = $wpdb->get_var(‘select meta_value from ‘ . $wpdb->postmeta . ‘ as postmeta, ‘.$wpdb->posts.’ as posts where postmeta.post_id = posts.ID AND posts.ID = ‘.$a->post_id.’ postmeta.meta_key = “_expiration-date-processed”‘);

    and should be like this:

    $processed = $wpdb->get_var(‘select meta_value from ‘ . $wpdb->postmeta . ‘ as postmeta, ‘.$wpdb->posts.’ as posts where postmeta.post_id = posts.ID AND posts.ID = ‘.$a->post_id.’ AND postmeta.meta_key = “_expiration-date-processed”‘);

    AND is missing between posts.ID and postmeta.meta_key conditions.

    Anyway – great extension, but it’s broken since 1.5 and on trunk so I suspect not many people is using it.

  3. John Clarke says:

    Hi Aaron,

    Thanks for publishing a great plugin.

    I was having trouble with Post Expirator 1.5.2 creating a new revision every minute for each post that had the Post Expirator enabled. (ie It was not recognising that it had already “Expired” the post.)

    I made the following amendments to Post Expirator (post-expirator.php) which seem to have corrected the problem.

    Line 74 – Add AND before postmeta.meta_key = “_expiration-date-processed”
    [without the AND the code was checking ANY meta record associated with the post instead of the _expiration-date-processed meta record.]

    Was...
    $processed = $wpdb->get_var('select meta_value from ' . $wpdb->postmeta . ' as postmeta, '.$wpdb->posts.' as posts where postmeta.post_id = posts.ID AND posts.ID = '.$a->post_id.' postmeta.meta_key = "_expiration-date-processed"');
    Should be...
    $processed = $wpdb->get_var('select meta_value from ' . $wpdb->postmeta . ' as postmeta, '.$wpdb->posts.' as posts where postmeta.post_id = posts.ID AND posts.ID = '.$a->post_id.' AND postmeta.meta_key = "_expiration-date-processed"');

    I also removed the ,true on the following lines because update_post_meta() should only have three parameters.
    Line 97 – Remove , true
    Line392 – Remove , true
    Line398 – Remove , true

    update_post_meta($a->post_id, 'expiration-date', $a->meta_value, true);
    update_post_meta($a->post_id, 'expiration-date', $a->meta_value);

    I hope this is useful.

    Kind regards
    John

  4. Hello
    How to solve the problem with the release of “Month and Hour (UTC) bar” menu publications. See the picture: http://i41.tinypic.com/jqgtw4.jpg

  5. Tomas Kapler says:

    nic plugin, you should just add screenshots to it, for me it is very usefull hint if the developer is e.g. respecting the wp admin style, so that it will not mess up with other plugins or custom changes

  6. Michael says:

    I don’t quite love you and want to have your babies … but pretty damn close! 🙂

    It’s really integral to the site I’m building … and was working fine, then stopped all of a sudden. Everything looked fine – showed correct dates and times for expiry in admin screen etc. – just didn’t actually do anything.

    Thought I’d start tonight to resolve it … and decided to start from basics, so deleted it and reinstalled. While I was doing it, thought I’d see what the “Upgrade” link led to – reset cron? “Can’t hurt”, I thought, so I did it. Lo and behold, when I looked at my posts, all that should have expired had 🙂 Don’t know whether deleting and re-adding, or resetting cron is what worked but one of them did.

    As well as saying ‘thanks’ for a great plugin, thought I’d share this really simple tip in case others come looking for a solution to a problem. Start with the basics, guys … you never know! 🙂

  7. The problem remains the front my post!

    • Aaron Axelsen says:

      Are you running other plugins that might be doing something to the css? I’ve tried a number of configurations/tests and I can’t reproduce the issue

Leave a Reply

Your email address will not be published. Required fields are marked *