Changeset 2201729
- Timestamp:
- 11/27/2019 02:55:34 AM (6 years ago)
- Location:
- loginrequirepress/trunk
- Files:
-
- 3 edited
-
LICENSE (modified) (1 diff)
-
LoginRequirePress.php (modified) (4 diffs)
-
readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
loginrequirepress/trunk/LICENSE
r1968416 r2201729 29 29 http://www.maratbn.com/projects/login-require-press 30 30 31 Copyright (C) 2015-201 8Marat Nepomnyashy http://maratbn.com maratbn@gmail31 Copyright (C) 2015-2019 Marat Nepomnyashy http://maratbn.com maratbn@gmail 32 32 33 Version: 1. 4.0-development_unreleased33 Version: 1.5.0-development_unreleased 34 34 35 35 Module: loginrequirepress/LICENSE -
loginrequirepress/trunk/LoginRequirePress.php
r1968416 r2201729 9 9 Author URI: http://www.maratbn.com 10 10 License: GPL3 11 Version: 1. 4.0-development_unreleased11 Version: 1.5.0-development_unreleased 12 12 Text Domain: domain-plugin-LoginRequirePress 13 13 */ … … 44 44 http://www.maratbn.com/projects/login-require-press 45 45 46 Copyright (C) 2015-201 8Marat Nepomnyashy http://maratbn.com maratbn@gmail47 48 Version: 1. 4.0-development_unreleased46 Copyright (C) 2015-2019 Marat Nepomnyashy http://maratbn.com maratbn@gmail 47 48 Version: 1.5.0-development_unreleased 49 49 50 50 Module: LoginRequirePress.php … … 107 107 __('Login Require Press', DOMAIN_PLUGIN), 108 108 '\\plugin_LoginRequirePress\\callbackMetaBox', 109 null); 109 null, 110 'advanced', 111 'default', 112 ['__block_editor_compatible_meta_box' => false]); 110 113 } 111 114 … … 141 144 142 145 function action_save_post($idPost) { 143 if (!\current_user_can('manage_options')) return; 146 if (!\current_user_can('manage_options')) { 147 $postToSave = \get_post($idPost); 148 if ($postToSave == null || 149 $postToSave->post_author != \get_current_user_id()) { 150 return; 151 } 152 } 144 153 145 154 if (isset($_POST[LOGIN_REQUIRE_PRESS__META]) && -
loginrequirepress/trunk/readme.txt
r1968416 r2201729 3 3 Tags: require login, password protect, security, limit access, control access, members, visitors, subscribers, require-login, password-protect, login-protect, limit-access 4 4 Requires at least: 3.8.1 5 Tested up to: 4.9.86 Stable tag: 1. 3.05 Tested up to: 5.3 6 Stable tag: 1.4.0 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 14 14 Overview: 15 15 16 At the time of this writing, the latest version of WordPress, version 4.9.8, 17 has 3 post visibility options, which are 'public', 'password protected', and 18 'private'. 16 At the time of this writing, the latest version of WordPress, version 5.3, has 3 post visibility options, which are 'public', 'password protected', and 'private'. 19 17 20 The 'password protected' option allows the site administrator to 21 individually lock certain posts, even from the logged in users, with an 22 additional password / passcode. However, there is currently no built-in way 23 to just deny access only to the unauthenticated users. 18 The 'password protected' option allows the site administrator to individually lock certain posts, even from the logged in users, with an additional password / passcode. However, there is currently no built-in way to just deny access only to the unauthenticated users. 24 19 25 Login Require Press is a WordPress plugin that allows site administrators to 26 specifically designate arbitrary posts with any public post type as viewable 27 only after user login. 20 Login Require Press is a WordPress plugin that allows site administrators to specifically designate arbitrary posts with any public post type as viewable only after user login. Post authors can also enable or disable login protection for their own posts. 28 21 29 22 It is an easy way to require login to view specific pages / posts. 30 23 31 Unauthenticated site visitors attempting to view any page that includes any 32 such specifically designated post will then be automatically redirected to 33 the site's default login page, and then back to the original page after they 34 login, thereby limiting access only to logged-in users with subscriber roles 35 and above. 24 Unauthenticated site visitors attempting to view any page that includes any such specifically designated post will then be automatically redirected to the site's default login page, and then back to the original page after they login, thereby limiting access only to logged-in users with subscriber roles and above. 36 25 37 Plugin will still allow unauthenticated downloading of site's feeds, but 38 will filter out all login-requiring posts from the feed listings. 26 Plugin will still allow unauthenticated downloading of site's feeds, but will filter out all login-requiring posts from the feed listings. 39 27 40 Plugin will protect the titles and contents of login-requiring posts in 41 search result page listings when the user is not logged in. The titles / 42 contents will be replaced by text "[Post title / content protected by 43 Login Require Press. Login to see the title / content.]" 28 Plugin will protect the titles, contents, and excerpts of login-requiring posts in search result page listings when the user is not logged in. The titles / contents / excerpts will be replaced by text "[Post title / content / excerpts protected by Login Require Press. Login to see the title / content / excerpt.]" 44 29 45 30 Technical summary: 46 31 47 Plugin works by hooking-in special logic into the action 'send_headers' to 48 redirect unauthenticated client browsers to the site's login page from any 49 non-feed and non-search-results page upon detecting any login-requiring post, 50 and by hooking-in another special logic into the filter 'posts_results' to 51 filter out all login-requiring posts from all feed page listings, and to 52 protect the titles and contents of login-requiring posts in search result 53 page listings. 32 Plugin works by hooking-in special logic into the action 'send_headers' to redirect unauthenticated client browsers to the site's login page from any non-feed and non-search-results page upon detecting any login-requiring post, and by hooking-in another special logic into the filter 'posts_results' to filter out all login-requiring posts from all feed page listings, and to protect the titles, contents, and excerpts of login-requiring posts in search result page listings. 54 33 55 34 Login-requiring posts are marked with a custom field 'login_require_press' set to 'yes'. … … 90 69 == Screenshots == 91 70 92 1. Login Require Press configuration screen with the table used to specify which posts are to be 93 login-protected. 71 1. Login Require Press configuration screen with the table used to specify which posts are to be login-protected. 94 72 95 2. Login Require Press configuration screen with the lists of private, non-private login-protected, 96 and passcode-protected posts. 73 2. Login Require Press configuration screen with the lists of private, non-private login-protected, and passcode-protected posts. 97 74 98 75 3. Login Require Press edit post meta box to enable or disable login protection. 99 76 100 77 == Changelog == 78 79 = 1.4.0 = 80 * Tested up to WordPress 5.3 81 * Fixed bug that prevented authors without administrative privileges from enabling / disabling login protection on their own posts. 82 * Added logic to indicate that the previously-implemented Login Require Press post meta box is not compatible with the new WordPress block editor. 101 83 102 84 = 1.3.0 = … … 110 92 * Changed the plugin name from 'LoginRequirePress' to 'Login Require Press'. 111 93 * Indicating posts without names by token [no name #] where # is the post ID number. 112 * Shortened the plugin description appearing on the admin dashboard plugins list to just one 113 sentence. 94 * Shortened the plugin description appearing on the admin dashboard plugins list to just one sentence. 114 95 * Added support for WordPress instances nested inside subdirectories. 115 96 116 97 = 1.1.0 = 117 98 * Tested up to WordPress 4.5.2 118 * Improved the listing-out of posts in the post categorizations sections on the plugin's Settings 119 page. 99 * Improved the listing-out of posts in the post categorizations sections on the plugin's Settings page. 120 100 * Added 'Refresh' buttons to the Settings page. 121 101 * Added LoginRequirePress meta box to the post edit screen. … … 125 105 * Tested up to WordPress 4.5 126 106 * Login Required status indicators now in red. 127 * Added new 'Default Visibility' column, that indicates posts' present visibility according to the 128 default WordPress logic without this plugin. 107 * Added new 'Default Visibility' column, that indicates posts' present visibility according to the default WordPress logic without this plugin. 129 108 * Explicitly listing-out the Private, Login-Protected, and Passcode/Password-Protected posts. 130 109 * Added plugin activation check for PHP version >= 5.4 … … 134 113 * Minor improvement to plugin WordPress description meta field. 135 114 * Fixed issue https://github.com/maratbn/LoginRequirePress/issues/2: Added file 'REQUIREMENTS'. 136 * Fixed issue https://github.com/maratbn/LoginRequirePress/issues/3: Protecting the titles and 137 contents of login-requiring posts in search result page listings when the user is not logged in. 115 * Fixed issue https://github.com/maratbn/LoginRequirePress/issues/3: Protecting the titles and contents of login-requiring posts in search result page listings when the user is not logged in. 138 116 139 117 = 0.1.1 =
Note: See TracChangeset
for help on using the changeset viewer.