84% leo-product-recommendations

Code Review | Leo Product Recommendations For WooCommerce - Recommended Products For WooCommerce, Upsell Product Popup, Related Product Lightbox

WordPress plugin Leo Product Recommendations For WooCommerce - Recommended Products For WooCommerce, Upsell Product Popup, Related Product Lightbox scored84%from 54 tests.

About plugin

  • Plugin page: leo-product-recom...
  • Plugin version: 2.6.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 17, 2020
  • Latest release: Nov 22, 2023
  • Number of updates: 65
  • Update frequency: every 18.8 days
  • Top authors: leocoder (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

700+ active /13,649 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼6.93ms] Passed 4 tests

This is a short check of server-side resources used by Leo Product Recommendations For WooCommerce - Recommended Products For WooCommerce, Upsell Product Popup, Related Product Lightbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2745.26 ▲1.56
Dashboard /wp-admin3.58 ▲0.2347.69 ▼21.09
Posts /wp-admin/edit.php3.69 ▲0.3352.19 ▼0.73
Add New Post /wp-admin/post-new.php6.16 ▲0.2790.20 ▼7.47
Media Library /wp-admin/upload.php3.50 ▲0.2737.21 ▲3.42

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
woocommerce_cart_redirect_after_add
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
lc_lpr_settings
woocommerce_enable_ajax_add_to_cart
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Leo Product Recommendations For WooCommerce - Recommended Products For WooCommerce, Upsell Product Popup, Related Product Lightbox
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7014.34 ▼0.002.18 ▲0.2942.92 ▼8.30
Dashboard /wp-admin2,198 ▲245.53 ▼0.0592.66 ▼10.1241.04 ▲2.64
Posts /wp-admin/edit.php2,106 ▲31.96 ▲0.0240.81 ▼1.2637.25 ▲0.93
Add New Post /wp-admin/post-new.php1,532 ▲623.22 ▲0.07634.44 ▲13.2452.70 ▼9.86
Media Library /wp-admin/upload.php1,406 ▲124.20 ▲0.0198.39 ▲1.1041.09 ▼1.14

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • lc_lpr_settings
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • woocommerce_cart_redirect_after_add
    • can_compress_scripts
    • widget_recent-posts
    • woocommerce_enable_ajax_add_to_cart

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/leo-product-recommendations/templates/modal-modal.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
7 plugin tags: ajax add to cart popup, woocommerce cross-sell, woocommerce popup, woocommerce grouped product, woocommerce related products...

leo-product-recommendations/leo-product-recommendations.php 92% from 13 tests

The primary PHP file in "Leo Product Recommendations For WooCommerce - Recommended Products For WooCommerce, Upsell Product Popup, Related Product Lightbox" version 2.6.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "5.7")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin35,849 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JSON20028,348
JavaScript224982682,993
PHP135797862,572
Sass321881,239
CSS77430697

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity63.00
▷ Minimum class complexity23.00
▷ Maximum class complexity163.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods94
▷ Static methods22.13%
▷ Public methods9095.74%
▷ Protected methods22.13%
▷ Private methods22.13%
Functions32
▷ Named functions1134.38%
▷ Anonymous functions2165.62%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin