84% wc-payphone-gateway

Code Review | WooCommerce - Payphone Gateway

WordPress plugin WooCommerce - Payphone Gateway scored84%from 54 tests.

About plugin

  • Plugin page: wc-payphone-gateway
  • Plugin version: 3.1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2018
  • Latest release: Mar 13, 2023
  • Number of updates: 29
  • Update frequency: every 63.3 days
  • Top authors: payphone (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /12,657 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.01MB] [CPU: ▼7.71ms] Passed 4 tests

An overview of server-side resources used by WooCommerce - Payphone Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.40 ▼2.55
Dashboard /wp-admin3.31 ▼0.0445.71 ▼15.49
Posts /wp-admin/edit.php3.36 ▲0.0048.29 ▲1.90
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.61 ▼13.13
Media Library /wp-admin/upload.php3.23 ▲0.0036.82 ▲0.32

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 39 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
wc_gateway_payphone_bootstrap_warning_message
widget_recent-posts
widget_theysaidso_widget
wc_payphone_version
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce - Payphone Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.34 ▼0.931.96 ▲0.3044.30 ▲7.31
Dashboard /wp-admin2,209 ▲204.86 ▼0.1297.05 ▼15.2239.54 ▼9.29
Posts /wp-admin/edit.php2,086 ▼32.01 ▲0.0340.22 ▲4.0733.74 ▲0.72
Add New Post /wp-admin/post-new.php1,536 ▲1723.23 ▲0.16596.74 ▼74.9051.52 ▼2.16
Media Library /wp-admin/upload.php1,391 ▲64.22 ▲0.0396.07 ▼8.3642.12 ▼2.11

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 detected upon uninstall: 8 options
    • wc_gateway_payphone_bootstrap_warning_message
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • wc_payphone_version

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_gateway_payphone() in wp-content/plugins/wc-payphone-gateway/includes/wc-gateway-payphone-response.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_gateway_payphone() in wp-content/plugins/wc-payphone-gateway/includes/wc-gateway-payphone.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_gateway_payphone() in wp-content/plugins/wc-payphone-gateway/includes/wc-gateway-payphone-process.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: woocommerce, gateway payment

wc-payphone-gateway/woocommerce-gateway-payphone.php 92% from 13 tests

Analyzing the main PHP file in "WooCommerce - Payphone Gateway" version 3.1.0
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-payphone-gateway.php" instead of "woocommerce-gateway-payphone.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin2,294 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PO File79941,8901,145
PHP112564041,085
CSS14935
Markdown116029

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity15.11
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods5681.16%
▷ Protected methods45.80%
▷ Private methods913.04%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.png14.50KB4.15KB▼ 71.41%
assets/img/logo-woocommerce.png3.05KB2.25KB▼ 26.16%