72% dashwidget

Code Review | Dash Widget

WordPress plugin Dash Widget scored72%from 54 tests.

About plugin

  • Plugin page: dashwidget
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2022
  • Latest release: Jan 27, 2023
  • Number of updates: 19
  • Update frequency: every 3.4 days
  • Top authors: dashwidget (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /937 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.70MB] [CPU: ▼0.02ms] Passed 4 tests

A check of server-side resources used by Dash Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.52342.45 ▲304.78
Dashboard /wp-admin4.03 ▲0.7351.41 ▲4.84
Posts /wp-admin/edit.php4.09 ▲0.7247.12 ▲2.98
Add New Post /wp-admin/post-new.php6.59 ▲0.7083.96 ▼10.57
Media Library /wp-admin/upload.php3.89 ▲0.6637.44 ▲2.67
Dash Widget /wp-admin/admin.php?page=dashwidget/settings3.8834.87
Settings /wp-admin/admin.php?page=dashwidget/builder4.2034.29

Server storage [IO: ▲2.11MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 52 new files
Database: no new tables, 13 new options
New WordPress options
_dashwidget_ig_feed_refresh_id
_dashwidget_facebook_accounts
_dashwidget_ig_feed_refresh_secret
_dashwidget_feed_refresh_registered
_dashwidget_instagram_accounts
_dashwidget_test_shortcodes
db_upgraded
widget_recent-posts
_dashwidget_list_widgets
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for Dash Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲32414.02 ▼0.575.52 ▲3.8943.32 ▲4.23
Dashboard /wp-admin2,366 ▲1925.19 ▼0.33119.48 ▲31.8578.72 ▲37.75
Posts /wp-admin/edit.php2,232 ▲1322.19 ▲0.2243.72 ▲6.5940.02 ▲4.93
Add New Post /wp-admin/post-new.php1,745 ▲21723.53 ▲0.54696.73 ▲36.3329.94 ▼22.66
Media Library /wp-admin/upload.php1,631 ▲2314.76 ▲0.57104.88 ▼3.7176.36 ▲31.21
Dash Widget /wp-admin/admin.php?page=dashwidget/settings1,0673.1347.6741.38
Settings /wp-admin/admin.php?page=dashwidget/builder9562.9344.2026.65

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_recent-comments
    • _dashwidget_instagram_accounts
    • db_upgraded
    • _dashwidget_ig_feed_refresh_secret
    • _dashwidget_test_shortcodes
    • theysaidso_admin_options
    • _dashwidget_feed_refresh_registered
    • _dashwidget_ig_feed_refresh_id
    • can_compress_scripts
    • _dashwidget_facebook_accounts
    • ...

Smoke tests 25% 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 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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dashwidget/public/partials/dash-widget-public-display.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/dashwidget/includes/widgets/instagram/template.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/dashwidget/admin/partials/dash-widget-settings-widget-builder.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dashwidget/includes/class-dash-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dashwidget/admin/partials/dash-widget-settings-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dashwidget/includes/class-dash-widget-activator.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dashwidget/builder
    • > Network (severe)
    http://storage.googleapis.com/dashwidget-assets-plugin/dash-widget_icon-only_var1_colored_16x16.png - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=dashwidget/builder
    • > Javascript (severe) in unknown
    /wp-content/plugins/dashwidget/admin/js/dash-widget-builder.js?ver=1.0.2 276:61 Uncaught TypeError: Cannot set properties of null (setting 'onclick')
    • > GET request to /wp-admin/admin.php?page=dashwidget/builder
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot set properties of null (setting 'src')" "TypeError: Cannot set properties of null (setting 'src')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/dashwidget/admin/js/dash-widget-builder.js?ver=1.0.2:34:49)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=dashwidget/builder
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot set properties of null (setting 'src')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
The official readme.txt is a good inspiration

dashwidget/dash-widget.php 92% from 13 tests

This is the main PHP file of "Dash Widget" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dashwidget.php" instead of "dash-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin7,519 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP291,2761,7835,701
JavaScript84873101,095
JSON100435
Markdown1670265
CSS5145723

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity16.44
▷ Minimum class complexity1.00
▷ Maximum class complexity213.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces3
Interfaces2
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods118
▷ Static methods2722.88%
▷ Public methods9378.81%
▷ Protected methods00.00%
▷ Private methods2521.19%
Functions24
▷ Named functions416.67%
▷ Anonymous functions2083.33%
Constants13
▷ Global constants17.69%
▷ Class constants1292.31%
▷ Public constants433.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin