90% discount-percentage-for-woocommerce

Code Review | Discount Percentage for WooCommerce

WordPress plugin Discount Percentage for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: discount-percenta...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.0.1
  • WordPress version: 6.3.1
  • First release: Jul 22, 2022
  • Latest release: Jul 22, 2022
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: racmanuel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /810 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 gracefully, with no errors

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

Server-side resources used by Discount Percentage for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.40 ▼7.30
Dashboard /wp-admin3.32 ▼0.0342.95 ▼15.89
Posts /wp-admin/edit.php3.37 ▲0.0148.31 ▼1.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.53 ▼32.17
Media Library /wp-admin/upload.php3.24 ▲0.0136.39 ▲0.88

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Discount Percentage for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.31 ▼1.295.39 ▲3.2240.95 ▼1.06
Dashboard /wp-admin2,206 ▲184.83 ▼1.10114.38 ▲11.5244.91 ▲4.00
Posts /wp-admin/edit.php2,089 ▼31.99 ▲0.0236.81 ▼4.3236.73 ▼2.75
Add New Post /wp-admin/post-new.php1,542 ▲1418.58 ▲0.58663.45 ▲65.7552.65 ▼3.59
Media Library /wp-admin/upload.php1,391 ▲94.28 ▲0.05109.43 ▲13.0242.51 ▼1.51

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Everything seems fine, however this is by no means an exhaustive test

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: products, badge, badges, woocommerce

discount-percentage-for-woocommerce/discount-percentage-for-woocommerce.php 92% from 13 tests

The entry point to "Discount Percentage for WooCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected59 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1153859

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions3
▷ Named functions3100.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
No PNG images were found in this plugin