10% image-in-the-widget

Code Review | Image In The Widget

WordPress plugin Image In The Widget scored10%from 54 tests.

About plugin

  • Plugin page: image-in-the-widget
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 20, 2013
  • Latest release: Mar 20, 2013
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: Sapian Technologies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,818 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/image-in-the-widget/image-widget.php+24
    Methods with the same name as their class will not be constructors in a future version of PHP; sap_Image_Widget has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼169.01ms] Passed 4 tests

Server-side resources used by Image In The Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.304.90 ▼44.67
Dashboard /wp-admin2.18 ▼1.206.76 ▼494.96
Posts /wp-admin/edit.php2.18 ▼1.186.21 ▼48.31
Add New Post /wp-admin/post-new.php2.18 ▼3.717.99 ▼88.08
Media Library /wp-admin/upload.php2.18 ▼1.056.09 ▼28.52

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_widget_sp_image
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Image In The Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7313.19 ▼0.994.63 ▲2.7647.17 ▲6.93
Dashboard /wp-admin2,218 ▲125.85 ▼0.18112.87 ▲3.5344.41 ▲5.40
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0036.44 ▼4.7033.83 ▼1.45
Add New Post /wp-admin/post-new.php1,545 ▼023.15 ▼0.05653.92 ▲39.9450.45 ▼2.37
Media Library /wp-admin/upload.php1,397 ▲34.28 ▲0.1197.79 ▼7.0941.17 ▼4.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/image-in-the-widget/image-widget.php+24
    Methods with the same name as their class will not be constructors in a future version of PHP; sap_Image_Widget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_widget_sp_image
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/image-in-the-widget/views/widget-admin.deprecated.php
    • > /wp-content/plugins/image-in-the-widget/views/widget.php
    • > /wp-content/plugins/image-in-the-widget/views/widget-admin.php
    • > /wp-content/plugins/image-in-the-widget/image-widget.php

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: image in the sidebar, image widget for wordpress

image-in-the-widget/image-widget.php 92% from 13 tests

The main file in "Image In The Widget" v. 2.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("image-in-the-widget.php" instead of "image-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
Good job! No executable or dangerous file extensions detected722 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP592175495
JavaScript35557227

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity40.00
▷ Minimum class complexity30.00
▷ Maximum class complexity50.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods312.50%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin