67% bs-authorize-net

Code Review | BS Authorize.net

WordPress plugin BS Authorize.net scored 67% from 54 tests.

About plugin

  • Plugin page: bs-authorize-net
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.2
  • WordPress version: 6.3.1
  • First release: Sep 24, 2019
  • Latest release: Sep 24, 2019
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: Bipinsingh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 697 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by BS Authorize.net
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.70 ▼6.87
Dashboard /wp-admin3.32 ▲0.0248.18 ▼0.59
Posts /wp-admin/edit.php3.37 ▲0.0149.98 ▲2.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.58 ▼8.46
Media Library /wp-admin/upload.php3.24 ▲0.0135.55 ▲0.04

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

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

Browser metrics Passed 4 tests

BS Authorize.net: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲9813.64 ▼0.944.44 ▲2.8238.58 ▼5.14
Dashboard /wp-admin2,214 ▲265.94 ▲0.9296.01 ▼25.1541.07 ▼1.57
Posts /wp-admin/edit.php2,099 ▲132.05 ▼0.0039.26 ▲2.1636.92 ▲3.73
Add New Post /wp-admin/post-new.php1,550 ▲1718.41 ▼4.82597.86 ▼78.6352.13 ▼0.15
Media Library /wp-admin/upload.php1,396 ▲54.31 ▲0.1698.10 ▼2.5145.65 ▼2.04

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

Smoke tests 50% 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 0% 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
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bs-authorize-net/views/credits.php
    • > /wp-content/plugins/bs-authorize-net/includes/class-bs-anet-wc-form-validator.php
    • > /wp-content/plugins/bs-authorize-net/bs-authorizenet.php
  • 188× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\controller\\base\\ApiOperationBase' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetHostedPaymentPageController.php:7
    • > PHP Warning
      Use of undefined constant BS_ANET_WC_BASEURL - assumed 'BS_ANET_WC_BASEURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/bs-authorize-net/includes/constants.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\controller\\base\\ApiOperationBase' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateCustomerPaymentProfileController.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiRequestType' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerProfileIdsRequest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiRequestType' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SecurePaymentContainerRequest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ProfileTransOrderType' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransCaptureOnlyType.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\controller\\base\\ApiOperationBase' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetSettledBatchListController.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\controller\\base\\ApiOperationBase' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetBatchStatisticsController.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiResponseType' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerProfileResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'net\\authorize\\api\\contract\\v1\\ANetApiRequestType' not found in wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuthenticateTestRequest.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 80% 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: These screenshots require images: #8 (Unsettled transactions), #9 (Transaction management), #10 (Void transaction), #11 (FDS transaction), #12 (FDS Transaction management), #13 (Merchant info), #14 (Advanced settings), #15 (Order management), #16 (Order transaction)
The official readme.txt might help

bs-authorize-net/bs-authorizenet.php 62% from 13 tests

"BS Authorize.net" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: Please keep the plugin description shorter than 140 characters (currently 321 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "2.6")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bs-authorize-net.php" instead of "bs-authorizenet.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/bs-authorize-net/library/vendor/authorizenet/authorizenet/tests/domain.crt
48,635 lines of code in 614 files:
LanguageFilesBlank linesComment linesLines of code
PHP3265,33315,28630,363
YAML219998,689
XSD1428643,848
JavaScript136121992,521
CSS12389461,878
Markdown122320828
Bourne Shell85251208
JSON510125
SVG130093
Perl3123544
XML19337
HTML1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.99
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces19
Interfaces1
Traits0
Classes302
▷ Abstract classes10.33%
▷ Concrete classes30199.67%
▷ Final classes00.00%
Methods2,441
▷ Static methods481.97%
▷ Public methods2,35396.39%
▷ Protected methods632.58%
▷ Private methods251.02%
Functions195
▷ Named functions199.74%
▷ Anonymous functions17690.26%
Constants28
▷ Global constants2382.14%
▷ Class constants517.86%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin