89% waafipay-payment-gateway-for-woocommerce

Code Review | WaafiPay Payment Gateway

WordPress plugin WaafiPay Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: waafipay-payment-...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8.1
  • WordPress version: 6.3.1
  • First release: Dec 28, 2021
  • Latest release: Feb 2, 2022
  • Number of updates: 16
  • Update frequency: every 2.3 days
  • Top authors: waafipay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,810 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.95ms] Passed 4 tests

A check of server-side resources used by WaafiPay Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0435.94 ▼2.37
Dashboard /wp-admin3.34 ▲0.0343.95 ▼7.50
Posts /wp-admin/edit.php3.45 ▲0.0943.03 ▼5.47
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.21 ▼16.45
Media Library /wp-admin/upload.php3.26 ▲0.0335.16 ▲5.03

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
wc_gateway_waafi_bootstrap_warning_message
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WaafiPay Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6313.24 ▼1.061.68 ▼0.0841.94 ▼5.91
Dashboard /wp-admin2,215 ▲245.79 ▲0.90102.56 ▼0.0940.60 ▼4.69
Posts /wp-admin/edit.php2,098 ▲62.03 ▲0.0333.82 ▼2.1132.73 ▼0.20
Add New Post /wp-admin/post-new.php1,542 ▲1423.02 ▼0.20664.00 ▲52.4757.27 ▲1.14
Media Library /wp-admin/upload.php1,400 ▲124.22 ▼0.03110.82 ▲13.7948.66 ▲5.92

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • wc_gateway_waafi_bootstrap_warning_message
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (Install & Activate Waafipay), #2 (Activate payment gateway in woocommerce), #3 (Add configuration)
Please take inspiration from this readme.txt

waafipay-payment-gateway-for-woocommerce/wc_waafipay.php 92% from 13 tests

The principal PHP file in "WaafiPay Payment Gateway" v. 1.1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("waafipay-payment-gateway-for-woocommerce.php" instead of "wc_waafipay.php")

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 detected688 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10152129687
Markdown1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.86
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods3692.31%
▷ Protected methods37.69%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin