Skip to content

Commit

Permalink
move subscription to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
sapayth committed Feb 9, 2024
1 parent 998d046 commit d07eaa1
Show file tree
Hide file tree
Showing 13 changed files with 6,212 additions and 8,081 deletions.
2 changes: 1 addition & 1 deletion includes/Admin/Forms/Admin_Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace WeDevs\Wpuf\Admin\Forms;

use WeDevs\Wpuf\Subscription;
use WeDevs\Wpuf\Admin\Subscription;
use WeDevs\Wpuf\Traits\FieldableTrait;
use WeDevs\WpUtils\ContainerTrait;

Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/Forms/Field_Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace WeDevs\Wpuf\Admin\Forms;

use WeDevs\Wpuf\Admin\Subscription;
use WeDevs\Wpuf\Fields\Form_Field_Checkbox;
use WeDevs\Wpuf\Fields\Form_Field_Column;
use WeDevs\Wpuf\Fields\Form_Field_Dropdown;
Expand All @@ -21,7 +22,6 @@
use WeDevs\Wpuf\Fields\Form_Field_Text;
use WeDevs\Wpuf\Fields\Form_Field_Textarea;
use WeDevs\Wpuf\Fields\Form_Field_URL;
use WeDevs\Wpuf\Subscription;

/**
* Form field manager class
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace WeDevs\Wpuf;
namespace WeDevs\Wpuf\Admin;

use WeDevs\Wpuf\Admin\Forms\Form;
use WeDevs\Wpuf\Traits\TaxableTrait;
use WeDevs\Wpuf\User_Subscription;

/**
* WPUF subscription manager
Expand Down
2 changes: 1 addition & 1 deletion includes/Frontend/Frontend_Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace WeDevs\Wpuf\Frontend;

use WeDevs\Wpuf\Subscription;
use WeDevs\Wpuf\Admin\Subscription;
use WeDevs\Wpuf\User_Subscription;

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/Frontend/Frontend_Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace WeDevs\Wpuf\Frontend;

use WeDevs\Wpuf\Admin\Forms\Form;
use WeDevs\Wpuf\Admin\Subscription;
use WeDevs\Wpuf\Frontend_Render_Form;
use WeDevs\Wpuf\Subscription;
use WeDevs\Wpuf\Traits\FieldableTrait;

class Frontend_Form extends Frontend_Render_Form {
Expand Down
2 changes: 2 additions & 0 deletions includes/Frontend_Render_Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace WeDevs\Wpuf;

use WeDevs\Wpuf\Admin\Subscription;

class Frontend_Render_Form {
private static $_instance;

Expand Down
2 changes: 1 addition & 1 deletion includes/User_Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function pack_info( $form_id ) {
$billing_amount = ( intval( $pack->meta_value['billing_amount'] ) > 0 ) ? $details_meta['symbol'] . $pack->meta_value['billing_amount'] : __( 'Free', 'wp-user-frontend' );

if ( $pack->meta_value['recurring_pay'] == 'yes' ) {
$recurring_des = sprintf( 'For each %s %s', $pack->meta_value['billing_cycle_number'], \WeDevs\Wpuf\Subscription::get_cycle_label( $pack->meta_value['cycle_period'], $pack->meta_value['billing_cycle_number'] ), $pack->meta_value['trial_duration_type'] );
$recurring_des = sprintf( 'For each %s %s', $pack->meta_value['billing_cycle_number'], Admin\Subscription::get_cycle_label( $pack->meta_value['cycle_period'], $pack->meta_value['billing_cycle_number'] ), $pack->meta_value['trial_duration_type'] );
$recurring_des .= ! empty( $pack->meta_value['billing_limit'] ) ? sprintf( ', for %s installments', $pack->meta_value['billing_limit'] ) : '';
$recurring_des = $recurring_des;
} else {
Expand Down
2 changes: 1 addition & 1 deletion includes/upgrades/upgrade-2.1.9.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function wpuf_upgrade_2_1_9_subscription() {
return;
}

$post_type = (new \WeDevs\Wpuf\Subscription())->get_all_post_type();
$post_type = (new \WeDevs\Wpuf\Admin\Subscription())->get_all_post_type();

foreach ( $results as $key => $result ) {
$args = [
Expand Down
2 changes: 1 addition & 1 deletion includes/upgrades/upgrade-2.6.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function wpuf_upgrade_2_6_create_subscribers_table() {
*/
function wpuf_upgrade_2_6_insert_subscribers() {
global $wpdb;
$users = (new \WeDevs\Wpuf\Subscription())->subscription_pack_users();
$users = (new \WeDevs\Wpuf\Admin\Subscription())->subscription_pack_users();

foreach ( $users as $user ) {
$sub_data = get_user_meta( $user->data->ID, '_wpuf_subscription_pack', true );
Expand Down
Loading

0 comments on commit d07eaa1

Please sign in to comment.