84% snapplify-payment-gateway

Code Review | Snapplify Payment Gateway

WordPress plugin Snapplify Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: snapplify-payment...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Nov 3, 2022
  • Latest release: Aug 18, 2023
  • Number of updates: 13
  • Update frequency: every 22.3 days
  • Top authors: snapplify (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /244 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼17.09ms] Passed 4 tests

An overview of server-side resources used by Snapplify Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.52 ▼2.15
Dashboard /wp-admin3.21 ▼0.1040.64 ▼9.51
Posts /wp-admin/edit.php3.27 ▼0.0837.71 ▼19.78
Add New Post /wp-admin/post-new.php5.45 ▼0.4475.16 ▼36.91
Media Library /wp-admin/upload.php3.21 ▼0.0234.22 ▼1.05

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Snapplify Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,457 ▼1,32911.87 ▼2.492.01 ▼0.0342.78 ▼4.50
Dashboard /wp-admin850 ▼1,3271.38 ▼4.2213.45 ▼78.0620.55 ▼23.39
Posts /wp-admin/edit.php861 ▼1,2391.53 ▼0.516.66 ▼31.6820.86 ▼14.42
Add New Post /wp-admin/post-new.php587 ▼9451.73 ▼21.3919.00 ▼641.957.16 ▼45.76
Media Library /wp-admin/upload.php746 ▼6511.73 ▼2.5320.50 ▼82.0120.28 ▼26.62

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/snapplify-payment-gateway/includes/class-wc-gateway-snapplify.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: woocommerce, e-commerce, snapplify, payments, gateway

snapplify-payment-gateway/snapplify-payment-gateway.php Passed 13 tests

This is the main PHP file of "Snapplify Payment Gateway" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
51 characters long description:
Accept payments in WooCommerce using Snapplify Pay.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected623 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP313465602
Markdown114021

PHP code Passed 2 tests

This is a short overview 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.31
Average class complexity41.50
▷ Minimum class complexity7.00
▷ Maximum class complexity76.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods620.69%
▷ Public methods1862.07%
▷ Protected methods00.00%
▷ Private methods1137.93%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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/snapplify-icon.png6.15KB1.06KB▼ 82.81%