67% ecwid-shopping-cart

Code Review | Ecwid Ecommerce Shopping Cart

WordPress plugin Ecwid Ecommerce Shopping Cart scored67%from 54 tests.

About plugin

  • Plugin page: ecwid-shopping-cart
  • Plugin version: 6.12.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Oct 21, 2009
  • Latest release: Nov 28, 2023
  • Number of updates: 850
  • Update frequency: every 6.1 days
  • Top authors: Ecwid (100%)

Code review

54 tests

User reviews

223 reviews

Install metrics

20,000+ active /2,387,910 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲2.83MB] [CPU: ▲20.06ms] Passed 4 tests

Analyzing server-side resources used by Ecwid Ecommerce Shopping Cart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.80 ▲2.3454.38 ▲12.74
Dashboard /wp-admin6.26 ▲2.9569.84 ▲18.68
Posts /wp-admin/edit.php6.39 ▲3.0465.03 ▲14.86
Add New Post /wp-admin/post-new.php9.45 ▲3.562,741.13 ▲2,641.87
Media Library /wp-admin/upload.php6.24 ▲3.0172.82 ▲33.96
/wp-admin/admin.php?page=ecwid-advanced6.1262.84
/wp-admin/admin.php?page=ec-admin-mobile6.2160.45
/wp-admin/admin.php?page=ec-params6.2169.67
/wp-admin/admin.php?page=ecwid-debug6.1263.57
/wp-admin/admin.php?page=ec-sync6.2159.92
Storefront /wp-admin/admin.php?page=ec-storefront-settings6.2965.91
/wp-admin/admin.php?page=ecwid-help6.1256.63
/wp-admin/admin.php?page=ecwid-sync6.1251.70
/wp-admin/admin.php?page=ecwid6.1252.38
/wp-admin/admin.php?page=ecwid-install-theme6.1254.62

