Skip to content

chore: Update version to 1.4.2 and enhance redirect functionality#16

Merged
soderlind merged 2 commits intomainfrom
update/redirect
Jan 23, 2026
Merged

chore: Update version to 1.4.2 and enhance redirect functionality#16
soderlind merged 2 commits intomainfrom
update/redirect

Conversation

@soderlind
Copy link
Owner

This pull request addresses a redirect caching issue that previously required users to perform a hard refresh after authentication. It introduces proper HTTP redirects using the template_redirect hook, ensures no-cache headers are sent with all redirect responses, and updates documentation and tests to reflect these changes. The update also bumps the plugin version to 1.4.2.

Redirect and Caching Improvements:

  • Redirects after authentication now use a proper HTTP redirect via the template_redirect hook in Shortcodes.php, replacing the previous meta refresh approach. This ensures more reliable and standards-compliant redirection. [1] [2]
  • No-cache headers are now sent with all redirect responses and on the password form to prevent browsers from caching protected pages, addressing the issue where users needed to hard refresh after authentication. [1] [2] [3] [4]

Testing and Documentation:

  • Tests have been updated to expect empty output from the shortcode when the user is already authenticated, since redirects are now handled earlier in the request lifecycle. [1] [2]
  • The test bootstrap now stubs the nocache_headers function to prevent header warnings during tests.
  • The changelog and readme have been updated to document the redirect fix and the addition of no-cache headers. [1] [2]

Version Bump:

  • The plugin version is updated to 1.4.2 in package.json, passwp-posts.php, and readme.txt. [1] [2] [3] [4]

- Updated version number in package.json, passwp-posts.php, and readme.txt to 1.4.2.
- Added changelog entry for version 1.4.2 detailing fixes for redirect caching issues and improvements in redirect handling.
- Implemented no-cache headers in Protection.php, Shortcodes.php, and password-form.php to prevent browser caching of redirects.
- Changed redirect logic to use the template_redirect hook for authenticated users in Shortcodes.php, replacing the previous meta refresh method.
- Updated tests in ShortcodesTest.php to reflect changes in redirect handling.
@soderlind soderlind merged commit b6822da into main Jan 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant