summaryrefslogtreecommitdiff
blob: abeb1cba785fc4cf52597b9c19136b56d303295d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
=== Public Post Preview ===
Contributors: ocean90
Tags: public, preview, posts, anonymous, drafts
Requires at least: 5.0
Tested up to: 5.2
Requires PHP: 5.6
Stable tag: 2.9.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Allow anonymous users to preview a draft of a post before it is published.

== Description ==

Share a link to anonymous users to preview a draft of a post (or any other public post type) before it is published.

Have you ever been writing a post with the help of someone who does not have access to your site and needed to give them the ability to preview it before publishing? This plugin takes care of that by generating an URL with an expiring nonce that can be given out for public preview.

*Previously this plugin was maintained by [Matt Martz](http://profiles.wordpress.org/sivel/) and was an idea of [Jonathan Dingman](http://profiles.wordpress.org/jdingman/). Thanks to Hans Dinkelberg for his [photo](http://www.flickr.com/photos/uitdragerij/7516234430/).*

== Installation ==

Note: There will be NO settings page.

For an automatic installation through WordPress:

1. Go to the 'Add New' plugins screen in your WordPress admin area
1. Search for 'Public Post Preview'
1. Click 'Install Now' and activate the plugin


For a manual installation via FTP:

1. Upload the `public-post-preview` directory to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' screen in your WordPress admin area


To upload the plugin through WordPress, instead of FTP:

1. Upload the downloaded zip file on the 'Add New' plugins screen (see the 'Upload' tab) in your WordPress admin area and activate.

== Screenshots ==

1. Edit Posts Page

== Usage ==
* To enable a public post preview check the box below the edit post box.
* The link will be displayed if the checkbox is checked, just copy and share the link with your friends.
* To disable a preview just uncheck the box.

== Frequently Asked Questions ==

**I can't find the option for preview links. Where is it?**

The checkbox is only available for non-published posts and once a post was saved as a draft.


**After some time the preview link returns the message "The link has been expired!". Why?**

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
}`

Or use the [Public Post Preview Configurator](https://wordpress.org/plugins/public-post-preview-configurator/).

== Change Log ==

=  2.9.0 (2019-07-20): =
* Requires WordPress 5.0
* Requires PHP 5.6
* Adds notice (as Snackbar if supported) when changing preview status in block editor.
* Fixes incorrect status message in classic editor.
* Fixes grammar in expired link notice. Props [@garrett-eclipse](https://github.com/garrett-eclipse).
* Improves internal checks to be more strict. Props [@PatelUtkarsh](https://github.com/PatelUtkarsh).
* Removes deprecated i18n compatibility layer from Gutenberg plugin.

= 2.8.0 (2018-11-27): =
* Add support for WordPress 5.0 and the new block editor.

= 2.7.0 (2018-09-14): =
* Initial support for Gutenberg.
* Block robots for public post previews. Props [@westonruter](https://github.com/westonruter).

For more see [CHANGELOG.md](https://github.com/ocean90/public-post-preview/blob/master/CHANGELOG.md).