Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.1] - 2026-01-09

### Added

- New minimal-style CSS for shortcode form with gray input and black button

### Changed

- Shortcode form now automatically enqueues its own stylesheet

## [1.3.0] - 2026-01-08

### Added
Expand Down
122 changes: 122 additions & 0 deletions assets/css/shortcode-form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/**
* Shortcode form styles.
*
* Minimal design with gray input and black button.
*
* @package PassWP_Posts
*/

.passwp-login {
max-width: 600px;
margin: 0 auto;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.passwp-login .loginform {
margin: 0;
padding: 0;
}

.passwp-login .login-password {
margin: 0 0 2px;
padding: 0;
}

.passwp-login .login-password label {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

.passwp-login .login-password .input {
display: block;
width: 100%;
padding: 20px 24px;
margin: 0;
font-size: 16px;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
color: #7a8a99;
background-color: #f2f2f2;
border: none;
box-sizing: border-box;
outline: none;
}

.passwp-login .login-password .input::placeholder {
color: #7a8a99;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
}

.passwp-login .login-password .input:focus {
background-color: #e8e8e8;
}

.passwp-login .login-remember {
margin: 16px 0;
padding: 0;
font-size: 14px;
color: #666;
}

.passwp-login .login-remember label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}

.passwp-login .login-remember input[type="checkbox"] {
width: 18px;
height: 18px;
margin: 0;
cursor: pointer;
}

.passwp-login .login-submit {
margin: 0;
padding: 0;
}

.passwp-login .login-submit .button {
display: block;
width: 100%;
padding: 20px 24px;
margin: 0;
font-size: 16px;
font-weight: 500;
letter-spacing: 0.1em;
text-transform: uppercase;
text-align: center;
color: #ffffff;
background-color: #000000;
border: none;
cursor: pointer;
box-sizing: border-box;
transition: background-color 0.2s ease;
}

.passwp-login .login-submit .button:hover,
.passwp-login .login-submit .button:focus {
background-color: #333333;
}

/* Error message */
.passwp-login p[role="alert"] {
margin: 0 0 16px;
padding: 12px 16px;
background-color: #fef2f2;
border: 1px solid #fecaca;
border-radius: 4px;
color: #dc2626;
font-size: 14px;
}
8 changes: 8 additions & 0 deletions includes/Shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ public function register_shortcodes(): void {
* @param array<string, mixed>|string $atts Shortcode attributes.
*/
public function render_passwp_login( array|string $atts = [] ): string {
// Enqueue shortcode form styles.
wp_enqueue_style(
'passwp-posts-shortcode',
PASSWP_POSTS_URL . 'assets/css/shortcode-form.css',
[],
PASSWP_POSTS_VERSION
);

$settings = get_option( 'passwp_posts_settings', [] );

if ( empty( $settings[ 'enabled' ] ) || empty( $settings[ 'password_hash' ] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passwp-posts",
"version": "1.3.0",
"version": "1.3.1",
"description": "Password protects all pages and posts except the front page",
"type": "module",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions passwp-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PassWP Posts
* Plugin URI: https://developer.suspended.no/passwp-posts
* Description: Password protects all pages and posts except the front page. Logged-in users bypass the password.
* Version: 1.3.0
* Version: 1.3.1
* Author: Per Soderlind
* Author URI: https://soderlind.no
* License: GPL-2.0+
Expand All @@ -22,7 +22,7 @@
defined( 'ABSPATH' ) || exit;

// Plugin constants.
define( 'PASSWP_POSTS_VERSION', '1.3.0' );
define( 'PASSWP_POSTS_VERSION', '1.3.1' );
define( 'PASSWP_POSTS_PATH', plugin_dir_path( __FILE__ ) );
define( 'PASSWP_POSTS_URL', plugin_dir_url( __FILE__ ) );
define( 'PASSWP_POSTS_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: password, protection, privacy, security, access control
Requires at least: 6.8
Tested up to: 6.9
Requires PHP: 8.3
Stable tag: 1.3.0
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down
4 changes: 4 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ protected function setup_common_stubs(): void {
throw new \Exception( $message );
},
'current_user_can' => '__return_true',

// Asset functions.
'wp_enqueue_style' => '__return_null',
'wp_enqueue_script' => '__return_null',
)
);
}
Expand Down