78% zi-hide-price-and-add-to-cart-for-woocommerce

Code Review | ZI Hide price and add to cart for WooCommerce

WordPress plugin ZI Hide price and add to cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: zi-hide-price-and...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 1, 2019
  • Latest release: Jan 4, 2023
  • Number of updates: 46
  • Update frequency: every 26.0 days
  • Top authors: zeninvader (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /12,056 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▲2.26ms] Passed 4 tests

Server-side resources used by ZI Hide price and add to cart for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.08 ▲2.22
Dashboard /wp-admin3.38 ▲0.0748.57 ▲1.79
Posts /wp-admin/edit.php3.49 ▲0.1345.16 ▲1.43
Add New Post /wp-admin/post-new.php5.98 ▲0.0994.71 ▲7.49
Media Library /wp-admin/upload.php3.30 ▲0.0737.18 ▲3.59

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for ZI Hide price and add to cart for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.57 ▼0.848.65 ▲7.0944.04 ▲2.85
Dashboard /wp-admin2,210 ▲185.91 ▲0.92114.50 ▼0.3841.78 ▲0.21
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0337.01 ▼3.2732.88 ▼1.61
Add New Post /wp-admin/post-new.php1,518 ▲422.94 ▲5.45650.32 ▼22.4762.11 ▼0.67
Media Library /wp-admin/upload.php1,392 ▲44.23 ▲0.06106.78 ▼6.7748.37 ▼1.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/zi-hide-price-and-add-to-cart-for-woocommerce/admin/partials/zi-woo-hide-price-cart-admin-display.php
    • > /wp-content/plugins/zi-hide-price-and-add-to-cart-for-woocommerce/public/partials/zi-woo-hide-price-cart-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zi-hide-price-and-add-to-cart-for-woocommerce/includes/zi-woo-hide-price-cart-core.php:3

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === zi-hide-price-and-add-to-cart-for-woocommerce === )
Please take inspiration from this readme.txt

zi-hide-price-and-add-to-cart-for-woocommerce/zi-woo-hide-price-cart.php 85% from 13 tests

"ZI Hide price and add to cart for WooCommerce" version 1.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("zi-hide-price-and-add-to-cart-for-woocommerce.php" instead of "zi-woo-hide-price-cart.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected269 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13176542263
JavaScript24546
CSS2080

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants1
▷ Global constants1100.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
No PNG files were detected