78% alf-disable-product-for-woocommerce

Code Review | ALF Disable Product for Woocommerce

WordPress plugin ALF Disable Product for Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: alf-disable-produ...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-5.3.2
  • WordPress version: 6.3.1
  • First release: May 12, 2020
  • Latest release: May 12, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: elixirlouise (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /423 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.98ms] Passed 4 tests

An overview of server-side resources used by ALF Disable Product for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.78 ▼1.17
Dashboard /wp-admin3.31 ▲0.0045.31 ▼4.77
Posts /wp-admin/edit.php3.36 ▲0.0046.48 ▼0.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.58 ▼20.78
Media Library /wp-admin/upload.php3.23 ▲0.0033.20 ▼1.21

Server storage [IO: ▲0.08MB] [DB: ▲0.32MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for ALF Disable Product for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.82 ▲1.602.00 ▼2.1843.14 ▲0.99
Dashboard /wp-admin2,203 ▲155.81 ▲0.9399.48 ▲0.1850.44 ▲9.85
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0440.69 ▼0.4535.20 ▼0.99
Add New Post /wp-admin/post-new.php1,533 ▼323.74 ▲0.47579.87 ▼53.6149.41 ▼6.64
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0097.51 ▲3.3740.60 ▼2.49

Uninstaller [IO: ▲0.00MB] [DB: ▲0.32MB] 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_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/alf-disable-product-for-woocommerce/public/partials/alf-disable-product-for-woocommerce-public-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/alf-disable-product-for-woocommerce/admin/partials/alf-disable-product-for-woocommerce-product-tab-data.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/alf-disable-product-for-woocommerce/admin/partials/alf-disable-product-for-woocommerce-product-category-edit.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/alf-disable-product-for-woocommerce/admin/partials/alf-disable-product-for-woocommerce-product-category.php:16

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 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Contributors: Contributors not specified
  • Screenshots: Screenshot #1 (ALF Disable Product for Woocommerce) image missing
The official readme.txt is a good inspiration

alf-disable-product-for-woocommerce/alf-disable-product-for-woocommerce.php 92% from 13 tests

The principal PHP file in "ALF Disable Product for Woocommerce" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.9" instead of "3.9.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin768 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP14158658517
JavaScript2183192
CSS20573
PO File17615259
Markdown112027

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity10.86
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods43
▷ Static methods24.65%
▷ Public methods3888.37%
▷ Protected methods00.00%
▷ Private methods511.63%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin