84% tcp-credit-term-payment-gateway

Code Review | Credit Term Payment Gateway for Woocommerce by TheCartPress

WordPress plugin Credit Term Payment Gateway for Woocommerce by TheCartPress scored84%from 54 tests.

About plugin

  • Plugin page: tcp-credit-term-p...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7.1
  • WordPress version: 6.3.1
  • First release: May 10, 2021
  • Latest release: May 10, 2021
  • Number of updates: 2
  • Update frequency: every 5.0 days
  • Top authors: tcpteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.48ms] Passed 4 tests

Server-side resources used by Credit Term Payment Gateway for Woocommerce by TheCartPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0651.92 ▼1.77
Dashboard /wp-admin3.37 ▲0.0762.33 ▲1.82
Posts /wp-admin/edit.php3.49 ▲0.1358.73 ▼7.00
Add New Post /wp-admin/post-new.php5.96 ▲0.0695.93 ▼14.95
Media Library /wp-admin/upload.php3.30 ▲0.0645.63 ▲2.91

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Credit Term Payment Gateway for Woocommerce by TheCartPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.29 ▲0.102.17 ▲0.0644.65 ▲1.97
Dashboard /wp-admin2,195 ▲155.55 ▼0.1192.05 ▲0.0439.18 ▼5.22
Posts /wp-admin/edit.php2,100 ▼32.04 ▲0.0936.27 ▼9.8336.92 ▲3.07
Add New Post /wp-admin/post-new.php1,526 ▼022.95 ▼0.19659.48 ▼60.5557.81 ▲4.55
Media Library /wp-admin/upload.php1,394 ▼64.38 ▲0.31101.01 ▼11.7543.57 ▼5.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tcp-credit-term-payment-gateway/tcp-menu.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
You can look at the official readme.txt

tcp-credit-term-payment-gateway/tcp-wc-credit-term-gateway.php 92% from 13 tests

The main PHP file in "Credit Term Payment Gateway for Woocommerce by TheCartPress" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("tcp-credit-term-payment-gateway.php" instead of "tcp-wc-credit-term-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin1,239 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6155871,191
CSS16033
SVG10115

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity29.00
▷ Minimum class complexity17.00
▷ Maximum class complexity74.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods59
▷ Static methods00.00%
▷ Public methods59100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin