10% woocommerce-accepted-payment-methods

Code Review | WooCommerce Accepted Payment Methods

WordPress plugin WooCommerce Accepted Payment Methods scored10%from 54 tests.

About plugin

  • Plugin page: woocommerce-accep...
  • Plugin version: 0.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 19, 2012
  • Latest release: Dec 9, 2014
  • Number of updates: 40
  • Update frequency: every 18.8 days
  • Top authors: jameskoster (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

9,000+ active /163,318 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/woocommerce-accepted-payment-methods/accepted-payment-methods.php+186
    Methods with the same name as their class will not be constructors in a future version of PHP; Accepted_Payment_Methods has a deprecated constructor

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

A check of server-side resources used by WooCommerce Accepted Payment Methods
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.31 ▼3.80
Dashboard /wp-admin3.31 ▲0.0051.28 ▼2.73
Posts /wp-admin/edit.php3.36 ▲0.0050.69 ▼5.15
Add New Post /wp-admin/post-new.php5.89 ▲0.00100.51 ▼0.17
Media Library /wp-admin/upload.php3.23 ▲0.0039.99 ▲2.80

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Accepted Payment Methods
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.31 ▲0.082.11 ▲0.2741.60 ▼3.34
Dashboard /wp-admin2,195 ▲155.61 ▼0.0487.32 ▼0.3437.85 ▼0.53
Posts /wp-admin/edit.php2,097 ▼01.95 ▲0.0139.73 ▲5.2035.07 ▲2.80
Add New Post /wp-admin/post-new.php1,528 ▲223.48 ▼0.06598.67 ▼85.7853.22 ▼1.33
Media Library /wp-admin/upload.php1,400 ▲34.19 ▼0.0398.17 ▼11.5641.88 ▼5.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/woocommerce-accepted-payment-methods/accepted-payment-methods.php:20

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (The Accepted Payment Methods options), #2 (The widget)
You can take inspiration from this readme.txt

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

The principal PHP file in "WooCommerce Accepted Payment Methods" v. 0.7.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-accepted-payment-methods.php" instead of "accepted-payment-methods.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
There were no executable files found in this plugin738 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PO File5120226324
PHP13044170
LESS183126
CSS100115
Markdown1103

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
22 PNG files occupy 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png25.92KB7.92KB▼ 69.43%
assets/images/mastercard.png1.13KB1.16KB0.00%
assets/images/google@2x.png4.99KB2.46KB▼ 50.74%
assets/images/visa.png1.95KB1.47KB▼ 24.36%
assets/images/bitcoin.png1.96KB1.69KB▼ 13.73%