Skip to content

Add a new "Redirect Page" setting in the admin#14

Merged
soderlind merged 3 commits intomainfrom
redirect/to
Jan 23, 2026
Merged

Add a new "Redirect Page" setting in the admin#14
soderlind merged 3 commits intomainfrom
redirect/to

Conversation

@soderlind
Copy link
Owner

This pull request introduces a new global "Redirect Page" setting for authenticated user redirection, improves Content Security Policy (CSP) compatibility, and simplifies the shortcode logic by removing the redirect attribute. The admin interface now uses Select2 for easier page/post selection, and the redirect mechanism uses a meta refresh instead of JavaScript. Several tests have been updated to reflect these changes.

Admin Settings and UI Improvements:

  • Added a new "Redirect Page" setting in the admin, allowing configuration of the destination page for authenticated users; the field uses Select2 for easier searching and selection. The field's visibility toggles based on the "Auto-redirect" checkbox. [1] [2] [3] [4]
  • Default settings and sanitization updated to support the new redirect_page option. [1] [2] [3]

Shortcode and Redirect Logic Changes:

  • Removed the redirect attribute from the [passwp_login] shortcode; redirection now uses the global setting. The redirect logic is centralized and uses a meta refresh tag for CSP compatibility instead of JavaScript. [1] [2] [3] [4]
  • Updated the redirect URL resolution to use the selected page/post from settings, with fallback to the homepage if not set or invalid.

Testing Updates:

  • Unit tests updated and expanded to verify the new redirect behavior, including tests for meta refresh output, correct redirect URLs, and handling of the new global setting. [1] [2] [3] [4] [5]

Changelog and Versioning:

  • Bumped plugin version to 1.4.0 and updated changelog and readme to reflect new features and changes. [1] [2] [3] [4]

Bug Fixes:

  • Fixed CSP violation by replacing inline JavaScript redirects with a meta refresh tag. [1] [2]

These changes collectively improve the plugin's flexibility, security, and user experience.

…onality

- Added a new "Redirect Page" setting in AdminSettings to configure where authenticated users are redirected after login.
- Integrated Select2 for the redirect page selector in the admin interface for improved usability.
- Removed the `redirect` attribute from the `[passwp_login]` shortcode, now relying on the global setting.
- Updated auto-redirect behavior to use a meta refresh for CSP compatibility instead of JavaScript.
- Fixed a Content Security Policy violation by eliminating inline JavaScript for redirects.
- Updated version to 1.4.0 in main plugin file and readme.
- Adjusted tests to reflect changes in redirect logic and settings.
- Updated project version to 1.4.0 in package.json and localization files.
- Modified passwp-posts-nb_NO.po and passwp-posts-nb_NO.l10n.php to reflect new version and updated translation strings.
- Adjusted POT creation date in passwp-posts.pot to match the new version.
- Enhanced i18n scripts in package.json for better localization management.
- Updated binary .mo file to ensure compatibility with the latest translations.
@soderlind soderlind merged commit 542b42d 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