Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request gocodebox#2546 from gocodebox/dev
Browse files Browse the repository at this point in the history
Pending Release
  • Loading branch information
ideadude authored Nov 5, 2023
2 parents 6d3e2c5 + 81d5a96 commit a8a7354
Show file tree
Hide file tree
Showing 167 changed files with 1,891 additions and 515 deletions.
5 changes: 5 additions & 0 deletions .changelogs/add-gateway-can-process-access-plan-logic-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: minor
type: dev
entry: Added `LLMS_Payment_Gateway::can_process_access_plan()` method to determine if an
access plan can be processed by the gateway. Also added the filter hook
`llms_can_gateway_process_access_plan` to filter its result.
4 changes: 4 additions & 0 deletions .changelogs/add-gateway-can-process-access-plan-logic-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: minor
type: dev
entry: Added a check on whether the gateway can process a specific plan when
purchasing a plan, or switching the payment gateway of a recurring payment.
5 changes: 5 additions & 0 deletions .changelogs/add-gateway-can-process-access-plan-logic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: minor
type: dev
entry: Added action hook `llms_checkout_form_gateway_cant_process_plan` fired on
the checkout form gateways section, when a gateway cannot process a specific
plan.
4 changes: 4 additions & 0 deletions .changelogs/blocks-2.5.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: changed
entry: Updates LifterLMS Blocks to
[v2.5.2](https://make.lifterlms.com/2023/11/01/lifterlms-blocks-version-2-5-2/).
6 changes: 6 additions & 0 deletions .changelogs/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
significance: patch
type: dev
entry: Added new filter hook
`llms_unschedule_recurring_payment_on_access_pan_expiration` to control
whether or not the recurring payments fo an order need to be
unscheduled when the related access plan expires (`true` by default).
6 changes: 6 additions & 0 deletions .changelogs/export-possible-security-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
significance: patch
type: security
attributions:
- "[Huseyin Tintas (stif)](https://linkedin.com/in/huseyintintas)"
entry: "Improved security when exporting a reporting table: make sure to avoid
path traversals."
3 changes: 3 additions & 0 deletions .changelogs/feature_favorite-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: dev
entry: Added 'favorites' in User postmeta for getting all user's favorites.
4 changes: 4 additions & 0 deletions .changelogs/feature_favorite-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: minor
type: dev
entry: Added filter `llms_course_syllabus_lesson_favorite_visibility` for
disabling favorites in syllabus view.
4 changes: 4 additions & 0 deletions .changelogs/feature_favorite-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: minor
type: dev
entry: Added filter `llms_is_$object_type_favorite` to change object's (lesson,
student, course) favorite boolean value.
4 changes: 4 additions & 0 deletions .changelogs/feature_favorite-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: dev
entry: Added `llms_lesson_preview_before_title` and
`llms_lesson_preview_after_title` action hooks.
3 changes: 3 additions & 0 deletions .changelogs/feature_favorite-5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: dev
entry: Added function `llms_template_syllabus_favorite_lesson_preview`.
3 changes: 3 additions & 0 deletions .changelogs/feature_favorite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: dev
entry: Added filter `llms_favorites_enabled` to enable/disable Favorites feature.
6 changes: 6 additions & 0 deletions .changelogs/function-name-correction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
significance: patch
type: fixed
links:
- "#2550"
entry: Fixed checking for the wrong function name when
defining the pluggable function `lifterlms_student_dashboard`.
5 changes: 5 additions & 0 deletions .changelogs/issue_2511-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: added
links:
- "#2511"
entry: Added `LLMS_Add_On::get_image()` method to get the addon and author image.
5 changes: 5 additions & 0 deletions .changelogs/issue_2511.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: changed
links:
- "#2511"
entry: Bundled Add-ons & More Banners/Author Images in Core LifterLMS.
7 changes: 7 additions & 0 deletions .changelogs/issue_2552.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
significance: patch
type: dev
links:
- "#2552"
attributions:
- "@AlexVCS"
entry: Removed references to the unused quiz's property `random_answers`.
6 changes: 6 additions & 0 deletions .changelogs/issues_2434.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
significance: minor
type: added
links:
- "#2434"
entry: Added a paragraph to show Number of lessons in a course at Course Catalog
and My Courses.
3 changes: 3 additions & 0 deletions .changelogs/only-lifterlms-add-ons-in-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: fixed
entry: Only show LifterLMS-authored Addons in All section.
3 changes: 3 additions & 0 deletions .changelogs/php82-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: dev
entry: Improved some unit tests compatibility with PHP 8.2.
5 changes: 5 additions & 0 deletions .changelogs/php82-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: fixed
entry: Improved compatibility with WordPress 6.4 by using
`traverse_and_serialize_blocks` in place of the deprecated
`_inject_theme_attribute_in_block_template_content`.
4 changes: 4 additions & 0 deletions .changelogs/php82.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: fixed
entry: "PHP 8.2 compatibility fix: Fixed creation of dynamic property
`LLMS_Meta_Box_Access::$_saved`."
4 changes: 4 additions & 0 deletions .changelogs/rest-beta-29.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: changed
entry: Updates LifterLMS Rest to
[v1.0.0-beta.29](https://make.lifterlms.com/2023/10/24/lifterlms-rest-api-version-1-0-0-beta-29/).
4 changes: 4 additions & 0 deletions .changelogs/update-action-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: changed
entry: Update Action Scheduler to version 3.5.4. To improve compatibility
with PHP 8.2.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/Affiliate-WP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/Astra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/Authority-Pro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/AutomatorWP-LifterLMS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/BuddyBoss-LifterLMS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/GrassBlade.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/KadenceWP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/Lifter-Elements-Tangible.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/LifterLMS-ConvertKit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/LifterLMS-Course-Cohorts.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/LifterLMS-Earth-Bundle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/LifterLMS-Groups-add-on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/addons/LifterLMS-PDFs-add-on.png
Binary file added assets/images/addons/LifterLMS-Private-Site.jpeg
Binary file added assets/images/addons/LifterLMS-WPForms-Add-On.jpg
Binary file added assets/images/addons/LoginWP.png
Binary file added assets/images/addons/Memberium.png
Binary file added assets/images/addons/Monochrome-Pro.png
Binary file added assets/images/addons/MonsterInsights.png
Binary file added assets/images/addons/Neve.png
Binary file added assets/images/addons/OceanWP.png
Binary file added assets/images/addons/Payflexi.png
Binary file added assets/images/addons/Presto-Player.png
Binary file added assets/images/addons/Revolution-Pro.png
Binary file added assets/images/addons/Store-Apps.png
Binary file added assets/images/addons/Tribe-theme.png
Binary file added assets/images/addons/Tutorque.png
Binary file added assets/images/addons/UpsellPlugin-LifterLMS.png
Binary file added assets/images/addons/WP-Fusion.png
Binary file added assets/images/addons/WPfomify.png
Binary file added assets/images/addons/WishList-Member.png
Binary file added assets/images/addons/castos.png
Binary file added assets/images/addons/course-maker-pro.png
Binary file added assets/images/addons/gamipress.png
Binary file added assets/images/addons/genesis-framework.png
Binary file added assets/images/addons/groundhogg.png
Binary file added assets/images/addons/iThemes-Security-Pro.png
Binary file added assets/images/addons/launchpad-theme.jpg
Binary file added assets/images/addons/lifterlms-powerpack-1.png
Binary file added assets/images/addons/lifterlms-suretriggers.jpg
Binary file added assets/images/addons/page-builder-framework.png
Binary file added assets/images/addons/rebrand-lifterlms-pro.png
Binary file added assets/images/addons/sky-pilot-theme.jpg
Binary file added assets/images/addons/uncanny-automator.png
Binary file added assets/images/addons/wpzone-course-scheduler.png
13 changes: 7 additions & 6 deletions assets/js/builder/Models/Quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Quiz Model.
*
* @since 3.16.0
* @version 7.4.0
* @version [version]
*/
define( [
'Collections/Questions',
Expand Down Expand Up @@ -47,10 +47,11 @@ define( [
schema: QuizSchema,

/**
* New lesson defaults.
* New quiz defaults.
*
* @since 3.16.0
* @since 7.4.0 Added filter for filtering defaults.
* @since [version] Replaced unused `random_answers` property with `random_questions`.
*
* @return {Object}
*/
Expand All @@ -64,23 +65,23 @@ define( [

status: 'draft',

// editable fields
// editable fields.
content: '',
allowed_attempts: 5,
limit_attempts: 'no',
limit_time: 'no',
passing_percent: 65,
name: '',
random_answers: 'no',
random_questions: 'no',
time_limit: 30,
show_correct_answer: 'no',

questions: [],

// calculated
// calculated.
_points: 0,

// display
// display.
permalink: '',
_show_settings: false,
_questions_loaded: false,
Expand Down
93 changes: 93 additions & 0 deletions assets/js/llms-favorites.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* global LLMS, $ */
/* jshint strict: true */

/**
* Front End Favorite Class.
*
* @type {Object}
*
* @since [version]
* @version [version]
*/
( function( $ ) {

var favorite = {

/**
* Bind DOM events.
*
* @since [version]
*
* @return {Void}
*/
bind: function() {

var self = this;

// Favorite clicked.
$( '.llms-favorite-wrapper' ).on( 'click', function( e ) {
e.preventDefault();
var $btn = $( this ).find( '.llms-heart-btn' );
$btn && self.favorite( $btn );
} );

// Adding class in Favorite's parent.
$( '.llms-favorite-wrapper' ).parent().addClass( 'llms-has-favorite' );

},

/**
* Favorite / Unfavorite an object.
*
* @since [version]
*
* @param {Object} $btn jQuery object for the "Favorite / Unfavorite" button.
* @return {Void}
*/
favorite: function( $btn ) {

var object_id = $btn.attr( 'data-id' ),
object_type = $btn.attr( 'data-type' ),
user_action = $btn.attr( 'data-action' );

LLMS.Ajax.call( {
data: {
action: 'favorite_object',
object_id: object_id,
object_type: object_type,
user_action: user_action
},
beforeSend: function() {},
success: function( r ) {
/**
* Get all the favorite buttons on the page related to the same lesson, e.g. when the syllabus
* is shown on the sidebar of a lesson or a course, in that case you will have the same favorite
* button twice. The code below makes sure both the buttons are updated.
*/
var $fav_btns = $( '[data-id='+object_id+'][data-type='+object_type+'][data-action='+user_action+']' );
if( r.success ) {
$fav_btns.each(
function() {
if( 'favorite' === user_action ) {
$(this).removeClass( 'fa-heart-o' ).addClass( 'fa-heart' );
$(this).attr( 'data-action', 'unfavorite' );
} else if ( 'unfavorite' === user_action ) {
$(this).removeClass( 'fa-heart' ).addClass( 'fa-heart-o' );
$(this).attr( 'data-action', 'favorite' );
}
// Updating count.
$(this).closest( '.llms-favorite-wrapper' ).find( '.llms-favorites-count' ).text( r.total_favorites );
}
);
}
}
} );
}
};

favorite.bind();

window.llms = window.llms || {};
window.llms.favorites = favorite;

} )( jQuery );
27 changes: 27 additions & 0 deletions assets/scss/frontend/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,30 @@ svg .llms-animated-circle {
.llms-lesson-tooltip.active {
display: inline-block;
}

// Favorites.
.llms-favorite-wrapper {
cursor: pointer;

.fa-heart {
color: #EF476F;
}
}

.llms-has-favorite .llms-parent-course-link {
display: inline-block;
margin-bottom: 20px;

+ .llms-favorite-wrapper {
float: right;
margin: 0;
}
}

.llms-syllabus-wrapper .llms-has-favorite {
text-align: left;

.llms-favorite-wrapper {
display: inline-block;
}
}
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"php": ">=7.4",
"composer/installers": "~1.9.0",
"deliciousbrains/wp-background-processing": "1.0.2",
"lifterlms/lifterlms-blocks": "2.5.1",
"lifterlms/lifterlms-blocks": "2.5.2",
"lifterlms/lifterlms-cli": "0.0.3",
"lifterlms/lifterlms-helper": "3.5.0",
"lifterlms/lifterlms-rest": "1.0.0-beta.28",
"woocommerce/action-scheduler": "3.5.2"
"lifterlms/lifterlms-rest": "1.0.0-beta.29",
"woocommerce/action-scheduler": "3.5.4"
},
"require-dev": {
"lifterlms/lifterlms-tests": "^3.3.1",
"lifterlms/lifterlms-tests": "^4.1.1",
"lifterlms/lifterlms-cs": "dev-trunk"
},
"archive": {
Expand Down
9 changes: 9 additions & 0 deletions includes/abstracts/abstract.llms.admin.metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ abstract class LLMS_Admin_Metabox {
*/
private $version = 1;

/**
* Used to prevent save action from running
* multiple times on a single load.
*
* @since [version]
* @var bool
*/
private $_saved;

/**
* Constructor.
*
Expand Down
29 changes: 27 additions & 2 deletions includes/abstracts/abstract.llms.payment.gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package LifterLMS/Abstracts/Classes
*
* @since 3.0.0
* @version 7.1.0
* @version [version]
*/

defined( 'ABSPATH' ) || exit;
Expand Down Expand Up @@ -1033,7 +1033,7 @@ public function retrieve_secure_strings() {
}

/**
* Determine if a feature is supported by the gateway
* Determine if a feature is supported by the gateway.
*
* Looks at the $this->supports and ensures the submitted feature exists and is true.
*
Expand All @@ -1056,4 +1056,29 @@ public function supports( $feature, $order = null ) {

}

/**
* Determine if an access plan can be processed by the gateway.
*
* @since [version]
*
* @param LLMS_Access_Plan $plan Instance of an LLMS_Access_Plan.
* @param LLMS_Order $order Instance of an LLMS_Order. Used to check whether a payment can be switched using this gateway.
* In that case, in fact, we have to rely on the access plan information contained in the order
* at the moment of its creation.
* @return boolean
*/
public function can_process_access_plan( $plan, $order = null ) {
/**
* Filters whether or not a gateway can process a specific access plan.
*
* @since [version]
*
* @param bool $can_process_plan Whether or not the gateway can process a specific access plan.
* @param LLMS_Access_Plan $plan Access plan object.
* @param LLMS_Order $plan Order object.
* @param string $id The gateway ID.
*/
return apply_filters( 'llms_can_gateway_process_access_plan', $plan || $order, $plan, $order, $this->id );
}

}
Loading

0 comments on commit a8a7354

Please sign in to comment.