84% cross-upsell-popup-for-woocommerce

Code Review | Cross/Upsell Popup for WooCommerce

WordPress plugin Cross/Upsell Popup for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: cross-upsell-popu...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0.2
  • WordPress version: 6.3.1
  • First release: Sep 13, 2022
  • Latest release: Sep 13, 2022
  • Number of updates: 12
  • Update frequency: N/A
  • Top authors: yourwcninja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /204 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼13.52ms] Passed 4 tests

A check of server-side resources used by Cross/Upsell Popup for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0843.45 ▲1.17
Dashboard /wp-admin3.37 ▲0.0342.19 ▼20.74
Posts /wp-admin/edit.php3.49 ▲0.1344.22 ▲1.17
Add New Post /wp-admin/post-new.php5.95 ▲0.0775.58 ▼30.76
Media Library /wp-admin/upload.php3.30 ▲0.0732.94 ▼3.73

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Cross/Upsell Popup for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲15313.55 ▼0.837.17 ▲5.2542.51 ▲0.94
Dashboard /wp-admin2,229 ▲385.87 ▲0.99113.61 ▲7.1343.65 ▼1.14
Posts /wp-admin/edit.php2,114 ▲252.01 ▲0.0140.78 ▼0.2836.65 ▼2.73
Add New Post /wp-admin/post-new.php1,533 ▲1417.59 ▼5.47689.44 ▲62.4752.56 ▼0.59
Media Library /wp-admin/upload.php1,411 ▲204.23 ▲0.0698.87 ▼6.4141.07 ▼3.07

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/admin.php on line 2
    • > PHP Notice
      Undefined variable: errors in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/admin.php on line 2
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/admin.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/admin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/theme.php:19
    • > PHP Notice
      Undefined variable: crossSellDescription in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/theme.php on line 10
    • > PHP Notice
      Undefined variable: crossSellTitle in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/theme.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cross-upsell-popup-for-woocommerce/views/wc-not-activated.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 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
6 plugin tags: conversion, cross-sell, woocommerce upsell, order bump, woocommerce cross-sell...

cross-upsell-popup-for-woocommerce/cross-upsell-popup-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Cross/Upsell Popup for WooCommerce" version 1.0.0
131 characters long description:
A simple plugin to boost your sales with WooCommerce Upsell and Cross-Sell offers upon purchase of particular products on any page.

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 plugin1,526 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS23211471,208
PHP43757303
JavaScript12815

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods16
▷ Static methods212.50%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin