Changeset 3398720
- Timestamp:
- 11/19/2025 09:44:49 AM (5 months ago)
- Location:
- emplibot/trunk
- Files:
-
- 5 edited
-
emplibot.php (modified) (1 diff)
-
includes/class-emplibot.php (modified) (3 diffs)
-
includes/functions.php (modified) (1 diff)
-
includes/rest-api.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
emplibot/trunk/emplibot.php
r3284888 r3398720 3 3 * Plugin Name: Emplibot 4 4 * Description: Automated keyword research, automated blogging, with internal and external links, engaging infographics, unique featured images, and more. 5 * Version: 1. 0.95 * Version: 1.1.0 6 6 * Requires at least: 6.4 7 7 * Requires PHP: 7.2 -
emplibot/trunk/includes/class-emplibot.php
r3153973 r3398720 87 87 'emplibot_setting_section' // section 88 88 ); 89 90 add_settings_field( 91 'upload_version', // id 92 'Upload Version', // title 93 array( $this, 'upload_version_callback' ), // callback 94 'emplibot-admin', // page 95 'emplibot_setting_section' // section 96 ); 89 97 } 90 98 … … 122 130 $sanitary_values['plugin_key'] = sanitize_text_field( $plugin_key ); 123 131 } 132 } 133 134 if ( isset( $input['upload_version'] ) ) { 135 // Only allow v1 or v2 as valid values 136 $sanitary_values['upload_version'] = ($input['upload_version'] === 'v2') ? 'v2' : 'v1'; 124 137 } 125 138 … … 164 177 165 178 } 179 180 public function upload_version_callback() { 181 $emplibot_options = get_option('emplibot_options'); 182 $upload_version = (is_array($emplibot_options) && isset($emplibot_options['upload_version'])) 183 ? $emplibot_options['upload_version'] : 'v2'; // Default to v2 184 ?> 185 <select name="emplibot_options[upload_version]" id="upload_version"> 186 <option value="v1" <?php selected($upload_version, 'v1'); ?>>v1</option> 187 <option value="v2" <?php selected($upload_version, 'v2'); ?>>v2</option> 188 </select> 189 <p class="description"> 190 Upload version v2 is recommended. Use v1 only if you experience issues while receiving blogposts with v2. 191 </p> 192 <?php 193 } 166 194 } -
emplibot/trunk/includes/functions.php
r3281098 r3398720 10 10 11 11 // Make a GET request to the REST API 12 $response = wp_ remote_get($backend_url . '/public-key');12 $response = wp_safe_remote_get($backend_url . '/public-key'); 13 13 14 14 // Check if the request was successful -
emplibot/trunk/includes/rest-api.php
r3284888 r3398720 341 341 * 342 342 * @param WP_REST_Request $request The request object. 343 * @return WP_REST_Response The response containing the plugin version, plugin key hash, and environment info.343 * @return WP_REST_Response The response containing the plugin version, plugin key hash, upload version, and environment info. 344 344 */ 345 345 function emplibot_get_version(WP_REST_Request $request) { … … 351 351 $plugin_key = isset($emplibot_options['plugin_key']) ? sanitize_text_field($emplibot_options['plugin_key']) : ''; 352 352 353 // Get the upload version from options (default to v2 if not set) 354 $upload_version = isset($emplibot_options['upload_version']) ? sanitize_text_field($emplibot_options['upload_version']) : 'v2'; 355 353 356 // Generate SHA-256 hash of the plugin key 354 357 $pk_hash = hash('sha256', $plugin_key); … … 360 363 $fastcgi_finish_request_supported = function_exists('fastcgi_finish_request'); 361 364 362 // Return the version, pk_hash, and environment info as a JSON response365 // Return the version, pk_hash, upload_version, and environment info as a JSON response 363 366 return new WP_REST_Response( 364 367 array( 365 368 'version' => $plugin_data['Version'], 366 369 'pk_hash' => $pk_hash, 370 'upload_version' => $upload_version, 367 371 'wp_cron_enabled' => $wp_cron_enabled, 368 372 'fastcgi_finish_request_supported' => $fastcgi_finish_request_supported … … 484 488 // Download the ZIP file 485 489 $zip_file_path = $temp_dir . '/blog_post.zip'; 486 $download_response = wp_ remote_get($download_url, array(490 $download_response = wp_safe_remote_get($download_url, array( 487 491 'timeout' => 60, 488 492 'stream' => true, … … 763 767 ); 764 768 765 wp_ remote_post($webhook_callback_url, array(769 wp_safe_remote_post($webhook_callback_url, array( 766 770 'body' => json_encode($webhook_payload), 767 771 'headers' => array('Content-Type' => 'application/json'), … … 797 801 ); 798 802 799 wp_ remote_post($webhook_url, array(803 wp_safe_remote_post($webhook_url, array( 800 804 'body' => json_encode($webhook_payload), 801 805 'headers' => array('Content-Type' => 'application/json'), -
emplibot/trunk/readme.txt
r3284888 r3398720 4 4 Requires at least: 6.4 5 5 Tested up to: 6.8 6 Stable tag: 1. 0.97 Requires PHP: 7. 16 Stable tag: 1.1.0 7 Requires PHP: 7.2 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 62 62 = 1.0.9 = 63 63 * Prefer GD Image processing. 64 65 = 1.1.0 = 66 * Add the option to choose the blogpost processing workflow. 67 * Security improvements. 68
Note: See TracChangeset
for help on using the changeset viewer.