90% display-sale-percentage-value

Code Review | Advanced Sale Percentage Badge

WordPress plugin Advanced Sale Percentage Badge scored90%from 54 tests.

About plugin

  • Plugin page: display-sale-perc...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Feb 25, 2021
  • Latest release: Feb 25, 2021
  • Number of updates: 16
  • Update frequency: every 2.2 days
  • Top authors: navarroido (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /442 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: ▼3.78ms] Passed 4 tests

A check of server-side resources used by Advanced Sale Percentage Badge
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0044.76 ▼0.70
Dashboard /wp-admin3.31 ▲0.0046.11 ▼6.55
Posts /wp-admin/edit.php3.36 ▲0.0049.72 ▼0.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.55 ▼7.44
Media Library /wp-admin/upload.php3.23 ▲0.0037.33 ▼0.41

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Sale Percentage Badge
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.40 ▼0.211.78 ▼0.4142.83 ▼3.20
Dashboard /wp-admin2,200 ▲265.68 ▲0.0585.34 ▼19.1740.22 ▼4.85
Posts /wp-admin/edit.php2,105 ▲52.01 ▼0.0139.67 ▲5.2534.56 ▼4.35
Add New Post /wp-admin/post-new.php1,552 ▲2118.27 ▼5.02619.79 ▼40.2669.60 ▲10.98
Media Library /wp-admin/upload.php1,399 ▼14.22 ▼0.03114.97 ▲6.6250.84 ▲4.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The SRP test was a success

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: tag, woocommerce product labels, mark, product marks, sale product badge...

display-sale-percentage-value/display-sale-percentage-value.php 92% from 13 tests

Analyzing the main PHP file in "Advanced Sale Percentage Badge" version 1.0.0
Please make the necessary changes and fix the following:
  • 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 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin35 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2133123
CSS11112

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin