78% dynamic-page-header-images

Code Review | Dynamic Page Header Images

WordPress plugin Dynamic Page Header Images scored78%from 54 tests.

About plugin

  • Plugin page: dynamic-page-head...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 20, 2016
  • Latest release: Jan 21, 2021
  • Number of updates: 8
  • Update frequency: every 222.4 days
  • Top authors: praveencrony (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,879 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.66MB] [CPU: ▼16.60ms] Passed 4 tests

Server-side resources used by Dynamic Page Header Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.13 ▼5.52
Dashboard /wp-admin3.33 ▲0.0346.50 ▼7.52
Posts /wp-admin/edit.php3.38 ▲0.0346.57 ▲2.26
Add New Post /wp-admin/post-new.php3.16 ▼2.7237.54 ▼54.36
Media Library /wp-admin/upload.php3.26 ▲0.0336.10 ▲1.01
User Guide - DHI /wp-admin/options-general.php?page=dhi-option3.2229.09

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Dynamic Page Header Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.16 ▼1.154.64 ▲2.8241.08 ▼3.90
Dashboard /wp-admin2,210 ▲224.88 ▼1.15107.09 ▼10.7942.31 ▼4.91
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0139.93 ▲4.4835.42 ▲1.00
Add New Post /wp-admin/post-new.php1,538 ▲323.04 ▼0.11603.95 ▼96.4461.52 ▲2.96
Media Library /wp-admin/upload.php1,395 ▲74.25 ▲0.0599.83 ▼7.7241.06 ▼4.47
User Guide - DHI /wp-admin/options-general.php?page=dhi-option8772.0124.6426.97

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=dhi-option
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=dhi-option
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/dynamic-page-header-images/dynamic-header-images.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/dynamic-page-header-images/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
You can take inspiration from this readme.txt

dynamic-page-header-images/dynamic-header-images.php 92% from 13 tests

"Dynamic Page Header Images" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dynamic-page-header-images.php" instead of "dynamic-header-images.php")

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
No dangerous file extensions were detected199 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP27027199

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin