78% woocommerce-2checkout-payment

Code Review | 2Checkout Payment Gateway for WooCommerce

WordPress plugin 2Checkout Payment Gateway for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-2chec...
  • Plugin version: 6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 13, 2014
  • Latest release: Jan 23, 2023
  • Number of updates: 61
  • Update frequency: every 50.1 days
  • Top authors: nmedia (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active /78,753 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.75ms] Passed 4 tests

A check of server-side resources used by 2Checkout Payment Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1136.95 ▼6.76
Dashboard /wp-admin3.42 ▲0.1247.52 ▼4.71
Posts /wp-admin/edit.php3.53 ▲0.1847.50 ▲3.13
Add New Post /wp-admin/post-new.php6.00 ▲0.1187.50 ▼0.64
Media Library /wp-admin/upload.php3.34 ▲0.1133.97 ▲1.11

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

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

Browser metrics Passed 4 tests

A check of browser resources used by 2Checkout Payment Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.64 ▼0.664.26 ▲2.5540.73 ▼3.03
Dashboard /wp-admin2,203 ▲125.81 ▲0.7795.51 ▼7.8738.89 ▼5.77
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0137.22 ▼2.0533.81 ▼0.97
Add New Post /wp-admin/post-new.php1,533 ▲1923.20 ▲5.68659.11 ▼41.6949.77 ▼9.12
Media Library /wp-admin/upload.php1,385 ▼64.19 ▲0.0095.89 ▼5.0241.18 ▼3.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woocommerce-2checkout-payment/inc/functions.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/woocommerce-2checkout-payment/woocommerce-2checkout-payment.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention: The official readme.txt is a good inspiration

woocommerce-2checkout-payment/woocommerce-2checkout-payment.php 92% from 13 tests

The principal PHP file in "2Checkout Payment Gateway for WooCommerce" v. 6.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.5" instead of "3.0.0")

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
There were no executable files found in this plugin548 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP319296527
CSS23021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
7 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/down_32.png4.15KB1.42KB▼ 65.73%
images/delete_32.png4.37KB1.43KB▼ 67.31%
images/2co_logo.png7.22KB3.04KB▼ 57.95%
images/logo.png1.88KB1.02KB▼ 45.84%
images/delete_16.png3.30KB0.54KB▼ 83.61%