83% dk-new-medias-image-rotator-widget

Code Review | Image Rotator Widget

WordPress plugin Image Rotator Widget scored83%from 54 tests.

About plugin

  • Plugin page: dk-new-medias-ima...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.4.2
  • WordPress version: 6.3.1
  • First release: Dec 10, 2011
  • Latest release: May 6, 2016
  • Number of updates: 62
  • Update frequency: every 26.0 days
  • Top authors: douglaskarr (79.03%)srcoley (22.58%)

Code review

54 tests

User reviews

30 reviews

Install metrics

1,000+ active /161,764 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.52ms] Passed 4 tests

This is a short check of server-side resources used by Image Rotator Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.86 ▼4.36
Dashboard /wp-admin3.36 ▲0.0646.74 ▼5.13
Posts /wp-admin/edit.php3.41 ▲0.0647.46 ▲0.59
Add New Post /wp-admin/post-new.php5.94 ▲0.0679.30 ▼19.45
Media Library /wp-admin/upload.php3.28 ▲0.0533.58 ▼1.13

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_dk-image-rotator-widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Image Rotator Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲15013.78 ▼0.517.24 ▲5.0640.55 ▼10.11
Dashboard /wp-admin2,209 ▲214.84 ▼0.98108.29 ▼7.0936.89 ▼8.21
Posts /wp-admin/edit.php2,092 ▲62.04 ▲0.0438.33 ▲0.6332.39 ▼0.33
Add New Post /wp-admin/post-new.php1,538 ▲2423.24 ▲5.69658.91 ▲3.0551.83 ▲2.52
Media Library /wp-admin/upload.php1,391 ▲64.15 ▼0.0899.63 ▼4.4643.02 ▲1.28

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_dk-image-rotator-widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 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/dk-new-medias-image-rotator-widget/dkirw.php:65

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (DK New Media's Image Rotator Widget.), #2 (Once you've selected or uploaded the image, you must click "Send to Image Rotator."), #3 (Images added to the widget are listed in dynamically in the Images section.), #4 (Multiple images have been added to this widget), #5 (Hover over the image name to see a tooltip that contains the image.), #6 (Drag & Drop images to sort, right in the widget settings.)
Please take inspiration from this readme.txt

dk-new-medias-image-rotator-widget/dkirw.php 85% from 13 tests

"Image Rotator Widget" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 169 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("dk-new-medias-image-rotator-widget.php" instead of "dkirw.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
Good job! No executable or dangerous file extensions detected499 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43026208
PHP13243206
CSS215085

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity8.00
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
7 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png14.49KB6.82KB▼ 52.93%
images/add_image.png1.69KB1.37KB▼ 19.10%
screenshot-4.png16.94KB7.53KB▼ 55.55%
screenshot-6.png18.27KB8.12KB▼ 55.57%
screenshot-5.png26.86KB11.10KB▼ 58.66%