94% 2cpay

Code Review | 2CPay

WordPress plugin 2CPay scored 94% from 54 tests.

About plugin

  • Plugin page: 2cpay
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.4.2
  • WordPress version: 5.9.2
  • First release: Mar 19, 2016
  • Latest release: Mar 28, 2016
  • Number of updates: 7
  • Update frequency: every 1.4 days
  • Top authors: zonalhost (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 885 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼291.12ms] Passed 4 tests

Server-side resources used by 2CPay
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0256.34 ▲5.42
Dashboard /wp-admin3.42 ▲0.0134.33 ▲0.29
Posts /wp-admin/edit.php3.65 ▲0.0139.49 ▲2.20
Add New Post /wp-admin/post-new.php6.89 ▼0.0898.26 ▼1,168.10
Media Library /wp-admin/upload.php3.30 ▲0.0127.64 ▲1.14

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for 2CPay
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4116.20 ▲0.205.67 ▼0.012.68 ▲0.37
Dashboard /wp-admin2,888 ▲306.26 ▲0.11126.07 ▼3.03168.34 ▲5.88
Posts /wp-admin/edit.php2,691 ▼03.24 ▲0.0164.55 ▼0.20142.60 ▼1.95
Add New Post /wp-admin/post-new.php1,716 ▲521.91 ▲0.36464.67 ▲1.62162.58 ▲4.89
Media Library /wp-admin/upload.php1,698 ▼05.46 ▼0.06155.72 ▲11.93191.80 ▲5.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/2cpay/2cpay.php
    • > /wp-content/plugins/2cpay/includes/gateway.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (2CPay plugins page.), #2 (Settings in Woocommerce.)
You can look at the official readme.txt

2cpay/2cpay.php Passed 13 tests

The primary PHP file in "2CPay" version 1.3 is used by WordPress to initiate all plugin functionality
49 characters long description:
2Checkout Payment Gateway Plugin for Woocommerce.

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
There were no executable files found in this plugin197 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions4100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png43.98KB16.45KB▼ 62.59%
screenshot-2.png35.78KB19.65KB▼ 45.08%