84% ci-image-widget

Code Review | The Image Widget

WordPress plugin The Image Widget scored84%from 54 tests.

About plugin

  • Plugin page: ci-image-widget
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jul 29, 2016
  • Latest release: Aug 31, 2023
  • Number of updates: 14
  • Update frequency: every 184.9 days
  • Top authors: nvourva (50%)cssigniterteam (35.71%)tsiger (28.57%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,066 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼11.53ms] Passed 4 tests

An overview of server-side resources used by The Image Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.68 ▼2.04
Dashboard /wp-admin3.32 ▼0.0344.92 ▼17.72
Posts /wp-admin/edit.php3.37 ▲0.0147.67 ▼0.42
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.29 ▼22.54
Media Library /wp-admin/upload.php3.24 ▲0.0133.47 ▼3.82

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_ci_image_widget
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for The Image Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲16513.74 ▼0.996.74 ▲5.0137.76 ▼1.93
Dashboard /wp-admin2,203 ▲115.81 ▲0.83100.06 ▼10.7338.99 ▼1.42
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0237.43 ▲1.1734.95 ▲4.32
Add New Post /wp-admin/post-new.php1,533 ▲1423.16 ▲0.03599.50 ▼59.4847.98 ▼5.83
Media Library /wp-admin/upload.php1,388 ▲34.20 ▼0.0093.04 ▼16.5141.20 ▼1.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_ci_image_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ci-image-widget/ci_image_widget.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: images, photo widget, widget, image widget

ci-image-widget/ci_image_widget.php 92% from 13 tests

"The Image Widget" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ci-image-widget.php" instead of "ci_image_widget.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
No dangerous file extensions were detected1,960 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript34302391,446
CSS2396347
PHP13610167

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.11
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
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
2 compressed PNG files occupy 0.04MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png27.29KB29.02KB0.00%
assets/screenshot-1.png16.18KB17.14KB0.00%