Server storage [IO: ▲7.49MB] [DB: ▲0.38MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 508 new files
Database: no new tables, 74 new options
New WordPress options
ecwid_support_email
ecwid_hide_canonical
ecwid_plugin_version
ecwid_floating_shopping_cart_mode
ecwid_show_vote_message
ecwid_historyjs_html4mode
ec_store_cart_widget_layout
ecwid_log_cache
widget_ecwidrandomproduct
ecwid_plugin_migration_since_version
...

Browser metrics Passed 4 tests

Ecwid Ecommerce Shopping Cart: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,250 ▲48813.80 ▼0.547.83 ▲6.0629.92 ▼17.00
Dashboard /wp-admin2,528 ▲3475.24 ▼0.44102.53 ▼0.9651.66 ▲9.37
Posts /wp-admin/edit.php2,333 ▲2332.71 ▲0.7745.32 ▲7.0942.52 ▲9.26
Add New Post /wp-admin/post-new.php7,212 ▲5,53321.76 ▼0.021,104.97 ▲500.7897.21 ▲56.76
Media Library /wp-admin/upload.php1,653 ▲2504.75 ▲0.42120.64 ▲21.0458.34 ▲14.07
/wp-admin/admin.php?page=ecwid-advanced1,1192.2935.5940.44
/wp-admin/admin.php?page=ec-admin-mobile1,0882.1438.2441.17
/wp-admin/admin.php?page=ec-params1,5682.1737.0242.27
/wp-admin/admin.php?page=ecwid-debug280.410.093.92
/wp-admin/admin.php?page=ec-sync1,0442.3034.6033.69
Storefront /wp-admin/admin.php?page=ec-storefront-settings2,2332.5436.5946.21
/wp-admin/admin.php?page=ecwid-help1,3122.2235.4370.59
/wp-admin/admin.php?page=ecwid-sync280.410.083.80
/wp-admin/admin.php?page=ecwid1,0452.2238.2052.60
/wp-admin/admin.php?page=ecwid-install-theme280.410.083.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 57 options in the database
    • widget_ecwidbadge
    • widget_ecwidlatestproducts
    • widget_ecwidnsfminicart
    • ecwid_hide_prefetch
    • ecwid_store_pages
    • ecwid_remove_emoji
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • ecwid_hide_canonical
    • ecwid_static_home_page_enabled
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecwid-help
    • > Notice in wp-content/plugins/ecwid-shopping-cart/includes/class-ecwid-message-manager.php+80
    Undefined index: primary_blank
    • > GET request to /wp-admin/admin.php?page=ec-admin-mobile
    • > Notice in wp-content/plugins/ecwid-shopping-cart/templates/admin-footer.php+4
    Undefined variable: show_reconnect

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ecwid-shopping-cart/lib/html-catalog-templates/category.php
    • > /wp-content/plugins/ecwid-shopping-cart/templates/shortcode-pb-placeholder.php
    • > /wp-content/plugins/ecwid-shopping-cart/templates/shortcode-stub-buynow.tpl.php
  • 287× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ecwid-shopping-cart/templates/admin-params.php:11
    • > PHP Warning
      require_once(ECWID_THEMES_DIR/class-ecwid-theme-base.php): failed to open stream: No such file or directory in wp-content/plugins/ecwid-shopping-cart/includes/themes/class-ecwid-theme-enfold.php on line 2
    • > PHP Warning
      Use of undefined constant ECWID_PLUGIN_DIR - assumed 'ECWID_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecwid-shopping-cart/includes/widgets/class-ecwid-widget-products-base.php on line 3
    • > PHP Warning
      Use of undefined constant ECWID_PLUGIN_DIR - assumed 'ECWID_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecwid-shopping-cart/lib/ecwid_platform.php on line 4
    • > PHP Warning
      Use of undefined constant ECWID_PLUGIN_DIR - assumed 'ECWID_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecwid-shopping-cart/includes/widgets/class-ecwid-widget-minicart.php on line 3
    • > PHP Warning
      require_once(ECWID_THEMES_DIR/class-ecwid-theme-base.php): failed to open stream: No such file or directory in wp-content/plugins/ecwid-shopping-cart/includes/themes/class-ecwid-theme-bridge.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ECWID_PLUGIN_DIRincludes/integrations/class-ecwid-integration-cache-base.php' (include_path='.:/usr/share/php') in wp-content/plugins/ecwid-shopping-cart/includes/integrations/class-ecwid-integration-wprocket.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Ecwid_Importer_Task_Product_Base' not found in wp-content/plugins/ecwid-shopping-cart/includes/importer/task/class-ecwid-importer-task-import-woo-product.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ecwid_wrap_shortcode_content() in wp-content/plugins/ecwid-shopping-cart/templates/product.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/ecwid-shopping-cart/includes/class-ecwid-store-editor.php:5

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 take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=ecwid-debug
    • > Network (severe)
    wp-admin/admin.php?page=ec-store-debug - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=ecwid-sync
    • > Network (severe)
    wp-admin/admin.php?page=ec-store-sync - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=ecwid-install-theme
    • > Network (severe)
    wp-admin/admin.php?page=ec-store-install-theme - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration Passed 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
5 plugin tags: shopping cart, online store, e-commerce, storefront, ecommerce

ecwid-shopping-cart/ecwid-shopping-cart.php Passed 13 tests

The principal PHP file in "Ecwid Ecommerce Shopping Cart" v. 6.12.5 is loaded by WordPress automatically on each request
137 characters long description:
Ecwid is a free full-featured shopping cart. It can be easily integrated with any Wordpress blog and takes less than 5 minutes to set up.

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin47,261 lines of code in 377 files:
LanguageFilesBlank linesComment linesLines of code
PHP1995,8311,84723,247
CSS602,00528810,685
PO File73,3813,7096,856
JavaScript411,1746064,150
JSX102312601,087
SVG58434873
Sass1660304
JSON10059

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity15.58
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes151
▷ Abstract classes149.27%
▷ Concrete classes13790.73%
▷ Final classes00.00%
Methods1,073
▷ Static methods27025.16%
▷ Public methods86480.52%
▷ Protected methods20619.20%
▷ Private methods30.28%
Functions149
▷ Named functions14899.33%
▷ Anonymous functions10.67%
Constants218
▷ Global constants3214.68%
▷ Class constants18685.32%
▷ Public constants186100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
60 PNG files occupy 1.42MB with 1.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/gutenberg/categories-menu-preview.png0.76KB0.29KB▼ 62.66%
images/gutenberg/categories5.png55.70KB12.24KB▼ 78.02%
images/icon-sidebar-active.png20.31KB0.55KB▼ 97.29%
images/icon-title.png20.54KB0.94KB▼ 95.41%
images/gutenberg/categories1.png36.71KB6.89KB▼ 81.23%