89% woocommerce-payment-methods

Code Review | WooCommerce Payment Methods

WordPress plugin WooCommerce Payment Methods scored 89% from 54 tests.

About plugin

  • Plugin page: woocommerce-payme...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 6.3.1
  • First release: Sep 12, 2014
  • Latest release: Apr 24, 2015
  • Number of updates: 43
  • Update frequency: every 5.2 days
  • Top authors: vendocrat (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active / 16,884 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.53ms] Passed 4 tests

Server-side resources used by WooCommerce Payment Methods
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0232.88 ▼1.96
Dashboard /wp-admin3.32 ▲0.0243.02 ▼4.09
Posts /wp-admin/edit.php3.43 ▲0.0845.22 ▼2.45
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.14 ▼21.60
Media Library /wp-admin/upload.php3.24 ▲0.0239.39 ▲4.94

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Payment Methods
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.21 ▼1.154.18 ▲2.5237.99 ▲0.29
Dashboard /wp-admin2,209 ▲234.87 ▼0.11106.93 ▼22.9940.01 ▼12.41
Posts /wp-admin/edit.php2,089 ▲142.05 ▲0.0039.42 ▼4.1834.31 ▼9.43
Add New Post /wp-admin/post-new.php1,534 ▲2023.29 ▲5.76648.09 ▲30.4851.00 ▲8.06
Media Library /wp-admin/upload.php1,385 ▼34.17 ▼0.0594.77 ▼0.9641.86 ▲0.94

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_vendocrat_payment_methods

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Shortcode output (top-down: default, inverse, outline style)), #2 (Widgets (top-down: default, inverse, outline style)), #3 (WooCommerce Checkout in action)
Please take inspiration from this readme.txt

woocommerce-payment-methods/woocommerce-payment-methods.php 92% from 13 tests

"WooCommerce Payment Methods" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 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 plugin1,253 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS43251411
PHP3109233411
PO File4105126299
SVG100105
Markdown119027

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity36.00
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 1.47MB with 0.77MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png40.64KB23.69KB▼ 41.72%
screenshot-2.png51.08KB29.43KB▼ 42.39%
screenshot-4.png1,381.50KB330.57KB▼ 76.07%
screenshot-3.png28.65KB14.45KB▼ 49.58%