Site Reviews - Version 5.10.1

Version Description

(2021-04-26) =

  • Fixed the missing "terms" database column error for users who updated a fresh install of Site Reviews v5.9 to v5.10
Download this release

Release Info

Developer geminilabs
Plugin Icon 128x128 Site Reviews
Version 5.10.1
Comparing to
See all releases

Code changes from version 5.10.0 to 5.10.1

plugin/Application.php CHANGED
@@ -4,10 +4,10 @@ namespace GeminiLabs\SiteReviews;
4
 
5
  use GeminiLabs\SiteReviews\Database\DefaultsManager;
6
  use GeminiLabs\SiteReviews\Database\OptionManager;
 
7
  use GeminiLabs\SiteReviews\Defaults\PermissionDefaults;
8
  use GeminiLabs\SiteReviews\Helpers\Arr;
9
- use GeminiLabs\SiteReviews\Helpers\Str;
10
- use GeminiLabs\SiteReviews\Install;
11
 
12
  /**
13
  * @property array $addons
@@ -127,8 +127,14 @@ final class Application extends Container
127
  {
128
  // Ensure the custom database tables exist, this is needed in cases
129
  // where the plugin has been updated instead of activated.
130
- if (empty(get_option(static::PREFIX.'db_version'))) {
 
131
  $this->make(Install::class)->run();
 
 
 
 
 
132
  }
133
  $this->make(Hooks::class)->run();
134
  }
4
 
5
  use GeminiLabs\SiteReviews\Database\DefaultsManager;
6
  use GeminiLabs\SiteReviews\Database\OptionManager;
7
+ use GeminiLabs\SiteReviews\Database\SqlSchema;
8
  use GeminiLabs\SiteReviews\Defaults\PermissionDefaults;
9
  use GeminiLabs\SiteReviews\Helpers\Arr;
10
+ use GeminiLabs\SiteReviews\Modules\Migrate;
 
11
 
12
  /**
13
  * @property array $addons
127
  {
128
  // Ensure the custom database tables exist, this is needed in cases
129
  // where the plugin has been updated instead of activated.
130
+ $version = get_option(static::PREFIX.'db_version');
131
+ if (empty($version)) {
132
  $this->make(Install::class)->run();
133
+ } elseif ('1.1' === $version) { // @todo remove this in v5.12.0
134
+ if (!$this->make(SqlSchema::class)->columnExists('ratings', 'terms')) {
135
+ $this->make(Migrate::class)->reset();
136
+ update_option(static::PREFIX.'db_version', '1.0');
137
+ }
138
  }
139
  $this->make(Hooks::class)->run();
140
  }
plugin/Install.php CHANGED
@@ -113,7 +113,11 @@ class Install
113
  glsr(SqlSchema::class)->createTables();
114
  glsr(SqlSchema::class)->addForeignConstraints();
115
  if (glsr(SqlSchema::class)->tablesExist() && empty(get_option(glsr()->prefix.'db_version'))) {
116
- add_option(glsr()->prefix.'db_version', Application::DB_VERSION);
 
 
 
 
117
  }
118
  }
119
 
113
  glsr(SqlSchema::class)->createTables();
114
  glsr(SqlSchema::class)->addForeignConstraints();
115
  if (glsr(SqlSchema::class)->tablesExist() && empty(get_option(glsr()->prefix.'db_version'))) {
116
+ $version = '1.0'; // @compat
117
+ if (glsr(SqlSchema::class)->columnExists('ratings', 'terms')) {
118
+ $version = Application::DB_VERSION;
119
+ }
120
+ add_option(glsr()->prefix.'db_version', $version);
121
  }
122
  }
123
 
plugin/Modules/Migrations/Migrate_5_3_0.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace GeminiLabs\SiteReviews\Modules\Migrations;
4
 
5
  use GeminiLabs\SiteReviews\Application;
 
6
 
7
  class Migrate_5_3_0
8
  {
@@ -22,7 +23,11 @@ class Migrate_5_3_0
22
  {
23
  $databaseVersion = get_option(glsr()->prefix.'db_version');
24
  if ('5.2' === $databaseVersion) {
25
- update_option(glsr()->prefix.'db_version', '1.0');
 
 
 
 
26
  }
27
  }
28
 
3
  namespace GeminiLabs\SiteReviews\Modules\Migrations;
4
 
5
  use GeminiLabs\SiteReviews\Application;
6
+ use GeminiLabs\SiteReviews\Database\SqlSchema;
7
 
8
  class Migrate_5_3_0
9
  {
23
  {
24
  $databaseVersion = get_option(glsr()->prefix.'db_version');
25
  if ('5.2' === $databaseVersion) {
26
+ $version = '1.0'; // @compat
27
+ if (glsr(SqlSchema::class)->columnExists('ratings', 'terms')) {
28
+ $version = Application::DB_VERSION;
29
+ }
30
+ update_option(glsr()->prefix.'db_version', $version);
31
  }
32
  }
33
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: reviews, ratings, testimonials, woocommerce, product reviews
5
  Tested up to: 5.7
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 5.10.0
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -135,6 +135,10 @@ All documentation can be found in the "Help" page of the plugin. If your questio
135
 
136
  ## Changelog
137
 
 
 
 
 
138
  = 5.10.0 (2021-04-26) =
139
 
140
  - Added delimiter and date format options in the "Import third party reviews" tool
5
  Tested up to: 5.7
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 5.10.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
135
 
136
  ## Changelog
137
 
138
+ = 5.10.1 (2021-04-26) =
139
+
140
+ - Fixed the missing "terms" database column error for users who updated a fresh install of Site Reviews v5.9 to v5.10
141
+
142
  = 5.10.0 (2021-04-26) =
143
 
144
  - Added delimiter and date format options in the "Import third party reviews" tool
site-reviews.php CHANGED
@@ -7,7 +7,7 @@
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
- * Version: 5.10.0
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
7
  * Plugin Name: Site Reviews
8
  * Plugin URI: https://wordpress.org/plugins/site-reviews
9
  * Description: Receive and display reviews on your website
10
+ * Version: 5.10.1
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2