78% woo-hide-options

Code Review | Woocommerce Hide Options

WordPress plugin Woocommerce Hide Options scored78%from 54 tests.

About plugin

  • Plugin page: woo-hide-options
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Jun 21, 2018
  • Latest release: Aug 4, 2022
  • Number of updates: 27
  • Update frequency: every 55.7 days
  • Top authors: husainahmedqureshi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,613 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.43ms] Passed 4 tests

A check of server-side resources used by Woocommerce Hide Options
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.99 ▼1.00
Dashboard /wp-admin3.33 ▲0.0246.74 ▼5.98
Posts /wp-admin/edit.php3.38 ▲0.0247.18 ▼1.86
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.57 ▼4.87
Media Library /wp-admin/upload.php3.25 ▲0.0235.25 ▲0.90

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Hide Options
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.22 ▼1.381.70 ▼0.0239.89 ▼8.04
Dashboard /wp-admin2,208 ▲204.85 ▼0.05104.54 ▼5.6943.56 ▲3.31
Posts /wp-admin/edit.php2,100 ▲112.01 ▲0.0339.28 ▲0.0937.01 ▲1.27
Add New Post /wp-admin/post-new.php1,423 ▼9116.43 ▼1.03565.06 ▼115.2964.25 ▲3.34
Media Library /wp-admin/upload.php1,393 ▲84.16 ▼0.0796.14 ▼9.4843.26 ▼3.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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 following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-hide-options/woocommerce-hide-options.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-hide-options/wchos-functions.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
9 plugin tags: hide releted products, hide coupon code field, hide feature products, hide price, hide description tab...

woo-hide-options/woocommerce-hide-options.php 85% from 13 tests

The principal PHP file in "Woocommerce Hide Options" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-hide-options.php" instead of "woocommerce-hide-options.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

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
Everything looks great! No dangerous files found in this plugin162 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26272162

PHP code Passed 2 tests

This is a very shot review of 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.33
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin