Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: restructure plugin codes #1379

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
3478dcc
publish branch
sapayth May 18, 2023
b32452f
refactor files for post forms
sapayth May 22, 2023
5a6a7a2
load post form page and templates
sapayth May 24, 2023
9286428
post form assets restructure
sapayth May 24, 2023
c221024
Merge remote-tracking branch 'upstream/develop' into enhance/restruct…
sapayth May 24, 2023
d425e31
registration form page
sapayth May 24, 2023
1a0040b
modules page
sapayth May 26, 2023
16726a7
Merge remote-tracking branch 'upstream/develop' into enhance/restruct…
sapayth May 26, 2023
7675f92
subscriptions menu
sapayth May 26, 2023
0cdf628
subscriptions and transactions page
sapayth May 30, 2023
a6c0bb2
highlight parent menu and submenu
sapayth May 30, 2023
6927791
tools, settings menu and settings sections
sapayth May 30, 2023
82525e0
premium, help page
sapayth May 30, 2023
2ddc4f8
move and rename files
sapayth May 31, 2023
2bc6c84
fix all menu items, setup wizard
sapayth Jun 1, 2023
3d0c6cf
frontend post form
sapayth Jun 5, 2023
b488ba9
Frontend form submission AJAX, file upload AJAX
sapayth Jun 6, 2023
cd5f76a
Admin_Form_Builder_Ajax moved to AJAX class
sapayth Jun 6, 2023
e3c6e08
whats new page AJAX
sapayth Jun 6, 2023
21f9926
separate whats-new notice styling
sapayth Jun 6, 2023
118fa87
organize `wpuf_ajax_tag_search`
sapayth Jun 6, 2023
af35026
admin `Promotion` AJAX handled
sapayth Jun 6, 2023
c672361
ACF compatibility AJAX
sapayth Jun 7, 2023
3208678
login widget AJAX operations
sapayth Jun 7, 2023
c89e94b
form builder AJAX operations, register widgets
sapayth Jun 7, 2023
bcc94a4
admin subscription AJAX
sapayth Jun 7, 2023
bb0522d
address_ajax_action added
sapayth Jun 7, 2023
d000482
frontend account account_update_profile AJAX
sapayth Jun 7, 2023
2afda84
admin tools import_forms AJAX
sapayth Jun 7, 2023
33aa2f7
child category, address, billing address AJAX
sapayth Jun 7, 2023
9349827
cleanup ajax.php
sapayth Jun 7, 2023
08aba24
update namespace
sapayth Jun 7, 2023
55f3412
refactor namespace
sapayth Jun 7, 2023
2dffe4c
shortcode `wpuf_dashboard` restructure
sapayth Jun 7, 2023
1b41649
`wpuf-registration` shortcode restructure
sapayth Jun 7, 2023
ee39eff
wpuf_form, wpuf_form shortcode
sapayth Jun 7, 2023
cb37bb6
`wpuf_editprofile` shortcode
sapayth Jun 8, 2023
ae2e9c3
`wpuf-login` shortcode
sapayth Jun 8, 2023
aac1225
`wpuf-meta` shortcode
sapayth Jun 8, 2023
f83a8ff
sub_info, sub_pack, account shortcode
sapayth Jun 8, 2023
5955e86
code cleanup
sapayth Jun 8, 2023
b7944cc
code cleanup
sapayth Jun 12, 2023
816eded
update hook names
sapayth Jun 15, 2023
65141e3
post and reg form templates
sapayth Jun 19, 2023
5631711
weDevs settings api fixes
sapayth Jul 4, 2023
7fb6aef
customizer option
sapayth Jul 4, 2023
5e9dbe7
ajax refactor
sapayth Jul 11, 2023
466b151
update wpuf coupon ajax action name
sapayth Jul 12, 2023
ddac5d5
wpuf_payment refactor
sapayth Jul 13, 2023
0ce2f5e
unmerge develop to resolve conflict
sapayth Jul 31, 2023
38059fa
merge #1367
sapayth Jul 31, 2023
2af8bc2
merge 1366
sapayth Jul 31, 2023
3046536
merge 1363
sapayth Jul 31, 2023
6b7b3a3
multiple tasks. see description for commit details
sapayth Aug 1, 2023
0d85679
refactor ajax actions
sapayth Aug 1, 2023
22bec8d
implement wp-utils
sapayth Aug 3, 2023
55a7710
multiple tasks. description in commit details
sapayth Aug 8, 2023
b8cdc80
multiple changes. details in description
sapayth Aug 10, 2023
7499f67
merge with develop
sapayth Aug 11, 2023
0bdc485
code cleanup, merge with develop
sapayth Aug 17, 2023
9d77fac
add wpuf_pro version checking
sapayth Aug 21, 2023
095d489
frontend posting error fix
sapayth Aug 30, 2023
e738220
Merge remote-tracking branch 'upstream/develop' into enhance/restruct…
sapayth Aug 31, 2023
8638cf1
Merge remote-tracking branch 'upstream/develop' into enhance/restruct…
sapayth Sep 4, 2023
ceae97f
qa findings
sapayth Sep 4, 2023
cd156d3
asset name updated for minified files
sapayth Sep 14, 2023
4fe19ea
Merge remote-tracking branch 'upstream/develop' into enhance/restruct…
sapayth Sep 18, 2023
9688707
remove duplicate ajax
sapayth Sep 18, 2023
4db3830
fix: frontend post form submission
sapayth Oct 3, 2023
27ae062
enqueue subscriptions page scripts
sapayth Oct 3, 2023
19b9cd9
fix: recheck password field
sapayth Oct 4, 2023
4ad840d
fix: wp_error class dependancy
sapayth Oct 4, 2023
ad3e9b3
code cleanup and get_field_seperator
sapayth Oct 4, 2023
fe8ac04
location updated for Emogrifier.php
sapayth Oct 4, 2023
48ece39
remove warning alert for classic editor
sapayth Nov 13, 2023
46776b4
WPUF_Subscription and WPUF_Form uses refactored
sapayth Nov 14, 2023
0e78951
wooCommerce downloadable product
sapayth Nov 15, 2023
9b767da
fix: WPUF button on post
sapayth Nov 21, 2023
5cb7065
show wpuf pro whats new button
sapayth Dec 11, 2023
77e9b55
fix: paypal payment
sapayth Dec 12, 2023
e4cf6eb
fix: adding recaptcha library
sapayth Dec 12, 2023
d6757c1
fix: applying coupon for bank payment
sapayth Dec 12, 2023
871ddf4
fix: form preview not working
sapayth Dec 13, 2023
62ccfc9
fix: fatal error when editing featured post #1315
sapayth Dec 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = function(grunt) {
files: {
'<%= dirs.css %>/wpuf-form-builder.css': ['admin/form-builder/assets/less/form-builder.less'],
'<%= dirs.css %>/admin.css': ['<%= dirs.less %>/admin.less'],
'<%= dirs.css %>/admin/whats-new.css': ['<%= dirs.less %>/whats-new.less'],
'<%= dirs.css %>/registration-forms.css': ['<%= dirs.less %>/registration-forms.less']
}
}
Expand Down Expand Up @@ -138,7 +139,6 @@ module.exports = function(grunt) {
'!**/readme.md',
'!**/docs.md',
'!**/*~',
'!vendor/**',
'!**/log.txt',
'!**/package-lock.json',
'!**/appsero.json',
Expand Down
39 changes: 6 additions & 33 deletions lib/gateway/bank.php → Lib/Gateway/Bank.php
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
<?php

namespace WeDevs\Wpuf\Lib\Gateway;

use WeDevs\Wpuf\Pro\Coupons;

/**
* WP User Frotnend Bank gateway
*
* @since 2.1.4
*/
class WPUF_Gateway_Bank {
class Bank {
public function __construct() {
add_action( 'wpuf_gateway_bank', [$this, 'prepare_to_send'] );
add_action( 'wpuf_options_payment', [$this, 'payment_options'] );
add_action( 'wpuf_gateway_bank_order_submit', [$this, 'order_notify_admin'] );
add_action( 'wpuf_gateway_bank_order_complete', [$this, 'order_notify_user'], 10, 2 );
}

/**
* Adds paypal specific options to the admin panel
*
* @param type $options
*
* @return string
*/
public function payment_options( $options ) {
$pages = wpuf_get_pages();

$options[] = [
'name' => 'gate_instruct_bank',
'label' => __( 'Bank Instruction', 'wp-user-frontend' ),
'type' => 'wysiwyg',
'default' => 'Make your payment directly into our bank account.',
];

$options[] = [
'name' => 'bank_success',
'label' => __( 'Bank Payment Success Page', 'wp-user-frontend' ),
'desc' => __( 'After payment users will be redirected here', 'wp-user-frontend' ),
'type' => 'select',
'options' => $pages,
];

return $options;
}

/**
* Prepare the payment form and send to paypal
*
Expand All @@ -58,7 +33,7 @@ public function prepare_to_send( $data ) {
$data['price'] = isset( $data['price'] ) ? empty( $data['price'] ) ? 0 : $data['price'] : 0;

if ( isset( $_POST['coupon_id'] ) && !empty( $_POST['coupon_id'] ) ) {
$data['price'] = WPUF_Coupons::init()->discount( $data['price'], $_POST['coupon_id'], $data['item_number'] );
$data['price'] = (new Coupons())->discount( $data['price'], $_POST['coupon_id'], $data['item_number'] );
}

$data['cost'] = apply_filters( 'wpuf_payment_amount', $data['price'] ); //price with tax from pro
Expand Down Expand Up @@ -118,5 +93,3 @@ public function order_notify_user( $transaction, $order_id ) {
wp_delete_post( $order_id, true );
}
}

$wpuf_gateway_bank = new WPUF_Gateway_Bank();
53 changes: 6 additions & 47 deletions lib/gateway/paypal.php → Lib/Gateway/Paypal.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

namespace WeDevs\Wpuf\Lib\Gateway;

/**
* WP User Frotnend Paypal gateway
* WP User Frontend PayPal gateway
*
* @since 0.8
*/
class WPUF_Paypal {
class Paypal {
private $gateway_url;

private $gateway_cancel_url;
Expand All @@ -18,7 +20,6 @@ public function __construct() {
$this->test_mode = false;

add_action( 'wpuf_gateway_paypal', [ $this, 'prepare_to_send' ] );
add_action( 'wpuf_options_payment', [ $this, 'payment_options' ] );
add_action( 'init', [ $this, 'check_response' ] );
add_action( 'wpuf_paypal_ipn_success', [ $this, 'paypal_success' ] );
add_action( 'wpuf_cancel_payment_paypal', [ $this, 'handle_cancel_subscription' ] );
Expand Down Expand Up @@ -114,48 +115,6 @@ public function recurring_change_status( $user_id, $status ) {
}
}

/**
* Adds paypal specific options to the admin panel
*
* @param type $options
*
* @return string
*/
public function payment_options( $options ) {
$options[] = [
'name' => 'paypal_email',
'label' => __( 'PayPal Email', 'wp-user-frontend' ),
];

$options[] = [
'name' => 'gate_instruct_paypal',
'label' => __( 'PayPal Instruction', 'wp-user-frontend' ),
'type' => 'wysiwyg',
'default' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account",
];

$options[] = [
'name' => 'paypal_api_username',
'label' => __( 'PayPal API username', 'wp-user-frontend' ),
];
$options[] = [
'name' => 'paypal_api_password',
'label' => __( 'PayPal API password', 'wp-user-frontend' ),
];
$options[] = [
'name' => 'paypal_api_signature',
'label' => __( 'PayPal API signature', 'wp-user-frontend' ),
];
/* $options[] = [
'name' => 'paypal_endpoint',
'label' => __('PayPal IPN endpoint', 'wp-user-frontend'),
'default' => home_url( '/action/wpuf_paypal_success', null ),
'desc' => __('Set this to your notification IPN listener', 'wp-user-frontend'),
'class' => 'disabled'
];*/
return $options;
}

/**
* Prepare the payment form and send to paypal
*
Expand Down Expand Up @@ -185,7 +144,7 @@ public function prepare_to_send( $data ) {
$data['tax'] = $billing_amount - $data['subtotal'];

if ( $billing_amount == 0 ) {
wpuf_get_user( $user_id )->subscription()->add_pack( $data['item_number'], $profile_id = null, false, 'free' );
wpuf_get_user( $user_id )->subscription()->add_pack( $data['item_number'], $profile_id = null, false, 'Free' );
wp_redirect( $return_url );
exit();
}
Expand Down Expand Up @@ -450,7 +409,7 @@ public function paypal_success() {

WP_User_Frontend::log( 'payment', 'inserting payment to database. ' . print_r( $data, true ) );

WPUF_Payment::insert_payment( $data, $transaction_id, $is_recurring );
_Payment::insert_payment( $data, $transaction_id, $is_recurring );

if ( $coupon_id ) {
$pre_usage = get_post_meta( $coupon_id, '_coupon_used', true );
Expand Down
13 changes: 6 additions & 7 deletions lib/class-wedevs-insights.php → Lib/WeDevs_Insights.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

namespace WeDevs\Wpuf\Lib;

use Appsero\Client;

if ( ! class_exists( 'WPUF_WeDevs_Insights' ) ) :

/**
Expand All @@ -13,18 +17,13 @@
*
* @author Tareq Hasan <[email protected]>
*/
class WPUF_WeDevs_Insights {
class WeDevs_Insights {

/**
* Initialize the class
*/
public function __construct( $file ) {

if ( ! class_exists( 'Appsero\Client' ) ) {
require_once __DIR__ . '/appsero/Client.php';
}

$client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file );
$client = new Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file );

$this->insights = $client->insights();

Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading