84% first-data-payment-gateway-for-woocommerce

Code Review | First Data for WooCommerce

WordPress plugin First Data for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: first-data-paymen...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7.4
  • WordPress version: 6.3.1
  • First release: Nov 21, 2015
  • Latest release: Apr 24, 2017
  • Number of updates: 8
  • Update frequency: every 65.0 days
  • Top authors: offshorent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,227 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by First Data for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.45 ▼8.40
Dashboard /wp-admin3.31 ▼0.0448.34 ▼14.28
Posts /wp-admin/edit.php3.36 ▲0.0044.77 ▼5.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.60 ▼23.37
Media Library /wp-admin/upload.php3.23 ▲0.0038.05 ▼1.36

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

First Data for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.221.58 ▼0.1141.18 ▼1.74
Dashboard /wp-admin2,195 ▲155.62 ▲0.0284.80 ▼9.3543.84 ▲0.32
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0336.33 ▲0.3334.11 ▼3.58
Add New Post /wp-admin/post-new.php1,526 ▼223.03 ▼0.30657.46 ▲48.4868.93 ▲9.18
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.01105.76 ▼2.0550.37 ▲2.36

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • 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 | 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
Please fix 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/first-data-payment-gateway-for-woocommerce/os-woocommerce-firstdata.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues 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
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (First Data admin settings 1.), #2 (First Data admin settings 2.), #3 (Screenshot from checkout page)
You can look at the official readme.txt

first-data-payment-gateway-for-woocommerce/os-woocommerce-firstdata.php 92% from 13 tests

The main file in "First Data for WooCommerce" v. 1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("first-data-payment-gateway-for-woocommerce.php" instead of "os-woocommerce-firstdata.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin361 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP213271361

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
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%