diff --git a/.gitignore b/.gitignore
index 9241ae0d8..0ee1de6db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ phpunit.xml
coverage
/docs
languages
+strauss.phar
debug.log
diff --git a/includes/Classifai/Features/Prompts/ContentResizing/condense.php b/includes/Classifai/Features/Prompts/WritingTools/condense.php
similarity index 93%
rename from includes/Classifai/Features/Prompts/ContentResizing/condense.php
rename to includes/Classifai/Features/Prompts/WritingTools/condense.php
index d575b38dd..3e47049af 100644
--- a/includes/Classifai/Features/Prompts/ContentResizing/condense.php
+++ b/includes/Classifai/Features/Prompts/WritingTools/condense.php
@@ -1,6 +1,6 @@
label = __( 'Content Resizing', 'classifai' );
+ $this->label = __( 'Writing Tools', 'classifai' );
// Contains all providers that are registered to the service.
$this->provider_instances = $this->get_provider_instances( LanguageProcessing::get_service_providers() );
@@ -111,7 +111,7 @@ public function register_endpoints() {
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'validate_callback' => 'rest_validate_request_arg',
- 'description' => esc_html__( 'The type of resize operation. "expand" or "condense".', 'classifai' ),
+ 'description' => esc_html__( 'The type of resize operation. "expand", "condense", or "fix_grammar".', 'classifai' ),
),
),
)
@@ -142,7 +142,7 @@ public function resize_content_permissions_check( WP_REST_Request $request ) {
// Ensure the feature is enabled. Also runs a user check.
if ( ! $this->is_feature_enabled() ) {
- return new WP_Error( 'not_enabled', esc_html__( 'Content resizing is not currently enabled.', 'classifai' ) );
+ return new WP_Error( 'not_enabled', esc_html__( 'Writing tools are not currently enabled.', 'classifai' ) );
}
return true;
@@ -184,18 +184,18 @@ public function enqueue_editor_assets() {
}
wp_enqueue_script(
- 'classifai-plugin-content-resizing-js',
- CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-content-resizing.js',
- array_merge( get_asset_info( 'classifai-plugin-content-resizing', 'dependencies' ), array( 'lodash' ) ),
- get_asset_info( 'classifai-plugin-content-resizing', 'version' ),
+ 'classifai-plugin-writing-tools-js',
+ CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-writing-tools.js',
+ array_merge( get_asset_info( 'classifai-plugin-writing-tools', 'dependencies' ), [ 'lodash' ] ),
+ get_asset_info( 'classifai-plugin-writing-tools', 'version' ),
true
);
wp_enqueue_style(
- 'classifai-plugin-content-resizing-css',
- CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-content-resizing.css',
- array(),
- get_asset_info( 'classifai-plugin-content-resizing', 'version' ),
+ 'classifai-plugin-writing-tools-css',
+ CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-writing-tools.css',
+ [],
+ get_asset_info( 'classifai-plugin-writing-tools', 'version' ),
'all'
);
}
@@ -206,7 +206,7 @@ public function enqueue_editor_assets() {
* @return string
*/
public function get_enable_description(): string {
- return esc_html__( '"Condense this text" and "Expand this text" menu items will be added to the paragraph block\'s toolbar menu.', 'classifai' );
+ return esc_html__( '"Condense this text", "Expand this text", and "Fix grammar and spelling" menu items will be added to the paragraph block\'s toolbar menu.', 'classifai' );
}
/**
@@ -242,6 +242,20 @@ public function add_custom_settings_fields() {
'description' => esc_html__( 'Enter your custom prompt.', 'classifai' ),
)
);
+
+ add_settings_field(
+ 'fix_grammar_text_prompt',
+ esc_html__( 'Fix grammar and spelling', 'classifai' ),
+ [ $this, 'render_prompt_repeater_field' ],
+ $this->get_option_name(),
+ $this->get_option_name() . '_section',
+ [
+ 'label_for' => 'fix_grammar_text_prompt',
+ 'placeholder' => esc_html__( 'Please correct any spelling errors and grammatical mistakes in the following text', 'classifai' ),
+ 'default_value' => $settings['fix_grammar_text_prompt'],
+ 'description' => esc_html__( 'Enter your custom prompt.', 'classifai' ),
+ ]
+ );
}
/**
@@ -250,23 +264,30 @@ public function add_custom_settings_fields() {
* @return array
*/
public function get_feature_default_settings(): array {
- return array(
- 'condense_text_prompt' => array(
- array(
+ return [
+ 'condense_text_prompt' => [
+ [
'title' => esc_html__( 'ClassifAI default', 'classifai' ),
'prompt' => $this->get_prompt( 'condense' ),
'original' => 1,
- ),
- ),
- 'expand_text_prompt' => array(
- array(
+ ],
+ ],
+ 'expand_text_prompt' => [
+ [
'title' => esc_html__( 'ClassifAI default', 'classifai' ),
'prompt' => $this->get_prompt( 'expand' ),
'original' => 1,
- ),
- ),
- 'provider' => ChatGPT::ID,
- );
+ ],
+ ],
+ 'fix_grammar_text_prompt' => [
+ [
+ 'title' => esc_html__( 'ClassifAI default', 'classifai' ),
+ 'prompt' => $this->get_prompt( 'fix_grammar' ),
+ 'original' => 1,
+ ],
+ ],
+ 'provider' => ChatGPT::ID,
+ ];
}
/**
@@ -297,6 +318,15 @@ public function get_settings( $index = false ) {
}
}
+ if ( $settings && ! empty( $settings['fix_grammar_text_prompt'] ) ) {
+ foreach ( $settings['fix_grammar_text_prompt'] as $key => $prompt ) {
+ if ( 1 === intval( $prompt['original'] ) ) {
+ $settings['fix_grammar_text_prompt'][ $key ]['prompt'] = $this->get_prompt( 'fix_grammar' );
+ break;
+ }
+ }
+ }
+
return $settings;
}
@@ -309,8 +339,9 @@ public function get_settings( $index = false ) {
public function sanitize_default_feature_settings( array $new_settings ): array {
$settings = $this->get_settings();
- $new_settings['condense_text_prompt'] = sanitize_prompts( 'condense_text_prompt', $new_settings );
- $new_settings['expand_text_prompt'] = sanitize_prompts( 'expand_text_prompt', $new_settings );
+ $new_settings['condense_text_prompt'] = sanitize_prompts( 'condense_text_prompt', $new_settings );
+ $new_settings['expand_text_prompt'] = sanitize_prompts( 'expand_text_prompt', $new_settings );
+ $new_settings['fix_grammar_text_prompt'] = sanitize_prompts( 'fix_grammar_text_prompt', $new_settings );
return $new_settings;
}
diff --git a/includes/Classifai/Plugin.php b/includes/Classifai/Plugin.php
index c41184f02..fcf297abc 100644
--- a/includes/Classifai/Plugin.php
+++ b/includes/Classifai/Plugin.php
@@ -402,7 +402,7 @@ public function maybe_migrate_to_v3() {
if ( ! empty( $chatgpt_settings ) ) {
$features[] = \Classifai\Features\TitleGeneration::class;
$features[] = \Classifai\Features\ExcerptGeneration::class;
- $features[] = \Classifai\Features\ContentResizing::class;
+ $features[] = \Classifai\Features\WritingTools::class;
}
if ( ! empty( $tts_settings ) ) {
diff --git a/includes/Classifai/Providers/Azure/OpenAI.php b/includes/Classifai/Providers/Azure/OpenAI.php
index a4fcb5854..f6f6e67d2 100644
--- a/includes/Classifai/Providers/Azure/OpenAI.php
+++ b/includes/Classifai/Providers/Azure/OpenAI.php
@@ -5,7 +5,7 @@
namespace Classifai\Providers\Azure;
-use Classifai\Features\ContentResizing;
+use Classifai\Features\WritingTools;
use Classifai\Features\ExcerptGeneration;
use Classifai\Features\TitleGeneration;
use Classifai\Features\ContentGeneration;
@@ -142,7 +142,7 @@ public function render_provider_fields() {
);
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
add_settings_field(
static::ID . '_number_of_suggestions',
@@ -184,7 +184,7 @@ public function get_default_provider_settings(): array {
* Default values for feature specific settings.
*/
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$common_settings['number_of_suggestions'] = 1;
break;
@@ -221,7 +221,7 @@ public function sanitize_settings( array $new_settings ): array {
$new_settings[ static::ID ]['deployment'] = sanitize_text_field( $new_settings[ static::ID ]['deployment'] ?? $settings[ static::ID ]['deployment'] );
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$new_settings[ static::ID ]['number_of_suggestions'] = sanitize_number_of_responses_field( 'number_of_suggestions', $new_settings[ static::ID ], $settings[ static::ID ] );
break;
@@ -246,7 +246,7 @@ protected function prep_api_url( ?\Classifai\Features\Feature $feature = null ):
}
if (
- ( $feature instanceof ContentResizing ||
+ ( $feature instanceof WritingTools ||
$feature instanceof ExcerptGeneration ||
$feature instanceof TitleGeneration ||
$feature instanceof KeyTakeaways ||
@@ -584,7 +584,7 @@ public function resize_content( int $post_id, array $args = array() ) {
return new WP_Error( 'post_id_required', esc_html__( 'Post ID is required to resize content.', 'classifai' ) );
}
- $feature = new ContentResizing();
+ $feature = new WritingTools();
$settings = $feature->get_settings();
$args = wp_parse_args(
@@ -596,6 +596,8 @@ public function resize_content( int $post_id, array $args = array() ) {
if ( 'shrink' === $args['resize_type'] ) {
$prompt = esc_textarea( get_default_prompt( $settings['condense_text_prompt'] ) ?? $feature->get_prompt( 'condense' ) );
+ } elseif ( 'fix_grammar' === $args['resize_type'] ) {
+ $prompt = esc_textarea( get_default_prompt( $settings['fix_grammar_text_prompt'] ) ?? $feature->get_prompt( 'fix_grammar' ) );
} else {
$prompt = esc_textarea( get_default_prompt( $settings['expand_text_prompt'] ) ?? $feature->get_prompt( 'expand' ) );
}
@@ -657,7 +659,7 @@ public function resize_content( int $post_id, array $args = array() ) {
);
$response = $this->get_result( $response );
- set_transient( 'classifai_azure_openai_content_resizing_latest_response', $response, DAY_IN_SECONDS * 30 );
+ set_transient( 'classifai_azure_openai_writing_tools_latest_response', $response, DAY_IN_SECONDS * 30 );
if ( is_wp_error( $response ) ) {
return $response;
@@ -1080,11 +1082,12 @@ public function get_debug_information(): array {
$debug_info[ __( 'Excerpt length', 'classifai' ) ] = $settings['length'] ?? 55;
$debug_info[ __( 'Generate excerpt prompt', 'classifai' ) ] = wp_json_encode( $settings['generate_excerpt_prompt'] ?? array() );
$debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_azure_openai_excerpt_generation_latest_response' ) );
- } elseif ( $this->feature_instance instanceof ContentResizing ) {
- $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = $provider_settings['number_of_suggestions'] ?? 1;
- $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? array() );
- $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? array() );
- $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_azure_openai_content_resizing_latest_response' ) );
+ } elseif ( $this->feature_instance instanceof WritingTools ) {
+ $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = $provider_settings['number_of_suggestions'] ?? 1;
+ $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? [] );
+ $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? [] );
+ $debug_info[ __( 'Fix grammar and spelling', 'classifai' ) ] = wp_json_encode( $settings['fix_grammar_text_prompt'] ?? [] );
+ $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_azure_openai_writing_tools_latest_response' ) );
}
return apply_filters(
diff --git a/includes/Classifai/Providers/Browser/ChromeAI.php b/includes/Classifai/Providers/Browser/ChromeAI.php
index 9cd752730..9ff904cc1 100644
--- a/includes/Classifai/Providers/Browser/ChromeAI.php
+++ b/includes/Classifai/Providers/Browser/ChromeAI.php
@@ -5,7 +5,7 @@
namespace Classifai\Providers\Browser;
-use Classifai\Features\ContentResizing;
+use Classifai\Features\WritingTools;
use Classifai\Features\ExcerptGeneration;
use Classifai\Features\TitleGeneration;
use Classifai\Providers\Provider;
@@ -283,11 +283,13 @@ public function resize_content( int $post_id, array $args = array() ) {
return new WP_Error( 'post_id_required', esc_html__( 'Post ID is required to resize content.', 'classifai' ) );
}
- $feature = new ContentResizing();
+ $feature = new WritingTools();
$settings = $feature->get_settings();
if ( 'shrink' === $args['resize_type'] ) {
$prompt = esc_textarea( get_default_prompt( $settings['condense_text_prompt'] ) ?? $feature->get_prompt( 'condense' ) );
+ } elseif ( 'fix_grammar' === $args['resize_type'] ) {
+ $prompt = esc_textarea( get_default_prompt( $settings['fix_grammar_text_prompt'] ) ?? $feature->get_prompt( 'fix_grammar' ) );
} else {
$prompt = esc_textarea( get_default_prompt( $settings['expand_text_prompt'] ) ?? $feature->get_prompt( 'expand' ) );
}
diff --git a/includes/Classifai/Providers/GoogleAI/GeminiAPI.php b/includes/Classifai/Providers/GoogleAI/GeminiAPI.php
index 9fd9ffcab..53c6f8170 100644
--- a/includes/Classifai/Providers/GoogleAI/GeminiAPI.php
+++ b/includes/Classifai/Providers/GoogleAI/GeminiAPI.php
@@ -5,7 +5,7 @@
namespace Classifai\Providers\GoogleAI;
-use Classifai\Features\ContentResizing;
+use Classifai\Features\WritingTools;
use Classifai\Features\ExcerptGeneration;
use Classifai\Features\TitleGeneration;
use Classifai\Providers\Provider;
@@ -439,7 +439,7 @@ public function resize_content( int $post_id, array $args = array() ) {
return new WP_Error( 'post_id_required', esc_html__( 'Post ID is required to resize content.', 'classifai' ) );
}
- $feature = new ContentResizing();
+ $feature = new WritingTools();
$settings = $feature->get_settings();
$args = wp_parse_args(
@@ -453,6 +453,8 @@ public function resize_content( int $post_id, array $args = array() ) {
if ( 'shrink' === $args['resize_type'] ) {
$prompt = esc_textarea( get_default_prompt( $settings['condense_text_prompt'] ) ?? $feature->get_prompt( 'condense' ) );
+ } elseif ( 'fix_grammar' === $args['resize_type'] ) {
+ $prompt = esc_textarea( get_default_prompt( $settings['fix_grammar_text_prompt'] ) ?? $feature->get_prompt( 'fix_grammar' ) );
} else {
$prompt = esc_textarea( get_default_prompt( $settings['expand_text_prompt'] ) ?? $feature->get_prompt( 'expand' ) );
}
@@ -510,7 +512,7 @@ public function resize_content( int $post_id, array $args = array() ) {
)
);
- set_transient( 'classifai_googleai_gemini_api_content_resizing_latest_response', $response, DAY_IN_SECONDS * 30 );
+ set_transient( 'classifai_googleai_gemini_api_writing_tools_latest_response', $response, DAY_IN_SECONDS * 30 );
if ( is_wp_error( $response ) ) {
return $response;
@@ -595,11 +597,12 @@ public function get_debug_information(): array {
$debug_info[ __( 'Excerpt length', 'classifai' ) ] = $settings['length'] ?? 55;
$debug_info[ __( 'Generate excerpt prompt', 'classifai' ) ] = wp_json_encode( $settings['generate_excerpt_prompt'] ?? array() );
$debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_googleai_gemini_api_excerpt_generation_latest_response' ) );
- } elseif ( $this->feature_instance instanceof ContentResizing ) {
- $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = 1;
- $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? array() );
- $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? array() );
- $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_googleai_gemini_api_content_resizing_latest_response' ) );
+ } elseif ( $this->feature_instance instanceof WritingTools ) {
+ $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = 1;
+ $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? [] );
+ $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? [] );
+ $debug_info[ __( 'Fix grammar and spelling', 'classifai' ) ] = wp_json_encode( $settings['fix_grammar_text_prompt'] ?? [] );
+ $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_googleai_gemini_api_writing_tools_latest_response' ) );
}
return apply_filters(
diff --git a/includes/Classifai/Providers/Localhost/Ollama.php b/includes/Classifai/Providers/Localhost/Ollama.php
index 75eda18a0..e6f7d457d 100644
--- a/includes/Classifai/Providers/Localhost/Ollama.php
+++ b/includes/Classifai/Providers/Localhost/Ollama.php
@@ -7,7 +7,7 @@
use Classifai\Providers\Provider;
use Classifai\Providers\OpenAI\APIRequest;
-use Classifai\Features\ContentResizing;
+use Classifai\Features\WritingTools;
use Classifai\Features\ExcerptGeneration;
use Classifai\Features\TitleGeneration;
use Classifai\Features\ContentGeneration;
@@ -54,7 +54,7 @@ public function get_default_provider_settings(): array {
* Default values for feature specific settings.
*/
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$common_settings['number_of_suggestions'] = 1;
break;
@@ -114,7 +114,7 @@ public function sanitize_settings( array $new_settings ): array {
$new_settings[ static::ID ]['model'] = sanitize_text_field( $new_settings[ static::ID ]['model'] ?? $settings[ static::ID ]['model'] );
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$new_settings[ static::ID ]['number_of_suggestions'] = sanitize_number_of_responses_field( 'number_of_suggestions', $new_settings[ static::ID ], $settings[ static::ID ] );
break;
@@ -422,7 +422,7 @@ public function resize_content( int $post_id, array $args = array() ) {
return new WP_Error( 'post_id_required', esc_html__( 'Post ID is required to resize content.', 'classifai' ) );
}
- $feature = new ContentResizing();
+ $feature = new WritingTools();
$settings = $feature->get_settings();
$args = wp_parse_args(
@@ -435,6 +435,8 @@ public function resize_content( int $post_id, array $args = array() ) {
if ( 'shrink' === $args['resize_type'] ) {
$prompt = esc_textarea( get_default_prompt( $settings['condense_text_prompt'] ) ?? $feature->get_prompt( 'condense' ) );
+ } elseif ( 'fix_grammar' === $args['resize_type'] ) {
+ $prompt = esc_textarea( get_default_prompt( $settings['fix_grammar_text_prompt'] ) ?? $feature->get_prompt( 'fix_grammar' ) );
} else {
$prompt = esc_textarea( get_default_prompt( $settings['expand_text_prompt'] ) ?? $feature->get_prompt( 'expand' ) );
}
diff --git a/includes/Classifai/Providers/OpenAI/ChatGPT.php b/includes/Classifai/Providers/OpenAI/ChatGPT.php
index fc8ac255c..9b2664403 100644
--- a/includes/Classifai/Providers/OpenAI/ChatGPT.php
+++ b/includes/Classifai/Providers/OpenAI/ChatGPT.php
@@ -5,7 +5,7 @@
namespace Classifai\Providers\OpenAI;
-use Classifai\Features\ContentResizing;
+use Classifai\Features\WritingTools;
use Classifai\Features\DescriptiveTextGenerator;
use Classifai\Features\ImageTextExtraction;
use Classifai\Features\ImageTagsGenerator;
@@ -115,7 +115,7 @@ public function render_provider_fields() {
);
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
add_settings_field(
static::ID . '_number_of_suggestions',
@@ -155,7 +155,7 @@ public function get_default_provider_settings(): array {
* Default values for feature specific settings.
*/
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$common_settings['number_of_suggestions'] = 1;
break;
@@ -191,7 +191,7 @@ public function sanitize_settings( array $new_settings ): array {
$new_settings[ static::ID ]['authenticated'] = $api_key_settings[ static::ID ]['authenticated'];
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$new_settings[ static::ID ]['number_of_suggestions'] = sanitize_number_of_responses_field( 'number_of_suggestions', $new_settings[ static::ID ], $settings[ static::ID ] );
break;
@@ -847,7 +847,7 @@ public function resize_content( int $post_id, array $args = array() ) {
return new WP_Error( 'post_id_required', esc_html__( 'Post ID is required to resize content.', 'classifai' ) );
}
- $feature = new ContentResizing();
+ $feature = new WritingTools();
$settings = $feature->get_settings();
$args = wp_parse_args(
@@ -861,6 +861,8 @@ public function resize_content( int $post_id, array $args = array() ) {
if ( 'shrink' === $args['resize_type'] ) {
$prompt = esc_textarea( get_default_prompt( $settings['condense_text_prompt'] ) ?? $feature->get_prompt( 'condense' ) );
+ } elseif ( 'fix_grammar' === $args['resize_type'] ) {
+ $prompt = esc_textarea( get_default_prompt( $settings['fix_grammar_text_prompt'] ) ?? $feature->get_prompt( 'fix_grammar' ) );
} else {
$prompt = esc_textarea( get_default_prompt( $settings['expand_text_prompt'] ) ?? $feature->get_prompt( 'expand' ) );
}
@@ -918,7 +920,7 @@ public function resize_content( int $post_id, array $args = array() ) {
)
);
- set_transient( 'classifai_openai_chatgpt_content_resizing_latest_response', $response, DAY_IN_SECONDS * 30 );
+ set_transient( 'classifai_openai_chatgpt_writing_tools_latest_response', $response, DAY_IN_SECONDS * 30 );
if ( is_wp_error( $response ) ) {
return $response;
@@ -1403,11 +1405,12 @@ public function get_debug_information(): array {
$debug_info[ __( 'Excerpt length', 'classifai' ) ] = $settings['length'] ?? 55;
$debug_info[ __( 'Generate excerpt prompt', 'classifai' ) ] = wp_json_encode( $settings['generate_excerpt_prompt'] ?? array() );
$debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_openai_chatgpt_excerpt_generation_latest_response' ) );
- } elseif ( $this->feature_instance instanceof ContentResizing ) {
- $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = $provider_settings['number_of_suggestions'] ?? 1;
- $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? array() );
- $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? array() );
- $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_openai_chatgpt_content_resizing_latest_response' ) );
+ } elseif ( $this->feature_instance instanceof WritingTools ) {
+ $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = $provider_settings['number_of_suggestions'] ?? 1;
+ $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? [] );
+ $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? [] );
+ $debug_info[ __( 'Fix grammar and spelling', 'classifai' ) ] = wp_json_encode( $settings['fix_grammar_text_prompt'] ?? [] );
+ $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_openai_chatgpt_writing_tools_latest_response' ) );
}
return apply_filters(
diff --git a/includes/Classifai/Providers/XAI/Grok.php b/includes/Classifai/Providers/XAI/Grok.php
index f527d29e9..dc23f1d0c 100644
--- a/includes/Classifai/Providers/XAI/Grok.php
+++ b/includes/Classifai/Providers/XAI/Grok.php
@@ -5,7 +5,7 @@
namespace Classifai\Providers\XAI;
-use Classifai\Features\ContentResizing;
+use Classifai\Features\WritingTools;
use Classifai\Features\DescriptiveTextGenerator;
use Classifai\Features\ExcerptGeneration;
use Classifai\Features\TitleGeneration;
@@ -139,7 +139,7 @@ public function get_default_provider_settings(): array {
* Default values for feature specific settings.
*/
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$common_settings['number_of_suggestions'] = 1;
break;
@@ -181,7 +181,7 @@ public function sanitize_settings( array $new_settings ): array {
$new_settings[ static::ID ]['models'] = $api_key_settings[ static::ID ]['models'];
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
$new_settings[ static::ID ]['number_of_suggestions'] = sanitize_number_of_responses_field( 'number_of_suggestions', $new_settings[ static::ID ], $settings[ static::ID ] );
break;
@@ -221,7 +221,7 @@ public function sanitize_api_key_settings( array $new_settings = array(), array
} else {
$new_settings[ static::ID ]['authenticated'] = true;
switch ( $this->feature_instance::ID ) {
- case ContentResizing::ID:
+ case WritingTools::ID:
case TitleGeneration::ID:
case ExcerptGeneration::ID:
$text_models = array_filter( $models, fn( $model ) => in_array( 'text', $model['input_modalities'], true ) );
@@ -672,7 +672,7 @@ public function resize_content( int $post_id, array $args = array() ) {
return new WP_Error( 'post_id_required', esc_html__( 'Post ID is required to resize content.', 'classifai' ) );
}
- $feature = new ContentResizing();
+ $feature = new WritingTools();
$settings = $feature->get_settings();
$args = wp_parse_args(
@@ -686,6 +686,8 @@ public function resize_content( int $post_id, array $args = array() ) {
if ( 'shrink' === $args['resize_type'] ) {
$prompt = esc_textarea( get_default_prompt( $settings['condense_text_prompt'] ) ?? $feature->get_prompt( 'condense' ) );
+ } elseif ( 'fix_grammar' === $args['resize_type'] ) {
+ $prompt = esc_textarea( get_default_prompt( $settings['fix_grammar_text_prompt'] ) ?? $feature->get_prompt( 'fix_grammar' ) );
} else {
$prompt = esc_textarea( get_default_prompt( $settings['expand_text_prompt'] ) ?? $feature->get_prompt( 'expand' ) );
}
@@ -744,7 +746,7 @@ public function resize_content( int $post_id, array $args = array() ) {
)
);
- set_transient( 'classifai_xai_grok_content_resizing_latest_response', $response, DAY_IN_SECONDS * 30 );
+ set_transient( 'classifai_xai_grok_writing_tools_latest_response', $response, DAY_IN_SECONDS * 30 );
if ( is_wp_error( $response ) ) {
return $response;
@@ -848,11 +850,12 @@ public function get_debug_information(): array {
$debug_info[ __( 'Excerpt length', 'classifai' ) ] = $settings['length'] ?? 55;
$debug_info[ __( 'Generate excerpt prompt', 'classifai' ) ] = wp_json_encode( $settings['generate_excerpt_prompt'] ?? array() );
$debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_xai_grok_excerpt_generation_latest_response' ) );
- } elseif ( $this->feature_instance instanceof ContentResizing ) {
- $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = $provider_settings['number_of_suggestions'] ?? 1;
- $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? array() );
- $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? array() );
- $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_xai_grok_content_resizing_latest_response' ) );
+ } elseif ( $this->feature_instance instanceof WritingTools ) {
+ $debug_info[ __( 'No. of suggestions', 'classifai' ) ] = $provider_settings['number_of_suggestions'] ?? 1;
+ $debug_info[ __( 'Expand text prompt', 'classifai' ) ] = wp_json_encode( $settings['expand_text_prompt'] ?? [] );
+ $debug_info[ __( 'Condense text prompt', 'classifai' ) ] = wp_json_encode( $settings['condense_text_prompt'] ?? [] );
+ $debug_info[ __( 'Fix grammar and spelling', 'classifai' ) ] = wp_json_encode( $settings['fix_grammar_text_prompt'] ?? [] );
+ $debug_info[ __( 'Latest response', 'classifai' ) ] = $this->get_formatted_latest_response( get_transient( 'classifai_xai_grok_writing_tools_latest_response' ) );
}
return apply_filters(
diff --git a/includes/Classifai/Services/ServicesManager.php b/includes/Classifai/Services/ServicesManager.php
index 7bce29632..933cc0036 100644
--- a/includes/Classifai/Services/ServicesManager.php
+++ b/includes/Classifai/Services/ServicesManager.php
@@ -83,7 +83,7 @@ public function register_language_processing_features( array $features ): array
'\Classifai\Features\TitleGeneration',
'\Classifai\Features\ExcerptGeneration',
'\Classifai\Features\ContentGeneration',
- '\Classifai\Features\ContentResizing',
+ '\Classifai\Features\WritingTools',
'\Classifai\Features\KeyTakeaways',
'\Classifai\Features\TextToSpeech',
'\Classifai\Features\AudioTranscriptsGeneration',
diff --git a/src/js/features/content-resizing/index.js b/src/js/features/writing-tools/index.js
similarity index 94%
rename from src/js/features/content-resizing/index.js
rename to src/js/features/writing-tools/index.js
index d388ade60..e60100164 100644
--- a/src/js/features/content-resizing/index.js
+++ b/src/js/features/writing-tools/index.js
@@ -120,7 +120,7 @@ const resizeContentStore = createReduxStore( 'resize-content-store', {
register( resizeContentStore );
-const ContentResizingPlugin = () => {
+const WritingToolsPlugin = () => {
// Holds the original text of the block being processed.
const [ blockContentAsPlainText, setBlockContentAsPlainText ] =
useState( '' );
@@ -164,7 +164,17 @@ const ContentResizingPlugin = () => {
'Expanded text suggestion',
'Expanded text suggestions',
textArray.length,
- 'Modal title after expand content resizing.',
+ 'Modal title after expand writing tools.',
+ 'classifai'
+ )
+ );
+ } else if ( 'fix_grammar' === resizingType ) {
+ setModalTitle(
+ _nx(
+ 'Grammar and spelling correction suggestion',
+ 'Grammar and spelling correction suggestions',
+ textArray.length,
+ 'Modal title after fix grammar writing tools.',
'classifai'
)
);
@@ -174,7 +184,7 @@ const ContentResizingPlugin = () => {
'Condensed text suggestion',
'Condensed text suggestions',
textArray.length,
- 'Modal title after condense content resizing.',
+ 'Modal title after condense writing tools.',
'classifai'
)
);
@@ -204,7 +214,7 @@ const ContentResizingPlugin = () => {
/**
* Refreshes results.
*
- * @param {string} resizingType Type of resizing. grow|shrink|null
+ * @param {string} resizingType Type of resizing. grow|shrink|fix_grammar|null
* @param {Block} selectedBlock The selected block.
*/
async function refreshResults( resizingType, selectedBlock ) {
@@ -218,7 +228,7 @@ const ContentResizingPlugin = () => {
}
/**
- * Triggered when either `Grow content` or `Shrink content` is clicked from
+ * Triggered when `Expand this text`, `Condense this text`, or `Fix grammar and spelling` is clicked from
* the Block's "more options" menu.
*
* @return {void}
@@ -319,7 +329,7 @@ const ContentResizingPlugin = () => {
}
}
- // We don't want to use the reszing feature when multiple blocks are selected.
+ // We don't want to use the resizing feature when multiple blocks are selected.
// Nor do we want to use it when a block's content resizing is under process.
if ( isMultiBlocksSelected || isResizing ) {
return null;
@@ -475,8 +485,8 @@ function toPlainText( html ) {
return plainText.replace( /\n\n+/g, '\n\n' );
}
-registerPlugin( 'classifai-plugin-content-resizing', {
- render: ContentResizingPlugin,
+registerPlugin( 'classifai-plugin-writing-tools', {
+ render: WritingToolsPlugin,
} );
const colorsArray = [ '#8c2525', '#ca4444', '#303030' ];
@@ -637,6 +647,17 @@ const withBlockControls = createHigherOrderComponent( ( BlockEdit ) => {
).setResizingType( 'shrink' );
},
},
+ {
+ title: __(
+ 'Fix grammar and spelling',
+ 'classifai'
+ ),
+ onClick: () => {
+ dispatch(
+ resizeContentStore
+ ).setResizingType( 'fix_grammar' );
+ },
+ },
] }
/>
diff --git a/src/js/features/content-resizing/index.scss b/src/js/features/writing-tools/index.scss
similarity index 100%
rename from src/js/features/content-resizing/index.scss
rename to src/js/features/writing-tools/index.scss
diff --git a/src/js/settings/components/feature-additional-settings/index.js b/src/js/settings/components/feature-additional-settings/index.js
index eb8675f85..1d14cd18b 100644
--- a/src/js/settings/components/feature-additional-settings/index.js
+++ b/src/js/settings/components/feature-additional-settings/index.js
@@ -16,7 +16,7 @@ import { ImageToTextGeneratorSettings } from './image-to-text-generator';
import { PDFToTextGenerationSettings } from './pdf-to-text-generation';
import { TextToSpeechSettings } from './text-to-speech';
import { TitleGenerationSettings } from './title-generation';
-import { ContentResizingSettings } from './content-resizing';
+import { WritingToolsSettings } from './writing-tools';
import { ContentGenerationSettings } from './content-generation';
import { ExcerptGenerationSettings } from './excerpt-generation';
import { KeyTakeawaysSettings } from './key-takeaways';
@@ -51,7 +51,7 @@ const AdditionalSettingsFields = () => {
return ;
case 'feature_content_resizing':
- return ;
+ return ;
case 'feature_key_takeaways':
return ;
diff --git a/src/js/settings/components/feature-additional-settings/content-resizing.js b/src/js/settings/components/feature-additional-settings/writing-tools.js
similarity index 68%
rename from src/js/settings/components/feature-additional-settings/content-resizing.js
rename to src/js/settings/components/feature-additional-settings/writing-tools.js
index 51d1a9610..5b1c4a3f1 100644
--- a/src/js/settings/components/feature-additional-settings/content-resizing.js
+++ b/src/js/settings/components/feature-additional-settings/writing-tools.js
@@ -12,13 +12,13 @@ import { STORE_NAME } from '../../data/store';
import { PromptRepeater } from './prompt-repeater';
/**
- * Component for the Content Resizing feature settings.
+ * Component for the Writing Tools feature settings.
*
- * This component is used within the FeatureSettings component to allow users to configure the Content Resizing feature.
+ * This component is used within the FeatureSettings component to allow users to configure the Writing Tools feature.
*
- * @return {React.ReactElement} ContentResizingSettings component.
+ * @return {React.ReactElement} WritingToolsSettings component.
*/
-export const ContentResizingSettings = () => {
+export const WritingToolsSettings = () => {
const featureSettings = useSelect( ( select ) =>
select( STORE_NAME ).getFeatureSettings()
);
@@ -54,6 +54,20 @@ export const ContentResizingSettings = () => {
} }
/>
+
+ {
+ setFeatureSettings( {
+ fix_grammar_text_prompt: prompts,
+ } );
+ } }
+ />
+
>
);
};
diff --git a/tests/e2e/specs/admin/common-feature-fields.spec.ts b/tests/e2e/specs/admin/common-feature-fields.spec.ts
index e5c20a87a..14d3bec08 100644
--- a/tests/e2e/specs/admin/common-feature-fields.spec.ts
+++ b/tests/e2e/specs/admin/common-feature-fields.spec.ts
@@ -5,7 +5,7 @@ const services: Record< string, Record< string, string > > = {
feature_classification: 'Classification',
feature_title_generation: 'Title Generation',
feature_excerpt_generation: 'Excerpt Generation',
- feature_content_resizing: 'Content Resizing',
+ feature_content_resizing: 'Writing Tools',
feature_text_to_speech_generation: 'Text to Speech',
feature_audio_transcripts_generation: 'Audio Transcripts Generation',
},
diff --git a/webpack.config.js b/webpack.config.js
index d813e4e6a..23c848d9a 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -27,7 +27,7 @@ module.exports = {
'classifai-plugin-text-to-speech': './src/js/features/text-to-speech/index.js',
'classifai-plugin-classic-text-to-speech': './src/js/features/text-to-speech/classic/index.js',
'classifai-plugin-text-to-speech-frontend': './src/js/features/text-to-speech/frontend/index.js',
- 'classifai-plugin-content-resizing': './src/js/features/content-resizing/index.js',
+ 'classifai-plugin-writing-tools': './src/js/features/writing-tools/index.js',
'classifai-plugin-title-generation': './src/js/features/title-generation/index.js',
'classifai-plugin-classic-title-generation': './src/js/features/title-generation/classic/index.js',
'classifai-plugin-excerpt-generation': './src/js/features/excerpt-generation/index.js',
diff --git a/wp-hooks-docs/docs/01.get-started/03.pricing.md b/wp-hooks-docs/docs/01.get-started/03.pricing.md
index eedddeb27..4e44890d4 100644
--- a/wp-hooks-docs/docs/01.get-started/03.pricing.md
+++ b/wp-hooks-docs/docs/01.get-started/03.pricing.md
@@ -8,12 +8,12 @@ Note that there is no cost to using ClassifAI itself. Both IBM Watson and Micros
**IBM Watson's Natural Language Understanding** ("NLU"), which is one of the providers that powers the classification feature, has a ["lite" pricing tier](https://www.ibm.com/cloud/watson-natural-language-understanding/pricing) that offers 30,000 free NLU items per month.
-**OpenAI**, which is one of the providers that powers the classification, title generation, excerpt generation, content resizing, audio transcripts generation, text to speech, moderation and image generation features, has a limited free trial and then requires a [pay per usage](https://openai.com/pricing) plan.
+**OpenAI**, which is one of the providers that powers the classification, title generation, excerpt generation, writing tools, audio transcripts generation, text to speech, moderation and image generation features, has a limited free trial and then requires a [pay per usage](https://openai.com/pricing) plan.
**Microsoft Azure AI Vision**, which is one of the providers that powers the descriptive text generator, image tags generator, image cropping, image text extraction and PDF text extraction features, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/computer-vision/) that offers 20 transactions per minute and 5,000 transactions per month.
**Microsoft Azure AI Speech**, which is one of the providers that powers the text to speech feature, has a ["free" pricing tier](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/speech-services/) that offers 0.5 million characters per month.
-**Microsoft Azure OpenAI**, which is one of the providers that powers the title generation, excerpt generation and content resizing features, has a [pay per usage](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/) plan.
+**Microsoft Azure OpenAI**, which is one of the providers that powers the title generation, excerpt generation and writing tools features, has a [pay per usage](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/) plan.
-**Google Gemini**, which is one of the providers that powers the title generation, excerpt generation and content resizing features, has a ["free" pricing tier](https://ai.google.dev/pricing) that offers 60 queries per minute. To utilize the image generation feature, you will need a paid account.
+**Google Gemini**, which is one of the providers that powers the title generation, excerpt generation and writing tools features, has a ["free" pricing tier](https://ai.google.dev/pricing) that offers 60 queries per minute. To utilize the image generation feature, you will need a paid account.
diff --git a/wp-hooks-docs/docs/02.feature-configuration/02.title-generation.md b/wp-hooks-docs/docs/02.feature-configuration/02.title-generation.md
index d58de0c71..2aa0a5904 100644
--- a/wp-hooks-docs/docs/02.feature-configuration/02.title-generation.md
+++ b/wp-hooks-docs/docs/02.feature-configuration/02.title-generation.md
@@ -71,7 +71,7 @@ sidebar_label: "Title Generation"
* Note that if this page doesn't work, it's likely that Gemini is not enabled in your workspace. Contact your workspace administrator to get this enabled.
* Click `Create API key` and copy the key that is shown.
-### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Content Resizing > Settings
+### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Writing Tools > Settings
* Select **Google AI (Gemini API)** in the provider dropdown.
* Enter your API Key copied from the above step into the `API Key` field.
diff --git a/wp-hooks-docs/docs/02.feature-configuration/03.excerpt-generation.md b/wp-hooks-docs/docs/02.feature-configuration/03.excerpt-generation.md
index 83a6f15d6..bf99ac409 100644
--- a/wp-hooks-docs/docs/02.feature-configuration/03.excerpt-generation.md
+++ b/wp-hooks-docs/docs/02.feature-configuration/03.excerpt-generation.md
@@ -71,7 +71,7 @@ sidebar_label: "Excerpt Generation"
* Note that if this page doesn't work, it's likely that Gemini is not enabled in your workspace. Contact your workspace administrator to get this enabled.
* Click `Create API key` and copy the key that is shown.
-### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Content Resizing > Settings
+### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Writing Tools > Settings
* Select **Google AI (Gemini API)** in the provider dropdown.
* Enter your API Key copied from the above step into the `API Key` field.
diff --git a/wp-hooks-docs/docs/02.feature-configuration/04.content-generation.md b/wp-hooks-docs/docs/02.feature-configuration/04.content-generation.md
index 97fed50f3..14855b79e 100644
--- a/wp-hooks-docs/docs/02.feature-configuration/04.content-generation.md
+++ b/wp-hooks-docs/docs/02.feature-configuration/04.content-generation.md
@@ -70,7 +70,7 @@ sidebar_label: "Content Generation"
* Note that if this page doesn't work, it's likely that Gemini is not enabled in your workspace. Contact your workspace administrator to get this enabled.
* Click `Create API key` and copy the key that is shown.
-### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Content Resizing > Settings
+### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Writing Tools > Settings
* Select **Google AI (Gemini API)** in the provider dropdown.
* Enter your API Key copied from the above step into the `API Key` field.
diff --git a/wp-hooks-docs/docs/02.feature-configuration/05.content-resizing.md b/wp-hooks-docs/docs/02.feature-configuration/05.writing-tools.md
similarity index 91%
rename from wp-hooks-docs/docs/02.feature-configuration/05.content-resizing.md
rename to wp-hooks-docs/docs/02.feature-configuration/05.writing-tools.md
index 6d962ac06..c158c3128 100644
--- a/wp-hooks-docs/docs/02.feature-configuration/05.content-resizing.md
+++ b/wp-hooks-docs/docs/02.feature-configuration/05.writing-tools.md
@@ -1,10 +1,10 @@
---
-id: content-resizing
-title: "Feature Configuration - Content Resizing"
-sidebar_label: "Content Resizing"
+id: writing-tools
+title: "Feature Configuration - Writing Tools"
+sidebar_label: "Writing Tools"
---
-# Content Resizing
+# Writing Tools
## Set Up via OpenAI ChatGPT
@@ -15,12 +15,12 @@ sidebar_label: "Content Resizing"
* Log into your account and go to the [API key page](https://platform.openai.com/account/api-keys).
* Click `Create new secret key` and copy the key that is shown.
-### 2. Configure OpenAI API Keys under Tools > ClassifAI > Language Processing > Content Resizing > Settings
+### 2. Configure OpenAI API Keys under Tools > ClassifAI > Language Processing > Writing Tools > Settings
* Select **OpenAI ChatGPT** in the provider dropdown.
* Enter your API Key copied from the above step into the `API Key` field.
-### 3. Enable Content Resizing
+### 3. Enable Writing Tools
* Turn on the "Enable" toggle in the screen above.
* Set the other options as needed.
@@ -51,7 +51,7 @@ sidebar_label: "Content Resizing"
* Enter your API Key copied from the above step into the `API key` field.
* Enter your deployment name copied from the above step into the `Deployment name` field.
-### 3. Enable Content Resizing
+### 3. Enable Writing Tools
* Turn on the "Enable" toggle in the screen above.
* Set the other options as needed.
@@ -74,12 +74,12 @@ sidebar_label: "Content Resizing"
* Note that if this page doesn't work, it's likely that Gemini is not enabled in your workspace. Contact your workspace administrator to get this enabled.
* Click `Create API key` and copy the key that is shown.
-### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Content Resizing > Settings
+### 2. Configure API Keys under Tools > ClassifAI > Language Processing > Title Generation, Excerpt Generation or Writing Tools > Settings
* Select **Google AI (Gemini API)** in the provider dropdown.
* Enter your API Key copied from the above step into the `API Key` field.
-### 3. Enable Content Resizing
+### 3. Enable Writing Tools
* Turn on the "Enable" toggle in the screen above.
* Set the other options as needed.
diff --git a/wp-hooks-docs/docs/02.feature-configuration/index.md b/wp-hooks-docs/docs/02.feature-configuration/index.md
index a2ea282cf..49aa3af1b 100644
--- a/wp-hooks-docs/docs/02.feature-configuration/index.md
+++ b/wp-hooks-docs/docs/02.feature-configuration/index.md
@@ -14,7 +14,7 @@ Welcome to the ClassifAI Feature Configuration guide. This section provides deta
- [Title Generation](./02.title-generation.md) - Set up automated title generation for your content
- [Excerpt Generation](./03.excerpt-generation.md) - Configure automatic excerpt generation
- [Content Generation](./04.content-generation.md) - Set up AI-powered content generation
-- [Content Resizing](./05.content-resizing.md) - Configure content length adjustment features
+- [Writing Tools](./05.writing-tools.md) - Configure content length adjustment features and fix grammar
- [Key Takeaways](./06.key-takeaways.md) - Set up automatic key points extraction
- [Text to Speech](./07.text-to-speech.md) - Configure text-to-speech conversion
- [Audio Transcripts Generation](./08.audio-transcripts-generation.md) - Set up audio transcription
diff --git a/wp-hooks-docs/docs/03.advanced-docs/07.feature-provider-support.md b/wp-hooks-docs/docs/03.advanced-docs/07.feature-provider-support.md
index 6561d417d..0f13f28ba 100644
--- a/wp-hooks-docs/docs/03.advanced-docs/07.feature-provider-support.md
+++ b/wp-hooks-docs/docs/03.advanced-docs/07.feature-provider-support.md
@@ -13,7 +13,7 @@ The following table lists out all the Providers that are in ClassifAI and what F
| Title Generation | | | | X | | X | | X | X | X | | |
| Excerpt Generation | | | | X | | X | | X | X | X | | |
| Content Generation | | | | X | | | | X | X | | | |
-| Content Resizing | | | | X | | X | | X | X | X | | |
+| Writing Tools | | | | X | | X | | X | X | X | | |
| Key Takeaways | | | | X | | | | X | X | | | |
| Text to Speech | X | X | | | | | | | X | | | X |
| Audio Transcripts Generation | | | | | | | | | X | | | X |
diff --git a/wp-hooks-docs/docs/03.advanced-docs/08.data-flow.md b/wp-hooks-docs/docs/03.advanced-docs/08.data-flow.md
index 26c4dc851..e807f2923 100644
--- a/wp-hooks-docs/docs/03.advanced-docs/08.data-flow.md
+++ b/wp-hooks-docs/docs/03.advanced-docs/08.data-flow.md
@@ -32,7 +32,7 @@ While it varies slightly depending on the Feature and Provider in use, the gener
- **Data**: The full content of the item being processed is sent, along with whatever prompt is set as the default. If the `{{TITLE}}` variable is set, it will be replaced with the title of the item being processed.
- **Controls**: In the settings UI, can control the prompt that is used and which post types are allowed. There are also multiple hooks at the code level that allow fine grained control over which items are allowed to be processed or the data that is sent.
-### Content Resizing
+### Writing Tools
- **Data**: The content of the individual paragraph being processed is sent, along with whatever prompt is set as the default.
- **Controls**: In the settings UI, can control the prompt that is used. There are also multiple hooks at the code level that allow fine grained control over which items are allowed to be processed or the data that is sent.
diff --git a/wp-hooks-docs/src/pages/index.js b/wp-hooks-docs/src/pages/index.js
index 58ce12a87..6f4be9063 100644
--- a/wp-hooks-docs/src/pages/index.js
+++ b/wp-hooks-docs/src/pages/index.js
@@ -122,11 +122,11 @@ export default function Home() {
configureLink: '/feature-configuration/title-generation',
},
{
- title: 'Content Resizing',
+ title: 'Writing Tools',
tagline: 'Say More, Say Less',
description:
- 'Expand or condense your written content to create the ideal version that is precise and effective, with length indicators.',
- configureLink: '/feature-configuration/content-resizing',
+ 'Expand, condense or fix grammar in your written content to create the ideal version that is precise and effective, with length indicators.',
+ configureLink: '/feature-configuration/writing-tools',
},
{
title: 'Key Takeaways',