78% if-widget

Code Review | If Widget - Visibility control for Widgets

WordPress plugin If Widget - Visibility control for Widgets scored78%from 54 tests.

About plugin

  • Plugin page: if-widget
  • Plugin version: 0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 25, 2018
  • Latest release: Jan 18, 2021
  • Number of updates: 11
  • Update frequency: every 79.8 days
  • Top authors: andrei.igna (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /11,863 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 gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼4.39ms] Passed 4 tests

Server-side resources used by If Widget - Visibility control for Widgets
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2143.94 ▲2.55
Dashboard /wp-admin3.52 ▲0.1760.06 ▼9.17
Posts /wp-admin/edit.php3.63 ▲0.2755.80 ▲3.71
Add New Post /wp-admin/post-new.php6.10 ▲0.2190.09 ▼14.63
Media Library /wp-admin/upload.php3.44 ▲0.2141.66 ▲3.95
If Widget /wp-admin/themes.php?page=if-widget3.4136.51

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 123 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for If Widget - Visibility control for Widgets
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.20 ▼0.211.88 ▲0.0544.51 ▼0.41
Dashboard /wp-admin2,220 ▲405.65 ▼0.0085.13 ▼12.3041.33 ▼5.67
Posts /wp-admin/edit.php2,122 ▲252.05 ▲0.0139.74 ▲1.0637.21 ▲2.13
Add New Post /wp-admin/post-new.php1,566 ▲4023.06 ▲5.58658.16 ▲59.0156.66 ▲3.08
Media Library /wp-admin/upload.php1,425 ▲254.22 ▼0.00102.65 ▲5.4345.16 ▼0.87
If Widget /wp-admin/themes.php?page=if-widget1,0802.0125.3987.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=if-widget
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% 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
  • 96× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/if-widget/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php:4

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

if-widget/if-widget.php Passed 13 tests

The entry point to "If Widget - Visibility control for Widgets" version 0.5 is a PHP file that has certain tags in its header comment area
77 characters long description:
Control what widgets your site’s visitors see, with custom visibility rules

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected3,660 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
PHP1095036152,848
CSS1843381
JSON300271
JavaScript3198123
Markdown118037

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity2.86
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes103
▷ Abstract classes10.97%
▷ Concrete classes10299.03%
▷ Final classes00.00%
Methods132
▷ Static methods118.33%
▷ Public methods8765.91%
▷ Protected methods3929.55%
▷ Private methods64.55%
Functions18
▷ Named functions316.67%
▷ Anonymous functions1583.33%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin