diff --git a/includes/Classifai/Features/PDFTextExtraction.php b/includes/Classifai/Features/PDFTextExtraction.php
index a4a6531a5..b16d6a69e 100644
--- a/includes/Classifai/Features/PDFTextExtraction.php
+++ b/includes/Classifai/Features/PDFTextExtraction.php
@@ -73,7 +73,7 @@ public function register_endpoints() {
'required' => true,
'type' => 'integer',
'sanitize_callback' => 'absint',
- 'description' => esc_html__( 'Attachment ID to extact text from the PDF file.', 'classifai' ),
+ 'description' => esc_html__( 'Attachment ID to extract text from the PDF file.', 'classifai' ),
],
],
'permission_callback' => [ $this, 'read_pdf_permissions_check' ],
diff --git a/includes/Classifai/Features/Smart404EPIntegration.php b/includes/Classifai/Features/Smart404EPIntegration.php
index 0d7b1d0cf..597a9e058 100644
--- a/includes/Classifai/Features/Smart404EPIntegration.php
+++ b/includes/Classifai/Features/Smart404EPIntegration.php
@@ -75,7 +75,7 @@ public function __construct( $provider = null ) {
}
/**
- * Inintialize the class and register the needed hooks.
+ * Initialize the class and register the needed hooks.
*/
public function init() {
// Vector support was added in Elasticsearch 7.0.
diff --git a/includes/Classifai/Features/TermCleanup.php b/includes/Classifai/Features/TermCleanup.php
index 8c27d379d..76fc794ca 100644
--- a/includes/Classifai/Features/TermCleanup.php
+++ b/includes/Classifai/Features/TermCleanup.php
@@ -359,9 +359,9 @@ public function start_term_cleanup_process() {
wp_die( esc_html__( 'You don\'t have permission to perform this operation.', 'classifai' ) );
}
- $settings = $this->get_settings( 'taxonomies' );
- $taxonomy = isset( $_POST['classifai_term_cleanup_taxonomy'] ) ? sanitize_text_field( wp_unslash( $_POST['classifai_term_cleanup_taxonomy'] ) ) : '';
- $thresold = isset( $settings[ $taxonomy . '_threshold' ] ) ? absint( $settings[ $taxonomy . '_threshold' ] ) : 75;
+ $settings = $this->get_settings( 'taxonomies' );
+ $taxonomy = isset( $_POST['classifai_term_cleanup_taxonomy'] ) ? sanitize_text_field( wp_unslash( $_POST['classifai_term_cleanup_taxonomy'] ) ) : '';
+ $threshold = isset( $settings[ $taxonomy . '_threshold' ] ) ? absint( $settings[ $taxonomy . '_threshold' ] ) : 75;
if ( empty( $taxonomy ) ) {
wp_die( esc_html__( 'Invalid taxonomy.', 'classifai' ) );
@@ -387,7 +387,7 @@ public function start_term_cleanup_process() {
$job_args = [
[
'taxonomy' => $taxonomy,
- 'thresold' => $thresold,
+ 'threshold' => $threshold,
'action' => 'term_cleanup',
'embeddings_generated' => false,
'processed' => 0,
@@ -515,16 +515,16 @@ public function generate_embeddings( string $taxonomy ) {
* Get similar terms.
*
* @param string $taxonomy Taxonomy to process.
- * @param int $thresold Thresold to consider terms as duplicates.
+ * @param int $threshold Threshold to consider terms as duplicates.
* @param array $args Additional arguments.
* @return array|bool|WP_Error
*/
- public function get_similar_terms( string $taxonomy, int $thresold, array $args = [] ) {
+ public function get_similar_terms( string $taxonomy, int $threshold, array $args = [] ) {
if ( class_exists( '\\ElasticPress\\Feature' ) && '1' === $this->get_settings( 'use_ep' ) ) {
- return $this->get_similar_terms_using_elasticpress( $taxonomy, $thresold, $args );
+ return $this->get_similar_terms_using_elasticpress( $taxonomy, $threshold, $args );
}
- return $this->get_similar_terms_using_wpdb( $taxonomy, $thresold, $args );
+ return $this->get_similar_terms_using_wpdb( $taxonomy, $threshold, $args );
}
/**
@@ -535,11 +535,11 @@ public function get_similar_terms( string $taxonomy, int $thresold, array $args
* when ElasticPress is not installed or not in use.
*
* @param string $taxonomy Taxonomy to process.
- * @param int $thresold Thresold to consider terms as duplicates.
+ * @param int $threshold Threshold to consider terms as duplicates.
* @param array $args Additional arguments.
* @return array|bool
*/
- public function get_similar_terms_using_wpdb( string $taxonomy, int $thresold, array $args = [] ) {
+ public function get_similar_terms_using_wpdb( string $taxonomy, int $threshold, array $args = [] ) {
$processed = $args['processed'] ?? 0;
$term_id = $args['term_id'] ?? 0;
$offset = $args['offset'] ?? 0;
@@ -625,7 +625,7 @@ public function get_similar_terms_using_wpdb( string $taxonomy, int $thresold, a
}
$similarity = $calculations->cosine_similarity( $term_embedding, $compare_embedding );
- if ( false !== $similarity && ( 1 - $similarity ) >= ( $thresold / 100 ) ) {
+ if ( false !== $similarity && ( 1 - $similarity ) >= ( $threshold / 100 ) ) {
$similar_terms[ $compare_term_id ] = 1 - $similarity;
}
}
@@ -655,11 +655,11 @@ public function get_similar_terms_using_wpdb( string $taxonomy, int $thresold, a
* Get similar terms using Elasticsearch via ElasticPress.
*
* @param string $taxonomy Taxonomy to process.
- * @param int $thresold Thresold to consider terms as duplicates.
+ * @param int $threshold Threshold to consider terms as duplicates.
* @param array $args Additional arguments.
* @return array|bool|WP_Error
*/
- public function get_similar_terms_using_elasticpress( string $taxonomy, int $thresold, array $args = [] ) {
+ public function get_similar_terms_using_elasticpress( string $taxonomy, int $threshold, array $args = [] ) {
$processed = $args['processed'] ?? 0;
$meta_key = sanitize_text_field( $this->get_embeddings_meta_key() );
@@ -691,7 +691,7 @@ public function get_similar_terms_using_elasticpress( string $taxonomy, int $thr
foreach ( $terms as $term_id ) {
// Find similar terms for the term.
- $search_results = $this->ep_integration->exact_knn_search( $term_id, 'term', 500, $thresold );
+ $search_results = $this->ep_integration->exact_knn_search( $term_id, 'term', 500, $threshold );
if ( is_wp_error( $search_results ) ) {
return $search_results;
diff --git a/includes/Classifai/Features/TermCleanupEPIntegration.php b/includes/Classifai/Features/TermCleanupEPIntegration.php
index 016441326..85c431233 100644
--- a/includes/Classifai/Features/TermCleanupEPIntegration.php
+++ b/includes/Classifai/Features/TermCleanupEPIntegration.php
@@ -39,7 +39,7 @@ public function __construct( $feature ) {
}
/**
- * Inintialize the class and register the needed hooks.
+ * Initialize the class and register the needed hooks.
*/
public function init() {
// Vector support was added in Elasticsearch 7.0.
diff --git a/includes/Classifai/Helpers.php b/includes/Classifai/Helpers.php
index ef9ceec74..edd2d1c32 100644
--- a/includes/Classifai/Helpers.php
+++ b/includes/Classifai/Helpers.php
@@ -216,8 +216,8 @@ function get_largest_acceptable_image_url( string $full_image, string $full_url,
* @param string $full_image The path to the full-sized image source file.
* @param string $full_url The URL of the full-sized image.
* @param array $metadata Attachment metadata, including intermediate sizes.
- * @param array $width Array of minimimum and maximum width values. Default 0, 4200.
- * @param array $height Array of minimimum and maximum height values. Default 0, 4200.
+ * @param array $width Array of minimum and maximum width values. Default 0, 4200.
+ * @param array $height Array of minimum and maximum height values. Default 0, 4200.
* @param int $max_size The maximum acceptable filesize. Default 1MB.
* @return string|null The image URL, or null if no acceptable image found.
*/
@@ -456,7 +456,7 @@ function check_term_permissions( string $tax = '' ) {
$create_cap = is_taxonomy_hierarchical( $taxonomy->name ) ? $taxonomy->cap->edit_terms : $taxonomy->cap->assign_terms;
if ( ! current_user_can( $create_cap ) || ! current_user_can( $taxonomy->cap->assign_terms ) ) {
- return new WP_Error( 'rest_cannot_assign_term', esc_html__( 'Sorry, you are not alllowed to create or assign to this taxonomy.', 'classifai' ) );
+ return new WP_Error( 'rest_cannot_assign_term', esc_html__( 'Sorry, you are not allowed to create or assign to this taxonomy.', 'classifai' ) );
}
return true;
diff --git a/includes/Classifai/Providers/Azure/Embeddings.php b/includes/Classifai/Providers/Azure/Embeddings.php
index 4c0e512b9..e2d45ec3b 100644
--- a/includes/Classifai/Providers/Azure/Embeddings.php
+++ b/includes/Classifai/Providers/Azure/Embeddings.php
@@ -688,7 +688,7 @@ private function get_embeddings_similarity( array $embedding, bool $consider_thr
*
* @param string $taxonomy Taxonomy slug.
* @param bool $all Whether to generate embeddings for all terms or just those without embeddings.
- * @param array $args Overrideable query args for get_terms()
+ * @param array $args Overridable query args for get_terms()
* @param int $user_id The user ID to run this as.
*/
private function trigger_taxonomy_update( string $taxonomy = '', bool $all = false, array $args = [], int $user_id = 0 ) {
@@ -775,7 +775,7 @@ private function trigger_taxonomy_update( string $taxonomy = '', bool $all = fal
*
* @param string $taxonomy Taxonomy slug.
* @param bool $all Whether to generate embeddings for all terms or just those without embeddings.
- * @param array $args Overrideable query args for get_terms()
+ * @param array $args Overridable query args for get_terms()
* @param int $user_id The user ID to run this as.
*/
public function generate_embedding_job( string $taxonomy = '', bool $all = false, array $args = [], int $user_id = 0 ) {
diff --git a/includes/Classifai/Providers/Azure/OpenAI.php b/includes/Classifai/Providers/Azure/OpenAI.php
index 7fe0f397c..3e28efe3c 100644
--- a/includes/Classifai/Providers/Azure/OpenAI.php
+++ b/includes/Classifai/Providers/Azure/OpenAI.php
@@ -721,7 +721,7 @@ public function get_result( $response ) {
if ( empty( $json['error'] ) ) {
return $json;
} else {
- $message = $json['error']['message'] ?? esc_html__( 'An error occured', 'classifai' );
+ $message = $json['error']['message'] ?? esc_html__( 'An error occurred', 'classifai' );
return new WP_Error( $code, $message );
}
} elseif ( ! empty( wp_remote_retrieve_response_message( $response ) ) ) {
diff --git a/includes/Classifai/Providers/GoogleAI/APIRequest.php b/includes/Classifai/Providers/GoogleAI/APIRequest.php
index d71e862f8..45c196ba2 100644
--- a/includes/Classifai/Providers/GoogleAI/APIRequest.php
+++ b/includes/Classifai/Providers/GoogleAI/APIRequest.php
@@ -186,7 +186,7 @@ public function get_result( $response ) {
if ( empty( $json['error'] ) ) {
return $json;
} else {
- $message = $json['error']['message'] ?? esc_html__( 'An error occured', 'classifai' );
+ $message = $json['error']['message'] ?? esc_html__( 'An error occurred', 'classifai' );
return new WP_Error( $code, $message );
}
} elseif ( ! empty( wp_remote_retrieve_response_message( $response ) ) ) {
diff --git a/includes/Classifai/Providers/OpenAI/APIRequest.php b/includes/Classifai/Providers/OpenAI/APIRequest.php
index ed7a04bde..b264f0863 100644
--- a/includes/Classifai/Providers/OpenAI/APIRequest.php
+++ b/includes/Classifai/Providers/OpenAI/APIRequest.php
@@ -290,7 +290,7 @@ public function get_result( $response ) {
if ( empty( $json['error'] ) ) {
return $json;
} else {
- $message = $json['error']['message'] ?? esc_html__( 'An error occured', 'classifai' );
+ $message = $json['error']['message'] ?? esc_html__( 'An error occurred', 'classifai' );
return new WP_Error( $code, $message );
}
} else {
diff --git a/includes/Classifai/Providers/OpenAI/Embeddings.php b/includes/Classifai/Providers/OpenAI/Embeddings.php
index 96c9bfbd5..cb6911797 100644
--- a/includes/Classifai/Providers/OpenAI/Embeddings.php
+++ b/includes/Classifai/Providers/OpenAI/Embeddings.php
@@ -804,7 +804,7 @@ private function get_embeddings_similarity( array $embedding, bool $consider_thr
*
* @param string $taxonomy Taxonomy slug.
* @param bool $all Whether to generate embeddings for all terms or just those without embeddings.
- * @param array $args Overrideable query args for get_terms()
+ * @param array $args Overridable query args for get_terms()
* @param int $user_id The user ID to run this as.
*/
public function trigger_taxonomy_update( string $taxonomy = '', bool $all = false, array $args = [], int $user_id = 0 ) {
@@ -891,7 +891,7 @@ public function trigger_taxonomy_update( string $taxonomy = '', bool $all = fals
*
* @param string $taxonomy Taxonomy slug.
* @param bool $all Whether to generate embeddings for all terms or just those without embeddings.
- * @param array $args Overrideable query args for get_terms()
+ * @param array $args Overridable query args for get_terms()
* @param int $user_id The user ID to run this as.
*/
public function generate_embedding_job( string $taxonomy = '', bool $all = false, array $args = [], int $user_id = 0 ) {
diff --git a/includes/Classifai/Providers/XAI/APIRequest.php b/includes/Classifai/Providers/XAI/APIRequest.php
index 7c2777c04..ec292d609 100644
--- a/includes/Classifai/Providers/XAI/APIRequest.php
+++ b/includes/Classifai/Providers/XAI/APIRequest.php
@@ -188,7 +188,7 @@ public function get_result( $response ) {
} else {
$message = $json['error']['message'] ?? '';
if ( empty( $message ) ) {
- $message = $json['error'] ?? esc_html__( 'An error occured', 'classifai' );
+ $message = $json['error'] ?? esc_html__( 'An error occurred', 'classifai' );
}
return new WP_Error( $code, $message );
}
diff --git a/includes/Classifai/TermCleanupScheduler.php b/includes/Classifai/TermCleanupScheduler.php
index a0f8d83cc..943214fed 100644
--- a/includes/Classifai/TermCleanupScheduler.php
+++ b/includes/Classifai/TermCleanupScheduler.php
@@ -46,7 +46,7 @@ public function run( array $item = [] ) {
case 'term_cleanup':
$started_by = absint( $item['started_by'] );
$taxonomy = $item['taxonomy'];
- $thresold = $item['thresold'];
+ $threshold = $item['threshold'];
$term_cleanup = new TermCleanup();
$embeddings_generated = (bool) $item['embeddings_generated'];
@@ -92,7 +92,7 @@ public function run( array $item = [] ) {
'term_id' => $item['term_id'] ?? 0,
'offset' => $item['offset'] ?? 0,
);
- $res = $term_cleanup->get_similar_terms( $taxonomy, $thresold, $args );
+ $res = $term_cleanup->get_similar_terms( $taxonomy, $threshold, $args );
/**
* Fires when a batch of similar terms are calculated.
diff --git a/src/js/features/classification/pre-publish-classify-post.js b/src/js/features/classification/pre-publish-classify-post.js
index c4cdb8b76..5e592d0b9 100644
--- a/src/js/features/classification/pre-publish-classify-post.js
+++ b/src/js/features/classification/pre-publish-classify-post.js
@@ -34,7 +34,7 @@ class PrePubClassifyPost extends Component {
* Render the component.
*/
render() {
- // retun null if popupOpened is true
+ // return null if popupOpened is true
if ( this.props.popupOpened ) {
return null;
}
diff --git a/src/js/features/classification/previewer.js b/src/js/features/classification/previewer.js
index 80b51a3e7..804ec5922 100644
--- a/src/js/features/classification/previewer.js
+++ b/src/js/features/classification/previewer.js
@@ -177,7 +177,7 @@ import './previewer.scss';
* Filters response data depending on the threshold value.
*
* @param {Object} data Response data from NLU.
- * @param {Object} thresholds Object containing threshold values for various taxnomy types.
+ * @param {Object} thresholds Object containing threshold values for various taxonomy types.
* @return {Array} Sorted data.
*/
function filterByScoreOrRelevance( data = {}, thresholds ) {
@@ -513,7 +513,7 @@ document.addEventListener( 'DOMContentLoaded', function () {
if ( classifaiNLUCheckbox ) {
classifaiNLUCheckbox.addEventListener( 'change', function () {
const classifyButton = document.querySelector(
- '.classifai-clasify-post-wrapper'
+ '.classifai-classify-post-wrapper'
);
if ( this.checked === true ) {
classifyButton.style.display = 'none';
diff --git a/src/js/features/classification/taxonomy-controls.js b/src/js/features/classification/taxonomy-controls.js
index 089699b06..12f374550 100644
--- a/src/js/features/classification/taxonomy-controls.js
+++ b/src/js/features/classification/taxonomy-controls.js
@@ -158,7 +158,7 @@ const TaxonomyControls = ( { onChange, query } ) => {
// Append newTerm to taxoInfo.terms.
const terms = {
...taxoInfo.terms,
- entitites: [
+ entities: [
...taxoInfo.terms.entities,
newTerm,
],
diff --git a/src/js/helpers.js b/src/js/helpers.js
index b6cd0a1b0..ff3134c44 100644
--- a/src/js/helpers.js
+++ b/src/js/helpers.js
@@ -127,7 +127,7 @@ export const chromeAITextGeneration = async ( prompt = '', content = '' ) => {
sprintf(
/* translators: %s: error message */
__(
- 'Error occured during AI text generation: %1$s. Please ensure you have followed the setup instructions at https://10up.github.io/classifai/tutorial-chrome-built-in-ai.html',
+ 'Error occurred during AI text generation: %1$s. Please ensure you have followed the setup instructions at https://10up.github.io/classifai/tutorial-chrome-built-in-ai.html',
'classifai'
),
e?.message
diff --git a/src/js/settings/components/provider-settings/index.js b/src/js/settings/components/provider-settings/index.js
index 33f3d9536..5fc654351 100644
--- a/src/js/settings/components/provider-settings/index.js
+++ b/src/js/settings/components/provider-settings/index.js
@@ -26,7 +26,7 @@ import { AzurePersonalizerSettings } from './azure-personlizer';
import { OpenAIDallESettings } from './openai-dalle';
import { AmazonPollySettings } from './amazon-polly';
import { AzureTextToSpeechSettings } from './azure-text-to-speech';
-import { OpenAITextToSpeachSettings } from './openai-text-to-speech';
+import { OpenAITextToSpeechSettings } from './openai-text-to-speech';
import { ChromeAISettings } from './chrome-ai';
import { XAIGrokSettings } from './xai-grok';
@@ -84,7 +84,7 @@ const ProviderFields = ( { provider, isConfigured } ) => {
return
;
case 'openai_text_to_speech':
- return
;
+ return
;
case 'xai_grok':
return
;
diff --git a/src/js/settings/components/provider-settings/openai-text-to-speech.js b/src/js/settings/components/provider-settings/openai-text-to-speech.js
index e8991b7a3..574c2cd2f 100644
--- a/src/js/settings/components/provider-settings/openai-text-to-speech.js
+++ b/src/js/settings/components/provider-settings/openai-text-to-speech.js
@@ -22,9 +22,9 @@ import { STORE_NAME } from '../../data/store';
* @param {Object} props Component props.
* @param {boolean} props.isConfigured Whether the provider is configured.
*
- * @return {React.ReactElement} OpenAITextToSpeachSettings component.
+ * @return {React.ReactElement} OpenAITextToSpeechSettings component.
*/
-export const OpenAITextToSpeachSettings = ( { isConfigured = false } ) => {
+export const OpenAITextToSpeechSettings = ( { isConfigured = false } ) => {
const providerName = 'openai_text_to_speech';
const providerSettings = useSelect(
( select ) =>
diff --git a/src/scss/admin.scss b/src/scss/admin.scss
index 61beb70c6..70759c0ec 100644
--- a/src/scss/admin.scss
+++ b/src/scss/admin.scss
@@ -870,7 +870,7 @@ input.classifai-button {
}
// Start: Classify Post Modal
-.classify-post-componenet {
+.classify-post-component {
hr {
margin-bottom: 20px;
}
diff --git a/tests/Classifai/Providers/Azure/SmartCroppingTest.php b/tests/Classifai/Providers/Azure/SmartCroppingTest.php
index 5d15cd4b4..3dddaabb3 100644
--- a/tests/Classifai/Providers/Azure/SmartCroppingTest.php
+++ b/tests/Classifai/Providers/Azure/SmartCroppingTest.php
@@ -85,7 +85,7 @@ public function test_get_wp_filesystem() {
*/
public function test_should_crop() {
global $_wp_additional_image_sizes;
- $saved_additonal_image_sizes = $_wp_additional_image_sizes;;
+ $saved_additional_image_sizes = $_wp_additional_image_sizes;;
add_image_size( 'test-cropped-image-size', 600, 500, true );
add_image_size( 'test-position-cropped-image-size', 600, 400, [ 'right', 'bottom' ] );
@@ -98,7 +98,7 @@ public function test_should_crop() {
$this->assertFalse( $smart_cropping->should_crop( 'test-position-cropped-image-size' ) );
// Reset.
- $_wp_additional_image_sizes = $saved_additonal_image_sizes;
+ $_wp_additional_image_sizes = $saved_additional_image_sizes;
}
/**