84% wc-first-data-payment-gateway

Code Review | WC First Data Payment Gateway

WordPress plugin WC First Data Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: wc-first-data-pay...
  • Plugin version: 1.3
  • 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 /776 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by WC First Data Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0643.00 ▲0.29
Dashboard /wp-admin3.37 ▲0.0750.47 ▼0.39
Posts /wp-admin/edit.php3.42 ▲0.0654.02 ▲6.06
Add New Post /wp-admin/post-new.php5.95 ▲0.0691.40 ▼7.04
Media Library /wp-admin/upload.php3.29 ▲0.0642.54 ▲8.56

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

WC First Data Payment Gateway: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.26 ▼1.392.27 ▲0.5242.60 ▼2.88
Dashboard /wp-admin2,209 ▲244.88 ▼0.96113.36 ▲5.0241.77 ▲2.90
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0142.18 ▼5.2735.38 ▼3.32
Add New Post /wp-admin/post-new.php1,533 ▲1923.53 ▲5.80664.19 ▼0.3754.29 ▲2.51
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.06107.54 ▼1.1045.73 ▲3.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 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-first-data-payment-gateway/wc-first-data-payment-gateway.php:12

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 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (First Data admin settings 1.), #2 (First Data admin settings 2.), #3 (Screenshot from checkout page)
The official readme.txt might help

wc-first-data-payment-gateway/wc-first-data-payment-gateway.php Passed 13 tests

The main PHP file in "WC First Data Payment Gateway" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
103 characters long description:
WC First Data Payment Gateway addon adds a payment option for customers to pay with their Credit Cards.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin361 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212363361

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity20.00
▷ Minimum class complexity10.00
▷ Maximum class complexity30.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1266.67%
▷ Protected methods00.00%
▷ Private methods633.33%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.11MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png32.13KB11.61KB▼ 63.86%
screenshot-3.png34.19KB10.04KB▼ 70.63%
images/first_data.png10.13KB2.63KB▼ 74.08%
screenshot-1.png38.07KB15.34KB▼ 59.71%