99% dynamic-price-and-discounts-for-woocommerce

Code Review | Dynamic Price and Discounts for Woocommerce

WordPress plugin Dynamic Price and Discounts for Woocommerce scored 99% from 54 tests.

About plugin

  • Plugin page: dynamic-price-and...
  • Plugin version: 1.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.6
  • WordPress version: 5.9.2
  • First release: Sep 29, 2016
  • Latest release: Dec 28, 2020
  • Number of updates: 89
  • Update frequency: every 17.4 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active / 15,846 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼298.24ms] Passed 4 tests

A check of server-side resources used by Dynamic Price and Discounts for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1071.42 ▲12.45
Dashboard /wp-admin3.50 ▲0.0938.42 ▼0.20
Posts /wp-admin/edit.php3.73 ▲0.0941.44 ▼1.89
Add New Post /wp-admin/post-new.php6.97 ▲0.0095.88 ▼1,191.63
Media Library /wp-admin/upload.php3.39 ▲0.0930.63 ▲0.76

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 42 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Dynamic Price and Discounts for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,769 ▲1516.03 ▲0.747.03 ▲1.052.19 ▼0.28
Dashboard /wp-admin2,878 ▲206.12 ▼0.05138.06 ▼11.82163.42 ▲2.22
Posts /wp-admin/edit.php2,694 ▲63.10 ▼0.1360.48 ▼4.19142.30 ▼2.97
Add New Post /wp-admin/post-new.php1,688 ▲2718.34 ▲1.54405.88 ▼15.96193.92 ▲25.27
Media Library /wp-admin/upload.php1,689 ▼35.50 ▼0.03138.46 ▼7.87219.80 ▲15.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found


Plugin configuration 86% 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:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

dynamic-price-and-discounts-for-woocommerce/phoen_discounts.php 77% from 13 tests

Analyzing the main PHP file in "Dynamic Price and Discounts for Woocommerce" version 1.4.8
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dynamic-price-and-discounts-for-woocommerce.php" instead of "phoen_discounts.php")
  • Text Domain: The text domain must be the same as the plugin slug, although 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
No dangerous file extensions were detected1,868 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.57
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions11100.00%
▷ Anonymous functions00.00%
▷ Global constants2100.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
13 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/premium-head.png6.61KB5.20KB▼ 21.37%
assets/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
assets/images/aa2.png1.34KB1.26KB▼ 5.77%
assets/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%