77% widget-manager-light

Code Review | Widget Manager Light

WordPress plugin Widget Manager Light scored77%from 54 tests.

About plugin

  • Plugin page: widget-manager-light
  • Plugin version: 1.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 6.3.1
  • First release: Aug 27, 2012
  • Latest release: Mar 3, 2022
  • Number of updates: 50
  • Update frequency: every 69.6 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /47,268 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▲2.86ms] Passed 4 tests

Server-side resources used by Widget Manager Light
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0748.87 ▲7.99
Dashboard /wp-admin3.36 ▲0.0647.39 ▼3.82
Posts /wp-admin/edit.php3.48 ▲0.1250.95 ▲0.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0696.45 ▲9.82
Media Library /wp-admin/upload.php3.29 ▲0.0639.49 ▲7.19
Set up widget appearance /wp-admin/admin.php?page=otw-wml-widget-dialog3.5933.99
License Manager /wp-admin/admin.php?page=otw-wml-lm3.34259.22
otwfcr /wp-admin/admin.php?page=otwfcr3.2535.47
Options /wp-admin/admin.php?page=otw-wml3.3039.66

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 44 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
otw_widget_settings
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Widget Manager Light
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.22 ▼0.962.10 ▲0.2543.43 ▼1.67
Dashboard /wp-admin2,235 ▲445.87 ▼0.19105.63 ▼9.8771.10 ▲23.47
Posts /wp-admin/edit.php2,123 ▲312.01 ▼0.0438.12 ▼5.4836.84 ▼2.66
Add New Post /wp-admin/post-new.php1,707 ▲19324.66 ▲7.19702.25 ▲64.6968.01 ▲18.04
Media Library /wp-admin/upload.php1,422 ▲314.24 ▼0.04102.15 ▲3.1945.74 ▲2.08
Set up widget appearance /wp-admin/admin.php?page=otw-wml-widget-dialog6931.146.7713.61
License Manager /wp-admin/admin.php?page=otw-wml-lm9342.0224.2125.88
otwfcr /wp-admin/admin.php?page=otwfcr7952.0140.0022.34
Options /wp-admin/admin.php?page=otw-wml9102.1430.7944.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • otw_widget_settings
    • db_upgraded

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/widget-manager-light/include/otw_components/otw_factory/views/action_message.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_get() in wp-content/plugins/widget-manager-light/include/otw_widget_dialog.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/widget-manager-light/include/otw_components/otw_factory/otw_factory.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/widget-manager-light/include/otw_sidebar_options.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/widget-manager-light/include/otw_wml_items_by_type.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/widget-manager-light/include/otw_functions.php:273
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/widget-manager-light/include/otw_sidebar_info.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_post() in wp-content/plugins/widget-manager-light/include/otw_process_actions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/widget-manager-light/otw_widget_manager.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/widget-manager-light/include/otw_components/otw_factory/views/license_manager.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/widget-manager-light/include/otw_labels/otw_wml_factory_object.labels.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add images for these screenshots: #1 (Enable widget management), #2 (Select Widget), #3 (Select pages to display on)
You can take inspiration from this readme.txt

widget-manager-light/otw_widget_manager.php 85% from 13 tests

The entry point to "Widget Manager Light" version 1.18 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("widget-manager-light.php" instead of "otw_widget_manager.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 157 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected10,377 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP171,2443684,513
CSS43112,799
SVG1002,671
JavaScript41161377
JSON10017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.75
Average class complexity148.50
▷ Minimum class complexity104.00
▷ Maximum class complexity193.00
Average method complexity8.76
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3181.58%
▷ Protected methods00.00%
▷ Private methods718.42%
Functions70
▷ Named functions70100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.25MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/otw-sbm-icon.png0.13KB0.14KB0.00%
screenshot-1.png39.75KB13.46KB▼ 66.14%
images/swm-selected.png3.81KB0.25KB▼ 93.36%
images/swm-notselected.png3.76KB0.21KB▼ 94.34%
screenshot-3.png96.96KB33.79KB▼ 65.15%