68% goods-catalog

Code Review | Goods Catalog

WordPress plugin Goods Catalog scored 68% from 54 tests.

About plugin

  • Plugin page: goods-catalog
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-5.3.0
  • WordPress version: 5.8.1
  • First release: Mar 1, 2014
  • Latest release: Nov 17, 2019
  • Number of updates: 118
  • Update frequency: every 17.7 days
  • Top authors: oriolo (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active / 57,591 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.83MB] [CPU: ▼178.29ms] Passed 4 tests

Analyzing server-side resources used by Goods Catalog
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.76 ▼0.0720.82 ▼11.44
Dashboard /wp-admin2.82 ▼0.2425.66 ▼24.01
Posts /wp-admin/edit.php2.82 ▼0.2919.46 ▼24.45
Add New Post /wp-admin/post-new.php2.82 ▼2.6217.40 ▼645.18
Media Library /wp-admin/upload.php2.82 ▼0.1918.59 ▼19.52
Tags /wp-admin/edit-tags.php?taxonomy=goods_tag&post_type=goods2.8222.11
Goods Catalog Settings /wp-admin/edit.php?post_type=goods&page=goods-setting-admin2.8219.49
Goods /wp-admin/edit.php?post_type=goods2.8221.45
Goods Categories /wp-admin/edit-tags.php?taxonomy=goods_category&post_type=goods2.8218.35
Add /wp-admin/post-new.php?post_type=goods2.8221.24

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 2 new options
New WordPress options
widget_widget_goods_tags
widget_widget_goods_categories

Browser metrics Passed 4 tests

This is an overview of browser requirements for Goods Catalog
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,735 ▲16315.79 ▼0.0710.96 ▼0.2754.64 ▲1.35
Dashboard /wp-admin3,017 ▲865.90 ▼0.03152.29 ▼1.56115.53 ▼6.45
Posts /wp-admin/edit.php2,789 ▲502.68 ▲0.0068.48 ▼6.8291.70 ▼0.83
Add New Post /wp-admin/post-new.php1,715 ▲3218.39 ▼0.36389.14 ▼18.70126.18 ▲9.02
Media Library /wp-admin/upload.php1,857 ▲475.03 ▲0.00154.30 ▼21.17137.76 ▲14.18
Tags /wp-admin/edit-tags.php?taxonomy=goods_tag&post_type=goods1,7612.5168.8091.53
Goods Catalog Settings /wp-admin/edit.php?post_type=goods&page=goods-setting-admin1,4722.1063.4392.57
Goods /wp-admin/edit.php?post_type=goods1,5062.6365.5781.66
Goods Categories /wp-admin/edit-tags.php?taxonomy=goods_category&post_type=goods1,7862.5069.6388.79
Add /wp-admin/post-new.php?post_type=goods3,5329.10237.63149.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/goods-catalog/inc/class.goods-post-type.php+17
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 2 options
    • widget_widget_goods_categories
    • widget_widget_goods_tags

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 31 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=goods
    • > Notice in wp-content/plugins/goods-catalog/inc/class.goods-tags-taxonomy.php+18
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/edit.php?post_type=goods&page=goods-setting-admin
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit.php?post_type=goods&page=goods-setting-admin
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 24× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/goods-catalog/inc/class.goods-categories-taxonomy.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/goods-catalog/inc/widgets/Widget_Goods_Tags.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/goods-catalog/inc/class.metabox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_term_by() in wp-content/plugins/goods-catalog/templates/taxonomy-goods_category.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/goods-catalog/inc/templates-include.php:65
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/goods-catalog/inc/widgets/Widget_Goods_Categories.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_term_by() in wp-content/plugins/goods-catalog/templates/taxonomy-goods_tag.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/goods-catalog/goods-cat.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/goods-catalog/inc/class.wrapper.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/goods-catalog/templates/single-goods.php:11

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 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention: The official readme.txt might help

goods-catalog/goods-cat.php 92% from 13 tests

The main PHP file in "Goods Catalog" ver. 2.4.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("goods-catalog.php" instead of "goods-cat.php")

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
Good job! No executable or dangerous file extensions detected3,227 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP263425911,615
PO File44576251,246
Markdown51260206
CSS12213151
YAML1009

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/gi.png6.48KB2.74KB▼ 57.72%
img/gc.png2.80KB1.91KB▼ 31.79%