78% header-footer-code-manager

Code Review | Header Footer Code Manager

WordPress plugin Header Footer Code Manager scored78%from 54 tests.

About plugin

  • Plugin page: header-footer-cod...
  • Plugin version: 1.1.36
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2016
  • Latest release: Sep 6, 2023
  • Number of updates: 70
  • Update frequency: every 36.7 days
  • Top authors: 99robots (100%)

Code review

54 tests

User reviews

262 reviews

Install metrics

500,000+ active /4,969,264 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼1.22ms] Passed 4 tests

A check of server-side resources used by Header Footer Code Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2644.80 ▲6.95
Dashboard /wp-admin3.58 ▲0.2745.85 ▼2.53
Posts /wp-admin/edit.php3.69 ▲0.3347.41 ▲2.25
Add New Post /wp-admin/post-new.php6.16 ▲0.2794.12 ▼9.94
Media Library /wp-admin/upload.php3.50 ▲0.2737.95 ▲5.33
All Snippets /wp-admin/admin.php?page=hfcm-list3.4733.61
Request Handler /wp-admin/admin.php?page=hfcm-request-handler3.4429.98
Update /wp-admin/admin.php?page=hfcm-update3.4431.95
Tools /wp-admin/admin.php?page=hfcm-tools3.4833.94
Add New /wp-admin/admin.php?page=hfcm-create3.7036.38

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: 1 new table, 8 new options
New tables
wp_hfcm_scripts
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
hfcm_activation_date
hfcm_db_version
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Header Footer Code Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.63 ▼0.754.36 ▲2.6142.31 ▲2.21
Dashboard /wp-admin2,254 ▲665.86 ▲0.81105.83 ▲5.3440.51 ▼1.42
Posts /wp-admin/edit.php2,140 ▲482.02 ▲0.0240.25 ▼2.0535.44 ▼0.05
Add New Post /wp-admin/post-new.php1,541 ▼117.67 ▼0.64587.02 ▼9.0052.57 ▲0.67
Media Library /wp-admin/upload.php1,439 ▲544.21 ▲0.0895.32 ▼4.1544.20 ▲0.23
All Snippets /wp-admin/admin.php?page=hfcm-list1,0762.0826.3457.92
Request Handler /wp-admin/admin.php?page=hfcm-request-handler7011.146.7217.01
Update /wp-admin/admin.php?page=hfcm-update7383.4749.6425.55
Tools /wp-admin/admin.php?page=hfcm-tools9222.1230.3429.94
Add New /wp-admin/admin.php?page=hfcm-create1,6234.95105.2138.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • hfcm_activation_date
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • 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 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
Please fix the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/class-wp-list-table.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/header-footer-code-manager/includes/class-hfcm-snippets-list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/header-footer-code-manager/includes/hfcm-tools.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/header-footer-code-manager/includes/class-hfcm-snippets-list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/header-footer-code-manager/includes/hfcm-add-edit.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/header-footer-code-manager/includes/class-hfcm-snippets-list.php:6
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/header-footer-code-manager/includes/class-hfcm-snippets-list.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=hfcm-tools
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).selectize is not a function" "TypeError: $(...).selectize is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/header-footer-code-manager/js/nnr-hfcm-showboxes.js?ver=6.3.1:148:106)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=hfcm-tools
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).selectize is not a function
    • > GET request to /wp-admin/admin.php?page=hfcm-create
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of null (reading 'addEventListener')" "TypeError: Cannot read properties of null (reading 'addEventListener')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/header-footer-code-manager/js/nnr-hfcm-showboxes.js?ver=6.3.1:168:55)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=hfcm-create
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-codemirror,underscore&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: google analytics, tracking, verification, pixel, code manager...

header-footer-code-manager/99robots-header-footer-code-manager.php 85% from 13 tests

The main file in "Header Footer Code Manager" v. 1.1.36 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("header-footer-code-manager.php" instead of "99robots-header-footer-code-manager.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 336 characters long)

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
No dangerous file extensions were detected3,220 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP52642682,095
CSS3117612
PO File1101269281
JavaScript42422231
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity122.50
▷ Minimum class complexity80.00
▷ Maximum class complexity165.00
Average method complexity5.96
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods49
▷ Static methods3673.47%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/99robots.png1.81KB1.07KB▼ 41.04%
images/logo.png2.74KB2.01KB▼ 26.60%