73% woocommerce-product-payments

Code Review | Payment gateway per Product for WooCommerce

WordPress plugin Payment gateway per Product for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 3.2.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 5, 2013
  • Latest release: Oct 3, 2023
  • Number of updates: 125
  • Update frequency: every 29.7 days
  • Top authors: dreamfox (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

500+ active /69,195 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.44MB] [CPU: ▲29.12ms] 75% from 4 tests

Server-side resources used by Payment gateway per Product for WooCommerce
Please fix the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.44MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.29 ▲5.8272.84 ▲30.60
Dashboard /wp-admin9.31 ▲6.0076.20 ▲23.91
Posts /wp-admin/edit.php9.31 ▲5.9586.27 ▲38.81
Add New Post /wp-admin/post-new.php9.86 ▲3.97126.98 ▲30.35
Media Library /wp-admin/upload.php9.31 ▲6.0867.44 ▲31.60
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius9.3159.19

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Payment gateway per Product for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲4514.34 ▲0.091.97 ▲0.0429.38 ▼16.26
Dashboard /wp-admin2,215 ▲385.63 ▲0.0395.00 ▲2.8339.30 ▼5.27
Posts /wp-admin/edit.php2,121 ▲211.97 ▼0.0540.77 ▲4.6539.25 ▲3.85
Add New Post /wp-admin/post-new.php1,531 ▼623.04 ▲4.66643.80 ▼5.1153.63 ▼13.32
Media Library /wp-admin/upload.php1,417 ▲174.18 ▼0.01100.11 ▼6.4347.01 ▲0.35
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0721.7023.6429.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/woocommerce-product-payments/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • widget_recent-posts
    • fs_debug_mode
    • fs_active_plugins
    • widget_theysaidso_widget
    • fs_accounts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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 fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/woocommerce-product-payments/inc/per_tags.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/woocommerce-product-payments/inc/per_categories.php:1

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 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention: The official readme.txt might help

woocommerce-product-payments/woocommerce-product-payments.php 85% from 13 tests

The entry point to "Payment gateway per Product for WooCommerce" version 3.2.9 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin44,449 lines of code in 212 files:
LanguageFilesBlank linesComment linesLines of code
PHP1218,07717,31634,000
JavaScript702,5848189,738
CSS17821578
PO File33066117
XML13016

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity93.38
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,259
▷ Static methods19815.73%
▷ Public methods86969.02%
▷ Protected methods171.35%
▷ Private methods37329.63%
Functions131
▷ Named functions131100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/pgpp1.png6.76KB6.76KB0.00%
img/pgpp2.png28.30KB11.43KB▼ 59.61%
img/close-icon.png1.09KB1.00KB▼ 7.55%
freemius/assets/img/dfm-payment-gateway-per-product-for-woocommerce.png3.12KB2.85KB▼ 8.43%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%