83% wp-header-images

Code Review | WP Header Images

WordPress plugin WP Header Images scored83%from 54 tests.

About plugin

  • Plugin page: wp-header-images
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Jul 3, 2015
  • Latest release: May 18, 2023
  • Number of updates: 130
  • Update frequency: every 22.1 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

8,000+ active /216,536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▲0.49ms] Passed 4 tests

Analyzing server-side resources used by WP Header Images
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3240.89 ▼3.34
Dashboard /wp-admin3.48 ▲0.1748.18 ▼1.89
Posts /wp-admin/edit.php3.59 ▲0.2453.10 ▲4.26
Add New Post /wp-admin/post-new.php6.06 ▲0.1796.04 ▲3.46
Media Library /wp-admin/upload.php3.40 ▲0.1738.41 ▲3.71
WP Header Images /wp-admin/options-general.php?page=wp_hi3.6943.70

Server storage [IO: ▲5.01MB] [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: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP Header Images
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲7513.18 ▼1.051.50 ▼0.6841.19 ▼8.44
Dashboard /wp-admin2,210 ▲254.84 ▼0.02109.72 ▲0.9641.88 ▼10.97
Posts /wp-admin/edit.php2,096 ▲72.10 ▲0.1039.54 ▼1.5234.14 ▼2.74
Add New Post /wp-admin/post-new.php1,538 ▲2423.05 ▲5.49665.35 ▼57.7070.05 ▲5.71
Media Library /wp-admin/upload.php1,389 ▲14.19 ▼0.0296.86 ▼12.4646.43 ▲0.30
WP Header Images /wp-admin/options-general.php?page=wp_hi3,71626.90806.2095.90

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_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • 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 | 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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-header-images/inc/wphi-settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-header-images/inc/functions.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-header-images/index.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-header-images/inc/gluri-slider-support.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-header-images/inc/functions-inner.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: custom images, header images, images, header, image slider...

wp-header-images/index.php 85% from 13 tests

The main PHP script in "WP Header Images" version 2.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 151 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-header-images.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin12,953 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
SVG3009,546
PHP68311491,521
CSS511023882
PO File3317398720
JavaScript315228284

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions33
▷ Named functions2987.88%
▷ Anonymous functions412.12%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.60MB with 0.28MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/banner-style-0.png0.07KB0.08KB0.00%
img/banner-style-3.png406.80KB128.58KB▼ 68.39%
img/screenshot-12.png202.71KB57.55KB▼ 71.61%