83% woo-product-disclaimer

Code Review | Product Disclaimer For WooCommerce

WordPress plugin Product Disclaimer For WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: woo-product-discl...
  • Plugin version: 2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 6, 2017
  • Latest release: May 24, 2022
  • Number of updates: 65
  • Update frequency: every 32.2 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active / 9,349 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.62ms] Passed 4 tests

An overview of server-side resources used by Product Disclaimer For WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.73 ▼0.10
Dashboard /wp-admin3.34 ▲0.0445.60 ▼1.90
Posts /wp-admin/edit.php3.40 ▲0.0447.27 ▼1.93
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.36 ▼10.54
Media Library /wp-admin/upload.php3.27 ▲0.0436.13 ▲0.99

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

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

Browser metrics Passed 4 tests

Product Disclaimer For WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.19 ▼1.191.67 ▼0.1739.84 ▼9.92
Dashboard /wp-admin2,209 ▲215.80 ▲0.8797.50 ▼19.0440.72 ▼4.94
Posts /wp-admin/edit.php2,094 ▲52.02 ▲0.0234.81 ▼3.3130.44 ▼1.77
Add New Post /wp-admin/post-new.php1,543 ▲2423.31 ▲0.27711.17 ▲52.0753.50 ▼11.77
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0397.27 ▼3.8444.23 ▼0.62

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-product-disclaimer/includes/views/admin/wcpd-general-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/woo-product-disclaimer/includes/views/admin/general/global-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/woo-product-disclaimer/includes/views/admin/general/sitewide-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/woo-product-disclaimer/includes/views/admin/wcpd-single-disclaimer-settings.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: woocommerce disclaimer product, woocommerce disclaimer, disclaimer product, woocommerce product, disclaimer...

woo-product-disclaimer/product-disclaimer-woocommerce.php 77% from 13 tests

The main file in "Product Disclaimer For WooCommerce" v. 2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.5.0" instead of "3.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-product-disclaimer.php" instead of "product-disclaimer-woocommerce.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected3,660 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23861751,630
PHP113171981,291
CSS21111732
SVG1017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity42.80
▷ Minimum class complexity4.00
▷ Maximum class complexity119.00
Average method complexity6.81
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods36
▷ Static methods1438.89%
▷ Public methods3186.11%
▷ Protected methods00.00%
▷ Private methods513.89%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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