Changeset 3487544
- Timestamp:
- 03/21/2026 12:22:48 AM (11 days ago)
- Location:
- cmsps-revenue-pulse-advisor
- Files:
-
- 19 added
- 3 edited
-
assets/banner-1544x500.png (added)
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.png (added)
-
tags/1.0.3 (added)
-
tags/1.0.3/assets (added)
-
tags/1.0.3/assets/admin.css (added)
-
tags/1.0.3/assets/admin.js (added)
-
tags/1.0.3/assets/export.css (added)
-
tags/1.0.3/cmsps-revenue-pulse-advisor.php (added)
-
tags/1.0.3/includes (added)
-
tags/1.0.3/includes/class-cmsps-client.php (added)
-
tags/1.0.3/includes/class-cmsps-scheduler.php (added)
-
tags/1.0.3/includes/class-cmsps-settings.php (added)
-
tags/1.0.3/readme.txt (added)
-
trunk/cmsps-revenue-pulse-advisor.php (modified) (5 diffs)
-
trunk/includes/class-cmsps-settings.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cmsps-revenue-pulse-advisor/trunk/cmsps-revenue-pulse-advisor.php
r3487258 r3487544 4 4 * Plugin URI: https://wooi.codingmall.com 5 5 * Description: WooCommerce AI insights via CMSPS SaaS. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Author: CMSPS 8 8 * License: GPL-2.0-or-later … … 15 15 } 16 16 17 define('CMSPS_RPA_VERSION', '1.0. 2');17 define('CMSPS_RPA_VERSION', '1.0.3'); 18 18 define('CMSPS_RPA_SLUG', 'cmsps-revenue-pulse-advisor'); 19 19 define('CMSPS_RPA_DIR', plugin_dir_path(__FILE__)); … … 184 184 } 185 185 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)) { 188 189 update_option(CMSPS_RPA_OPTION_ACTIVATION_NOTICE, [ 189 190 'type' => 'warning', … … 200 201 201 202 $response = CMSPS_RPA_Client::activate_site([ 202 'domain' => $ domain,203 'domain' => $site_base_url, 203 204 'site_name' => get_bloginfo('name'), 204 205 'proof_secret' => $proof_secret, … … 284 285 } 285 286 286 function cmsps_rpa_current_ domain() {287 function cmsps_rpa_current_site_base_url() { 287 288 $site_url = home_url('/'); 289 $scheme = wp_parse_url($site_url, PHP_URL_SCHEME); 288 290 $host = wp_parse_url($site_url, PHP_URL_HOST); 289 if (!is_string($ host)) {291 if (!is_string($scheme) || !is_string($host) || $scheme === '' || $host === '') { 290 292 return ''; 291 293 } 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 312 function 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 292 322 return strtolower(trim($host)); 293 323 } 294 324 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)) {325 function 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)) { 303 333 return false; 304 334 } -
cmsps-revenue-pulse-advisor/trunk/includes/class-cmsps-settings.php
r3487258 r3487544 1029 1029 check_admin_referer('cmsps_rpa_reconnect_site'); 1030 1030 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')) { 1032 1032 update_option(CMSPS_RPA_OPTION_ACTIVATION_NOTICE, [ 1033 1033 'type' => 'error', … … 1037 1037 } 1038 1038 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)) { 1041 1042 update_option(CMSPS_RPA_OPTION_ACTIVATION_NOTICE, [ 1042 1043 'type' => 'warning', … … 1050 1051 1051 1052 $response = CMSPS_RPA_Client::activate_site([ 1052 'domain' => $ domain,1053 'domain' => $site_base_url, 1053 1054 'site_name' => get_bloginfo('name'), 1054 1055 'proof_secret' => $proof_secret, -
cmsps-revenue-pulse-advisor/trunk/readme.txt
r3487258 r3487544 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 21 21 == External services == 22 22 23 This plugin connects to external services for activation, balance lookup, analysis generation, pricing metadata, and checkout links.23 This plugin connects to external services for activation, credit balance lookup, revenue analysis generation, and credit purchases. 24 24 25 25 Service website: … … 31 31 * When the store owner runs a revenue analysis 32 32 * 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 opensFastSpring checkout33 * When the `Buy Credits` page loads to show available credit packages 34 * When the site owner starts a credit purchase through FastSpring checkout 35 35 36 36 Data sent: … … 66 66 No. Payments are handled by FastSpring checkout links. 67 67 68 == Screenshots == 69 70 1. Plugin settings with connection status, credits overview, and quick actions. 71 2. Run Revenue Analysis page with preset and custom date range options. 72 3. Results history with saved analysis runs and status indicators. 73 4. Analysis detail view with generated insights and source snapshot. 74 68 75 == Changelog == 69 76 77 = 1.0.3 = 78 * Fixed automatic site activation for WordPress installations hosted in a subdirectory path. 79 70 80 = 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. 73 82 74 83 = 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. 78 86 79 87 = 1.0.0 = 80 88 * 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. 84 91 85 92 == Upgrade Notice == 86 93 94 = 1.0.3 = 95 Subdirectory WordPress installs now activate correctly. 96 87 97 = 1.0.0 = 88 98 Initial stable release.
Note: See TracChangeset
for help on using the changeset viewer.