84% dynamic-widget-content

Code Review | Dynamic Widget Content

WordPress plugin Dynamic Widget Content scored84%from 54 tests.

About plugin

  • Plugin page: dynamic-widget-co...
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Mar 23, 2015
  • Latest release: Nov 6, 2023
  • Number of updates: 37
  • Update frequency: every 85.2 days
  • Top authors: BrechtVds (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /11,696 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.65MB] [CPU: ▲2.07ms] Passed 4 tests

An overview of server-side resources used by Dynamic Widget Content
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5746.19 ▲4.41
Dashboard /wp-admin3.98 ▲0.6356.86 ▼0.71
Posts /wp-admin/edit.php4.10 ▲0.7456.21 ▲2.63
Add New Post /wp-admin/post-new.php6.64 ▲0.75102.29 ▲1.96
Media Library /wp-admin/upload.php3.90 ▲0.6747.62 ▲12.95
Dynamic Widget Content /wp-admin/options-general.php?page=dwc_settings4.5143.56

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 213 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
dynamic-widget-content_version
widget_dwc_widget
can_compress_scripts
dwc_option

Browser metrics Passed 4 tests

This is an overview of browser requirements for Dynamic Widget Content
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲2214.30 ▲0.061.63 ▼0.3737.85 ▼6.73
Dashboard /wp-admin2,202 ▲255.60 ▼0.0594.23 ▼0.0142.71 ▲1.14
Posts /wp-admin/edit.php2,107 ▲41.95 ▼0.0541.17 ▲0.5636.95 ▲2.23
Add New Post /wp-admin/post-new.php1,674 ▲14821.02 ▼2.15838.00 ▲185.7962.27 ▲14.09
Media Library /wp-admin/upload.php1,401 ▼24.18 ▼0.0698.12 ▼2.0441.48 ▼3.76
Dynamic Widget Content /wp-admin/options-general.php?page=dwc_settings1,3852.3548.7546.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • widget_dwc_widget
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • dynamic-widget-content_version
    • dwc_option
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 124× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/dynamic-widget-content/vendor/vafpress/views/control/color.php:1
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/dynamic-widget-content/vendor/vafpress/views/control/radioimage.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_Field' not found in wp-content/plugins/dynamic-widget-content/vendor/vafpress/classes/control/field/toggle.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/dynamic-widget-content/vendor/vafpress/views/control/fontawesome.php:1
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dynamic-widget-content/vendor/vafpress/config/dependencies.php on line 77
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/dynamic-widget-content/vendor/vafpress/classes/control/field/fontawesome.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dynamic-widget-content/vendor/vafpress/config/messages.php:13
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/dynamic-widget-content/vendor/vafpress/config/dependencies.php on line 180
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Option_Control_Group' not found in wp-content/plugins/dynamic-widget-content/vendor/vafpress/classes/option/control/group/menu.php:3
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/dynamic-widget-content/vendor/vafpress/views/control/codeeditor.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: dynamic content, widgets

dynamic-widget-content/dynamic-widget-content.php Passed 13 tests

This is the main PHP file of "Dynamic Widget Content" version 1.3.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
49 characters long description:
Dynamic widget content for single pages and posts

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin16,493 lines of code in 171 files:
LanguageFilesBlank linesComment linesLines of code
PHP1012,1422,3559,190
JavaScript526745953,490
CSS141541763,309
SVG100414
Markdown231089
JSON1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity19.87
▷ Minimum class complexity1.00
▷ Maximum class complexity271.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes65
▷ Abstract classes46.15%
▷ Concrete classes6193.85%
▷ Final classes00.00%
Methods552
▷ Static methods9316.85%
▷ Public methods51893.84%
▷ Protected methods203.62%
▷ Private methods142.54%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants37
▷ Global constants3491.89%
▷ Class constants38.11%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
23 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/vafpress/public/img/vp_shortcode_icon_sprite.png1.55KB0.42KB▼ 73.10%
vendor/vafpress/public/img/bootstrap-colorpicker/saturation.png8.61KB5.13KB▼ 40.41%
vendor/vafpress/public/css/vendor/jqueryui/themes/smoothness/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
vendor/vafpress/public/css/vendor/jqueryui/themes/smoothness/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/vafpress/public/img/vp-logo.png1.94KB0.66KB▼ 65.94%