84% woo-d2i

Code Review | WooCommerce D2I

WordPress plugin WooCommerce D2I scored84%from 54 tests.

About plugin

  • Plugin page: woo-d2i
  • Plugin version: 1.3101
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.6.2
  • WordPress version: 6.3.1
  • First release: Mar 2, 2018
  • Latest release: Mar 5, 2021
  • Number of updates: 11
  • Update frequency: every 99.9 days
  • Top authors: rolfsd2i (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /643 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.81ms] Passed 4 tests

A check of server-side resources used by WooCommerce D2I
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.54 ▼2.64
Dashboard /wp-admin3.39 ▲0.0950.62 ▼3.75
Posts /wp-admin/edit.php3.50 ▲0.1551.63 ▲1.12
Add New Post /wp-admin/post-new.php5.97 ▲0.0985.19 ▼21.79
Media Library /wp-admin/upload.php3.31 ▲0.0932.91 ▼3.04

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

WooCommerce D2I: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.25 ▼1.121.76 ▼0.0343.22 ▼1.74
Dashboard /wp-admin2,206 ▲184.84 ▼0.09101.27 ▼1.7443.22 ▼4.03
Posts /wp-admin/edit.php2,089 ▼31.99 ▲0.0234.05 ▼3.6537.82 ▲3.23
Add New Post /wp-admin/post-new.php1,514 ▼1417.68 ▼0.65686.00 ▲51.4256.19 ▲2.62
Media Library /wp-admin/upload.php1,391 ▲34.16 ▼0.0795.74 ▼14.5643.19 ▼1.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-d2i/woocommerce-d2i-payment-gateway.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: woocommerce, d2i

woo-d2i/woocommerce-d2i-payment-gateway.php 92% from 13 tests

The principal PHP file in "WooCommerce D2I" v. 1.3101 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-d2i.php" instead of "woocommerce-d2i-payment-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin533 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP115499533

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity23.00
▷ Minimum class complexity2.00
▷ Maximum class complexity44.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
d2i-logo.png13.75KB4.81KB▼ 65.05%