84% checkout-upsell-and-order-bumps

Code Review | Checkout Upsell - WooCommerce Upsell, Cross Sell, Order Bumps, One Click Upsell, Next Order Coupons, Product Recommendations

WordPress plugin Checkout Upsell - WooCommerce Upsell, Cross Sell, Order Bumps, One Click Upsell, Next Order Coupons, Product Recommendations scored84%from 54 tests.

About plugin

  • Plugin page: checkout-upsell-a...
  • Plugin version: 1.4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: May 18, 2023
  • Latest release: Nov 1, 2023
  • Number of updates: 33
  • Update frequency: every 5.1 days
  • Top authors: flycartdev (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /2,148 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.94ms] Passed 4 tests

Analyzing server-side resources used by Checkout Upsell - WooCommerce Upsell, Cross Sell, Order Bumps, One Click Upsell, Next Order Coupons, Product Recommendations
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0044.50 ▲2.57
Dashboard /wp-admin3.31 ▼0.0449.42 ▼15.42
Posts /wp-admin/edit.php3.36 ▲0.0045.97 ▼4.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.47 ▼21.85
Media Library /wp-admin/upload.php3.23 ▲0.0036.11 ▲1.94

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Checkout Upsell - WooCommerce Upsell, Cross Sell, Order Bumps, One Click Upsell, Next Order Coupons, Product Recommendations
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.311.68 ▼0.0443.71 ▼0.47
Dashboard /wp-admin2,195 ▲185.53 ▲0.0184.06 ▼18.0638.57 ▼2.34
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0838.77 ▲2.8133.12 ▼3.05
Add New Post /wp-admin/post-new.php1,526 ▼022.92 ▼0.70655.95 ▼15.0864.56 ▲1.40
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0595.68 ▼4.9741.11 ▼0.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant CUW_PLUGIN_NAME - assumed 'CUW_PLUGIN_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/checkout-upsell-and-order-bumps/config.php on line 4
    • > PHP Warning
      Use of undefined constant CUW_VERSION - assumed 'CUW_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/checkout-upsell-and-order-bumps/config.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

checkout-upsell-and-order-bumps/checkout-upsell-and-order-bumps.php 92% from 13 tests

Analyzing the main PHP file in "Checkout Upsell - WooCommerce Upsell, Cross Sell, Order Bumps, One Click Upsell, Next Order Coupons, Product Recommendations" version 1.4.2
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin37,089 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PHP1591,6294,78813,999
JavaScript62,7861,80511,959
CSS6816219,603
Markdown119001,164
SVG3800216
JSON200105
YAML232843

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity28.93
▷ Minimum class complexity1.00
▷ Maximum class complexity209.00
Average method complexity4.24
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces14
Interfaces0
Traits0
Classes70
▷ Abstract classes68.57%
▷ Concrete classes6491.43%
▷ Final classes00.00%
Methods565
▷ Static methods40872.21%
▷ Public methods45580.53%
▷ Protected methods6311.15%
▷ Private methods478.32%
Functions34
▷ Named functions12.94%
▷ Anonymous functions3397.06%
Constants14
▷ Global constants428.57%
▷ Class constants1071.43%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/products/cap.png15.67KB5.12KB▼ 67.36%
assets/img/products/t-shirt.png18.66KB5.70KB▼ 69.44%
assets/img/start-create-campaign.png2.87KB1.91KB▼ 33.55%
assets/img/products/sunglasses.png12.45KB3.68KB▼ 70.47%
assets/img/logo.png2.41KB1.02KB▼ 57.63%