Skip to content

Commit 2d3c950

Browse files
committed
Released 6.1.1
Released 6.1.1 with: #1. Escaping added, when necessary to ‘_doing_it_wrong’ calls. #2. Network-updating now can be done for 6.1.1 successfully. #3. Some additional minor improvements / patches.
1 parent 3c0a53c commit 2d3c950

File tree

9 files changed

+39
-76
lines changed

9 files changed

+39
-76
lines changed

Controllers/Admin/Status/NetworkController.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
* @license MIT License. See Legal/License.txt for details.
88
*/
99
namespace ExpandableFAQ\Controllers\Admin\Status;
10-
use ExpandableFAQ\Controllers\Admin\InstallController;
1110
use ExpandableFAQ\Models\Configuration\ConfigurationInterface;
1211
use ExpandableFAQ\Models\Formatting\StaticFormatter;
13-
use ExpandableFAQ\Models\Install\Install;
14-
use ExpandableFAQ\Models\Language\Language;
1512
use ExpandableFAQ\Models\Language\LanguageInterface;
1613
use ExpandableFAQ\Models\Cache\StaticSession;
1714
use ExpandableFAQ\Models\Status\NetworkStatus;
@@ -46,32 +43,36 @@ private function processUpdate()
4643

4744
// Allow only one update at-a-time per site refresh. We need that to save resources of server to not to get to timeout phase
4845
$allUpdatableSitesSemverUpdated = FALSE;
49-
$minPluginSemverInDatabase = $objStatus->getMinPluginSemverInDatabase();
50-
$maxPluginSemverInDatabase = $objStatus->getMaxPluginSemverInDatabase();
46+
$currentMinPluginSemverInDatabase = $objStatus->getMinPluginSemverInDatabase();
5147
$latestSemver = $this->conf->getPluginSemver();
5248

5349
// ----------------------------------------
5450
// NOTE: A PLACE FOR UPDATE CODE
5551
// ----------------------------------------
56-
5752
if($this->conf->isNetworkEnabled())
5853
{
59-
if(version_compare($minPluginSemverInDatabase, '6.0.2', '=='))
54+
if(version_compare($currentMinPluginSemverInDatabase, '6.0.2', '=='))
6055
{
6156
$allUpdatableSitesSemverUpdated = $objUpdatesObserver->do602_UpdateTo610();
62-
} else if(version_compare($minPluginSemverInDatabase, $latestSemver, '=='))
57+
} else if(version_compare($currentMinPluginSemverInDatabase, $latestSemver, '=='))
6358
{
6459
// It's a last version
6560
$allUpdatableSitesSemverUpdated = TRUE;
6661
}
6762

6863
// Process patches
69-
if(version_compare($minPluginSemverInDatabase, '6.0.0', '>=') && version_compare($maxPluginSemverInDatabase, '6.1.0', '<'))
64+
// NOTE: Is import here to get plugin semver once again, to make sure we have up to date data
65+
$updatedMinPluginSemverInDatabase = $objStatus->getMinPluginSemverInDatabase();
66+
$updatedMaxPluginSemverInDatabase = $objStatus->getMaxPluginSemverInDatabase();
67+
if(version_compare($updatedMinPluginSemverInDatabase, '6.0.0', '>=') && version_compare($updatedMaxPluginSemverInDatabase, '6.1.0', '<'))
7068
{
7169
// Process 6.0.Z patches
7270
$allUpdatableSitesSemverUpdated = $objPatchesObserver->doPatch(6, 0);
71+
} else if(version_compare($updatedMinPluginSemverInDatabase, '6.1.0', '>=') && version_compare($updatedMaxPluginSemverInDatabase, '6.2.0', '<'))
72+
{
73+
// Process 6.1.Z patches
74+
$allUpdatableSitesSemverUpdated = $objPatchesObserver->doPatch(6, 1);
7375
}
74-
// NOTE: No 6.1.Z patches exist yet, so no ELSE IF statement is here
7576

7677
// Cache update messages
7778
StaticSession::cacheHTML_Array('admin_debug_html', $objUpdatesObserver->getSavedDebugMessages());

