{"id":18178,"date":"2012-05-16T19:30:15","date_gmt":"2012-05-16T19:30:15","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/protected-posts-logout-button\/"},"modified":"2023-02-16T00:46:23","modified_gmt":"2023-02-16T00:46:23","slug":"protected-posts-logout-button","status":"publish","type":"plugin","link":"https:\/\/lv.wordpress.org\/plugins\/protected-posts-logout-button\/","author":9474271,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.4.6","stable_tag":"1.4.6","tested":"6.1.10","requires":"2.8","requires_php":"","requires_plugins":"","header_name":"Protected Posts Logout Button","header_author":"Nate Reist","header_description":"","assets_banners_color":"","last_updated":"2023-02-16 00:46:23","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/omfgitsnater.com\/protected-posts-logout-button\/","header_plugin_uri":"http:\/\/mindutopia.com","header_author_uri":"http:\/\/mindutopia.com","rating":4.9,"author_block_rating":0,"active_installs":1000,"downloads":33551,"num_ratings":13,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"natereist","date":"2012-05-19 00:34:26"},"1.1":{"tag":"1.1","author":"natereist","date":"2012-05-19 00:42:52"},"1.2":{"tag":"1.2","author":"natereist","date":"2012-05-19 17:50:45"},"1.3":{"tag":"1.3","author":"natereist","date":"2013-02-10 22:36:52"},"1.3.1":{"tag":"1.3.1","author":"natereist","date":"2014-07-19 21:14:33"},"1.3.2":{"tag":"1.3.2","author":"natereist","date":"2014-09-19 02:04:48"},"1.3.2.1":{"tag":"1.3.2.1","author":"natereist","date":"2014-09-19 02:33:22"},"1.4":{"tag":"1.4","author":"natereist","date":"2016-04-10 16:51:47"},"1.4.1":{"tag":"1.4.1","author":"natereist","date":"2016-04-11 12:08:56"},"1.4.2":{"tag":"1.4.2","author":"natereist","date":"2019-02-11 17:49:07"},"1.4.3":{"tag":"1.4.3","author":"natereist","date":"2019-04-09 15:57:39"},"1.4.4":{"tag":"1.4.4","author":"natereist","date":"2019-07-13 17:14:37"},"1.4.5":{"tag":"1.4.5","author":"natereist","date":"2023-02-16 00:15:26"},"1.4.6":{"tag":"1.4.6","author":"natereist","date":"2023-02-16 00:46:23"}},"upgrade_notice":{"1.1":"<p>Fixes a bug that leads to a 404, you should update this immediately for it to work properly.<\/p>","1.0":"<p>Original Release.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"11"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3","1.3.1","1.3.2","1.3.2.1","1.4","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5","1.4.6"],"block_files":[],"assets_screenshots":{"screenshot-3.png":{"filename":"screenshot-3.png","revision":2866065,"resolution":"3","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":2866065,"resolution":"1","location":"plugin"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":2866065,"resolution":"2","location":"plugin"}},"screenshots":{"1":"Admin Screen for simple settings","2":"Optional alert","3":"Button added to the content"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[4233,51484,1173],"plugin_category":[38],"plugin_contributors":[81158],"plugin_business_model":[],"class_list":["post-18178","plugin","type-plugin","status-publish","hentry","plugin_tags-logout","plugin_tags-password-protected-posts-logout-button","plugin_tags-wordpress-security","plugin_category-authentication","plugin_contributors-natereist","plugin_committers-natereist"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/protected-posts-logout-button.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/protected-posts-logout-button\/trunk\/screenshot-1.png?rev=2866065","caption":"Admin Screen for simple settings"},{"src":"https:\/\/ps.w.org\/protected-posts-logout-button\/trunk\/screenshot-2.png?rev=2866065","caption":"Optional alert"},{"src":"https:\/\/ps.w.org\/protected-posts-logout-button\/trunk\/screenshot-3.png?rev=2866065","caption":"Button added to the content"}],"raw_content":"<!--section=description-->\n<p>This plugin simply adds a logout button to the content of any password protected post. Sometimes clients want a password protected page to share information with privileged individuals and the default 10 days for the cookie to expire is too long for their liking. So I wrote a little plugin to do this with AJAX and set the cookie to expire immediately, well actually 10 days in the past.<\/p>\n\n<ul>\n<li>Works logged in or out as a Wordpress user.<\/li>\n<li>Uses the same functionality Wordpress uses to set post cookies.<\/li>\n<li>Has a simple settings page to make everything easier.<\/li>\n<li>Allows you to alert user they have logged out.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>pplb_logout_button.zip<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Customize your settings.<\/li>\n<li>Confirm it is working &amp; you're done!<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='the%20logout%20button%20shows%20up%2C%20but%20nothing%20happens%20when%20clicked%2C%20what%27s%20wrong%3F'><h3>The logout button shows up, but nothing happens when clicked, what's wrong?<\/h3><\/dt>\n<dd><p>Does your theme have <code>&lt;?php wp_head(); ?&gt;<\/code> and <code>&lt;?php wp_footer(); ?&gt;<\/code> installed correctly?  This plugin uses some javascript that gets embedded automatically in the header or footer, and requires it to work properly.<\/p><\/dd>\n<dt id='this%20button%20is%20so%20ugly%3F%21%20what%20can%20i%20do%3F'><h3>This button is so ugly?! What can I do?<\/h3><\/dt>\n<dd><p>Well, this button is setup to be no intrusive on your theme, so it adapts to the styles that come with you theme.<\/p>\n\n<p>That being said, you can style the button as you wish using a css class you define on the settings page, or add your themes button class.<\/p><\/dd>\n<dt id='i%20get%20more%20than%20one%20button%20on%20my%20page%20when%20i%20am%20logged%20in%20to%20a%20protected%20post%2C%20what%20gives%3F'><h3>I get more than one button on my page when I am logged in to a protected post, what gives?<\/h3><\/dt>\n<dd><p>Well that logout button gets added to the function <code>the_content()<\/code> but only when the function <code>in_the_loop()<\/code> returns true (as of version 1.2).\nif your theme is using <code>apply_filters('the_content', $some_str);<\/code> it is possible it will show up more than once.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4.6<\/h4>\n\n<ul>\n<li>Fixed vulnerabilities in option saving function, not allowing unescaped user input and checking user role <\/li>\n<\/ul>\n\n<h4>1.4.5<\/h4>\n\n<ul>\n<li>Tested with Wordpress 6.1.1<\/li>\n<li>Added nonce verification for updating options.<\/li>\n<\/ul>\n\n<h4>1.4.4<\/h4>\n\n<ul>\n<li>Tested with Wordpress 5.2.2<\/li>\n<li>Added option for positioning button after content.<\/li>\n<\/ul>\n\n<h4>1.4.3<\/h4>\n\n<ul>\n<li>Tested with Wordpress 5.1.1<\/li>\n<li>Added support for multisite by adding COOKIE_DOMAIN to the logout function. Thanks to @rcreactor, @gahapati, and @gserafini<\/li>\n<\/ul>\n\n<h4>1.4.2<\/h4>\n\n<ul>\n<li>Tested with Wordpress 5.0.3<\/li>\n<li>Added filters <code>pplb_button_text<\/code> &amp; <code>pplb_button_html<\/code> for manipulating text and HTML button output.<\/li>\n<\/ul>\n\n<h4>1.4.1<\/h4>\n\n<ul>\n<li>Added an option for changing the button text<\/li>\n<li>re added the function <code>pplb_logout_button<\/code> to fix potential PHP errors<\/li>\n<\/ul>\n\n<h4>1.4.0<\/h4>\n\n<ul>\n<li>Refactored code into a class<\/li>\n<li>Moved the options page to a template<\/li>\n<li>Tested with version 4.4.2<\/li>\n<\/ul>\n\n<h4>1.3.2.1<\/h4>\n\n<ul>\n<li>Moving javascript to footers<\/li>\n<li>Checking to see if logout cookie option is numeric<\/li>\n<\/ul>\n\n<h4>1.3.2<\/h4>\n\n<ul>\n<li>Added a optional debug to the send response to the console.log function ( only for debugging use should not be used in production. )<\/li>\n<li>Added a check to see the <code>message<\/code> is not of type \"undefined\"<\/li>\n<li>Added an option to the options page for turning on or off debug.<\/li>\n<li>Tested with version 4.0!<\/li>\n<\/ul>\n\n<h4>1.3.1<\/h4>\n\n<ul>\n<li>Added the ability to change the default WordPress postpass cookie in the admin area.<\/li>\n<li>Cleaned up some logic and php code.<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Added conditional logic to the allow admin to disable the automatic filter.<\/li>\n<li>Added a shortcode to allow users to place the button inside posts and a php function to place it in template files or hook it.<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<p>Added conditional logic to the filter to only add the button inside of the loop.<\/p>\n\n<h4>1.1<\/h4>\n\n<p>Fixed a bug with javascript enqueue that was causing a 404 file not found for <code>logout.js<\/code>.<\/p>\n\n<h4>1.0<\/h4>\n\n<p>Original Release: uses <code>wp_enqueue_scripts<\/code> and ajax to logout password protected posts by setting the cookie to expire immediately.<\/p>","raw_excerpt":"Automatically adds a logout button to your password protected content.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/18178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=18178"}],"author":[{"embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/natereist"}],"wp:attachment":[{"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=18178"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=18178"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=18178"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=18178"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=18178"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/lv.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=18178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}