89% widgets-control

Code Review | Widgets Control

WordPress plugin Widgets Control scored 89% from 54 tests.

About plugin

  • Plugin page: widgets-control
  • Plugin version: 2.5.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 5.8.1
  • First release: Mar 10, 2015
  • Latest release: Apr 4, 2021
  • Number of updates: 49
  • Update frequency: every 45.2 days
  • Top authors: itthinx (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 23,995 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.06MB] [CPU: ▼138.26ms] Passed 4 tests

Server-side resources used by Widgets Control
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.0836.35 ▲4.08
Dashboard /wp-admin3.12 ▲0.0644.58 ▼0.90
Posts /wp-admin/edit.php3.21 ▲0.1043.33 ▲2.04
Add New Post /wp-admin/post-new.php5.48 ▲0.0599.22 ▼547.43
Media Library /wp-admin/upload.php3.06 ▲0.0535.03 ▼6.74
Widgets Control /wp-admin/plugins.php?page=widgets-plugin3.0329.29

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 1 new option
New WordPress options
widget_widgets_control_content_block

Browser metrics Passed 4 tests

Checking browser requirements for Widgets Control
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12715.89 ▲0.288.28 ▼0.3448.18 ▲1.47
Dashboard /wp-admin3,007 ▲765.93 ▼0.11141.43 ▲7.47114.44 ▼1.85
Posts /wp-admin/edit.php2,779 ▲402.68 ▼0.0166.40 ▼2.2394.21 ▲1.97
Add New Post /wp-admin/post-new.php1,742 ▲7218.94 ▲1.53381.59 ▲19.99111.04 ▲2.06
Media Library /wp-admin/upload.php1,847 ▲405.01 ▼0.01152.79 ▼4.52123.50 ▼1.29
Widgets Control /wp-admin/plugins.php?page=widgets-plugin1,0872.0557.8367.74

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
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_widgets_control_content_block

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #10, #11, #12, #13, #14, #6, #7, #8, #9 in widgets-control/assets to your readme.txt
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

widgets-control/widgets-control.php Passed 13 tests

Analyzing the main PHP file in "Widgets Control" version 2.5.0
119 characters long description:
A Widget toolbox that adds visibility management and helps to control where widgets and sidebars are shown efficiently.

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 plugin2,368 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP192491,0021,995
PO File176103236
JavaScript142394
CSS24043

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity27.67
▷ Minimum class complexity3.00
▷ Maximum class complexity66.00
Average method complexity5.55
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods88
▷ Static methods8293.18%
▷ Public methods8090.91%
▷ Protected methods00.00%
▷ Private methods89.09%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants1864.29%
▷ Class constants1035.71%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wctrl_gear-20x20.png1.58KB0.64KB▼ 59.39%
images/wctrl_gear.png5.41KB2.59KB▼ 52.14%