Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #839

Merged
merged 6 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Reqest, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
20 changes: 20 additions & 0 deletions .github/workflows/spell-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Spell Checker'
on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
Spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Spell Check
uses: crate-ci/typos@master
with:
files: ./
23 changes: 23 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[files]
extend-exclude = [
".git/",
"tests/test-plugin/text-to-speech-voices.json"
]
ignore-hidden = false

[default]
extend-ignore-re = [
"\\bTung Du\\b",
]

[default.extend-words]
# Typos
"weather" = "whether"

[default.extend-identifiers]
# Typos
"Github" = "GitHub"
"Wordpress" = "WordPress"
"Woocommerce" = "WooCommerce"
"get_post_stati" = "get_post_stati"
"Automattic" = "Automattic"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -463,7 +463,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- `classifai_post_statuses_for_post_type_or_id` filter; allows post statuses for content classification to be changed as required based on post type / post ID (props [@jamesmorrison](https://github.com/jamesmorrison), [@dkotter](https://github.com/dkotter) via [#310](https://github.com/10up/classifai/pull/310)).
- Implement `can_register()` method for `Classifai/Providers/Watson/NLU.php` (props [@thrijith](https://github.com/thrijith) via [#313](https://github.com/10up/classifai/pull/313)).
- Notice for deprecated IBM Watson `watsonplatform.net` NLU API endpoint (props [@rahulsprajapati](https://github.com/rahulsprajapati), [@jeffpaul](https://github.com/jeffpaul) via [#320](https://github.com/10up/classifai/pull/320)).
- CodeQL Analaysis code scanning and Dependency security scanning actions (props [@jeffpaul](https://github.com/jeffpaul) via [#314](https://github.com/10up/classifai/pull/314), [#336](https://github.com/10up/classifai/pull/336)).
- CodeQL Analysis code scanning and Dependency security scanning actions (props [@jeffpaul](https://github.com/jeffpaul) via [#314](https://github.com/10up/classifai/pull/314), [#336](https://github.com/10up/classifai/pull/336)).

### Changed
- Bump WordPress "tested up to" version 5.9 (props [@s3rgiosan](https://github.com/s3rgiosan), [@jeffpaul](https://github.com/jeffpaul) via [#327](https://github.com/10up/classifai/pull/327)).
2 changes: 1 addition & 1 deletion hookdocs/useful-snippets.md
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ class MyProvider extends Provider {
*
* All Features will end up calling the rest_endpoint_callback method for their assigned Provider.
* This method should validate the route that is being called and then call the appropriate method
* for that route. This method typically will validate we have all the requried data and if so,
* for that route. This method typically will validate we have all the required data and if so,
* make a request to the appropriate API endpoint.
*
* @param int $post_id The Post ID we're processing.
2 changes: 1 addition & 1 deletion includes/Classifai/Admin/Onboarding.php
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public function __construct() {
}

/**
* Inintialize the class and register the actions needed.
* Initialize the class and register the actions needed.
*/
public function init() {
add_action( 'admin_menu', [ $this, 'register_setup_page' ] );
2 changes: 1 addition & 1 deletion includes/Classifai/Admin/Settings.php
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ class Settings {
public function __construct() {}

/**
* Inintialize the class and register the actions needed.
* Initialize the class and register the actions needed.
*/
public function init() {
add_action( 'admin_menu', [ $this, 'register_settings_page' ] );
4 changes: 2 additions & 2 deletions includes/Classifai/Admin/UserProfile.php
Original file line number Diff line number Diff line change
@@ -105,9 +105,9 @@ public function save_user_settings( int $user_id ) {
return;
}

$opted_out_feautures = isset( $_POST['classifai_opted_out_features'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['classifai_opted_out_features'] ) ) : array();
$opted_out_features = isset( $_POST['classifai_opted_out_features'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['classifai_opted_out_features'] ) ) : array();

update_user_meta( $user_id, $this->opt_out_key, $opted_out_feautures );
update_user_meta( $user_id, $this->opt_out_key, $opted_out_features );
}

/**
2 changes: 1 addition & 1 deletion includes/Classifai/Features/Classification.php
Original file line number Diff line number Diff line change
@@ -458,7 +458,7 @@ public function render_meta_box( \WP_Post $post ) {
</label>
</p>

<div class="classifai-clasify-post-wrapper" style="display: none;">
<div class="classifai-classify-post-wrapper" style="display: none;">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is a typo, because this is used as a class name, we'll need to decide if we want to leave this as-is, as others may be relying on this class for styling purposes and updating this will break things for them. Not overly concerned but something for us to consider

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding additional details here that this is used in the classic editor only.

<a href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=classifai_classify_post&post_id=' . $post->ID ), 'classifai_classify_post_action', 'classifai_classify_post_nonce' ) ); ?>" class="button button-classify-post">
<?php esc_html_e( 'Suggest terms & tags', 'classifai' ); ?>
</a>
2 changes: 1 addition & 1 deletion includes/Classifai/Features/PDFTextExtraction.php
Original file line number Diff line number Diff line change
@@ -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' ],
2 changes: 1 addition & 1 deletion includes/Classifai/Features/Smart404EPIntegration.php
Original file line number Diff line number Diff line change
@@ -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.
28 changes: 14 additions & 14 deletions includes/Classifai/Features/TermCleanup.php
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion includes/Classifai/Features/TermCleanupEPIntegration.php
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 3 additions & 3 deletions includes/Classifai/Helpers.php
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions includes/Classifai/Providers/Azure/Embeddings.php
Original file line number Diff line number Diff line change
@@ -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 ) {
2 changes: 1 addition & 1 deletion includes/Classifai/Providers/Azure/OpenAI.php
Original file line number Diff line number Diff line change
@@ -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 ) ) ) {
2 changes: 1 addition & 1 deletion includes/Classifai/Providers/GoogleAI/APIRequest.php
Original file line number Diff line number Diff line change
@@ -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 ) ) ) {
2 changes: 1 addition & 1 deletion includes/Classifai/Providers/OpenAI/APIRequest.php
Original file line number Diff line number Diff line change
@@ -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 {
4 changes: 2 additions & 2 deletions includes/Classifai/Providers/OpenAI/Embeddings.php
Original file line number Diff line number Diff line change
@@ -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 ) {
2 changes: 1 addition & 1 deletion includes/Classifai/Providers/XAI/APIRequest.php
Original file line number Diff line number Diff line change
@@ -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 );
}
4 changes: 2 additions & 2 deletions includes/Classifai/TermCleanupScheduler.php
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 2 additions & 2 deletions src/js/features/classification/previewer.js
Original file line number Diff line number Diff line change
@@ -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'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide we don't want to change this class name (mentioned in another comment) we'll want to revert this change as well

);
if ( this.checked === true ) {
classifyButton.style.display = 'none';
2 changes: 1 addition & 1 deletion src/js/features/classification/taxonomy-controls.js
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ const TaxonomyControls = ( { onChange, query } ) => {
// Append newTerm to taxoInfo.terms.
const terms = {
...taxoInfo.terms,
entitites: [
entities: [
...taxoInfo.terms.entities,
newTerm,
],
2 changes: 1 addition & 1 deletion src/js/helpers.js
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/js/settings/components/provider-settings/index.js
Original file line number Diff line number Diff line change
@@ -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 <AzureTextToSpeechSettings isConfigured={ isConfigured } />;

case 'openai_text_to_speech':
return <OpenAITextToSpeachSettings isConfigured={ isConfigured } />;
return <OpenAITextToSpeechSettings isConfigured={ isConfigured } />;

case 'xai_grok':
return <XAIGrokSettings isConfigured={ isConfigured } />;
Original file line number Diff line number Diff line change
@@ -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 ) =>
2 changes: 1 addition & 1 deletion src/scss/admin.scss
Original file line number Diff line number Diff line change
@@ -870,7 +870,7 @@ input.classifai-button {
}

// Start: Classify Post Modal
.classify-post-componenet {
.classify-post-component {
hr {
margin-bottom: 20px;
}
4 changes: 2 additions & 2 deletions tests/Classifai/Providers/Azure/SmartCroppingTest.php
Original file line number Diff line number Diff line change
@@ -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;
}

/**

Unchanged files with check annotations Beta

{

Check warning on line 1 in composer.json

GitHub Actions / test

missing_composer_json_file

The &quot;/vendor&quot; directory using composer exists, but &quot;composer.json&quot; file is missing.
"name": "10up/classifai",
"description": "Enhance your WordPress content with Artificial Intelligence and Machine Learning services.",
"authors": [
* Registers the settings for the feature.
*/
public function register_setting() {
register_setting(

Check warning on line 335 in includes/Classifai/Features/Feature.php

GitHub Actions / test

PluginCheck.CodeAnalysis.SettingSanitization.register_settingDynamic

Dynamic argument passed in third parameter of register_setting(). Please ensure proper sanitization.
$this->get_option_name(),
$this->get_option_name(),
[
* Register the settings and sanitization callback method.
*/
public function register_settings() {
register_setting( 'classifai_settings', 'classifai_settings', [ $this, 'sanitize_settings' ] );

Check warning on line 175 in includes/Classifai/Services/ServicesManager.php

GitHub Actions / test

PluginCheck.CodeAnalysis.SettingSanitization.register_settingDynamic

Dynamic argument passed in third parameter of register_setting(). Please ensure proper sanitization.
}
/**