77% wc-cross-seller

Code Review | WooCommerce Cross-Seller

WordPress plugin WooCommerce Cross-Seller scored 77% from 54 tests.

About plugin

  • Plugin page: wc-cross-seller
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.1
  • WordPress version: 5.9.2
  • First release: Jan 6, 2019
  • Latest release: Nov 10, 2020
  • Number of updates: 6
  • Update frequency: every 112.3 days
  • Top authors: cleverplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 513 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼302.33ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Cross-Seller
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0164.52 ▲7.63
Dashboard /wp-admin3.41 ▲0.0134.59 ▼40.94
Posts /wp-admin/edit.php3.64 ▲0.0143.41 ▼3.77
Add New Post /wp-admin/post-new.php6.88 ▼0.0996.13 ▼1,163.50
Media Library /wp-admin/upload.php3.30 ▲0.0027.61 ▼1.12

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 194 new files
Database: no new tables, 4 new options
New WordPress options
fs_debug_mode
fs_gdpr
fs_accounts
fs_active_plugins

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Cross-Seller
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.77 ▼0.226.24 ▼0.712.23 ▼0.14
Dashboard /wp-admin2,892 ▲316.07 ▼0.11119.05 ▼20.35174.08 ▲15.53
Posts /wp-admin/edit.php2,688 ▲163.24 ▼0.0164.10 ▼33.36131.90 ▼24.79
Add New Post /wp-admin/post-new.php1,661 ▼516.07 ▼4.66393.80 ▼70.17197.23 ▲33.46
Media Library /wp-admin/upload.php1,698 ▲35.54 ▲0.05139.62 ▼2.99229.80 ▲47.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 4 options
    • fs_debug_mode
    • fs_active_plugins
    • fs_gdpr
    • fs_accounts

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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-cross-seller/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/wc-cross-seller/admin/partials/woocommerce-cross-seller-admin-display.php
    • > /wp-content/plugins/wc-cross-seller/public/partials/woocommerce-cross-seller-public-display.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/wc-cross-seller/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wc-cross-seller/freemius/templates/account/partials/addon.php on line 6

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: cross sell, woocommerce, email

wc-cross-seller/woocommerce-cross-seller.php 77% from 13 tests

The main file in "WooCommerce Cross-Seller" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-cross-seller.php" instead of "woocommerce-cross-seller.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("4.3" instead of "3.3")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected32,440 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP1207,39316,69331,386
PO File1149181393
Markdown31010304
JavaScript645116223
CSS1320475
JSON20042
SVG10017

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity78.04
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods1,175
▷ Static methods18015.32%
▷ Public methods82870.47%
▷ Protected methods151.28%
▷ Private methods33228.26%
Functions98
▷ Named functions98100.00%
▷ Anonymous functions00.00%
Constants126
▷ Global constants10180.16%
▷ Class constants2519.84%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
images/cleverpluginslogo.png21.10KB10.85KB▼ 48.61%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%