74% ec-authorizenet

Code Review | EC Authorize.net

WordPress plugin EC Authorize.net scored74%from 54 tests.

About plugin

  • Plugin page: ec-authorizenet
  • Plugin version: 0.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Apr 13, 2014
  • Latest release: Feb 19, 2017
  • Number of updates: 34
  • Update frequency: every 30.6 days
  • Top authors: sftranna (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /6,057 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.42MB] [CPU: ▼4.61ms] Passed 4 tests

A check of server-side resources used by EC Authorize.net
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4139.73 ▼1.37
Dashboard /wp-admin3.73 ▲0.4348.08 ▼2.62
Posts /wp-admin/edit.php3.78 ▲0.4345.92 ▼0.65
Add New Post /wp-admin/post-new.php6.31 ▲0.4285.54 ▼13.80
Media Library /wp-admin/upload.php3.65 ▲0.4336.13 ▲2.29
EC Authorize.net /wp-admin/admin.php?page=ec-authorize-net3.5633.56
Recurring Subscription /wp-admin/admin.php?page=ec-subscriber-list3.5631.72

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

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

Browser metrics Passed 4 tests

EC Authorize.net: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.86 ▼0.498.77 ▲7.0842.53 ▲3.02
Dashboard /wp-admin2,216 ▲385.48 ▼0.1984.28 ▼18.7738.15 ▼2.73
Posts /wp-admin/edit.php2,124 ▲241.96 ▼0.0735.28 ▼0.9333.98 ▼4.55
Add New Post /wp-admin/post-new.php1,548 ▲2223.24 ▲0.02647.29 ▼21.2654.36 ▼19.18
Media Library /wp-admin/upload.php1,427 ▲274.19 ▲0.0093.09 ▼4.5643.34 ▼1.25
EC Authorize.net /wp-admin/admin.php?page=ec-authorize-net9372.0223.4025.68
Recurring Subscription /wp-admin/admin.php?page=ec-subscriber-list7952.0022.4326.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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 fix the following
  • 28× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(PHPUnit/Framework.php): failed to open stream: No such file or directory in wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/AuthorizeNet_Test_Config.php on line 43
    • > PHP Warning
      require_once(PHPUnit/Framework.php): failed to open stream: No such file or directory in wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/AuthorizeNet_Test_Config.php on line 43
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/share/php') in wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/AuthorizeNet_Test_Config.php on line 43
    • > PHP Warning
      require_once(PHPUnit/Framework.php): failed to open stream: No such file or directory in wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/AuthorizeNet_Test_Config.php on line 43
    • > PHP Fatal error
      Uncaught Error: Class 'AuthorizeNetRequest' not found in wp-content/plugins/ec-authorizenet/anet_php_sdk/lib/AuthorizeNetAIM.php:42
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/share/php') in wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/AuthorizeNet_Test_Config.php on line 43
    • > PHP Fatal error
      Uncaught Error: Class 'AuthorizeNetSIM_Form' not found in wp-content/plugins/ec-authorizenet/anet_php_sdk/lib/AuthorizeNetDPM.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/ec-authorizenet/anet_php_sdk/lib/AuthorizeNetSOAP.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/share/php') in wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/AuthorizeNet_Test_Config.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ec-authorizenet/index.php:53

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
The official readme.txt might help

ec-authorizenet/index.php 92% from 13 tests

Analyzing the main PHP file in "EC Authorize.net" version 0.3.3
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("ec-authorizenet.php" instead of "index.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/ec-authorizenet/anet_php_sdk/tests/domain.crt
4,127 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP245941,2213,268
Markdown81930501
HTML2270332
JavaScript13526

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity6.03
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes12.63%
▷ Concrete classes3797.37%
▷ Final classes00.00%
Methods194
▷ Static methods52.58%
▷ Public methods17288.66%
▷ Protected methods189.28%
▷ Private methods42.06%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants830.77%
▷ Class constants1869.23%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/payment-card-icon-.png10.12KB5.56KB▼ 45.07%
images/payment-card-icon.png6.70KB4.71KB▼ 29.76%