Plugin Directory

Changeset 3255406


Ignore:
Timestamp:
03/13/2025 01:52:05 PM (13 months ago)
Author:
marknokes
Message:

2.5.1

  • Bugfix: plans not refreshing on plugin activation
Location:
subscriptions-for-woo
Files:
44 added
5 edited

Legend:

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

    r3255029 r3255406  
    1212           $frequency,
    1313           $price,
     14           $plan_name,
    1415           $product_name,
    1516           $version,
  • subscriptions-for-woo/trunk/classes/PPSFWOO/class-ppsfwoo-plugin-main.php

    r3255029 r3255406  
    203203        add_action('ppsfwoo_cron_resubscribe_webhooks', [Webhook::get_instance(), 'resubscribe']);
    204204
    205         add_action('ppsfwoo_refresh_plans', [AjaxActionsPriv::class, 'refresh_plans']);
    206 
    207205        add_action('admin_menu', [$this, 'register_options_page']);
    208206
     
    704702    public function plugin_deactivation()
    705703    {
     704        delete_transient('ppsfwoo_refresh_plans_ran');
     705
    706706        if("1" === $this->ppsfwoo_delete_plugin_data) {
    707707           
    708             new Database("DROP TABLE IF EXISTS {$GLOBALS['wpdb']->base_prefix}ppsfwoo_subscriber");
     708            new Database("SET FOREIGN_KEY_CHECKS = 0;");
     709
     710            new Database("DROP TABLE IF EXISTS {$GLOBALS['wpdb']->base_prefix}ppsfwoo_subscriber;");
     711
     712            new Database("SET FOREIGN_KEY_CHECKS = 1;");
    709713
    710714            Webhook::get_instance()->delete();
  • subscriptions-for-woo/trunk/readme.txt

    r3255029 r3255406  
    44License: GPLv2 or later
    55License URI: http://www.gnu.org/licenses/gpl-2.0.html
    6 Stable tag: 2.5
     6Stable tag: 2.5.1
    77WC tested up to: 9.7.1
    88Requires at least: 6.4.3
     
    106106== Changelog ==
    107107
     108= 2.5.1 =
     109* Bugfix: plans not refreshing on plugin activation
     110
    108111= 2.5 =
    109112* Bugfix: product general settings missing on product type change
     
    112115* Improvement: update validate_callback on rest_api_init
    113116* Improvement: general refactoring for efficiency & clarity
    114 
    115117
    116118= 2.4.9 =
  • subscriptions-for-woo/trunk/subscriptions-for-woo.php

    r3255029 r3255406  
    88 * License: GPLv2 or later
    99 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    10  * Version: 2.5
     10 * Version: 2.5.1
    1111 * WC requires at least: 8.6.0
    1212 * WC tested up to: 9.7.1
     
    1919
    2020use PPSFWOO\PluginMain,
     21    PPSFWOO\AjaxActionsPriv,
    2122    PPSFWOO\Product,
    2223    PPSFWOO\PluginExtras,
     
    4445
    4546add_action('upgrader_process_complete', [PluginMain::class, 'upgrader_process_complete'], 10, 2);
     47
     48add_action('ppsfwoo_refresh_plans', [AjaxActionsPriv::class, 'refresh_plans']);
    4649
    4750add_action('plugins_loaded', function() {
  • subscriptions-for-woo/trunk/templates/table-plans.php

    r3251356 r3255406  
    1313    </tr>
    1414    <?php
    15     foreach ($plans as $plan_id => $plan)
    16     {
    17         $plan_active = "ACTIVE" === $plan->status;
     15    if(!isset($plans['000'])) {
    1816
    19         $paypal_action = $plan_active ? 'deactivate': 'activate';
     17        foreach ($plans as $plan_id => $plan)
     18        {
     19            $plan_active = "ACTIVE" === $plan->status;
    2020
    21         $status_indicator = $plan_active ? 'green': 'red';
     21            $paypal_action = $plan_active ? 'deactivate': 'activate';
    2222
    23         $formatter = new \NumberFormatter('en_US', \NumberFormatter::CURRENCY);
     23            $status_indicator = $plan_active ? 'green': 'red';
    2424
    25         ?>
    26         <tr class="plan-row">
    27             <td><a href='<?php echo esc_url($paypal_url); ?>/billing/plans/<?php echo esc_attr($plan_id); ?>' target='_blank'><?php echo esc_html($plan_id); ?></a></td>
    28             <td><?php echo esc_html($plan->name); ?></td>
    29             <td><?php echo esc_html($plan->product_name); ?></td>
    30             <td><?php echo esc_html($plan->frequency); ?></td>
    31             <td><?php echo esc_html($formatter->formatCurrency($plan->price, 'USD')); ?></td>
    32             <td>
    33                 <p class="copy-text"><?php echo esc_url($paypal_url); ?>/webapps/billing/plans/subscribe?plan_id=<?php echo esc_html($plan_id); ?></p>
    34                 <button class="copy-button">Copy to clipboard</button>
    35             </td>
    36             <td><span class='tooltip status <?php echo esc_attr($status_indicator); ?>'><span class='tooltip-text'><?php echo esc_html($plan->status); ?></span></span></td>
    37             <td><a href='#' class='<?php echo esc_attr($paypal_action); ?>' data-plan-id='<?php echo esc_attr($plan_id); ?>' data-nonce='<?php echo esc_attr(wp_create_nonce('modify_plan')); ?>'><?php echo esc_html(ucfirst($paypal_action)); ?></a></td>
    38         </tr>
    39     <?php
     25            $formatter = new \NumberFormatter('en_US', \NumberFormatter::CURRENCY);
     26
     27            ?>
     28            <tr class="plan-row">
     29                <td><a href='<?php echo esc_url($paypal_url); ?>/billing/plans/<?php echo esc_attr($plan_id); ?>' target='_blank'><?php echo esc_html($plan_id); ?></a></td>
     30                <td><?php echo esc_html($plan->name); ?></td>
     31                <td><?php echo esc_html($plan->product_name); ?></td>
     32                <td><?php echo esc_html($plan->frequency); ?></td>
     33                <td><?php echo esc_html($formatter->formatCurrency($plan->price, 'USD')); ?></td>
     34                <td>
     35                    <p class="copy-text"><?php echo esc_url($paypal_url); ?>/webapps/billing/plans/subscribe?plan_id=<?php echo esc_html($plan_id); ?></p>
     36                    <button class="copy-button">Copy to clipboard</button>
     37                </td>
     38                <td><span class='tooltip status <?php echo esc_attr($status_indicator); ?>'><span class='tooltip-text'><?php echo esc_html($plan->status); ?></span></span></td>
     39                <td><a href='#' class='<?php echo esc_attr($paypal_action); ?>' data-plan-id='<?php echo esc_attr($plan_id); ?>' data-nonce='<?php echo esc_attr(wp_create_nonce('modify_plan')); ?>'><?php echo esc_html(ucfirst($paypal_action)); ?></a></td>
     40            </tr>
     41        <?php
     42        }
     43       
    4044    }
    4145    ?>
Note: See TracChangeset for help on using the changeset viewer.