Plugin Directory

Changeset 3251921


Ignore:
Timestamp:
03/07/2025 12:19:52 AM (13 months ago)
Author:
marknokes
Message:

2.4.7

  • Feature: add subscription start time to order details
  • Bugfix: plans not updating in gui on plugin activation when using redis cache
  • Bugfix: plugin reactivation causes database error on upgrade
  • Improvement: increase timeout for wp_remote_request
  • Improvement: isset check for plan_id and product_id in ajax actions
  • Improvement: change Order set_taxes method from private to public static
Location:
subscriptions-for-woo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • subscriptions-for-woo/tags/2.4.7/classes/PPSFWOO/class-ppsfwoo-plan.php

    r3251915 r3251921  
    219219        $env = $this->env;
    220220
     221        PluginMain::clear_option_cache('ppsfwoo_plans');
     222
    221223        update_option('ppsfwoo_plans', [
    222224            $env => $plans
    223225        ]);
    224226
    225         return $PluginMain::get_option('ppsfwoo_plans');
     227        return $plans;
    226228    }
    227229
     
    315317        $PluginMain = PluginMain::get_instance();
    316318
    317         $plans = $PluginMain->ppsfwoo_plans[$PluginMain->env['env']] ?? [];
     319        $maybe_string = PluginMain::get_option('ppsfwoo_plans');
     320
     321        $array = is_array($maybe_string) ? $maybe_string[$PluginMain->env['env']]: unserialize($maybe_string)[$PluginMain->env['env']];
     322
     323        $plans = $array ?? [];
    318324
    319325        if($plans) {
  • subscriptions-for-woo/tags/2.4.7/classes/PPSFWOO/class-ppsfwoo-webhook.php

    r3251915 r3251921  
    55use PPSFWOO\PayPal,
    66    PPSFWOO\Subscriber,
    7     PPSFWOO\PluginMain;
     7    PPSFWOO\PluginMain,
     8    PPSFWOO\Exception;
    89
    910class Webhook
     
    213214                $event_types = $response['response']['event_types'];
    214215           
    215             } else if(isset($response['error']) && $response['error'] === "WEBHOOK_URL_ALREADY_EXISTS") {
     216            } else if(!PayPal::response_status_is($response, 201)) {
    216217
    217218                $response = $this->patch(true);
     
    236237           
    237238        } catch(\Exception $e) {
     239
     240            Exception::log($e);
    238241
    239242            return false;
  • subscriptions-for-woo/trunk/classes/PPSFWOO/class-ppsfwoo-plan.php

    r3251915 r3251921  
    219219        $env = $this->env;
    220220
     221        PluginMain::clear_option_cache('ppsfwoo_plans');
     222
    221223        update_option('ppsfwoo_plans', [
    222224            $env => $plans
    223225        ]);
    224226
    225         return $PluginMain::get_option('ppsfwoo_plans');
     227        return $plans;
    226228    }
    227229
     
    315317        $PluginMain = PluginMain::get_instance();
    316318
    317         $plans = $PluginMain->ppsfwoo_plans[$PluginMain->env['env']] ?? [];
     319        $maybe_string = PluginMain::get_option('ppsfwoo_plans');
     320
     321        $array = is_array($maybe_string) ? $maybe_string[$PluginMain->env['env']]: unserialize($maybe_string)[$PluginMain->env['env']];
     322
     323        $plans = $array ?? [];
    318324
    319325        if($plans) {
  • subscriptions-for-woo/trunk/classes/PPSFWOO/class-ppsfwoo-webhook.php

    r3243512 r3251921  
    55use PPSFWOO\PayPal,
    66    PPSFWOO\Subscriber,
    7     PPSFWOO\PluginMain;
     7    PPSFWOO\PluginMain,
     8    PPSFWOO\Exception;
    89
    910class Webhook
     
    213214                $event_types = $response['response']['event_types'];
    214215           
    215             } else if(isset($response['error']) && $response['error'] === "WEBHOOK_URL_ALREADY_EXISTS") {
     216            } else if(!PayPal::response_status_is($response, 201)) {
    216217
    217218                $response = $this->patch(true);
     
    236237           
    237238        } catch(\Exception $e) {
     239
     240            Exception::log($e);
    238241
    239242            return false;
Note: See TracChangeset for help on using the changeset viewer.