57% simple-e-commerce-shopping-cart

Code Review | Simple Ecommerce Shopping Cart Plugin- Sell products through Paypal

WordPress plugin Simple Ecommerce Shopping Cart Plugin- Sell products through Paypal scored57%from 54 tests.

About plugin

  • Plugin page: simple-e-commerce...
  • Plugin version: 3.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2012
  • Latest release: Jun 1, 2023
  • Number of updates: 100
  • Update frequency: every 40.0 days
  • Top authors: n.showket@gmail.com (78%)waseef98 (14%)naim42 (8%)wpbizcart (3%)

Code review

54 tests

User reviews

114 reviews

Install metrics

200+ active /69,433 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.64MB] [CPU: ▲1.55ms] Passed 4 tests

Analyzing server-side resources used by Simple Ecommerce Shopping Cart Plugin- Sell products through Paypal
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.41 ▲1.9459.92 ▲16.74
Dashboard /wp-admin5.23 ▲1.8861.41 ▼5.38
Posts /wp-admin/edit.php5.28 ▲1.9268.55 ▲17.61
Add New Post /wp-admin/post-new.php6.74 ▲0.8580.94 ▼22.77
Media Library /wp-admin/upload.php5.15 ▲1.9259.87 ▲21.94
Add/Edit Products /wp-admin/admin.php?page=simpleecommcart-products5.3864.80
Coupons /wp-admin/admin.php?page=simpleecommcart-promotions5.1951.57
Settings /wp-admin/admin.php?page=simpleecommcart-settings5.3373.96
Reports /wp-admin/admin.php?page=simpleecommcart_admin5.3080.35
Orders /wp-admin/admin.php?page=simpleecommcart-orders5.0747.08
Tax /wp-admin/admin.php?page=simpleecommcart-tax5.1047.63
Shipping /wp-admin/admin.php?page=simpleecommcart-shipping5.1049.39
Inventory /wp-admin/admin.php?page=simpleecommcart-inventory5.0745.96

Server storage [IO: ▲2.54MB] [DB: ▲0.02MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 170 new files
Database: 15 new tables, 7 new options
New tables
wp_simpleecommcart_shipping_table_rate
wp_simpleecommcart_shipping_weight_rate
wp_simpleecommcart_shipping_variation
wp_simpleecommcart_downloads
wp_simpleecommcart_products
wp_simpleecommcart_tax_rates
wp_simpleecommcart_cart_settings
wp_simpleecommcart_shipping_rules
wp_simpleecommcart_shipping_rates
wp_simpleecommcart_product_categories
...
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_simpleecommcartcartwidget
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Ecommerce Shopping Cart Plugin- Sell products through Paypal
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲16813.26 ▼0.948.66 ▲6.8842.59 ▼0.97
Dashboard /wp-admin2,250 ▲705.51 ▼0.1190.33 ▼2.7473.43 ▲28.92
Posts /wp-admin/edit.php2,149 ▲491.96 ▼0.0238.92 ▼0.9039.16 ▲0.69
Add New Post /wp-admin/post-new.php1,568 ▲4222.61 ▼0.37654.93 ▼16.82166.39 ▲104.93
Media Library /wp-admin/upload.php1,449 ▲494.17 ▼0.00102.02 ▼7.1780.82 ▲36.61
Add/Edit Products /wp-admin/admin.php?page=simpleecommcart-products1,9032.1936.3547.44
Coupons /wp-admin/admin.php?page=simpleecommcart-promotions1,4062.4653.5833.08
Settings /wp-admin/admin.php?page=simpleecommcart-settings3,9882.0734.5538.39
Reports /wp-admin/admin.php?page=simpleecommcart_admin2,3492.0626.3238.62
Orders /wp-admin/admin.php?page=simpleecommcart-orders8602.0324.6426.35
Tax /wp-admin/admin.php?page=simpleecommcart-tax1,1222.0827.6131.27
Shipping /wp-admin/admin.php?page=simpleecommcart-shipping1,1582.0826.3128.20
Inventory /wp-admin/admin.php?page=simpleecommcart-inventory8632.0626.5227.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/simple-e-commerce-shopping-cart/uninstall.php+7
    Constant SIMPLEECOMMCART_PATH already defined
  • Zombie tables were found after uninstall: 15 tables
    • wp_simpleecommcart_product_categories
    • wp_simpleecommcart_shipping_table_rate
    • wp_simpleecommcart_promotions
    • wp_simpleecommcart_inventory
    • wp_simpleecommcart_shipping_weight_rate
    • wp_simpleecommcart_shipping_rates
    • wp_simpleecommcart_shipping_rules
    • wp_simpleecommcart_order_items
    • wp_simpleecommcart_products
    • wp_simpleecommcart_sessions
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_simpleecommcartcartwidget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/simple-e-commerce-shopping-cart/views/cart-button-anchor.php
    • > /wp-content/plugins/simple-e-commerce-shopping-cart/advanced/views/feature-level-meta-box.php
    • > /wp-content/plugins/simple-e-commerce-shopping-cart/admin/more.php
    • > /wp-content/plugins/simple-e-commerce-shopping-cart/admin/orders.php
    • > /wp-content/plugins/simple-e-commerce-shopping-cart/js/simpleecommcartDialog.php
    • > /wp-content/plugins/simple-e-commerce-shopping-cart/admin/inventory.php
  • 90× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/simple-e-commerce-shopping-cart/views/checkout.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Chart' not found in wp-content/plugins/simple-e-commerce-shopping-cart/libchart/classes/view/chart/BarChart.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'SimpleEcommCartCommon' not found in wp-content/plugins/simple-e-commerce-shopping-cart/views/client/checkout.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-e-commerce-shopping-cart/advanced/admin/inventory.php:3
    • > PHP Notice
      Undefined variable: url in wp-content/plugins/simple-e-commerce-shopping-cart/advanced/idevaffiliate-award.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'SimpleEcommCartModelAbstract' not found in wp-content/plugins/simple-e-commerce-shopping-cart/models/SimpleEcommCartTaxRate.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-e-commerce-shopping-cart/views/checkout.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-e-commerce-shopping-cart/views/cart-sidebar.php on line 7
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/simple-e-commerce-shopping-cart/views/cart-sidebar-advanced.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'SimpleEcommCartModelAbstract' not found in wp-content/plugins/simple-e-commerce-shopping-cart/models/SimpleEcommCartShippingRate.php: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 83% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Contributors: The plugin contributors field is missing
The official readme.txt might help

simple-e-commerce-shopping-cart/simpleecommcart.php 77% from 13 tests

The entry point to "Simple Ecommerce Shopping Cart Plugin- Sell products through Paypal" version 3.1.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-e-commerce-shopping-cart.php" instead of "simpleecommcart.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 202 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin20,908 lines of code in 111 files:
LanguageFilesBlank linesComment linesLines of code
PHP942,4972,91216,075
XML1002,980
CSS5161741,219
JavaScript98973389
SQL2150245

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity23.77
▷ Minimum class complexity1.00
▷ Maximum class complexity298.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes61
▷ Abstract classes69.84%
▷ Concrete classes5590.16%
▷ Final classes00.00%
Methods649
▷ Static methods14021.57%
▷ Public methods58289.68%
▷ Protected methods619.40%
▷ Private methods60.92%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants24100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
42 compressed PNG files occupy 0.45MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
ChartFolder/individual5.png3.14KB1.88KB▼ 40.01%
admin/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
images/btn-bg.png0.17KB0.20KB0.00%
admin/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%