Skip to content

Commit a4c369b

Browse files
Release free-v3.0.4
1 parent 76ea8c7 commit a4c369b

File tree

9 files changed

+95
-13
lines changed

9 files changed

+95
-13
lines changed

readme.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Requires at least: 6.5
55
Donate Link: https://wprollback.com/
66
Tested up to: 6.8
77
Requires PHP: 7.4
8-
Stable tag: 3.0.3
8+
Stable tag: 3.0.4
99
License: GPLv3
1010
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1111

@@ -112,11 +112,19 @@ This is the first version of this plugin. It is a tool for your convenience. Rol
112112

113113
== Changelog ==
114114

115+
= 3.0.4 =
116+
* New: Added maintenance mode support during rollback operations to prevent site access while files are being replaced, following WordPress Core update patterns.
117+
* Improvement: Enhanced rollback safety with automatic maintenance mode cleanup that ensures your site never gets stuck in maintenance mode, even if a rollback fails.
118+
* Fix: Removed overly restrictive package validation that required plugin main files to match the plugin slug. This fix allows plugins like Visual Composer (with main file "plugin-wordpress.php") and other legitimate plugins with non-standard main file names to be rolled back successfully.
119+
* Fix: Resolved fatal error when using WP CLI bulk updates (`wp plugin update --all`) due to missing string type check. The backup service now properly handles cases where the package parameter is boolean instead of a string during bulk operations.
120+
* Fix: WordPress Multisite network admin pages now properly load rollback scripts and styles.
121+
* Fix: Resolved package validation errors on multisite installations where ZIP files were incorrectly flagged as invalid.
122+
* Fix: Fixed multisite upload size restrictions that prevented rollbacks due to the default 1MB limit.
123+
115124
= 3.0.3 =
116125
* Fix: Resolved fatal error when attempting to rollback plugins that return boolean false for requires_php field instead of a string value. This fix ensures proper type validation for WordPress requirement fields.
117126
* Fix: Plugin and theme names containing HTML entities (like &, <, etc.) now display correctly in rollback modals instead of showing raw HTML characters.
118127

119-
120128
= 3.0.2 =
121129
* Improvement: Simplified theme rollback button display functionality - all themes now display rollback buttons without checking WordPress.org availability.
122130
* Improvement: Consolidated theme rollback JavaScript handlers between free and pro versions for better code maintainability.

src/Core/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct()
2525
{
2626
parent::__construct(
2727
'wp-rollback', // Text domain
28-
'3.0.3', // Version
28+
'3.0.4', // Version
2929
'wp-rollback', // Slug
3030
'wp-rollback-nonce', // Nonce
3131
self::findPluginFile('wp-rollback', __FILE__) // Plugin file path

src/PluginSetup/PluginMeta.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ public static function addPluginRowMeta(array $pluginMeta, string $pluginFile):
6161
),
6262
esc_html__('Support', 'wp-rollback')
6363
),
64+
sprintf(
65+
'<a href="%1$s" target="_blank" style="color: #6d28d9; font-weight: bold;">%2$s</a>',
66+
esc_url(
67+
add_query_arg(
68+
[
69+
'utm_source' => 'plugins-page',
70+
'utm_medium' => 'plugin-row',
71+
'utm_campaign' => 'admin',
72+
],
73+
'https://wprollback.com/pricing/'
74+
)
75+
),
76+
esc_html__('Go Pro!', 'wp-rollback')
77+
),
6478
];
6579

6680
return array_merge($pluginMeta, $newMetaLinks);

src/PluginSetup/PluginScripts.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ public function enqueueAssets(): void
4343
{
4444
$assetsManager = SharedCore::container()->make(AssetsManager::class);
4545

46+
// Determine the correct admin URL based on context
47+
$adminUrl = is_network_admin()
48+
? network_admin_url('settings.php?page=wp-rollback')
49+
: admin_url('tools.php?page=wp-rollback');
50+
4651
$assetsManager->enqueueScript('tools', [
4752
'rollback_nonce' => wp_create_nonce('wpr_rollback_nonce'),
4853
'restApiNonce' => wp_create_nonce('wp_rest'),
49-
'adminUrl' => admin_url('tools.php?page=wp-rollback'),
54+
'adminUrl' => $adminUrl,
5055
'restUrl' => esc_url_raw(rest_url()),
5156
'rollbackSteps' => $this->getRollbackSteps(),
5257
]);

src/Rollbacks/Actions/RegisterAdminMenu.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace WpRollback\Free\Rollbacks\Actions;
1313

14-
use WpRollback\Free\Rollbacks\ToolsPage\ToolsPage;
1514
use WpRollback\SharedCore\Rollbacks\Actions\BaseRegisterAdminMenu;
1615

1716
/**
@@ -37,11 +36,4 @@ protected function getPageTitle(): string
3736
return __('WP Rollback', 'wp-rollback');
3837
}
3938

40-
/**
41-
* {@inheritdoc}
42-
*/
43-
protected function getToolsPageClass(): string
44-
{
45-
return ToolsPage::class;
46-
}
4739
}

