'; $output .= sprintf( + /* translators: %1$s: action, %2$s: number of posts, %3$s: post type*/ _n( - 'Classified %s post.', - 'Classified %s posts.', + '%1$s %2$s %3$s.', + '%1$s %2$s %3$ss.', $classified_posts_count, 'classifai' ), - $classified_posts_count + $action, + $classified_posts_count, + $post_type ); $output .= '
+ +
+ function( $object ) { + $process_content = get_post_meta( $object['id'], '_classifai_process_content', true ); + return ( 'no' === $process_content ) ? 'no' : 'yes'; + }, + 'update_callback' => function ( $value, $object ) { + $value = ( 'no' === $value ) ? 'no' : 'yes'; + return update_post_meta( $object->ID, '_classifai_process_content', $value ); + }, + 'schema' => [ + 'type' => 'string', + 'context' => [ 'view', 'edit' ], + ], + ) + ); + } } diff --git a/includes/Classifai/Services/Service.php b/includes/Classifai/Services/Service.php index 50d68bfa4..5d2a87994 100644 --- a/includes/Classifai/Services/Service.php +++ b/includes/Classifai/Services/Service.php @@ -106,7 +106,7 @@ public function get_display_name() { public function render_settings_page() { $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : $this->provider_classes[0]->get_settings_section(); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> -https://REGION.api.cognitive.microsoft.com
or "
@@ -135,126 +161,126 @@ msgid ""
"different based on your setting choices in Azure."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:756
-#: includes/Classifai/Providers/Watson/NLU.php:200
-#: includes/Classifai/Providers/Watson/NLU.php:295
+#: includes/Classifai/Providers/Azure/ComputerVision.php:764
+#: includes/Classifai/Providers/Watson/NLU.php:234
+#: includes/Classifai/Providers/Watson/NLU.php:330
msgid "API Key"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:776
+#: includes/Classifai/Providers/Azure/ComputerVision.php:784
msgid "The alt text field will be filled out automatically."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:781
+#: includes/Classifai/Providers/Azure/ComputerVision.php:789
msgid "Alt text confidence threshold"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:789
+#: includes/Classifai/Providers/Azure/ComputerVision.php:797
msgid ""
"Minimum confidence score for automatically added alt text, numeric value "
"from 0-100. Recommended to be set to at least 75."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:794
+#: includes/Classifai/Providers/Azure/ComputerVision.php:802
msgid "Tag images"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:802
+#: includes/Classifai/Providers/Azure/ComputerVision.php:810
msgid "Image tags will be added automatically."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:807
+#: includes/Classifai/Providers/Azure/ComputerVision.php:815
msgid "Tag confidence threshold"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:815
+#: includes/Classifai/Providers/Azure/ComputerVision.php:823
msgid ""
"Minimum confidence score for automatically added image tags, numeric value "
"from 0-100. Recommended to be set to at least 70."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:826
+#: includes/Classifai/Providers/Azure/ComputerVision.php:834
msgid "Tag taxonomy"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:838
+#: includes/Classifai/Providers/Azure/ComputerVision.php:846
msgid "Enable smart cropping"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:846
+#: includes/Classifai/Providers/Azure/ComputerVision.php:854
msgid ""
"ComputerVision detects and saves the most visually interesting part of your "
"image (i.e., faces, animals, notable text)."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:854
+#: includes/Classifai/Providers/Azure/ComputerVision.php:862
msgid "Scan images for text"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:862
+#: includes/Classifai/Providers/Azure/ComputerVision.php:870
msgid ""
"OCR detects text in images (e.g., handwritten notes) and saves that as post "
"content."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:870
+#: includes/Classifai/Providers/Azure/ComputerVision.php:878
msgid "Enable scanning PDF"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:878
+#: includes/Classifai/Providers/Azure/ComputerVision.php:886
msgid ""
"Extract visible text from multi-pages PDF documents. Store the result as "
"the attachment description."
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:910
+#: includes/Classifai/Providers/Azure/ComputerVision.php:918
msgid "Please enter your credentials"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1014
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1022
msgid "Authenticated"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1014
-#: includes/Classifai/Providers/Watson/NLU.php:700
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1022
+#: includes/Classifai/Providers/Watson/NLU.php:735
#: includes/Classifai/Services/ServicesManager.php:354
msgid "yes"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1014
-#: includes/Classifai/Providers/Watson/NLU.php:700
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1022
+#: includes/Classifai/Providers/Watson/NLU.php:735
#: includes/Classifai/Services/ServicesManager.php:354
msgid "no"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1015
-#: includes/Classifai/Providers/Watson/NLU.php:267
-#: includes/Classifai/Providers/Watson/NLU.php:701
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1023
+#: includes/Classifai/Providers/Watson/NLU.php:302
+#: includes/Classifai/Providers/Watson/NLU.php:736
msgid "API URL"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1016
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1024
msgid "Caption threshold"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1017
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1025
msgid "Latest response - Image Scan"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1018
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1026
msgid "Latest response - Smart Cropping"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1019
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1027
msgid "Latest response - OCR"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1032
-#: includes/Classifai/Providers/Watson/NLU.php:718
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1040
+#: includes/Classifai/Providers/Watson/NLU.php:753
msgid "N/A"
msgstr ""
-#: includes/Classifai/Providers/Azure/ComputerVision.php:1104
+#: includes/Classifai/Providers/Azure/ComputerVision.php:1112
msgid "Valid image size not found. Make sure the image is less than 4MB."
msgstr ""
@@ -310,69 +336,77 @@ msgstr ""
msgid "Please Choose"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:41
+#: includes/Classifai/Providers/Watson/NLU.php:42
+#: includes/Classifai/Services/Service.php:142
msgid "Category"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:42
+#: includes/Classifai/Providers/Watson/NLU.php:43
msgid "Category Threshold (%)"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:43
+#: includes/Classifai/Providers/Watson/NLU.php:44
msgid "Category Taxonomy"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:48
+#: includes/Classifai/Providers/Watson/NLU.php:49
+#: includes/Classifai/Services/Service.php:147
msgid "Keyword"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:49
+#: includes/Classifai/Providers/Watson/NLU.php:50
msgid "Keyword Threshold (%)"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:50
+#: includes/Classifai/Providers/Watson/NLU.php:51
msgid "Keyword Taxonomy"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:55
+#: includes/Classifai/Providers/Watson/NLU.php:56
+#: includes/Classifai/Services/Service.php:152
msgid "Entity"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:56
+#: includes/Classifai/Providers/Watson/NLU.php:57
msgid "Entity Threshold (%)"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:57
+#: includes/Classifai/Providers/Watson/NLU.php:58
msgid "Entity Taxonomy"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:62
+#: includes/Classifai/Providers/Watson/NLU.php:63
+#: includes/Classifai/Services/Service.php:157
msgid "Concept"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:63
+#: includes/Classifai/Providers/Watson/NLU.php:64
msgid "Concept Threshold (%)"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:64
+#: includes/Classifai/Providers/Watson/NLU.php:65
msgid "Concept Taxonomy"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:199
+#: includes/Classifai/Providers/Watson/NLU.php:233
msgid "API Password"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:201
-#: includes/Classifai/Providers/Watson/NLU.php:314
+#: includes/Classifai/Providers/Watson/NLU.php:235
+#: includes/Classifai/Providers/Watson/NLU.php:349
msgid "Use an API Key instead?"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:202
-#: includes/Classifai/Providers/Watson/NLU.php:313
+#: includes/Classifai/Providers/Watson/NLU.php:236
+#: includes/Classifai/Providers/Watson/NLU.php:348
msgid "Use a username/password instead?"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:218
+#: includes/Classifai/Providers/Watson/NLU.php:237
+msgid "Loading Preview"
+msgstr ""
+
+#: includes/Classifai/Providers/Watson/NLU.php:253
msgid ""
"Don't have an IBM Cloud account yet? Register for one and set up a here for details."
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:280
+#: includes/Classifai/Providers/Watson/NLU.php:315
msgid "API Username"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:343
+#: includes/Classifai/Providers/Watson/NLU.php:378
msgid "Post Types to Classify"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:354
+#: includes/Classifai/Providers/Watson/NLU.php:389
msgid "Post Statuses to Classify"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:505
+#: includes/Classifai/Providers/Watson/NLU.php:540
msgid "Watson Category Settings"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:510
+#: includes/Classifai/Providers/Watson/NLU.php:545
msgid "Enable"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:614
+#: includes/Classifai/Providers/Watson/NLU.php:649
msgid "IBM Watson NLU Authentication Failed. Please check credentials."
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:700
+#: includes/Classifai/Providers/Watson/NLU.php:735
msgid "Configured"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:702
+#: includes/Classifai/Providers/Watson/NLU.php:737
msgid "API username"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:703
+#: includes/Classifai/Providers/Watson/NLU.php:738
msgid "Post types"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:704
+#: includes/Classifai/Providers/Watson/NLU.php:739
msgid "Features"
msgstr ""
-#: includes/Classifai/Providers/Watson/NLU.php:705
+#: includes/Classifai/Providers/Watson/NLU.php:740
msgid "Latest response"
msgstr ""
+#: includes/Classifai/Providers/Watson/NLU.php:788
+msgid "ClassifAI Language Processing"
+msgstr ""
+
+#: includes/Classifai/Providers/Watson/NLU.php:813
+msgid "Process content on update"
+msgstr ""
+
#: includes/Classifai/Services/ImageProcessing.php:55
#: includes/Classifai/Services/ImageProcessing.php:74
msgid "Scan"
@@ -469,6 +511,14 @@ msgstr ""
msgid "Language Processing"
msgstr ""
+#: includes/Classifai/Services/Service.php:163
+msgid "Preview Language Processing"
+msgstr ""
+
+#: includes/Classifai/Services/Service.php:172
+msgid "Preview"
+msgstr ""
+
#: includes/Classifai/Services/ServicesManager.php:134
msgid "Invalid ClassifAI registration info. Please check and try again."
msgstr ""
diff --git a/readme.txt b/readme.txt
index ac45004c1..5a94599d6 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,29 +1,29 @@
-=== ClassifAI ===
-Contributors: 10up
-Tags: AI, Artifical Intelligence, ML, Machine Learning, Microsoft Azure, IBM Watson, Content Tagging, Classification, Smart Cropping, Alt Text
-Requires at least: 5.0
-Tested up to: 6.0
-Requires PHP: 7.0
-Stable tag: 1.7.2
-License: GPLv2 or later
-License URI: http://www.gnu.org/licenses/gpl-2.0.html
-
-Enhance your WordPress content with Artificial Intelligence and Machine Learning services.
-
-== Description ==
-
-**Features**
-
-* Classify your content using [Microsoft Azure's Computer Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/) and [IBM Watson's Natural Language Understanding API](https://www.ibm.com/watson/services/natural-language-understanding/)
-* Supports Azure's [Describe Image](https://westus.dev.cognitive.microsoft.com/docs/services/5adf991815e1060e6355ad44/operations/56f91f2e778daf14a499e1fe)
-* Supports Watson's [Categories](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#categories), [Keywords](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#keywords), [Concepts](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#concepts) & [Entities](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#entities)
-* Automatically classify content and images on save
-* Automatically generate alt text and image tags for images
-* Automatically scan images and PDF files for embedded text and save for use in WordPress
-* [Smartly crop images](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/computervision/generatethumbnail) around a region of interest identified by Computer Vision
-* Bulk classify content with [WP-CLI](https://wp-cli.org/)
-
-**Requirements**
-
-* To utilize the Language Processing functionality, you will need an active [IBM Watson](https://cloud.ibm.com/registration) account.
-* To utilize the Image Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.
+=== ClassifAI ===
+Contributors: 10up
+Tags: AI, Artifical Intelligence, ML, Machine Learning, Microsoft Azure, IBM Watson, Content Tagging, Classification, Smart Cropping, Alt Text
+Requires at least: 5.6
+Tested up to: 6.0
+Requires PHP: 7.0
+Stable tag: 1.7.3
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+Enhance your WordPress content with Artificial Intelligence and Machine Learning services.
+
+== Description ==
+
+**Features**
+
+* Classify your content using [Microsoft Azure's Computer Vision API](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/) and [IBM Watson's Natural Language Understanding API](https://www.ibm.com/watson/services/natural-language-understanding/)
+* Supports Azure's [Describe Image](https://westus.dev.cognitive.microsoft.com/docs/services/5adf991815e1060e6355ad44/operations/56f91f2e778daf14a499e1fe)
+* Supports Watson's [Categories](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#categories), [Keywords](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#keywords), [Concepts](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#concepts) & [Entities](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-about#entities)
+* Automatically classify content and images on save
+* Automatically generate alt text and image tags for images
+* Automatically scan images and PDF files for embedded text and save for use in WordPress
+* [Smartly crop images](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/computervision/generatethumbnail) around a region of interest identified by Computer Vision
+* Bulk classify content with [WP-CLI](https://wp-cli.org/)
+
+**Requirements**
+
+* To utilize the Language Processing functionality, you will need an active [IBM Watson](https://cloud.ibm.com/registration) account.
+* To utilize the Image Processing functionality, you will need an active [Microsoft Azure](https://signup.azure.com/signup) account.