78% image-switcher

Code Review | Image Switcher

WordPress plugin Image Switcher scored78%from 54 tests.

About plugin

  • Plugin page: image-switcher
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 6.3.1
  • First release: Sep 5, 2018
  • Latest release: Dec 7, 2018
  • Number of updates: 25
  • Update frequency: every 3.8 days
  • Top authors: khanit (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,918 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
Install script ran successfully

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

An overview of server-side resources used by Image Switcher
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0233.04 ▼4.36
Dashboard /wp-admin3.36 ▲0.0155.85 ▼3.54
Posts /wp-admin/edit.php3.47 ▲0.1153.59 ▲7.34
Add New Post /wp-admin/post-new.php5.93 ▲0.0599.59 ▲10.55
Media Library /wp-admin/upload.php3.26 ▲0.0334.32 ▼0.67
Image Switcher /wp-admin/options-general.php?page=image_switcher3.2633.26

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Image Switcher: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲21414.78 ▲0.491.71 ▲0.0939.70 ▼1.83
Dashboard /wp-admin2,367 ▲1866.39 ▲0.83120.32 ▲22.7840.18 ▼2.73
Posts /wp-admin/edit.php2,292 ▲1923.53 ▲1.5552.87 ▲14.3932.48 ▼2.05
Add New Post /wp-admin/post-new.php1,552 ▲2623.99 ▲0.49665.05 ▲17.2237.13 ▼13.42
Media Library /wp-admin/upload.php1,429 ▲294.42 ▲0.2482.77 ▼20.4442.68 ▼1.74
Image Switcher /wp-admin/options-general.php?page=image_switcher1,6464.0975.6435.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/image-switcher/image-switcher.php
    • > /wp-content/plugins/image-switcher/admin/admin-page.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=image_switcher
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=image_switcher
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=image_switcher
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultString is deprecated since version 5.5.0! Use wp.i18n instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=image_switcher
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Requires php: Version not formatted correctly
  • Plugin Name: Please specify the plugin name on the first line ( === image-switcher === )
You can take inspiration from this readme.txt

image-switcher/image-switcher.php Passed 13 tests

The main PHP file in "Image Switcher" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
91 characters long description:
This is just simple wordpress image switcher plugin. You can switch image through hovering.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin738 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP317238350
JavaScript365152341
CSS220347

PHP code Passed 2 tests

An overview 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.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/placeholder-blue.png3.88KB2.85KB▼ 26.65%
assets/img/placeholder-red.png3.88KB2.85KB▼ 26.65%