Controllers/Admin/Status/SingleController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,11 @@ private function processUpdate()
174174
{
175175
// Run 6.0.Z patches
176176
$semverUpdated = $objPatchesObserver->doPatch(6, 0);
177+
} else if(version_compare($updatedPluginSemverInDatabase, '6.1.0', '>=') && version_compare($updatedPluginSemverInDatabase, '6.2.0', '<'))
178+
{
179+
// Run 6.1.Z patches
180+
$semverUpdated = $objPatchesObserver->doPatch(6, 1);
177181
}
178-
// NOTE: No 6.1.Z patches exist yet, so no ELSE IF statement is here
179182

180183
// Cache update messages
181184
StaticSession::cacheHTML_Array('admin_debug_html', $objUpdatesObserver->getSavedDebugMessages());

ExpandableFAQ.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Expandable FAQ
44
* Plugin URI: https://wordpress.org/plugins/expandable-faq/
55
* Description: It’s a high quality, native and responsive WordPress plugin to create and view F.A.Q.'s
6-
* Version: 6.1.0
6+
* Version: 6.1.1
77
* Author: KestutisIT
88
* Author URI: https://profiles.wordpress.org/KestutisIT
99
* Text Domain: expandable-faq
@@ -43,7 +43,7 @@ final class ExpandableFAQ
4343
const REQUIRED_PHP_VERSION = '5.6.0';
4444
const REQUIRED_WP_VERSION = 4.6;
4545
const OLDEST_COMPATIBLE_PLUGIN_SEMVER = '6.0.0';
46-
const PLUGIN_SEMVER = '6.1.0';
46+
const PLUGIN_SEMVER = '6.1.1';
4747

4848
// Settings
4949
/**

Models/Status/NetworkStatus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ final class NetworkStatus extends AbstractStack implements StackInterface, Netwo
2525
/**
2626
* CAUTION! Be careful when using echo debug, as this class is used in ajax requests,
2727
* so only if it is links display call, or 'die()' is called afterwards, the echoing will work as expected.
28-
* @var int
28+
* @var bool
2929
*/
30-
private $echoDebug = 0;
30+
private $echoDebug = FALSE;
3131

