89% woo-conditional-discount-rules-for-checkout

Code Review | Dynamic Pricing and Discount Rules for WooCommerce

WordPress plugin Dynamic Pricing and Discount Rules for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: woo-conditional-d...
  • Plugin version: 2.4.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 10, 2019
  • Latest release: Sep 13, 2023
  • Number of updates: 65
  • Update frequency: every 23.0 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 34,872 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Dynamic Pricing and Discount Rules for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.99 ▼5.48
Dashboard /wp-admin3.31 ▲0.0144.77 ▼2.25
Posts /wp-admin/edit.php3.36 ▲0.0051.01 ▼0.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.05 ▼19.62
Media Library /wp-admin/upload.php3.23 ▲0.0034.20 ▼1.77

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 279 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
fs_accounts
fs_active_plugins
widget_recent-comments
theysaidso_admin_options
wdpad_version
can_compress_scripts
db_upgraded
widget_theysaidso_widget
fs_debug_mode

Browser metrics Passed 4 tests

Checking browser requirements for Dynamic Pricing and Discount Rules for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.48 ▲0.131.78 ▼0.3340.83 ▲2.57
Dashboard /wp-admin2,206 ▲185.85 ▲0.93106.55 ▲2.6638.81 ▼3.38
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0139.39 ▼1.0736.57 ▲1.98
Add New Post /wp-admin/post-new.php1,542 ▲918.30 ▼5.01618.87 ▼9.6750.57 ▲1.92
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0493.83 ▼12.7639.30 ▼5.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • fs_debug_mode
    • fs_active_plugins
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • fs_accounts
    • wdpad_version
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt might help

woo-conditional-discount-rules-for-checkout/woo-conditional-discount-rules-for-checkout.php Passed 13 tests

The entry point to "Dynamic Pricing and Discount Rules for WooCommerce" version 2.4.1 is a PHP file that has certain tags in its header comment area
120 characters long description:
With this plugin, you can create and manage complex discount rules in WooCommerce store without the help of a developer.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin50,423 lines of code in 184 files:
LanguageFilesBlank linesComment linesLines of code
PHP1428,79418,63039,309
PO File41,9163,7095,029
CSS233494702,369
JavaScript83654612,369
SVG5001,329
XML13016
Markdown1002

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,088)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 136)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity91.74
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.90
▷ Minimum method complexity1.00
▷ Maximum method complexity136.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,378
▷ Static methods21015.24%
▷ Public methods97870.97%
▷ Protected methods191.38%
▷ Private methods38127.65%
Functions132
▷ Named functions132100.00%
▷ Anonymous functions00.00%
Constants158
▷ Global constants10767.72%
▷ Class constants5132.28%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
34 PNG files occupy 1.68MB with 0.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
admin/css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
admin/images/Getting_Started_02.png133.27KB39.65KB▼ 70.25%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/images/pro-features-img/feature-box-img-8.png112.69KB34.51KB▼ 69.37%