10% elements-for-lifterlms

Code Review | Elements for LifterLMS

WordPress plugin Elements for LifterLMS scored 10% from 54 tests.

About plugin

  • Plugin page: elements-for-lift...
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 5.8.1
  • First release: Aug 22, 2019
  • Latest release: Dec 19, 2020
  • Number of updates: 4
  • Update frequency: every 121.3 days
  • Top authors: zeetheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,824 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/elements-for-lifterlms/admin/class-elements-for-lifterlms-admin.php+133
    require_once(wp-content/plugins/elements-for-lifterlms/admin/partials/elements-for-lifterlms-hide-elements.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼0.00MB] [CPU: ▼148.57ms] Passed 4 tests

An overview of server-side resources used by Elements for LifterLMS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0034.92 ▲8.44
Dashboard /wp-admin3.06 ▼0.0038.06 ▼4.75
Posts /wp-admin/edit.php3.11 ▲0.0035.59 ▼2.27
Add New Post /wp-admin/post-new.php5.42 ▼0.0273.88 ▼586.92
Media Library /wp-admin/upload.php3.00 ▲0.0024.65 ▼0.32

Server storage [IO: ▲4.21MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 228 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Elements for LifterLMS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.98 ▲0.024.83 ▼0.1075.02 ▼0.48
Dashboard /wp-admin2,930 ▲346.12 ▼0.14113.10 ▼20.66163.96 ▼9.32
Posts /wp-admin/edit.php2,740 ▼03.22 ▼0.0061.87 ▼2.07138.69 ▲4.98
Add New Post /wp-admin/post-new.php3,736 ▲118.32 ▲0.58443.52 ▼16.55154.57 ▼18.21
Media Library /wp-admin/upload.php1,752 ▼05.54 ▲0.01135.37 ▼0.75183.34 ▼4.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/elements-for-lifterlms/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/elements-for-lifterlms/public/partials/elements-for-lifterlms-public-display.php
  • 29× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/elements-for-lifterlms/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/elements-for-lifterlms/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/elements-for-lifterlms/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/elements-for-lifterlms/includes/widgets/lesson-navigation.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/elements-for-lifterlms/includes/widgets/lesson-progress-bar.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/elements-for-lifterlms/admin/partials/elements-for-lifterlms-admin-settings-page.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/elements-for-lifterlms/includes/widgets/course-pricing-table.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/elements-for-lifterlms/includes/widgets/course-continue-button.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/elements-for-lifterlms/includes/widgets/course-syllabus.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/elements-for-lifterlms/includes/widgets/course-prerequisite.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
Please take inspiration from this readme.txt

elements-for-lifterlms/elements-for-lifterlms.php 92% from 13 tests

This is the main PHP file of "Elements for LifterLMS" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin58,149 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1369,36117,95839,838
PO File105,7106,91312,558
CSS146171122,952
JavaScript79081072,366
Sass2275262
LESS1115152
SVG11013
Ruby1208

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity64.39
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes72
▷ Abstract classes22.78%
▷ Concrete classes7097.22%
▷ Final classes00.00%
Methods1,317
▷ Static methods17613.36%
▷ Public methods93570.99%
▷ Protected methods493.72%
▷ Private methods33325.28%
Functions102
▷ Named functions102100.00%
▷ Anonymous functions00.00%
Constants127
▷ Global constants10078.74%
▷ Class constants2721.26%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/elements-for-lifterlms-logo.png2.66KB2.32KB▼ 13.05%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/img/elements-for-lifterlms.png0.76KB0.74KB▼ 2.81%
admin/img/llmse-logo-freemius.png24.82KB12.00KB▼ 51.63%