71% wc-product-table-lite

Code Review | WooCommerce Product Table Lite

WordPress plugin WooCommerce Product Table Lite scored71%from 54 tests.

About plugin

  • Plugin page: wc-product-table-...
  • Plugin version: 3.1.2
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.4-6.3.0
  • WordPress version: 6.3.1
  • First release: Sep 4, 2018
  • Latest release: Nov 19, 2023
  • Number of updates: 89
  • Update frequency: every 21.4 days
  • Top authors: wcproducttable (100%)

Code review

54 tests

User reviews

228 reviews

Install metrics

10,000+ active /141,626 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.10MB] [CPU: ▲7.08ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Product Table Lite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.57 ▲1.1143.00 ▲2.15
Dashboard /wp-admin4.40 ▲1.1062.75 ▲15.86
Posts /wp-admin/edit.php4.45 ▲1.1056.74 ▲6.45
Add New Post /wp-admin/post-new.php7.00 ▲1.1293.90 ▲8.91
Media Library /wp-admin/upload.php4.32 ▲1.0945.01 ▲10.79
Add New Product Table /wp-admin/post-new.php?post_type=wc_product_table3.4119.96
Addons /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-addons4.2343.25
Product Tables /wp-admin/edit.php?post_type=wc_product_table4.3842.02
Add New Table /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-edit4.1229.59
Settings /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-settings4.3338.22

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 567 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

WooCommerce Product Table Lite: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲9114.14 ▼0.601.67 ▲0.0041.39 ▲1.09
Dashboard /wp-admin2,252 ▲745.62 ▼0.0791.03 ▼18.8437.88 ▼4.77
Posts /wp-admin/edit.php2,164 ▲612.04 ▲0.0239.78 ▼4.8234.26 ▼5.26
Add New Post /wp-admin/post-new.php1,581 ▲5523.32 ▼0.55676.93 ▼10.7554.51 ▼0.86
Media Library /wp-admin/upload.php1,463 ▲634.22 ▲0.04106.87 ▼7.6744.36 ▼1.87
Add New Product Table /wp-admin/post-new.php?post_type=wc_product_table1,0593.6950.0384.69
Addons /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-addons8132.0224.9422.42
Product Tables /wp-admin/edit.php?post_type=wc_product_table1,2532.0534.3836.24
Add New Table /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-edit1,0563.7046.4238.64
Settings /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-settings1,0563.6948.6639.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wc_product_table&page=wcpt-edit
    • > Notice in wp-content/plugins/wc-product-table-lite/presets/presets.php+109
    Undefined index: post_id

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
The following issues need your attention
  • 41× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/style/borders.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/style/cells.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/space.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/heading_format__op_selected.php
    • > /wp-content/plugins/wc-product-table-lite/templates/row-close.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/dot.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/price-style.php
    • > /wp-content/plugins/wc-product-table-lite/templates/cell-value-close.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/sort_modal.php
    • > /wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/badge.php
  • 133× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_get_table_data() in wp-content/plugins/wc-product-table-lite/templates/lazy-load.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_icon() in wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/style/parent-child.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_get_table_data() in wp-content/plugins/wc-product-table-lite/editor/partials/checklist.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-product-table-lite/presets/presets.php:14
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/wc-product-table-lite/editor/settings-partials/search__common1.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/wc-product-table-lite/editor/settings-partials/archive-override.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_icon() in wp-content/plugins/wc-product-table-lite/editor/settings-partials/search__common2.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_print_icon_dopdown() in wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/icon.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_general_placeholders__print_placeholders() in wp-content/plugins/wc-product-table-lite/editor/partials/element-editor/partials/html__col.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcpt_pro_badge() in wp-content/plugins/wc-product-table-lite/editor/settings-partials/search.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

wc-product-table-lite/main.php 77% from 13 tests

The entry point to "WooCommerce Product Table Lite" version 3.1.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.9" instead of "3.4.4")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-product-table-lite.php" instead of "main.php")
  • 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 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected46,174 lines of code in 554 files:
LanguageFilesBlank linesComment linesLines of code
PHP2285,0701,79726,250
JavaScript303,0792,34810,734
CSS221,7704528,689
SVG26900274
HTML3328225
JSON2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity85.60
▷ Minimum class complexity1.00
▷ Maximum class complexity194.00
Average method complexity6.10
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods83
▷ Static methods910.84%
▷ Public methods7387.95%
▷ Protected methods67.23%
▷ Private methods44.82%
Functions170
▷ Named functions16999.41%
▷ Anonymous functions10.59%
Constants13
▷ Global constants430.77%
▷ Class constants969.23%
▷ Public constants9100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 1.14MB with 0.85MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
presets/thumb/list-layout.png367.13KB98.48KB▼ 73.18%
presets/thumb/compact-table.png516.38KB139.37KB▼ 73.01%
presets/thumb/regular-table.png270.35KB75.45KB▼ 72.09%
presets/thumb/blank.png14.30KB2.96KB▼ 79.29%