60% usc-e-shop

Code Review | Welcart e-Commerce

WordPress plugin Welcart e-Commerce scored60%from 54 tests.

About plugin

  • Plugin page: usc-e-shop
  • Plugin version: 2.9.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Oct 23, 2009
  • Latest release: Nov 22, 2023
  • Number of updates: 2,288
  • Update frequency: every 2.3 days
  • Top authors: uscnanbu (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20,000+ active /981,625 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲17.90MB] [CPU: ▲166.04ms] 50% from 4 tests

Server-side resources used by Welcart e-Commerce
The following require your attention
  • RAM: Total memory usage should be kept under 10MB (currently 21.44MB on /wp-admin/admin.php?page=usces_memberlist)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 17.90MB on /wp-admin/admin.php?page=usces_memberlist)
PageMemory (MB)CPU Time (ms)
Home /21.63 ▲18.17178.30 ▲137.60
Dashboard /wp-admin21.27 ▲17.971,111.92 ▲1,063.04
Posts /wp-admin/edit.php21.24 ▲17.88213.56 ▲162.38
Add New Post /wp-admin/post-new.php23.76 ▲17.87239.98 ▲150.89
Media Library /wp-admin/upload.php21.11 ▲17.88242.85 ▲213.27
Operation log /wp-admin/admin.php?page=usces_loglist21.08157.04
New Order or Estimate /wp-admin/admin.php?page=usces_ordernew21.67184.69
General Setting /wp-admin/admin.php?page=usces_initial21.36159.36
Settlement Setting /wp-admin/admin.php?page=usces_settlement21.14168.11
Cart Page Setting /wp-admin/admin.php?page=usces_cart21.23167.50
E-mail Setting /wp-admin/admin.php?page=usces_mail21.43164.64
Business Days Setting /wp-admin/admin.php?page=usces_schedule21.49159.14
Master Items /wp-admin/admin.php?page=usces_itemedit21.38151.81
Order List /wp-admin/admin.php?page=usces_orderlist21.67154.12
List of Members /wp-admin/admin.php?page=usces_memberlist21.44153.80

