Changeset 2902745
- Timestamp:
- 04/22/2023 01:09:54 PM (3 years ago)
- Location:
- bob-ai
- Files:
-
- 12 edited
-
tags/1.0.0/admin/bob-doc.php (modified) (1 diff)
-
tags/1.0.0/admin/bob-general.php (modified) (5 diffs)
-
tags/1.0.0/admin/bob-settings.php (modified) (6 diffs)
-
tags/1.0.0/assets/js/bob-general.js (modified) (8 diffs)
-
tags/1.0.0/bob.php (modified) (3 diffs)
-
tags/1.0.0/readme.txt (modified) (3 diffs)
-
trunk/admin/bob-doc.php (modified) (1 diff)
-
trunk/admin/bob-general.php (modified) (5 diffs)
-
trunk/admin/bob-settings.php (modified) (6 diffs)
-
trunk/assets/js/bob-general.js (modified) (8 diffs)
-
trunk/bob.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bob-ai/tags/1.0.0/admin/bob-doc.php
r2902675 r2902745 9 9 <div class="help-section"> 10 10 <h3><?php _e('Scheduling Optimization', 'bob-ai'); ?></h3> 11 <p><?php _e('Bob AI uses a scheduler to automatically update meta descriptions . You can start or stop the scheduler at any time by clicking the "Start Bob AI" or "Stop Bob AI" buttons on the main plugin page. While the scheduler is running, Bob AI will periodically optimize meta descriptions using OpenAI.', 'bob-ai'); ?></p>11 <p><?php _e('Bob AI uses a scheduler to automatically update meta descriptions randomly between 1 and 3 hours. You can start or stop the scheduler at any time by clicking the "Start Bob AI" or "Stop Bob AI" buttons on the main plugin page. While the scheduler is running, Bob AI will periodically optimize meta descriptions using OpenAI.', 'bob-ai'); ?></p> 12 12 </div> 13 13 <!-- End Section 2 --> -
bob-ai/tags/1.0.0/admin/bob-general.php
r2902675 r2902745 4 4 } 5 5 6 // Get options and saved settings status 6 7 $api_key = get_option( 'bob-openai-api-key' ); 7 8 $settings_saved = $this->bob_settings_saved_notice(); 8 9 $bob_ai_status = get_option( 'bob_ai_status' ); 9 10 11 // Display success notice when settings are saved 10 12 if ($settings_saved) { 11 13 ?> … … 13 15 <p><?php esc_html_e( 'Settings saved successfully.', 'bob-ai' ); ?></p> 14 16 </div> 17 <script> 18 document.addEventListener('DOMContentLoaded', function() { 19 var settingsSavedEvent = new CustomEvent('settingsSaved'); 20 document.dispatchEvent(settingsSavedEvent); 21 }); 22 </script> 15 23 <?php 16 24 } 17 25 26 // Determine if the "Start Bob AI" button should be disabled 18 27 $disabled = empty( $api_key ) || !$settings_saved || $bob_ai_status === 'stopped' ? '' : 'disabled'; 19 28 20 29 $escaped_disabled = esc_attr( $disabled ); 21 30 31 // Start Bob AI when the "Start Bob AI" button is clicked 22 32 if ( isset( $_POST['start-bob-ai'] ) && $_POST['start-bob-ai'] ) { 23 33 if ( ! wp_next_scheduled( 'bob_optimizer_cron' ) ) { … … 26 36 } 27 37 38 // Stop Bob AI when the "Stop Bob AI" button is clicked 28 39 if ( isset( $_POST['stop-bob-ai'] ) && $_POST['stop-bob-ai'] ) { 29 40 wp_clear_scheduled_hook( 'bob_optimizer_cron' ); … … 31 42 ?> 32 43 44 <!-- Display the welcome message and instructions --> 33 45 <div class="bob-general"> 34 46 <h2><?php esc_html_e('Welcome to Bob AI', 'bob-ai'); ?></h2> … … 39 51 <?php esc_html_e('Please configure the OpenAI and SEO settings tabs before starting Bob AI.', 'bob-ai'); ?> 40 52 </p> 53 <p> 54 <?php esc_html_e('Once started, Bob AI will update your articles randomly between 1 and 3 hours. So check back the progress in Bob Stats after 3 hours.', 'bob-ai'); ?> 55 </p> 41 56 </div> 42 57 43 58 <form method="post"> 44 <?php wp_nonce_field( 'bob_meta_generation_nonce' ); ?> 59 <?php wp_nonce_field( 'bob_meta_generation_nonce', 'bob_meta_generation_nonce_field' ); 60 ?> 45 61 <div> 46 62 <button id="start-bob-ai" class="button button-primary" name="start-bob-ai" type="submit" <?php echo $escaped_disabled; ?> <?php echo esc_attr($start_button_display); ?>><?php esc_html_e('Start Bob AI', 'bob-ai'); ?></button> -
bob-ai/tags/1.0.0/admin/bob-settings.php
r2902675 r2902745 27 27 } 28 28 29 public function enqueue_admin_scripts() { 30 wp_enqueue_script( 'bob-admin', BOB_PLUGIN_URL . 'assets/js/bob-admin.js', array( 'jquery' ), BOB_VERSION, true ); 31 wp_enqueue_script( 'bob-general', BOB_PLUGIN_URL . 'assets/js/bob-general.js', array( 'jquery' ), BOB_VERSION, true ); 32 wp_enqueue_style( 'bob-admin', BOB_PLUGIN_URL . 'assets/css/bob-admin.css', array(), BOB_VERSION ); 33 34 $bob_ai_status = get_option( 'bob_ai_status', 'stopped' ); 29 public function enqueue_admin_scripts($hook_suffix) { 30 if ($hook_suffix != 'toplevel_page_bob-settings' && $hook_suffix != 'bob-ai_page_bob-stats') { 31 return; 32 } 33 34 wp_enqueue_script('bob-admin', BOB_PLUGIN_URL . 'assets/js/bob-admin.js', array('jquery'), BOB_VERSION, true); 35 wp_enqueue_script('bob-general', BOB_PLUGIN_URL . 'assets/js/bob-general.js', array('jquery'), BOB_VERSION, true); 36 wp_enqueue_style('bob-admin', BOB_PLUGIN_URL . 'assets/css/bob-admin.css', array(), BOB_VERSION); 37 38 $bob_ai_status = get_option('bob_ai_status', 'stopped'); 35 39 $js_data = array( 36 'ajaxurl' => admin_url( 'admin-ajax.php' ), 37 'bobAiStatus' => $bob_ai_status 40 'ajaxurl' => admin_url('admin-ajax.php'), 41 'bobAiStatus' => $bob_ai_status, 42 'startNonce' => wp_create_nonce('start_bob_meta_generation_nonce'), 43 'stopNonce' => wp_create_nonce('stop_bob_meta_generation_nonce'), 38 44 ); 39 40 wp_localize_script( 'bob-general', 'bobData', $js_data);41 } 45 46 wp_localize_script('bob-general', 'bobData', $js_data); 47 } 42 48 43 49 public function ajax_start_bob_ai() { 44 check_ajax_referer(' bob_meta_generation_nonce');50 check_ajax_referer('start_bob_meta_generation_nonce'); 45 51 46 52 if (!wp_next_scheduled('bob_optimizer_cron')) { … … 53 59 54 60 public function ajax_stop_bob_ai() { 55 check_ajax_referer(' bob_meta_generation_nonce');61 check_ajax_referer('stop_bob_meta_generation_nonce'); 56 62 57 63 wp_clear_scheduled_hook('bob_optimizer_cron'); … … 67 73 'manage_options', 68 74 'bob-settings', 69 [ $this, 'bob_render_settings_page' ] 75 [ $this, 'bob_render_settings_page' ], 76 'dashicons-index-card' 70 77 ); 71 78 … … 103 110 register_setting( 'bob-openai-settings-group', 'bob-openai-presence-penalty', [ $this, 'sanitize_float_field_callback' ] ); 104 111 105 add_settings_section( 'bob-openai-section', esc_html__( 'OpenAI API Key', 'bob-ai' ), [ $this, 'render_openai_section' ], 'bob-openai-settings' );112 add_settings_section( 'bob-openai-section', esc_html__( 'OpenAI API Settings', 'bob-ai' ), [ $this, 'render_openai_section' ], 'bob-openai-settings' ); 106 113 add_settings_field( 'bob-openai-api-key', esc_html__( 'API Key', 'bob-ai' ), [ $this, 'render_openai_api_key_field' ], 'bob-openai-settings', 'bob-openai-section' ); 107 114 add_settings_field( 'bob-openai-model', esc_html__( 'Model', 'bob-ai' ), [ $this, 'render_openai_model_field' ], 'bob-openai-settings', 'bob-openai-section' ); … … 149 156 $tooltip = esc_attr__( 'Your OpenAI API key is a secret code that identifies your account and allows you to access OpenAI\'s language processing services.', 'bob-ai' ); 150 157 151 printf( '<div class="bob-tooltip-container"><input type="password" name="bob-openai-api-key" value="%s" autocomplete=" off" /><span class="bob-tooltip">%s</span><button id="bob-api-key-toggle" type="button">%s</button></div><br /><span class="description">%s</span>', esc_attr( $api_key ), esc_attr( $tooltip ), esc_html__( 'Show', 'bob-ai' ), $description );158 printf( '<div class="bob-tooltip-container"><input type="password" name="bob-openai-api-key" value="%s" autocomplete="new-password" /><span class="bob-tooltip">%s</span><button id="bob-api-key-toggle" type="button">%s</button></div><br /><span class="description">%s</span>', esc_attr( $api_key ), esc_attr( $tooltip ), esc_html__( 'Show', 'bob-ai' ), $description ); 152 159 } 153 160 … … 169 176 } 170 177 echo '</select>'; 171 } 178 echo '<br /><span class="description">' . esc_html__( 'Only select GPT-4 if you have GPT-4 enabled inn your OpenAI account.', 'bob-ai' ) . '</span>'; // Added the description here 179 } 172 180 173 181 public function render_openai_max_tokens_field() { -
bob-ai/tags/1.0.0/assets/js/bob-general.js
r2902675 r2902745 4 4 */ 5 5 document.addEventListener('DOMContentLoaded', function() { 6 // Get elements from the DOM 6 7 var startBobAI = document.getElementById('start-bob-ai'); 7 8 var stopBobAI = document.getElementById('stop-bob-ai'); … … 10 11 messageContainer.classList.add('bob-message'); 11 12 13 // Set initial visibility of the buttons based on Bob AI status 12 14 if (bobData.bobAiStatus === 'running') { 13 15 startBobAI.style.display = 'none'; … … 18 20 } 19 21 22 // Add the message container to the DOM 20 23 form.parentNode.insertBefore(messageContainer, form.nextSibling); 21 24 25 // Helper function to display messages to the user 22 26 function showMessage(message, type) { 23 27 messageContainer.textContent = message; … … 32 36 } 33 37 38 // Event handler for the "Start Bob AI" button 34 39 startBobAI.addEventListener('click', function(e) { 35 40 e.preventDefault(); … … 37 42 var formData = new FormData(form); 38 43 formData.append('action', 'start_bob_ai'); 44 formData.append('_ajax_nonce', bobData.startNonce); 39 45 46 // Send AJAX request to start Bob AI 40 47 fetch(ajaxurl, { 41 48 method: 'POST', … … 49 56 startBobAI.style.display = 'none'; 50 57 stopBobAI.style.display = 'inline-block'; 51 showMessage('Bob AI has started updating your descriptions. Please check the Bob Stats section to see the progress. You can click the "Stop Bob AI" button to stop Bob AI.', 'bob-message-success');58 showMessage('Bob AI has started updating your descriptions. Please check the Bob Stats section in a few hours to see the progress. You can click the "Stop Bob AI" button to stop Bob AI.', 'bob-message-success'); 52 59 } else { 53 60 showMessage('An error occurred while starting Bob AI. Please try again.', 'bob-message-error'); … … 56 63 }); 57 64 65 // Helper function to enable the "Start Bob AI" button if Bob AI is not running 66 function enableStartButton() { 67 if (bobData.bobAiStatus !== 'running') { 68 startBobAI.removeAttribute('disabled'); 69 } 70 } 71 72 // Event handler for the "Stop Bob AI" button 58 73 stopBobAI.addEventListener('click', function(e) { 59 74 e.preventDefault(); 60 75 76 // Prepare form data for AJAX request 61 77 var formData = new FormData(form); 62 78 formData.append('action', 'stop_bob_ai'); 79 formData.append('_ajax_nonce', bobData.stopNonce); 63 80 81 // Send AJAX request to stop Bob AI 64 82 fetch(ajaxurl, { 65 83 method: 'POST', … … 79 97 }); 80 98 }); 99 document.addEventListener('settingsSaved', enableStartButton); 81 100 }); -
bob-ai/tags/1.0.0/bob.php
r2902675 r2902745 3 3 /** 4 4 * Plugin Name: Bob AI 5 * Description: A WordPress plugin that optimizes and updates meta descriptions using OpenAI to improve search engine visibility and boost click-through rates.5 * Description: Update your WordPress meta descriptions and improve your On-Page SEO with Bob AI.. 6 6 * Author: Ammanulah Emmanuel 7 7 * Author URI: https://nabaleka.com 8 * Version: 1.0. 08 * Version: 1.0.1 9 9 * Requires at least: 5.9 10 * Requires PHP: 7.0 11 * License: GPLv2 or later 12 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 * Requires PHP: 7.2.5 11 * License: GPLv3 12 * License URI: http://www.gnu.org/licenses/gpl.html 13 * 13 14 * Text Domain: bob-ai 14 15 * … … 21 22 } 22 23 23 define( 'BOB_VERSION', '1.0. 0' );24 define( 'BOB_VERSION', '1.0.1' ); 24 25 define( 'BOB_PLUGIN_FILE', __FILE__ ); 25 26 define( 'BOB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 34 35 * Begin bob execution. 35 36 * 36 * @since 1. 1.037 * @since 1.0.0 37 38 */ 38 39 function run_bob() { -
bob-ai/tags/1.0.0/readme.txt
r2902675 r2902745 1 1 === Bob AI === 2 Contributors: smartkenyan 2 Contributors: smartkenyan, djoakim 3 3 Tags: SEO, AI, OpenAI, meta descriptions, descriptions, GPT, GPT3.5 4 4 Requires at least: 5.9 or higher 5 Tested up to: 6. 1.15 Tested up to: 6.2 6 6 Stable tag: 1.0.0 7 Requires PHP: 7. 08 License: GPLv 2 or later9 License URI: http s://www.gnu.org/licenses/old-licenses/gpl-2.0.html7 Requires PHP: 7.2.5 8 License: GPLv3 9 License URI: http://www.gnu.org/licenses/gpl.html 10 10 11 Bob AI is a WordPress plugin that optimizes and updates WordPress meta descriptions using OpenAI to improve search engine visibility and boost click-through rates.11 Update your WordPress meta descriptions and improve your On-Page SEO with Bob AI. 12 12 13 13 == Description == 14 14 15 Bob AI is a WordPress plugin that uses OpenAI to optimize and update meta descriptions in order to improve search engine visibility and boost click-through rates. With this plugin, you can easily generate compelling meta descriptions for your website content and increase your chances of ranking higher in search engine results pages (SERPs).15 Bob AI is a WordPress plugin that uses OpenAI to optimize and update meta descriptions for your WordPress posts and custom post types. With Bob AI, you can easily generate compelling meta descriptions for your website content and increase your chances of ranking higher in search engine results pages (SERPs). 16 16 17 17 *BENEFITS* 18 18 19 * Improved search engine visibility20 * Increased c lick-through rates19 * Optimized Meta Descriptions 20 * Increased chances of a higher click-through rates 21 21 * Enhanced user experience 22 * Better engagement rates22 * Update older posts you missed updating their meta 23 23 24 24 *KEY FEATURES* … … 61 61 = Why use Bob AI? = 62 62 63 Bob AI is an innovative solution that leverages the power of artificial intelligence to improve your website's SEO performance. With AI-generated meta descriptions, real-time content analysis, and customizable templates, you can optimize your website for search engines and attract more organic traffic.63 Bob AI is an innovative solution that leverages the power of artificial intelligence to improve your website's SEO performance. With AI-generated meta descriptions, you can optimize your website for search engines. 64 64 65 65 = How does Bob AI work? = 66 66 67 Bob AI uses OpenAI's powerful language models to analyze your website content and generate compelling meta descriptions that are tailored to each page. When you create or update a page or post on your website, Bob AI uses your own content, including the title, focus keyword, and content, to generate a unique meta description for that page. This ensures that the content is 100% owned by you, the website owner.67 Bob uses WordPress cron to run in the backgrgound randomly between 1 and 3 hours picking your articles title and brief intro section to generate and pass to openai to generate unique meta descriptions that are tailored to each page. When you create or update a page or post on your website, Bob AI uses your own content, including the title, and content, to generate a unique meta description for that page. This ensures that the content is 100% owned by you, the website owner. 68 68 69 69 = Is Bob AI easy to use? = … … 71 71 Yes, Bob AI is designed to be user-friendly and intuitive. You can install the plugin in just a few clicks and start optimizing your website immediately. The interface is simple and easy to navigate, with clear instructions and helpful tooltips to guide you along the way. 72 72 73 == Upgrade Notice == 73 74 75 We will be improving Bob AI and when update is availlable, you will see it in your WordPress dashboard. 74 76 75 77 == Changelog == 78 79 = 1.0.1 = 80 Minor bug fixes. 76 81 77 82 = 1.0.0 = -
bob-ai/trunk/admin/bob-doc.php
r2902675 r2902745 9 9 <div class="help-section"> 10 10 <h3><?php _e('Scheduling Optimization', 'bob-ai'); ?></h3> 11 <p><?php _e('Bob AI uses a scheduler to automatically update meta descriptions . You can start or stop the scheduler at any time by clicking the "Start Bob AI" or "Stop Bob AI" buttons on the main plugin page. While the scheduler is running, Bob AI will periodically optimize meta descriptions using OpenAI.', 'bob-ai'); ?></p>11 <p><?php _e('Bob AI uses a scheduler to automatically update meta descriptions randomly between 1 and 3 hours. You can start or stop the scheduler at any time by clicking the "Start Bob AI" or "Stop Bob AI" buttons on the main plugin page. While the scheduler is running, Bob AI will periodically optimize meta descriptions using OpenAI.', 'bob-ai'); ?></p> 12 12 </div> 13 13 <!-- End Section 2 --> -
bob-ai/trunk/admin/bob-general.php
r2902675 r2902745 4 4 } 5 5 6 // Get options and saved settings status 6 7 $api_key = get_option( 'bob-openai-api-key' ); 7 8 $settings_saved = $this->bob_settings_saved_notice(); 8 9 $bob_ai_status = get_option( 'bob_ai_status' ); 9 10 11 // Display success notice when settings are saved 10 12 if ($settings_saved) { 11 13 ?> … … 13 15 <p><?php esc_html_e( 'Settings saved successfully.', 'bob-ai' ); ?></p> 14 16 </div> 17 <script> 18 document.addEventListener('DOMContentLoaded', function() { 19 var settingsSavedEvent = new CustomEvent('settingsSaved'); 20 document.dispatchEvent(settingsSavedEvent); 21 }); 22 </script> 15 23 <?php 16 24 } 17 25 26 // Determine if the "Start Bob AI" button should be disabled 18 27 $disabled = empty( $api_key ) || !$settings_saved || $bob_ai_status === 'stopped' ? '' : 'disabled'; 19 28 20 29 $escaped_disabled = esc_attr( $disabled ); 21 30 31 // Start Bob AI when the "Start Bob AI" button is clicked 22 32 if ( isset( $_POST['start-bob-ai'] ) && $_POST['start-bob-ai'] ) { 23 33 if ( ! wp_next_scheduled( 'bob_optimizer_cron' ) ) { … … 26 36 } 27 37 38 // Stop Bob AI when the "Stop Bob AI" button is clicked 28 39 if ( isset( $_POST['stop-bob-ai'] ) && $_POST['stop-bob-ai'] ) { 29 40 wp_clear_scheduled_hook( 'bob_optimizer_cron' ); … … 31 42 ?> 32 43 44 <!-- Display the welcome message and instructions --> 33 45 <div class="bob-general"> 34 46 <h2><?php esc_html_e('Welcome to Bob AI', 'bob-ai'); ?></h2> … … 39 51 <?php esc_html_e('Please configure the OpenAI and SEO settings tabs before starting Bob AI.', 'bob-ai'); ?> 40 52 </p> 53 <p> 54 <?php esc_html_e('Once started, Bob AI will update your articles randomly between 1 and 3 hours. So check back the progress in Bob Stats after 3 hours.', 'bob-ai'); ?> 55 </p> 41 56 </div> 42 57 43 58 <form method="post"> 44 <?php wp_nonce_field( 'bob_meta_generation_nonce' ); ?> 59 <?php wp_nonce_field( 'bob_meta_generation_nonce', 'bob_meta_generation_nonce_field' ); 60 ?> 45 61 <div> 46 62 <button id="start-bob-ai" class="button button-primary" name="start-bob-ai" type="submit" <?php echo $escaped_disabled; ?> <?php echo esc_attr($start_button_display); ?>><?php esc_html_e('Start Bob AI', 'bob-ai'); ?></button> -
bob-ai/trunk/admin/bob-settings.php
r2902675 r2902745 27 27 } 28 28 29 public function enqueue_admin_scripts() { 30 wp_enqueue_script( 'bob-admin', BOB_PLUGIN_URL . 'assets/js/bob-admin.js', array( 'jquery' ), BOB_VERSION, true ); 31 wp_enqueue_script( 'bob-general', BOB_PLUGIN_URL . 'assets/js/bob-general.js', array( 'jquery' ), BOB_VERSION, true ); 32 wp_enqueue_style( 'bob-admin', BOB_PLUGIN_URL . 'assets/css/bob-admin.css', array(), BOB_VERSION ); 33 34 $bob_ai_status = get_option( 'bob_ai_status', 'stopped' ); 29 public function enqueue_admin_scripts($hook_suffix) { 30 if ($hook_suffix != 'toplevel_page_bob-settings' && $hook_suffix != 'bob-ai_page_bob-stats') { 31 return; 32 } 33 34 wp_enqueue_script('bob-admin', BOB_PLUGIN_URL . 'assets/js/bob-admin.js', array('jquery'), BOB_VERSION, true); 35 wp_enqueue_script('bob-general', BOB_PLUGIN_URL . 'assets/js/bob-general.js', array('jquery'), BOB_VERSION, true); 36 wp_enqueue_style('bob-admin', BOB_PLUGIN_URL . 'assets/css/bob-admin.css', array(), BOB_VERSION); 37 38 $bob_ai_status = get_option('bob_ai_status', 'stopped'); 35 39 $js_data = array( 36 'ajaxurl' => admin_url( 'admin-ajax.php' ), 37 'bobAiStatus' => $bob_ai_status 40 'ajaxurl' => admin_url('admin-ajax.php'), 41 'bobAiStatus' => $bob_ai_status, 42 'startNonce' => wp_create_nonce('start_bob_meta_generation_nonce'), 43 'stopNonce' => wp_create_nonce('stop_bob_meta_generation_nonce'), 38 44 ); 39 40 wp_localize_script( 'bob-general', 'bobData', $js_data);41 } 45 46 wp_localize_script('bob-general', 'bobData', $js_data); 47 } 42 48 43 49 public function ajax_start_bob_ai() { 44 check_ajax_referer(' bob_meta_generation_nonce');50 check_ajax_referer('start_bob_meta_generation_nonce'); 45 51 46 52 if (!wp_next_scheduled('bob_optimizer_cron')) { … … 53 59 54 60 public function ajax_stop_bob_ai() { 55 check_ajax_referer(' bob_meta_generation_nonce');61 check_ajax_referer('stop_bob_meta_generation_nonce'); 56 62 57 63 wp_clear_scheduled_hook('bob_optimizer_cron'); … … 67 73 'manage_options', 68 74 'bob-settings', 69 [ $this, 'bob_render_settings_page' ] 75 [ $this, 'bob_render_settings_page' ], 76 'dashicons-index-card' 70 77 ); 71 78 … … 103 110 register_setting( 'bob-openai-settings-group', 'bob-openai-presence-penalty', [ $this, 'sanitize_float_field_callback' ] ); 104 111 105 add_settings_section( 'bob-openai-section', esc_html__( 'OpenAI API Key', 'bob-ai' ), [ $this, 'render_openai_section' ], 'bob-openai-settings' );112 add_settings_section( 'bob-openai-section', esc_html__( 'OpenAI API Settings', 'bob-ai' ), [ $this, 'render_openai_section' ], 'bob-openai-settings' ); 106 113 add_settings_field( 'bob-openai-api-key', esc_html__( 'API Key', 'bob-ai' ), [ $this, 'render_openai_api_key_field' ], 'bob-openai-settings', 'bob-openai-section' ); 107 114 add_settings_field( 'bob-openai-model', esc_html__( 'Model', 'bob-ai' ), [ $this, 'render_openai_model_field' ], 'bob-openai-settings', 'bob-openai-section' ); … … 149 156 $tooltip = esc_attr__( 'Your OpenAI API key is a secret code that identifies your account and allows you to access OpenAI\'s language processing services.', 'bob-ai' ); 150 157 151 printf( '<div class="bob-tooltip-container"><input type="password" name="bob-openai-api-key" value="%s" autocomplete=" off" /><span class="bob-tooltip">%s</span><button id="bob-api-key-toggle" type="button">%s</button></div><br /><span class="description">%s</span>', esc_attr( $api_key ), esc_attr( $tooltip ), esc_html__( 'Show', 'bob-ai' ), $description );158 printf( '<div class="bob-tooltip-container"><input type="password" name="bob-openai-api-key" value="%s" autocomplete="new-password" /><span class="bob-tooltip">%s</span><button id="bob-api-key-toggle" type="button">%s</button></div><br /><span class="description">%s</span>', esc_attr( $api_key ), esc_attr( $tooltip ), esc_html__( 'Show', 'bob-ai' ), $description ); 152 159 } 153 160 … … 169 176 } 170 177 echo '</select>'; 171 } 178 echo '<br /><span class="description">' . esc_html__( 'Only select GPT-4 if you have GPT-4 enabled inn your OpenAI account.', 'bob-ai' ) . '</span>'; // Added the description here 179 } 172 180 173 181 public function render_openai_max_tokens_field() { -
bob-ai/trunk/assets/js/bob-general.js
r2902675 r2902745 4 4 */ 5 5 document.addEventListener('DOMContentLoaded', function() { 6 // Get elements from the DOM 6 7 var startBobAI = document.getElementById('start-bob-ai'); 7 8 var stopBobAI = document.getElementById('stop-bob-ai'); … … 10 11 messageContainer.classList.add('bob-message'); 11 12 13 // Set initial visibility of the buttons based on Bob AI status 12 14 if (bobData.bobAiStatus === 'running') { 13 15 startBobAI.style.display = 'none'; … … 18 20 } 19 21 22 // Add the message container to the DOM 20 23 form.parentNode.insertBefore(messageContainer, form.nextSibling); 21 24 25 // Helper function to display messages to the user 22 26 function showMessage(message, type) { 23 27 messageContainer.textContent = message; … … 32 36 } 33 37 38 // Event handler for the "Start Bob AI" button 34 39 startBobAI.addEventListener('click', function(e) { 35 40 e.preventDefault(); … … 37 42 var formData = new FormData(form); 38 43 formData.append('action', 'start_bob_ai'); 44 formData.append('_ajax_nonce', bobData.startNonce); 39 45 46 // Send AJAX request to start Bob AI 40 47 fetch(ajaxurl, { 41 48 method: 'POST', … … 49 56 startBobAI.style.display = 'none'; 50 57 stopBobAI.style.display = 'inline-block'; 51 showMessage('Bob AI has started updating your descriptions. Please check the Bob Stats section to see the progress. You can click the "Stop Bob AI" button to stop Bob AI.', 'bob-message-success');58 showMessage('Bob AI has started updating your descriptions. Please check the Bob Stats section in a few hours to see the progress. You can click the "Stop Bob AI" button to stop Bob AI.', 'bob-message-success'); 52 59 } else { 53 60 showMessage('An error occurred while starting Bob AI. Please try again.', 'bob-message-error'); … … 56 63 }); 57 64 65 // Helper function to enable the "Start Bob AI" button if Bob AI is not running 66 function enableStartButton() { 67 if (bobData.bobAiStatus !== 'running') { 68 startBobAI.removeAttribute('disabled'); 69 } 70 } 71 72 // Event handler for the "Stop Bob AI" button 58 73 stopBobAI.addEventListener('click', function(e) { 59 74 e.preventDefault(); 60 75 76 // Prepare form data for AJAX request 61 77 var formData = new FormData(form); 62 78 formData.append('action', 'stop_bob_ai'); 79 formData.append('_ajax_nonce', bobData.stopNonce); 63 80 81 // Send AJAX request to stop Bob AI 64 82 fetch(ajaxurl, { 65 83 method: 'POST', … … 79 97 }); 80 98 }); 99 document.addEventListener('settingsSaved', enableStartButton); 81 100 }); -
bob-ai/trunk/bob.php
r2902675 r2902745 3 3 /** 4 4 * Plugin Name: Bob AI 5 * Description: A WordPress plugin that optimizes and updates meta descriptions using OpenAI to improve search engine visibility and boost click-through rates.5 * Description: Update your WordPress meta descriptions and improve your On-Page SEO with Bob AI.. 6 6 * Author: Ammanulah Emmanuel 7 7 * Author URI: https://nabaleka.com 8 * Version: 1.0. 08 * Version: 1.0.1 9 9 * Requires at least: 5.9 10 * Requires PHP: 7.0 11 * License: GPLv2 or later 12 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 * Requires PHP: 7.2.5 11 * License: GPLv3 12 * License URI: http://www.gnu.org/licenses/gpl.html 13 * 13 14 * Text Domain: bob-ai 14 15 * … … 21 22 } 22 23 23 define( 'BOB_VERSION', '1.0. 0' );24 define( 'BOB_VERSION', '1.0.1' ); 24 25 define( 'BOB_PLUGIN_FILE', __FILE__ ); 25 26 define( 'BOB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 34 35 * Begin bob execution. 35 36 * 36 * @since 1. 1.037 * @since 1.0.0 37 38 */ 38 39 function run_bob() { -
bob-ai/trunk/readme.txt
r2902675 r2902745 1 1 === Bob AI === 2 Contributors: smartkenyan 2 Contributors: smartkenyan, djoakim 3 3 Tags: SEO, AI, OpenAI, meta descriptions, descriptions, GPT, GPT3.5 4 4 Requires at least: 5.9 or higher 5 Tested up to: 6. 1.15 Tested up to: 6.2 6 6 Stable tag: 1.0.0 7 Requires PHP: 7. 08 License: GPLv 2 or later9 License URI: http s://www.gnu.org/licenses/old-licenses/gpl-2.0.html7 Requires PHP: 7.2.5 8 License: GPLv3 9 License URI: http://www.gnu.org/licenses/gpl.html 10 10 11 Bob AI is a WordPress plugin that optimizes and updates WordPress meta descriptions using OpenAI to improve search engine visibility and boost click-through rates.11 Update your WordPress meta descriptions and improve your On-Page SEO with Bob AI. 12 12 13 13 == Description == 14 14 15 Bob AI is a WordPress plugin that uses OpenAI to optimize and update meta descriptions in order to improve search engine visibility and boost click-through rates. With this plugin, you can easily generate compelling meta descriptions for your website content and increase your chances of ranking higher in search engine results pages (SERPs).15 Bob AI is a WordPress plugin that uses OpenAI to optimize and update meta descriptions for your WordPress posts and custom post types. With Bob AI, you can easily generate compelling meta descriptions for your website content and increase your chances of ranking higher in search engine results pages (SERPs). 16 16 17 17 *BENEFITS* 18 18 19 * Improved search engine visibility20 * Increased c lick-through rates19 * Optimized Meta Descriptions 20 * Increased chances of a higher click-through rates 21 21 * Enhanced user experience 22 * Better engagement rates22 * Update older posts you missed updating their meta 23 23 24 24 *KEY FEATURES* … … 61 61 = Why use Bob AI? = 62 62 63 Bob AI is an innovative solution that leverages the power of artificial intelligence to improve your website's SEO performance. With AI-generated meta descriptions, real-time content analysis, and customizable templates, you can optimize your website for search engines and attract more organic traffic.63 Bob AI is an innovative solution that leverages the power of artificial intelligence to improve your website's SEO performance. With AI-generated meta descriptions, you can optimize your website for search engines. 64 64 65 65 = How does Bob AI work? = 66 66 67 Bob AI uses OpenAI's powerful language models to analyze your website content and generate compelling meta descriptions that are tailored to each page. When you create or update a page or post on your website, Bob AI uses your own content, including the title, focus keyword, and content, to generate a unique meta description for that page. This ensures that the content is 100% owned by you, the website owner.67 Bob uses WordPress cron to run in the backgrgound randomly between 1 and 3 hours picking your articles title and brief intro section to generate and pass to openai to generate unique meta descriptions that are tailored to each page. When you create or update a page or post on your website, Bob AI uses your own content, including the title, and content, to generate a unique meta description for that page. This ensures that the content is 100% owned by you, the website owner. 68 68 69 69 = Is Bob AI easy to use? = … … 71 71 Yes, Bob AI is designed to be user-friendly and intuitive. You can install the plugin in just a few clicks and start optimizing your website immediately. The interface is simple and easy to navigate, with clear instructions and helpful tooltips to guide you along the way. 72 72 73 == Upgrade Notice == 73 74 75 We will be improving Bob AI and when update is availlable, you will see it in your WordPress dashboard. 74 76 75 77 == Changelog == 78 79 = 1.0.1 = 80 Minor bug fixes. 76 81 77 82 = 1.0.0 =
Note: See TracChangeset
for help on using the changeset viewer.