diff --git a/CHANGELOG.md b/CHANGELOG.md
index ba5552f..d3f952b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
+## 2.5.3 - 2022-06-17
+- Improved Settings HTML structure
+- Added Note regarding compatibility with login designer within dashboard
+
+## 2.5.2 - 2022-05-26
+Made compatibility with [login designer](https://wp.org/plugins/login-designer); Now you can customize the password-protected screen with the customizer using login designer plugin.
+
## [2.5] - 2021-09-01
### Fixed
diff --git a/README.md b/README.md
index 2316c60..c76c031 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,7 @@ Features include:
- Password protect your WordPress site with a single password.
- Option to allow access to feeds.
- Option to allow administrators access without entering password.
-- Works with Mark Jaquith's [Login Logo](https://wordpress.org/plugins/login-logo/) plugin.
-- Works with the [Uber Login Logo](https://wordpress.org/plugins/uber-login-logo/) plugin.
+- *New* 👉 Now you can customize the whole password protected screen including the background, font, logo, color e.t.c.
> Please note, this plugin works by setting a cookie to allow access to the site. If you are using a caching plugin or web hosting such as WP Engine that has in-built caching, you will need to configure the caching service to be disabled if the Password Protected cookie is set.
@@ -73,6 +72,12 @@ If you would like to translate this plugin you can easily contribute at the [Tra
Upgrade Notice
--------------
+### 2.5.3
+- Improved Settings HTML structure
+- Added Note regarding compatibility with login designer within dashboard
+
+### 2.5.2
+Made compatibility with [login designer](https://wp.org/plugins/login-designer); Now you can customize the password-protected screen with the customizer using login designer plugin.
### 2.5
Fixes robots tag for WordPress 5.7+
diff --git a/admin/admin-bar.php b/admin/admin-bar.php
index 0375bc1..163d40d 100644
--- a/admin/admin-bar.php
+++ b/admin/admin-bar.php
@@ -36,7 +36,7 @@ public static function load() {
public static function toolbar_item() {
global $wp_admin_bar;
-
+
if ( self::allow_current_user() ) {
$wp_admin_bar->add_menu( array(
diff --git a/admin/admin-caching.php b/admin/admin-caching.php
index 0be3ac9..f230480 100644
--- a/admin/admin-caching.php
+++ b/admin/admin-caching.php
@@ -46,7 +46,7 @@ public function cache_settings_info() {
// Caching Section
add_settings_section(
'password_protected_compat_caching',
- __( 'Caching', 'password-protected' ),
+ __( 'Having issue with Caching?', 'password-protected' ),
array( $this, 'section_caching' ),
'password-protected-compat'
);
diff --git a/admin/admin.php b/admin/admin.php
index cbb971a..2e075a8 100644
--- a/admin/admin.php
+++ b/admin/admin.php
@@ -4,14 +4,14 @@ class Password_Protected_Admin {
var $settings_page_id;
var $options_group = 'password-protected';
+ var $setting_tabs = array();
/**
* Constructor
*/
public function __construct() {
-
global $wp_version;
-
+ add_action( 'admin_init', array( $this, 'password_protected_register_setting_tabs' ) );
add_action( 'admin_init', array( $this, 'password_protected_settings' ), 5 );
add_action( 'admin_init', array( $this, 'add_privacy_policy' ) );
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
@@ -20,16 +20,46 @@ public function __construct() {
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
add_filter( 'plugin_action_links_password-protected/password-protected.php', array( $this, 'plugin_action_links' ) );
add_filter( 'pre_update_option_password_protected_password', array( $this, 'pre_update_option_password_protected_password' ), 10, 2 );
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
+ }
+
+ /**
+ * Password protected setting tabs
+ * customizable using filter hook
+ */
+ public function password_protected_register_setting_tabs() {
+ $this->setting_tabs = array(
+ 'general' => 'General',
+ 'advanced' => 'Advanced',
+ 'help' => 'Help',
+ 'getpro' => 'Get Pro'
+ );
+ if( $this->password_protected_pro_is_installed_and_activated() )
+ unset( $this->setting_tabs['getpro'] );
+ $this->setting_tabs = apply_filters( 'password_protected_setting_tabs', $this->setting_tabs );
}
+ /**
+ * Admin enqueue scripts.
+ *
+ * @param string $hooks Page Hook.
+ */
+ public function admin_enqueue_scripts( $hooks ) {
+
+ if ( 'settings_page_password-protected' === $hooks || 'toplevel_page_password-protected' === $hooks ) {
+ wp_enqueue_style( 'password-protected-page-script', PASSWORD_PROTECTED_URL . 'assets/css/admin.css', array(), '2.6.0' );
+ wp_enqueue_script( 'password-protected-admin-script', PASSWORD_PROTECTED_URL . 'assets/js/admin.js', array('jquery'), '2.6.0' );
+ }
+ }
+
/**
* Add Privacy Policy
*/
public function add_privacy_policy() {
if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
- return;
+ return 1;
}
$content = _x( 'The Password Protected plugin stores a cookie on successful password login containing a hashed version of the entered password. It does not store any information about the user. The cookie stored is named bid_n_password_protected_auth where n is the blog ID in a multisite network', 'privacy policy content', 'password-protected' );
@@ -42,9 +72,18 @@ public function add_privacy_policy() {
* Admin Menu
*/
public function admin_menu() {
-
+
$capability = apply_filters( 'password_protected_options_page_capability', 'manage_options' );
$this->settings_page_id = add_options_page( __( 'Password Protected', 'password-protected' ), __( 'Password Protected', 'password-protected' ), $capability, 'password-protected', array( $this, 'settings_page' ) );
+ add_menu_page(
+ 'Password Protected',
+ 'Password Protected',
+ 'manage_options',
+ 'password-protected',
+ array( $this, 'pp_admin_menu_page_callback' ),
+ 'dashicons-lock',
+ 99
+ );
add_action( 'load-' . $this->settings_page_id, array( $this, 'add_help_tabs' ), 20 );
}
@@ -65,12 +104,96 @@ public function settings_page() {
?>
';
}
/**
@@ -182,7 +374,7 @@ public function password_protected_settings() {
* @return string Sanitized password.
*/
public function sanitize_password_protected_password( $val ) {
-
+
$old_val = get_option( 'password_protected_password' );
if ( is_array( $val ) ) {
@@ -200,7 +392,8 @@ public function sanitize_password_protected_password( $val ) {
}
return get_option( 'password_protected_password' );
}
-
+
+
return $val;
}
@@ -242,8 +435,7 @@ private function validate_ip_address( $ip_address ) {
*/
public function password_protected_settings_section() {
- echo '
' . __( 'Password protect your web site. Users will be asked to enter a password to view the site.', 'password-protected' ) . '
- ' . __( 'For more information about Password Protected settings, view the "Help" tab at the top of this page.', 'password-protected' ) . '
';
+ return 1;
}
@@ -261,10 +453,10 @@ public function password_protected_status_field() {
*/
public function password_protected_permissions_field() {
- echo '';
- echo '';
- echo '';
- echo '';
+ echo '';
+ echo '';
+ echo '';
+ echo '';
}
@@ -273,8 +465,8 @@ public function password_protected_permissions_field() {
*/
public function password_protected_password_field() {
- echo ' ' . __( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'password-protected' ) . '
- ' . __( 'Type your new password again.', 'password-protected' ) . '';
+ echo '
' . __( 'If you would like to change the password, type a new one. Otherwise, leave this blank.', 'password-protected' ) . '
+
' . __( 'Type your new password again.', 'password-protected' ) . '
';
}
@@ -283,11 +475,11 @@ public function password_protected_password_field() {
*/
public function password_protected_allowed_ip_addresses_field() {
- echo '' . get_option( 'password_protected_allowed_ip_addresses' ) . '';
+ echo '' . get_option( 'password_protected_allowed_ip_addresses' ) . '';
echo '
' . esc_html__( 'Enter one IP address per line.', 'password-protected' );
if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
- echo ' ' . esc_html( sprintf( __( 'Your IP is address %s.', 'password-protected' ), $_SERVER['REMOTE_ADDR'] ) );
+ echo ' ' . esc_html( sprintf( __( 'Your IP address is %s.', 'password-protected' ), $_SERVER['REMOTE_ADDR'] ) );
}
echo '
';
@@ -307,10 +499,54 @@ public function password_protected_remember_me_field() {
*/
public function password_protected_remember_me_lifetime_field() {
- echo '';
+ echo '';
}
+ /**
+ * Password Protected Page description
+ */
+ public function password_protected_page_description() {
+ return 1;
+ }
+
+ /**
+ * Password Protected text above passsword
+ */
+ public function password_protected_text_above_password() {
+ echo '';
+ }
+
+ /**
+ * Password Protected below above passsword
+ */
+ public function password_protected_text_below_password() {
+ echo '';
+ }
+
+ /**
+ * Help Tab text field
+ */
+ public function password_protected_help_tab() {
+ echo '
' . __( 'Password protect your web site. Users will be asked to enter a password to view the site.', 'password-protected' ) . '
+ ' . __( 'For more information about Password Protected settings, view the "Help" tab at the top of this page.', 'password-protected' ) . '
';
+ }
+
+ /**
+ * Try pro sideabr
+ */
+ public function password_protected_try_pro(){
+ $image = plugin_dir_url( __DIR__ ) . "assets/images/login-designer-demo.gif";
+ echo '
+
+
+ ' . esc_attr__( 'Looking for more options?', 'password-protected' ) . '
+
\n";
}
-
}
}
@@ -759,14 +811,13 @@ public function load_theme_stylesheet() {
if ( ! empty( $located ) ) {
$stylesheet_directory = trailingslashit( get_stylesheet_directory() );
- $template_directory = trailingslashit( get_template_directory() );
+ $template_directory = trailingslashit( get_template_directory() );
if ( $stylesheet_directory == substr( $located, 0, strlen( $stylesheet_directory ) ) ) {
wp_enqueue_style( 'password-protected-login', get_stylesheet_directory_uri() . '/' . $filename );
- } else if ( $template_directory == substr( $located, 0, strlen( $template_directory ) ) ) {
+ } elseif ( $template_directory == substr( $located, 0, strlen( $template_directory ) ) ) {
wp_enqueue_style( 'password-protected-login', get_template_directory_uri() . '/' . $filename );
}
-
}
}
@@ -807,7 +858,7 @@ static function is_plugin_supported() {
* Always allow logged in users who require REST API for Gutenberg
* and other admin/plugin compatibility.
*
- * @param WP_REST_Request $access Full details about the request.
+ * @param WP_REST_Request $access Full details about the request.
* @return WP_Error|boolean
*/
public function only_allow_logged_in_rest_access( $access ) {
@@ -821,4 +872,24 @@ public function only_allow_logged_in_rest_access( $access ) {
}
+ /**
+ * Print text above password field
+ * @return void.
+ */
+ public function password_protected_above_password_field() {
+ $text = get_option('password_protected_text_above_password');
+ if( !empty($text) )
+ echo '
' . esc_attr( $text ) . '
';
+ }
+
+ /**
+ * Print text below password field
+ * @return void.
+ */
+ public function password_protected_below_password_field() {
+ $text = get_option('password_protected_text_below_password');
+ if( !empty($text) )
+ echo '
' . esc_attr( $text ) . '
';
+ }
+
}
diff --git a/readme.txt b/readme.txt
index 22cb6dd..1ce8197 100644
--- a/readme.txt
+++ b/readme.txt
@@ -2,32 +2,87 @@
Contributors: wpexpertsio
Tags: password, protect, password protect, login
Requires at least: 4.6
-Tested up to: 5.9.1
+Tested up to: 6.1.1
Requires PHP: 5.6
-Stable tag: 2.5.1
+Stable tag: 2.6.1
License: GPLv2 or later
-A very simple way to quickly password protect your WordPress site with a single password.
+The ultimate password protection plugin that protects your WordPress site with a single password.
== Description ==
-A very simple way to quickly password protect your WordPress site with a single password.
+Password Protected for WordPress allows you to secure your website with a single password. The ultimate password protection plugin protects your WordPress categories, posts, products, and more with the simplest of ease.
-This plugin only protects your WordPress generated content. It **does not protect images or uploaded files** so if you enter and exact URL to in image file it will still be accessible.
+Password Protected does not protect images or uploaded files, so if you enter an exact URL of an image file, it will still be accessible.
-Features include:
+= Password Protected Features =
-* Password protect your WordPress site with a single password.
-* Option to allow access to feeds.
-* Option to allow administrators access without entering password.
-* Works with Mark Jaquith's [Login Logo](https://wordpress.org/plugins/login-logo/) plugin.
-* Works with the [Uber Login Logo](https://wordpress.org/plugins/uber-login-logo/) plugin.
+* Easy to set up - Password protect your WordPress site with a single password.
+* Set a description - Display text (description or instructions) above or below the password field.
+* reCaptcha v2/v3 - You can enable Google reCAPTCHA v2 or V3 to increase bot security measures.
+* Allow administrators - Option to allow administrators access without entering the password.
+* Allow logged-in users - Option to give logged-in users access to the website.
+* Allow RSS Feeds - Option to allow access to feeds.
+* Allow Rest API Access - Allow admin to access pages and posts.
+* Customization - Customize the password-protected screen, including the background, font, logo, color, etc.
> Please note, this plugin works by setting a cookie to allow access to the site. If you are using a caching plugin or web hosting such as WP Engine that has in-built caching, you will need to configure the caching service to be disabled if the Password Protected cookie is set.
-= Translations =
+= Password Protected Pro =
+
+[Password Protected Pro](https://passwordwp.com/#pricing_sec) is equipped with powerful features that will take your WordPress website security to the next level.
+
+* Exclude page posts & post types - Option to exclude specific pages and post types from password protection.
+* Limit login attempts - Limit the user’s attempts to enter a password for a specified interval.
+* Lockdown time - Set a time (in minutes) during which users can not enter the password after their login attempts are limited.
+* Usage limits - Set a usage limit after which a password can not be used.
+* Status control - You can change the status of the password (Active, Deactivated, Expired).
+* Manage multiple passwords - Edit, activate, deactivate, or delete passwords (individual or bulk action).
+* Set Expiry Dates - Options to select the expiry date for specific passwords
+* Activity Log Reports - View the Activity Logs of each user, including their IP address, browser, status, date, and time of password attempts.
+* Priority Support - Our team of support professionals will make sure to handle your queries on high priority.
+
+= Detect hackers and bots from abusing password protection with reCAPTCHA =
+Google reCAPTCHA v2 or v3 empowers your WordPress website to prevent password abuse against automated software, bots, hackers, etc. This anti-spam tool will allow any real user to access your website easily.
+
+= Password protect any post type =
+You can include or exclude any post type from password protection. All of this can be done from the back end using a single password.
+
+= Password protect your WordPress site with a single password =
+Password Protected has the ability to secure your entire website with a single password. Everything from pages to posts will also be protected.
+
+= Customize your login page using Login Designer for WordPress =
+You password forms should match the theme and branding of your website. With Login Designer, you can add a logo, change the color and background of the form, and use other elemenets to improve the overall user experience.
+
+[Login Designer](https://wordpress.org/plugins/login-designer/) is the all-in-one WordPress plugin designed for styling custom login pages and giving you live-editing experience unlike any other. Why use Login Designer? Zero refreshes. Contextually displayed options and plugin settings. Custom event triggers. Context-aware previews. Powerful custom controls. Live editing… the list goes on.
+
+= Display password protected content in RSS feeds =
+You can allow RSS feeds to show a login page after which user accessing the feed can view the password protected content. Disabling the option will restrict any user's access to the website even if the RSS feed is public.
-If you would like to translate this plugin you can easily contribute at the [Translating WordPress](https://translate.wordpress.org/projects/wp-plugins/password-protected/) page. The stable plugin needs to be 95% translated for a language file to be available to download/update via WordPress.
+= Password usage limits and complexities =
+Limits users from entering the password using Password Protected’s Usage Limit counter. Password greater than that limit can not be applicable on the login page.
+
+Usage limits can also be restricted by setting a password expiry from the calendar settings. This prevents users from re-using any given password. Regular password changes mitigate the risk of any security breach.
+
+Limiting password attempts prevents security issues like the Brute Force attack, where hackers keep trying to guess your password until they get it right. A complimentary solution to this feature is the Lockdown Timer, which resets the user’s right to log in after exceeding their login attempt limit.
+
+= Monitor and review activity logs for Password Protected =
+Password Protected’s Activity Log is similar to an audit log that gives you a record of the events that have taken place on your website. To provide you with a better understanding, here is a list of the details you will find in the activity log:
+
+* Filter options for passwords used in a specific range (All-time, Today, Yesterday, This Week, This Month)
+* IP addresses of the system from where the passwords were attempted.
+* Country names from where the passwords were attempted.
+* Browser names where the password was attempted.
+* Status of the password attempts (successful or failed)
+
+The admin can also perform the search operation on the activity log. You can search by IP, Country, Browser, and Status. For e.g., searching Success will search all the passwords with successful attempts, and searching Failure will search all the orders with failed attempts.
+
+= Documentation and support =
+* Password Protected [Technical Documentation](https://passwordwp.com/documentation/)
+* You can open a support ticket [here](https://objectsws.atlassian.net/servicedesk/customer/portal/18)
+
+= Translations =
+If you would like to translate this plugin, you can easily contribute to the [Translating WordPress](https://translate.wordpress.org/projects/wp-plugins/password-protected/) page. The stable plugin needs to be 95% translated for a language file to be available to download/update via WordPress.
== Installation ==
@@ -80,9 +135,28 @@ If you would like to translate this plugin you can easily contribute at the [Tra
== Screenshots ==
1. Login page perfectly mimicks the WordPress login.
-2. Password Protected settings page.
+2. Login page with reCaptcha v3
+3. Login page with reCaptcha v2
+4. Password Protected general settings page.
+4. Password Protected advanced settings page.
== Changelog ==
+2.6.1
+- Fix – Parse error related to PHP version 7.2
+
+= 2.6.0 =
+- Improved admin settings interface and introduced NEW tabs structure.
+- NEW: Added Google Recaptcha v2 and v3 to make it more secure.
+- NEW: Added Password Protected top-level admin menu for ease.
+- NEW: Added option to add text above password Field.
+- NEW: Added option to add text below password Field.
+
+= 2.5.3 =
+- Improved Settings HTML structure
+- Added Note regarding compatibility with login designer within dashboard
+
+= 2.5.2 =
+- Made compatibility with [login designer](https://wp.org/plugins/login-designer); Now you can customize the password-protected screen with the customizer using login designer plugin.
= 2.5.1 =
- Fix - Author name conflict resolved
diff --git a/theme/password-protected-login.php b/theme/password-protected-login.php
index 866c67c..6ea0fe7 100644
--- a/theme/password-protected-login.php
+++ b/theme/password-protected-login.php
@@ -90,6 +90,8 @@ function wp_login_viewport_meta() {
@@ -115,29 +120,31 @@ function wp_login_viewport_meta() {