84% upsells-for-learndash

Code Review | UpSells For LearnDash

WordPress plugin UpSells For LearnDash scored84%from 54 tests.

About plugin

  • Plugin page: upsells-for-learn...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 5, 2022
  • Latest release: Oct 20, 2023
  • Number of updates: 12
  • Update frequency: every 27.4 days
  • Top authors: saffiretech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /416 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.56ms] Passed 4 tests

An overview of server-side resources used by UpSells For LearnDash
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.31 ▼1.37
Dashboard /wp-admin3.41 ▲0.1145.47 ▼6.98
Posts /wp-admin/edit.php3.52 ▲0.1746.71 ▲2.30
Add New Post /wp-admin/post-new.php6.00 ▲0.1181.95 ▼4.17
Media Library /wp-admin/upload.php3.34 ▲0.1133.56 ▲3.67

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for UpSells For LearnDash
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,983 ▲22214.48 ▲0.199.82 ▲8.1939.79 ▼6.33
Dashboard /wp-admin2,228 ▲545.16 ▼0.4899.17 ▲5.6236.98 ▼6.45
Posts /wp-admin/edit.php2,130 ▲302.69 ▲0.6746.07 ▲10.0138.23 ▼0.19
Add New Post /wp-admin/post-new.php1,554 ▲2823.37 ▼0.19640.52 ▲13.8533.57 ▼28.65
Media Library /wp-admin/upload.php1,433 ▲304.71 ▲0.52100.46 ▲4.5840.09 ▼4.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/upsells-for-learndash/include/ldups-upsells-metabox.php:72
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/upsells-for-learndash/include/ldups-upsells-widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: bundles, upsells, courses

upsells-for-learndash/upsells-for-learndash.php 85% from 13 tests

"UpSells For LearnDash" version 1.0.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: The description should be shorter than 140 characters (currently 264 characters long)

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
Good job! No executable or dangerous file extensions detected887 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP583146476
CSS34914329
JavaScript46682

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions18
▷ Named functions1583.33%
▷ Anonymous functions316.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin