Skip to content

Commit d18bb7e

Browse files
committed
Merge branch 'develop' of github.com:10up/classifai into enhancement/728
2 parents 149c2c8 + 40561ba commit d18bb7e

9 files changed

+24
-12
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file, per [the Ke
44

55
## [Unreleased] - TBD
66

7+
## [3.0.1] - 2024-03-07
8+
### Fixed
9+
- Ensure we only pass in array data to our `merge_settings` method (props [@dkotter](https://github.com/dkotter), [@ajaxthemestudios](https://github.com/ajaxthemestudios), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#733](https://github.com/10up/classifai/pull/733)).
10+
- Handle scenario where non-array data is passed into our descriptive text generator feature (props [@dkotter](https://github.com/dkotter), [@ajaxthemestudios](https://github.com/ajaxthemestudios), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#733](https://github.com/10up/classifai/pull/733)).
11+
- Address a fatal error that occurs if `composer install` hasn't been run (props [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#740](https://github.com/10up/classifai/pull/740)).
12+
- Ensure we properly account for `null` values when merging our saved settings with our default settings (props [@dkotter](https://github.com/dkotter), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#741](https://github.com/10up/classifai/pull/741)).
13+
714
## [3.0.0] - 2024-02-29
815
**Note that this is a major release of ClassifAI that restructures most of the codebase and will have some breaking changes. If you're extending ClassifAI in any way, please ensure you fully test those integrations prior to running this update on production. For more details on what is changing, see the [migration guide](https://10up.github.io/classifai/tutorial-migration-guide-v2-to-v3.html).**
916

@@ -544,6 +551,7 @@ All notable changes to this project will be documented in this file, per [the Ke
544551
- Initial closed source release
545552

546553
[Unreleased]: https://github.com/10up/classifai/compare/trunk...develop
554+
[3.0.1]: https://github.com/10up/classifai/compare/3.0.0...3.0.1
547555
[3.0.0]: https://github.com/10up/classifai/compare/2.5.1...3.0.0
548556
[2.5.1]: https://github.com/10up/classifai/compare/2.5.0...2.5.1
549557
[2.5.0]: https://github.com/10up/classifai/compare/2.4.0...2.5.0

CREDITS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo
1010

1111
Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.
1212

13-
[Darshan Sawardekar (@dsawardekar)](https://github.com/dsawardekar), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Christian Chung (@christianc1)](https://github.com/christianc1), [Dependabot (@dependabot)](https://github.com/dependabot), [Dillon McCallum (@McCallumDillon)](https://github.com/McCallumDillon), [Dustin Rue (@dustinrue)](https://github.com/dustinrue), [Jay Wood (@JayWood)](https://github.com/JayWood), [John Watkins (@johnwatkins0)](https://github.com/johnwatkins0), [Matthew McAchran (@mmcachran)](https://github.com/mmcachran), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Darío Hereñú (@kant)](https://github.com/kant), [Aaron Jorbin (@aaronjorbin)](https://github.com/aaronjorbin), [Eduard Florea (@eflorea)](https://github.com/eflorea), [Jackie Kjome (@JackieKjome)](https://github.com/JackieKjome), [Ricky Lee Whittemore (@rickalee)](https://github.com/rickalee), [Ritesh Patel (@Ritesh-patel)](https://github.com/Ritesh-patel), [Dana Ross (@dana-ross)](https://github.com/dana-ross), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Pete Nelson (@petenelson)](https://github.com/petenelson), [Connor Smyth (@ActuallyConnor)](https://github.com/ActuallyConnor), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Shah Qureshi (@ShahAaron)](https://github.com/ShahAaron), [Barry Ceelen (@barryceelen)](https://github.com/barryceelen), [Jeffrey Carandang (@phpbits)](https://github.com/phpbits), [Thrijith Thankachan (@thrijith)](https://github.com/thrijith), [Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura), [Blanca Hong [@blancahong]](https://profiles.wordpress.org/blancahong/), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [@myBCN](https://github.com/myBCN), [James Morrison (@jamesmorrison)](https://github.com/jamesmorrison), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Sérgio Santos (@s3rgiosan)](https://github.com/s3rgiosan), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Delfina Hoxha](https://www.linkedin.com/in/delfina-hoxha/), [Ajay Maurya (@ajmaurya99)](https://github.com/ajmaurya99), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Mustafa Uysal (@mustafauysal)](https://github.com/mustafauysal), [Max Lyuchin (@cadic)](https://github.com/cadic), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Joe McGill (@joemcgill)](https://github.com/joemcgill), [Tyler Bailey (@TylerB24890)](https://github.com/TylerB24890), [Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor), [Ivan Ivanić (@Spoygg)](https://github.com/Spoygg), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Garth Gutenberg (@ggutenberg)](https://github.com/ggutenberg), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Julian Weiland (@derweili)](https://github.com/derweili), [Anton Vanyukov (@av3nger)](https://github.com/av3nger), [Ben Keith (@benlk)](https://github.com/benlk), [David Hechler (@pixeldevsio)](https://github.com/pixeldevsio), [Joshua Abenazer (@joshuaabenazer)](https://github.com/joshuaabenazer), [Dominik Schilling (@ocean90)](https://github.com/ocean90), [Björn Holine (@bjorn2404)](https://github.com/bjorn2404), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis), [Dan Berko (@berkod)](https://github.com/berkod), [Luca Ricci (@theskinnyghost)](https://github.com/theskinnyghost), [Parikshit Adhikari (@parikshit-adhikari)](https://github.com/parikshit-adhikari), [Surav Shrestha (@shresthasurav)](https://github.com/shresthasurav), [Tim Schwartz (@timatron)](https://github.com/timatron), [Ankit Gupta (@ankitguptaindia)](https://github.com/ankitguptaindia), [Kirtan Gajjar (@kirtangajjar)](https://github.com/kirtangajjar), [Shazahan Kabir Saju (@sksaju)](https://github.com/sksaju), [Giorgos Sarigiannidis (@gsarig)](https://github.com/gsarig), [Harshal Kadu (@QAharshalkadu)](https://github.com/QAharshalkadu), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya).
13+
[Darshan Sawardekar (@dsawardekar)](https://github.com/dsawardekar), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Christian Chung (@christianc1)](https://github.com/christianc1), [Dependabot (@dependabot)](https://github.com/dependabot), [Dillon McCallum (@McCallumDillon)](https://github.com/McCallumDillon), [Dustin Rue (@dustinrue)](https://github.com/dustinrue), [Jay Wood (@JayWood)](https://github.com/JayWood), [John Watkins (@johnwatkins0)](https://github.com/johnwatkins0), [Matthew McAchran (@mmcachran)](https://github.com/mmcachran), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Darío Hereñú (@kant)](https://github.com/kant), [Aaron Jorbin (@aaronjorbin)](https://github.com/aaronjorbin), [Eduard Florea (@eflorea)](https://github.com/eflorea), [Jackie Kjome (@JackieKjome)](https://github.com/JackieKjome), [Ricky Lee Whittemore (@rickalee)](https://github.com/rickalee), [Ritesh Patel (@Ritesh-patel)](https://github.com/Ritesh-patel), [Dana Ross (@dana-ross)](https://github.com/dana-ross), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Pete Nelson (@petenelson)](https://github.com/petenelson), [Connor Smyth (@ActuallyConnor)](https://github.com/ActuallyConnor), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Shah Qureshi (@ShahAaron)](https://github.com/ShahAaron), [Barry Ceelen (@barryceelen)](https://github.com/barryceelen), [Jeffrey Carandang (@phpbits)](https://github.com/phpbits), [Thrijith Thankachan (@thrijith)](https://github.com/thrijith), [Junaid Bhura (@junaidbhura)](https://github.com/junaidbhura), [Blanca Hong [@blancahong]](https://profiles.wordpress.org/blancahong/), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [@myBCN](https://github.com/myBCN), [James Morrison (@jamesmorrison)](https://github.com/jamesmorrison), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [Sérgio Santos (@s3rgiosan)](https://github.com/s3rgiosan), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Delfina Hoxha](https://www.linkedin.com/in/delfina-hoxha/), [Ajay Maurya (@ajmaurya99)](https://github.com/ajmaurya99), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Mustafa Uysal (@mustafauysal)](https://github.com/mustafauysal), [Max Lyuchin (@cadic)](https://github.com/cadic), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Joe McGill (@joemcgill)](https://github.com/joemcgill), [Tyler Bailey (@TylerB24890)](https://github.com/TylerB24890), [Viktor Szépe (@szepeviktor)](https://github.com/szepeviktor), [Ivan Ivanić (@Spoygg)](https://github.com/Spoygg), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Garth Gutenberg (@ggutenberg)](https://github.com/ggutenberg), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Julian Weiland (@derweili)](https://github.com/derweili), [Anton Vanyukov (@av3nger)](https://github.com/av3nger), [Ben Keith (@benlk)](https://github.com/benlk), [David Hechler (@pixeldevsio)](https://github.com/pixeldevsio), [Joshua Abenazer (@joshuaabenazer)](https://github.com/joshuaabenazer), [Dominik Schilling (@ocean90)](https://github.com/ocean90), [Björn Holine (@bjorn2404)](https://github.com/bjorn2404), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis), [Dan Berko (@berkod)](https://github.com/berkod), [Luca Ricci (@theskinnyghost)](https://github.com/theskinnyghost), [Parikshit Adhikari (@parikshit-adhikari)](https://github.com/parikshit-adhikari), [Surav Shrestha (@shresthasurav)](https://github.com/shresthasurav), [Tim Schwartz (@timatron)](https://github.com/timatron), [Ankit Gupta (@ankitguptaindia)](https://github.com/ankitguptaindia), [Kirtan Gajjar (@kirtangajjar)](https://github.com/kirtangajjar), [Shazahan Kabir Saju (@sksaju)](https://github.com/sksaju), [Giorgos Sarigiannidis (@gsarig)](https://github.com/gsarig), [Harshal Kadu (@QAharshalkadu)](https://github.com/QAharshalkadu), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [ajaxthemestudios (@ajaxthemestudios)](https://github.com/ajaxthemestudios).
1414

1515
## Libraries
1616

classifai.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function classifai_autoload() {
8888
return true;
8989
} else {
9090
error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
91-
sprintf( esc_html__( 'Fatal Error: Composer not setup in %', 'classifai' ), CLASSIFAI_PLUGIN_DIR )
91+
sprintf( 'Warning: Composer not setup in %s', CLASSIFAI_PLUGIN_DIR )
9292
);
9393

9494
return false;

config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Global Constants.
44
*/
55

6-
$plugin_version = '3.0.0';
6+
$plugin_version = '3.0.1';
77

88
// Useful global constants
99
classifai_define( 'CLASSIFAI_PLUGIN', __DIR__ . '/classifai.php' );

includes/Classifai/Features/DescriptiveTextGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function get_alt_text_settings(): array {
313313

314314
if ( ! is_array( $settings['descriptive_text_fields'] ) ) {
315315
return array(
316-
'alt' => 'no' === $settings['descriptive_text_fields']['caption'] ? 0 : 'alt',
316+
'alt' => 'no' === $settings['descriptive_text_fields'] ? 0 : 'alt',
317317
'caption' => 0,
318318
'description' => 0,
319319
);

includes/Classifai/Features/Feature.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ public function get_option_name(): string {
311311
* Returns the settings for the feature.
312312
*
313313
* @param string $index The index of the setting to return.
314-
* @return array|string
314+
* @return array|mixed
315315
*/
316316
public function get_settings( $index = false ) {
317317
$defaults = $this->get_default_settings();
318318
$settings = get_option( $this->get_option_name(), [] );
319-
$settings = $this->merge_settings( $settings, $defaults );
319+
$settings = $this->merge_settings( (array) $settings, (array) $defaults );
320320

321321
if ( $index && isset( $settings[ $index ] ) ) {
322322
return $settings[ $index ];
@@ -393,10 +393,14 @@ public function add_provider_fields() {
393393
*/
394394
protected function merge_settings( array $settings = [], array $defaults = [] ): array {
395395
foreach ( $defaults as $key => $value ) {
396-
if ( ! isset( $settings[ $key ] ) ) {
396+
if ( ! array_key_exists( $key, $settings ) ) {
397397
$settings[ $key ] = $defaults[ $key ];
398398
} elseif ( is_array( $value ) ) {
399-
$settings[ $key ] = $this->merge_settings( $settings[ $key ], $defaults[ $key ] );
399+
if ( is_array( $settings[ $key ] ) ) {
400+
$settings[ $key ] = $this->merge_settings( $settings[ $key ], $defaults[ $key ] );
401+
} else {
402+
$settings[ $key ] = $defaults[ $key ];
403+
}
400404
}
401405
}
402406

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "classifai",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"license": "GPL-2.0-or-later",
55
"repository": "https://github.com/10up/classifai/",
66
"description": "Enhance your WordPress content with Artificial Intelligence and Machine Learning services.",

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: AI, Artificial Intelligence, ML, Machine Learning, Microsoft
44
Requires at least: 6.1
55
Tested up to: 6.4
66
Requires PHP: 7.4
7-
Stable tag: 3.0.0
7+
Stable tag: 3.0.1
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

0 commit comments

Comments
 (0)