10% image-upload-widget

Code Review | Image Upload Widget

WordPress plugin Image Upload Widget scored10%from 54 tests.

About plugin

  • Plugin page: image-upload-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Dec 10, 2013
  • Latest release: Dec 12, 2013
  • Number of updates: 10
  • Update frequency: every 0.2 days
  • Top authors: arunschandran (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /7,626 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
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/image-upload-widget/widget_guide.php+132
    Function create_function() is deprecated

Server metrics [RAM: ▼1.93MB] [CPU: ▼54.77ms] Passed 4 tests

A check of server-side resources used by Image Upload Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.397.07 ▼35.70
Dashboard /wp-admin2.09 ▼1.256.05 ▼49.12
Posts /wp-admin/edit.php2.09 ▼1.266.98 ▼42.50
Add New Post /wp-admin/post-new.php2.09 ▼3.796.06 ▼91.75
Media Library /wp-admin/upload.php2.09 ▼1.145.12 ▼28.57

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_image_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Image Upload Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲16814.78 ▲1.711.65 ▼3.1840.82 ▼1.55
Dashboard /wp-admin2,345 ▲1576.42 ▲1.52118.95 ▲10.7842.61 ▼1.05
Posts /wp-admin/edit.php2,254 ▲1653.35 ▲1.2949.32 ▲8.1532.01 ▼4.07
Add New Post /wp-admin/post-new.php1,530 ▼1223.30 ▲0.33609.08 ▼55.2328.51 ▼18.76
Media Library /wp-admin/upload.php1,390 ▲24.20 ▲0.0180.14 ▼19.1942.25 ▼2.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/image-upload-widget/widget_guide.php+132
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_image_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/image-upload-widget/widget_guide.php:31

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 93% from 29 tests

readme.txt 94% 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
Please fix the following attributes: The official readme.txt is a good inspiration

image-upload-widget/widget_guide.php 92% from 13 tests

This is the main PHP file of "Image Upload Widget" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("image-upload-widget.php" instead of "widget_guide.php")

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
Success! There were no dangerous files found in this plugin96 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1135371
JavaScript10325

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin