diff --git a/apple-news.php b/apple-news.php index b5bb3643f..d9a029d71 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 8b1378917..000000000 --- a/lang/apple-export.pot +++ /dev/null @@ -1 +0,0 @@ - diff --git a/readme.txt b/readme.txt index f989baa28..39b285063 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 36c29b6a7..d76127b34 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'] ); } }