78% unique-headers

Code Review | Unique Headers

WordPress plugin Unique Headers scored78%from 54 tests.

About plugin

  • Plugin page: unique-headers
  • Plugin version: 1.9.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.4
  • WordPress version: 6.3.1
  • First release: Jun 25, 2012
  • Latest release: Oct 26, 2023
  • Number of updates: 88
  • Update frequency: every 47.1 days
  • Top authors: ryanhellyer (100%)

Code review

54 tests

User reviews

159 reviews

Install metrics

20,000+ active /363,020 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.21ms] Passed 4 tests

This is a short check of server-side resources used by Unique Headers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1137.93 ▼1.04
Dashboard /wp-admin3.46 ▲0.1545.82 ▲1.12
Posts /wp-admin/edit.php3.58 ▲0.2251.61 ▲1.89
Add New Post /wp-admin/post-new.php6.05 ▲0.1680.92 ▼5.57
Media Library /wp-admin/upload.php3.37 ▲0.1335.58 ▲0.67

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Unique Headers: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17214.45 ▲0.161.71 ▲0.0944.88 ▲0.47
Dashboard /wp-admin2,336 ▲1566.17 ▲0.56111.40 ▲24.8137.54 ▼2.37
Posts /wp-admin/edit.php2,267 ▲1673.33 ▲1.3055.27 ▲17.5534.48 ▼2.13
Add New Post /wp-admin/post-new.php6,256 ▲4,73025.84 ▲2.51867.49 ▲212.2840.58 ▼23.56
Media Library /wp-admin/upload.php1,404 ▲44.14 ▼0.0779.13 ▼28.3939.72 ▼5.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/unique-headers/index.php
    • > /wp-content/plugins/unique-headers/inc/legacy.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Unique_Headers_Core' not found in wp-content/plugins/unique-headers/inc/class-unique-headers-display.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Unique_Headers_Core' not found in wp-content/plugins/unique-headers/inc/class-unique-headers-taxonomy-header-images.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (21 tag instead of maximum 10)
You can look at the official readme.txt

unique-headers/index.php 92% from 13 tests

This is the main PHP file of "Unique Headers" version 1.9.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("unique-headers.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin731 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP8224642573
JavaScript1426976
PO File4201664
JSON10011
CSS1007

PHP code Passed 2 tests

This is a very shot review 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.38
Average class complexity15.50
▷ Minimum class complexity4.00
▷ Maximum class complexity36.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods413.79%
▷ Public methods2896.55%
▷ Protected methods00.00%
▷ Private methods13.45%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin