83% wc-confirm-payment

Code Review | WooCommerce Confirm Payment

WordPress plugin WooCommerce Confirm Payment scored 83% from 54 tests.

About plugin

  • Plugin page: wc-confirm-payment
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Feb 18, 2019
  • Latest release: Oct 1, 2020
  • Number of updates: 12
  • Update frequency: every 49.3 days
  • Top authors: surakrai (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

3,000+ active / 18,845 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼2.73ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Confirm Payment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1338.15 ▼1.08
Dashboard /wp-admin3.44 ▲0.1452.82 ▲1.43
Posts /wp-admin/edit.php3.56 ▲0.2149.77 ▲4.65
Add New Post /wp-admin/post-new.php6.03 ▲0.1482.48 ▼13.88
Media Library /wp-admin/upload.php3.34 ▲0.1236.03 ▲2.63
Confirm payment /wp-admin/edit.php?post_type=wcp_confirm_payment3.4239.07
Setting /wp-admin/edit.php?post_type=wcp_confirm_payment&page=wcp-setting-admin3.4035.92

Server storage [IO: ▲0.24MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
wcp_option
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Confirm Payment
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,092 ▲35715.58 ▲1.206.81 ▲5.2042.18 ▼0.03
Dashboard /wp-admin2,371 ▲1826.45 ▲1.58122.44 ▲12.0042.28 ▲0.08
Posts /wp-admin/edit.php2,277 ▲1883.33 ▲1.2752.84 ▲19.2136.83 ▲0.23
Add New Post /wp-admin/post-new.php1,548 ▲1523.27 ▼0.04667.43 ▼1.7741.71 ▼17.19
Media Library /wp-admin/upload.php1,416 ▲284.07 ▼0.1484.25 ▼11.5741.98 ▲0.81
Confirm payment /wp-admin/edit.php?post_type=wcp_confirm_payment1,2863.3253.8330.26
Setting /wp-admin/edit.php?post_type=wcp_confirm_payment&page=wcp-setting-admin1,1293.1141.5826.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • wcp_option
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

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 everything seems fine, this is not 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 fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/wc-confirm-payment/public/partials/woocommerce-confirm-payment-confirm-form.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-confirm-payment/admin/partials/woocommerce-confirm-payment-admin-account-details-field.php:22
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wc-confirm-payment/public/partials/woocommerce-confirm-payment-bank-details.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-confirm-payment/public/partials/woocommerce-confirm-payment-history.php:19

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 90% 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: line notify, confirm payment

wc-confirm-payment/woocommerce-confirm-payment.php 77% from 13 tests

The entry point to "WooCommerce Confirm Payment" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-confirm-payment.php" instead of "woocommerce-confirm-payment.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0.1" instead of "3.0.0")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin3,848 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP266401,0551,747
JavaScript33532941,112
PO File2216330495
CSS278494

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.28
Average class complexity10.85
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods102
▷ Static methods21.96%
▷ Public methods9492.16%
▷ Protected methods00.00%
▷ Private methods87.84%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin