Changeset 3415062
- Timestamp:
- 12/09/2025 08:29:31 AM (4 months ago)
- Location:
- subscription
- Files:
-
- 2 deleted
- 14 edited
- 1 copied
-
tags/1.8.10 (copied) (copied from subscription/trunk)
-
tags/1.8.10/changelog.txt (modified) (1 diff)
-
tags/1.8.10/composer.json (deleted)
-
tags/1.8.10/includes/Admin/Integrations.php (modified) (5 diffs)
-
tags/1.8.10/includes/Frontend/Checkout.php (modified) (2 diffs)
-
tags/1.8.10/includes/Illuminate/Helper.php (modified) (2 diffs)
-
tags/1.8.10/languages/wp_subscription.pot (modified) (2 diffs)
-
tags/1.8.10/subscription.php (modified) (2 diffs)
-
tags/1.8.10/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/composer.json (deleted)
-
trunk/includes/Admin/Integrations.php (modified) (5 diffs)
-
trunk/includes/Frontend/Checkout.php (modified) (2 diffs)
-
trunk/includes/Illuminate/Helper.php (modified) (2 diffs)
-
trunk/languages/wp_subscription.pot (modified) (2 diffs)
-
trunk/subscription.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
subscription/tags/1.8.10/changelog.txt
r3413403 r3415062 1 1 *** WPSubscription Changelog *** 2 3 2025-12-09 - version 1.8.10 4 * new: Added beta badge in the integrations list. 5 * fix: Subscription switch action. 6 * fix: Core helper methods. 2 7 3 8 2025-12-07 - version 1.8.9 -
subscription/tags/1.8.10/includes/Admin/Integrations.php
r3413403 r3415062 114 114 * 115 115 * @param string $gateway_id Gateway ID. 116 * @param bool $partial_match Whether to allow partial match of gateway ID. 116 117 * @return bool 117 118 */ 118 p rotected function is_gateway_installed( $gateway_id) {119 public static function is_gateway_installed( $gateway_id, $partial_match = false ) { 119 120 $installed_gateways = WC()->payment_gateways()->payment_gateways(); 121 122 // Partial match check. For gateways with dynamic IDs. 123 if ( $partial_match ) { 124 foreach ( $installed_gateways as $key => $gateway ) { 125 if ( strpos( $key, $gateway_id ) !== false ) { 126 return true; 127 } 128 } 129 return false; 130 } 131 120 132 return isset( $installed_gateways[ $gateway_id ] ); 121 133 } … … 125 137 * 126 138 * @param string $gateway_id Gateway ID. 139 * @param bool $partial_match Whether to allow partial match of gateway ID. 127 140 * @return bool 128 141 */ 129 p rotected function is_gateway_enabled( $gateway_id) {142 public static function is_gateway_enabled( $gateway_id, $partial_match = false ) { 130 143 $installed_gateways = WC()->payment_gateways()->payment_gateways(); 144 145 // Partial match check. For gateways with dynamic IDs. 146 if ( $partial_match ) { 147 foreach ( $installed_gateways as $key => $gateway ) { 148 if ( strpos( $key, $gateway_id ) !== false ) { 149 return $gateway->is_available(); 150 } 151 } 152 return false; 153 } 154 131 155 if ( ! isset( $installed_gateways[ $gateway_id ] ) ) { 132 156 return false; … … 183 207 'icon_url' => WP_SUBSCRIPTION_ASSETS . '/images/paypal.svg', 184 208 'is_installed' => 'on' === get_option( 'wp_subs_paypal_integration_enabled', 'off' ), 185 'is_active' => $this->is_gateway_enabled( 'wp_subscription_paypal' ),209 'is_active' => self::is_gateway_enabled( 'wp_subscription_paypal' ), 186 210 'supports_recurring' => true, 187 211 'actions' => [ … … 212 236 'icon_url' => 'https://ps.w.org/woocommerce-gateway-stripe/assets/icon-256x256.png', 213 237 'is_installed' => class_exists( 'WC_Stripe' ), 214 'is_active' => $this->is_gateway_enabled( 'stripe' ),238 'is_active' => self::is_gateway_enabled( 'stripe' ), 215 239 'supports_recurring' => true, 216 240 'actions' => [ … … 234 258 'icon_url' => WP_SUBSCRIPTION_ASSETS . '/images/paddle.svg', 235 259 'is_installed' => class_exists( 'SmartPayWoo\Gateways\Paddle\SmartPay_Paddle' ), 236 'is_active' => $this->is_gateway_enabled( 'smartpay_paddle' ),260 'is_active' => self::is_gateway_enabled( 'smartpay_paddle' ), 237 261 'supports_recurring' => true, 238 262 'actions' => [ -
subscription/tags/1.8.10/includes/Frontend/Checkout.php
r3399395 r3415062 19 19 */ 20 20 public function __construct() { 21 // Subscription upgrade/downgrade order created hook. 22 add_action( 'woocommerce_checkout_order_processed', [ $this, 'trigger_subscription_switch_order_created' ] ); 23 add_action( 'woocommerce_store_api_checkout_order_processed', [ $this, 'trigger_subscription_switch_order_created_storeapi' ] ); 24 21 25 add_action( 'woocommerce_checkout_order_processed', [ $this, 'create_subscription_after_checkout' ] ); 22 26 add_action( 'woocommerce_store_api_checkout_order_processed', [ $this, 'create_subscription_after_checkout_storeapi' ] ); … … 317 321 } 318 322 } 323 324 /** 325 * Trigger subscription switch order created store API. 326 * 327 * @param \WC_Order $order Order. 328 */ 329 public function trigger_subscription_switch_order_created_storeapi( $order ) { 330 $this->trigger_subscription_switch_order_created( $order->get_id() ?? 0 ); 331 } 332 333 /** 334 * Trigger subscription switch order created. 335 * 336 * @param int $order_id Order ID. 337 */ 338 public function trigger_subscription_switch_order_created( $order_id ) { 339 if ( ! $order_id || ! subscrpt_pro_activated() ) { 340 return; 341 } 342 343 $order = wc_get_order( $order_id ); 344 $order_items = $order->get_items(); 345 346 foreach ( $order_items as $order_item ) { 347 $is_switch = in_array( $order_item->get_meta( '_wp_subs_switch' ), [ true, 1, '1' ], true ); 348 $switch_context = $order_item->get_meta( '_wp_subs_switch_context' ); 349 350 if ( $is_switch ) { 351 $switch_type = $switch_context['switch_type'] ?? 'upgrade'; 352 353 unset( $switch_context['nonce'] ); 354 unset( $switch_context['redirect_back_url'] ); 355 356 /** 357 * Action fired when subscription switch order is created. 358 * 359 * @param string $switch_type Switch type (upgrade/downgrade). 360 * @param \WC_Order $order Order object. 361 * @param \WC_Order_Item_Product $order_item Order Item object. 362 * @param array $switch_context Switch context data. [ 'switch_type', 'subscription_id', 'order_id', 'product_id', 'old_variation_id', 'new_variation_id' ] 363 */ 364 do_action( 'subscrpt_switch_order_created', $switch_type, $order, $order_item, $switch_context ); 365 } 366 } 367 } 319 368 } -
subscription/tags/1.8.10/includes/Illuminate/Helper.php
r3413403 r3415062 564 564 if ( subscrpt_is_max_payments_reached( $subscription_id ) ) { 565 565 // Mark subscription as expired due to limit reached 566 wp_update_post( 567 array( 568 'ID' => $subscription_id, 569 'post_status' => 'expired', 570 ) 571 ); 566 Action::status( 'expired', $subscription_id ); 572 567 573 568 error_log( "WPS: Maximum payment limit reached for subscription #{$subscription_id}. No renewal order created." ); … … 634 629 635 630 do_action( 'subscrpt_after_create_renew_order', $new_order, $old_order, $subscription_id, false ); 631 632 return $new_order; 633 } 634 635 /** 636 * Get subscription total price. 637 * 638 * @param int $subscription_id Subscription ID. 639 * @return float 640 */ 641 public static function get_subscription_total( $subscription_id ) { 642 return (float) get_post_meta( $subscription_id, '_subscrpt_price', true ); 643 } 644 645 /** 646 * Get subscription status. 647 * 648 * @param int $subscription_id Subscription ID. 649 * @return string 650 */ 651 public static function get_subscription_status( $subscription_id ) { 652 return get_post_status( $subscription_id ); 653 } 654 655 /** 656 * Check if subscription has status. 657 * 658 * @param int $subscription_id Subscription ID. 659 * @param string $status Status to check. 660 * @return bool 661 */ 662 public static function subscription_has_status( $subscription_id, $status ) { 663 return self::get_subscription_status( $subscription_id ) === $status; 664 } 665 666 /** 667 * Check if subscription needs payment. 668 * 669 * @param int $subscription_id Subscription ID. 670 * @return bool 671 */ 672 public static function subscription_needs_payment( $subscription_id ) { 673 return true; // Always true for now 674 } 675 676 /** 677 * Get product period (timing option). 678 * 679 * @param int $product_id Product ID. 680 * @return string 681 */ 682 public static function get_product_period( $product_id ) { 683 $product = wc_get_product( $product_id ); 684 return $product ? $product->get_meta( '_subscrpt_timing_option' ) : ''; 685 } 686 687 /** 688 * Get product interval (timing per). 689 * 690 * @param int $product_id Product ID. 691 * @return int 692 */ 693 public static function get_product_interval( $product_id ) { 694 $product = wc_get_product( $product_id ); 695 return $product ? (int) $product->get_meta( '_subscrpt_timing_per' ) : 1; 696 } 697 698 /** 699 * Get product length (max payments). 700 * 701 * @param int $product_id Product ID. 702 * @return int 703 */ 704 public static function get_product_length( $product_id ) { 705 $product = wc_get_product( $product_id ); 706 return $product ? (int) $product->get_meta( '_subscrpt_max_no_payment' ) : 0; 707 } 708 709 /** 710 * Get product trial length. 711 * 712 * @param int $product_id Product ID. 713 * @return int 714 */ 715 public static function get_product_trial_length( $product_id ) { 716 $product = wc_get_product( $product_id ); 717 return $product ? (int) $product->get_meta( '_subscrpt_trial_timing_per' ) : 0; 718 } 719 720 /** 721 * Get product signup fee. 722 * 723 * @param int $product_id Product ID. 724 * @return float 725 */ 726 public static function get_product_signup_fee( $product_id ) { 727 $product = wc_get_product( $product_id ); 728 return $product ? (float) $product->get_meta( '_subscrpt_signup_fee' ) : 0.0; 729 } 730 731 /** 732 * Get first renewal payment time. 733 * 734 * @param int $product_id Product ID. 735 * @return int Timestamp 736 */ 737 public static function get_first_renewal_payment_time( $product_id ) { 738 $product = wc_get_product( $product_id ); 739 if ( ! $product ) { 740 return 0; 741 } 742 743 $trial_period = $product->get_meta( '_subscrpt_trial_timing_per' ); 744 $trial_option = $product->get_meta( '_subscrpt_trial_timing_option' ); 745 746 if ( ! empty( $trial_period ) && ! empty( $trial_option ) ) { 747 return strtotime( "+{$trial_period} {$trial_option}" ); 748 } 749 750 return 0; 751 } 752 753 /** 754 * Update subscription next payment date. 755 * 756 * @param int $subscription_id Subscription ID. 757 * @param string $new_date New Date string. 758 * @return void 759 */ 760 public static function update_subscription_next_payment_date( $subscription_id, $new_date ) { 761 update_post_meta( $subscription_id, '_subscrpt_next_date', strtotime( $new_date ) ); 762 } 763 764 /** 765 * Cancel subscription. 766 * 767 * @param int $subscription_id Subscription ID. 768 * @return void 769 */ 770 public static function cancel_subscription( $subscription_id ) { 771 Action::status( 'cancelled', $subscription_id ); 772 } 773 774 /** 775 * Pause subscription. 776 * 777 * @param int $subscription_id Subscription ID. 778 * @return void 779 */ 780 public static function pause_subscription( $subscription_id ) { 781 Action::status( 'on-hold', $subscription_id ); 782 } 783 784 /** 785 * Resume subscription. 786 * 787 * @param int $subscription_id Subscription ID. 788 * @return void 789 */ 790 public static function resume_subscription( $subscription_id ) { 791 Action::status( 'active', $subscription_id ); 792 } 793 794 /** 795 * Mark subscription payment as complete. 796 * 797 * @param int $subscription_id Subscription ID. 798 * @param string $payment_id Payment/Transaction ID. 799 * @return void 800 */ 801 public static function subscription_payment_complete( $subscription_id, $payment_id ) { 802 if ( 'active' !== get_post_status( $subscription_id ) ) { 803 Action::status( 'active', $subscription_id ); 804 } 805 806 // Allow payment gateways to add their own comments/notes 807 do_action( 'subscrpt_subscription_payment_completed', $subscription_id, $payment_id ); 636 808 } 637 809 -
subscription/tags/1.8.10/languages/wp_subscription.pot
r3413403 r3415062 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-12-0 7T08:44:18+00:00\n"12 "POT-Creation-Date: 2025-12-09T08:24:31+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 1488 1488 msgstr "" 1489 1489 1490 #: includes/Illuminate/Helper.php: 9241490 #: includes/Illuminate/Helper.php:1096 1491 1491 msgid "Subscription renewal isn't possible due to previous order not completed or deletion." 1492 1492 msgstr "" -
subscription/tags/1.8.10/subscription.php
r3413403 r3415062 7 7 * Description: WPSubscription allow WooCommerce to enables recurring payments, subscriptions, and auto-renewals for digital and physical products. Supports Stripe, PayPal, Paddle, and more. 8 8 * 9 * Version: 1.8. 99 * Version: 1.8.10 10 10 * 11 11 * Author: ConversWP … … 51 51 * @var string 52 52 */ 53 const version = '1.8. 9';53 const version = '1.8.10'; 54 54 55 55 /** -
subscription/tags/1.8.10/vendor/composer/installed.php
r3413403 r3415062 2 2 'root' => array( 3 3 'name' => 'converswp/subscription', 4 'pretty_version' => '1.8. 9',5 'version' => '1.8. 9.0',6 'reference' => ' 6ef770f3fb9e19d8f07a1853a1c2b571093a3dc8',4 'pretty_version' => '1.8.10', 5 'version' => '1.8.10.0', 6 'reference' => '4fe49d4b2b7f0c2436a0e6fff49949240485f685', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'converswp/subscription' => array( 14 'pretty_version' => '1.8. 9',15 'version' => '1.8. 9.0',16 'reference' => ' 6ef770f3fb9e19d8f07a1853a1c2b571093a3dc8',14 'pretty_version' => '1.8.10', 15 'version' => '1.8.10.0', 16 'reference' => '4fe49d4b2b7f0c2436a0e6fff49949240485f685', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
subscription/trunk/changelog.txt
r3413403 r3415062 1 1 *** WPSubscription Changelog *** 2 3 2025-12-09 - version 1.8.10 4 * new: Added beta badge in the integrations list. 5 * fix: Subscription switch action. 6 * fix: Core helper methods. 2 7 3 8 2025-12-07 - version 1.8.9 -
subscription/trunk/includes/Admin/Integrations.php
r3413403 r3415062 114 114 * 115 115 * @param string $gateway_id Gateway ID. 116 * @param bool $partial_match Whether to allow partial match of gateway ID. 116 117 * @return bool 117 118 */ 118 p rotected function is_gateway_installed( $gateway_id) {119 public static function is_gateway_installed( $gateway_id, $partial_match = false ) { 119 120 $installed_gateways = WC()->payment_gateways()->payment_gateways(); 121 122 // Partial match check. For gateways with dynamic IDs. 123 if ( $partial_match ) { 124 foreach ( $installed_gateways as $key => $gateway ) { 125 if ( strpos( $key, $gateway_id ) !== false ) { 126 return true; 127 } 128 } 129 return false; 130 } 131 120 132 return isset( $installed_gateways[ $gateway_id ] ); 121 133 } … … 125 137 * 126 138 * @param string $gateway_id Gateway ID. 139 * @param bool $partial_match Whether to allow partial match of gateway ID. 127 140 * @return bool 128 141 */ 129 p rotected function is_gateway_enabled( $gateway_id) {142 public static function is_gateway_enabled( $gateway_id, $partial_match = false ) { 130 143 $installed_gateways = WC()->payment_gateways()->payment_gateways(); 144 145 // Partial match check. For gateways with dynamic IDs. 146 if ( $partial_match ) { 147 foreach ( $installed_gateways as $key => $gateway ) { 148 if ( strpos( $key, $gateway_id ) !== false ) { 149 return $gateway->is_available(); 150 } 151 } 152 return false; 153 } 154 131 155 if ( ! isset( $installed_gateways[ $gateway_id ] ) ) { 132 156 return false; … … 183 207 'icon_url' => WP_SUBSCRIPTION_ASSETS . '/images/paypal.svg', 184 208 'is_installed' => 'on' === get_option( 'wp_subs_paypal_integration_enabled', 'off' ), 185 'is_active' => $this->is_gateway_enabled( 'wp_subscription_paypal' ),209 'is_active' => self::is_gateway_enabled( 'wp_subscription_paypal' ), 186 210 'supports_recurring' => true, 187 211 'actions' => [ … … 212 236 'icon_url' => 'https://ps.w.org/woocommerce-gateway-stripe/assets/icon-256x256.png', 213 237 'is_installed' => class_exists( 'WC_Stripe' ), 214 'is_active' => $this->is_gateway_enabled( 'stripe' ),238 'is_active' => self::is_gateway_enabled( 'stripe' ), 215 239 'supports_recurring' => true, 216 240 'actions' => [ … … 234 258 'icon_url' => WP_SUBSCRIPTION_ASSETS . '/images/paddle.svg', 235 259 'is_installed' => class_exists( 'SmartPayWoo\Gateways\Paddle\SmartPay_Paddle' ), 236 'is_active' => $this->is_gateway_enabled( 'smartpay_paddle' ),260 'is_active' => self::is_gateway_enabled( 'smartpay_paddle' ), 237 261 'supports_recurring' => true, 238 262 'actions' => [ -
subscription/trunk/includes/Frontend/Checkout.php
r3399395 r3415062 19 19 */ 20 20 public function __construct() { 21 // Subscription upgrade/downgrade order created hook. 22 add_action( 'woocommerce_checkout_order_processed', [ $this, 'trigger_subscription_switch_order_created' ] ); 23 add_action( 'woocommerce_store_api_checkout_order_processed', [ $this, 'trigger_subscription_switch_order_created_storeapi' ] ); 24 21 25 add_action( 'woocommerce_checkout_order_processed', [ $this, 'create_subscription_after_checkout' ] ); 22 26 add_action( 'woocommerce_store_api_checkout_order_processed', [ $this, 'create_subscription_after_checkout_storeapi' ] ); … … 317 321 } 318 322 } 323 324 /** 325 * Trigger subscription switch order created store API. 326 * 327 * @param \WC_Order $order Order. 328 */ 329 public function trigger_subscription_switch_order_created_storeapi( $order ) { 330 $this->trigger_subscription_switch_order_created( $order->get_id() ?? 0 ); 331 } 332 333 /** 334 * Trigger subscription switch order created. 335 * 336 * @param int $order_id Order ID. 337 */ 338 public function trigger_subscription_switch_order_created( $order_id ) { 339 if ( ! $order_id || ! subscrpt_pro_activated() ) { 340 return; 341 } 342 343 $order = wc_get_order( $order_id ); 344 $order_items = $order->get_items(); 345 346 foreach ( $order_items as $order_item ) { 347 $is_switch = in_array( $order_item->get_meta( '_wp_subs_switch' ), [ true, 1, '1' ], true ); 348 $switch_context = $order_item->get_meta( '_wp_subs_switch_context' ); 349 350 if ( $is_switch ) { 351 $switch_type = $switch_context['switch_type'] ?? 'upgrade'; 352 353 unset( $switch_context['nonce'] ); 354 unset( $switch_context['redirect_back_url'] ); 355 356 /** 357 * Action fired when subscription switch order is created. 358 * 359 * @param string $switch_type Switch type (upgrade/downgrade). 360 * @param \WC_Order $order Order object. 361 * @param \WC_Order_Item_Product $order_item Order Item object. 362 * @param array $switch_context Switch context data. [ 'switch_type', 'subscription_id', 'order_id', 'product_id', 'old_variation_id', 'new_variation_id' ] 363 */ 364 do_action( 'subscrpt_switch_order_created', $switch_type, $order, $order_item, $switch_context ); 365 } 366 } 367 } 319 368 } -
subscription/trunk/includes/Illuminate/Helper.php
r3413403 r3415062 564 564 if ( subscrpt_is_max_payments_reached( $subscription_id ) ) { 565 565 // Mark subscription as expired due to limit reached 566 wp_update_post( 567 array( 568 'ID' => $subscription_id, 569 'post_status' => 'expired', 570 ) 571 ); 566 Action::status( 'expired', $subscription_id ); 572 567 573 568 error_log( "WPS: Maximum payment limit reached for subscription #{$subscription_id}. No renewal order created." ); … … 634 629 635 630 do_action( 'subscrpt_after_create_renew_order', $new_order, $old_order, $subscription_id, false ); 631 632 return $new_order; 633 } 634 635 /** 636 * Get subscription total price. 637 * 638 * @param int $subscription_id Subscription ID. 639 * @return float 640 */ 641 public static function get_subscription_total( $subscription_id ) { 642 return (float) get_post_meta( $subscription_id, '_subscrpt_price', true ); 643 } 644 645 /** 646 * Get subscription status. 647 * 648 * @param int $subscription_id Subscription ID. 649 * @return string 650 */ 651 public static function get_subscription_status( $subscription_id ) { 652 return get_post_status( $subscription_id ); 653 } 654 655 /** 656 * Check if subscription has status. 657 * 658 * @param int $subscription_id Subscription ID. 659 * @param string $status Status to check. 660 * @return bool 661 */ 662 public static function subscription_has_status( $subscription_id, $status ) { 663 return self::get_subscription_status( $subscription_id ) === $status; 664 } 665 666 /** 667 * Check if subscription needs payment. 668 * 669 * @param int $subscription_id Subscription ID. 670 * @return bool 671 */ 672 public static function subscription_needs_payment( $subscription_id ) { 673 return true; // Always true for now 674 } 675 676 /** 677 * Get product period (timing option). 678 * 679 * @param int $product_id Product ID. 680 * @return string 681 */ 682 public static function get_product_period( $product_id ) { 683 $product = wc_get_product( $product_id ); 684 return $product ? $product->get_meta( '_subscrpt_timing_option' ) : ''; 685 } 686 687 /** 688 * Get product interval (timing per). 689 * 690 * @param int $product_id Product ID. 691 * @return int 692 */ 693 public static function get_product_interval( $product_id ) { 694 $product = wc_get_product( $product_id ); 695 return $product ? (int) $product->get_meta( '_subscrpt_timing_per' ) : 1; 696 } 697 698 /** 699 * Get product length (max payments). 700 * 701 * @param int $product_id Product ID. 702 * @return int 703 */ 704 public static function get_product_length( $product_id ) { 705 $product = wc_get_product( $product_id ); 706 return $product ? (int) $product->get_meta( '_subscrpt_max_no_payment' ) : 0; 707 } 708 709 /** 710 * Get product trial length. 711 * 712 * @param int $product_id Product ID. 713 * @return int 714 */ 715 public static function get_product_trial_length( $product_id ) { 716 $product = wc_get_product( $product_id ); 717 return $product ? (int) $product->get_meta( '_subscrpt_trial_timing_per' ) : 0; 718 } 719 720 /** 721 * Get product signup fee. 722 * 723 * @param int $product_id Product ID. 724 * @return float 725 */ 726 public static function get_product_signup_fee( $product_id ) { 727 $product = wc_get_product( $product_id ); 728 return $product ? (float) $product->get_meta( '_subscrpt_signup_fee' ) : 0.0; 729 } 730 731 /** 732 * Get first renewal payment time. 733 * 734 * @param int $product_id Product ID. 735 * @return int Timestamp 736 */ 737 public static function get_first_renewal_payment_time( $product_id ) { 738 $product = wc_get_product( $product_id ); 739 if ( ! $product ) { 740 return 0; 741 } 742 743 $trial_period = $product->get_meta( '_subscrpt_trial_timing_per' ); 744 $trial_option = $product->get_meta( '_subscrpt_trial_timing_option' ); 745 746 if ( ! empty( $trial_period ) && ! empty( $trial_option ) ) { 747 return strtotime( "+{$trial_period} {$trial_option}" ); 748 } 749 750 return 0; 751 } 752 753 /** 754 * Update subscription next payment date. 755 * 756 * @param int $subscription_id Subscription ID. 757 * @param string $new_date New Date string. 758 * @return void 759 */ 760 public static function update_subscription_next_payment_date( $subscription_id, $new_date ) { 761 update_post_meta( $subscription_id, '_subscrpt_next_date', strtotime( $new_date ) ); 762 } 763 764 /** 765 * Cancel subscription. 766 * 767 * @param int $subscription_id Subscription ID. 768 * @return void 769 */ 770 public static function cancel_subscription( $subscription_id ) { 771 Action::status( 'cancelled', $subscription_id ); 772 } 773 774 /** 775 * Pause subscription. 776 * 777 * @param int $subscription_id Subscription ID. 778 * @return void 779 */ 780 public static function pause_subscription( $subscription_id ) { 781 Action::status( 'on-hold', $subscription_id ); 782 } 783 784 /** 785 * Resume subscription. 786 * 787 * @param int $subscription_id Subscription ID. 788 * @return void 789 */ 790 public static function resume_subscription( $subscription_id ) { 791 Action::status( 'active', $subscription_id ); 792 } 793 794 /** 795 * Mark subscription payment as complete. 796 * 797 * @param int $subscription_id Subscription ID. 798 * @param string $payment_id Payment/Transaction ID. 799 * @return void 800 */ 801 public static function subscription_payment_complete( $subscription_id, $payment_id ) { 802 if ( 'active' !== get_post_status( $subscription_id ) ) { 803 Action::status( 'active', $subscription_id ); 804 } 805 806 // Allow payment gateways to add their own comments/notes 807 do_action( 'subscrpt_subscription_payment_completed', $subscription_id, $payment_id ); 636 808 } 637 809 -
subscription/trunk/languages/wp_subscription.pot
r3413403 r3415062 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-12-0 7T08:44:18+00:00\n"12 "POT-Creation-Date: 2025-12-09T08:24:31+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 1488 1488 msgstr "" 1489 1489 1490 #: includes/Illuminate/Helper.php: 9241490 #: includes/Illuminate/Helper.php:1096 1491 1491 msgid "Subscription renewal isn't possible due to previous order not completed or deletion." 1492 1492 msgstr "" -
subscription/trunk/subscription.php
r3413403 r3415062 7 7 * Description: WPSubscription allow WooCommerce to enables recurring payments, subscriptions, and auto-renewals for digital and physical products. Supports Stripe, PayPal, Paddle, and more. 8 8 * 9 * Version: 1.8. 99 * Version: 1.8.10 10 10 * 11 11 * Author: ConversWP … … 51 51 * @var string 52 52 */ 53 const version = '1.8. 9';53 const version = '1.8.10'; 54 54 55 55 /** -
subscription/trunk/vendor/composer/installed.php
r3413403 r3415062 2 2 'root' => array( 3 3 'name' => 'converswp/subscription', 4 'pretty_version' => '1.8. 9',5 'version' => '1.8. 9.0',6 'reference' => ' 6ef770f3fb9e19d8f07a1853a1c2b571093a3dc8',4 'pretty_version' => '1.8.10', 5 'version' => '1.8.10.0', 6 'reference' => '4fe49d4b2b7f0c2436a0e6fff49949240485f685', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'converswp/subscription' => array( 14 'pretty_version' => '1.8. 9',15 'version' => '1.8. 9.0',16 'reference' => ' 6ef770f3fb9e19d8f07a1853a1c2b571093a3dc8',14 'pretty_version' => '1.8.10', 15 'version' => '1.8.10.0', 16 'reference' => '4fe49d4b2b7f0c2436a0e6fff49949240485f685', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.