83% paybill-payment-gateway-for-woocommerce

Code Review | PayBill.NG Woocommerce Payment Gateway

WordPress plugin PayBill.NG Woocommerce Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: paybill-payment-g...
  • Plugin version: 0.1.7
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 26, 2017
  • Latest release: Jul 27, 2017
  • Number of updates: 33
  • Update frequency: every 0.2 days
  • Top authors: paybillng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /793 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.81ms] Passed 4 tests

Server-side resources used by PayBill.NG Woocommerce Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.75 ▼4.45
Dashboard /wp-admin3.34 ▲0.0449.09 ▼1.95
Posts /wp-admin/edit.php3.40 ▲0.0449.30 ▲0.66
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.02 ▼13.50
Media Library /wp-admin/upload.php3.27 ▲0.0436.63 ▲4.14

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

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

Browser metrics Passed 4 tests

Checking browser requirements for PayBill.NG Woocommerce Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.121.85 ▼0.3943.66 ▲0.09
Dashboard /wp-admin2,198 ▲215.64 ▼0.0498.22 ▲8.2443.05 ▲4.47
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0137.13 ▼0.5133.50 ▼7.03
Add New Post /wp-admin/post-new.php1,529 ▲123.25 ▲0.35616.16 ▼43.8254.11 ▼7.21
Media Library /wp-admin/upload.php1,397 ▼34.18 ▲0.0098.43 ▼3.3340.47 ▼3.24

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/paybill-payment-gateway-for-woocommerce/includes/templates/processing_form.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

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 to be fixed: Please take inspiration from this readme.txt

paybill-payment-gateway-for-woocommerce/index.php 92% from 13 tests

The main PHP file in "PayBill.NG Woocommerce Payment Gateway" ver. 0.1.7 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("paybill-payment-gateway-for-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin384 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP513835384

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.20
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods10
▷ Static methods330.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.24MB with 0.14MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png250.29KB104.24KB▼ 58.35%