66% woocommerce-catalog

Code Review | Woocommerce Catalog

WordPress plugin Woocommerce Catalog scored 66% from 54 tests.

About plugin

  • Plugin page: woocommerce-catalog
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.5.2
  • WordPress version: 5.8.1
  • First release: Nov 16, 2014
  • Latest release: Sep 11, 2016
  • Number of updates: 25
  • Update frequency: every 26.6 days
  • Top authors: pantrif (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active / 58,168 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.67MB] [CPU: ▼173.83ms] Passed 4 tests

This is a short check of server-side resources used by Woocommerce Catalog
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.1140.24 ▲4.60
Dashboard /wp-admin2.98 ▼0.0726.99 ▼19.09
Posts /wp-admin/edit.php2.98 ▼0.1427.81 ▼29.51
Add New Post /wp-admin/post-new.php2.98 ▼2.4531.59 ▼634.69
Media Library /wp-admin/upload.php2.98 ▼0.0223.88 ▼12.01
Woocommerce Catalog Mode /wp-admin/options-general.php?page=woo_Catalog_settings2.9828.54

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Catalog
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲7115.82 ▲0.2811.31 ▲2.8151.95 ▲4.74
Dashboard /wp-admin2,997 ▲695.89 ▼0.05156.82 ▲14.18118.35 ▲3.28
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0071.84 ▲3.7295.01 ▲0.61
Add New Post /wp-admin/post-new.php1,618 ▼6521.46 ▲3.24281.81 ▼128.72112.22 ▲6.35
Media Library /wp-admin/upload.php1,830 ▲205.04 ▲0.03154.23 ▼20.92130.88 ▲6.73
Woocommerce Catalog Mode /wp-admin/options-general.php?page=woo_Catalog_settings1,8754.86117.92109.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/woocommerce-catalog/include/php/settings.php+188
    Trying to get property 'name' of non-object

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=woo_Catalog_settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/woocommerce-catalog/include/php/settings.php+188
    Trying to get property 'name' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=woo_Catalog_settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/woocommerce-catalog/include/php/settings.php+189
    Trying to get property 'term_id' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woocommerce-catalog/include/css/style.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-catalog/woocommerce_catalogue.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woocommerce-catalog/woocommerce_catalogue.php:34

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=woo_Catalog_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,farbtastic&ver=5.8.1 1:31592 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/woocommerce-catalog/include/js/admin.js?ver=1.0.0:193:31)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,farbtastic&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,farbtastic&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/options-general.php?page=woo_Catalog_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,farbtastic&ver=5.8.1 1:31702 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Please add images for these screenshots: #1 (The basic settings to get you started.), #2 (Customize the custom button as you like.)
You can take inspiration from this readme.txt

woocommerce-catalog/woocommerce_catalogue.php 92% from 13 tests

The entry point to "Woocommerce Catalog" version 1.2.5 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-catalog.php" instead of "woocommerce_catalogue.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin386 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript24865190
PHP34620163
CSS212033

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity30.00
▷ Minimum class complexity20.00
▷ Maximum class complexity40.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2395.83%
▷ Protected methods00.00%
▷ Private methods14.17%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
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
include/icons/infinite.png4.60KB2.26KB▼ 50.84%