3232
public function __construct(ConfigurationInterface &$paramConf, LanguageInterface &$paramLang)
3333
{

Models/Status/SingleStatus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ final class SingleStatus extends AbstractStack implements StackInterface, Single
2525
/**
2626
* CAUTION! Be careful when using echo debug, as this class is used in ajax requests,
2727
* so only if it is links display call, or 'die()' is called afterwards, the echoing will work as expected.
28-
* @var int
28+
* @var bool
2929
*/
30-
private $echoDebug = 0;
30+
private $echoDebug = FALSE;
3131
private $blogId = 0;
3232

3333
public function __construct(ConfigurationInterface &$paramConf, LanguageInterface &$paramLang, $paramBlogId)

Models/Update/NetworkUpdatesObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function do602_UpdateTo610()
9999
// and current site database was not yet updated
100100
if(
101101
$networkEarlyStructAltered && $objSingleStatus->checkPluginDataExistsOf('6.0.2')
102-
&& version_compare($objSingleStatus->getPluginSemverInDatabase(), '6.1.0', '==')
102+
&& version_compare($objSingleStatus->getPluginSemverInDatabase(), '6.0.2', '==')
103103
) {
104104
$dataUpdated = $objSingleDB_Update->updateDatabaseData();
105105
if($dataUpdated === FALSE)

Models/Update/Patches61Z.php

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class Patches61Z extends AbstractDatabase implements StackInterface, Datab
1717
{
1818
const CURRENT_MAJOR = 6; // Positive integer [X]
1919
const CURRENT_MINOR = 1; // Positive integer [Y]
20-
const LATEST_PATCH = 0; // Positive integer [Z]
20+
const LATEST_PATCH = 1; // Positive integer [Z]
2121
const LATEST_RELEASE = ''; // String
2222
const LATEST_BUILD_METADATA = ''; // String
2323
const PLUGIN_PREFIX = "expandable_faq_";
@@ -38,55 +38,17 @@ public function __construct(ConfigurationInterface &$paramConf, LanguageInterfac
3838
*/
3939
public function patchDatabaseEarlyStructure()
4040
{
41-
// NOTHING HERE
42-
$patched = TRUE;
43-
44-
/*$arrSQL = array();
45-
$objSemver = new Semver($this->pluginSemverInDatabase, FALSE);
46-
$currentPatch = $objSemver->getPatch();
47-
48-
// No patches yet
49-
50-
$patched = $this->executeQueries($arrSQL);
51-
if($patched === FALSE)
52-
{
53-
$this->errorMessages[] = sprintf($this->lang->getText('LANG_DATABASE_UPDATE_EARLY_STRUCTURE_PATCH_ERROR_TEXT'), $this->blogId);
54-
} else
55-
{
56-
$this->okayMessages[] = sprintf($this->lang->getText('LANG_DATABASE_UPDATE_EARLY_STRUCTURE_PATCHED_TEXT'), $this->blogId);
57-
}*/
58-
59-
return $patched;
41+
// NOTHING HERE YET
42+
return TRUE;
6043
}
6144

6245
/**
6346
* @return bool
6447
*/
6548
public function patchData()
6649
{
67-
// NOTHING HERE
68-
$patched = TRUE;
69-
70-
/*$arrSQL = array();
71-
$validBlogId = StaticValidator::getValidPositiveInteger($this->blogId, 0);
72-
73-
$objSemver = new Semver($this->pluginSemverInDatabase, FALSE);
74-
$currentPatch = $objSemver->getPatch();
75-
76-
// No patches yet
77-
78-
// Execute queries
79-
$patched = $this->executeQueries($arrSQL);
80-
81-
if($patched === FALSE)
82-
{
83-
$this->errorMessages[] = sprintf($this->lang->getText('LANG_DATABASE_UPDATE_DATA_PATCH_ERROR_TEXT'), $this->blogId);
84-
} else
85-
{
86-
$this->okayMessages[] = sprintf($this->lang->getText('LANG_DATABASE_UPDATE_DATA_PATCHED_TEXT'), $this->blogId);
87-
}*/
88-
89-
return $patched;
50+
// NOTHING HERE YET
51+
return TRUE;
9052
}
9153

9254
/**
@@ -95,20 +57,8 @@ public function patchData()
9557
*/
9658
public function patchDatabaseLateStructure()
9759
{
98-
// NOTHING HERE
99-
$patched = TRUE;
100-
101-
// $arrSQL = array();
102-
// $patched = $this->executeQueries($arrSQL);
103-
//if($patched === FALSE)
104-
//{
105-
// $this->errorMessages[] = sprintf($this->lang->getText('LANG_DATABASE_UPDATE_LATE_STRUCTURE_PATCH_ERROR_TEXT'), $this->blogId);
106-
//} else
107-
//{
108-
// $this->okayMessages[] = sprintf($this->lang->getText('LANG_DATABASE_UPDATE_LATE_STRUCTURE_PATCHED_TEXT'), $this->blogId);
109-
//}
110-
111-
return $patched;
60+
// NOTHING HERE YET
61+
return TRUE;
11262
}
11363

11464
/**

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ to your website's FAQ page and make automatically expand specific FAQ with a pag
108108

109109
# Changelog
110110

111+
= 6.1.1 =
112+
* Escaping added, when necessary to ‘_doing_it_wrong’ calls.
113+
* Network-updating now can be done for 6.1.1 successfully.
114+
* Some additional minor improvements / patches.
115+
111116
= 6.1.0 =
112117
* NumberDropdown bug fixed in StaticFormatter.
113118
* All table classes are now marked as final.

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ to your website's FAQ page and make automatically expand specific FAQ with a pag
100100

101101
== Changelog ==
102102

103+
= 6.1.1 =
104+
* Escaping added, when necessary to ‘_doing_it_wrong’ calls.
105+
* Network-updating now can be done for 6.1.1 successfully.
106+
* Some additional minor improvements / patches.
107+
103108
= 6.1.0 =
104109
* NumberDropdown bug fixed in StaticFormatter.
105110
* All table classes are now marked as final.
@@ -113,7 +118,6 @@ to your website's FAQ page and make automatically expand specific FAQ with a pag
113118
* Fixed issue with network installing when multisite is enabled in WordPress, as well as created workaround until WordPress core bug #36406 will be fixed (read more at [https://core.trac.wordpress.org/ticket/36406]( https://core.trac.wordpress.org/ticket/36406 "WordPress Trac")).
114119
* PHP 5.6 backwards compatibility added.
115120

116-
117121
= 6.0.2 =
118122
* Updating and patching are now separated. FA now loaded by default after install. Populate/drop data url behaviour changed. Some minor improvements.
119123

0 commit comments

Comments
 (0)