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 134 forks source link

Small Yoast and LifterLMS notification conflict #1779

Open nrherron92 opened 3 years ago

nrherron92 commented 3 years ago

Reproduction Steps

Expected Behavior

Actual Behavior

Error Messages / Logs


### System and Environment Information

<details>
<summary>System Report</summary>

<!-- Paste your System Report between the three backticks below this line -->

Wordpress

Home Url: https://natalie-5-testing.myliftersite.com Site Url: https://natalie-5-testing.myliftersite.com Login Url: https://natalie-5-testing.myliftersite.com/wp-login.php Version: 5.8.1 Debug Mode: Yes Debug Log: Yes Debug Display: Yes Locale: en_US Multisite: No Page For Posts: Not Set Page On Front: Homepage (#950) [https://natalie-5-testing.myliftersite.com/] Permalink Structure: /%postname%/ Show On Front: page Wp Cron: Yes

Settings

Version: 5.3.0 Db Version: 5.3.0 Course Catalog: Not Set Membership Catalog: Not Set Student Dashboard: Student Dashboard (#12) [https://natalie-5-testing.myliftersite.com/dashboard/] Checkout Page: Purchase (#11) [https://natalie-5-testing.myliftersite.com/purchase/] Course Catalog Per Page: -1 Course Catalog Sorting: menu_order,ASC Membership Catalog Per Page: 9 Membership Catalog Sorting: menu_order,ASC Site Membership: Not Set Courses Endpoint: my-courses Edit Endpoint: edit-account Lost Password Endpoint: lost-password Vouchers Endpoint: redeem-voucher Autogenerate Username: yes Password Strength Meter: yes Minimum Password Strength: strong Terms Required: yes Terms Page:(#156) [] Checkout Names: required Checkout Address: required Checkout Phone: optional Checkout Email Confirmation: yes Open Registration: no Registration Names: required Registration Address: optional Registration Phone: hidden Registration Voucher: optional Registration Email Confirmation: no Account Names: required Account Address: required Account Phone: optional Account Email Confirmation: yes Confirmation Endpoint: confirm-payment Force Ssl Checkout: no Country: IE Currency: USD Currency Position: left Thousand Separator: , Decimal Separator: . Decimals: 2 Trim Zero Decimals: no Recurring Payments: yes Email From Address: team+sandbox@lifterlms.com Email From Name: A LifterLMS Sandbox Email Footer Text: Email Header Image: 880 Cert Bg Width: 800 Cert Bg Height: 616 Cert Legacy Compat: no

Constants

LLMS_REMOVE_ALL_DATA: undefined LLMS_REST_DISABLE: undefined LLMS_SITE_FEATURE_RECURRING_PAYMENTS: undefined LLMS_SITE_IS_CLONE: undefined

Gateways

Manual: Enabled Manual Logging: no Manual Order: 1

Server

Mysql Version: 5.7.35 Php Curl: Yes Php Default Timezone: UTC Php Fsockopen: Yes Php Max Input Vars: 5000 Php Max Upload Size: 512 MB Php Memory Limit: 256M Php Post Max Size: 1024M Php Soap: Yes Php Suhosin: No Php Time Limt: 30 Php Version: 7.3.30 Software: Apache/2.4.48 (Unix) OpenSSL/1.1.1 Wp Memory Limit: 256M

Browser

HTTP USER AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Theme

Name: Astra Version: 3.6.9 Themeuri: https://wpastra.com/ Authoruri: https://wpastra.com/about/ Template: Child Theme: No Llms Support: Yes

Plugins

LifterLMS: 5.3.0 User Switching: 1.5.7 Yoast SEO: 17.1

Integrations

BbPress: No BuddyPress: No

Template Overrides



</details>

This issue has be recreated:
+ [X] Locally
+ [X] On a staging site
+ [X] On a production website
+ [X] With only LifterLMS and a default theme

### Browser, Device, and Operating System Information

+ Browser name and version
+ Operating System name and version
+ Device name and version (if applicable)
nrherron92 commented 3 years ago

Work around: If you add a custom Yoast description on the course the notification works. I'll let the user know this!

thomasplevy commented 3 years ago

Similar to SEO plugin issues we've had in gocodebox/lifterlms-private-areas#40, gocodebox/lifterlms-private-areas#44

The notice is "swallowed" as part of the post's content when the SEO plugin automatically generates the SEO description (used in header/frontmatter)

Screenshot_2021-09-13_12-56-11

I think we can fix this but it will require us to hook into an action before the automatic description generation, then we'll have to remove our action and then add it back in after the automatic description generation.

As you've discovered @nrherron92 adding a default description for the post type works (because then Yoast won't autogenerate one from the post content). I believe you can also create a custom description per post/course or adding an explicit excerpt will also fix this.

For the moment I don't think it's necessary for us to pursue a fix as I'm not sure adding the login shortcode to a course is all that common (maybe I'm wrong and welcome to be proven as such). For now I'll mark this as a low severity conflict with a workaround that's not that hard to implement. If we get a bunch of similiar complaints we'll endeavor to add a compatibility fix into the core.

Sound good?