84% wp-headers-and-footers

Code Review | Insert Headers And Footers

WordPress plugin Insert Headers And Footers scored84%from 54 tests.

About plugin

  • Plugin page: wp-headers-and-fo...
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 20, 2017
  • Latest release: Nov 7, 2023
  • Number of updates: 27
  • Update frequency: every 88.6 days
  • Top authors: WPBrigade (77.78%)hiddenpearls (25.93%)

Code review

54 tests

User reviews

61 reviews

Install metrics

100,000+ active /613,026 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.32MB] [CPU: ▼0.60ms] Passed 4 tests

A check of server-side resources used by Insert Headers And Footers
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2840.52 ▼1.92
Dashboard /wp-admin3.69 ▲0.3953.88 ▲0.52
Posts /wp-admin/edit.php3.75 ▲0.3958.38 ▲12.08
Add New Post /wp-admin/post-new.php6.19 ▲0.3096.53 ▼3.69
Media Library /wp-admin/upload.php3.53 ▲0.3038.79 ▲2.68
WP Headers and Footers /wp-admin/options-general.php?page=wp-headers-and-footers3.5440.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 10 new options
New WordPress options
wpheaderandfooter_basics
wpheaderandfooter_settings
widget_recent-posts
widget_recent-comments
wpheaderandfooter_basics_logger
widget_theysaidso_widget
wpheaderandfooter_diagnostic_log
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Insert Headers And Footers
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲18614.80 ▲0.441.65 ▲0.0540.50 ▼5.02
Dashboard /wp-admin2,356 ▲1826.33 ▲0.66118.55 ▲18.9141.40 ▼4.84
Posts /wp-admin/edit.php2,284 ▲1873.48 ▲1.4857.26 ▲20.1735.15 ▼0.84
Add New Post /wp-admin/post-new.php1,541 ▲1523.32 ▲0.22600.33 ▼105.5033.34 ▼12.24
Media Library /wp-admin/upload.php1,415 ▲154.34 ▲0.1684.24 ▼13.8541.01 ▲0.12
WP Headers and Footers /wp-admin/options-general.php?page=wp-headers-and-footers1,6305.85118.63108.27

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
  • Zombie WordPress options detected upon uninstall: 10 options
    • theysaidso_admin_options
    • wpheaderandfooter_basics_logger
    • widget_recent-comments
    • wpheaderandfooter_basics
    • widget_recent-posts
    • can_compress_scripts
    • wpheaderandfooter_diagnostic_log
    • wpheaderandfooter_settings
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-headers-and-footers/lib/wpb-sdk/views/wpb-sdk-deactivate-form.php:109
    • > PHP Notice
      Undefined variable: product_slug in wp-content/plugins/wp-headers-and-footers/lib/wpb-sdk/views/wpb-sdk-deactivate-form.php on line 103
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-headers-and-footers/classes/plugin-meta.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-headers-and-footers/wp-headers-and-footers.php:137

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

wp-headers-and-footers/wp-headers-and-footers.php Passed 13 tests

"Insert Headers And Footers" version 2.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
81 characters long description:
Allows you to insert code or text in the header or footer of your WordPress site.

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
Good job! No executable or dangerous file extensions detected2,268 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP114056541,475
CSS3258732
JavaScript17147
SVG10014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity23.88
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods79
▷ Static methods1012.66%
▷ Public methods6886.08%
▷ Protected methods00.00%
▷ Private methods1113.92%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/img/icons.png13.07KB4.75KB▼ 63.65%
asset/img/icon-128x128.png1.98KB0.62KB▼ 68.48%