Site Reviews - Version 5.1.3

Version Description

(2020-10-25) =

  • Add "ORDER BY" in migration SQL queries. This will make it a little slower, but hopefully fix the problem where the database migration notice is shown multiple times.
  • Fixed addons notice styling and placement
Download this release

Release Info

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

Code changes from version 5.1.2 to 5.1.3

languages/site-reviews-en_US.po CHANGED
@@ -1684,17 +1684,17 @@ msgctxt "admin-text"
1684
  msgid "Yes"
1685
  msgstr "Yes"
1686
 
1687
- #: plugin/Controllers/NoticeController.php:108
1688
  msgctxt "admin-text"
1689
  msgid "Import Third Party Reviews"
1690
  msgstr "Import Third Party Reviews"
1691
 
1692
- #: plugin/Controllers/NoticeController.php:124
1693
  msgctxt "admin-text"
1694
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1695
  msgstr "Thanks for installing Site Reviews v%s, we hope you love it!"
1696
 
1697
- #: plugin/Controllers/NoticeController.php:125
1698
  msgctxt "admin-text"
1699
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1700
  msgstr "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1684
  msgid "Yes"
1685
  msgstr "Yes"
1686
 
1687
+ #: plugin/Controllers/NoticeController.php:118
1688
  msgctxt "admin-text"
1689
  msgid "Import Third Party Reviews"
1690
  msgstr "Import Third Party Reviews"
1691
 
1692
+ #: plugin/Controllers/NoticeController.php:133
1693
  msgctxt "admin-text"
1694
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1695
  msgstr "Thanks for installing Site Reviews v%s, we hope you love it!"
1696
 
1697
+ #: plugin/Controllers/NoticeController.php:134
1698
  msgctxt "admin-text"
1699
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1700
  msgstr "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
languages/site-reviews.pot CHANGED
@@ -1334,17 +1334,17 @@ msgctxt "admin-text"
1334
  msgid "Yes"
1335
  msgstr ""
1336
 
1337
- #: plugin/Controllers/NoticeController.php:108
1338
  msgctxt "admin-text"
1339
  msgid "Import Third Party Reviews"
1340
  msgstr ""
1341
 
1342
- #: plugin/Controllers/NoticeController.php:124
1343
  msgctxt "admin-text"
1344
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1345
  msgstr ""
1346
 
1347
- #: plugin/Controllers/NoticeController.php:125
1348
  msgctxt "admin-text"
1349
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1350
  msgstr ""
1334
  msgid "Yes"
1335
  msgstr ""
1336
 
1337
+ #: plugin/Controllers/NoticeController.php:118
1338
  msgctxt "admin-text"
1339
  msgid "Import Third Party Reviews"
1340
  msgstr ""
1341
 
1342
+ #: plugin/Controllers/NoticeController.php:133
1343
  msgctxt "admin-text"
1344
  msgid "Thanks for installing Site Reviews v%s, we hope you love it!"
1345
  msgstr ""
1346
 
1347
+ #: plugin/Controllers/NoticeController.php:134
1348
  msgctxt "admin-text"
1349
  msgid "Thanks for updating to Site Reviews v%s, we hope you love the changes!"
1350
  msgstr ""
plugin/Controllers/NoticeController.php CHANGED
@@ -33,11 +33,10 @@ class NoticeController extends Controller
33
  */
34
  public function adminNotices()
35
  {
36
- $screen = glsr_current_screen();
37
  // order is intentional!
38
  $this->renderAddonsNotice();
39
- $this->renderWelcomeNotice($screen->post_type);
40
- $this->renderMigrationNotice($screen->post_type);
41
  }
42
 
43
  /**
@@ -81,12 +80,24 @@ class NoticeController extends Controller
81
  return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
82
  }
83
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  /**
85
  * @return void
86
  */
87
  protected function renderAddonsNotice()
