84% hide-cart-functions

Code Review | Hide Cart Functions

WordPress plugin Hide Cart Functions scored84%from 54 tests.

About plugin

  • Plugin page: hide-cart-functions
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.4.33+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2022
  • Latest release: Oct 12, 2023
  • Number of updates: 30
  • Update frequency: every 18.9 days
  • Top authors: artiosmedia (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /7,359 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.32MB] [CPU: ▼9.29ms] Passed 4 tests

A check of server-side resources used by Hide Cart Functions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3138.03 ▼0.36
Dashboard /wp-admin3.63 ▲0.2844.87 ▼17.63
Posts /wp-admin/edit.php3.75 ▲0.3944.31 ▲4.80
Add New Post /wp-admin/post-new.php6.23 ▲0.3481.56 ▼20.05
Media Library /wp-admin/upload.php3.56 ▲0.3237.07 ▲0.87
Hide Functions /wp-admin/admin.php?page=hwcf_settings3.5333.22

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
hwcf_settings_data
widget_theysaidso_widget
pcfw_version_1_0_0_installed
pcfw_notice_dismiss
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Hide Cart Functions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.43 ▲0.091.70 ▲0.0340.28 ▼2.41
Dashboard /wp-admin2,207 ▲304.91 ▼0.7685.86 ▼14.3138.88 ▼8.61
Posts /wp-admin/edit.php2,112 ▲122.33 ▲0.3034.27 ▼2.0933.38 ▲3.87
Add New Post /wp-admin/post-new.php1,541 ▲1323.15 ▲0.16667.10 ▲17.3757.04 ▼1.81
Media Library /wp-admin/upload.php1,412 ▲124.42 ▲0.2695.32 ▼18.1745.06 ▼3.26
Hide Functions /wp-admin/admin.php?page=hwcf_settings1,0651.8528.5128.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • pcfw_notice_dismiss
    • hwcf_settings_data
    • pcfw_version_1_0_0_installed
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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

SRP 50% 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
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/hide-cart-functions/admin/hwcf-table.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/hide-cart-functions/admin/hwcf-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Artiosmedia\\WC_Purchase_Customization_Admin\\is_admin() in wp-content/plugins/hide-cart-functions/admin/hwcf-admin.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-cart-functions/inc/utilities-functions.php:112
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/hide-cart-functions/admin/hwcf-table.php on line 3

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: hide category, hide product, hide price, hide add to cart, hide option...

hide-cart-functions/hide-cart-functions.php 85% from 13 tests

"Hide Cart Functions" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 238 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("4.6" instead of "4.6.0")

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 plugin2,884 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP42794001,253
PO File4283336762
JavaScript316732595
CSS3364274

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity70.00
▷ Minimum class complexity36.00
▷ Maximum class complexity101.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods46
▷ Static methods510.87%
▷ Public methods3576.09%
▷ Protected methods1123.91%
▷ Private methods00.00%
Functions16
▷ Named functions1381.25%
▷ Anonymous functions318.75%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin