84% product-category

Code Review | Product Category

WordPress plugin Product Category scored84%from 54 tests.

About plugin

  • Plugin page: product-category
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Mar 2, 2019
  • Latest release: Apr 16, 2023
  • Number of updates: 34
  • Update frequency: every 44.3 days
  • Top authors: kushang78 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /4,201 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.90ms] Passed 4 tests

Server-side resources used by Product Category
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.51 ▼2.94
Dashboard /wp-admin3.31 ▲0.0149.50 ▲3.89
Posts /wp-admin/edit.php3.36 ▲0.0143.13 ▼2.99
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.00 ▼12.21
Media Library /wp-admin/upload.php3.23 ▲0.0033.00 ▼1.44

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Product Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.27 ▼1.161.79 ▼0.1579.26 ▲34.79
Dashboard /wp-admin2,219 ▲314.86 ▼0.08110.89 ▲11.4242.51 ▼1.57
Posts /wp-admin/edit.php2,102 ▲162.05 ▲0.0435.91 ▼3.3636.50 ▲2.77
Add New Post /wp-admin/post-new.php1,530 ▼323.49 ▲0.31698.83 ▲9.4155.42 ▼3.33
Media Library /wp-admin/upload.php1,407 ▲194.21 ▼0.0699.20 ▼6.9543.13 ▲0.74

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% 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 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
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/product-category/product-category.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-category/includes/shortcode/shortcode.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-category/includes/widget/woo-product-category-widget.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #7, #8 in product-category/assets to your readme.txt
Please take inspiration from this readme.txt

product-category/product-category.php Passed 13 tests

"Product Category" version 1.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
111 characters long description:
Now Customize your Product Category page as you want using Widget and Shortcode with Built-in Default 5 Styles.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,598 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP5992421,013
CSS31446533
PO File14436
SVG30016

PHP code Passed 2 tests

Analyzing 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.17
Average class complexity13.33
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1381.25%
▷ Protected methods318.75%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
24 PNG files occupy 0.86MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/pcw.png3.82KB1.22KB▼ 68.12%
includes/shortcode/images/logo-2.png6.31KB2.72KB▼ 56.87%
includes/shortcode/images/page14.png235.22KB80.54KB▼ 65.76%
includes/shortcode/images/page5.png39.42KB20.09KB▼ 49.04%
includes/shortcode/images/copy.png3.67KB2.87KB▼ 21.69%