88
  {
89
- if ('site-review_page_addons' !== glsr_current_screen()->id
90
  && Helper::isGreaterThan($this->getVersionFor('addons'), $this->getUserMeta('addons', 0))
91
  && glsr()->can('edit_others_posts')) {
92
  glsr()->render('partials/notices/addons');
@@ -94,12 +105,11 @@ class NoticeController extends Controller
94
  }
95
 
96
  /**
97
- * @param string $screenPostType
98
  * @return void
99
  */
100
- protected function renderMigrationNotice($screenPostType)
101
  {
102
- if (glsr()->post_type == $screenPostType
103
  && glsr()->hasPermission('tools', 'general')
104
  && (glsr(Migrate::class)->isMigrationNeeded() || glsr(Database::class)->isMigrationNeeded())) {
105
  glsr()->render('partials/notices/migrate', [
@@ -112,12 +122,11 @@ class NoticeController extends Controller
112
  }
113
 
114
  /**
115
- * @param string $screenPostType
116
  * @return void
117
  */
118
- protected function renderWelcomeNotice($screenPostType)
119
  {
120
- if (glsr()->post_type == $screenPostType
121
  && Helper::isGreaterThan($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0))
122
  && glsr()->can('edit_others_posts')) {
123
  $welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
33
  */
34
  public function adminNotices()
35
  {
 
36
  // order is intentional!
37
  $this->renderAddonsNotice();
38
+ $this->renderWelcomeNotice();
39
+ $this->renderMigrationNotice();
40
  }
41
 
42
  /**
80
  return Arr::get($this->dismissValuesMap, $noticeKey, glsr()->version('major'));
81
  }
82
 
83
+ /**
84
+ * @return bool
85
+ */
86
+ protected function isCurrentScreen()
87
+ {
88
+ $screen = glsr_current_screen();
89
+ $screenIds = [
90
+ 'dashboard',
91
+ ];
92
+ return glsr()->post_type == $screen->post_type || in_array($screen->id, $screenIds);
93
+ }
94
+
95
  /**
96
  * @return void
97
  */
98
  protected function renderAddonsNotice()
99
  {
100
+ if ($this->isCurrentScreen()
101
  && Helper::isGreaterThan($this->getVersionFor('addons'), $this->getUserMeta('addons', 0))
102
  && glsr()->can('edit_others_posts')) {
103
  glsr()->render('partials/notices/addons');
105
  }
106
 
107
  /**
 
108
  * @return void
109
  */
110
+ protected function renderMigrationNotice()
111
  {
112
+ if ($this->isCurrentScreen()
113
  && glsr()->hasPermission('tools', 'general')
114
  && (glsr(Migrate::class)->isMigrationNeeded() || glsr(Database::class)->isMigrationNeeded())) {
115
  glsr()->render('partials/notices/migrate', [
122
  }
123
 
124
  /**
 
125
  * @return void
126
  */
127
+ protected function renderWelcomeNotice()
128
  {
129
+ if ($this->isCurrentScreen()
130
  && Helper::isGreaterThan($this->getVersionFor('welcome'), $this->getUserMeta('welcome', 0))
131
  && glsr()->can('edit_others_posts')) {
132
  $welcomeText = '0.0.0' == glsr(OptionManager::class)->get('version_upgraded_from')
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: reviews, ratings, testimonials, business reviews, product reviews, stars,
5
  Tested up to: 5.5
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 5.1.2
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -113,10 +113,10 @@ All documentation can be found in the "Help" page of the plugin. If your questio
113
 
114
  == Changelog ==
115
 
116
- = 5.1.2 (2020-10-24) =
117
 
118
  - Add "ORDER BY" in migration SQL queries. This will make it a little slower, but hopefully fix the problem where the database migration notice is shown multiple times.
119
- - Fixed notice styling
120
 
121
  = 5.1.0 (2020-10-24) =
122
 
5
  Tested up to: 5.5
6
  Requires at least: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 5.1.3
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
113
 
114
  == Changelog ==
115
 
116
+ = 5.1.3 (2020-10-25) =
117
 
118
  - Add "ORDER BY" in migration SQL queries. This will make it a little slower, but hopefully fix the problem where the database migration notice is shown multiple times.
119
+ - Fixed addons notice styling and placement
120
 
121
  = 5.1.0 (2020-10-24) =
122
 
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.1.2
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.1.3
11
  * Author: Paul Ryley
12
  * Author URI: https://geminilabs.io
13
  * License: GPL2
views/partials/notices/addons.php CHANGED
@@ -1,5 +1,5 @@
1
- <div class="notice is-dismissible glsr-notice glsr-notice-branded" data-dismiss="addons" style="border-left-color:#f6e05e!important;padding-left:98px">
2
- <div class="glsr-notice-branded-image" style="align-items:center;background-color:#faf089;border-right:1px solid #ccd0d4;bottom:0;display:flex;justify-content:center;left:0;padding:0 5px;position:absolute;top:0;width:75px">
3
  <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
4
  <path fill="#212121" fill-rule="nonzero" d="M458 80a14 14 0 0114 14v364a14 14 0 01-14 14H54a14 14 0 01-14-14V94a14 14 0 0114-14h404z"/>
5
  <path fill="ivory" fill-rule="nonzero" d="M458 83H54a11 11 0 00-11 10.71V458a11 11 0 0010.71 11H458a11 11 0 0011-10.71V94a11 11 0 00-10.71-11H458z"/>
1
+ <div class="notice is-dismissible glsr-notice glsr-notice-branded" data-dismiss="addons">
2
+ <div class="glsr-notice-branded-image">
3
  <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
4
  <path fill="#212121" fill-rule="nonzero" d="M458 80a14 14 0 0114 14v364a14 14 0 01-14 14H54a14 14 0 01-14-14V94a14 14 0 0114-14h404z"/>
5
  <path fill="ivory" fill-rule="nonzero" d="M458 83H54a11 11 0 00-11 10.71V458a11 11 0 0010.71 11H458a11 11 0 0011-10.71V94a11 11 0 00-10.71-11H458z"/>