84% wc-label-percentage-discount

Code Review | Label Percentage Discount

WordPress plugin Label Percentage Discount scored84%from 54 tests.

About plugin

  • Plugin page: wc-label-percenta...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0+
  • WordPress version: 6.3.1
  • First release: Jan 14, 2021
  • Latest release: Nov 20, 2022
  • Number of updates: 7
  • Update frequency: every 96.6 days
  • Top authors: marcobarbadoro81 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,459 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by Label Percentage Discount
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.48 ▼3.46
Dashboard /wp-admin3.31 ▲0.0151.12 ▼3.28
Posts /wp-admin/edit.php3.36 ▲0.0053.34 ▲0.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.35 ▼5.97
Media Library /wp-admin/upload.php3.23 ▲0.0039.39 ▲4.10

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Label Percentage Discount
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.061.64 ▼0.0140.74 ▼5.07
Dashboard /wp-admin2,195 ▲155.59 ▼0.0292.67 ▼0.7541.26 ▼1.65
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0142.97 ▲5.8340.95 ▲5.12
Add New Post /wp-admin/post-new.php1,537 ▲918.08 ▼5.19661.55 ▼36.0375.98 ▲18.77
Media Library /wp-admin/upload.php1,400 ▼34.15 ▼0.01111.28 ▼1.1046.70 ▲1.85

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

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

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 | 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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wc-label-percentage-discount/admin-sconto.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-label-percentage-discount/sconto.php:5

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: You can take inspiration from this readme.txt

wc-label-percentage-discount/admin-sconto.php 92% from 13 tests

The main PHP script in "Label Percentage Discount" version 1.0.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-label-percentage-discount.php" instead of "admin-sconto.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin60 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21831660

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
PNG images were not found in this plugin