Changeset 3434176
- Timestamp:
- 01/07/2026 08:41:45 AM (6 weeks ago)
- Location:
- inpipe-by-seresa/trunk
- Files:
-
- 5 edited
-
includes/core/api/class-inpipe-api-endpoints-free.php (modified) (7 diffs)
-
includes/core/class-inpipe-status-manager.php (modified) (4 diffs)
-
includes/core/class-inpipe-vue-admin.php (modified) (5 diffs)
-
inpipe-by-seresa.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
inpipe-by-seresa/trunk/includes/core/api/class-inpipe-api-endpoints-free.php
r3432527 r3434176 8 8 * @author Seresa 9 9 * @license GPL-2.0+ 10 * 10 * @since 1.0.0 11 * @since 1.0.5 Added 'trialing' status support for trial subscriptions. 11 12 */ 12 13 … … 145 146 * @since 1.0.0 146 147 * @since 1.0.3 Updated to use new field names (subscription_type, plan_type, expires_at). 148 * @since 1.0.5 Added 'trialing' to valid active statuses for trial subscriptions. 147 149 * @param WP_REST_Request $request The request object. 148 150 * @return WP_REST_Response|WP_Error Response object. … … 162 164 $subscription_type = ! empty( $subscription['subscription_type'] ) ? $subscription['subscription_type'] : ( ! empty( $subscription['plan'] ) ? $subscription['plan'] : 'free' ); 163 165 $status = array( 164 'is_active' => ! empty( $subscription['status'] ) && 'active' === $subscription['status'],166 'is_active' => ! empty( $subscription['status'] ) && in_array( $subscription['status'], array( 'active', 'trialing' ), true ), 165 167 'expires' => ! empty( $subscription['expires_at'] ) ? $subscription['expires_at'] : ( ! empty( $subscription['expires'] ) ? $subscription['expires'] : null ), 166 168 'subscription_type' => $subscription_type, … … 199 201 * @since 1.0.0 200 202 * @since 1.0.3 Updated to use new field names from verify_subscription_with_service(). 203 * @since 1.0.5 Added 'trialing' to valid active statuses for trial subscriptions. 201 204 * @param WP_REST_Request $request The request object. 202 205 * @return WP_REST_Response|WP_Error Response object. … … 281 284 } 282 285 283 // Only mark as active if the subscription is actually active and not expired284 $is_active = ($subscription_data['status'] === 'active');286 // Only mark as active if the subscription is actually active/trialing and not expired 287 $is_active = in_array( $subscription_data['status'], array( 'active', 'trialing' ), true ); 285 288 $is_expired = !empty($subscription_data['expires']) && (time() > strtotime($subscription_data['expires'])); 286 $subscription_status = ($is_active && !$is_expired) ? 'active': 'inactive';289 $subscription_status = ($is_active && !$is_expired) ? $subscription_data['status'] : 'inactive'; 287 290 288 291 // debug log removed for production … … 1603 1606 1604 1607 /** 1605 * Register REST API routes with caching. 1606 * 1607 * @since 1.0.0 1608 * Register REST API routes. 1609 * 1610 * @since 1.0.0 1611 * @since 1.0.5 Removed route caching that caused 404 errors on servers with persistent object cache (Redis/Memcached). 1608 1612 * @return void 1609 1613 */ 1610 1614 public function register_routes() { 1611 1615 inpipe_debug_log( 'FREE API ROUTE REGISTRATION START' ); 1612 1613 $cached_routes = wp_cache_get( 'api_routes', $this->cache_group );1614 if ( false !== $cached_routes ) {1615 return;1616 }1617 1616 1618 1617 $routes = array( … … 1757 1756 } 1758 1757 1759 wp_cache_set( 'api_routes', true, $this->cache_group, HOUR_IN_SECONDS );1760 1758 inpipe_debug_log( 'FREE API ROUTE REGISTRATION COMPLETE' ); 1761 1759 } -
inpipe-by-seresa/trunk/includes/core/class-inpipe-status-manager.php
r3400228 r3434176 9 9 * @subpackage Core 10 10 * @since 1.0.1 11 * @since 1.0.5 Added 'trialing' status support for trial subscriptions. 11 12 * @author Seresa 12 13 * @license GPL-2.0+ … … 137 138 * 138 139 * @since 1.0.1 140 * @since 1.0.5 Added 'trialing' to valid statuses and 'trial' to valid plans. 139 141 * @return bool True if subscription is valid. 140 142 */ 141 143 public function isValid(): bool { 142 $is_active = $this->status === 'active';144 $is_active = in_array( $this->status, array( 'active', 'trialing' ), true ); 143 145 $is_expired = $this->expires_at ? (time() > strtotime($this->expires_at)) : false; 144 $valid_plan = in_array(strtolower($this->plan), ['pro', 'premium', 'business' ]);145 146 $valid_plan = in_array(strtolower($this->plan), ['pro', 'premium', 'business', 'trial']); 147 146 148 return $is_active && !$is_expired && $valid_plan; 147 149 } … … 262 264 * @since 1.0.1 263 265 * @since 1.0.2 Updated subscription query to check multiple statuses (active, paused, suspended, expired, cancelled) 266 * @since 1.0.5 Added 'trialing' to valid subscription statuses for trial subscriptions. 264 267 * @return bool True if subscription is active and valid, false otherwise. 265 268 */ … … 309 312 "SELECT subscription_status, subscription_type, subscription_expiry 310 313 FROM {$table_name} 311 WHERE subscription_status IN (%s, %s, %s, %s, %s )314 WHERE subscription_status IN (%s, %s, %s, %s, %s, %s) 312 315 ORDER BY updated_at DESC 313 316 LIMIT 1", 314 317 'active', 318 'trialing', 315 319 'paused', 316 320 'suspended', -
inpipe-by-seresa/trunk/includes/core/class-inpipe-vue-admin.php
r3406561 r3434176 162 162 $this->plugin_slug, // Menu slug. 163 163 array( $this, 'render_admin_app' ), // Callback. 164 'dashicons- chart-area',// Icon.164 'dashicons-yes-alt', // Icon. 165 165 30 // Position. 166 166 ); … … 216 216 echo '<div id="inpipe-admin-app" class="wrap"> 217 217 <style> 218 .inpipe-loading {218 .inpipe-loading-container { 219 219 display: flex; 220 220 flex-direction: column; … … 224 224 min-height: 300px; 225 225 } 226 .inpipe- spinner {226 .inpipe-loading-spinner { 227 227 width: 40px; 228 228 height: 40px; … … 230 230 border-top: 3px solid #2271b1; 231 231 border-radius: 50%; 232 animation: inpipe- spin 0.8s linear infinite;232 animation: inpipe-admin-spin 0.8s linear infinite; 233 233 } 234 @keyframes inpipe- spin {234 @keyframes inpipe-admin-spin { 235 235 0% { transform: rotate(0deg); } 236 236 100% { transform: rotate(360deg); } … … 242 242 } 243 243 </style> 244 <div class="inpipe-loading ">245 <div class="inpipe- spinner"></div>244 <div class="inpipe-loading-container"> 245 <div class="inpipe-loading-spinner"></div> 246 246 <p class="inpipe-loading-text">' . esc_html__( 'Loading inPIPE Admin...', 'inpipe-by-seresa' ) . '</p> 247 247 </div> -
inpipe-by-seresa/trunk/inpipe-by-seresa.php
r3432527 r3434176 4 4 * Plugin URI: https://seresa.io/wordpress-plugin 5 5 * Description: Captures, stores, and decodes UTM parameters for enhanced results in Google Analytics, Facebook Ads, and other platforms. Integrates with the dataLayer and supports standard and encoded UTM codes. 6 * Version: 1.0. 46 * Version: 1.0.5 7 7 * Requires at least: 6.4 8 8 * Requires PHP: 8.3 … … 31 31 // ==================================================================== 32 32 33 define( 'INPIPE_VERSION', '1.0. 3' );33 define( 'INPIPE_VERSION', '1.0.5' ); 34 34 define( 'INPIPE_DB_VERSION', '1.0.0' ); 35 35 define( 'INPIPE_PATH', plugin_dir_path( __FILE__ ) ); -
inpipe-by-seresa/trunk/readme.txt
r3432527 r3434176 6 6 Requires PHP: 8.3 7 7 Tested up to: 6.9 8 Stable tag: 1.0. 48 Stable tag: 1.0.5 9 9 License: GPL-2.0+ 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 168 168 169 169 == Changelog == 170 171 = 1.0.5 - 2026-01-06 = 172 **Trial Subscription Support & REST API Fix** 173 174 = NEW FEATURES = 175 * **Trial Subscription Status Support**: Added full support for `trialing` subscription status from Stripe 176 - Trial users now properly recognized as premium users with access to all features 177 - Premium UI components display correctly during trial period 178 - Event tracking enabled for trial subscriptions 179 180 = UI ENHANCEMENTS = 181 * **Trial Status Display**: Added "Trial Active" status display in subscription management 182 - New blue badge styling for trial status (`.badge-trialing`) 183 - Status indicator shows "Trial Active" instead of "Unknown" 184 - Consistent visual styling across all subscription status displays 185 186 = BUG FIXES = 187 * **Fixed REST API 404 Errors on Cached Servers**: Removed incorrect route caching that caused 404 errors on servers with persistent object cache (Redis/Memcached) 188 - Routes must be registered on every `rest_api_init` call; caching was preventing registration 189 - Fixes `/wp-json/inpipe/v1/*` endpoints returning 404 on cached hosting environments 190 * **Fixed Premium Detection for Trials**: Trial subscriptions now correctly detected as valid premium subscriptions 191 - Updated `isValid()` method to accept `trialing` status 192 - Updated `inpipe_has_premium_subscription()` SQL query to include `trialing` 193 - Fixed `is_active` checks in API endpoints to recognize trial subscriptions 194 * **Fixed Subscription Warning Banner**: Trial users no longer see incorrect subscription warning messages 195 * **Fixed Event Tracking for Trials**: Event tracking now properly schedules for trial subscriptions 196 197 = TECHNICAL = 198 * Updated `class-inpipe-status-manager.php` with trialing status support 199 * Updated `class-inpipe-api-endpoints-free.php` with trialing status checks and removed route caching 200 * Added `@since 1.0.5` documentation tags to all modified methods 201 202 --- 170 203 171 204 = 1.0.4 - 2025-12-16 =
Note: See TracChangeset
for help on using the changeset viewer.