public-post-preview

Public Post Preview (en)

Zur deutschen Beschreibung wechseln.

Enables you to give a link to anonymous users for public preview of a post (or any other public post type) before it is published.

Checkbox in the Publish Metabox

Have you ever been writing a post with the help of someone who does not have access to your blog and needed to give them the ability to preview it before publishing?

This plugin takes care of that by generating a URL with an expiring nonce that can be given out for public preview.

The plugin generates an URL with an expiring nonce. By default a link “lives” 48 hours. After 48 hours the link is expired and you need to copy and share a new link which is automatically generated on the same place under the editor.

48 hours are not enough to me. Can I extend the nonce time? Yes, of course. You can use the filter ppp_nonce_life.
Example for 5 days:

add_filter( 'ppp_nonce_life', 'my_nonce_life' );
function my_nonce_life() {
	return 60 * 60 * 24 * 5; // 5 days
}

Thanks to Hans Dinkelberg for his photo.

Download

The plugin has been downloaded 61,599 times.
It got 96% positive feedback, based on 31 ratings from the plugin repo on WordPress.org.

The plugin requires WordPress 3.5 and is compatible up to WordPress 4.5.1.

Changelog

2.5.0 (2016-04-05):

  • Auto select preview link on focus. Props @JeroenSormani.
  • Remove preview status from posts which are trashed or after scheduled posts are published.
  • Add support for paged posts.

2.4.1 (2015-10-13):

2.4 (2014-08-21):

  • Supports EditFlow and custom statuses
  • Disables comments and pings during public post preview
  • Adds Public Preview to the list of display states used in the Posts list table
  • Prevents flickering of link box on Post edit while loading

2.3 (2013-11-18):

  • Introduces a filter ppp_preview_link. With the filter you can adjust the preview link.
  • If a post has gone live, redirect to it's proper permalink.
  • Adds the query var _ppp to WordPress SEO by Yoast whitelist.

2.2 (2013-03-15):

  • Based on feedback I have removed the extra metabox and added the preview link to the main Publish metabox.
  • Only show the checkbox if the post status/post type is good.
  • Requires WordPress 3.5.

2.1.1 (2012-09-19):

  • Sorry for the new update. Through a change in 2.1 a filter was applied to each query. The misplaced "The link has been expired!" message is now gone. Props Aki Björklund and Jonathan Channon.

2.1 (2012-09-16):

  • Introduces a filter ppp_nonce_life. With the filter you can adjust the expiration of a link. By default a link has a lifetime of 48 hours.
  • In some situations (still not sure when) the preview link is rewritten as a permalink which results in an error. The plugin now works in this situations too.

2.0.1 (2012-07-25):

  • Makes the preview link copyable again

2.0 (2012-07-23):

  • Support for all public post types
  • Saves public preview status via an AJAX request
  • I18n
  • Requires at least WordPress 3.3

1.3 (2009-06-30):

  • Hook in earlier in the post selection process to fix PHP notices
  • Add uninstall functionality to remove options from the options table

1.2 (2009-03-30):

  • Fix preview URL for scheduled posts on sites with a permalink other than default activated.

1.1 (2009-03-11):

  • Don't limit public previews to posts in draft or pending status. Just exclude posts in publish status.

1.0 (2009-02-20):

  • Initial Public Release

20 thoughts on “Public Post Preview (en)”

  1. I recently installed your Public Post Preview plugin but when I shared the link with someone there was a message that said “expired”. How do I make the link available for a longer period of time? What is the default time frame before it shows as expired? Looks like a great plug in if we can get it to work properly.
    Thank you,
    Halle Eavelyn

    1. By default the link is available for 24 hours. It based on the WordPress Nonces API and exists for security reasons.

      If a link (the nonce code) has been expired you can copy the link again.

      If you really want to extend the time to can use the filter in wp_nonce_tick().
      For example:

      add_filter( 'nonce_life', 'ds_nonce_life' );
      function ds_nonce_life( $seconds ) {
      	return 60 * 60 * 24 * 50; // 50 days
      }
      
  2. I am running WordPress 3.4.1 and Public Post Preview 2.0.1. The preview links are not working. If I am still logged into my account they work, but if I am logged out (or for other non-registered users) there is a 404 Not Found error. Any ideas on what is going on or how I can fix it? Thanks.
    -Marybeth.

  3. Since the update yesterday links are no longer working and I get “The link has been expired!” and the formatting of the website is broken on that page. This was working quite well before yesterday’s update.

  4. I would like to say that im glad that this plugin has been picked back up again and is being updated. One feature that I miss from previous verisons in the ability to right click the link and then click Send Link. Is it possible to reimplement this feature?

    1. That was not a feature of the plugin, more a feature of your browser. Since the link is now in a textbox the browser cannot provide this feature anymore.

      Currently there is no plan to restore it as a link. But maybe I can add a small linked icon after the textbox. The browser should detected this too.

    2. I went ahead and changed the code in the my installation to the following for lines 169-172

      <a href="ID ) ); ?>”>ID ) ); ?>

    3. Well that didn’t work. I just added the <a> tag around the link and placed the php for the link in the href.

  5. I just installed it and whilst it works, my post has a border around it. Looking at the source its a div titled error. I think WordPress notices that you’re trying to view a unpublished post and tries to put an error around it

  6. “After 48 hours the link is expired”

    This has to be the most bizarre, unhelpful, and annoying “default” behavior of any plug-in I’ve ever seen. Why not just remove that feature?

  7. i have installed the Public Post Preview and activated it. I do not see where the checkbox is to enable the actual link.

    I have screenshots of what I am experiencing if you send me an email address.

    thanks,
    bill

  8. Really great plugin – I’ve been relying on it for a couple years now, fantastic.

    Thanks Dominik!

  9. I understnad I can add the filter…sorry, but I am a real rookie. Is there somewhere imn particular in the edit box I add this?? I can see where the ppp_nonce_life is in the html…do I put it there. I really need to change it to several days.

    thanks-very helpful plug in for me.

    NJ

Leave a Reply