64% advanced-dynamic-pricing-for-woocommerce

Code Review | Advanced Dynamic Pricing for WooCommerce

WordPress plugin Advanced Dynamic Pricing for WooCommerce scored64%from 54 tests.

About plugin

  • Plugin page: advanced-dynamic-...
  • Plugin version: 4.5.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.4
  • WordPress version: 6.3.1
  • First release: Nov 10, 2017
  • Latest release: Oct 31, 2023
  • Number of updates: 267
  • Update frequency: every 8.2 days
  • Top authors: algol.plus (100%)

Code review

54 tests

User reviews

102 reviews

Install metrics

20,000+ active /685,505 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼0.97ms] Passed 4 tests

A check of server-side resources used by Advanced Dynamic Pricing for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.53 ▼0.44
Dashboard /wp-admin3.39 ▲0.0850.89 ▲0.20
Posts /wp-admin/edit.php3.50 ▲0.1444.05 ▼3.38
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.57 ▲2.94
Media Library /wp-admin/upload.php3.31 ▲0.0835.02 ▼0.26

Server storage [IO: ▲3.41MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 588 new files
Database: 4 new tables, 6 new options
New tables
wp_wdp_order_items
wp_wdp_rules
wp_wdp_persistent_rules_cache
wp_wdp_orders
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Dynamic Pricing for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.70 ▲0.351.67 ▼0.0242.33 ▼2.22
Dashboard /wp-admin2,206 ▲325.54 ▼0.1183.58 ▼13.2637.70 ▼7.35
Posts /wp-admin/edit.php2,111 ▲111.98 ▼0.0533.04 ▼7.9735.54 ▲1.63
Add New Post /wp-admin/post-new.php1,532 ▲623.54 ▲0.25630.47 ▼1.7055.26 ▼2.24
Media Library /wp-admin/upload.php1,414 ▲144.17 ▼0.0198.39 ▲5.7543.89 ▲4.09

Uninstaller [IO: ▲3.41MB] [DB: ▲0.01MB] 25% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Incomplete uninstall procedure, leaving 588 files (3.41MB) in the plugin directory
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/AdminTabInterface.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/Paginator.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/Tabs/Compatibility.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminNotice.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/Tabs/Help.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/AdminPageFilterTitles.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/Tabs/Options.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage.php
    • (new file) BaseVersion/Includes/AdminExtensions/AdminPage/Tabs/Collections.php
    • (new file) AutoLoader.php
    • ...
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_wdp_persistent_rules_cache
    • wp_wdp_rules
    • wp_wdp_order_items
    • wp_wdp_orders
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ADP\\Settings\\Abstracts\\OriginOption' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/Settings/Varieties/SelectiveOption/SelectiveOption.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'ADP\\BaseVersion\\Includes\\CartProcessor\\CartCouponsProcessorMerge\\MergeCoupon\\IMergeCoupon' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/CartProcessor/CartCouponsProcessorMerge/MergeCoupon/RuleTriggerCoupon.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ADP\\BaseVersion\\Includes\\Enums\\BaseEnum' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Enums/GiftChoiceMethodEnum.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'ADP\\BaseVersion\\Includes\\Database\\Repository\\OrderItemRepositoryInterface' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Database/Repository/OrderItemRepository.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ADP\\BaseVersion\\Includes\\Enums\\BaseEnum' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Enums/AutoAddChoiceTypeEnum.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'ADP\\BaseVersion\\Includes\\Core\\ICartCalculator' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Core/CartCalculatorPersistent.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'ADP\\BaseVersion\\Includes\\Core\\Cart\\Coupon\\AdpCouponInterface' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Core/Cart/Coupon/CouponRuleTrigger.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'ADP\\BaseVersion\\Includes\\CartProcessor\\CartCouponsProcessorMerge\\MergeCoupon\\IMergeCoupon' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/CartProcessor/CartCouponsProcessorMerge/MergeCoupon/CartItemCoupon.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ADP\\BaseVersion\\Includes\\Core\\Rule\\CartCondition\\Impl\\AbstractCondition' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Core/Rule/CartCondition/Impl/ProductCategoriesAll.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ADP\\BaseVersion\\Includes\\Core\\Rule\\CartCondition\\Impl\\AbstractCondition' not found in wp-content/plugins/advanced-dynamic-pricing-for-woocommerce/BaseVersion/Includes/Core/Rule/CartCondition/Impl/ProductAttributesAll.php:9

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: dynamic pricing, deals, discounts, pricing deals, woocommerce...

advanced-dynamic-pricing-for-woocommerce/advanced-dynamic-pricing-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Advanced Dynamic Pricing for WooCommerce" version 4.5.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.8" instead of "3.6")

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 plugin67,477 lines of code in 576 files:
LanguageFilesBlank linesComment linesLines of code
PHP52811,90913,17250,115
JavaScript163,39492314,873
CSS133651321,842
Sass11040538
SVG1800109

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity14.41
▷ Minimum class complexity1.00
▷ Maximum class complexity239.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces86
Interfaces46
Traits2
Classes379
▷ Abstract classes82.11%
▷ Concrete classes37197.89%
▷ Final classes00.00%
Methods3,617
▷ Static methods39610.95%
▷ Public methods3,15787.28%
▷ Protected methods39610.95%
▷ Private methods641.77%
Functions201
▷ Named functions21.00%
▷ Anonymous functions19999.00%
Constants580
▷ Global constants101.72%
▷ Class constants57098.28%
▷ Public constants56999.82%

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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
BaseVersion/assets/jquery-ui/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
BaseVersion/assets/jquery-ui/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
BaseVersion/assets/jquery-ui/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
BaseVersion/assets/jquery-ui/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
BaseVersion/assets/jquery-ui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%