Skip to content

Commit

Permalink
Merge pull request #2723 from gocodebox/dev
Browse files Browse the repository at this point in the history
Release 7.7.3
  • Loading branch information
brianhogg authored Aug 12, 2024
2 parents eb3da8f + b768471 commit dafbfb9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 46 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
LifterLMS Changelog
===================

v7.7.3 - 2024-08-12
-------------------

##### Bug Fixes

+ Fixes revenue display in the Orders table. [#2719](https://github.com/gocodebox/lifterlms/issues/2719)


v7.7.2 - 2024-08-12
-------------------

Expand Down
2 changes: 1 addition & 1 deletion class-lifterlms.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class LifterLMS {
*
* @var string
*/
public $version = '7.7.2';
public $version = '7.7.3';

/**
* LLMS_Assets instance
Expand Down
49 changes: 8 additions & 41 deletions includes/models/model.llms.order.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ public function add_note( $note, $added_by_user = false ) {
do_action( 'llms_new_order_note_added', $note_id, $this );

return $note_id;

}

/**
Expand Down Expand Up @@ -328,7 +327,7 @@ private function calculate_next_payment_date( $format = 'Y-m-d H:i:s' ) {
$i = 1;
while ( $next_payment_time < ( llms_current_time( 'timestamp', true ) + 2 * HOUR_IN_SECONDS ) && $i < 3000 ) {
$next_payment_time = strtotime( '+' . $frequency . ' ' . $period, $next_payment_time );
$i++;
++$i;
}
}

Expand All @@ -342,7 +341,6 @@ private function calculate_next_payment_date( $format = 'Y-m-d H:i:s' ) {
* @param LLMS_Order $order The order object.
*/
return apply_filters( 'llms_order_calculate_next_payment_date', date( $format, $next_payment_time ), $format, $this );

}

/**
Expand All @@ -365,7 +363,6 @@ private function calculate_trial_end_date( $format = 'Y-m-d H:i:s' ) {
$ret = date_i18n( $format, $end );

return apply_filters( 'llms_order_calculate_trial_end_date', $ret, $format, $this );

}

/**
Expand Down Expand Up @@ -396,7 +393,6 @@ public function can_be_confirmed() {
$this,
$this->get( 'payment_gateway' )
);

}

/**
Expand Down Expand Up @@ -439,7 +435,6 @@ public function can_be_retried() {
* @param LLMS_Order $order Order object.
*/
return apply_filters( 'llms_order_can_be_retried', $can_retry, $this );

}

/**
Expand Down Expand Up @@ -484,7 +479,6 @@ public function can_resubscribe() {
* @param LLMS_Order $order The order object.
*/
return apply_filters( 'llms_order_can_resubscribe', $can_resubscribe, $this );

}

/**
Expand All @@ -507,7 +501,6 @@ public function can_switch_source() {
* @param LLMS_Order $order The order object.
*/
return apply_filters( 'llms_order_can_switch_source', $can_switch, $this );

}

/**
Expand Down Expand Up @@ -575,7 +568,6 @@ public function get_access_expiration_date( $format = 'Y-m-d' ) {
}

return apply_filters( 'llms_order_get_access_expiration_date', $ret, $this, $format );

}

/**
Expand Down Expand Up @@ -640,7 +632,6 @@ public function get_access_status() {

// We're active.
return 'active';

}

/**
Expand Down Expand Up @@ -679,7 +670,6 @@ public function get_coupon_amount( $payment = 'regular' ) {
$amount = llms_price( $amount );
}
return $amount;

}

/**
Expand Down Expand Up @@ -826,7 +816,6 @@ public function get_notes( $number = 10, $page = 1 ) {
);

return $comments;

}

/**
Expand Down Expand Up @@ -930,7 +919,6 @@ public function get_next_payment_due_date( $format = 'Y-m-d H:i:s' ) {
$next_payment_time = apply_filters( 'llms_order_get_next_payment_due_date', $next_payment_time, $this, $format );

return date_i18n( $format, $next_payment_time );

}

/**
Expand Down Expand Up @@ -979,7 +967,6 @@ public function get_remaining_payments() {
* @param LLMS_Order $order Order object.
*/
return apply_filters( 'llms_order_remaining_payments', $remaining, $this );

}

/**
Expand Down Expand Up @@ -1029,7 +1016,6 @@ private function get_retry_rules() {
* @param LLMS_Order $rules The order object.
*/
return apply_filters( 'llms_order_automatic_retry_rules', $rules, $this );

}

/**
Expand All @@ -1046,9 +1032,9 @@ public function get_transaction_total( $type = 'amount' ) {

// Check the cache.
static $cache = array();
if ( isset( $cache[$this->get( 'id' )] )
&& isset( $cache[$this->get( 'id' )][$type] ) ) {
return $cache[$this->get( 'id' )][$type];
if ( isset( $cache[ $this->get( 'id' ) ] )
&& isset( $cache[ $this->get( 'id' ) ][ $type ] ) ) {
return $cache[ $this->get( 'id' ) ][ $type ];
}

$statuses = array( 'llms-txn-refunded' );
Expand Down Expand Up @@ -1089,12 +1075,12 @@ public function get_transaction_total( $type = 'amount' ) {
// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared

// Save to cache.
if ( ! isset( $cache[$this->get( 'id' )] ) ) {
$cache[$this->get( 'id' )] = array();
if ( ! isset( $cache[ $this->get( 'id' ) ] ) ) {
$cache[ $this->get( 'id' ) ] = array();
}
$cache[$this->get('id')][$type] = floatval( $grosse );
$cache[ $this->get( 'id' ) ][ $type ] = floatval( $grosse );

return $cache[$type];
return $cache[ $this->get( 'id' ) ][ $type ];
}

/**
Expand Down Expand Up @@ -1168,7 +1154,6 @@ public function get_switch_source_action() {
* @param LLMS_Order $order The order object.
*/
return apply_filters( 'llms_order_switch_source_action', $action, $this );

}

