77% aco-woo-dynamic-pricing

Code Review | Dynamic Pricing With Discount Rules for WooCommerce

WordPress plugin Dynamic Pricing With Discount Rules for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: aco-woo-dynamic-p...
  • Plugin version: 4.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.9.2
  • First release: Mar 20, 2019
  • Latest release: Mar 23, 2022
  • Number of updates: 106
  • Update frequency: every 10.4 days
  • Top authors: acowebs (84.91%)acowebscd (16.04%)

Code review

54 tests

User reviews

33 reviews

Install metrics

8,000+ active / 98,175 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼309.55ms] Passed 4 tests

This is a short check of server-side resources used by Dynamic Pricing With Discount Rules for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0456.26 ▲6.28
Dashboard /wp-admin3.46 ▲0.0634.72 ▼7.55
Posts /wp-admin/edit.php3.69 ▲0.0535.94 ▼6.13
Add New Post /wp-admin/post-new.php6.95 ▼0.0293.82 ▼1,223.45
Media Library /wp-admin/upload.php3.34 ▲0.0524.60 ▼1.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 1 new option
New WordPress options
awdp_version

Browser metrics Passed 4 tests

Checking browser requirements for Dynamic Pricing With Discount Rules for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲916.17 ▲0.385.56 ▼0.522.31 ▼0.20
Dashboard /wp-admin2,895 ▲416.01 ▼0.13121.24 ▼13.39155.03 ▼1.01
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0063.88 ▲0.24141.00 ▼3.43
Add New Post /wp-admin/post-new.php1,668 ▼9219.71 ▼2.86382.20 ▼67.47155.86 ▼8.94
Media Library /wp-admin/upload.php1,701 ▲35.52 ▲0.04137.18 ▼12.68189.23 ▲4.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • awdp_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/aco-woo-dynamic-pricing/includes/views/admin-settings.php
    • > /wp-content/plugins/aco-woo-dynamic-pricing/includes/views/admin-lists.php
    • > /wp-content/plugins/aco-woo-dynamic-pricing/includes/views/admin-root.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant AWDP_TOKEN - assumed 'AWDP_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/aco-woo-dynamic-pricing/includes/views/admin-lists.php on line 1
    • > PHP Warning
      Use of undefined constant AWDP_TOKEN - assumed 'AWDP_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/aco-woo-dynamic-pricing/includes/views/admin-settings.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/aco-woo-dynamic-pricing/start.php:28
    • > PHP Warning
      Use of undefined constant AWDP_TOKEN - assumed 'AWDP_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/aco-woo-dynamic-pricing/includes/views/admin-root.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

aco-woo-dynamic-pricing/start.php 85% from 13 tests

The primary PHP file in "Dynamic Pricing With Discount Rules for WooCommerce" version 4.1.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("aco-woo-dynamic-pricing.php" instead of "start.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 152 characters long)

Code Analysis 97% 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
Good job! No executable or dangerous file extensions detected5,221 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP179816363,798
JSON100789
PO File1227227479
CSS1191132
XML10021
JavaScript2002

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 282)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity90.17
▷ Minimum class complexity3.00
▷ Maximum class complexity380.00
Average method complexity11.49
▷ Minimum method complexity1.00
▷ Maximum method complexity282.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods102
▷ Static methods54.90%
▷ Public methods10098.04%
▷ Protected methods10.98%
▷ Private methods10.98%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/edit.png0.61KB0.61KB0.00%
assets/images/link-go.png1.02KB0.24KB▼ 77.00%
assets/images/image-actions-old.png2.22KB1.02KB▼ 54.26%
assets/images/icon.png1.15KB0.47KB▼ 59.06%
assets/images/scheduler-icons.png2.25KB1.23KB▼ 45.26%