Changeset 3454316
- Timestamp:
- 02/05/2026 07:35:46 AM (2 weeks ago)
- Location:
- stacksuite-sales-manager-for-woocommerce
- Files:
-
- 8 edited
- 1 copied
-
tags/1.5.8 (copied) (copied from stacksuite-sales-manager-for-woocommerce/trunk)
-
tags/1.5.8/includes/class-aisales-admin-settings.php (modified) (2 diffs)
-
tags/1.5.8/includes/class-aisales-batch-page.php (modified) (1 diff)
-
tags/1.5.8/readme.txt (modified) (2 diffs)
-
tags/1.5.8/stacksuite-sales-manager-for-woocommerce.php (modified) (4 diffs)
-
trunk/includes/class-aisales-admin-settings.php (modified) (2 diffs)
-
trunk/includes/class-aisales-batch-page.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/stacksuite-sales-manager-for-woocommerce.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
stacksuite-sales-manager-for-woocommerce/tags/1.5.8/includes/class-aisales-admin-settings.php
r3454306 r3454316 53 53 add_action( 'admin_init', array( $this, 'handle_actions' ) ); 54 54 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_toast_script' ), 20 ); 55 add_action( 'admin_init', array( $this, 'maybe_check_for_updates' ) ); 55 56 } 56 57 … … 1003 1004 return isset( $labels[ $operation ] ) ? $labels[ $operation ] : $operation; 1004 1005 } 1006 1007 /** 1008 * Check for plugin updates on dashboard page load (every 6 hours) 1009 * 1010 * This triggers WordPress's plugin update check mechanism to ensure 1011 * users see fresh update information when visiting the plugin dashboard. 1012 */ 1013 public function maybe_check_for_updates() { 1014 // Only run on our main dashboard page. 1015 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 1016 if ( ! isset( $_GET['page'] ) || 'ai-sales-manager' !== $_GET['page'] ) { 1017 return; 1018 } 1019 1020 $last_check = get_option( 'aisales_last_update_check', 0 ); 1021 $interval = 6 * HOUR_IN_SECONDS; 1022 1023 // Only check if more than 6 hours since last check. 1024 if ( time() - $last_check < $interval ) { 1025 return; 1026 } 1027 1028 // Update last check time first to prevent multiple checks. 1029 update_option( 'aisales_last_update_check', time(), false ); 1030 1031 // Clear the update transient and trigger a fresh check. 1032 delete_site_transient( 'update_plugins' ); 1033 wp_update_plugins(); 1034 } 1005 1035 } -
stacksuite-sales-manager-for-woocommerce/tags/1.5.8/includes/class-aisales-batch-page.php
r3453999 r3454316 113 113 array( 114 114 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 115 'nonce' => wp_create_nonce( 'aisales_ batch_nonce' ),115 'nonce' => wp_create_nonce( 'aisales_nonce' ), 116 116 'apiBaseUrl' => apply_filters( 'aisales_api_url_client', AISALES_API_URL_CLIENT ), 117 117 'apiKey' => $api_key, -
stacksuite-sales-manager-for-woocommerce/tags/1.5.8/readme.txt
r3454306 r3454316 5 5 Tested up to: 6.9 6 6 Requires PHP: 8.0 7 Stable tag: 1.5. 77 Stable tag: 1.5.8 8 8 WC requires at least: 8.0 9 9 WC tested up to: 9.0 … … 114 114 115 115 == Changelog == 116 117 = 1.5.8 = 118 * Fixed: Batch page AJAX nonce mismatch causing 403 errors when applying changes 116 119 117 120 = 1.5.7 = -
stacksuite-sales-manager-for-woocommerce/tags/1.5.8/stacksuite-sales-manager-for-woocommerce.php
r3454306 r3454316 4 4 * Plugin URI: https://github.com/stacksuite-dev/woo-ai-sales-manager 5 5 * Description: AI-powered product catalog management for WooCommerce. Generate content, suggest tags/categories, and create/improve product images using Google Gemini. 6 * Version: 1.5. 76 * Version: 1.5.8 7 7 * Author: StackSuite 8 8 * Author URI: https://stacksuite.dev … … 27 27 28 28 // Plugin constants 29 define( 'AISALES_VERSION', '1.5. 7' );29 define( 'AISALES_VERSION', '1.5.8' ); 30 30 define( 'AISALES_PLUGIN_FILE', __FILE__ ); 31 31 define( 'AISALES_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 147 147 add_filter( 'plugin_action_links_' . AISALES_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) ); 148 148 add_filter( 'admin_body_class', array( $this, 'add_plugin_body_class' ) ); 149 add_action( 'admin_notices', array( $this, 'maybe_show_update_notice' ) ); 149 150 150 151 // Initialize components … … 403 404 404 405 /** 406 * Show update notice on plugin pages if an update is available 407 * 408 * Reads from WordPress's existing update transient (no extra API calls). 409 */ 410 public function maybe_show_update_notice() { 411 // Only show on plugin pages. 412 if ( ! self::is_plugin_page() ) { 413 return; 414 } 415 416 // Check WordPress's update transient. 417 $update_plugins = get_site_transient( 'update_plugins' ); 418 if ( empty( $update_plugins->response ) ) { 419 return; 420 } 421 422 $plugin_file = AISALES_PLUGIN_BASENAME; 423 if ( ! isset( $update_plugins->response[ $plugin_file ] ) ) { 424 return; 425 } 426 427 $update_info = $update_plugins->response[ $plugin_file ]; 428 $new_version = isset( $update_info->new_version ) ? $update_info->new_version : ''; 429 $update_url = admin_url( 'plugins.php' ); 430 $changelog_url = isset( $update_info->url ) ? $update_info->url : 'https://wordpress.org/plugins/stacksuite-sales-manager-for-woocommerce/#developers'; 431 432 if ( empty( $new_version ) ) { 433 return; 434 } 435 436 ?> 437 <div class="notice notice-warning aisales-update-notice" style="display: flex; align-items: center; gap: 12px; padding: 12px 16px;"> 438 <span class="dashicons dashicons-update" style="font-size: 24px; width: 24px; height: 24px; color: #dba617;"></span> 439 <div style="flex: 1;"> 440 <strong><?php esc_html_e( 'StackSuite Sales Manager Update Available', 'stacksuite-sales-manager-for-woocommerce' ); ?></strong> 441 <p style="margin: 4px 0 0;"> 442 <?php 443 printf( 444 /* translators: %1$s: current version, %2$s: new version */ 445 esc_html__( 'Version %1$s is available. You are running %2$s.', 'stacksuite-sales-manager-for-woocommerce' ), 446 '<strong>' . esc_html( $new_version ) . '</strong>', 447 esc_html( AISALES_VERSION ) 448 ); 449 ?> 450 </p> 451 </div> 452 <a href="<?php echo esc_url( $changelog_url ); ?>" class="button button-secondary" target="_blank" rel="noopener"> 453 <?php esc_html_e( 'View Changelog', 'stacksuite-sales-manager-for-woocommerce' ); ?> 454 </a> 455 <a href="<?php echo esc_url( $update_url ); ?>" class="button button-primary"> 456 <?php esc_html_e( 'Update Now', 'stacksuite-sales-manager-for-woocommerce' ); ?> 457 </a> 458 </div> 459 <?php 460 } 461 462 /** 405 463 * Get API client instance 406 464 * -
stacksuite-sales-manager-for-woocommerce/trunk/includes/class-aisales-admin-settings.php
r3454306 r3454316 53 53 add_action( 'admin_init', array( $this, 'handle_actions' ) ); 54 54 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_toast_script' ), 20 ); 55 add_action( 'admin_init', array( $this, 'maybe_check_for_updates' ) ); 55 56 } 56 57 … … 1003 1004 return isset( $labels[ $operation ] ) ? $labels[ $operation ] : $operation; 1004 1005 } 1006 1007 /** 1008 * Check for plugin updates on dashboard page load (every 6 hours) 1009 * 1010 * This triggers WordPress's plugin update check mechanism to ensure 1011 * users see fresh update information when visiting the plugin dashboard. 1012 */ 1013 public function maybe_check_for_updates() { 1014 // Only run on our main dashboard page. 1015 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 1016 if ( ! isset( $_GET['page'] ) || 'ai-sales-manager' !== $_GET['page'] ) { 1017 return; 1018 } 1019 1020 $last_check = get_option( 'aisales_last_update_check', 0 ); 1021 $interval = 6 * HOUR_IN_SECONDS; 1022 1023 // Only check if more than 6 hours since last check. 1024 if ( time() - $last_check < $interval ) { 1025 return; 1026 } 1027 1028 // Update last check time first to prevent multiple checks. 1029 update_option( 'aisales_last_update_check', time(), false ); 1030 1031 // Clear the update transient and trigger a fresh check. 1032 delete_site_transient( 'update_plugins' ); 1033 wp_update_plugins(); 1034 } 1005 1035 } -
stacksuite-sales-manager-for-woocommerce/trunk/includes/class-aisales-batch-page.php
r3453999 r3454316 113 113 array( 114 114 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 115 'nonce' => wp_create_nonce( 'aisales_ batch_nonce' ),115 'nonce' => wp_create_nonce( 'aisales_nonce' ), 116 116 'apiBaseUrl' => apply_filters( 'aisales_api_url_client', AISALES_API_URL_CLIENT ), 117 117 'apiKey' => $api_key, -
stacksuite-sales-manager-for-woocommerce/trunk/readme.txt
r3454306 r3454316 5 5 Tested up to: 6.9 6 6 Requires PHP: 8.0 7 Stable tag: 1.5. 77 Stable tag: 1.5.8 8 8 WC requires at least: 8.0 9 9 WC tested up to: 9.0 … … 114 114 115 115 == Changelog == 116 117 = 1.5.8 = 118 * Fixed: Batch page AJAX nonce mismatch causing 403 errors when applying changes 116 119 117 120 = 1.5.7 = -
stacksuite-sales-manager-for-woocommerce/trunk/stacksuite-sales-manager-for-woocommerce.php
r3454306 r3454316 4 4 * Plugin URI: https://github.com/stacksuite-dev/woo-ai-sales-manager 5 5 * Description: AI-powered product catalog management for WooCommerce. Generate content, suggest tags/categories, and create/improve product images using Google Gemini. 6 * Version: 1.5. 76 * Version: 1.5.8 7 7 * Author: StackSuite 8 8 * Author URI: https://stacksuite.dev … … 27 27 28 28 // Plugin constants 29 define( 'AISALES_VERSION', '1.5. 7' );29 define( 'AISALES_VERSION', '1.5.8' ); 30 30 define( 'AISALES_PLUGIN_FILE', __FILE__ ); 31 31 define( 'AISALES_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 147 147 add_filter( 'plugin_action_links_' . AISALES_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) ); 148 148 add_filter( 'admin_body_class', array( $this, 'add_plugin_body_class' ) ); 149 add_action( 'admin_notices', array( $this, 'maybe_show_update_notice' ) ); 149 150 150 151 // Initialize components … … 403 404 404 405 /** 406 * Show update notice on plugin pages if an update is available 407 * 408 * Reads from WordPress's existing update transient (no extra API calls). 409 */ 410 public function maybe_show_update_notice() { 411 // Only show on plugin pages. 412 if ( ! self::is_plugin_page() ) { 413 return; 414 } 415 416 // Check WordPress's update transient. 417 $update_plugins = get_site_transient( 'update_plugins' ); 418 if ( empty( $update_plugins->response ) ) { 419 return; 420 } 421 422 $plugin_file = AISALES_PLUGIN_BASENAME; 423 if ( ! isset( $update_plugins->response[ $plugin_file ] ) ) { 424 return; 425 } 426 427 $update_info = $update_plugins->response[ $plugin_file ]; 428 $new_version = isset( $update_info->new_version ) ? $update_info->new_version : ''; 429 $update_url = admin_url( 'plugins.php' ); 430 $changelog_url = isset( $update_info->url ) ? $update_info->url : 'https://wordpress.org/plugins/stacksuite-sales-manager-for-woocommerce/#developers'; 431 432 if ( empty( $new_version ) ) { 433 return; 434 } 435 436 ?> 437 <div class="notice notice-warning aisales-update-notice" style="display: flex; align-items: center; gap: 12px; padding: 12px 16px;"> 438 <span class="dashicons dashicons-update" style="font-size: 24px; width: 24px; height: 24px; color: #dba617;"></span> 439 <div style="flex: 1;"> 440 <strong><?php esc_html_e( 'StackSuite Sales Manager Update Available', 'stacksuite-sales-manager-for-woocommerce' ); ?></strong> 441 <p style="margin: 4px 0 0;"> 442 <?php 443 printf( 444 /* translators: %1$s: current version, %2$s: new version */ 445 esc_html__( 'Version %1$s is available. You are running %2$s.', 'stacksuite-sales-manager-for-woocommerce' ), 446 '<strong>' . esc_html( $new_version ) . '</strong>', 447 esc_html( AISALES_VERSION ) 448 ); 449 ?> 450 </p> 451 </div> 452 <a href="<?php echo esc_url( $changelog_url ); ?>" class="button button-secondary" target="_blank" rel="noopener"> 453 <?php esc_html_e( 'View Changelog', 'stacksuite-sales-manager-for-woocommerce' ); ?> 454 </a> 455 <a href="<?php echo esc_url( $update_url ); ?>" class="button button-primary"> 456 <?php esc_html_e( 'Update Now', 'stacksuite-sales-manager-for-woocommerce' ); ?> 457 </a> 458 </div> 459 <?php 460 } 461 462 /** 405 463 * Get API client instance 406 464 *
Note: See TracChangeset
for help on using the changeset viewer.