From 3e539d2fdaf254105e51bcc0c289fd5aa49d4949 Mon Sep 17 00:00:00 2001 From: Scott Nelle Date: Wed, 27 Nov 2024 14:04:11 -0500 Subject: [PATCH 01/11] clarify that the bulk publish action can also be used to update settings --- admin/class-admin-apple-news-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/class-admin-apple-news-list-table.php b/admin/class-admin-apple-news-list-table.php index 676c878f..b73c0bd8 100644 --- a/admin/class-admin-apple-news-list-table.php +++ b/admin/class-admin-apple-news-list-table.php @@ -328,7 +328,7 @@ public function get_bulk_actions() { return apply_filters( 'apple_news_bulk_actions', [ - Admin_Apple_Index_Page::namespace_action( 'push' ) => __( 'Publish', 'apple-news' ), + Admin_Apple_Index_Page::namespace_action( 'push' ) => __( 'Publish/Update', 'apple-news' ), ] ); } From 5468f9afae03831cb6593919a2942f6c392cd37a Mon Sep 17 00:00:00 2001 From: Scott Nelle Date: Wed, 27 Nov 2024 14:04:50 -0500 Subject: [PATCH 02/11] clarify comment about how the plugin determines whether an article has changed since the last push --- admin/apple-actions/index/class-push.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/apple-actions/index/class-push.php b/admin/apple-actions/index/class-push.php index 6bed4414..9fa1d71c 100644 --- a/admin/apple-actions/index/class-push.php +++ b/admin/apple-actions/index/class-push.php @@ -169,9 +169,9 @@ private function is_post_in_sync( $json, $meta = [], $bundles = [] ) { /** * Allows for custom logic to determine if a post is in sync or not. * - * By default, the plugin simply compares the last modified time to the - * last time it was pushed to Apple News. If you want to apply custom - * logic, you can do that by modifying `$in_sync`. The most common use case + * By default, the plugin compares the checksum that is generated in this class + * with the checksum stored last time it was pushed to Apple News. If you want to apply + * custom logic, you can do that by modifying `$in_sync`. The most common use case * is to not update posts based on custom criteria. * * @param bool $in_sync Whether the current post is in sync or not. From 296766d3900193a0c3f77b5366020e755f0ecc58 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Sat, 7 Dec 2024 09:57:27 -0300 Subject: [PATCH 03/11] WIP: issue-1208 From 2de39cd4a0d975fa6b2627ef502336c90153d7e1 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:54:34 -0300 Subject: [PATCH 04/11] Address i18n issues with WordPress 6.7 --- apple-news.php | 37 +++++++++------------------------ includes/class-apple-news.php | 34 +++++++++++++++++------------- lang/apple-export.pot | 1 - readme.txt | 10 ++++++++- tests/test-class-apple-news.php | 2 +- 5 files changed, 40 insertions(+), 44 deletions(-) delete mode 100644 lang/apple-export.pot diff --git a/apple-news.php b/apple-news.php index b5bb3643..d9a029d7 100644 --- a/apple-news.php +++ b/apple-news.php @@ -1,24 +1,16 @@ =' ) ) { + $current_version = get_option( 'apple_news_version', '' ); + if ( is_string( $current_version ) && version_compare( $current_version, self::$version, '>=' ) ) { return; } // Determine if this is a clean install (no settings set yet). $settings = get_option( self::$option_name ); - if ( ! empty( $settings ) ) { + if ( ! empty( $settings ) && is_string( $current_version ) ) { // Handle upgrade to version 1.3.0. if ( version_compare( $current_version, '1.3.0', '<' ) ) { @@ -517,8 +520,6 @@ public function action_plugins_loaded(): void { /** * Create the default themes, if they do not exist. - * - * @access public */ public function create_default_theme(): void { @@ -529,9 +530,14 @@ public function create_default_theme(): void { } // Build the theme formatting settings from the base settings array. - $theme = new Theme(); - $options = Theme::get_options(); - $wp_settings = get_option( self::$option_name, [] ); + $theme = new Theme(); + $options = Theme::get_options(); + $wp_settings = get_option( self::$option_name, [] ); + + if ( ! is_array( $wp_settings ) ) { + $wp_settings = []; + } + $theme_settings = []; foreach ( array_keys( $options ) as $option_key ) { if ( isset( $wp_settings[ $option_key ] ) ) { diff --git a/lang/apple-export.pot b/lang/apple-export.pot deleted file mode 100644 index 8b137891..00000000 --- a/lang/apple-export.pot +++ /dev/null @@ -1 +0,0 @@ - diff --git a/readme.txt b/readme.txt index f989baa2..39b28506 100644 --- a/readme.txt +++ b/readme.txt @@ -45,6 +45,14 @@ Please visit our [wiki](https://github.com/alleyinteractive/apple-news/wiki) for == Changelog == += 2.6.2 = + +* Enhancement: i18n - Remove `load_plugin_textdomain`. Since WordPress 4.6, plugins no longer need to load their own textdomain. +* Enhancement: i18n - Moved some plugin initialization code to the `init` action hook. +* Bugfix: i18n - Fixed the `_load_textdomain_just_in_time` error with WordPress 6.7. +* Bugfix: Update plugin name in plugin header. +* Enhancement: Add license to plugin header. + = 2.6.1 = * Enhancement: Ensured support for WordPress 6.7. @@ -90,4 +98,4 @@ Information on previous releases can be found on the plugin's [GitHub Releases p == Developers == -Please visit us on [github](https://github.com/alleyinteractive/apple-news) to [submit issues](https://github.com/alleyinteractive/apple-news/issues), [pull requests](https://github.com/alleyinteractive/apple-news/pulls) or [read our wiki page about contributing](https://github.com/alleyinteractive/apple-news/wiki/contributing). +Please visit us on [GitHub](https://github.com/alleyinteractive/apple-news) to [submit issues](https://github.com/alleyinteractive/apple-news/issues), [pull requests](https://github.com/alleyinteractive/apple-news/pulls) or [read our wiki page about contributing](https://github.com/alleyinteractive/apple-news/wiki/contributing). diff --git a/tests/test-class-apple-news.php b/tests/test-class-apple-news.php index 36c29b6a..d76127b3 100644 --- a/tests/test-class-apple-news.php +++ b/tests/test-class-apple-news.php @@ -358,7 +358,7 @@ public function test_upgrade_to_2_5_0(): void { * @see Apple_News::$version */ public function test_version() { - $plugin_data = apple_news_get_plugin_data(); + $plugin_data = apple_news_get_plugin_data( translate: false ); $this->assertEquals( Apple_News::$version, $plugin_data['Version'] ); } } From 2f623345046f5a46bf9cc6f9574437d5da288023 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:55:27 -0300 Subject: [PATCH 05/11] Ready for review From af6c39f310f55509d2b2f331757d0a73a3e46f9e Mon Sep 17 00:00:00 2001 From: Scott Nelle Date: Tue, 10 Dec 2024 17:52:27 -0500 Subject: [PATCH 06/11] for articles with existing apple news ids display update instead of publish --- admin/class-admin-apple-news-list-table.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/class-admin-apple-news-list-table.php b/admin/class-admin-apple-news-list-table.php index b73c0bd8..50345a28 100644 --- a/admin/class-admin-apple-news-list-table.php +++ b/admin/class-admin-apple-news-list-table.php @@ -172,6 +172,8 @@ public function column_title( $item ) { return; } + $apple_news_api_id = get_post_meta( $item->ID, 'apple_news_api_id', true ); + // Build the base URL. $base_url = add_query_arg( [ @@ -202,7 +204,7 @@ public function column_title( $item ) { $actions['push'] = sprintf( "%s", esc_url( Admin_Apple_Index_Page::action_query_params( 'push', $base_url ) ), - esc_html__( 'Publish', 'apple-news' ) + $apple_news_api_id ? esc_html__( 'Update', 'apple-news' ) : esc_html__( 'Publish', 'apple-news' ) ); } @@ -216,7 +218,7 @@ public function column_title( $item ) { } // Add the delete action, if required. - if ( get_post_meta( $item->ID, 'apple_news_api_id', true ) ) { + if ( $apple_news_api_id ) { $actions['delete'] = sprintf( "%s", esc_html__( 'Delete from Apple News', 'apple-news' ), From 42a7515b9e54dd8afbcc60ff6f4465a069ec8ad1 Mon Sep 17 00:00:00 2001 From: Scott Nelle Date: Tue, 10 Dec 2024 17:53:57 -0500 Subject: [PATCH 07/11] clarify language on bulk export page --- admin/partials/page-bulk-export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/partials/page-bulk-export.php b/admin/partials/page-bulk-export.php index de923e5d..df124637 100644 --- a/admin/partials/page-bulk-export.php +++ b/admin/partials/page-bulk-export.php @@ -12,7 +12,7 @@ ?>

-

+

Date: Tue, 10 Dec 2024 17:56:34 -0500 Subject: [PATCH 08/11] update bulk export page heading --- admin/partials/page-bulk-export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/partials/page-bulk-export.php b/admin/partials/page-bulk-export.php index df124637..790ca252 100644 --- a/admin/partials/page-bulk-export.php +++ b/admin/partials/page-bulk-export.php @@ -11,7 +11,7 @@ ?>
-

+

Date: Mon, 27 Jan 2025 23:28:36 -0300 Subject: [PATCH 09/11] Bump version to 2.6.2 --- .github/workflows/phpunit.yml | 2 +- apple-news.php | 2 +- package.json | 2 +- readme.txt | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 1491b213..edb4c5f2 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: multisite: [true, false] - php: ['8.3', '8.2', '8.1', '8.0'] + php: ['8.4', 8.3', '8.2', '8.1', '8.0'] wordpress: ["latest"] include: - php: '8.0' diff --git a/apple-news.php b/apple-news.php index d9a029d7..e93a5ad2 100644 --- a/apple-news.php +++ b/apple-news.php @@ -3,7 +3,7 @@ * Plugin Name: Publish To Apple News * Plugin URI: http://github.com/alleyinteractive/apple-news * Description: Export and sync posts to Apple format. - * Version: 2.6.1 + * Version: 2.6.2 * Author: Alley * Author URI: https://alley.com * Text Domain: apple-news diff --git a/package.json b/package.json index 2601af05..266a627f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "publish-to-apple-news", - "version": "2.5.1", + "version": "2.6.2", "license": "GPLv3", "main": "index.php", "engines": { diff --git a/readme.txt b/readme.txt index 39b28506..548c1dac 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: publish, apple, news, iOS Requires at least: 6.3 Tested up to: 6.7 Requires PHP: 8.0 -Stable tag: 2.6.1 +Stable tag: 2.6.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl.html @@ -60,6 +60,7 @@ Please visit our [wiki](https://github.com/alleyinteractive/apple-news/wiki) for = 2.6.0 = * Enhancement: Support added for PHP 8.3. +* Enhancement: CI: PHP 8.4 added to the matrix. * Enhancement: Support added for handling deleted articles (in iCloud News Publisher). * Enhancement: Add a new hook, `apple_news_after_push_failure`, that fires when a post fails to be pushed to Apple News. * Enhancement: Debugging Settings: support added for sending notification to multiple email accounts. From c994759f5e142f7b5558dfc5e063c95ed1372049 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Mon, 27 Jan 2025 23:32:08 -0300 Subject: [PATCH 10/11] Missed one spot --- includes/class-apple-news.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-apple-news.php b/includes/class-apple-news.php index 22aaeb46..9aa688cd 100644 --- a/includes/class-apple-news.php +++ b/includes/class-apple-news.php @@ -50,7 +50,7 @@ class Apple_News { * @var string * @access public */ - public static string $version = '2.6.1'; + public static string $version = '2.6.2'; /** * Link to support for the plugin on WordPress.org. From 69d5ec71b58a6557fb6bef25b4056f4b73ac30cb Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:50:37 -0300 Subject: [PATCH 11/11] Revert php 8.4 change --- .github/workflows/phpunit.yml | 2 +- readme.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index edb4c5f2..1491b213 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: multisite: [true, false] - php: ['8.4', 8.3', '8.2', '8.1', '8.0'] + php: ['8.3', '8.2', '8.1', '8.0'] wordpress: ["latest"] include: - php: '8.0' diff --git a/readme.txt b/readme.txt index 548c1dac..46d0c548 100644 --- a/readme.txt +++ b/readme.txt @@ -60,7 +60,6 @@ Please visit our [wiki](https://github.com/alleyinteractive/apple-news/wiki) for = 2.6.0 = * Enhancement: Support added for PHP 8.3. -* Enhancement: CI: PHP 8.4 added to the matrix. * Enhancement: Support added for handling deleted articles (in iCloud News Publisher). * Enhancement: Add a new hook, `apple_news_after_push_failure`, that fires when a post fails to be pushed to Apple News. * Enhancement: Debugging Settings: support added for sending notification to multiple email accounts.