84% 2cpay

Code Review | 2CPay

WordPress plugin 2CPay scored84%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: 6.3.1
  • 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 /1,140 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by 2CPay
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.01 ▼3.68
Dashboard /wp-admin3.31 ▲0.0146.88 ▼3.17
Posts /wp-admin/edit.php3.36 ▲0.0045.54 ▲0.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.16 ▲2.72
Media Library /wp-admin/upload.php3.23 ▲0.0036.15 ▲3.66

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for 2CPay
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.32 ▼1.061.61 ▼0.2539.99 ▼14.08
Dashboard /wp-admin2,206 ▲186.04 ▲1.19109.43 ▼6.6543.87 ▲5.62
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0834.85 ▼6.2632.92 ▼3.05
Add New Post /wp-admin/post-new.php1,537 ▼323.17 ▲0.06643.79 ▲30.3287.26 ▲38.03
Media Library /wp-admin/upload.php1,391 ▲34.17 ▼0.03117.74 ▲12.9745.20 ▲1.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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/2cpay/includes/gateway.php
    • > /wp-content/plugins/2cpay/2cpay.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% 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
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (2CPay plugins page.), #2 (Settings in Woocommerce.)
You can look at the official readme.txt

2cpay/2cpay.php Passed 13 tests

The main PHP file in "2CPay" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
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 not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin197 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21125197

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
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
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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%