83% woocommerce-pay-for-payment

Code Review | Pay for Payment for WooCommerce

WordPress plugin Pay for Payment for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-pay-f...
  • Plugin version: 2.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.2.0
  • WordPress version: 6.3.1
  • First release: Jan 30, 2014
  • Latest release: Jul 24, 2023
  • Number of updates: 84
  • Update frequency: every 41.2 days
  • Top authors: vyskoczilova (67.86%)podpirate (33.33%)

Code review

54 tests

User reviews

64 reviews

Install metrics

20,000+ active /275,258 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Pay for Payment for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.58 ▼4.08
Dashboard /wp-admin3.31 ▲0.0146.59 ▲0.33
Posts /wp-admin/edit.php3.36 ▲0.0042.44 ▼4.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.17 ▼12.83
Media Library /wp-admin/upload.php3.23 ▲0.0035.69 ▲0.57

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Pay for Payment for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.14 ▼1.251.74 ▲0.0540.91 ▼2.71
Dashboard /wp-admin2,224 ▲364.84 ▼0.0598.32 ▼7.4139.82 ▼1.28
Posts /wp-admin/edit.php2,103 ▲141.99 ▲0.0134.85 ▼1.7837.09 ▲6.67
Add New Post /wp-admin/post-new.php1,548 ▲2923.10 ▼0.00628.15 ▼72.0552.22 ▼3.04
Media Library /wp-admin/upload.php1,403 ▲124.29 ▲0.1099.11 ▼0.9240.57 ▼3.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-pay-for-payment/woocommerce-payforpayment.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-pay-for-payment/inc/class-pay4pay-admin.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt might help

woocommerce-pay-for-payment/woocommerce-payforpayment.php 85% from 13 tests

The main file in "Pay for Payment for WooCommerce" v. 2.1.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.6" instead of "2.6")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-pay-for-payment.php" instead of "woocommerce-payforpayment.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,870 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PO File83724251,160
PHP8149190672
JavaScript13035
CSS1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity12.86
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods1642.11%
▷ Public methods3284.21%
▷ Protected methods00.00%
▷ Private methods615.79%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
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
There are no PNG files in this plugin