83% header-and-footer-scripts

Code Review | Header and Footer Scripts

WordPress plugin Header and Footer Scripts scored83%from 54 tests.

About plugin

  • Plugin page: header-and-footer...
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Feb 20, 2014
  • Latest release: Apr 26, 2020
  • Number of updates: 27
  • Update frequency: every 83.6 days
  • Top authors: BlogSynthesis (51.85%)anand_kumar (48.15%)digitalliberation (7.41%)

Code review

54 tests

User reviews

55 reviews

Install metrics

200,000+ active /1,151,582 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼8.57ms] Passed 4 tests

This is a short check of server-side resources used by Header and Footer Scripts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.74 ▼11.06
Dashboard /wp-admin3.37 ▲0.0651.53 ▼2.08
Posts /wp-admin/edit.php3.42 ▲0.0647.99 ▼6.46
Add New Post /wp-admin/post-new.php5.95 ▲0.0683.24 ▼14.66
Media Library /wp-admin/upload.php3.30 ▲0.0638.13 ▲6.59
Header and Footer Scripts /wp-admin/options-general.php?page=header-and-footer-scripts/shfs.php3.2835.47

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Header and Footer Scripts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.40 ▼0.161.80 ▼0.0846.06 ▲3.04
Dashboard /wp-admin2,196 ▲195.63 ▼0.1196.27 ▲10.8042.10 ▼2.25
Posts /wp-admin/edit.php2,101 ▲222.00 ▼0.0236.69 ▲0.2833.61 ▼3.52
Add New Post /wp-admin/post-new.php6,233 ▲4,68818.80 ▼4.47886.08 ▲234.2759.88 ▲13.33
Media Library /wp-admin/upload.php1,407 ▲74.23 ▼0.10100.28 ▼2.3142.39 ▼3.29
Header and Footer Scripts /wp-admin/options-general.php?page=header-and-footer-scripts/shfs.php9332.0122.1329.59

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/header-and-footer-scripts/shfs.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/header-and-footer-scripts/inc/sidebar.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/header-and-footer-scripts/inc/options.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/header-and-footer-scripts/inc/meta.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Access this page from `Dashboard --> Settings --> Header and Footer Scripts`), #2 (This box will appear below the compose box on posts and pages. If not please refer to [our docs][4] if it's not there.)
The official readme.txt is a good inspiration

header-and-footer-scripts/shfs.php 77% from 13 tests

This is the main PHP file of "Header and Footer Scripts" version 2.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 150 characters long)
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("header-and-footer-scripts.php" instead of "shfs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected172 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP46860172

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin