Plugin Directory

Changeset 3583938


Ignore:
Timestamp:
06/24/2026 01:37:16 AM (4 months ago)
Author:
marcusxue
Message:

Release PopAEO llms.txt 0.2.7

Location:
popaeo-llms-txt
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • popaeo-llms-txt/tags/0.2.7/popaeo-llms-txt.php

    r3583930 r3583938  
    44 * Plugin URI: https://www.popaeo.com/docs
    55 * Description: Publishes AI-readable llms.txt content for WooCommerce stores through PopAEO.
    6  * Version: 0.2.6
     6 * Version: 0.2.7
    77 * Author: PopAEO
    88 * Author URI: https://www.popaeo.com
    … …  
    4747    $settings = get_option(POPAEO_LLMS_OPTION, []);
    4848    return wp_parse_args(is_array($settings) ? $settings : [], popaeo_llms_default_settings());
     49}
     50
     51function popaeo_llms_is_valid_endpoint_url($endpoint_url) {
     52    $parts = wp_parse_url($endpoint_url);
     53    if (empty($parts['scheme']) || empty($parts['host']) || !in_array($parts['scheme'], ['http', 'https'], true)) {
     54        return false;
     55    }
     56
     57    $path = $parts['path'] ?? '';
     58    return $path === '' || $path === '/';
     59}
     60
     61function popaeo_llms_is_connected($settings) {
     62    if (empty($settings['endpoint_url']) || empty($settings['connection_id']) || empty($settings['shared_secret'])) {
     63        return false;
     64    }
     65
     66    return popaeo_llms_is_valid_endpoint_url($settings['endpoint_url']);
    4967}
    5068
    … …  
    222240        'popaeo_llms_start_connect'
    223241    );
    224     $is_connected = !empty($settings['endpoint_url']) && !empty($settings['connection_id']) && !empty($settings['shared_secret']);
     242    $has_saved_connection = !empty($settings['endpoint_url']) && !empty($settings['connection_id']) && !empty($settings['shared_secret']);
     243    $is_connected = popaeo_llms_is_connected($settings);
    225244    $dashboard_url = $is_connected
    226245        ? untrailingslashit($settings['endpoint_url']) . '/connections/woocommerce/dashboard/' . rawurlencode($settings['connection_id'])
    … …  
    262281        <?php if (!class_exists('WooCommerce')) : ?>
    263282            <div class="notice notice-error"><p><?php echo esc_html__('WooCommerce is required. Install and activate WooCommerce before connecting PopAEO.', 'popaeo-llms-txt'); ?></p></div>
     283        <?php endif; ?>
     284
     285        <?php if ($has_saved_connection && !$is_connected) : ?>
     286            <div class="notice notice-warning"><p><?php echo esc_html__('PopAEO found an incomplete or outdated connection setting. Click Start AEO Audit to reconnect and repair it automatically.', 'popaeo-llms-txt'); ?></p></div>
    264287        <?php endif; ?>
    265288
  • popaeo-llms-txt/tags/0.2.7/readme.txt

    r3583930 r3583938  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 0.2.6
     7Stable tag: 0.2.7
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    8989== Changelog ==
    9090
     91= 0.2.7 =
     92* Added validation for saved PopAEO endpoint settings so outdated or incomplete connection data cannot trap merchants inside the embedded connection page.
     93* Shows a reconnect prompt when existing connection settings need to be repaired.
     94
    9195= 0.2.6 =
    9296* Moved WooCommerce connection start into a native WordPress admin redirect so the PopAEO connection form is no longer embedded inside WordPress.
  • popaeo-llms-txt/trunk/popaeo-llms-txt.php

    r3583930 r3583938  
    44 * Plugin URI: https://www.popaeo.com/docs
    55 * Description: Publishes AI-readable llms.txt content for WooCommerce stores through PopAEO.
    6  * Version: 0.2.6
     6 * Version: 0.2.7
    77 * Author: PopAEO
    88 * Author URI: https://www.popaeo.com
    … …  
    4747    $settings = get_option(POPAEO_LLMS_OPTION, []);
    4848    return wp_parse_args(is_array($settings) ? $settings : [], popaeo_llms_default_settings());
     49}
     50
     51function popaeo_llms_is_valid_endpoint_url($endpoint_url) {
     52    $parts = wp_parse_url($endpoint_url);
     53    if (empty($parts['scheme']) || empty($parts['host']) || !in_array($parts['scheme'], ['http', 'https'], true)) {
     54        return false;
     55    }
     56
     57    $path = $parts['path'] ?? '';
     58    return $path === '' || $path === '/';
     59}
     60
     61function popaeo_llms_is_connected($settings) {
     62    if (empty($settings['endpoint_url']) || empty($settings['connection_id']) || empty($settings['shared_secret'])) {
     63        return false;
     64    }
     65
     66    return popaeo_llms_is_valid_endpoint_url($settings['endpoint_url']);
    4967}
    5068
    … …  
    222240        'popaeo_llms_start_connect'
    223241    );
    224     $is_connected = !empty($settings['endpoint_url']) && !empty($settings['connection_id']) && !empty($settings['shared_secret']);
     242    $has_saved_connection = !empty($settings['endpoint_url']) && !empty($settings['connection_id']) && !empty($settings['shared_secret']);
     243    $is_connected = popaeo_llms_is_connected($settings);
    225244    $dashboard_url = $is_connected
    226245        ? untrailingslashit($settings['endpoint_url']) . '/connections/woocommerce/dashboard/' . rawurlencode($settings['connection_id'])
    … …  
    262281        <?php if (!class_exists('WooCommerce')) : ?>
    263282            <div class="notice notice-error"><p><?php echo esc_html__('WooCommerce is required. Install and activate WooCommerce before connecting PopAEO.', 'popaeo-llms-txt'); ?></p></div>
     283        <?php endif; ?>
     284
     285        <?php if ($has_saved_connection && !$is_connected) : ?>
     286            <div class="notice notice-warning"><p><?php echo esc_html__('PopAEO found an incomplete or outdated connection setting. Click Start AEO Audit to reconnect and repair it automatically.', 'popaeo-llms-txt'); ?></p></div>
    264287        <?php endif; ?>
    265288
  • popaeo-llms-txt/trunk/readme.txt

    r3583930 r3583938  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 0.2.6
     7Stable tag: 0.2.7
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    8989== Changelog ==
    9090
     91= 0.2.7 =
     92* Added validation for saved PopAEO endpoint settings so outdated or incomplete connection data cannot trap merchants inside the embedded connection page.
     93* Shows a reconnect prompt when existing connection settings need to be repaired.
     94
    9195= 0.2.6 =
    9296* Moved WooCommerce connection start into a native WordPress admin redirect so the PopAEO connection form is no longer embedded inside WordPress.
Note: See TracChangeset for help on using the changeset viewer.