Giter VIP home page Giter VIP logo

lifterlms-helper's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lifterlms-helper's Issues

Add-ons available to a license can get out of sync when new add-ons are added to a bundle

Recreation Steps

  1. Activate a license for a bundle (infinity or universe)
  2. Add an add-on to the license (via the LifterLMS.com API)
  3. Navigate back to the admin panel and if the new add-on is already installed it will show (incorrectly) as unlicensed.

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.

Solution

  • During the weekly checkin cron that determines if the license is still active we can refresh the license's available add-on data.
  • We could also add a "force" or "clear cache" option somewhere on the add-on page to allow a forced update on demand.

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.

Undefined index notice encountered when attempting to deactivate a key which is not stored on the site

Reproduction Steps

  • This can only be reproduced using the LLMS-CLI
  • Attempt to deactivate a license key which does not exist on the site, for example: wp llms cli deactivate fake

Expected Behavior

  • Command error response displayed, something like "Fake is not a valid license key"

Actual Behavior

PHP notice encountered:

Notice: Undefined index: fake in /***/ifterlms-helper/includes/class-llms-helper-keys.php on line 188

This issue has be recreated:

  • Locally
  • On a staging site
  • On a production website
  • With only LifterLMS and a default theme

PHP8 and WP5.6 Compat

Add-on Checklist

  • Composer Updates

    • lifterlms/lifterlms-tests
      • Switch from "dev-master" to "dev-trunk"
      • Update to latest version
    • lifterlms/lifterlms-cs
      • Switch from "dev-master" to "dev-trunk"
      • Update to latest version
    • Scripts
      • Update scripts to match the LifterLMS Core scripts block
      • Ensure any custom scripts are retained
      • Ensure database scripts use a custom default database name, eg "llms_groups_tests" instead of "llms_tests"
      • If the add-on is not configured for E2E testing the "env" and "env:setup" commands can be removed
    • PHP Requirements
      • Update PHP version to be >=7.2
  • Travis Config Updates

    • Update to import the add-on.yml config from the LLMS core.
    • Import the e2e config if the add-on is setup for e2e testing
    • Retain any custom jobs specific to the add-on
  • Tests

    • Test Suite Passes in Travis
    • Passes manual inspection on php8

Unable to update to LifterLMS core beta versions without a valid license

Reproduction Steps

  1. Install LifterLMS & the Helper
  2. Subscribe to the beta channel for the core plugin
  3. Update to the latest beta

Expected

Should be able to update

Actual

Receive an error message about an invalid download URL

Problem

if ( ! $addon || ! $addon->is_installable() || ! $addon->is_licensed() ) {

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

HS-167851

Transition from static HTML changelogs in favor of blogposts at make.lifterlms.com

  • Codebases need their changelogs fully transitioned to the blog (log entries prior to the creation of the blog need to be retroactively added)
  • Helper must update its changelog getter method to read from the blog post. Best way to handle this would be to utilize the WP REST API to retrieve the changelog information. method

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

LifterLMS Plugin description missing from plugin page in WordPress admin

Reproduction Steps

Not 100% sure if this is a bug

  1. Install LifterLMS core plugin
  2. Go to plugins area
  3. click 'View Details'

Screen Shot 2022-07-18 at 11 42 23 PM

Expected Behavior

A description would appear

Actual Behavior

The description does not appear

System and Environment Information

System Report
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:

  • [ x] Locally
  • [ x] On a staging site
  • [ x] On a production website
  • With only LifterLMS and a default theme

Obfuscate the License Keys

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

  • Do not output the middle of the license key in both what is shown and in the form HTML (ie. the form to select and remove the license keys)
  • In the request to remove selected license keys, loop through and check that the pattern of the obfuscated license key matches rather than looking for an exact match.
  • Ensure the deactivation on the license key server still works as expected.

The key will still be available within the database but not in the HTML output on the front-end.

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

$all_products = llms_get_add_ons( false );
foreach ( $all_products['items'] as $addon_data ) {

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.

Helper < 3.0 migration message displayed on first run for new users when included as a library

Reproduction Steps

  • Install LifterLMS core on a new site
  • Login in to the admin panel

Expected Behavior

  • No helper "Welcome" message displayed

Actual Behavior

  • The welcome message is displayed

$text = '<p><strong>' . __( 'Welcome to the LifterLMS Helper', 'lifterlms' ) . '</strong></p>';
$text .= '<p>' . __( 'This plugin allows your website to interact with your subscriptions at LifterLMS.com to ensure your add-ons stay up to date.', 'lifterlms' ) . '</p>';
// Translators: %1$s = Opening anchor tag; %2$s = closing anchor tag.
$text .= '<p>' . sprintf( __( 'You can activate your add-ons from the %1$sAdd-Ons & More%2$s screen.', 'lifterlms' ), '<a href="' . admin_url( 'admin.php?page=llms-add-ons' ) . '">', '</a>' ) . '</p>';

Plugin object without a `plugin` property

Reproduction Steps

  1. DELETE FROM wp_options WHERE option_name = '_site_transient_update_plugins';
  2. In the WordPress navigation menu, go to Plugins -> Add New

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?

Expected Behavior

  • No errors.

Actual Behavior

  • Errors.

Error Messages / Logs

[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

System and Environment Information

WordPress 5.9.1-src
LifterLMS 6.2.0
PHP 8.0
Windows 10

This issue has been recreated:

  • Locally
  • On a staging site
  • On a production website
  • With only LifterLMS and a default theme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.