84% copecart-lifterlmsg

Code Review | CopeCart-LifterLMS

WordPress plugin CopeCart-LifterLMS scored84%from 54 tests.

About plugin

  • Plugin page: copecart-lifterlmsg
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0
  • WordPress version: 6.3.1
  • First release: Sep 20, 2021
  • Latest release: Jul 7, 2022
  • Number of updates: 4
  • Update frequency: every 73.3 days
  • Top authors: copecartgmbh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /758 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.98ms] Passed 4 tests

A check of server-side resources used by CopeCart-LifterLMS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.51 ▼5.48
Dashboard /wp-admin3.34 ▲0.0449.39 ▼2.80
Posts /wp-admin/edit.php3.46 ▲0.1049.04 ▼4.29
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.42 ▼3.33
Media Library /wp-admin/upload.php3.26 ▲0.0437.35 ▲0.83

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
lifterlms_copecart_disable_order_checkout
widget_recent-comments
lifterlms_set_version_option
db_upgraded

Browser metrics Passed 4 tests

CopeCart-LifterLMS: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.13 ▼1.071.74 ▼0.0341.37 ▼4.64
Dashboard /wp-admin2,209 ▲214.90 ▲0.01108.82 ▲3.9338.73 ▼5.51
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0239.63 ▲3.2834.44 ▲0.58
Add New Post /wp-admin/post-new.php1,514 ▼2017.64 ▼5.58632.23 ▼43.4548.87 ▼6.14
Media Library /wp-admin/upload.php1,391 ▲34.16 ▼0.0297.69 ▼3.5445.22 ▲1.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • lifterlms_set_version_option
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • lifterlms_copecart_disable_order_checkout
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/copecart-lifterlmsg/includes/lifterlms-copecart-settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/copecart-lifterlmsg/includes/lifterlms-copecart-ipn.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: copecart, lms, membership, gateway, lifterlms

copecart-lifterlmsg/copecart-lifterlms.php 92% from 13 tests

The principal PHP file in "CopeCart-LifterLMS" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("copecart-lifterlmsg.php" instead of "copecart-lifterlms.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected580 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4158238436
PO File25880144

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity25.33
▷ Minimum class complexity6.00
▷ Maximum class complexity56.00
Average method complexity4.32
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods22
▷ Static methods1463.64%
▷ Public methods2090.91%
▷ Protected methods00.00%
▷ Private methods29.09%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin