Skip to content

Commit b73041b

Browse files
authored
Fix missing migration for v4.7.0 (#1161)
* Fix missing migration * update tests
1 parent 05536d0 commit b73041b

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.7.1] - 2025-01-14
9+
10+
### Fixed
11+
12+
* Missing migration
13+
814
## [4.7.0] - 2025-01-13
915

1016
### Added
@@ -1200,8 +1206,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12001206

12011207
* initial
12021208

1203-
[Unreleased]: https://github.com/Automattic/wordpress-activitypub/compare/4.7.0...trunk
1209+
[Unreleased]: https://github.com/Automattic/wordpress-activitypub/compare/4.7.1...trunk
12041210
<!-- Add new release below and update "Unreleased" link -->
1211+
[4.7.1]: https://github.com/Automattic/wordpress-activitypub/compare/4.7.0...4.7.1
12051212
[4.7.0]: https://github.com/Automattic/wordpress-activitypub/compare/4.6.0...4.7.0
12061213
[4.6.0]: https://github.com/Automattic/wordpress-activitypub/compare/4.5.1...4.6.0
12071214
[4.5.1]: https://github.com/Automattic/wordpress-activitypub/compare/4.5.0...4.5.1

activitypub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: ActivityPub
44
* Plugin URI: https://github.com/Automattic/wordpress-activitypub
55
* Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.
6-
* Version: 4.7.0
6+
* Version: 4.7.1
77
* Author: Matthias Pfefferle & Automattic
88
* Author URI: https://automattic.com/
99
* License: MIT
@@ -19,7 +19,7 @@
1919

2020
use WP_CLI;
2121

22-
\define( 'ACTIVITYPUB_PLUGIN_VERSION', '4.7.0' );
22+
\define( 'ACTIVITYPUB_PLUGIN_VERSION', '4.7.1' );
2323

2424
// Plugin related constants.
2525
\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );

includes/class-migration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ public static function maybe_migrate() {
161161
if ( \version_compare( $version_from_db, '4.5.0', '<' ) ) {
162162
\wp_schedule_single_event( \time() + MINUTE_IN_SECONDS, 'activitypub_update_comment_counts' );
163163
}
164-
if ( \version_compare( $version_from_db, '4.6.0', '<' ) ) {
165-
self::migrate_to_4_6_0();
164+
if ( \version_compare( $version_from_db, '4.7.1', '<' ) ) {
165+
self::migrate_to_4_7_1();
166166
}
167167

168168
/**
@@ -393,7 +393,7 @@ public static function migrate_to_4_1_0() {
393393
/**
394394
* Updates post meta keys to be prefixed with an underscore.
395395
*/
396-
public static function migrate_to_4_6_0() {
396+
public static function migrate_to_4_7_1() {
397397
global $wpdb;
398398

399399
$meta_keys = array(

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: automattic, pfefferle, mattwiebe, obenland, akirk, jeherve, mediaf
33
Tags: OStatus, fediverse, activitypub, activitystream
44
Requires at least: 5.5
55
Tested up to: 6.7
6-
Stable tag: 4.7.0
6+
Stable tag: 4.7.1
77
Requires PHP: 7.2
88
License: MIT
99
License URI: http://opensource.org/licenses/MIT
@@ -132,6 +132,10 @@ For reasons of data protection, it is not possible to see the followers of other
132132

133133
== Changelog ==
134134

135+
= 4.7.1 =
136+
137+
* Fixed: Missing migration
138+
135139
= 4.7.0 =
136140

137141
* Added: Comment counts get updated when the plugin is activated/deactivated/deleted

tests/includes/class-test-migration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ public function test_migrate_to_4_1_0() {
187187
}
188188

189189
/**
190-
* Test migrate to 4.6.0.
190+
* Test migrate to 4.7.1.
191191
*
192-
* @covers ::migrate_to_4_6_0
192+
* @covers ::migrate_to_4_7_1
193193
*/
194-
public function test_migrate_to_4_6_0() {
194+
public function test_migrate_to_4_7_1() {
195195
$post1 = \wp_insert_post(
196196
array(
197197
'post_author' => 1,
@@ -222,7 +222,7 @@ public function test_migrate_to_4_6_0() {
222222
}
223223

224224
// Run migration.
225-
Migration::migrate_to_4_6_0();
225+
Migration::migrate_to_4_7_1();
226226

227227
// Clean post cache to ensure fresh meta data.
228228
\clean_post_cache( $post1 );

0 commit comments

Comments
 (0)