68% header-footer-custom-html

Code Review | Header Footer Custom Html

WordPress plugin Header Footer Custom Html scored68%from 54 tests.

About plugin

  • Plugin page: header-footer-cus...
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: Aug 4, 2021
  • Latest release: Sep 11, 2023
  • Number of updates: 46
  • Update frequency: every 16.8 days
  • Top authors: enweby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /5,756 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.83MB] [CPU: ▲5.85ms] Passed 4 tests

Analyzing server-side resources used by Header Footer Custom Html
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6646.68 ▲6.75
Dashboard /wp-admin4.22 ▲0.8758.45 ▲4.87
Posts /wp-admin/edit.php4.26 ▲0.9153.44 ▲13.62
Add New Post /wp-admin/post-new.php6.86 ▲0.97101.84 ▲3.40
Media Library /wp-admin/upload.php4.11 ▲0.8944.19 ▲8.39
Support Forum /wp-admin/admin.php?page=header-footer-custom-html-wp-support-forum3.8230.29
Contact Us /wp-admin/admin.php?page=header-footer-custom-html-contact4.1639.12
Global Settings /wp-admin/admin.php?page=header-footer-custom-html4.1745.08
Header Footer Custom Html /wp-admin/admin.php?page=header-footer-custom-html&page=header-footer-custom-html4.1546.25
Add New /wp-admin/post-new.php?post_type=enwb_hfch_settings4.2855.56
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.5041.80
Upgrade  ➤ /wp-admin/admin.php?page=header-footer-custom-html-pricing4.1841.37
All HFCH Settings /wp-admin/edit.php?post_type=enwb_hfch_settings4.2047.11

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 223 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
fs_debug_mode
db_upgraded
theysaidso_admin_options
fs_active_plugins
widget_recent-comments
fs_accounts

Browser metrics Passed 4 tests

Header Footer Custom Html: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,083 ▲33715.26 ▲0.676.39 ▲4.6242.18 ▼2.57
Dashboard /wp-admin2,406 ▲2266.40 ▲0.76113.38 ▲29.0537.65 ▼0.49
Posts /wp-admin/edit.php2,336 ▲2363.26 ▲1.2949.16 ▲8.6230.50 ▼11.29
Add New Post /wp-admin/post-new.php1,587 ▲6123.40 ▲0.49651.84 ▲23.4544.62 ▼8.89
Media Library /wp-admin/upload.php1,476 ▲734.40 ▲0.1984.90 ▼13.7744.39 ▼0.71
Support Forum /wp-admin/admin.php?page=header-footer-custom-html-wp-support-forum1,3703.9287.2672.68
Contact Us /wp-admin/admin.php?page=header-footer-custom-html-contact1,7944.5770.0044.62
Global Settings /wp-admin/admin.php?page=header-footer-custom-html1,5555.5596.7776.42
Header Footer Custom Html /wp-admin/admin.php?page=header-footer-custom-html&page=header-footer-custom-html1,5495.4197.4167.91
Add New /wp-admin/post-new.php?post_type=enwb_hfch_settings3,46911.19238.17105.28
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,3143.3439.8125.31
Upgrade  ➤ /wp-admin/admin.php?page=header-footer-custom-html-pricing1,8844.9485.8048.62
All HFCH Settings /wp-admin/edit.php?post_type=enwb_hfch_settings1,3133.5449.9828.29

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/header-footer-custom-html/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_accounts
    • fs_active_plugins
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_debug_mode
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/header-footer-custom-html/public/partials/header-footer-custom-html-public-display.php
    • > /wp-content/plugins/header-footer-custom-html/index.php
    • > /wp-content/plugins/header-footer-custom-html/public/index.php
    • > /wp-content/plugins/header-footer-custom-html/admin/partials/hfch-main-menu.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/header-footer-custom-html/admin/index.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/header-footer-custom-html/admin/partials/header-footer-custom-html-admin-display.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: custom script in header or footer, header footer custom html, custom css script in header, header footer css, header script...

header-footer-custom-html/header-footer-custom-html.php 92% from 13 tests

"Header Footer Custom Html" version 1.0.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 242 characters long)

Code Analysis 97% from 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 plugin36,508 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PHP1368,69818,42235,524
JavaScript685172443
Markdown2820405
CSS16610100
SVG10120
XML13016

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity81.80
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes59
▷ Abstract classes23.39%
▷ Concrete classes5796.61%
▷ Final classes00.00%
Methods1,408
▷ Static methods20914.84%
▷ Public methods1,00471.31%
▷ Protected methods201.42%
▷ Private methods38427.27%
Functions105
▷ Named functions10499.05%
▷ Anonymous functions10.95%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
13 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/enweby-logo-old.png4.51KB2.98KB▼ 33.96%
admin/images/enweby-logo-white.png4.23KB2.92KB▼ 31.14%
admin/images/hfch-128x128.png3.93KB2.60KB▼ 34.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/header-footer-custom-html.png9.16KB5.26KB▼ 42.58%