From 1e70f8964cdbcafe7fbbd5ebc9cf5291a050d429 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 26 Nov 2018 11:59:27 -0500 Subject: [PATCH] Moved session init to index from adminHooks to fix pseudo-random sort on front-end. --- index.php | 13 ++++++++++--- readme.txt | 3 +++ setup/adminHooks.php | 7 ------- 3 files changed, 13 insertions(+), 10 deletions(-) mode change 100644 => 100755 setup/adminHooks.php diff --git a/index.php b/index.php index d00c81db..a1576ad1 100755 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Associate - Members Plugin * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media GLM Associate core plugin and Members database. - * Version: 2.10.45 + * Version: 2.10.46 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabase * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 2.10.45 + * @version 2.10.46 */ $GLOBALS['glmAssociateMemTracker'] = memory_get_usage(); @@ -47,7 +47,7 @@ if (!defined('ABSPATH')) { * */ -define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.45'); +define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.46'); define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.41'); // Check if plugin version is not current in WordPress option and if needed updated it @@ -429,6 +429,13 @@ if (GLM_MEMBERS_PLUGIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage()." - End glm-member-db setup",E_USER_NOTICE); } +// Initialize a PHP session if not already set +add_action( 'init', function(){ + if ( ! session_id() ) { + session_start(); + } +}); + /* * * Run desired controller diff --git a/readme.txt b/readme.txt index 6f1bc5d9..aab0221c 100755 --- a/readme.txt +++ b/readme.txt @@ -66,6 +66,9 @@ There is of course much more to this. (none) == Changelog == += 2.10.46 = +* Moved session startup from adminHooks.php to index.php to ensure there's always a session started. + = 2.10.43 = * Country is no longer required for Authorize.net Payment Gateway unless International payment diff --git a/setup/adminHooks.php b/setup/adminHooks.php old mode 100644 new mode 100755 index 2886dbdc..18d9b194 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -396,10 +396,3 @@ function glm_admin_import_help_tab () { __( 'Help Guide' ) . '

' ); } - -// If no session then start one. -add_action( 'init', function(){ - if ( ! session_id() ) { - session_start(); - } -}); -- 2.17.1