83% extra-amount-on-checkout

Code Review | WC Extra Amount On Checkout

WordPress plugin WC Extra Amount On Checkout scored83%from 54 tests.

About plugin

  • Plugin page: extra-amount-on-c...
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-7.9.0
  • WordPress version: 6.3.1
  • First release: Nov 3, 2019
  • Latest release: Jul 21, 2023
  • Number of updates: 30
  • Update frequency: every 45.4 days
  • Top authors: amitwpdeveloper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,139 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by WC Extra Amount On Checkout
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.18 ▼1.19
Dashboard /wp-admin3.31 ▲0.0048.19 ▼2.53
Posts /wp-admin/edit.php3.36 ▲0.0045.07 ▼5.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.28 ▼8.39
Media Library /wp-admin/upload.php3.23 ▲0.0038.61 ▲4.01

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

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

Browser metrics Passed 4 tests

WC Extra Amount On Checkout: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.42 ▲0.201.94 ▲0.2241.07 ▼3.40
Dashboard /wp-admin2,203 ▲274.84 ▼0.9799.45 ▼19.6738.84 ▼9.02
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0137.01 ▼1.5333.66 ▼0.90
Add New Post /wp-admin/post-new.php1,533 ▲1923.22 ▲5.75668.42 ▲7.2450.88 ▼12.02
Media Library /wp-admin/upload.php1,385 ▲64.21 ▲0.01106.65 ▲2.4347.39 ▲2.36

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/extra-amount-on-checkout/wps-eawc-basic.php:14

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 86% 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #4 (Payment Gateway Basis.) image missing
The official readme.txt is a good inspiration

extra-amount-on-checkout/wps-eawc-basic.php 77% from 13 tests

The main PHP file in "WC Extra Amount On Checkout" ver. 1.1.5 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("extra-amount-on-checkout.php" instead of "wps-eawc-basic.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 275 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "4.1.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,576 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP613011943
CSS2226446
JavaScript2330187

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 code0.28
Average class complexity20.25
▷ Minimum class complexity3.00
▷ Maximum class complexity34.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods1047.62%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png0.48KB0.61KB0.00%