73% widgets-controller

Code Review | Widgets Controller

WordPress plugin Widgets Controller scored73%from 54 tests.

About plugin

  • Plugin page: widgets-controller
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.1
  • WordPress version: 6.3.1
  • First release: Jul 30, 2012
  • Latest release: Aug 21, 2013
  • Number of updates: 54
  • Update frequency: every 7.2 days
  • Top authors: tarakpatel (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /37,558 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼1.83MB] [CPU: ▼48.60ms] Passed 4 tests

Server-side resources used by Widgets Controller
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.315.01 ▼32.68
Dashboard /wp-admin2.18 ▼1.136.55 ▼45.92
Posts /wp-admin/edit.php2.18 ▼1.186.29 ▼37.46
Add New Post /wp-admin/post-new.php2.18 ▼3.716.72 ▼78.33
Media Library /wp-admin/upload.php2.18 ▼1.056.04 ▼27.63

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Widgets Controller
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲12713.48 ▼1.119.92 ▲8.0042.22 ▼1.90
Dashboard /wp-admin2,202 ▲255.61 ▲0.0496.10 ▼4.9442.77 ▼1.01
Posts /wp-admin/edit.php2,110 ▲102.01 ▼0.0037.20 ▼0.6031.53 ▼1.00
Add New Post /wp-admin/post-new.php1,536 ▲1023.16 ▼0.35679.22 ▼17.7164.75 ▲11.12
Media Library /wp-admin/upload.php1,413 ▲164.28 ▲0.0398.40 ▲4.4245.70 ▲3.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the my-ajax-request handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 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/widgets-controller/widgets_controller.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
  • Screenshots: These screenshots do not have images: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can take inspiration from this readme.txt

widgets-controller/widgets_controller.php 92% from 13 tests

The main PHP file in "Widgets Controller" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("widgets-controller.php" instead of "widgets_controller.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin316 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP11217198
JavaScript10498
CSS11120

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.33MB with 0.16MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png88.39KB46.26KB▼ 47.66%
screenshot-2.png87.53KB45.64KB▼ 47.85%
screenshot-4.png81.26KB43.32KB▼ 46.69%
screenshot-1.png76.83KB38.29KB▼ 50.16%