Plugin Directory

Changeset 3487544


Ignore:
Timestamp:
03/21/2026 12:22:48 AM (11 days ago)
Author:
codingmall
Message:

Release version 1.0.3

Location:
cmsps-revenue-pulse-advisor
Files:
19 added
3 edited

Legend:

Unmodified
Added
Removed
  • cmsps-revenue-pulse-advisor/trunk/cmsps-revenue-pulse-advisor.php

    r3487258 r3487544  
    44 * Plugin URI: https://wooi.codingmall.com
    55 * Description: WooCommerce AI insights via CMSPS SaaS.
    6  * Version: 1.0.2
     6 * Version: 1.0.3
    77 * Author: CMSPS
    88 * License: GPL-2.0-or-later
     
    1515}
    1616
    17 define('CMSPS_RPA_VERSION', '1.0.2');
     17define('CMSPS_RPA_VERSION', '1.0.3');
    1818define('CMSPS_RPA_SLUG', 'cmsps-revenue-pulse-advisor');
    1919define('CMSPS_RPA_DIR', plugin_dir_path(__FILE__));
     
    184184  }
    185185
    186   $domain = cmsps_rpa_current_domain();
    187   if (!cmsps_rpa_is_live_domain($domain)) {
     186  $site_base_url = cmsps_rpa_current_site_base_url();
     187  $site_host = cmsps_rpa_site_host_from_url($site_base_url);
     188  if (!cmsps_rpa_is_live_host($site_host)) {
    188189    update_option(CMSPS_RPA_OPTION_ACTIVATION_NOTICE, [
    189190      'type' => 'warning',
     
    200201
    201202    $response = CMSPS_RPA_Client::activate_site([
    202       'domain' => $domain,
     203      'domain' => $site_base_url,
    203204      'site_name' => get_bloginfo('name'),
    204205      'proof_secret' => $proof_secret,
     
    284285}
    285286
    286 function cmsps_rpa_current_domain() {
     287function cmsps_rpa_current_site_base_url() {
    287288  $site_url = home_url('/');
     289  $scheme = wp_parse_url($site_url, PHP_URL_SCHEME);
    288290  $host = wp_parse_url($site_url, PHP_URL_HOST);
    289   if (!is_string($host)) {
     291  if (!is_string($scheme) || !is_string($host) || $scheme === '' || $host === '') {
    290292    return '';
    291293  }
     294
     295  $port = wp_parse_url($site_url, PHP_URL_PORT);
     296  $path = wp_parse_url($site_url, PHP_URL_PATH);
     297
     298  $base = strtolower($scheme) . '://' . strtolower(trim($host));
     299  if (is_int($port) && $port > 0) {
     300    $base .= ':' . $port;
     301  }
     302  if (is_string($path) && $path !== '') {
     303    $normalized_path = '/' . trim($path, '/');
     304    if ($normalized_path !== '/') {
     305      $base .= $normalized_path;
     306    }
     307  }
     308
     309  return untrailingslashit($base);
     310}
     311
     312function cmsps_rpa_site_host_from_url($site_url) {
     313  if (!is_string($site_url) || $site_url === '') {
     314    return '';
     315  }
     316
     317  $host = wp_parse_url($site_url, PHP_URL_HOST);
     318  if (!is_string($host) || $host === '') {
     319    return '';
     320  }
     321
    292322  return strtolower(trim($host));
    293323}
    294324
    295 function cmsps_rpa_is_live_domain($domain) {
    296   if (!is_string($domain) || $domain === '') {
    297     return false;
    298   }
    299   if ($domain === 'localhost' || preg_match('/\.(local|test|invalid|example)$/', $domain)) {
    300     return false;
    301   }
    302   if (filter_var($domain, FILTER_VALIDATE_IP)) {
     325function cmsps_rpa_is_live_host($host) {
     326  if (!is_string($host) || $host === '') {
     327    return false;
     328  }
     329  if ($host === 'localhost' || preg_match('/\.(local|test|invalid|example)$/', $host)) {
     330    return false;
     331  }
     332  if (filter_var($host, FILTER_VALIDATE_IP)) {
    303333    return false;
    304334  }
  • cmsps-revenue-pulse-advisor/trunk/includes/class-cmsps-settings.php

    r3487258 r3487544  
    10291029    check_admin_referer('cmsps_rpa_reconnect_site');
    10301030
    1031     if (!function_exists('cmsps_rpa_current_domain') || !function_exists('cmsps_rpa_is_live_domain')) {
     1031    if (!function_exists('cmsps_rpa_current_site_base_url') || !function_exists('cmsps_rpa_site_host_from_url') || !function_exists('cmsps_rpa_is_live_host')) {
    10321032      update_option(CMSPS_RPA_OPTION_ACTIVATION_NOTICE, [
    10331033        'type' => 'error',
     
    10371037    }
    10381038
    1039     $domain = cmsps_rpa_current_domain();
    1040     if (!cmsps_rpa_is_live_domain($domain)) {
     1039    $site_base_url = cmsps_rpa_current_site_base_url();
     1040    $site_host = cmsps_rpa_site_host_from_url($site_base_url);
     1041    if (!cmsps_rpa_is_live_host($site_host)) {
    10411042      update_option(CMSPS_RPA_OPTION_ACTIVATION_NOTICE, [
    10421043        'type' => 'warning',
     
    10501051
    10511052    $response = CMSPS_RPA_Client::activate_site([
    1052       'domain' => $domain,
     1053      'domain' => $site_base_url,
    10531054      'site_name' => get_bloginfo('name'),
    10541055      'proof_secret' => $proof_secret,
  • cmsps-revenue-pulse-advisor/trunk/readme.txt

    r3487258 r3487544  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2121== External services ==
    2222
    23 This plugin connects to external services for activation, balance lookup, analysis generation, pricing metadata, and checkout links.
     23This plugin connects to external services for activation, credit balance lookup, revenue analysis generation, and credit purchases.
    2424
    2525Service website:
     
    3131* When the store owner runs a revenue analysis
    3232* When plugin admin pages request credit balance or credit ledger data
    33 * When the `Buy Credits` page loads to fetch pricing metadata from `https://codingmall.com/tools0x/wooinsights/plans.json`
    34 * When the site owner clicks a `Buy Now` link and opens FastSpring checkout
     33* When the `Buy Credits` page loads to show available credit packages
     34* When the site owner starts a credit purchase through FastSpring checkout
    3535
    3636Data sent:
     
    6666No. Payments are handled by FastSpring checkout links.
    6767
     68== Screenshots ==
     69
     701. Plugin settings with connection status, credits overview, and quick actions.
     712. Run Revenue Analysis page with preset and custom date range options.
     723. Results history with saved analysis runs and status indicators.
     734. Analysis detail view with generated insights and source snapshot.
     74
    6875== Changelog ==
    6976
     77= 1.0.3 =
     78* Fixed automatic site activation for WordPress installations hosted in a subdirectory path.
     79
    7080= 1.0.2 =
    71 * Show "Reconnect Automatically" only when API is not connected.
    72 * Show one-time congratulations notice when activation bonus credits are granted after bootstrap retry.
     81* Improved connection and activation messaging in wp-admin.
    7382
    7483= 1.0.1 =
    75 * Added automatic credential bootstrap retries in wp-admin when credentials are missing.
    76 * Redirected non-settings plugin pages to Settings when API is not connected.
    77 * Added reconnect-required admin notice flow.
     84* Improved automatic setup when site credentials are missing.
     85* Improved the disconnected-site admin flow.
    7886
    7987= 1.0.0 =
    8088* Initial stable release.
    81 * Added buy credits screen with live plan links.
    82 * Added credits purchased history screen.
    83 * Added FastSpring webhook hardening and diagnostics.
     89* Added the Buy Credits screen.
     90* Added credits purchase history.
    8491
    8592== Upgrade Notice ==
    8693
     94= 1.0.3 =
     95Subdirectory WordPress installs now activate correctly.
     96
    8797= 1.0.0 =
    8898Initial stable release.
Note: See TracChangeset for help on using the changeset viewer.