Benchmarks
Plugin footprint 83% from 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully
Server metrics [RAM: ▲0.19MB] [CPU: ▼0.47ms] Passed 4 tests
This is a short check of server-side resources used by PayHere Payment Gateway
No issues were detected with server-side resource usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.64 ▲0.17 | 39.55 ▼3.91 |
Dashboard /wp-admin | 3.54 ▲0.23 | 58.45 ▲8.92 |
Posts /wp-admin/edit.php | 3.59 ▲0.23 | 51.47 ▲5.78 |
Add New Post /wp-admin/post-new.php | 6.08 ▲0.19 | 93.48 ▼6.33 |
Media Library /wp-admin/upload.php | 3.40 ▲0.17 | 36.91 ▲2.59 |
Cards on File /wp-admin/admin.php?page=payhere_list_customer_list | 3.37 | 33.78 |
Server storage [IO: ▲0.23MB] [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: 46 new files
Database: no new tables, 7 new options
New WordPress options |
---|
widget_recent-comments |
can_compress_scripts |
payhere_db_version |
widget_recent-posts |
theysaidso_admin_options |
db_upgraded |
widget_theysaidso_widget |
Browser metrics Passed 4 tests
PayHere Payment Gateway: an overview of browser usage
Normal browser usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,809 ▲47 | 14.35 ▲0.01 | 1.72 ▲0.07 | 40.20 ▼6.93 |
Dashboard /wp-admin | 2,213 ▲39 | 5.62 ▼0.02 | 90.79 ▼9.74 | 44.18 ▲2.22 |
Posts /wp-admin/edit.php | 2,115 ▲15 | 2.01 ▲0.08 | 40.83 ▼1.67 | 36.66 ▼0.25 |
Add New Post /wp-admin/post-new.php | 1,536 ▲10 | 23.83 ▲0.60 | 638.18 ▲3.83 | 54.90 ▲3.92 |
Media Library /wp-admin/upload.php | 1,418 ▲18 | 4.16 ▼0.04 | 95.65 ▲1.07 | 43.26 ▲2.44 |
Cards on File /wp-admin/admin.php?page=payhere_list_customer_list | 1,099 | 1.78 | 28.68 | 29.64 |
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
- The uninstall procedure has failed, leaving 7 options in the database
- widget_recent-comments
- payhere_db_version
- can_compress_scripts
- widget_recent-posts
- widget_theysaidso_widget
- theysaidso_admin_options
- db_upgraded
Smoke tests 50% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test
SRP 0% from 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
The following issues need your attention
- 1× GET requests to PHP files return non-empty strings:
- > /wp-content/plugins/payhere-payment-gateway/public/partials/payhere-ipg-public-display.php
- 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/payhere-payment-gateway/public/partials/checkout-form-sale.php:14
- > PHP Warning
require_once(ABSPATHwp-admin/includes/screen.php): failed to open stream: No such file or directory in wp-content/plugins/payhere-payment-gateway/includes/class-phcustomerslist.php on line 13
- > PHP Fatal error
Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/payhere-payment-gateway/public/partials/checkout-form-auth.php:14
- > PHP Notice
Undefined variable: onsite_checkout_enabled in wp-content/plugins/payhere-payment-gateway/public/partials/checkout-form-auth.php on line 12
- > PHP Fatal error
Uncaught Error: Class 'PayHereToken' not found in wp-content/plugins/payhere-payment-gateway/gateway/class-payherecapturepayment.php:19
- > PHP Fatal error
Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payhere-payment-gateway/gateway/class-wcgatewaypayhere.php:20
- > PHP Fatal error
require_once(): Failed opening required 'ABSPATHwp-admin/includes/screen.php' (include_path='.:/usr/share/php') in wp-content/plugins/payhere-payment-gateway/includes/class-phcustomerslist.php on line 13
- > PHP Fatal error
Uncaught Error: Class 'PayHereToken' not found in wp-content/plugins/payhere-payment-gateway/gateway/class-chargepayment.php:22
- > PHP Fatal error
Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/payhere-payment-gateway/admin/partials/order-auth-payment.php:13
- > PHP Notice
Undefined variable: onsite_checkout_enabled in wp-content/plugins/payhere-payment-gateway/public/partials/checkout-form-sale.php on line 12
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found
Optimizations
Plugin configuration 90% from 29 tests
readme.txt 94% from 16 tests
You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
- Plugin Name: Please specify the plugin name on the first line (
=== payhere-payment-gateway ===
)
payhere-payment-gateway/payhere-payment-gateway.php 85% from 13 tests
"PayHere Payment Gateway" version 2.2.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
- Description: Please keep the plugin description shorter than 140 characters (currently 149 characters long)
- Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
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
Everything looks great! No dangerous files found in this plugin2,292 lines of code in 35 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 25 | 460 | 1,371 | 1,902 |
CSS | 3 | 35 | 8 | 203 |
JavaScript | 6 | 29 | 81 | 185 |
SVG | 1 | 0 | 0 | 2 |
PHP code Passed 2 tests
This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.27 |
Average class complexity | 11.81 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 89.00 |
Average method complexity | 2.65 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 25.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 16 | |
▷ Abstract classes | 0 | 0.00% |
▷ Concrete classes | 16 | 100.00% |
▷ Final classes | 0 | 0.00% |
Methods | 103 | |
▷ Static methods | 6 | 5.83% |
▷ Public methods | 90 | 87.38% |
▷ Protected methods | 1 | 0.97% |
▷ Private methods | 12 | 11.65% |
Functions | 5 | |
▷ Named functions | 4 | 80.00% |
▷ Anonymous functions | 1 | 20.00% |
Constants | 13 | |
▷ Global constants | 1 | 7.69% |
▷ Class constants | 12 | 92.31% |
▷ Public constants | 12 | 100.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
public/images/helapay.png | 61.35KB | 29.54KB | ▼ 51.85% |
public/images/master.png | 7.02KB | 2.59KB | ▼ 63.06% |
admin/images/cards.png | 7.33KB | 7.12KB | ▼ 2.75% |
public/images/visa.png | 5.22KB | 2.36KB | ▼ 54.81% |