Changeset 3345921
- Timestamp:
- 08/17/2025 02:37:55 PM (8 months ago)
- Location:
- wordai
- Files:
-
- 49 added
- 7 edited
-
tags/1.0.6 (added)
-
tags/1.0.6/admin (added)
-
tags/1.0.6/admin/css (added)
-
tags/1.0.6/admin/css/fontawesome6-all.min.css (added)
-
tags/1.0.6/admin/css/images (added)
-
tags/1.0.6/admin/css/images/WAI-Black-White-Icon-16x16.png (added)
-
tags/1.0.6/admin/css/images/WAI-Black-White-Icon-20x20.png (added)
-
tags/1.0.6/admin/css/images/WAI-Black-White-Icon-50x50.png (added)
-
tags/1.0.6/admin/css/images/ui-bg_glass_65_ffffff_1x400.png (added)
-
tags/1.0.6/admin/css/images/ui-bg_glass_75_dadada_1x400.png (added)
-
tags/1.0.6/admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png (added)
-
tags/1.0.6/admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png (added)
-
tags/1.0.6/admin/css/images/ui-icons_222222_256x240.png (added)
-
tags/1.0.6/admin/css/images/ui-icons_454545_256x240.png (added)
-
tags/1.0.6/admin/css/images/ui-icons_888888_256x240.png (added)
-
tags/1.0.6/admin/css/jquery-ui.css (added)
-
tags/1.0.6/admin/css/sc-wordai-misc-styles.css (added)
-
tags/1.0.6/admin/fonts (added)
-
tags/1.0.6/admin/fonts/Merienda-VariableFont_wght.ttf (added)
-
tags/1.0.6/admin/fonts/Monoton-Regular.ttf (added)
-
tags/1.0.6/admin/js (added)
-
tags/1.0.6/admin/js/sc-wordai-content-generate-script.js (added)
-
tags/1.0.6/admin/js/sc-wordai-misc-script.js (added)
-
tags/1.0.6/admin/js/wordai-admin-view-script.js (added)
-
tags/1.0.6/admin/views (added)
-
tags/1.0.6/admin/views/metabox-popup.php (added)
-
tags/1.0.6/admin/views/settings-pages-header-template.php (added)
-
tags/1.0.6/admin/views/submenus-apisettings.php (added)
-
tags/1.0.6/admin/views/submenus-content-settings.php (added)
-
tags/1.0.6/admin/views/submenus-image-settings.php (added)
-
tags/1.0.6/admin/views/suggest-titles-popup.php (added)
-
tags/1.0.6/admin/webfonts (added)
-
tags/1.0.6/admin/webfonts/fa-brands-400.ttf (added)
-
tags/1.0.6/admin/webfonts/fa-brands-400.woff2 (added)
-
tags/1.0.6/admin/webfonts/fa-regular-400.ttf (added)
-
tags/1.0.6/admin/webfonts/fa-regular-400.woff2 (added)
-
tags/1.0.6/admin/webfonts/fa-solid-900.ttf (added)
-
tags/1.0.6/admin/webfonts/fa-solid-900.woff2 (added)
-
tags/1.0.6/admin/webfonts/fa-v4compatibility.ttf (added)
-
tags/1.0.6/admin/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.0.6/includes (added)
-
tags/1.0.6/includes/class-sftcy-wordai-ajaxhandler.php (added)
-
tags/1.0.6/includes/class-sftcy-wordai-autoloader.php (added)
-
tags/1.0.6/includes/class-sftcy-wordai-metabox.php (added)
-
tags/1.0.6/includes/class-sftcy-wordai-openai.php (added)
-
tags/1.0.6/includes/class-sftcy-wordai.php (added)
-
tags/1.0.6/languages (added)
-
tags/1.0.6/readme.txt (added)
-
tags/1.0.6/wordai.php (added)
-
trunk/admin/js/sc-wordai-content-generate-script.js (modified) (4 diffs)
-
trunk/admin/js/sc-wordai-misc-script.js (modified) (1 diff)
-
trunk/admin/views/submenus-apisettings.php (modified) (1 diff)
-
trunk/includes/class-sftcy-wordai-openai.php (modified) (4 diffs)
-
trunk/includes/class-sftcy-wordai.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/wordai.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordai/trunk/admin/js/sc-wordai-content-generate-script.js
r3148245 r3345921 297 297 scCompleteResponse = scWordAIProcessGroupOfChunkResponse(scChunkResponse); 298 298 // console.log( 'Chunk Complete Response:'+ scCompleteResponse ); 299 scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 299 if ( ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined && scCompleteResponse[0].errorData !== undefined ) ) { 300 scWordAIResponseErrorMessage = scCompleteResponse[0].errorData; 301 } 302 // scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 300 303 //scCompleteResponse = scCompleteResponse.replace(/^\"/g, '').replace(/\"$/g, ''); 301 scCompleteResponse = (scWordAIResponseErrorMessage.length === 0) ? scCompleteResponse.replace(/^\"/g, '').replace(/\"$/g, '') : ''; 304 // scCompleteResponse = (scWordAIResponseErrorMessage.length === 0) ? scCompleteResponse.replace(/^\"/g, '').replace(/\"$/g, '') : ''; 305 scCompleteResponse = (scWordAIResponseErrorMessage.length === 0 && scCompleteResponse.length !== 0 ) ? scCompleteResponse.replace(/^\"/g, '').replace(/\"$/g, '') : ''; 302 306 $('.sc-wordai-generated-title').val( scCompleteResponse ); 303 307 } … … 359 363 // console.log(scChunkResponse); 360 364 scCompleteResponse = scWordAIProcessGroupOfChunkResponse(scChunkResponse); 361 //console.log( scCompleteResponse ); 362 scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 365 //console.log( scCompleteResponse ); 366 if ( ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined && scCompleteResponse[0].errorData !== undefined ) ) { 367 scWordAIResponseErrorMessage = scCompleteResponse[0].errorData; 368 } 369 // scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 363 370 $('.sc-wordai-generated-content').val( scCompleteResponse ); 364 371 $('.sc-wordai-replace-withbr-response-format-content').val(scCompleteResponse.replace(/\n/g, "<br>") ); … … 420 427 //console.log(scChunkResponse); 421 428 scCompleteResponse = scWordAIProcessGroupOfChunkResponse(scChunkResponse); 422 //console.log( scCompleteResponse ); 423 scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 429 //console.log( scCompleteResponse ); 430 if ( ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined && scCompleteResponse[0].errorData !== undefined ) ) { 431 scWordAIResponseErrorMessage = scCompleteResponse[0].errorData; 432 } 433 // scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 424 434 $('.sc-wordai-generated-excerpt').val( scCompleteResponse ); 425 435 $('.sc-wordai-replace-withbr-response-format-excerpt').val(scCompleteResponse.replace(/\n/g, "<br>") ); … … 481 491 scCompleteResponse = scWordAIProcessGroupOfChunkResponse(scChunkResponse); 482 492 // console.log( scCompleteResponse ); 483 scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 493 if ( ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined && scCompleteResponse[0].errorData !== undefined ) ) { 494 scWordAIResponseErrorMessage = scCompleteResponse[0].errorData; 495 } 496 // scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 484 497 $('.sc-wordai-generated-tags').val(scCompleteResponse.replace(/\n/g, "").replace(/\\/, "") ); 485 498 } -
wordai/trunk/admin/js/sc-wordai-misc-script.js
r3072955 r3345921 134 134 //console.log('scCompleteResponse: '); 135 135 //console.log(scCompleteResponse); 136 scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 136 if ( ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined && scCompleteResponse[0].errorData !== undefined ) ) { 137 scWordAIResponseErrorMessage = scCompleteResponse[0].errorData; 138 } 139 // scWordAIResponseErrorMessage = ( scCompleteResponse[0] !== undefined && scCompleteResponse[0].error !== undefined )? scCompleteResponse[0].errorData : ''; 137 140 scListedChunkResponse = scCompleteResponse.split('\n'); 138 141 //console.log(scListedChunkResponse); -
wordai/trunk/admin/views/submenus-apisettings.php
r3148245 r3345921 82 82 </td> 83 83 <td> 84 <p class="sc-wordai-settings-text-hints"><?php esc_html_e('GPT-4o mini, most cost-efficient small model. GPT-4o mini is affordable and intelligent small model for fast, lightweight tasks. GPT-4o mini is cheaper and more capable than GPT-3.5 Turbo. GPT-4o mini enables a broad range of tasks with its low cost and latency. GPT-4o is the latest step in pushing the boundaries of deep learning, in the direction of practical usability. GPT-4o is 2x faster, half the price, and has 5x higher rate limits compared to GPT-4 Turbo. GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy than any of previous models. GPT-4 is available in the OpenAI API to paying customers. The difference between GPT-4 and GPT-3.5 models is not significant. However, in more complex reasoning situations, GPT-4 is much more capable than any of OpenAI previous models. GPT-3.5 Turbo is most capable and cost effective model in the GPT-3.5 family.', 'wordai');?></p> 84 <p class="sc-wordai-settings-text-hints"><?php esc_html_e('GPT-4o mini, most cost-efficient small model. GPT-4o mini is affordable and intelligent small model for fast, lightweight tasks. GPT-4o mini is cheaper and more capable than GPT-3.5 Turbo. GPT-4o mini enables a broad range of tasks with its low cost and latency. GPT-4o is the latest step in pushing the boundaries of deep learning, in the direction of practical usability. GPT-4o is 2x faster, half the price, and has 5x higher rate limits compared to GPT-4 Turbo. GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy than any of previous models. GPT-4 is available in the OpenAI API to paying customers. The difference between GPT-4 and GPT-3.5 models is not significant. However, in more complex reasoning situations, GPT-4 is much more capable than any of OpenAI previous models. GPT-3.5 Turbo is most capable and cost effective model in the GPT-3.5 family. GPT-5, The best model for coding and agentic tasks across domains. GPT-5 mini, A faster, cost-efficient version of GPT-5 for well-defined tasks. GPT-5 nano Fastest, most cost-efficient version of GPT-5.', 'wordai');?></p> 85 <p class="alert-error"><small><?php esc_html_e('If you use GPT-5 / GPT-5-mini model then your organization must be verified to stream this model. Please go to: https://platform.openai.com/settings/organization/general and click on Verify Organization.', 'wordai');?></small></p> 85 86 </td> 86 87 </tr> 88 <tr> 89 <td> 90 <h4><?php esc_html_e('GPT-5 Model Reasoning Effort', 'wordai');?></h4> 91 <?php 92 $reasoning_efforts = SFTCY_Wordai_OpenAI::openai_reasoning_effort(); 93 echo '<select id="sc-wordai-openai-reasoning-effort" name="sc-wordai-openai-reasoning-effort">'; 94 foreach ( $reasoning_efforts as $reasoning_effort_slug => $reasoning_effort_name ) { 95 $selected = isset( $data['sc-wordai-openai-reasoning-effort'] ) ? selected( $data['sc-wordai-openai-reasoning-effort'], $reasoning_effort_slug, false) : selected( $reasoning_effort_slug, SFTCY_Wordai_OpenAI::$gpt_5_reasoning_effort ); 96 echo '<option value="'. esc_attr( $reasoning_effort_slug ) .'" ' . esc_attr( $selected ) . '>' . esc_html( $reasoning_effort_name ) . '</option>'; 97 } 98 echo '</select>'; 99 ?> 100 </td> 101 <td> 102 <p class="sc-wordai-settings-text-hints"><?php echo wp_kses('GPT-5 is great at reasoning through complex tasks. For complex tasks like coding and multi-step planning, use <strong><i>High</i></strong> reasoning effort. <strong><i>Low</strong></i> favored speed and fewer tokens, while high favored more thorough reasoning. The new minimal setting produces very few reasoning tokens for cases where you need the fastest possible time-to-first-token. Better keep it <strong><i>Low</strong></i> when using GPT-5 models if you are just generating contents.', [ 'strong' => [], 'i' => [] ], 'wordai');?></p> 103 </td> 104 </tr> 87 105 <tr> 88 106 <td> -
wordai/trunk/includes/class-sftcy-wordai-openai.php
r3279831 r3345921 15 15 16 16 //public static $MODEL = 'gpt-4'; 17 public static $MODEL = 'gpt- 3.5-turbo'; // Default Model17 public static $MODEL = 'gpt-4o-mini'; // Default Model 18 18 public static $IMAGE_MODEL = 'dall-e-2'; // Default Dall-E-2 19 public static $gpt_5_reasoning_effort = 'low'; // Default 'low', low | medium | high | minimal 19 20 public static $STREAM = null; 20 21 … … 134 135 // $openai_params['model'] = $data['sc-wordai-openai-model-slug']; 135 136 $openai_params['model'] = ! isset( $data['sc-wordai-openai-model-slug'] ) || empty( $data['sc-wordai-openai-model-slug'] )? self::$MODEL : trim( $data['sc-wordai-openai-model-slug'] ); 136 $openai_params['max_tokens'] = empty( $data['sc-wordai-max-tokens'] ) ? null : intval( $data['sc-wordai-max-tokens'] ); // Ref: https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens 137 $openai_params['temperature'] = floatval( $data['sc-wordai-temperature'] ); 138 $openai_params['top_p'] = floatval( $data['sc-wordai-top-p'] ); 137 138 // $openai_params['max_tokens'] = empty( $data['sc-wordai-max-tokens'] ) ? null : intval( $data['sc-wordai-max-tokens'] ); // Ref: https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens 139 // $openai_params['temperature'] = floatval( $data['sc-wordai-temperature'] ); 140 // $openai_params['top_p'] = floatval( $data['sc-wordai-top-p'] ); 141 // GPT-5 Models require 'max_completion_tokens', not supporting 'max_tokens' parameter 142 if ( in_array( $openai_params['model'], [ 'gpt-5', 'gpt-5-mini', 'gpt-5-nano' ] ) ) { 143 $openai_params['max_completion_tokens'] = empty( $data['sc-wordai-max-tokens'] ) ? null : intval( $data['sc-wordai-max-tokens'] ); // Ref: https://platform.openai.com/docs/api-reference/chat/create#chat_create-max_completion_tokens 144 // In GPT-5 models 'temperature' only support 1 as default value 145 $openai_params['temperature'] = 1; 146 // GPT-5 models can use only 'reasoning_effort' parameter for response speed - Ref: https://platform.openai.com/docs/guides/latest-model#minimal-reasoning-effort 147 $openai_params['reasoning_effort'] = $data['sc-wordai-openai-reasoning-effort']; 148 } 149 else { 150 $openai_params['max_tokens'] = empty( $data['sc-wordai-max-tokens'] ) ? null : intval( $data['sc-wordai-max-tokens'] ); // Ref: https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens 151 $openai_params['temperature'] = floatval( $data['sc-wordai-temperature'] ); 152 // 'top_p' is not supported in GPT-5 Models 153 $openai_params['top_p'] = floatval( $data['sc-wordai-top-p'] ); 154 } 155 139 156 $openai_params['presence_penalty'] = floatval( $data['sc-wordai-presence-penalty-input'] ); 140 157 $openai_params['frequency_penalty'] = floatval( $data['sc-wordai-frequency-penalty-input'] ); … … 757 774 'gpt-4o' => 'GPT-4o', 758 775 'gpt-4o-mini' => 'GPT-4o-mini', 759 'gpt-4.1' => 'GPT-4.1' 776 'gpt-4.1' => 'GPT-4.1', 777 'gpt-5' => 'GPT-5', 778 'gpt-5-mini' => 'GPT-5 mini', 779 'gpt-5-nano' => 'GPT-5 nano' 760 780 ]; 761 781 … … 763 783 } 764 784 785 /** 786 * OpenAI GPT-5 reasoning effort 787 * GPT-5 models can use only 'reasoning_effort' parameter for response speed - Ref: https://platform.openai.com/docs/guides/latest-model#minimal-reasoning-effort 788 * @since 1.0.0 789 */ 790 public static function openai_reasoning_effort() { 791 $reasoning_effort = [ 792 'low' => 'Low', 793 'medium' => 'Medium', 794 'high' => 'High', 795 'minimal' => 'Minimal' 796 ]; 797 798 return $reasoning_effort; 799 } 800 765 801 /** 766 802 * OpenAI Image Models -
wordai/trunk/includes/class-sftcy-wordai.php
r3148245 r3345921 282 282 283 283 $settings_data['sc-wordai-openai-model-slug'] = isset( $options_data['sc-wordai-openai-model-slug'] )? sanitize_text_field( $options_data['sc-wordai-openai-model-slug'] ) : SFTCY_Wordai_OpenAI::$MODEL; 284 // GPT-5 models can use only 'reasoning_effort' parameter for response speed - Ref: https://platform.openai.com/docs/guides/latest-model#minimal-reasoning-effort 285 $settings_data['sc-wordai-openai-reasoning-effort'] = isset( $options_data['sc-wordai-openai-reasoning-effort'] )? sanitize_text_field( $options_data['sc-wordai-openai-reasoning-effort'] ) : SFTCY_Wordai_OpenAI::$gpt_5_reasoning_effort; 284 286 // Initial streaming true as default if not set 285 287 $options_data['sc-wordai-streaming'] = ( ! isset( $options_data['sc-wordai-streaming'] ) )? $default['sc-wordai-streaming'] : ( ( isset( $options_data['sc-wordai-streaming'] ) && $options_data['sc-wordai-streaming'] == 1 )? 1 : 0 ); -
wordai/trunk/readme.txt
r3279831 r3345921 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.2 8 Stable tag: 1.0. 58 Stable tag: 1.0.6 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 * Supports All Major Languages - Content can be written in any language 34 34 * Different Content Writing Styles 35 * Diff rent Content Writing Tones36 * Different Open AI supported image sizes selection options35 * Different Content Writing Tones 36 * Different Open AI supported image sizes selection options 37 37 * WooCommerce product Title / Description / Short Description Generation 38 38 * WooCommerce product images Generation … … 45 45 1. Install 'WordAI' Auto Content Writer by uploading the plugin to the '/wp-content/plugins/' directory inside. 46 46 2. Activate the plugin through the 'Plugins' menu in WordPress. 47 3. First put your open AI [API key](https://platform.openai.com/account/api-keys) through 'API Settings' page of the plugin.48 4. Then you are ready to generate auto content / HD images for your Word press!47 3. First put your open AI [API key](https://platform.openai.com/account/api-keys) through 'API Settings' page of the plugin. 48 4. Then you are ready to generate auto content / HD images for your WordPress! 49 49 50 50 … … 96 96 == Changelog == 97 97 98 = 1.0.6 = 99 * Added GPT-5 models ( GPT-5, GPT-5-mini, GPT-5-nano ) 100 * Other minor bug fixes 101 98 102 = 1.0.5 = 99 103 * Added GPT-4.1 model -
wordai/trunk/wordai.php
r3279831 r3345921 4 4 * Plugin URI: https://softcoy.com 5 5 * Description: AI driven humanlike SEO friendly content writing with HD images generation based on OpenAI. Automatize your Post / Page / Product content writing tasks. 6 * Version: 1.0. 56 * Version: 1.0.6 7 7 * Author: softcoy 8 8 * Author URI: https://softcoy.com/ … … 36 36 37 37 if ( ! defined( 'SFTCY_WORDAI_VERSION') ) { 38 define( 'SFTCY_WORDAI_VERSION', '1.0. 5' );38 define( 'SFTCY_WORDAI_VERSION', '1.0.6' ); 39 39 } 40 40 if ( ! defined( 'SFTCY_WORDAI_MINIMUM_PHP_VERSION') ) {
Note: See TracChangeset
for help on using the changeset viewer.