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

Code Review | Dynamic Price and Discounts for Woocommerce

WordPress plugin Dynamic Price and Discounts for Woocommerce scored89%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: 6.3.1
  • 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

100+ active /16,521 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.05ms] 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.46 ▲0.0036.97 ▼2.68
Dashboard /wp-admin3.31 ▲0.0048.83 ▼6.32
Posts /wp-admin/edit.php3.36 ▲0.0051.61 ▲5.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.67 ▼24.26
Media Library /wp-admin/upload.php3.23 ▲0.0038.71 ▲1.05

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Dynamic Price and Discounts for Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.33 ▼0.985.65 ▲3.8738.66 ▼3.89
Dashboard /wp-admin2,221 ▲155.84 ▼0.06122.07 ▲19.6954.03 ▲13.74
Posts /wp-admin/edit.php2,097 ▼32.00 ▼0.0140.11 ▲1.7834.64 ▼2.00
Add New Post /wp-admin/post-new.php1,545 ▲1923.27 ▲5.66599.30 ▼87.0452.15 ▲1.38
Media Library /wp-admin/upload.php1,394 ▼64.34 ▲0.1096.80 ▼8.5141.96 ▼4.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

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

"Dynamic Price and Discounts for Woocommerce" version 1.4.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • 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")

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
Everything looks great! No dangerous files found in this plugin1,868 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5783241,375
CSS36445491
JavaScript1002

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
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ 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 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/arrow-prv.png1.52KB1.36KB▼ 10.85%
assets/images/premium-btn.png5.72KB5.28KB▼ 7.69%
assets/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
assets/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/images/aa2.png1.34KB1.26KB▼ 5.77%