90% woo-safepay-gateway

Code Review | Safepay for WooCommerce

WordPress plugin Safepay for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: woo-safepay-gateway
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.2-5.5
  • WordPress version: 6.3.1
  • First release: Dec 27, 2019
  • Latest release: Sep 2, 2020
  • Number of updates: 18
  • Update frequency: every 13.9 days
  • Top authors: safepay (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /5,979 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.05MB] [CPU: ▼8.27ms] Passed 4 tests

This is a short check of server-side resources used by Safepay for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0541.25 ▼7.09
Dashboard /wp-admin3.36 ▲0.0552.95 ▼0.96
Posts /wp-admin/edit.php3.47 ▲0.1153.34 ▲2.18
Add New Post /wp-admin/post-new.php5.94 ▲0.0590.71 ▼23.83
Media Library /wp-admin/upload.php3.28 ▲0.0537.79 ▼1.19

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Safepay for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.29 ▼0.071.97 ▼0.1640.94 ▼0.76
Dashboard /wp-admin2,195 ▲185.48 ▼0.0594.29 ▼3.0746.13 ▼2.93
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0235.80 ▼3.3535.22 ▼2.15
Add New Post /wp-admin/post-new.php1,526 ▼023.15 ▼0.17699.38 ▼0.0253.32 ▼3.49
Media Library /wp-admin/upload.php1,400 ▲64.20 ▼0.05105.03 ▲1.4142.84 ▼4.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: woocommerce, pakistan, ecommerce, safepay, payments

woo-safepay-gateway/safepay-woocommerce-plugin.php 92% from 13 tests

The entry point to "Safepay for WooCommerce" version 1.0.6 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-safepay-gateway.php" instead of "safepay-woocommerce-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected414 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP287122414

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity16.50
▷ Minimum class complexity10.00
▷ Maximum class complexity23.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods313.64%
▷ Public methods1254.55%
▷ Protected methods836.36%
▷ Private methods29.09%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants00.00%
▷ Class constants12100.00%
▷ Public constants12100.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
images/logo.png7.99KB2.93KB▼ 63.25%