Plugin Directory

Changeset 3434176


Ignore:
Timestamp:
01/07/2026 08:41:45 AM (6 weeks ago)
Author:
seresa8
Message:

Update: Bug fixes and improvements (v1.0.5)

Location:
inpipe-by-seresa/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • inpipe-by-seresa/trunk/includes/core/api/class-inpipe-api-endpoints-free.php

    r3432527 r3434176  
    88 * @author Seresa
    99 * @license GPL-2.0+
    10  *
     10 * @since 1.0.0
     11 * @since 1.0.5 Added 'trialing' status support for trial subscriptions.
    1112 */
    1213
     
    145146     * @since 1.0.0
    146147     * @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.
    147149     * @param WP_REST_Request $request The request object.
    148150     * @return WP_REST_Response|WP_Error Response object.
     
    162164            $subscription_type = ! empty( $subscription['subscription_type'] ) ? $subscription['subscription_type'] : ( ! empty( $subscription['plan'] ) ? $subscription['plan'] : 'free' );
    163165            $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 ),
    165167                'expires'           => ! empty( $subscription['expires_at'] ) ? $subscription['expires_at'] : ( ! empty( $subscription['expires'] ) ? $subscription['expires'] : null ),
    166168                'subscription_type' => $subscription_type,
     
    199201     * @since 1.0.0
    200202     * @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.
    201204     * @param WP_REST_Request $request The request object.
    202205     * @return WP_REST_Response|WP_Error Response object.
     
    281284            }
    282285
    283             // Only mark as active if the subscription is actually active and not expired
    284             $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 );
    285288            $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';
    287290
    288291            // debug log removed for production
     
    16031606
    16041607    /**
    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).
    16081612     * @return void
    16091613     */
    16101614    public function register_routes() {
    16111615        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         }
    16171616
    16181617        $routes = array(
     
    17571756        }
    17581757
    1759         wp_cache_set( 'api_routes', true, $this->cache_group, HOUR_IN_SECONDS );
    17601758        inpipe_debug_log( 'FREE API ROUTE REGISTRATION COMPLETE' );
    17611759    }
  • inpipe-by-seresa/trunk/includes/core/class-inpipe-status-manager.php

    r3400228 r3434176  
    99 * @subpackage Core
    1010 * @since 1.0.1
     11 * @since 1.0.5 Added 'trialing' status support for trial subscriptions.
    1112 * @author Seresa
    1213 * @license GPL-2.0+
     
    137138     *
    138139     * @since 1.0.1
     140     * @since 1.0.5 Added 'trialing' to valid statuses and 'trial' to valid plans.
    139141     * @return bool True if subscription is valid.
    140142     */
    141143    public function isValid(): bool {
    142         $is_active = $this->status === 'active';
     144        $is_active = in_array( $this->status, array( 'active', 'trialing' ), true );
    143145        $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
    146148        return $is_active && !$is_expired && $valid_plan;
    147149    }
     
    262264     * @since 1.0.1
    263265     * @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.
    264267     * @return bool True if subscription is active and valid, false otherwise.
    265268     */
     
    309312                    "SELECT subscription_status, subscription_type, subscription_expiry
    310313                    FROM {$table_name}
    311                     WHERE subscription_status IN (%s, %s, %s, %s, %s)
     314                    WHERE subscription_status IN (%s, %s, %s, %s, %s, %s)
    312315                    ORDER BY updated_at DESC
    313316                    LIMIT 1",
    314317                    'active',
     318                    'trialing',
    315319                    'paused',
    316320                    'suspended',
  • inpipe-by-seresa/trunk/includes/core/class-inpipe-vue-admin.php

    r3406561 r3434176  
    162162            $this->plugin_slug,               // Menu slug.
    163163            array( $this, 'render_admin_app' ),      // Callback.
    164             'dashicons-chart-area',           // Icon.
     164            'dashicons-yes-alt',              // Icon.
    165165            30                                // Position.
    166166        );
     
    216216        echo '<div id="inpipe-admin-app" class="wrap">
    217217            <style>
    218                 .inpipe-loading {
     218                .inpipe-loading-container {
    219219                    display: flex;
    220220                    flex-direction: column;
     
    224224                    min-height: 300px;
    225225                }
    226                 .inpipe-spinner {
     226                .inpipe-loading-spinner {
    227227                    width: 40px;
    228228                    height: 40px;
     
    230230                    border-top: 3px solid #2271b1;
    231231                    border-radius: 50%;
    232                     animation: inpipe-spin 0.8s linear infinite;
     232                    animation: inpipe-admin-spin 0.8s linear infinite;
    233233                }
    234                 @keyframes inpipe-spin {
     234                @keyframes inpipe-admin-spin {
    235235                    0% { transform: rotate(0deg); }
    236236                    100% { transform: rotate(360deg); }
     
    242242                }
    243243            </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>
    246246                <p class="inpipe-loading-text">' . esc_html__( 'Loading inPIPE Admin...', 'inpipe-by-seresa' ) . '</p>
    247247            </div>
  • inpipe-by-seresa/trunk/inpipe-by-seresa.php

    r3432527 r3434176  
    44 * Plugin URI: https://seresa.io/wordpress-plugin
    55 * 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.4
     6 * Version: 1.0.5
    77 * Requires at least: 6.4
    88 * Requires PHP: 8.3
     
    3131// ====================================================================
    3232
    33 define( 'INPIPE_VERSION', '1.0.3' );
     33define( 'INPIPE_VERSION', '1.0.5' );
    3434define( 'INPIPE_DB_VERSION', '1.0.0' );
    3535define( 'INPIPE_PATH', plugin_dir_path( __FILE__ ) );
  • inpipe-by-seresa/trunk/readme.txt

    r3432527 r3434176  
    66Requires PHP: 8.3
    77Tested up to: 6.9
    8 Stable tag: 1.0.4
     8Stable tag: 1.0.5
    99License: GPL-2.0+
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    168168
    169169== 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---
    170203
    171204= 1.0.4 - 2025-12-16 =
Note: See TracChangeset for help on using the changeset viewer.