79% rotating-hero-image

Code Review | Rotating Hero Image

WordPress plugin Rotating Hero Image scored79%from 54 tests.

About plugin

  • Plugin page: rotating-hero-image
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 29, 2022
  • Latest release: Feb 10, 2023
  • Number of updates: 44
  • Update frequency: every 7.3 days
  • Top authors: wsxplugindev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /995 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼1.14ms] Passed 4 tests

An overview of server-side resources used by Rotating Hero Image
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.66 ▼1.84
Dashboard /wp-admin3.45 ▲0.1446.88 ▼5.79
Posts /wp-admin/edit.php3.56 ▲0.2049.57 ▲1.43
Add New Post /wp-admin/post-new.php6.05 ▲0.1692.69 ▲1.66
Media Library /wp-admin/upload.php3.37 ▲0.1437.56 ▲5.02
All Hero Images /wp-admin/edit.php?post_type=hero_image3.4134.48
Add New /wp-admin/post-new.php?post_type=hero_image3.5049.12
Categories /wp-admin/edit-tags.php?taxonomy=wsxhi_categories&post_type=hero_image3.3737.77
Settings /wp-admin/edit.php?post_type=hero_image&page=options3.3430.22

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 20 new options
New WordPress options
rhi_banner_text_font_color
can_compress_scripts
rhi_button_text_color
rhi_time_interval
rhi_opacity
rhi_height
rhi_show_banner_title
widget_recent-comments
rhi_title_font_style
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Rotating Hero Image: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲12413.43 ▼0.991.52 ▼0.2941.65 ▼7.51
Dashboard /wp-admin2,259 ▲685.25 ▲0.39113.64 ▲8.0344.03 ▼1.23
Posts /wp-admin/edit.php2,129 ▲372.34 ▲0.3345.45 ▲1.7335.72 ▼3.36
Add New Post /wp-admin/post-new.php1,563 ▲1923.27 ▲5.14632.08 ▲14.6937.19 ▼17.58
Media Library /wp-admin/upload.php1,442 ▲544.39 ▲0.2095.07 ▼6.1544.30 ▲2.77
All Hero Images /wp-admin/edit.php?post_type=hero_image1,1152.2537.8628.65
Add New /wp-admin/post-new.php?post_type=hero_image2,4367.97181.8168.85
Categories /wp-admin/edit-tags.php?taxonomy=wsxhi_categories&post_type=hero_image1,3002.0332.4226.39
Settings /wp-admin/edit.php?post_type=hero_image&page=options1,5012.7557.8128.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png), #5 (screenshot-5.png)
The official readme.txt might help

rotating-hero-image/rotating-hero-image.php Passed 13 tests

"Rotating Hero Image" version 1.0.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
90 characters long description:
Display a hero banner on a page or wherever you want. Use this shortcode: [wsx_hero_image]

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin618 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP546151524
CSS222088
JavaScript1506

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.96MB with 0.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png56.88KB27.53KB▼ 51.61%
screenshot-5.png674.66KB266.11KB▼ 60.56%
screenshot-3.png138.29KB42.68KB▼ 69.14%
screenshot-4.png50.65KB24.06KB▼ 52.50%
screenshot-1.png58.79KB18.43KB▼ 68.65%