/**
Expand Down Expand Up @@ -1325,7 +1310,6 @@ public function get_transactions( $args = array() ) {
'pages' => $query->max_num_pages,
'transactions' => $transactions,
);

}

/**
Expand Down Expand Up @@ -1356,7 +1340,6 @@ public function get_trial_end_date( $format = 'Y-m-d H:i:s' ) {
}

return apply_filters( 'llms_order_get_trial_end_date', $trial_end_date, $this );

}

/**
Expand Down Expand Up @@ -1388,7 +1371,6 @@ public function get_revenue( $type = 'net' ) {
}

return apply_filters( 'llms_order_get_revenue', $amount, $type, $this );

}

/**
Expand All @@ -1403,7 +1385,6 @@ public function get_view_link() {

$link = llms_get_endpoint_url( 'orders', $this->get( 'id' ), llms_get_page_url( 'myaccount' ) );
return apply_filters( 'llms_order_get_view_link', $link, $this );

}

/**
Expand Down Expand Up @@ -1627,7 +1608,6 @@ public function init( $user_data, $plan, $gateway, $coupon = false ) {
);

return $this;

}

/**
Expand Down Expand Up @@ -1670,7 +1650,6 @@ public function maybe_schedule_expiration() {
$this->unschedule_expiration();
as_schedule_single_action( $expires, 'llms_access_plan_expiration', $this->get_action_args() );
}

}

/**
Expand Down Expand Up @@ -1716,7 +1695,6 @@ public function maybe_schedule_payment( $recalc = true ) {

}
}

}

/**
Expand Down Expand Up @@ -1802,7 +1780,6 @@ public function maybe_schedule_retry() {
do_action( 'llms_automatic_payment_retry_scheduled', $this );

return true;

}

/**
Expand Down Expand Up @@ -1850,7 +1827,6 @@ public function record_transaction( $data = array() ) {
$txn->set( 'status', $status );

return $txn;

}

/**
Expand Down Expand Up @@ -1892,7 +1868,6 @@ public function set_date( $date_key, $date_val ) {
$this->maybe_schedule_payment( false );

}

}

/**
Expand All @@ -1914,7 +1889,6 @@ public function set_status( $status ) {
if ( array_key_exists( $status, llms_get_order_statuses( $this->get( 'order_type' ) ) ) ) {
$this->set( 'status', $status );
}

}

/**
Expand Down Expand Up @@ -1988,7 +1962,6 @@ public function set_user_data( $user_or_data ) {

$this->set_bulk( $to_set );
return $to_set;

}

/**
Expand Down Expand Up @@ -2022,7 +1995,6 @@ public function start_access() {
$this->maybe_schedule_expiration();

}

}

/**
Expand All @@ -2041,7 +2013,6 @@ public function unschedule_expiration() {
if ( $this->get_next_scheduled_action_time( 'llms_access_plan_expiration' ) ) {
as_unschedule_action( 'llms_access_plan_expiration', $this->get_action_args() );
}

}

/**
Expand Down Expand Up @@ -2075,7 +2046,6 @@ public function unschedule_recurring_payment() {
do_action( 'llms_charge_recurring_payment_unscheduled', $this, $action_args );

}

}

/**
Expand Down Expand Up @@ -2123,7 +2093,6 @@ public function schedule_recurring_payment( $next_payment_date = false, $gmt = f
do_action( 'llms_charge_recurring_payment_scheduled', $this, $date, $action_args, $action_id );

return $action_id;

}

/**
Expand Down Expand Up @@ -2157,7 +2126,6 @@ public function get_recurring_payment_due_date_for_scheduler( $next_payment_date
}

return (int) $date;

}

/**
Expand All @@ -2173,5 +2141,4 @@ public function supports_modify_recurring_payments() {
$gateway = $this->get_gateway();
return is_wp_error( $gateway ) ? false : $gateway->supports( 'modify_recurring_payments', $this );
}

}
2 changes: 1 addition & 1 deletion lifterlms.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: LifterLMS
* Plugin URI: https://lifterlms.com/
* Description: Complete e-learning platform to sell online courses, protect lessons, offer memberships, and quiz students. WP Learning Management System.
* Version: 7.7.2
* Version: 7.7.3
* Author: LifterLMS
* Author URI: https://lifterlms.com/
* Text Domain: lifterlms
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lifterlms",
"version": "7.7.2",
"version": "7.7.3",
"description": "LifterLMS by codeBOX",
"repository": {
"type": "git",
Expand Down

0 comments on commit dafbfb9

Please sign in to comment.