From f17cdb16bab95d2f507a11d0c6a9cd450dc6e9f5 Mon Sep 17 00:00:00 2001 From: dkotter Date: Tue, 6 Aug 2024 19:04:47 +0000 Subject: [PATCH] Release: (6941711) Merge branch 'develop' into trunk --- classifai.php | 2 +- config.php | 2 +- .../Providers/Azure/ComputerVision.php | 12 ++++- .../Classifai/Providers/OpenAI/ChatGPT.php | 4 +- languages/classifai.pot | 54 +++++++++---------- readme.txt | 2 +- vendor/composer/installed.php | 4 +- 7 files changed, 45 insertions(+), 35 deletions(-) diff --git a/classifai.php b/classifai.php index 1dbf364e6..e0b93dd08 100644 --- a/classifai.php +++ b/classifai.php @@ -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.1.0 + * Version: 3.1.1 * Requires at least: 6.1 * Requires PHP: 7.4 * Author: 10up diff --git a/config.php b/config.php index ebdb72479..94171a90c 100644 --- a/config.php +++ b/config.php @@ -3,7 +3,7 @@ * Global Constants. */ -$plugin_version = '3.1.0'; +$plugin_version = '3.1.1'; // Useful global constants classifai_define( 'CLASSIFAI_PLUGIN', __DIR__ . '/classifai.php' ); diff --git a/includes/Classifai/Providers/Azure/ComputerVision.php b/includes/Classifai/Providers/Azure/ComputerVision.php index 1a947a4d1..a4b6246c7 100644 --- a/includes/Classifai/Providers/Azure/ComputerVision.php +++ b/includes/Classifai/Providers/Azure/ComputerVision.php @@ -206,6 +206,16 @@ public function sanitize_settings( array $new_settings ) { if ( is_wp_error( $auth_check ) ) { $new_settings[ static::ID ]['authenticated'] = false; + + $error_message = $auth_check->get_error_message(); + + // Add an error message. + add_settings_error( + 'api_key', + 'classifai-auth', + $error_message, + 'error' + ); } else { $new_settings[ static::ID ]['authenticated'] = true; } @@ -692,7 +702,7 @@ protected function authenticate_credentials( string $url, string $api_key ) { 'Ocp-Apim-Subscription-Key' => $api_key, 'Content-Type' => 'application/json', ], - 'body' => '{"url":"https://classifaiplugin.com/wp-content/themes/classifai-theme/assets/img/header.png"}', + 'body' => '{"url":"https://classifaiplugin.com/wp-content/themes/fse-classifai-theme/assets/img/header.png"}', ] ); diff --git a/includes/Classifai/Providers/OpenAI/ChatGPT.php b/includes/Classifai/Providers/OpenAI/ChatGPT.php index 948eabcf7..6a50aab76 100644 --- a/includes/Classifai/Providers/OpenAI/ChatGPT.php +++ b/includes/Classifai/Providers/OpenAI/ChatGPT.php @@ -33,14 +33,14 @@ class ChatGPT extends Provider { * * @var string */ - protected $chatgpt_model = 'gpt-3.5-turbo'; + protected $chatgpt_model = 'gpt-4o-mini'; /** * Maximum number of tokens our model supports * * @var int */ - protected $max_tokens = 16385; + protected $max_tokens = 128000; /** * OpenAI ChatGPT constructor. diff --git a/languages/classifai.pot b/languages/classifai.pot index ce2b56ef6..ec9cec5ab 100644 --- a/languages/classifai.pot +++ b/languages/classifai.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPLv2. msgid "" msgstr "" -"Project-Id-Version: ClassifAI 3.1.0\n" +"Project-Id-Version: ClassifAI 3.1.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/classifai\n" -"POT-Creation-Date: 2024-07-15 15:27:24+00:00\n" +"POT-Creation-Date: 2024-08-06 19:04:39+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -75,7 +75,7 @@ msgstr "" #: includes/Classifai/Admin/BulkActions.php:383 #: includes/Classifai/Admin/BulkActions.php:530 #: includes/Classifai/Features/DescriptiveTextGenerator.php:242 -#: includes/Classifai/Providers/Azure/ComputerVision.php:832 +#: includes/Classifai/Providers/Azure/ComputerVision.php:842 msgid "Generate descriptive text" msgstr "" @@ -1011,7 +1011,7 @@ msgid "Image tags will be added automatically." msgstr "" #: includes/Classifai/Features/ImageTagsGenerator.php:313 -#: includes/Classifai/Providers/Azure/ComputerVision.php:838 +#: includes/Classifai/Providers/Azure/ComputerVision.php:848 msgid "Tag taxonomy" msgstr "" @@ -1112,7 +1112,7 @@ msgid "Attachment ID to extact text from the PDF file." msgstr "" #: includes/Classifai/Features/PDFTextExtraction.php:105 -#: includes/Classifai/Providers/Azure/ComputerVision.php:492 +#: includes/Classifai/Providers/Azure/ComputerVision.php:502 msgid "PDF Text Extraction is disabled. Please check your settings." msgstr "" @@ -1436,7 +1436,7 @@ msgid "Latest response - Voices" msgstr "" #: includes/Classifai/Providers/AWS/AmazonPolly.php:568 -#: includes/Classifai/Providers/Azure/ComputerVision.php:249 +#: includes/Classifai/Providers/Azure/ComputerVision.php:259 msgid "Nonce could not be verified." msgstr "" @@ -1457,8 +1457,8 @@ msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:107 #: includes/Classifai/Providers/Azure/ComputerVision.php:132 -#: includes/Classifai/Providers/Azure/ComputerVision.php:833 -#: includes/Classifai/Providers/Azure/ComputerVision.php:839 +#: includes/Classifai/Providers/Azure/ComputerVision.php:843 +#: includes/Classifai/Providers/Azure/ComputerVision.php:849 msgid "Confidence threshold" msgstr "" @@ -1474,57 +1474,57 @@ msgid "" "from 0-100. Recommended to be set to at least 70." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:257 +#: includes/Classifai/Providers/Azure/ComputerVision.php:267 msgid "Invalid attachment ID." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:264 +#: includes/Classifai/Providers/Azure/ComputerVision.php:274 msgid "Unauthorized access." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:322 -#: includes/Classifai/Providers/Azure/ComputerVision.php:376 -#: includes/Classifai/Providers/Azure/ComputerVision.php:424 -#: includes/Classifai/Providers/Azure/ComputerVision.php:520 +#: includes/Classifai/Providers/Azure/ComputerVision.php:332 +#: includes/Classifai/Providers/Azure/ComputerVision.php:386 +#: includes/Classifai/Providers/Azure/ComputerVision.php:434 +#: includes/Classifai/Providers/Azure/ComputerVision.php:530 msgid "This attachment can't be processed." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:329 -#: includes/Classifai/Providers/Azure/ComputerVision.php:383 +#: includes/Classifai/Providers/Azure/ComputerVision.php:339 +#: includes/Classifai/Providers/Azure/ComputerVision.php:393 msgid "Invalid data found. Please check your settings and try again." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:357 +#: includes/Classifai/Providers/Azure/ComputerVision.php:367 msgid "Access to the filesystem is required for this feature to work." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:595 +#: includes/Classifai/Providers/Azure/ComputerVision.php:605 msgid "Feature not enabled." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:640 -#: includes/Classifai/Providers/Azure/ComputerVision.php:644 +#: includes/Classifai/Providers/Azure/ComputerVision.php:650 +#: includes/Classifai/Providers/Azure/ComputerVision.php:654 msgid "An error occurred." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:723 +#: includes/Classifai/Providers/Azure/ComputerVision.php:733 #. translators: %1$s: the attachment ID msgid "%1$d is not found or is not an attachment" msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:733 +#: includes/Classifai/Providers/Azure/ComputerVision.php:743 msgid "No valid metadata found." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:760 +#: includes/Classifai/Providers/Azure/ComputerVision.php:770 msgid "Valid image size not found. Make sure the image is less than 4MB." msgstr "" -#: includes/Classifai/Providers/Azure/ComputerVision.php:834 -#: includes/Classifai/Providers/Azure/ComputerVision.php:840 #: includes/Classifai/Providers/Azure/ComputerVision.php:844 -#: includes/Classifai/Providers/Azure/ComputerVision.php:848 -#: includes/Classifai/Providers/Azure/ComputerVision.php:852 +#: includes/Classifai/Providers/Azure/ComputerVision.php:850 +#: includes/Classifai/Providers/Azure/ComputerVision.php:854 +#: includes/Classifai/Providers/Azure/ComputerVision.php:858 +#: includes/Classifai/Providers/Azure/ComputerVision.php:862 #: includes/Classifai/Providers/OpenAI/DallE.php:374 msgid "Latest response:" msgstr "" diff --git a/readme.txt b/readme.txt index e4f3f481f..d760d77a2 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: AI, Artificial Intelligence, ML, Machine Learning, Microsoft Requires at least: 6.1 Tested up to: 6.6 Requires PHP: 7.4 -Stable tag: 3.1.0 +Stable tag: 3.1.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 06038f0a3..c9701e1db 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '10up/classifai', 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '9bbea9aa0dacb0bbce2595a6cdb1c4292d8f08ba', + 'reference' => '694171169eac28a96141331f76977e0545f27ee9', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '10up/classifai' => array( 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '9bbea9aa0dacb0bbce2595a6cdb1c4292d8f08ba', + 'reference' => '694171169eac28a96141331f76977e0545f27ee9', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),