90% hide-product-image-for-woocommerce

Code Review | Hide Product Image for WooCommerce

WordPress plugin Hide Product Image for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: hide-product-imag...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 16, 2022
  • Latest release: Aug 9, 2023
  • Number of updates: 9
  • Update frequency: every 59.9 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /2,010 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.05MB] [CPU: ▼3.87ms] Passed 4 tests

A check of server-side resources used by Hide Product Image for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.42 ▼8.35
Dashboard /wp-admin3.35 ▲0.0558.04 ▼0.52
Posts /wp-admin/edit.php3.47 ▲0.1160.94 ▼0.22
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.78 ▼5.58
Media Library /wp-admin/upload.php3.28 ▲0.0537.58 ▼1.03
Hide Product Image for WooCommerce /wp-admin/options-general.php?page=hide-product-image-wc-settings3.2432.96

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
hpifwc_hide_all_prod_img
can_compress_scripts
db_upgraded
hide_prod_img_wc_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Hide Product Image for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.69 ▲0.341.67 ▼0.1138.86 ▼3.94
Dashboard /wp-admin2,196 ▲195.63 ▲0.0394.98 ▲4.4641.47 ▼2.81
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.0336.08 ▼4.9433.01 ▼2.99
Add New Post /wp-admin/post-new.php1,538 ▲1218.32 ▼5.24661.90 ▼52.4486.23 ▲34.77
Media Library /wp-admin/upload.php1,398 ▼24.18 ▲0.0297.86 ▼16.3643.15 ▼4.26
Hide Product Image for WooCommerce /wp-admin/options-general.php?page=hide-product-image-wc-settings8122.0129.1628.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • hide_prod_img_wc_db_version
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • hpifwc_hide_all_prod_img
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 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: e-commerce, woocommerce, woo, image, product

hide-product-image-for-woocommerce/main.php 92% from 13 tests

"Hide Product Image for WooCommerce" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hide-product-image-for-woocommerce.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected300 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33633263
CSS20037

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
addons/images/hpifwc-hide-images-by-products.png3.30KB2.42KB▼ 26.67%