72% prodigy-commerce

Code Review | Prodigy Commerce

WordPress plugin Prodigy Commerce scored72%from 54 tests.

About plugin

  • Plugin page: prodigy-commerce
  • Plugin version: 2.8.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Sep 23, 2019
  • Latest release: Nov 30, 2023
  • Number of updates: 49
  • Update frequency: every 31.2 days
  • Top authors: prodigycommerce (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

90+ active /12,073 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.17MB] [CPU: ▲1,185.53ms] 50% from 4 tests

Server-side resources used by Prodigy Commerce
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,200.97ms on /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_attributes)
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 1,185.53ms on /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_attributes)
PageMemory (MB)CPU Time (ms)
Home /6.66 ▲3.191,240.43 ▲1,195.59
Dashboard /wp-admin6.45 ▲3.141,244.76 ▲1,191.65
Posts /wp-admin/edit.php6.56 ▲3.211,261.59 ▲1,214.30
Add New Post /wp-admin/post-new.php9.11 ▲3.221,251.46 ▲1,162.33
Media Library /wp-admin/upload.php6.37 ▲3.141,226.79 ▲1,192.53
Categories /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_categories6.391,238.88
Products /wp-admin/edit.php?post_type=prodigy-product6.461,227.69
Settings /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_settings6.431,255.39
Products list /wp-admin/admin.php?page=prodigy_products6.381,305.07
Attributes /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_attributes6.381,200.97

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 651 new files
Database: 3 new tables, 44 new options
New tables
wp_prodigy_user_info
wp_prodigy_attribute_taxonomy
wp_prodigy_orders
New WordPress options
pg_cart_expiration_time
pg_all_slugs_product_type
widget_recent-posts
pg_currency_type
pg_custom_expiration_time
widget_prodigy_cart_widget
pg_enable_cache
prodigy_cart_page_id
pg_hold_stock_time
pg_indicator_sync_content
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Prodigy Commerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,073 ▲28615.24 ▲0.9627.74 ▲25.8542.37 ▼2.18
Dashboard /wp-admin2,264 ▲875.23 ▼0.4197.20 ▲8.7340.98 ▲1.19
Posts /wp-admin/edit.php2,150 ▲502.57 ▲0.6237.24 ▼2.1733.83 ▼2.26
Add New Post /wp-admin/post-new.php1,597 ▲7121.56 ▼1.93707.86 ▲85.0037.22 ▼16.09
Media Library /wp-admin/upload.php1,466 ▲694.63 ▲0.42105.13 ▲6.2541.71 ▲0.40
Categories /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_categories1,1303.4853.8426.37
Products /wp-admin/edit.php?post_type=prodigy-product1,3653.7959.3630.21
Settings /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_settings1,2083.7657.5032.69
Products list /wp-admin/admin.php?page=prodigy_products9972.2335.9928.70
Attributes /wp-admin/edit.php?post_type=prodigy-product&page=prodigy_attributes1,1373.5951.4625.32

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
  • Zombie WordPress options detected upon uninstall: 5 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 30× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/archive/filter-price.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/cart-page-widget.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/archive/products.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/archive/search.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/categories.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/archive/categories.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/product/tabs.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/product/meta.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/base-widget.php
    • > /wp-content/plugins/prodigy-commerce/includes/support/addons/elementor/widgets/archive/active-filters.php
  • 32× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_variant_option() on null in wp-content/plugins/prodigy-commerce/templates/partials/single-product/variants.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/prodigy-commerce/includes/support/addons/divi/includes/modules/DiviProdigyCart.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/prodigy-commerce/includes/helpers/prodigy-conditional-functions.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_prodigy_product() in wp-content/plugins/prodigy-commerce/templates/partials/single-product/tabs/tiered_prices.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/prodigy-commerce/admin/partials/settings/general-settings.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'DiviExtension' not found in wp-content/plugins/prodigy-commerce/includes/support/addons/divi/includes/Divi.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/prodigy-commerce/includes/support/customizer/class-prodigy-customizer-control-multiple-select.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/prodigy-commerce/templates/partials/single-product/modals/tiered_price.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Prodigy\\Includes\\Frontend\\Builders\\Prodigy_Main_Data_Mapper' not found in wp-content/plugins/prodigy-commerce/includes/frontend/builders/class-prodigy-active-filter-data-mapper.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Prodigy\\Includes\\Frontend\\Builders\\Prodigy_Main_Data_Mapper' not found in wp-content/plugins/prodigy-commerce/includes/frontend/builders/class-prodigy-thank-page-data-mapper.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=prodigy_products
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=prodigy_products 254:30 Uncaught TypeError: Cannot read properties of undefined (reading 'init')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: hosted checkout, online storefront, secure checkout, pci compliant, ecommerce platform...

prodigy-commerce/prodigy-commerce.php 92% from 13 tests

Analyzing the main PHP file in "Prodigy Commerce" version 2.8.5
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin134,966 lines of code in 559 files:
LanguageFilesBlank linesComment linesLines of code
PHP2839,0918,18386,175
CSS284,78619421,045
Sass1446972210,501
JavaScript501,2067419,820
SVG443105,852
JSON8001,413
LESS1115152
Ruby1208

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.51
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces29
Interfaces1
Traits1
Classes176
▷ Abstract classes42.27%
▷ Concrete classes17297.73%
▷ Final classes00.00%
Methods1,285
▷ Static methods17913.93%
▷ Public methods1,11386.61%
▷ Protected methods1199.26%
▷ Private methods534.12%
Functions172
▷ Named functions11667.44%
▷ Anonymous functions5632.56%
Constants246
▷ Global constants145.69%
▷ Class constants23294.31%
▷ Public constants232100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 compressed PNG files occupy 0.03MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
web/templates/images/photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%
web/templates/css/photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%
web/templates/images/placeholder.png23.12KB9.76KB▼ 57.77%
web/admin/images/placeholder.png2.76KB2.76KB0.00%