Skip to content

Commit 53219e5

Browse files
Release free-v3.0.2
1 parent 6600ef7 commit 53219e5

File tree

8 files changed

+21
-283
lines changed

8 files changed

+21
-283
lines changed

readme.txt

Lines changed: 10 additions & 1 deletion
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.1
8+
Stable tag: 3.0.2
99
License: GPLv3
1010
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1111

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

113113
== Changelog ==
114114

115+
= 3.0.2 =
116+
* Improvement: Simplified theme rollback button display functionality - all themes now display rollback buttons without checking WordPress.org availability.
117+
* Improvement: Consolidated theme rollback JavaScript handlers between free and pro versions for better code maintainability.
118+
* Improvement: Removed visual distinction between WordPress.org and premium plugin rollback links for a more consistent UI.
119+
* Fix: Resolved fatal error on themes.php page caused by incorrect namespace references.
120+
121+
= 3.0.1 =
122+
* Fix: Resolved an error with JetPack Sync and potentially other plugins that modify plugin data and return null.
123+
115124
= 3.0.0 =
116125
* New: Added additional "WP Rollback" menu item under WP-Admin > Tools.
117126
* New: Added new "Plugin" and "Themes" list views to select a rollback more easily.

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.1', // Version
28+
'3.0.2', // Version
2929
'wp-rollback', // Slug
3030
'wp-rollback-nonce', // Nonce
3131
self::findPluginFile('wp-rollback', __FILE__) // Plugin file path

src/Rollbacks/MultisiteSupport.php

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* Multisite support.
45
* @package WpRollback\Free\Rollbacks
56
* @since 3.0.0
67
*/
@@ -9,10 +10,6 @@
910

1011
namespace WpRollback\Free\Rollbacks;
1112

12-
use WP_Theme;
13-
use WpRollback\Free\Core\Exceptions\BindingResolutionException;
14-
use WpRollback\Free\Rollbacks\ThemeRollback\Actions\UpdateThemeList;
15-
1613
use WpRollback\SharedCore\Core\Helpers\ContainerHelper;
1714

1815
/**
@@ -21,41 +18,14 @@
2118
class MultisiteSupport
2219
{
2320
/**
24-
* Multisite: Theme Action Links
25-
*
26-
* Adds a "rollback" link/button to the theme listing page w/ appropriate query strings for multisite installations.
27-
*
28-
* @return array $actions
29-
* @throws BindingResolutionException
21+
* @since 3.0.0
3022
*/
31-
public function addThemeLink(array $actions, WP_Theme $theme): array
23+
public static function syncUpdateRollbackData(): void
3224
{
33-
$rollbackThemes = get_site_transient('rollback_themes');
34-
if (! is_object($rollbackThemes)) {
35-
$updateThemeList = ContainerHelper::container()->make(UpdateThemeList::class);
36-
$updateThemeList();
37-
$rollbackThemes = get_site_transient('rollback_themes');
38-
}
39-
40-
$themeSlug = $theme->get_template();
41-
42-
// Only WP.org themes.
43-
if (empty($themeSlug) || ! array_key_exists($themeSlug, $rollbackThemes->response)) {
44-
return $actions;
25+
if (is_main_site()) {
26+
// Sync plugin update data
27+
$updatePlugins = ContainerHelper::container()->make(PluginRollback::class);
28+
$updatePlugins();
4529
}
46-
47-
$rollbackURL = "settings.php?page=wp-rollback#/rollback/theme/{$themeSlug}";
48-
49-
// Final Output
50-
$actions['rollback'] = apply_filters(
51-
'wpr_theme_markup',
52-
sprintf(
53-
'<a href="%1$s">%2$s</a>',
54-
esc_url($rollbackURL),
55-
__('Rollback', 'wp-rollback')
56-
)
57-
);
58-
59-
return apply_filters('wpr_theme_action_links', $actions);
6030
}
6131
}

src/Rollbacks/ServiceProvider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +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\PrepareThemeJS;
23-
use WpRollback\Free\Rollbacks\ThemeRollback\Actions\UpdateThemeList;
24-
use WpRollback\Free\Rollbacks\ThemeRollback\Controllers\TypeConfirmationController;
22+
use WpRollback\Free\Rollbacks\ThemeRollback\Actions\ThemeUpgrader;
2523
use WpRollback\Free\Rollbacks\ThemeRollback\Views\ThemeRollbackButton;
2624
use WpRollback\SharedCore\Core\SharedCore;
2725
use WpRollback\Free\Core\Constants;
@@ -130,9 +128,7 @@ function () {
130128
*/
131129
private function bootThemeRollback(): void
132130
{
133-
Hooks::addAction('set_site_transient_update_themes', UpdateThemeList::class);
134-
Hooks::addFilter('wp_prepare_themes_for_js', PrepareThemeJS::class);
135-
Hooks::addAction('wp_ajax_is_wordpress_theme', TypeConfirmationController::class);
131+
// Theme rollback.
136132
Hooks::addAction('admin_enqueue_scripts', ThemeRollbackButton::class);
137133
}
138134

@@ -142,8 +138,6 @@ private function bootThemeRollback(): void
142138
*/
143139
private function addMultiSiteSupport(): void
144140
{
145-
Hooks::addFilter('theme_action_links', MultisiteSupport::class, 'addThemeLink', 20, 2);
146-
147141
// For multisite support
148142
Hooks::addAction('network_admin_menu', self::class, 'registerMultisiteMenu');
149143

src/Rollbacks/ThemeRollback/Actions/PrepareThemeJS.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/Rollbacks/ThemeRollback/Actions/UpdateThemeList.php

Lines changed: 0 additions & 125 deletions
This file was deleted.

src/Rollbacks/ThemeRollback/Controllers/TypeConfirmationController.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

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.1
9+
* Version: 3.0.2
1010
* Text Domain: wp-rollback
1111
* Domain Path: /languages
1212
*

0 commit comments

Comments
 (0)