67% hm-product-catalog

Code Review | HM Product Catalog

WordPress plugin HM Product Catalog scored 67% from 54 tests.

About plugin

  • Plugin page: hm-product-catalog
  • Plugin version: 1.7.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 18, 2019
  • Latest release: Jun 22, 2023
  • Number of updates: 62
  • Update frequency: every 21.7 days
  • Top authors: mhmrajib (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 2,639 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼2.96ms] Passed 4 tests

Analyzing server-side resources used by HM Product Catalog
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1740.34 ▲2.35
Dashboard /wp-admin3.47 ▲0.1646.89 ▼1.88
Posts /wp-admin/edit.php3.58 ▲0.2353.46 ▲0.73
Add New Post /wp-admin/post-new.php6.07 ▲0.1984.66 ▼13.04
Media Library /wp-admin/upload.php3.39 ▲0.1633.89 ▲3.07
Product Categories /wp-admin/edit-tags.php?taxonomy=product_category&post_type=products3.3833.76
Help & Usage /wp-admin/admin.php?page=wphpc-get-help3.3630.49
Product Catalogs /wp-admin/edit-tags.php?taxonomy=product_catalog&post_type=products3.3830.87
Add New /wp-admin/post-new.php?post_type=products3.5354.45
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=products3.3941.31
General Settings /wp-admin/admin.php?page=wphpc-settings-section3.4132.73
All Products /wp-admin/edit.php?post_type=products3.4338.06

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for HM Product Catalog
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲13313.21 ▼1.471.67 ▼0.1239.77 ▼1.86
Dashboard /wp-admin2,274 ▲864.93 ▲0.05108.26 ▼6.8263.54 ▲21.27
Posts /wp-admin/edit.php2,151 ▲592.02 ▲0.0139.66 ▼0.8735.64 ▲1.75
Add New Post /wp-admin/post-new.php1,577 ▲4923.40 ▲5.33736.59 ▲129.7752.05 ▼1.20
Media Library /wp-admin/upload.php1,453 ▲624.22 ▼0.1494.26 ▼10.4678.23 ▲34.06
Product Categories /wp-admin/edit-tags.php?taxonomy=product_category&post_type=products1,3272.1426.4935.90
Help & Usage /wp-admin/admin.php?page=wphpc-get-help1,0525.91102.4156.67
Product Catalogs /wp-admin/edit-tags.php?taxonomy=product_catalog&post_type=products1,3242.2728.7825.90
Add New /wp-admin/post-new.php?post_type=products3,0449.23209.31137.11
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=products1,3692.1425.1832.03
General Settings /wp-admin/admin.php?page=wphpc-settings-section1,7066.18133.4833.71
All Products /wp-admin/edit.php?post_type=products1,1981.9631.8427.81

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

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphpc-settings-section
    • > Notice in wp-content/plugins/hm-product-catalog/admin/view/wphpc-admin-settings.php+106
    Trying to access array offset on value of type bool

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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/hm-product-catalog/admin/view/partial/admin-sidebar.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/hm-product-catalog/front/view/single.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphpc-settings-section
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphpc-settings-section
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: affiliate, store, amazon affiliates, amazon, catalog

hm-product-catalog/hm-product-catalog.php Passed 13 tests

Analyzing the main PHP file in "HM Product Catalog" version 1.7.2
85 characters long description:
Product Showcase & Affiliat Plugin for WordPress to display products in your webpage.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin15,723 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32,3381,55312,339
CSS4142621,800
PHP14154621,584

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity8.40
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods2787.10%
▷ Protected methods13.23%
▷ Private methods39.68%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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/img/hmplugin-icon.png3.12KB0.61KB▼ 80.38%