83% takepayments-ipp-payment-gateway

Code Review | Takepayments Mercury Payment Gateway

WordPress plugin Takepayments Mercury Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: takepayments-ipp-...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.3
  • WordPress version: 6.3.1
  • First release: Jul 10, 2023
  • Latest release: Oct 9, 2023
  • Number of updates: 15
  • Update frequency: every 12.9 days
  • Top authors: takepayments (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /192 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Takepayments Mercury Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.84 ▼8.02
Dashboard /wp-admin3.31 ▲0.0147.07 ▼3.78
Posts /wp-admin/edit.php3.37 ▲0.0147.41 ▼6.13
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.26 ▼8.00
Media Library /wp-admin/upload.php3.24 ▲0.0138.52 ▲0.96

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Takepayments Mercury Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.38 ▼0.261.71 ▼0.1146.24 ▲1.94
Dashboard /wp-admin2,201 ▲215.62 ▼0.1487.35 ▼1.8443.34 ▼0.95
Posts /wp-admin/edit.php2,103 ▼02.06 ▲0.0140.78 ▼2.5638.66 ▲2.66
Add New Post /wp-admin/post-new.php1,561 ▲3523.15 ▲5.49602.22 ▼108.9650.84 ▼4.04
Media Library /wp-admin/upload.php1,403 ▲64.23 ▲0.02101.54 ▼14.0943.29 ▼6.72

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/takepayments-ipp-payment-gateway/classes/class-payment-block.php:9

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 90% 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
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Appearance of Takepayments Mercury gateway.), #2 (Takepayments Logo)
Please take inspiration from this readme.txt

takepayments-ipp-payment-gateway/takepayments-mercury-init.php 85% from 13 tests

The entry point to "Takepayments Mercury Payment Gateway" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("takepayments-ipp-payment-gateway.php" instead of "takepayments-mercury-init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected2,680 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP111052082,294
CSS22525231
SVG200112
JavaScript20043

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.67
▷ Minimum class complexity3.00
▷ Maximum class complexity31.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods37
▷ Static methods12.70%
▷ Public methods3081.08%
▷ Protected methods718.92%
▷ Private methods00.00%
Functions13
▷ Named functions646.15%
▷ Anonymous functions753.85%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.19MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/tp_logo.png3.57KB2.23KB▼ 37.66%
public/images/TP_Card_Logos_[Horiz]_AMEX_Full_Colour.png29.14KB15.45KB▼ 46.97%
assets/Screenshot-2.png17.65KB7.04KB▼ 60.12%
assets/Screenshot-1.png43.08KB16.36KB▼ 62.02%
public/images/icon-128x128.png3.95KB2.32KB▼ 41.38%