Plugin Directory

Changeset 3385547


Ignore:
Timestamp:
10/28/2025 03:51:58 AM (7 weeks ago)
Author:
lev0
Message:

Simplify + test with latest version

Location:
stop-logging-me-out
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • stop-logging-me-out/tags/1.1.0/languages/stop-logging-me-out.pot

    r3081704 r3385547  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Stop Logging Me Out 1.0.0\n"
     5"Project-Id-Version: Stop Logging Me Out 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/stop-logging-me-out\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-05-06T05:36:58+00:00\n"
     12"POT-Creation-Date: 2025-10-28T03:32:17+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.9.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: stop-logging-me-out\n"
    1616
    1717#. Plugin Name of the plugin
     18#: stop-logging-me-out.php
    1819msgid "Stop Logging Me Out"
    1920msgstr ""
    2021
    2122#. Description of the plugin
     23#: stop-logging-me-out.php
    2224msgid "Stop a previously expired session's login page from forcibly logging you out of your current session."
    2325msgstr ""
    2426
    2527#. Author of the plugin
     28#: stop-logging-me-out.php
    2629msgid "Roy Orbitson"
    2730msgstr ""
    2831
    2932#. Author URI of the plugin
     33#: stop-logging-me-out.php
    3034msgid "https://profiles.wordpress.org/lev0/"
    3135msgstr ""
    3236
    33 #: stop-logging-me-out.php:164
     37#: stop-logging-me-out.php:132
    3438msgid "You could not be authenticated in order to return you to your session. You will need to log in again."
    3539msgstr ""
    3640
    37 #: stop-logging-me-out.php:232
     41#: stop-logging-me-out.php:200
    3842msgid "You have logged in again since this page loaded. Would you like to try returning to your session?"
    3943msgstr ""
    4044
    41 #: stop-logging-me-out.php:233
     45#: stop-logging-me-out.php:201
    4246msgid "You have logged in again since this page automatically logged you out. Would you like to try returning to it?"
    4347msgstr ""
  • stop-logging-me-out/tags/1.1.0/readme.txt

    r3081704 r3385547  
    33Tags: login, sessions, annoyances
    44Requires at least: 4.0.0
    5 Tested up to: 6.5.2
    6 Stable tag: 1.0.0
     5Tested up to: 6.8.3
     6Stable tag: 1.1.0
    77Requires PHP: 7.0.0
    88License: GPLv2 or later
     
    1313== Description ==
    1414
    15 WordPress asks you to reauthenticate when your session expires, or for other security reasons. This is great *except* when you've just done so, and WordPress mistakenly believes you need to do it again and again.
     15WordPress asks you to reauthenticate when your session expires, or for other security reasons. This is great *except* when you've just done so (usually in another tab), and WordPress mistakenly believes you need to do it again and again.
    1616
    17 This plugin modifies a small portion the login system to prevent login cookies being erased when they don't need to. It may not work in rare instances where that system is already being modified by other third party code in a way that isn't completely compatible with the default WordPress functions.
     17This plugin modifies a small portion the login system to try return you to the page you were on. It may not work in rare instances where your login system is already being modified by other third-party code, and in a way that isn't completely compatible with the default WordPress functions.
    1818
    1919== Installation ==
     
    2525== Changelog ==
    2626 
     27= 1.1.0 =
     28
     29* Refactor to simplify.
     30 
    2731= 1.0.0 =
    2832
  • stop-logging-me-out/tags/1.1.0/stop-logging-me-out.php

    r3081704 r3385547  
    33Plugin Name: Stop Logging Me Out
    44Description: Stop a previously expired session's login page from forcibly logging you out of your current session.
    5 Version: 1.0.0
     5Version: 1.1.0
    66Requires at least: 4.0.0
    77Requires PHP: 7.0.0
     
    2828    # accumulate values from filters because not available at time we need to set cookie
    2929    $slmo_secure_logged_in_cookie = null;
    30     $slmo_send_auth_cookies = null;
    31     $slmo_expire = null;
    32     $slmo_user_id = 0;
    3330    $slmo_retain_cookies = false;
    3431    $slmo_modify_login = 0;
     
    6764    );
    6865
    69     add_action(
    70         'set_logged_in_cookie'
    71         , function($logged_in_cookie, $expire, $expiration, $user_id, $scheme) use (&$slmo_expire, &$slmo_user_id) {
    72             if ($scheme === 'logged_in') {
    73                 $slmo_expire = $expire;
    74                 $slmo_user_id = $user_id;
    75             }
    76         }
    77         , PHP_INT_MAX
    78         , 5
    79     );
    80 
    81     add_action(
    82         'clear_auth_cookie'
    83         , function() use (&$slmo_retain_cookies, &$slmo_user_id) {
    84             $slmo_retain_cookies = false;
    85             $slmo_user_id = 0;
    86         }
    87         , PHP_INT_MAX
    88         , 0
    89     );
    90 
    9166    add_filter(
    9267        'send_auth_cookies'
    93         , function($send_auth_cookies) use (&$slmo_send_auth_cookies, &$slmo_user_id, &$slmo_retain_cookies, $slmo_cookie_name, $slmo_cookie_path) {
    94             if ($slmo_user_id) {
    95                 $slmo_send_auth_cookies = $send_auth_cookies;
    96             }
    97             elseif ($slmo_retain_cookies) {
    98                 $send_auth_cookies = false; # unnecessary session destruction stopped
    99             }
    100             elseif ($send_auth_cookies) {
    101                 setcookie($slmo_cookie_name, ' ', time() - YEAR_IN_SECONDS, $slmo_cookie_path(), COOKIE_DOMAIN); # real logout
    102             }
    103             return $send_auth_cookies;
    104         }
    105         , PHP_INT_MAX
    106     );
    107 
    108     add_action(
    109         'wp_login'
    110         , function($user_login) use ($slmo_cookie_name, $slmo_cookie_path, &$slmo_secure_logged_in_cookie, &$slmo_expire, &$slmo_send_auth_cookies) {
    111             if ($slmo_send_auth_cookies) {
    112                 setcookie($slmo_cookie_name, time(), $slmo_expire, $slmo_cookie_path(), COOKIE_DOMAIN, $slmo_secure_logged_in_cookie);
    113             }
    114         }
    115         , PHP_INT_MIN
     68        , function($send, $expire, $expiration, $user_id) use (&$slmo_retain_cookies, &$slmo_secure_logged_in_cookie, $slmo_cookie_name, $slmo_cookie_path) {
     69            if ($send) {
     70                if ($user_id) { # after 'set_logged_in_cookie'
     71                    setcookie($slmo_cookie_name, time(), $expire, $slmo_cookie_path(), COOKIE_DOMAIN, $slmo_secure_logged_in_cookie);
     72                }
     73                elseif ($slmo_retain_cookies) { # after 'clear_auth_cookie'
     74                    $send = false; # stop unnecessary session destruction
     75                }
     76                else {
     77                    setcookie($slmo_cookie_name, '', time() - YEAR_IN_SECONDS, $slmo_cookie_path(), COOKIE_DOMAIN); # real logout
     78                }
     79            }
     80            return $send;
     81        }
     82        , PHP_INT_MAX
     83        , 4
    11684    );
    11785
     
    140108                            && $user->exists()
    141109                        ) {
    142                             # extra redirect logic duplicated from wp-login.php
     110                            # extra redirect logic duplicated from wp-login.php at end of "if" block below 'login_redirect' filter
    143111                            if ( ( empty( $redirect_to ) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) ) {
    144112                                // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
  • stop-logging-me-out/trunk/languages/stop-logging-me-out.pot

    r3081704 r3385547  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Stop Logging Me Out 1.0.0\n"
     5"Project-Id-Version: Stop Logging Me Out 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/stop-logging-me-out\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-05-06T05:36:58+00:00\n"
     12"POT-Creation-Date: 2025-10-28T03:32:17+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.9.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: stop-logging-me-out\n"
    1616
    1717#. Plugin Name of the plugin
     18#: stop-logging-me-out.php
    1819msgid "Stop Logging Me Out"
    1920msgstr ""
    2021
    2122#. Description of the plugin
     23#: stop-logging-me-out.php
    2224msgid "Stop a previously expired session's login page from forcibly logging you out of your current session."
    2325msgstr ""
    2426
    2527#. Author of the plugin
     28#: stop-logging-me-out.php
    2629msgid "Roy Orbitson"
    2730msgstr ""
    2831
    2932#. Author URI of the plugin
     33#: stop-logging-me-out.php
    3034msgid "https://profiles.wordpress.org/lev0/"
    3135msgstr ""
    3236
    33 #: stop-logging-me-out.php:164
     37#: stop-logging-me-out.php:132
    3438msgid "You could not be authenticated in order to return you to your session. You will need to log in again."
    3539msgstr ""
    3640
    37 #: stop-logging-me-out.php:232
     41#: stop-logging-me-out.php:200
    3842msgid "You have logged in again since this page loaded. Would you like to try returning to your session?"
    3943msgstr ""
    4044
    41 #: stop-logging-me-out.php:233
     45#: stop-logging-me-out.php:201
    4246msgid "You have logged in again since this page automatically logged you out. Would you like to try returning to it?"
    4347msgstr ""
  • stop-logging-me-out/trunk/readme.txt

    r3081704 r3385547  
    33Tags: login, sessions, annoyances
    44Requires at least: 4.0.0
    5 Tested up to: 6.5.2
    6 Stable tag: 1.0.0
     5Tested up to: 6.8.3
     6Stable tag: 1.1.0
    77Requires PHP: 7.0.0
    88License: GPLv2 or later
     
    1313== Description ==
    1414
    15 WordPress asks you to reauthenticate when your session expires, or for other security reasons. This is great *except* when you've just done so, and WordPress mistakenly believes you need to do it again and again.
     15WordPress asks you to reauthenticate when your session expires, or for other security reasons. This is great *except* when you've just done so (usually in another tab), and WordPress mistakenly believes you need to do it again and again.
    1616
    17 This plugin modifies a small portion the login system to prevent login cookies being erased when they don't need to. It may not work in rare instances where that system is already being modified by other third party code in a way that isn't completely compatible with the default WordPress functions.
     17This plugin modifies a small portion the login system to try return you to the page you were on. It may not work in rare instances where your login system is already being modified by other third-party code, and in a way that isn't completely compatible with the default WordPress functions.
    1818
    1919== Installation ==
     
    2525== Changelog ==
    2626 
     27= 1.1.0 =
     28
     29* Refactor to simplify.
     30 
    2731= 1.0.0 =
    2832
  • stop-logging-me-out/trunk/stop-logging-me-out.php

    r3081704 r3385547  
    33Plugin Name: Stop Logging Me Out
    44Description: Stop a previously expired session's login page from forcibly logging you out of your current session.
    5 Version: 1.0.0
     5Version: 1.1.0
    66Requires at least: 4.0.0
    77Requires PHP: 7.0.0
     
    2828    # accumulate values from filters because not available at time we need to set cookie
    2929    $slmo_secure_logged_in_cookie = null;
    30     $slmo_send_auth_cookies = null;
    31     $slmo_expire = null;
    32     $slmo_user_id = 0;
    3330    $slmo_retain_cookies = false;
    3431    $slmo_modify_login = 0;
     
    6764    );
    6865
    69     add_action(
    70         'set_logged_in_cookie'
    71         , function($logged_in_cookie, $expire, $expiration, $user_id, $scheme) use (&$slmo_expire, &$slmo_user_id) {
    72             if ($scheme === 'logged_in') {
    73                 $slmo_expire = $expire;
    74                 $slmo_user_id = $user_id;
    75             }
    76         }
    77         , PHP_INT_MAX
    78         , 5
    79     );
    80 
    81     add_action(
    82         'clear_auth_cookie'
    83         , function() use (&$slmo_retain_cookies, &$slmo_user_id) {
    84             $slmo_retain_cookies = false;
    85             $slmo_user_id = 0;
    86         }
    87         , PHP_INT_MAX
    88         , 0
    89     );
    90 
    9166    add_filter(
    9267        'send_auth_cookies'
    93         , function($send_auth_cookies) use (&$slmo_send_auth_cookies, &$slmo_user_id, &$slmo_retain_cookies, $slmo_cookie_name, $slmo_cookie_path) {
    94             if ($slmo_user_id) {
    95                 $slmo_send_auth_cookies = $send_auth_cookies;
    96             }
    97             elseif ($slmo_retain_cookies) {
    98                 $send_auth_cookies = false; # unnecessary session destruction stopped
    99             }
    100             elseif ($send_auth_cookies) {
    101                 setcookie($slmo_cookie_name, ' ', time() - YEAR_IN_SECONDS, $slmo_cookie_path(), COOKIE_DOMAIN); # real logout
    102             }
    103             return $send_auth_cookies;
    104         }
    105         , PHP_INT_MAX
    106     );
    107 
    108     add_action(
    109         'wp_login'
    110         , function($user_login) use ($slmo_cookie_name, $slmo_cookie_path, &$slmo_secure_logged_in_cookie, &$slmo_expire, &$slmo_send_auth_cookies) {
    111             if ($slmo_send_auth_cookies) {
    112                 setcookie($slmo_cookie_name, time(), $slmo_expire, $slmo_cookie_path(), COOKIE_DOMAIN, $slmo_secure_logged_in_cookie);
    113             }
    114         }
    115         , PHP_INT_MIN
     68        , function($send, $expire, $expiration, $user_id) use (&$slmo_retain_cookies, &$slmo_secure_logged_in_cookie, $slmo_cookie_name, $slmo_cookie_path) {
     69            if ($send) {
     70                if ($user_id) { # after 'set_logged_in_cookie'
     71                    setcookie($slmo_cookie_name, time(), $expire, $slmo_cookie_path(), COOKIE_DOMAIN, $slmo_secure_logged_in_cookie);
     72                }
     73                elseif ($slmo_retain_cookies) { # after 'clear_auth_cookie'
     74                    $send = false; # stop unnecessary session destruction
     75                }
     76                else {
     77                    setcookie($slmo_cookie_name, '', time() - YEAR_IN_SECONDS, $slmo_cookie_path(), COOKIE_DOMAIN); # real logout
     78                }
     79            }
     80            return $send;
     81        }
     82        , PHP_INT_MAX
     83        , 4
    11684    );
    11785
     
    140108                            && $user->exists()
    141109                        ) {
    142                             # extra redirect logic duplicated from wp-login.php
     110                            # extra redirect logic duplicated from wp-login.php at end of "if" block below 'login_redirect' filter
    143111                            if ( ( empty( $redirect_to ) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) ) {
    144112                                // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
Note: See TracChangeset for help on using the changeset viewer.