Skip to content

Commit

Permalink
Release: (adb6739) Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Mar 7, 2024
1 parent 85eaddd commit 1a099a2
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions classifai.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/10up/classifai
* Update URI: https://classifaiplugin.com
* Description: Enhance your WordPress content with Artificial Intelligence and Machine Learning services.
* Version: 3.0.0
* Version: 3.0.1
* Requires at least: 6.1
* Requires PHP: 7.4
* Author: 10up
Expand Down Expand Up @@ -88,7 +88,7 @@ function classifai_autoload() {
return true;
} else {
error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
sprintf( esc_html__( 'Fatal Error: Composer not setup in %', 'classifai' ), CLASSIFAI_PLUGIN_DIR )
sprintf( 'Warning: Composer not setup in %s', CLASSIFAI_PLUGIN_DIR )
);

return false;
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Global Constants.
*/

$plugin_version = '3.0.0';
$plugin_version = '3.0.1';

// Useful global constants
classifai_define( 'CLASSIFAI_PLUGIN', __DIR__ . '/classifai.php' );
Expand Down
2 changes: 1 addition & 1 deletion includes/Classifai/Features/DescriptiveTextGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function get_alt_text_settings(): array {

if ( ! is_array( $settings['descriptive_text_fields'] ) ) {
return array(
'alt' => 'no' === $settings['descriptive_text_fields']['caption'] ? 0 : 'alt',
'alt' => 'no' === $settings['descriptive_text_fields'] ? 0 : 'alt',
'caption' => 0,
'description' => 0,
);
Expand Down
12 changes: 8 additions & 4 deletions includes/Classifai/Features/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ public function get_option_name(): string {
* Returns the settings for the feature.
*
* @param string $index The index of the setting to return.
* @return array|string
* @return array|mixed
*/
public function get_settings( $index = false ) {
$defaults = $this->get_default_settings();
$settings = get_option( $this->get_option_name(), [] );
$settings = $this->merge_settings( $settings, $defaults );
$settings = $this->merge_settings( (array) $settings, (array) $defaults );

if ( $index && isset( $settings[ $index ] ) ) {
return $settings[ $index ];
Expand Down Expand Up @@ -393,10 +393,14 @@ public function add_provider_fields() {
*/
protected function merge_settings( array $settings = [], array $defaults = [] ): array {
foreach ( $defaults as $key => $value ) {
if ( ! isset( $settings[ $key ] ) ) {
if ( ! array_key_exists( $key, $settings ) ) {
$settings[ $key ] = $defaults[ $key ];
} elseif ( is_array( $value ) ) {
$settings[ $key ] = $this->merge_settings( $settings[ $key ], $defaults[ $key ] );
if ( is_array( $settings[ $key ] ) ) {
$settings[ $key ] = $this->merge_settings( $settings[ $key ], $defaults[ $key ] );
} else {
$settings[ $key ] = $defaults[ $key ];
}
}
}

Expand Down
68 changes: 32 additions & 36 deletions languages/classifai.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the GPLv2.
msgid ""
msgstr ""
"Project-Id-Version: ClassifAI 3.0.0\n"
"Project-Id-Version: ClassifAI 3.0.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/classifai\n"
"POT-Creation-Date: 2024-02-29 16:35:53+00:00\n"
"POT-Creation-Date: 2024-03-07 17:35:04+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -32,10 +32,6 @@ msgid ""
"the plugin."
msgstr ""

#: classifai.php:91
msgid "Fatal Error: Composer not setup in %"
msgstr ""

#: classifai.php:106
msgid "Error: Please run $ composer install in the ClassifAI plugin directory."
msgstr ""
Expand Down Expand Up @@ -626,17 +622,17 @@ msgid "Enable this to generate descriptive text for images."
msgstr ""

#: includes/Classifai/Features/DescriptiveTextGenerator.php:346
#: includes/Classifai/Features/Feature.php:761
#: includes/Classifai/Features/Feature.php:765
msgid "Alt text"
msgstr ""

#: includes/Classifai/Features/DescriptiveTextGenerator.php:347
#: includes/Classifai/Features/Feature.php:762
#: includes/Classifai/Features/Feature.php:766
msgid "Image caption"
msgstr ""

#: includes/Classifai/Features/DescriptiveTextGenerator.php:348
#: includes/Classifai/Features/Feature.php:763
#: includes/Classifai/Features/Feature.php:767
msgid "Image description"
msgstr ""

Expand Down Expand Up @@ -679,7 +675,7 @@ msgid ""
msgstr ""

#: includes/Classifai/Features/ExcerptGeneration.php:289
#: includes/Classifai/Features/Feature.php:620
#: includes/Classifai/Features/Feature.php:624
#: includes/Classifai/Features/TitleGeneration.php:323
msgid "Prompt"
msgstr ""
Expand Down Expand Up @@ -728,111 +724,111 @@ msgstr ""
msgid "Select a provider"
msgstr ""

#: includes/Classifai/Features/Feature.php:444
#: includes/Classifai/Features/Feature.php:448
msgid "Allowed roles"
msgstr ""

#: includes/Classifai/Features/Feature.php:452
#: includes/Classifai/Features/Feature.php:456
msgid "Choose which roles are allowed to access this feature."
msgstr ""

#: includes/Classifai/Features/Feature.php:459
#: includes/Classifai/Features/Feature.php:463
msgid "Allowed users"
msgstr ""

#: includes/Classifai/Features/Feature.php:466
#: includes/Classifai/Features/Feature.php:470
msgid "Users who have access to this feature."
msgstr ""

#: includes/Classifai/Features/Feature.php:473
#: includes/Classifai/Features/Feature.php:477
msgid "Enable user-based opt-out"
msgstr ""

#: includes/Classifai/Features/Feature.php:481
#: includes/Classifai/Features/Feature.php:485
msgid "Enables ability for users to opt-out from their user profile page."
msgstr ""

#: includes/Classifai/Features/Feature.php:591
#: includes/Classifai/Features/Feature.php:595
#. translators: %1$s is replaced with <strong>; %2$s with </strong>; %3$s with
#. prompt.
msgid "%1$sClassifAI default prompt%2$s: %3$s"
msgstr ""

#: includes/Classifai/Features/Feature.php:608
#: includes/Classifai/Features/Feature.php:612
msgid "Title"
msgstr ""

#: includes/Classifai/Features/Feature.php:610
#: includes/Classifai/Features/Feature.php:614
msgid "Short description of prompt to use for identification"
msgstr ""

#: includes/Classifai/Features/Feature.php:613
#: includes/Classifai/Features/Feature.php:617
msgid "Prompt title"
msgstr ""

#: includes/Classifai/Features/Feature.php:633
#: includes/Classifai/Features/Feature.php:637
msgid "Default prompt"
msgstr ""

#: includes/Classifai/Features/Feature.php:635
#: includes/Classifai/Features/Feature.php:639
msgid "Set as default prompt"
msgstr ""

#: includes/Classifai/Features/Feature.php:639
#: includes/Classifai/Features/Feature.php:643
msgid "Trash"
msgstr ""

#: includes/Classifai/Features/Feature.php:648
#: includes/Classifai/Features/Feature.php:652
msgid "Add new prompt"
msgstr ""

#: includes/Classifai/Features/Feature.php:1147
#: includes/Classifai/Features/Feature.php:1151
#: includes/Classifai/Features/Moderation.php:296
msgid "Yes"
msgstr ""

#: includes/Classifai/Features/Feature.php:1147
#: includes/Classifai/Features/Feature.php:1151
#: includes/Classifai/Features/Moderation.php:294
msgid "No"
msgstr ""

#: includes/Classifai/Features/Feature.php:1150
#: includes/Classifai/Features/Feature.php:1154
msgid "Enabled"
msgstr ""

#: includes/Classifai/Features/Feature.php:1150
#: includes/Classifai/Features/Feature.php:1154
msgid "Disabled"
msgstr ""

#: includes/Classifai/Features/Feature.php:1174
#: includes/Classifai/Features/Feature.php:1178
msgid "Authenticated"
msgstr ""

#: includes/Classifai/Features/Feature.php:1175
#: includes/Classifai/Features/Feature.php:1179
msgid "Status"
msgstr ""

#: includes/Classifai/Features/Feature.php:1176
#: includes/Classifai/Features/Feature.php:1180
msgid "Allowed roles (titles)"
msgstr ""

#: includes/Classifai/Features/Feature.php:1177
#: includes/Classifai/Features/Feature.php:1181
msgid "Allowed users (titles)"
msgstr ""

#: includes/Classifai/Features/Feature.php:1178
#: includes/Classifai/Features/Feature.php:1182
msgid "User based opt-out"
msgstr ""

#: includes/Classifai/Features/Feature.php:1179
#: includes/Classifai/Features/Feature.php:1183
msgid "Provider"
msgstr ""

#: includes/Classifai/Features/Feature.php:1242
#: includes/Classifai/Features/Feature.php:1246
msgid "Invalid route."
msgstr ""

#: includes/Classifai/Features/Feature.php:1257
#: includes/Classifai/Features/Feature.php:1261
msgid "The selected provider does not have a valid callback in place."
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: AI, Artificial Intelligence, ML, Machine Learning, Microsoft
Requires at least: 6.1
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 3.0.0
Stable tag: 3.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '10up/classifai',
'pretty_version' => 'dev-trunk',
'version' => 'dev-trunk',
'reference' => 'd4cafe9511856d7dc041829e6b82cb2a7cb06dc3',
'reference' => 'adb6739a1c0bb19070994cd7ecb6e2ff68c44a13',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'10up/classifai' => array(
'pretty_version' => 'dev-trunk',
'version' => 'dev-trunk',
'reference' => 'd4cafe9511856d7dc041829e6b82cb2a7cb06dc3',
'reference' => 'adb6739a1c0bb19070994cd7ecb6e2ff68c44a13',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down

0 comments on commit 1a099a2

Please sign in to comment.