Plugin Directory

Changeset 3457521


Ignore:
Timestamp:
02/09/2026 10:28:55 PM (8 weeks ago)
Author:
bramblesai
Message:

Fix Stripe connect URL bug when saving customizations

Location:
brambles-ai/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • brambles-ai/trunk/brambles-ai.php

    r3387307 r3457521  
    44 * Plugin URI: https://www.brambles.ai/wordpress-plugin
    55 * Description: Affiliate AI shopping chatbot that monetizes content with conversational commerce for publishers.
    6  * Version: 0.2.1
     6 * Version: 0.2.2
    77 * Author: Brambles.ai
    88 * Author URI: https://www.brambles.ai
     
    2222
    2323// Define plugin constants
    24 define( 'BRAMBLES_AI_VERSION', '0.2.1' );
     24define( 'BRAMBLES_AI_VERSION', '0.2.2' );
    2525define( 'BRAMBLES_AI_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    2626define( 'BRAMBLES_AI_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
     
    306306    public function admin_init() {
    307307        register_setting( 'brambles_ai_settings', 'brambles_ai_cuid', array( 'sanitize_callback' => 'sanitize_text_field' ) );
    308         register_setting( 'brambles_ai_settings', 'brambles_ai_api_base_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
     308        // Note: brambles_ai_api_base_url intentionally NOT registered as a setting.
     309        // It has no form field, so register_setting would wipe it to '' on form save.
    309310        register_setting( 'brambles_ai_settings', 'brambles_ai_auto_inject', array( 'sanitize_callback' => 'absint' ) );
    310311        register_setting( 'brambles_ai_settings', 'brambles_ai_position', array( 'sanitize_callback' => 'sanitize_text_field' ) );
     
    10481049        // Use your existing widget base URL + new stripe connect endpoint
    10491050        $api_base_url = get_option( 'brambles_ai_api_base_url', BRAMBLES_AI_WIDGET_BASE_URL );
     1051        if ( empty( $api_base_url ) ) {
     1052            $api_base_url = BRAMBLES_AI_WIDGET_BASE_URL;
     1053        }
    10501054        $api_base_url = rtrim( $api_base_url, '/' );
    10511055        $endpoint     = trailingslashit( $api_base_url ) . 'api/stripe/connect';
  • brambles-ai/trunk/readme.txt

    r3387307 r3457521  
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 0.2.1
     8Stable tag: 0.2.2
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    155155== Changelog ==
    156156
     157= 0.2.2 =
     158* FIX: Resolved "Network error: A valid URL was not provided" when connecting Stripe after saving widget customizations
     159* FIX: Prevented internal API base URL setting from being inadvertently cleared on settings save
     160* SECURITY: Added defensive URL validation for Stripe Connect endpoint
     161
    157162= 0.2.1 =
    158163* DOCS: Enhanced readme with SEO optimization and clearer monetization guidance
     
    173178== Upgrade Notice ==
    174179
     180= 0.2.2 =
     181Bug fix: Fixes Stripe Connect error that could occur after saving widget customizations. Recommended update for all users.
     182
    175183= 0.2.1 =
    176184Enhanced documentation and SEO optimization. Clearer setup instructions for affiliate monetization and Stripe payouts.
Note: See TracChangeset for help on using the changeset viewer.