Skip to content

Commit

Permalink
Fix missing migration for v4.7.0 (#1161)
Browse files Browse the repository at this point in the history
* Fix missing migration

* update tests
  • Loading branch information
pfefferle authored Jan 14, 2025
1 parent 05536d0 commit b73041b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.7.1] - 2025-01-14

### Fixed

* Missing migration

## [4.7.0] - 2025-01-13

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

* initial

[Unreleased]: https://github.com/Automattic/wordpress-activitypub/compare/4.7.0...trunk
[Unreleased]: https://github.com/Automattic/wordpress-activitypub/compare/4.7.1...trunk
<!-- Add new release below and update "Unreleased" link -->
[4.7.1]: https://github.com/Automattic/wordpress-activitypub/compare/4.7.0...4.7.1
[4.7.0]: https://github.com/Automattic/wordpress-activitypub/compare/4.6.0...4.7.0
[4.6.0]: https://github.com/Automattic/wordpress-activitypub/compare/4.5.1...4.6.0
[4.5.1]: https://github.com/Automattic/wordpress-activitypub/compare/4.5.0...4.5.1
Expand Down
4 changes: 2 additions & 2 deletions activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ActivityPub
* Plugin URI: https://github.com/Automattic/wordpress-activitypub
* Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.
* Version: 4.7.0
* Version: 4.7.1
* Author: Matthias Pfefferle & Automattic
* Author URI: https://automattic.com/
* License: MIT
Expand All @@ -19,7 +19,7 @@

use WP_CLI;

\define( 'ACTIVITYPUB_PLUGIN_VERSION', '4.7.0' );
\define( 'ACTIVITYPUB_PLUGIN_VERSION', '4.7.1' );

// Plugin related constants.
\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Expand Down
6 changes: 3 additions & 3 deletions includes/class-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ public static function maybe_migrate() {
if ( \version_compare( $version_from_db, '4.5.0', '<' ) ) {
\wp_schedule_single_event( \time() + MINUTE_IN_SECONDS, 'activitypub_update_comment_counts' );
}
if ( \version_compare( $version_from_db, '4.6.0', '<' ) ) {
self::migrate_to_4_6_0();
if ( \version_compare( $version_from_db, '4.7.1', '<' ) ) {
self::migrate_to_4_7_1();
}

/**
Expand Down Expand Up @@ -393,7 +393,7 @@ public static function migrate_to_4_1_0() {
/**
* Updates post meta keys to be prefixed with an underscore.
*/
public static function migrate_to_4_6_0() {
public static function migrate_to_4_7_1() {
global $wpdb;

$meta_keys = array(
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: automattic, pfefferle, mattwiebe, obenland, akirk, jeherve, mediaf
Tags: OStatus, fediverse, activitypub, activitystream
Requires at least: 5.5
Tested up to: 6.7
Stable tag: 4.7.0
Stable tag: 4.7.1
Requires PHP: 7.2
License: MIT
License URI: http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -132,6 +132,10 @@ For reasons of data protection, it is not possible to see the followers of other

== Changelog ==

= 4.7.1 =

* Fixed: Missing migration

= 4.7.0 =

* Added: Comment counts get updated when the plugin is activated/deactivated/deleted
Expand Down
8 changes: 4 additions & 4 deletions tests/includes/class-test-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ public function test_migrate_to_4_1_0() {
}

/**
* Test migrate to 4.6.0.
* Test migrate to 4.7.1.
*
* @covers ::migrate_to_4_6_0
* @covers ::migrate_to_4_7_1
*/
public function test_migrate_to_4_6_0() {
public function test_migrate_to_4_7_1() {
$post1 = \wp_insert_post(
array(
'post_author' => 1,
Expand Down Expand Up @@ -222,7 +222,7 @@ public function test_migrate_to_4_6_0() {
}

// Run migration.
Migration::migrate_to_4_6_0();
Migration::migrate_to_4_7_1();

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

0 comments on commit b73041b

Please sign in to comment.