gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
181 stars 135 forks source link

Members-only course access plan bulk generator #2196

Open thomasplevy opened 2 years ago

thomasplevy commented 2 years ago

The problem

Users who create memberships and wish to provide access to a large-number of courses end up using the course auto-enrollment feature to add every course to the membership.

The UX (for students) and performance implications of this are not ideal for what the users are trying to achieve: they want the users to have access to all the courses.

Proposed solution

Building on our "membership associated posts" concepts LLMS_Membership::get_associated_posts()

We could provide an interface (on the membership's admin panel) to add posts to this list from within the membership, in bulk.

There are 3 conditions defined for a membership-associated post:

  1. A post, page, or custom post type which supports llms-membership-restrictions and has restrictions enabled to this membership
  2. A course that exists in the memberships list of auto-enroll courses
  3. A course that has at least one access plan with members-only availability linked to this membership

UI already exists for item 2 (the auto-enroll interface) but I think we can rework this UI and create a wholly new UI:

Associated Posts

In this area we'll list out all the associated posts, grouped by post type. The tables should list out the title, id, and have edit / frontend view links as well as an actions area.

Actions are "Remove" and for any enrollable post-type the ability to mark the item as "Auto-enroll"

We should add a warning somewhere when the auto-enroll list grows to be larger than 10 items. Something like "We suggest keeping the auto-enrollment list to 10 items or fewer to improve the student's user experience and prevent performance degradation on larger websites" (or something)

The interface will provide an "Add item" button, when clicked a modal will open to search for qualified posts (by default post, page, courses)

When an item from condition 1 above is added, the post will automatically have it's membership restriction settings updated to include the current membership

When an item from condition 3 above is added, we will automatically create a free members-only access plan for the course.

eri-trabiccolo commented 2 years ago

When an item from condition 1 above is added, the post will automatically have it's membership restriction settings updated to include the current membership

Ok but let's do on save, right?

thomasplevy commented 2 years ago

Oh yea, on save for sure.

This isn't a fully-fledged feature either... I was just thinking about it and wanted to capture the idea.

For one: if a plan is deleted from the course side the course should be removed from the membership and if the course is removed from the membership the course plan should be removed. Probably.

thomasplevy commented 2 years ago

I'm thinking this entire UI should be built in react as a block-editor "plugin". Using the strategy we used for some react stuff related to certificates we could also place this interface outside the editor if it should ever become necessary, I think.