Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include an auto-incrementing id column for replication support #187

Merged
merged 2 commits into from
Mar 29, 2021
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Tags:** comments, sessions
**Requires at least:** 4.7
**Tested up to:** 5.7
**Stable tag:** 1.2.1
**Stable tag:** 1.2.2
**Requires PHP:** 5.4
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -73,6 +73,9 @@ This mu-plugin will load WP Native PHP Sessions before all other plugins, while

## Changelog ##

### 1.2.2 (March 29th, 2021) ###
* Includes an auto-incrementing `id` column for replication support [[#187](https://github.com/pantheon-systems/wp-native-php-sessions/pull/187)].

### 1.2.1 (September 17th, 2020) ###
* Plugin textdomain needs to be the same as the WordPress.org slug [[#169](https://github.com/pantheon-systems/wp-native-php-sessions/pull/169)].

Expand Down
5 changes: 3 additions & 2 deletions pantheon-sessions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: Native PHP Sessions for WordPress
* Version: 1.2.1
* Version: 1.2.2
* Description: Offload PHP's native sessions to your database for multi-server compatibility.
* Author: Pantheon
* Author URI: https://www.pantheon.io/
Expand All @@ -13,7 +13,7 @@

use Pantheon_Sessions\Session;

define( 'PANTHEON_SESSIONS_VERSION', '1.2.1' );
define( 'PANTHEON_SESSIONS_VERSION', '1.2.2' );

/**
* Main controller class for the plugin.
Expand Down Expand Up @@ -188,6 +188,7 @@ private function setup_database() {
}

$create_statement = "CREATE TABLE IF NOT EXISTS `{$table_name}` (
`id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'An auto-incrementing id to serve as an index.',
`user_id` bigint(20) unsigned NOT NULL COMMENT 'The user_id corresponding to a session, or 0 for anonymous user.',
`session_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'A session ID. The value is generated by plugin''s session handlers.',
`secure_session_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secure session ID. The value is generated by plugin''s session handlers.',
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: getpantheon, outlandish josh, mpvanwinkle77, danielbachhuber, andr
Tags: comments, sessions
Requires at least: 4.7
Tested up to: 5.7
Stable tag: 1.2.1
Stable tag: 1.2.2
Requires PHP: 5.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -73,6 +73,9 @@ This mu-plugin will load WP Native PHP Sessions before all other plugins, while

== Changelog ==

= 1.2.2 (March 29th, 2021) =
* Includes an auto-incrementing `id` column for replication support [[#187](https://github.com/pantheon-systems/wp-native-php-sessions/pull/187)].

= 1.2.1 (September 17th, 2020) =
* Plugin textdomain needs to be the same as the WordPress.org slug [[#169](https://github.com/pantheon-systems/wp-native-php-sessions/pull/169)].

Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/test-init-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function test_database_created() {
$columns = wp_list_pluck( $column_data, 'Field' );
$this->assertEquals(
array(
'id',
'user_id',
'session_id',
'secure_session_id',
Expand Down