src/Rollbacks/ServiceProvider.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use WpRollback\Free\Rollbacks\Actions\RegisterAdminMenu;
2020
use WpRollback\Free\Rollbacks\PluginRollback\Actions\AddPluginRollbackLinks;
2121
use WpRollback\Free\Rollbacks\PluginRollback\Actions\PreCurrentActivePlugins;
22+
use WpRollback\Free\Rollbacks\ThemeRollback\Actions\AddMultisiteThemeRollbackLinks;
2223
use WpRollback\Free\Rollbacks\ThemeRollback\Actions\ThemeUpgrader;
2324
use WpRollback\Free\Rollbacks\ThemeRollback\Views\ThemeRollbackButton;
2425
use WpRollback\SharedCore\Core\SharedCore;
@@ -142,6 +143,18 @@ private function addMultiSiteSupport(): void
142143
Hooks::addAction('network_admin_menu', self::class, 'registerMultisiteMenu');
143144

144145
Hooks::addFilter('network_admin_plugin_action_links', AddPluginRollbackLinks::class, '__invoke', 20, 4);
146+
147+
// Register factory for AddMultisiteThemeRollbackLinks
148+
// Note: This only applies in network admin - single sites use ThemeRollbackButton instead
149+
Hooks::registerFactory(
150+
AddMultisiteThemeRollbackLinks::class,
151+
function () {
152+
return SharedCore::container()->make(AddMultisiteThemeRollbackLinks::class);
153+
}
154+
);
155+
156+
// Add theme rollback links in network admin themes table
157+
Hooks::addFilter('theme_action_links', AddMultisiteThemeRollbackLinks::class, '__invoke', 20, 3);
145158
}
146159

147160
/**
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
/**
4+
* AddMultisiteThemeRollbackLinks
5+
*
6+
* This file extends the shared AddMultisiteThemeRollbackLinks class for the free plugin.
7+
* It uses the unified handler with appropriate configuration for the free version.
8+
* This is specifically for multisite installations.
9+
*
10+
* @package WpRollback\Free\Rollbacks\ThemeRollback\Actions
11+
* @since 3.0.0
12+
*/
13+
14+
declare(strict_types=1);
15+
16+
namespace WpRollback\Free\Rollbacks\ThemeRollback\Actions;
17+
18+
use WpRollback\SharedCore\Rollbacks\ThemeRollback\Actions\AddMultisiteThemeRollbackLinks as SharedAddMultisiteThemeRollbackLinks;
19+
use WpRollback\Free\Core\Constants;
20+
21+
/**
22+
* Class AddMultisiteThemeRollbackLinks
23+
*
24+
* @since 3.0.0
25+
*/
26+
class AddMultisiteThemeRollbackLinks extends SharedAddMultisiteThemeRollbackLinks
27+
{
28+
/**
29+
* Constructor.
30+
*
31+
* @param Constants $constants The Constants instance
32+
*/
33+
public function __construct(Constants $constants)
34+
{
35+
// Call parent constructor with plugin slug and isProVersion = false
36+
parent::__construct($constants->getSlug(), false);
37+
}
38+
}

src/Rollbacks/ThemeRollback/Views/ThemeRollbackButton.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use WpRollback\SharedCore\Core\Assets\AssetsManager;
1313
use WpRollback\SharedCore\Core\SharedCore;
14+
use WpRollback\SharedCore\Rollbacks\Traits\PluginHelpers;
1415

1516
/**
1617
* Handles theme rollback button functionality and assets.
@@ -19,6 +20,7 @@
1920
*/
2021
class ThemeRollbackButton
2122
{
23+
use PluginHelpers;
2224
/**
2325
* Register and enqueue theme rollback assets.
2426
*
@@ -32,6 +34,16 @@ public function __invoke(): void
3234
return;
3335
}
3436

37+
// Don't enqueue on network admin - themes use table view with action links there
38+
if (is_network_admin()) {
39+
return;
40+
}
41+
42+
// Don't enqueue on individual sites if plugin is network activated
43+
if ($this->isNetworkActivated()) {
44+
return;
45+
}
46+
3547
$assetsManager = SharedCore::container()->make(AssetsManager::class);
3648
$assetsManager->enqueueScript('themesAdmin', [], false);
3749
}

wp-rollback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Description: Rollback (or forward) any WordPress.org plugin, theme or block like a boss.
77
* Author: WP Rollback
88
* Author URI: https://wprollback.com/
9-
* Version: 3.0.3
9+
* Version: 3.0.4
1010
* Text Domain: wp-rollback
1111
* Domain Path: /languages
1212
*

0 commit comments

Comments
 (0)