84% dynamic-custom-header-replacement

Code Review | Dynamic Custom Header Replacement

WordPress plugin Dynamic Custom Header Replacement scored 84% from 54 tests.

About plugin

  • Plugin page: dynamic-custom-he...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Mar 24, 2017
  • Latest release: Jun 26, 2017
  • Number of updates: 8
  • Update frequency: every 11.3 days
  • Top authors: enteractie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,077 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.00MB] [CPU: ▼6.29ms] Passed 4 tests

An overview of server-side resources used by Dynamic Custom Header Replacement
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.65 ▼1.11
Dashboard /wp-admin3.31 ▲0.0149.39 ▲0.51
Posts /wp-admin/edit.php3.36 ▲0.0044.31 ▼3.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.49 ▼18.34
Media Library /wp-admin/upload.php3.23 ▲0.0035.35 ▼1.91

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Dynamic Custom Header Replacement
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.601.61 ▲0.0442.43 ▼8.20
Dashboard /wp-admin2,200 ▲114.83 ▼0.22101.42 ▼5.3446.60 ▲7.70
Posts /wp-admin/edit.php2,086 ▼62.05 ▲0.0134.84 ▼7.0631.54 ▼4.08
Add New Post /wp-admin/post-new.php1,546 ▲423.05 ▲4.83626.97 ▲17.6956.80 ▲1.54
Media Library /wp-admin/upload.php1,391 ▲94.19 ▼0.03104.09 ▲6.8745.80 ▲0.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dynamic-custom-header-replacement/dynamic-custom-header-replacement.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === dynamic-custom-header-replacement === )
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

dynamic-custom-header-replacement/dynamic-custom-header-replacement.php Passed 13 tests

The main PHP script in "Dynamic Custom Header Replacement" version 1.2 is automatically included on every request by WordPress
78 characters long description:
Allows the Custom Header Image to be replaced by the post/page Featured image.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin12 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12812

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions1
▷ Named functions1100.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
There are no PNG files in this plugin