Server storage [IO: ▲16.40MB] [DB: ▲0.36MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 363 new files
Database: 13 new tables, 59 new options
New tables
wp_usces_admin_log
wp_usces_skus
wp_usces_order
wp_usces_access
wp_usces_ordercart_meta
wp_usces_opts
wp_usces_log
wp_usces_ordercart
wp_usces_order_meta
wp_usces_member_meta
...
New WordPress options
usces_display_mode
widget_welcart-blog-calendar
usces_memberlist_option
widget_recent-comments
usces_custom_customer_select
usces_db_order
usces
usces_upgrade
can_compress_scripts
usces_db_opts
...

Browser metrics Passed 4 tests

Checking browser requirements for Welcart e-Commerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,475 ▲68813.88 ▼0.827.37 ▲5.3536.39 ▼8.19
Dashboard /wp-admin2,772 ▲5985.74 ▲0.1085.19 ▼13.1791.13 ▲46.21
Posts /wp-admin/edit.php2,279 ▲1762.03 ▲0.0838.84 ▼2.7938.28 ▲1.17
Add New Post /wp-admin/post-new.php1,763 ▲23719.93 ▼3.27681.29 ▲80.7753.42 ▲10.34
Media Library /wp-admin/upload.php1,501 ▲1014.16 ▲0.0197.06 ▲1.6443.99 ▲0.86
Operation log /wp-admin/admin.php?page=usces_loglist1,4602.1334.1528.99
New Order or Estimate /wp-admin/admin.php?page=usces_ordernew2,6902.5879.7640.07
General Setting /wp-admin/admin.php?page=usces_initial2,3942.4671.8843.63
Settlement Setting /wp-admin/admin.php?page=usces_settlement1,0772.3856.9062.48
Cart Page Setting /wp-admin/admin.php?page=usces_cart1,8832.0945.8048.01
E-mail Setting /wp-admin/admin.php?page=usces_mail2,2002.2541.7443.73
Business Days Setting /wp-admin/admin.php?page=usces_schedule5,1291.8534.7143.90
Master Items /wp-admin/admin.php?page=usces_itemedit1,3462.6053.9932.79
Order List /wp-admin/admin.php?page=usces_orderlist3,1113.7199.0636.22
List of Members /wp-admin/admin.php?page=usces_memberlist1,9112.1958.2233.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 13 tables
    • wp_usces_log
    • wp_usces_skus
    • wp_usces_order_meta
    • wp_usces_access
    • wp_usces_order
    • wp_usces_ordercart_meta
    • wp_usces_ordercart
    • wp_usces_member
    • wp_usces_opts
    • wp_usces_item
    • ...
  • This plugin does not fully uninstall, leaving 59 options in the database
    • usces_db_ordercart
    • usces_db_access
    • usces_customer_status
    • widget_welcart_post
    • usces_order_mail_print_fields
    • usces_memberlist_option
    • db_upgraded
    • usces_wcid
    • widget_recent-comments
    • usces_upgrade2
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=usces_memberlist
    • > Notice in wp-content/plugins/usc-e-shop/classes/memberList.class.php+49
    Trying to access array offset on value of type bool
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=usces_orderlist
    • > Notice in wp-content/plugins/usc-e-shop/classes/orderList2.class.php+209
    Trying to access array offset on value of type null

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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/usc-e-shop/pdf/tcpdf/tools/tcpdf_addfont.php
    • > /wp-content/plugins/usc-e-shop/includes/edit-form-advanced34.php
  • 157× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'USCES_PLUGIN_DIR/classes/dataList.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/usc-e-shop/includes/member_list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/usc-e-shop/includes/admin_member.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'USCES_PLUGIN_DIR/classes/fpdf/fpdf_tpl.php' (include_path='.:/usr/share/php') in wp-content/plugins/usc-e-shop/classes/fpdf/fpdi.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function usces_get_system_option() in wp-content/plugins/usc-e-shop/includes/delivery_secure_form.php:5
    • > PHP Warning
      require_once(USCES_PLUGIN_DIR/classes/fpdf/mbfpdf.php): failed to open stream: No such file or directory in wp-content/plugins/usc-e-shop/classes/fpdf/fpdf_tpl.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/usc-e-shop/templates/cart/cart.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/usc-e-shop/templates/member/member_verifying.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_vars() in wp-content/plugins/usc-e-shop/includes/usces_item_master_edit.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'USCES_PLUGIN_DIR/classes/memberList.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/usc-e-shop/includes/memberlist_page.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/usc-e-shop/classes/loglist.class.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add images for these screenshots: #1 (Item List page on the admin screen), #2 (Editing orders page on the admin screen), #3 (Top page(Free official theme 'Welcart Basic')), #4 (Item page(Free official theme 'Welcart Basic'))
  • Requires php: Version format is invalid
The official readme.txt is a good inspiration

usc-e-shop/usc-e-shop.php 92% from 13 tests

The primary PHP file in "Welcart e-Commerce" version 2.9.7 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 95% from 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 plugin199,988 lines of code in 273 files:
LanguageFilesBlank linesComment linesLines of code
PHP23013,82330,558164,918
PO File611,77819,26525,641
CSS113211694,829
JavaScript245006714,521
JSON20079

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,378)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity165.05
▷ Minimum class complexity1.00
▷ Maximum class complexity4,378.00
Average method complexity8.53
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes129
▷ Abstract classes53.88%
▷ Concrete classes12496.12%
▷ Final classes00.00%
Methods2,851
▷ Static methods1856.49%
▷ Public methods2,26479.41%
▷ Protected methods40614.24%
▷ Private methods1816.35%
Functions789
▷ Named functions77397.97%
▷ Anonymous functions162.03%
Constants433
▷ Global constants29267.44%
▷ Class constants14132.56%
▷ Public constants141100.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.50MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/jquery/color/hv.png2.80KB7.32KB0.00%
images/search.png1.61KB1.45KB▼ 9.71%
js/jquery/color/hs.png2.62KB7.54KB0.00%
css/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
images/login.png1.57KB1.44KB▼ 8.31%