10% wc-ultimate-cross-selling

Code Review | WC Ultimate Cross Selling

WordPress plugin WC Ultimate Cross Selling scored10%from 54 tests.

About plugin

  • Plugin page: wc-ultimate-cross...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.2
  • WordPress version: 6.3.1
  • First release: Sep 16, 2019
  • Latest release: Sep 16, 2019
  • Number of updates: 8
  • Update frequency: every 0.4 days
  • Top authors: technovartz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /477 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/woocommerce): failed to open dir: No such file or directory

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

This is a short check of server-side resources used by WC Ultimate Cross Selling
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.23 ▼1.15
Dashboard /wp-admin3.31 ▲0.0049.28 ▼3.00
Posts /wp-admin/edit.php3.36 ▲0.0046.37 ▼5.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.09 ▼10.30
Media Library /wp-admin/upload.php3.23 ▲0.0035.09 ▼3.73

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WC Ultimate Cross Selling
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▼0.191.74 ▲0.0645.26 ▼1.64
Dashboard /wp-admin2,195 ▲185.60 ▼0.0897.52 ▲12.1242.93 ▲0.55
Posts /wp-admin/edit.php2,100 ▲32.15 ▲0.1337.46 ▲0.6534.31 ▼1.91
Add New Post /wp-admin/post-new.php1,545 ▼023.21 ▼0.03659.68 ▼29.6451.19 ▼10.30
Media Library /wp-admin/upload.php1,397 ▼04.30 ▲0.1299.95 ▼14.2247.25 ▼1.33

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-ultimate-cross-selling/ultimate-cross-cell.php on line 22
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/wc-ultimate-cross-selling/ultimate-cross-cell.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-ultimate-cross-selling/includes/product-details.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wc-ultimate-cross-selling/ultimate-cross-cell.php on line 22

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)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: products, ecommerce, woocommerce, boost sales, cross seling

wc-ultimate-cross-selling/ultimate-cross-cell.php 69% from 13 tests

The main PHP script in "WC Ultimate Cross Selling" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 202 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-ultimate-cross-selling.php" instead of "ultimate-cross-cell.php")
  • Domain Path: The domain path folder was not found ("/lang")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected5,371 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,1603044,597
CSS5762550
PHP37256224

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/no-image-available.png3.06KB2.93KB▼ 4.09%