84% better-widgets

Code Review | Better Widgets

WordPress plugin Better Widgets scored84%from 54 tests.

About plugin

  • Plugin page: better-widgets
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8+
  • WordPress version: 6.3.1
  • First release: Nov 4, 2013
  • Latest release: Jan 22, 2014
  • Number of updates: 9
  • Update frequency: every 9.3 days
  • Top authors: shaunandrews (77.78%)Michael Arestad (33.33%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,150 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼12.44ms] Passed 4 tests

An overview of server-side resources used by Better Widgets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0052.51 ▲5.14
Dashboard /wp-admin3.31 ▼0.0450.49 ▼28.72
Posts /wp-admin/edit.php3.36 ▲0.0049.78 ▼7.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.70 ▼18.86
Media Library /wp-admin/upload.php3.23 ▲0.0047.24 ▲12.92

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Better Widgets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.14 ▼0.211.95 ▼0.1643.50 ▲0.79
Dashboard /wp-admin2,195 ▲185.59 ▼0.0892.07 ▲3.2639.46 ▼7.36
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0736.01 ▼3.9033.21 ▼2.08
Add New Post /wp-admin/post-new.php1,526 ▼523.09 ▼0.10697.23 ▲36.9850.44 ▼5.39
Media Library /wp-admin/upload.php1,397 ▼34.17 ▼0.07114.48 ▲10.4847.50 ▲6.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-widgets/widgets.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
1 plugin tags: widgets

better-widgets/widgets.php 92% from 13 tests

This is the main PHP file of "Better Widgets" version 0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("better-widgets.php" instead of "widgets.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected394 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
CSS12920289
JavaScript1211283
SVG10014
PHP1151088

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
18 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/icon-archives.png0.29KB0.21KB▼ 26.51%
icons/icon-image.png0.81KB0.47KB▼ 42.24%
icons/icon-grofile.png0.61KB0.42KB▼ 31.63%
icons/icon-categories.png0.34KB0.24KB▼ 29.63%
icons/icon-meta.png1.44KB0.87KB▼ 39.78%