84% wc-authorize-net-payment-gateway

Code Review | WC Authorize.net Payment Gateway

WordPress plugin WC Authorize.net Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: wc-authorize-net-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 21, 2017
  • Latest release: Apr 21, 2017
  • Number of updates: 2
  • Update frequency: every 3.5 days
  • Top authors: virtinapro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /728 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
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.83ms] Passed 4 tests

Server-side resources used by WC Authorize.net Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.94 ▲6.58
Dashboard /wp-admin3.37 ▲0.0748.60 ▼3.98
Posts /wp-admin/edit.php3.49 ▲0.1354.64 ▲4.60
Add New Post /wp-admin/post-new.php5.96 ▲0.0786.96 ▼14.32
Media Library /wp-admin/upload.php3.30 ▲0.0740.53 ▲6.37

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, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WC Authorize.net Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.59 ▼1.081.93 ▲0.0644.88 ▲3.37
Dashboard /wp-admin2,221 ▲184.87 ▼0.01100.87 ▼15.7441.30 ▼5.14
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0441.03 ▲4.7935.35 ▲0.15
Add New Post /wp-admin/post-new.php1,526 ▼517.44 ▼5.67723.67 ▲50.9158.54 ▲5.63
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.0599.80 ▼1.2648.24 ▲3.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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)
Everything seems fine, however 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-authorize-net-payment-gateway/wc-authorizenet-aim-payment-gateway.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (First Data admin settings 1.), #2 (First Data admin settings 2.), #3 (Screenshot from checkout page)
The official readme.txt might help

wc-authorize-net-payment-gateway/wc-authorizenet-aim-payment-gateway.php 92% from 13 tests

This is the main PHP file of "WC Authorize.net Payment Gateway" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-authorize-net-payment-gateway.php" instead of "wc-authorizenet-aim-payment-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected278 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19659278

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1168.75%
▷ Protected methods00.00%
▷ Private methods531.25%
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

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png34.95KB11.25KB▼ 67.81%
screenshot-1.png34.94KB13.56KB▼ 61.20%