72% yaypricing

Code Review | YayPricing - WooCommerce Dynamic Pricing & Discounts

WordPress plugin YayPricing - WooCommerce Dynamic Pricing & Discounts scored72%from 54 tests.

About plugin

  • Plugin page: yaypricing
  • Plugin version: 2.4.9.2
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 28, 2023
  • Latest release: Nov 25, 2023
  • Number of updates: 34
  • Update frequency: every 7.1 days
  • Top authors: yaycommerce (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

500+ active /5,175 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.22ms] Passed 4 tests

A check of server-side resources used by YayPricing - WooCommerce Dynamic Pricing & Discounts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.37 ▼3.86
Dashboard /wp-admin3.33 ▼0.0144.92 ▼20.11
Posts /wp-admin/edit.php3.45 ▲0.0948.98 ▲3.46
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.40 ▼7.93
Media Library /wp-admin/upload.php3.25 ▲0.0330.95 ▼0.98
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins3.0625.03
Help /wp-admin/admin.php?page=yaycommerce-help3.0623.77

Server storage [IO: ▲4.30MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 165 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

YayPricing - WooCommerce Dynamic Pricing & Discounts: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8114.23 ▲0.111.55 ▼0.1436.17 ▼6.40
Dashboard /wp-admin2,251 ▲715.66 ▲0.0696.33 ▲8.8242.05 ▼2.44
Posts /wp-admin/edit.php2,154 ▲542.05 ▲0.1040.18 ▲0.0537.46 ▼0.01
Add New Post /wp-admin/post-new.php1,558 ▲3223.50 ▲0.33680.15 ▲62.2755.82 ▲1.59
Media Library /wp-admin/upload.php1,456 ▲624.19 ▼0.0297.92 ▼1.2444.33 ▲3.78
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins8092.0627.9324.90
Help /wp-admin/admin.php?page=yaycommerce-help280.410.063.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=yaycommerce-other-plugins
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class '\YayMail\YayCommerceMenu\OtherPluginsMenu' not found

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
The following issues need your attention
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Trait 'YAYDP\\Traits\\YAYDP_Singleton' not found in wp-content/plugins/yaypricing/includes/core/sale-display/class-yaydp-sale-flash.php on line 15
    • > PHP Fatal error
      Trait 'YAYDP\\Traits\\YAYDP_Singleton' not found in wp-content/plugins/yaypricing/includes/class-yaydp-constants.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'YAYDP\\Abstracts\\YAYDP_Tooltip' not found in wp-content/plugins/yaypricing/includes/core/tooltip/class-yaydp-product-pricing-tooltip.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'YAYDP\\Abstracts\\YAYDP_Tooltip' not found in wp-content/plugins/yaypricing/includes/core/tooltip/class-yaydp-cart-discount-tooltip.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/yaypricing/includes/admin/views/html-notice-require-wc.php:5
    • > PHP Fatal error
      Trait 'YAYDP\\Traits\\YAYDP_Singleton' not found in wp-content/plugins/yaypricing/includes/class-yaydp-ajax.php on line 13
    • > PHP Fatal error
      Trait 'YAYDP\\Traits\\YAYDP_Singleton' not found in wp-content/plugins/yaypricing/includes/core/shortcode/class-yaydp-shortcode-handler.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'YAYDP\\Abstracts\\YAYDP_Adjustment' not found in wp-content/plugins/yaypricing/includes/core/single-adjustment/class-yaydp-cart-discount-adjustment.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'YAYDP\\Abstracts\\YAYDP_Adjustments' not found in wp-content/plugins/yaypricing/includes/core/adjustments/class-yaydp-checkout-fee-adjustments.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'YAYDP\\Abstracts\\YAYDP_Adjustments' not found in wp-content/plugins/yaypricing/includes/core/adjustments/class-yaydp-product-pricing-adjustments.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=yaycommerce-help
    • > Network (severe)
    wp-admin/admin.php?page=yaycommerce-help - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: tiered pricing, woocommerce discount, woocommerce dynamic pricing, woocommerce bulk discounts, cart fee...

yaypricing/yaypricing.php 92% from 13 tests

The main PHP file in "YayPricing - WooCommerce Dynamic Pricing & Discounts" ver. 2.4.9.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.0" instead of "3.0.0")

Code Analysis Passed 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 detected13,591 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
PHP1351,6995,17311,459
PO File14044181,008
CSS7596589
JavaScript736863509
JSON10022
SVG2004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.89
▷ Minimum class complexity1.00
▷ Maximum class complexity129.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces36
Interfaces0
Traits1
Classes108
▷ Abstract classes1312.04%
▷ Concrete classes9587.96%
▷ Final classes00.00%
Methods690
▷ Static methods20028.99%
▷ Public methods59886.67%
▷ Protected methods304.35%
▷ Private methods628.99%
Functions176
▷ Named functions6939.20%
▷ Anonymous functions10760.80%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin