77% tc-product-catalog

Code Review | Product Catalog

WordPress plugin Product Catalog scored77%from 54 tests.

About plugin

  • Plugin page: tc-product-catalog
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 21, 2016
  • Latest release: Feb 8, 2021
  • Number of updates: 48
  • Update frequency: every 33.4 days
  • Top authors: imranemu (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /30,243 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by Product Catalog
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.97 ▼3.13
Dashboard /wp-admin3.42 ▲0.0747.11 ▼18.48
Posts /wp-admin/edit.php3.53 ▲0.1752.11 ▲4.63
Add New Post /wp-admin/post-new.php6.00 ▲0.1196.83 ▼0.94
Media Library /wp-admin/upload.php3.34 ▲0.1136.34 ▲1.59
Product Catalogs /wp-admin/edit-tags.php?taxonomy=tcpc_catalog&post_type=tcpc3.3336.47
Product Category /wp-admin/edit-tags.php?taxonomy=tcpc_category&post_type=tcpc3.3334.79
All Products /wp-admin/edit.php?post_type=tcpc3.3838.26
Add New Product /wp-admin/post-new.php?post_type=tcpc3.4753.32
Help & Upgrade /wp-admin/edit.php?post_type=tcpc&page=tcpc_menu_help3.3031.12

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Product Catalog
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.16 ▼1.221.69 ▼0.3243.73 ▲0.83
Dashboard /wp-admin2,243 ▲524.88 ▼0.0397.37 ▼19.8168.20 ▲25.60
Posts /wp-admin/edit.php2,129 ▲432.00 ▲0.0337.34 ▲1.3936.45 ▲4.92
Add New Post /wp-admin/post-new.php1,551 ▲1817.80 ▼5.39684.41 ▲69.5757.81 ▲11.75
Media Library /wp-admin/upload.php1,428 ▲404.23 ▲0.0295.57 ▼3.1481.86 ▲41.16
Product Catalogs /wp-admin/edit-tags.php?taxonomy=tcpc_catalog&post_type=tcpc1,3052.1428.4129.04
Product Category /wp-admin/edit-tags.php?taxonomy=tcpc_category&post_type=tcpc1,3022.1425.6231.06
All Products /wp-admin/edit.php?post_type=tcpc1,1472.0733.1529.65
Add New Product /wp-admin/post-new.php?post_type=tcpc2,4567.93163.75125.31
Help & Upgrade /wp-admin/edit.php?post_type=tcpc&page=tcpc_menu_help1,4839.14266.8669.99

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tc-product-catalog/lib/tcpc-help-upgrade.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tc-product-catalog/lib/tcpc-metabox.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tc-product-catalog/lib/tcpc-cpt.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/tc-product-catalog/lib/tcpc-column.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/tc-product-catalog/public/tcpc-view.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tc-product-catalog/tc-product-catalog.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tc-product-catalog/lib/tcpc-taxonomy.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

tc-product-catalog/tc-product-catalog.php 85% from 13 tests

The principal PHP file in "Product Catalog" v. 1.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 278 characters long)

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
Everything looks great! No dangerous files found in this plugin625 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP911492396
CSS23211229

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.50
▷ Minimum method complexity2.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
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/images/tcpc.png3.83KB1.22KB▼ 68.15%