10% widget-builder

Code Review | Widget Builder

WordPress plugin Widget Builder scored10%from 54 tests.

About plugin

  • Plugin page: widget-builder
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2012
  • Latest release: Aug 21, 2015
  • Number of updates: 41
  • Update frequency: every 29.6 days
  • Top authors: codearachnid (43.9%)ModernTribe (36.59%)jbrinley (17.07%)zbtirrell (9.76%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /42,571 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/widget-builder/classes/custom-widget-display.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; Tribe_Widget_Builder_Display has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼55.13ms] Passed 4 tests

Analyzing server-side resources used by Widget Builder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.19 ▼33.25
Dashboard /wp-admin2.18 ▼1.166.83 ▼54.97
Posts /wp-admin/edit.php2.19 ▼1.186.54 ▼40.75
Add New Post /wp-admin/post-new.php2.18 ▼3.716.57 ▼91.54
Media Library /wp-admin/upload.php2.18 ▼1.056.15 ▼27.17
Widget Builder /wp-admin/edit.php?post_type=tribe_widget_builder2.197.36

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Widget Builder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.35 ▲0.001.57 ▼0.2345.55 ▲6.66
Dashboard /wp-admin2,199 ▲215.48 ▼0.1482.81 ▼16.6838.26 ▼1.04
Posts /wp-admin/edit.php2,104 ▲72.02 ▲0.0435.12 ▼0.9436.63 ▼1.43
Add New Post /wp-admin/post-new.php1,531 ▼1823.26 ▲5.09672.84 ▲16.0559.26 ▼12.07
Media Library /wp-admin/upload.php1,404 ▲14.20 ▲0.04100.62 ▲4.4744.12 ▼5.09
Widget Builder /wp-admin/edit.php?post_type=tribe_widget_builder1,0681.9729.3929.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/widget-builder/classes/custom-widget-display.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; Tribe_Widget_Builder_Display has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=tribe_widget_builder
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/widget-builder/classes/custom-widget-display.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; Tribe_Widget_Builder_Display has a deprecated constructor

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/widget-builder/views/metabox_link.php
    • > /wp-content/plugins/widget-builder/views/widget_options.php
    • > /wp-content/plugins/widget-builder/views/metabox_admin.php
    • > /wp-content/plugins/widget-builder/views/widget_dashboard.php
    • > /wp-content/plugins/widget-builder/views/metabox_pub.php
    • > /wp-content/plugins/widget-builder/views/widget.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget_Factory' not found in wp-content/plugins/widget-builder/lib/tribe-widget-factory/Tribe_WP_Widget_Factory.php:33
    • > PHP Fatal error
      Cannot use lexical variable $widget as a parameter name in wp-content/plugins/widget-builder/classes/wp_add_dashboard_widget.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widget-builder/lib/tribe-widget-factory/tribe-widget-factory.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
These attributes need your attention:
  • Screenshots: Screenshot #1 (How the default display template looks in the dashboard (when enabled).) image required
You can take inspiration from this readme.txt

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

This is the main PHP file of "Widget Builder" version 1.6.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
118 characters long description:
This plugin creates predefined content widgets that can be used in multiple sidebars while being centrally configured.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin532 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP12141292464
PO File1254068

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity14.33
▷ Minimum class complexity3.00
▷ Maximum class complexity34.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods39.38%
▷ Public methods2887.50%
▷ Protected methods00.00%
▷ Private methods412.50%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.31MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png83.71KB32.36KB▼ 61.35%
screenshot-2.png49.52KB20.09KB▼ 59.43%
screenshot-4.png10.71KB4.85KB▼ 54.77%
screenshot-5.png83.62KB27.59KB▼ 67.00%
screenshot-1.png86.13KB29.10KB▼ 66.21%