84% snap-finance-checkout

Code Review | Snap Finance

WordPress plugin Snap Finance scored84%from 54 tests.

About plugin

  • Plugin page: snap-finance-chec...
  • Plugin version: 2.1.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Dec 31, 2019
  • Latest release: Oct 27, 2023
  • Number of updates: 97
  • Update frequency: every 14.5 days
  • Top authors: snapfinance (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /3,754 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.61ms] Passed 4 tests

Analyzing server-side resources used by Snap Finance
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.03 ▲0.49
Dashboard /wp-admin3.31 ▲0.0046.11 ▲2.90
Posts /wp-admin/edit.php3.36 ▲0.0044.40 ▼0.12
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.44 ▼13.87
Media Library /wp-admin/upload.php3.23 ▲0.0033.05 ▼0.93

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Snap Finance
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.151.81 ▲0.2844.79 ▲4.50
Dashboard /wp-admin2,192 ▲175.53 ▼0.1483.39 ▼16.2436.82 ▼6.03
Posts /wp-admin/edit.php2,097 ▼61.99 ▲0.0335.33 ▼4.4532.84 ▼3.54
Add New Post /wp-admin/post-new.php1,535 ▲918.11 ▼5.03592.95 ▼46.1271.82 ▲23.11
Media Library /wp-admin/upload.php1,400 ▼04.14 ▼0.0396.34 ▲3.0844.34 ▲0.85

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/snap-finance-checkout/snap-finance-functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/snap-finance-checkout/snap-finance-wc-order.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/snap-finance-checkout/snap-finance-payment-class.php:3

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 88% 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
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #6, #7 in snap-finance-checkout/assets to your readme.txt
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Enable plugin from payment tabs in woocomerce.), #2 (Plugin settings to enter client id, client secret key and settings to change button design.)
You can take inspiration from this readme.txt

snap-finance-checkout/snap-finance-checkout.php Passed 13 tests

This is the main PHP file of "Snap Finance" version 2.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
88 characters long description:
Credit-challenged? Snap approves $150 up to $5,000 in accessible lease-to-own financing.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,773 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP71871671,145
JavaScript43615341
Markdown1470137
CSS101124
XML14215
JSON10011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity5.43
▷ Minimum method complexity2.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants19100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png7.41KB2.45KB▼ 66.90%