gocodebox / lifterlms-helper Goto Github PK
View Code? Open in Web Editor NEWUpdate, install, and beta test LifterLMS and LifterLMS add-ons
Update, install, and beta test LifterLMS and LifterLMS add-ons
After installing the helper users will more than likely desire to enter license keys immediately
adding a plugin actions link to navigate directly to the add-ons screen, with text like "Manage License Keys" will streamline that process
This is kind of a niche scenario as we don't often add add-ons to bundles but we do, of course, from time to time.
An interim solution is to deactivate (remove) the license and then re-add it immediately after. This will force the add-on data to be updated.
wp llms cli deactivate fake
PHP notice encountered:
Notice: Undefined index: fake in /***/ifterlms-helper/includes/class-llms-helper-keys.php on line 188
This issue has be recreated:
Add-on Checklist
Composer Updates
Travis Config Updates
Tests
Should be able to update
Receive an error message about an invalid download URL
The functionality to replace the download url to download from lifterlms.com checks to see if the core is licensed.
The is_licensed()
function should return true
if a license isn't required
Default 64 character is too short for something like WooCommerce:
llms_keys[plugins][lifterlms-integration-woocommerce/lifterlms-integration-woocommerce.php] (91 characters)
https://suhosin.org/stories/configuration.html#suhosin-post-max-name-length
To best transition we can refer to the changelog URL and if it's make.lifterlms.com
in the URL we can use the REST method, otherwise fallback to the static file
Since this has been moved in LifterLMS core it must have the same textdomain.
Not 100% sure if this is a bug
A description would appear
The description does not appear
Wordpress
-------------------------------------------
Home Url: https://for-calls-will.myliftersite.com
Site Url: https://for-calls-will.myliftersite.com
Login Url: https://for-calls-will.myliftersite.com/wp-login.php
Version: 6.0
Debug Mode: No
Debug Log: No
Debug Display: Yes
Locale: en_US
Multisite: No
Page For Posts: Blog (#2029) [https://for-calls-will.myliftersite.com/blog/]
Page On Front: Home (#1015) [https://for-calls-will.myliftersite.com/]
Permalink Structure: /%postname%/
Show On Front: page
Wp Cron: Yes
Settings
-------------------------------------------
Version: 6.8.0
Db Version: 6.8.0
Course Catalog: Courses (#2202) [https://for-calls-will.myliftersite.com/courses/]
Membership Catalog: Membership Catalog (#2129) [https://for-calls-will.myliftersite.com/memberships/]
Student Dashboard: Dashboard (#2131) [https://for-calls-will.myliftersite.com/dashboard/]
Checkout Page: Purchase (#2130) [https://for-calls-will.myliftersite.com/purchase/]
Course Catalog Per Page: 30
Course Catalog Sorting: menu_order,ASC
Membership Catalog Per Page: 9
Membership Catalog Sorting: menu_order
Site Membership: Not Set
Courses Endpoint: my-courses
Edit Endpoint: edit-account
Lost Password Endpoint: lost-password
Vouchers Endpoint: redeem-voucher
Autogenerate Username: no
Password Strength Meter: no
Minimum Password Strength:
Terms Required: no
Terms Page: Not Set
Checkout Names:
Checkout Address:
Checkout Phone:
Checkout Email Confirmation: no
Open Registration: yes
Registration Names:
Registration Address:
Registration Phone:
Registration Voucher:
Registration Email Confirmation: no
Account Names:
Account Address:
Account Phone:
Account Email Confirmation: no
Confirmation Endpoint: confirm-payment
Force Ssl Checkout: no
Country: US
Currency: USD
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Decimals: 2
Trim Zero Decimals: no
Recurring Payments: yes
Email From Address: [email protected]
Email From Name: A LifterLMS Sandbox
Email Footer Text:
Email Header Image:
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
-------------------------------------------
Authorize.Net: Disabled
Authorize.Net Test Mode: Disabled
Authorize.Net Logging:
Authorize.Net Order: 0
Stripe: Enabled
Stripe Test Mode: Enabled
Stripe Logging: no
Stripe Order: 1
PayPal: Enabled
PayPal Test Mode: Enabled
PayPal Logging: no
PayPal Order: 2
Manual: Enabled
Manual Logging:
Manual Order: 3
Server
-------------------------------------------
Mysql Version: 5.7.38
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: 8.0.20
Software: Apache/2.4.54 (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/103.0.0.0 Safari/537.36
Theme
-------------------------------------------
Name: Kadence
Version: 1.1.18
Themeuri: https://www.kadencewp.com/kadence-theme/
Authoruri: https://www.kadencewp.com/
Template:
Child Theme: No
Llms Support: No
Plugins
-------------------------------------------
bbPress: 2.6.9
Code Snippets: 3.1.1
Custom Post Type UI: 1.12.1
Embed Any Document: 2.7.1
Kadence Blocks โ Gutenberg Blocks for Page Builder Features: 2.4.4
LifterLMS: 6.8.0
LifterLMS Advanced Quizzes: 2.0.1
LifterLMS Advanced Videos: 1.0.0-beta.18
LifterLMS Assignments: 1.3.0
LifterLMS Authorize.Net Payment Gateway: 1.1.0
LifterLMS ConvertKit: 2.1.2
LifterLMS Custom Fields: 2.0.2
LifterLMS Formidable Forms: 1.0.5
LifterLMS Gravity Forms: 2.1.3
LifterLMS Groups: 1.0.0-beta.20
LifterLMS MailChimp Add-on: 3.2.0
LifterLMS Ninja Forms: 1.1.1
LifterLMS PayPal Gateway: 1.4.0
LifterLMS PDFs: 2.1.0
LifterLMS Private Areas: 1.1.5
LifterLMS Social Learning: 1.5.0
LifterLMS Stripe Payment Gateway: 5.4.0
LifterLMS Twilio: 1.1.2
LifterLMS WooCommerce: 2.2.2
LifterLMS WPForms: 1.1.2
myCred: 2.4.7
myCRED - LifterLMS Integration: 1.1.1
Ninja Forms: 3.6.9
PDF Embedder: 4.6.4
PublishPress Capabilities: 2.4.2
User Switching: 1.5.8
Integrations
-------------------------------------------
BbPress: Yes
BuddyPress: No
LifterLMS ConvertKit: No
LifterLMS Groups: Yes
LifterLMS Formidable Forms: No
LifterLMS Gravity Forms: No
LifterLMS Ninja Forms: Yes
Twilio: No
WooCommerce: No
LifterLMS WPForms: No
LifterLMS MailChimp: No
LifterLMS PDFs: Yes
LifterLMS Private Areas: Yes
LifterLMS Social Learning: Yes
Videos: Vimeo: No
Videos: Wistia: Yes
Videos: YouTube: No
Template Overrides
-------------------------------------------
course/lesson-preview.php (ver: 5.7.0): /srv/users/manager/apps/for-calls-will/public/wp-content/themes/kadence/lifterlms/ (ver: 4.4.0)
course/syllabus.php (ver: 4.4.0): /srv/users/manager/apps/for-calls-will/public/wp-content/themes/kadence/lifterlms/ (ver: 4.4.0)
This issue has be recreated:
Currently the full license key is shown in the LifterLMS settings, which allows anyone with access to copy/paste it. Instead, we can obfuscate the keys so (say) the middle of it is hidden.
Describe the solution you'd like
The key will still be available within the database but not in the HTML output on the front-end.
lifterlms-helper/includes/class-llms-helper-upgrader.php
Lines 229 to 231 in cc4bcb1
Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /path/to/wordpress/wp-content/plugins/lifterlms-helper/includes/class-llms-helper-upgrader.php:231
Stack trace:
#0 /path/to/wordpress/wp-includes/class-wp-hook.php(288): LLMS_Helper_Upgrader->pre_set_site_transient_update_things(Object(stdClass))
#1 /path/to/wordpress/wp-includes/plugin.php(203): WP_Hook->apply_filters(Object(stdClass), Array)
#2 /path/to/wordpress/wp-includes/option.php(1750): apply_filters('pre_set_site_tr...', Object(stdClass), 'update_plugins')
#3 /path/to/wordpress/wp-includes/update.php(296): set_site_transient('update_plugins', Object(stdClass))
#4 /path/to/wordpress/wp-includes/class-wp-hook.php(286): wp_update_plugins('')
#5 /path/to/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
#6 /path/to/wordpress/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#7 /path/to/wordpress/wp-admin/admin.php(332): do_actio in /path/to/wordpress/wp-content/plugins/lifterlms-helper/includes/class-llms-helper-upgrader.php on line 231
This means that sometimes instead of a list of addons, we get a WP_Error object as per https://github.com/gocodebox/lifterlms/blob/2f788b4be7b761524de9b0e3179166d82fc7beda/includes/admin/llms.functions.admin.php#L99-L110 So, a check for whether it is an array should at least prevent a fatal error of this type. Additionally, a check for WP_Error can also display/ log more useful information about the root cause.
lifterlms-helper/includes/class-llms-helper-install.php
Lines 96 to 99 in 155a63e
DELETE FROM wp_options WHERE option_name = '_site_transient_update_plugins';
WP_Plugin_Install_List_Table::prepare_items()
gets $installed_plugins
from WP_Plugin_Install_List_Table::get_installed_plugins()
and then tries to pluck the plugin
property from $installed_plugins
. Surprisingly, WP_List_Util::pluck()
does not check if the property exists, which causes a PHP warning to be logged.
WP_Plugin_Install_List_Table::get_installed_plugins()
gets plugin info from the update_plugins
transient.
When the update_plugins
transient is set, LLMS_Helper_Upgrader::pre_set_site_transient_update_things()
gets LifterLMS add on information from https://lifterlms.com/wp-json/llms/v3/products, then calls LLMS_Helper_Upgrader::set_plugins_api()
to get a plugin item object. This object does not have a plugin
property and is eventually saved to the update_plugins
site transient.
This code has not changed in a long time, so I can't figure out why I haven't noticed this before. Surely, this issue only exists on my system? Can anyone else reproduce this?
[31-Mar-2022 22:17:36 UTC] PHP Warning: Undefined property: stdClass::$plugin in C:\wordpress-develop\src\wp-includes\class-wp-list-util.php on line 167
[31-Mar-2022 22:17:36 UTC] PHP Stack trace:
[31-Mar-2022 22:17:36 UTC] PHP 1. {main}() C:\wordpress-develop\src\wp-admin\plugin-install.php:0
[31-Mar-2022 22:17:36 UTC] PHP 2. WP_Plugin_Install_List_Table->prepare_items() C:\wordpress-develop\src\wp-admin\plugin-install.php:41
[31-Mar-2022 22:17:36 UTC] PHP 3. wp_list_pluck( <Edited for brevity.> ) C:\wordpress-develop\src\wp-admin\includes\class-wp-plugin-install-list-table.php:271
[31-Mar-2022 22:17:36 UTC] PHP 4. WP_List_Util->pluck($field = 'plugin', $index_key = NULL) C:\wordpress-develop\src\wp-includes\functions.php:5129
WordPress 5.9.1-src
LifterLMS 6.2.0
PHP 8.0
Windows 10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.