89% woo-additional-fee

Code Review | Woo Additional Fee

WordPress plugin Woo Additional Fee scored89%from 54 tests.

About plugin

  • Plugin page: woo-additional-fee
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 4, 2017
  • Latest release: Jul 9, 2021
  • Number of updates: 8
  • Update frequency: every 183.4 days
  • Top authors: gr8nilay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /822 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
Installer ran successfully

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

A check of server-side resources used by Woo Additional Fee
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.59 ▼3.64
Dashboard /wp-admin3.31 ▲0.0052.54 ▲5.51
Posts /wp-admin/edit.php3.36 ▲0.0050.76 ▲0.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.92 ▼9.82
Media Library /wp-admin/upload.php3.23 ▲0.0034.21 ▼3.01

Server storage [IO: ▲0.07MB] [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: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Woo Additional Fee: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.481.81 ▼0.1546.06 ▼3.30
Dashboard /wp-admin2,209 ▲215.89 ▼0.01113.68 ▲5.5145.52 ▲3.73
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0244.07 ▲5.7333.58 ▼4.47
Add New Post /wp-admin/post-new.php1,533 ▲1923.56 ▲6.06700.00 ▼32.0470.10 ▲11.25
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.0596.57 ▼23.2742.42 ▼6.07

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Woo Additional Fee setting admin screen), #2 (Displayed additional fee on the front end)
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === woo-additional-fee === )
You can take inspiration from this readme.txt

woo-additional-fee/woo-additional-fee.php Passed 13 tests

The main PHP script in "Woo Additional Fee" version 1.0.0 is automatically included on every request by WordPress
115 characters long description:
This plugin allows merchant to add an additional cart fee to the cart by adding custom fee label and amount of fee.

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
Success! There were no dangerous files found in this plugin293 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11122426249
JavaScript16038
CSS1156

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.28
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
snapshot-1.png21.05KB12.49KB▼ 40.68%
snapshot-2.png24.31KB12.67KB▼ 47.87%
admin/css/wooaf_ico.png1.24KB0.46KB▼ 62.95%