10% ecommerce-shopping-cart-by-inventorycom

Code Review | eCommerce Shopping Cart by Inventory.com

WordPress plugin eCommerce Shopping Cart by Inventory.com scored 10% from 54 tests.

About plugin

  • Plugin page: ecommerce-shoppin...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8
  • WordPress version: 5.8.1
  • First release: Dec 20, 2013
  • Latest release: Jan 27, 2014
  • Number of updates: 13
  • Update frequency: every 3.0 days
  • Top authors: inventory (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 6,887 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/lib/helpers/ec_helper_functions.php+210
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼0.00MB] [CPU: ▼179.18ms] Passed 4 tests

An overview of server-side resources used by eCommerce Shopping Cart by Inventory.com
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1224.43 ▲2.16
Dashboard /wp-admin3.06 ▼0.0029.28 ▼9.23
Posts /wp-admin/edit.php3.11 ▲0.0032.36 ▲1.72
Add New Post /wp-admin/post-new.php5.42 ▼0.0268.02 ▼710.34
Media Library /wp-admin/upload.php3.00 ▲0.0024.36 ▲1.12

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 91 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

eCommerce Shopping Cart by Inventory.com: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.68 ▲0.106.22 ▼2.8674.85 ▼8.85
Dashboard /wp-admin2,930 ▲346.06 ▼0.07115.78 ▼17.68165.39 ▼10.74
Posts /wp-admin/edit.php2,740 ▼03.23 ▼0.0171.70 ▲9.42148.02 ▲13.37
Add New Post /wp-admin/post-new.php3,807 ▲6618.57 ▲0.05464.56 ▲26.71164.75 ▲6.49
Media Library /wp-admin/upload.php1,752 ▼05.48 ▼0.05139.08 ▲3.20185.10 ▲3.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/uninstall.php+31
    count(): Parameter must be an array or an object that implements Countable

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 27× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/views/frontend/thankyou-page.tpl.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/views/parts/ec-cart-widget.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/templates/front-page.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/lib/widgets/ECCategories.widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/templates/content-matrix-product.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'ERPLY' not found in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/lib/helpers/ERPLYAPI.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ECShipping' not found in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/lib/shipping/erply.shipping.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/templates/parts/single-page-tabs.tpl.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/lib/widgets/ECLogin.widget.php:2
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/ecommerce-shopping-cart-by-inventorycom/views/frontend/search-page-tpl.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
The official readme.txt might help

ecommerce-shopping-cart-by-inventorycom/plugin.php 92% from 13 tests

The main PHP script in "eCommerce Shopping Cart by Inventory.com" version 1.0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ecommerce-shopping-cart-by-inventorycom.php" instead of "plugin.php")

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
Everything looks great! No dangerous files found in this plugin8,015 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PHP559078945,285
JavaScript620545997
Sass3468731
CSS510720512
PO File2218465482
Ruby16117
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity17.89
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes00.00%
Methods250
▷ Static methods145.60%
▷ Public methods20381.20%
▷ Protected methods00.00%
▷ Private methods4718.80%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/js/swipebox/img/icons.png0.71KB0.43KB▼ 39.64%