83% widget-instance

Code Review | Widget Instance

WordPress plugin Widget Instance scored83%from 54 tests.

About plugin

  • Plugin page: widget-instance
  • Plugin version: 0.9.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.1-4.9.7
  • WordPress version: 6.3.1
  • First release: Jun 11, 2012
  • Latest release: Jul 11, 2018
  • Number of updates: 14
  • Update frequency: every 158.8 days
  • Top authors: global_1981 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active /12,372 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by Widget Instance
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.37 ▲1.32
Dashboard /wp-admin3.32 ▼0.0250.43 ▼12.74
Posts /wp-admin/edit.php3.37 ▲0.0249.45 ▼1.14
Add New Post /wp-admin/post-new.php5.90 ▲0.0289.11 ▼9.36
Media Library /wp-admin/upload.php3.24 ▲0.0237.66 ▲0.86

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Widget Instance
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.40 ▲0.032.00 ▲0.1844.63 ▲4.21
Dashboard /wp-admin2,198 ▲245.65 ▲0.0996.27 ▲9.5541.71 ▲1.41
Posts /wp-admin/edit.php2,103 ▼02.00 ▼0.0534.47 ▼23.3234.28 ▼9.41
Add New Post /wp-admin/post-new.php1,531 ▼1423.02 ▼0.21614.16 ▼0.8457.74 ▲8.30
Media Library /wp-admin/upload.php1,403 ▼04.21 ▲0.1399.69 ▼2.1047.23 ▲1.82

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

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 everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/widget-instance/index.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === widget-instance === )
  • Screenshots: Add images for these screenshots: #1 (The Widget Instance editor button), #2 (The editor dialog for inserting a specific widget instance)
Please take inspiration from this readme.txt

widget-instance/index.php 92% from 13 tests

The entry point to "Widget Instance" version 0.9.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("widget-instance.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected395 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP43340149
CSS140114
JavaScript35679
HTML10053

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.00
▷ Minimum class complexity3.00
▷ Maximum class complexity11.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%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png3.03KB1.88KB▼ 37.97%
tinymce.png0.74KB0.71KB▼ 4.07%
screenshot-2.png17.88KB7.18KB▼ 59.85%