83% swifty-image-widget

Code Review | Swifty Image Widget

WordPress plugin Swifty Image Widget scored83%from 54 tests.

About plugin

  • Plugin page: swifty-image-widget
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Aug 24, 2015
  • Latest release: Aug 9, 2023
  • Number of updates: 33
  • Update frequency: every 88.1 days
  • Top authors: Goran87 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /24,189 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼9.10ms] Passed 4 tests

A check of server-side resources used by Swifty Image Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.86 ▼6.99
Dashboard /wp-admin3.36 ▲0.0147.56 ▼13.62
Posts /wp-admin/edit.php3.48 ▲0.1250.87 ▲5.88
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.86 ▼15.71
Media Library /wp-admin/upload.php3.26 ▲0.0334.48 ▼0.08

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_swifty-img-widget
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Swifty Image Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16914.56 ▲0.011.74 ▲0.1638.20 ▲1.54
Dashboard /wp-admin2,334 ▲1566.18 ▲0.45106.71 ▲4.4736.97 ▼1.72
Posts /wp-admin/edit.php2,265 ▲1833.42 ▲1.3844.49 ▲9.1127.66 ▼8.23
Add New Post /wp-admin/post-new.php1,528 ▼122.63 ▼0.32565.20 ▼92.2331.98 ▼42.39
Media Library /wp-admin/upload.php1,393 ▼44.13 ▼0.0683.71 ▼19.4441.90 ▼1.40

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_swifty-img-widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_intermediate_image_sizes() in wp-content/plugins/swifty-image-widget/views/admin.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

swifty-image-widget/plugin.php 85% from 13 tests

This is the main PHP file of "Swifty Image Widget" version 1.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("swifty-image-widget.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin354 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP36566251
JavaScript1231462
CSS10024
PO File10017

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues 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 complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin