78% widgets-bundle

Code Review | Widgets Bundle

WordPress plugin Widgets Bundle scored78%from 54 tests.

About plugin

  • Plugin page: widgets-bundle
  • Plugin version: 2.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.4
  • WordPress version: 6.3.1
  • First release: Mar 9, 2018
  • Latest release: Apr 9, 2020
  • Number of updates: 15
  • Update frequency: every 51.4 days
  • Top authors: akshitsethi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,304 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.64MB] [CPU: ▼1.31ms] Passed 4 tests

An overview of server-side resources used by Widgets Bundle
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6847.14 ▲3.21
Dashboard /wp-admin3.97 ▲0.6753.21 ▼0.06
Posts /wp-admin/edit.php4.03 ▲0.6752.82 ▲2.21
Add New Post /wp-admin/post-new.php6.51 ▲0.6386.35 ▼10.60
Media Library /wp-admin/upload.php3.83 ▲0.6141.47 ▲4.63
Widgets Bundle /wp-admin/options-general.php?page=widgetsbundle_options3.8337.19

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 63 new files
Database: no new tables, 16 new options
New WordPress options
widget_recent-comments
widget_widgetsbundle_quote
db_upgraded
widget_recent-posts
widget_theysaidso_widget
as_widgetsbundle
widget_widgetsbundle_twitter
widget_widgetsbundle_subscribe
widget_widgetsbundle_ads
widget_widgetsbundle_facebook
...

Browser metrics Passed 4 tests

Widgets Bundle: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6713.21 ▼1.162.22 ▲0.2242.52 ▼1.42
Dashboard /wp-admin2,211 ▲235.89 ▲0.85103.74 ▼7.1642.03 ▼1.82
Posts /wp-admin/edit.php2,103 ▲172.04 ▲0.0642.56 ▲4.7935.84 ▲1.56
Add New Post /wp-admin/post-new.php1,526 ▼723.69 ▲0.60612.05 ▼91.5752.64 ▼14.40
Media Library /wp-admin/upload.php1,402 ▲204.21 ▲0.0895.30 ▼4.7442.67 ▼2.23
Widgets Bundle /wp-admin/options-general.php?page=widgetsbundle_options1,1182.0738.7336.70

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 15 options in the database
    • widget_widgetsbundle_posts
    • widget_widgetsbundle_facebook
    • theysaidso_admin_options
    • widget_widgetsbundle_instagram
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_widgetsbundle_ads
    • widget_widgetsbundle_twitter
    • widget_widgetsbundle_personal
    • ...

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/widgets-bundle/inc/admin/views/footer.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AkshitSethi\\Plugins\\WidgetsBundle\\Config' not found in wp-content/plugins/widgets-bundle/inc/admin/views/header.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/widgets-bundle/inc/admin/views/settings-about.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-bundle/inc/widgets/ads.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'AkshitSethi\\Plugins\\WidgetsBundle\\Config' not found in wp-content/plugins/widgets-bundle/inc/admin/views/header.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-bundle/inc/widgets/posts.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-bundle/inc/widgets/quote.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-bundle/inc/widgets/personal.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AkshitSethi\\Plugins\\WidgetsBundle\\plugin_dir_url() in wp-content/plugins/widgets-bundle/inc/class-config.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-bundle/inc/widgets/social.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-bundle/inc/widgets/twitter.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: widgets, wp widgets, wordpress widgets, wp widgets plugin

widgets-bundle/widgets-bundle.php 85% from 13 tests

The entry point to "Widgets Bundle" version 2.0.5 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: Prefix the domain path with a forward slash character ("/i18n")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("i18n")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin3,775 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP316381,0002,336
CSS34798861
JavaScript36370190
Markdown2800162
SVG11030115
JSON320100
Bourne Shell14011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity12.74
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods125
▷ Static methods1814.40%
▷ Public methods10281.60%
▷ Protected methods00.00%
▷ Private methods2318.40%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/close.png0.43KB0.33KB▼ 24.43%
assets/admin/images/facebook.png1.82KB0.59KB▼ 67.51%
assets/admin/images/toggle.png0.97KB0.11KB▼ 89.07%
assets/admin/images/wd-icon.png1.36KB0.38KB▼ 72.26%
assets/admin/images/twitter.png2.07KB0.63KB▼ 69.73%