84% nanoplazo-payment-gateway-for-woocommerce

Code Review | NanoPlazo Payment Gateway for WooCommerce

WordPress plugin NanoPlazo Payment Gateway for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: nanoplazo-payment...
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 6, 2022
  • Latest release: Aug 10, 2022
  • Number of updates: 14
  • Update frequency: every 5.0 days
  • Top authors: nanoplazo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,073 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.46ms] Passed 4 tests

Analyzing server-side resources used by NanoPlazo Payment Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.07 ▼3.76
Dashboard /wp-admin3.31 ▲0.0046.66 ▼3.77
Posts /wp-admin/edit.php3.36 ▲0.0045.06 ▼0.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.41 ▼14.19
Media Library /wp-admin/upload.php3.23 ▲0.0036.73 ▲2.45

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

NanoPlazo Payment Gateway for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.26 ▼1.391.82 ▼0.0846.79 ▲0.95
Dashboard /wp-admin2,203 ▲145.85 ▲0.8999.48 ▼9.5339.17 ▼5.49
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0434.22 ▼0.4734.46 ▲0.81
Add New Post /wp-admin/post-new.php1,542 ▲1318.24 ▼0.22598.50 ▼16.1756.02 ▲1.16
Media Library /wp-admin/upload.php1,388 ▲34.18 ▼0.0496.46 ▼6.8441.05 ▼0.15

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nanoplazo-payment-gateway-for-woocommerce/front/index.php:5

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 93% 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
Please fix the following attributes: You can take inspiration from this readme.txt

nanoplazo-payment-gateway-for-woocommerce/nanoplazo_woocommerce.php 92% from 13 tests

The main PHP script in "NanoPlazo Payment Gateway for WooCommerce" version 1.4.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("nanoplazo-payment-gateway-for-woocommerce.php" instead of "nanoplazo_woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin594 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP676163573
JavaScript10121

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.67
▷ Minimum class complexity2.00
▷ Maximum class complexity22.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants541.67%
▷ Class constants758.33%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-sale.png5.20KB3.31KB▼ 36.35%
assets/images/logo_normal@100x24.png3.85KB2.34KB▼ 39.24%
assets/images/logo.png11.99KB5.10KB▼ 57.46%
assets/images/logo_sales@100x24.png5.41KB2.52KB▼ 53.46%