10% woo-dynamic-pricing-and-discounts

Code Review | WooCommerce Discounts and Dynamic Pricing

WordPress plugin WooCommerce Discounts and Dynamic Pricing scored 10% from 54 tests.

About plugin

  • Plugin page: woo-dynamic-prici...
  • Plugin version: 1.27.15
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 5.8.1
  • First release: Mar 27, 2018
  • Latest release: Dec 30, 2018
  • Number of updates: 23
  • Update frequency: every 12.1 days
  • Top authors: azexo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 872 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/woo-dynamic-pricing-and-discounts/azh_woo_discounts.php+479
    Undefined variable: context

Server metrics [RAM: ▼1.18MB] [CPU: ▼186.35ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Discounts and Dynamic Pricing
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.45 ▼0.386.64 ▼26.44
Dashboard /wp-admin2.47 ▼0.586.94 ▼40.13
Posts /wp-admin/edit.php2.47 ▼0.636.73 ▼36.79
Add New Post /wp-admin/post-new.php2.47 ▼2.966.74 ▼638.72
Media Library /wp-admin/upload.php2.47 ▼0.536.60 ▼29.76

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Discounts and Dynamic Pricing
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12716.33 ▲0.7711.21 ▲0.5545.83 ▼1.43
Dashboard /wp-admin2,993 ▲625.92 ▼0.02139.04 ▲0.20106.46 ▲1.70
Posts /wp-admin/edit.php2,759 ▲202.73 ▲0.0267.25 ▲1.9792.03 ▲2.09
Add New Post /wp-admin/post-new.php1,881 ▼1,84519.14 ▲3.95385.68 ▼38.39107.80 ▼2.82
Media Library /wp-admin/upload.php1,827 ▲765.03 ▲0.05152.50 ▼4.64111.71 ▼7.79

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/woo-dynamic-pricing-and-discounts/azh_woo_discounts.php+479
    Undefined variable: context

Smoke tests 75% 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 50% from 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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-dynamic-pricing-and-discounts/azh_woo_discounts.php:12

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: discounts, dynamic pricing, bulk pricing, tiered pricing, product pricing...

woo-dynamic-pricing-and-discounts/azh_woo_discounts.php 85% from 13 tests

The entry point to "WooCommerce Discounts and Dynamic Pricing" version 1.27.15 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-dynamic-pricing-and-discounts.php" instead of "azh_woo_discounts.php")
  • 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

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
There were no executable files found in this plugin1,546 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP148491,546

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
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%
Functions47
▷ Named functions919.15%
▷ Anonymous functions3880.85%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin