89% hide-cart-by-condition

Code Review | Hide Cart By Condition.

WordPress plugin Hide Cart By Condition. scored89%from 54 tests.

About plugin

  • Plugin page: hide-cart-by-cond...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 17, 2021
  • Latest release: Jul 17, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: srinathdevinfo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /275 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.01MB] [CPU: ▼2.00ms] Passed 4 tests

Analyzing server-side resources used by Hide Cart By Condition.
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.10 ▼1.06
Dashboard /wp-admin3.32 ▲0.0261.31 ▲0.55
Posts /wp-admin/edit.php3.37 ▲0.0142.57 ▼2.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.88 ▼3.87
Media Library /wp-admin/upload.php3.24 ▲0.0134.62 ▼0.57

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hide Cart By Condition.
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.56 ▼0.754.37 ▲2.5142.13 ▼3.05
Dashboard /wp-admin2,209 ▲185.88 ▲0.8698.28 ▼19.1738.61 ▼5.16
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0537.05 ▼3.0531.80 ▼1.36
Add New Post /wp-admin/post-new.php1,542 ▲2218.35 ▼5.04601.38 ▼83.3956.69 ▲5.80
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0297.33 ▼6.6541.82 ▼4.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === hide-cart-by-condition === )
You can look at the official readme.txt

hide-cart-by-condition/Kw_hide_addto.php 85% from 13 tests

The principal PHP file in "Hide Cart By Condition." v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hide-cart-by-condition.php" instead of "Kw_hide_addto.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin95 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1652895

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods116.67%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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
PNG images were not found in this plugin