73% livemesh-dynamic-pricing

Code Review | Dynamic Pricing for WooCommerce

WordPress plugin Dynamic Pricing for WooCommerce scored 73% from 54 tests.

About plugin

  • Plugin page: livemesh-dynamic-...
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Apr 22, 2022
  • Latest release: Jul 17, 2023
  • Number of updates: 17
  • Update frequency: every 26.5 days
  • Top authors: livemesh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,631 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲4.98MB] [CPU: ▲25.46ms] 75% from 4 tests

This is a short check of server-side resources used by Dynamic Pricing for WooCommerce
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,777.40ms on /wp-admin/admin.php?page=livemesh-dynamic-pricing)
PageMemory (MB)CPU Time (ms)
Home /8.87 ▲5.4172.66 ▲30.70
Dashboard /wp-admin8.89 ▲5.5969.93 ▲20.14
Posts /wp-admin/edit.php8.89 ▲5.5485.17 ▲34.31
Add New Post /wp-admin/post-new.php9.25 ▲3.36110.52 ▲16.94
Media Library /wp-admin/upload.php8.89 ▲5.6765.64 ▲34.04
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.8957.59
Dynamic Pricing for WooCommerce /wp-admin/admin.php?page=livemesh-dynamic-pricing8.891,777.40

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 269 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
fs_accounts
widget_theysaidso_widget
fs_debug_mode
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Dynamic Pricing for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8614.48 ▲0.121.81 ▲0.1232.59 ▼6.94
Dashboard /wp-admin2,224 ▲335.83 ▼0.10109.41 ▲9.7346.81 ▲3.39
Posts /wp-admin/edit.php2,113 ▲242.02 ▲0.0136.01 ▼9.3738.07 ▲2.61
Add New Post /wp-admin/post-new.php1,523 ▲422.78 ▼0.28672.20 ▲16.2763.54 ▲4.52
Media Library /wp-admin/upload.php1,400 ▲124.23 ▲0.0099.30 ▲0.9943.79 ▼2.86
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0652.0524.1727.29
Dynamic Pricing for WooCommerce /wp-admin/admin.php?page=livemesh-dynamic-pricing9751.7125.5953.73

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/livemesh-dynamic-pricing/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • fs_accounts
    • fs_active_plugins
    • fs_debug_mode

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: condition_type in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/html-product-data-pricing-rule.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/views/pricing-methods/bulk-pricing-row.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/html-product-data-pricing-rule.php:22
    • > PHP Notice
      Undefined variable: condition_type in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/html-product-data-pricing-rule.php on line 10
    • > PHP Notice
      Undefined variable: condition_type in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/html-product-data-pricing-rule.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ldp_parse_args() in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/pricing-methods/bulk-pricing-row.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/html-product-data-pricing.php:5
    • > PHP Notice
      Undefined variable: condition_type in wp-content/plugins/livemesh-dynamic-pricing/includes/admin/single-product/views/html-product-data-pricing-rule.php on line 19

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 Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: dynamic pricing, woocommerce discounts, woocommerce dynamic pricing, conditional pricing, woocommerce

livemesh-dynamic-pricing/livemesh-dynamic-pricing.php 77% from 13 tests

Analyzing the main PHP file in "Dynamic Pricing for WooCommerce" version 1.2.1
Please take the time to fix the following:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.5" instead of "5.2")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin39,427 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PHP1839,10318,26137,175
CSS171618557
JavaScript9125106514
PO File1234392504
Sass2587429
Markdown1680214
SVG40334

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity51.78
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes92
▷ Abstract classes33.26%
▷ Concrete classes8996.74%
▷ Final classes11.12%
Methods1,478
▷ Static methods19813.40%
▷ Public methods1,08173.14%
▷ Protected methods171.15%
▷ Private methods38025.71%
Functions112
▷ Named functions112100.00%
▷ Anonymous functions00.00%
Constants154
▷ Global constants10769.48%
▷ Class constants4730.52%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/livemesh-dynamic-pricing.png27.35KB8.66KB▼ 68.36%