Plugin Directory

Changeset 3479503


Ignore:
Timestamp:
03/10/2026 08:15:29 PM (3 weeks ago)
Author:
previewai
Message:

Release 1.3.1 – Fix widget

Location:
preview-ai
Files:
4 edited
26 copied

Legend:

Unmodified
Added
Removed
  • preview-ai/tags/1.3.1/includes/class-preview-ai-api.php

    r3473838 r3479503  
    140140
    141141        return $result;
    142     }
    143 
    144     /**
    145      * Check if widget can be displayed.
    146      * Returns false if no API key or deactivated.
    147      *
    148      * @return bool
    149      */
    150     public static function is_widget_available() {
    151         $api_key = get_option( 'preview_ai_api_key', '' );
    152 
    153         // No API key = don't show widget.
    154         if ( empty( $api_key ) ) {
    155             return false;
    156         }
    157 
    158         // Check account status.
    159         $status = self::get_account_status();
    160 
    161         // Account deactivated by the service.
    162         if ( isset( $status['active'] ) && ! $status['active'] ) {
    163             return false;
    164         }
    165 
    166         return true;
    167142    }
    168143
  • preview-ai/tags/1.3.1/preview-ai.php

    r3473838 r3479503  
    1010 * Plugin URI:        https://previewai.app/
    1111 * Description:       Preview AI is a plugin that allows your customers to preview your products in real-time using AI image generation.
    12  * Version:           1.3.0
     12 * Version:           1.3.1
    1313 * Author:            Preview AI
    1414 * Author URI:        https://profiles.wordpress.org/previewai/
     
    2828 * Current plugin version.
    2929 */
    30 define( 'PREVIEW_AI_VERSION', '1.3.0' );
     30define( 'PREVIEW_AI_VERSION', '1.3.1' );
    3131define( 'PREVIEW_AI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
    3232
  • preview-ai/tags/1.3.1/public/class-preview-ai-public.php

    r3454451 r3479503  
    176176     */
    177177    public function render_widget() {
    178         // Check if widget is available (API key + tokens).
    179         if ( ! PREVIEW_AI_Api::is_widget_available() ) {
    180             return;
    181         }
    182 
    183178        if ( ! function_exists( 'is_product' ) || ! is_product() ) {
    184179            return;
     
    214209     */
    215210    public static function render_widget_output( $product_id, $overrides = array() ) {
    216         // Check if widget is available (API key + tokens).
    217         if ( ! PREVIEW_AI_Api::is_widget_available() ) {
    218             return '';
    219         }
    220 
    221211        if ( ! $product_id ) {
    222212            return '';
  • preview-ai/tags/1.3.1/readme.txt

    r3473838 r3479503  
    88WC requires at least: 8.0
    99WC tested up to: 10.5.1
    10 Stable tag: 1.3.0
     10Stable tag: 1.3.1
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    160160== Changelog ==
    161161
     162= 1.3.1 =
     163– Fixed widget visibility: the try-on button no longer disappears due to account status changes. Errors are shown at generation time instead.
     164
    162165= 1.3.0 =
    163166– Added automatic product analysis on publish: Preview AI now activates automatically for supported products when they are first published.
     
    202205== Upgrade Notice ==
    203206
     207= 1.3.1 =
     208Fixed: try-on button no longer disappears silently when account status changes.
     209
    204210= 1.3.0 =
    205211Automatic product analysis on publish: Preview AI now activates automatically for supported products when they are first published.
  • preview-ai/trunk/includes/class-preview-ai-api.php

    r3473838 r3479503  
    140140
    141141        return $result;
    142     }
    143 
    144     /**
    145      * Check if widget can be displayed.
    146      * Returns false if no API key or deactivated.
    147      *
    148      * @return bool
    149      */
    150     public static function is_widget_available() {
    151         $api_key = get_option( 'preview_ai_api_key', '' );
    152 
    153         // No API key = don't show widget.
    154         if ( empty( $api_key ) ) {
    155             return false;
    156         }
    157 
    158         // Check account status.
    159         $status = self::get_account_status();
    160 
    161         // Account deactivated by the service.
    162         if ( isset( $status['active'] ) && ! $status['active'] ) {
    163             return false;
    164         }
    165 
    166         return true;
    167142    }
    168143
  • preview-ai/trunk/preview-ai.php

    r3473838 r3479503  
    1010 * Plugin URI:        https://previewai.app/
    1111 * Description:       Preview AI is a plugin that allows your customers to preview your products in real-time using AI image generation.
    12  * Version:           1.3.0
     12 * Version:           1.3.1
    1313 * Author:            Preview AI
    1414 * Author URI:        https://profiles.wordpress.org/previewai/
     
    2828 * Current plugin version.
    2929 */
    30 define( 'PREVIEW_AI_VERSION', '1.3.0' );
     30define( 'PREVIEW_AI_VERSION', '1.3.1' );
    3131define( 'PREVIEW_AI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
    3232
  • preview-ai/trunk/public/class-preview-ai-public.php

    r3454451 r3479503  
    176176     */
    177177    public function render_widget() {
    178         // Check if widget is available (API key + tokens).
    179         if ( ! PREVIEW_AI_Api::is_widget_available() ) {
    180             return;
    181         }
    182 
    183178        if ( ! function_exists( 'is_product' ) || ! is_product() ) {
    184179            return;
     
    214209     */
    215210    public static function render_widget_output( $product_id, $overrides = array() ) {
    216         // Check if widget is available (API key + tokens).
    217         if ( ! PREVIEW_AI_Api::is_widget_available() ) {
    218             return '';
    219         }
    220 
    221211        if ( ! $product_id ) {
    222212            return '';
  • preview-ai/trunk/readme.txt

    r3473838 r3479503  
    88WC requires at least: 8.0
    99WC tested up to: 10.5.1
    10 Stable tag: 1.3.0
     10Stable tag: 1.3.1
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    160160== Changelog ==
    161161
     162= 1.3.1 =
     163– Fixed widget visibility: the try-on button no longer disappears due to account status changes. Errors are shown at generation time instead.
     164
    162165= 1.3.0 =
    163166– Added automatic product analysis on publish: Preview AI now activates automatically for supported products when they are first published.
     
    202205== Upgrade Notice ==
    203206
     207= 1.3.1 =
     208Fixed: try-on button no longer disappears silently when account status changes.
     209
    204210= 1.3.0 =
    205211Automatic product analysis on publish: Preview AI now activates automatically for supported products when they are first published.
Note: See TracChangeset for help on using the changeset viewer.