84% dpo-group-for-woocommerce

Code Review | DPO Pay for WooCommerce

WordPress plugin DPO Pay for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: dpo-group-for-woo...
  • Plugin version: 1.1.3
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Feb 2, 2022
  • Latest release: Apr 26, 2023
  • Number of updates: 11
  • Update frequency: every 41.5 days
  • Top authors: appinlet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /4,068 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
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by DPO Pay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.50 ▼10.04
Dashboard /wp-admin3.31 ▲0.0057.32 ▲4.68
Posts /wp-admin/edit.php3.36 ▲0.0052.32 ▲3.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.39 ▲1.70
Media Library /wp-admin/upload.php3.23 ▲0.0039.64 ▲1.94

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for DPO Pay for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.021.76 ▲0.0446.92 ▲2.13
Dashboard /wp-admin2,192 ▲125.61 ▼0.0691.55 ▼0.9641.78 ▼2.33
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0542.18 ▲4.9037.08 ▲1.28
Add New Post /wp-admin/post-new.php1,526 ▼023.02 ▲2.00668.04 ▼1.7157.70 ▼1.97
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.13111.30 ▼5.3147.05 ▼0.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/dpo-group-for-woocommerce/gateway-direct-pay-online.php on line 23
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/dpo-group-for-woocommerce/gateway-direct-pay-online.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WCGatewayDPO' not found in wp-content/plugins/dpo-group-for-woocommerce/classes/WCGatewayDpoCron.php:10
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dpo-group-for-woocommerce/gateway-direct-pay-online.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/dpo-group-for-woocommerce/includes/blocks/class-wc-dpo-payments-blocks.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can look at the official readme.txt

dpo-group-for-woocommerce/gateway-direct-pay-online.php 92% from 13 tests

This is the main PHP file of "DPO Pay for WooCommerce" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dpo-group-for-woocommerce.php" instead of "gateway-direct-pay-online.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
Good job! No executable or dangerous file extensions detected1,200 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP51812451,190
JavaScript2009
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity25.25
▷ Minimum class complexity3.00
▷ Maximum class complexity77.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods37
▷ Static methods1540.54%
▷ Public methods3594.59%
▷ Protected methods25.41%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants12
▷ Global constants00.00%
▷ Class constants12100.00%
▷ Public constants1191.67%

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
12 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/dpo-visa.png3.79KB3.63KB▼ 4.20%
assets/images/dpo-airtelmoney.png6.47KB6.22KB▼ 3.89%
assets/images/dpo-unionpay.png9.68KB9.73KB0.00%
assets/images/dpo-mtnmobilemoney.png5.89KB5.92KB0.00%
assets/images/dpo-amex.png6.48KB6.46KB0.21%