83% insert-headers-and-footers

Code Review | WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager

WordPress plugin WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager scored83%from 54 tests.

About plugin

  • Plugin page: insert-headers-an...
  • Plugin version: 2.1.5
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jul 12, 2012
  • Latest release: Nov 8, 2023
  • Number of updates: 126
  • Update frequency: every 32.8 days
  • Top authors: gripgrip (59.52%)deb255 (15.08%)iamdpegg (15.08%)n7studios (7.14%)peterwilsoncc (6.35%)

Code review

54 tests

User reviews

1227 reviews

Install metrics

2,000,000+ active /28,770,501 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲3.00MB] [CPU: ▲9.84ms] 75% from 4 tests

An overview of server-side resources used by WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 512.25ms on /wp-admin/admin.php?page=wpcode-library)
Page Memory (MB) CPU Time (ms)
Home / 4.46 ▲0.99 48.74 ▲7.59
Dashboard /wp-admin 6.98 ▲3.63 71.21 ▲10.32
Posts /wp-admin/edit.php 7.09 ▲3.73 66.53 ▲17.22
Add New Post /wp-admin/post-new.php 9.60 ▲3.71 103.16 ▲4.24
Media Library /wp-admin/upload.php 6.90 ▲3.67 61.17 ▲28.13
Library /wp-admin/admin.php?page=wpcode-library 7.16 512.25
File Editor /wp-admin/admin.php?page=wpcode-file-editor 7.04 395.46
1-Click /wp-admin/admin.php?page=wpcode-click 6.99 56.05
Header & Footer /wp-admin/admin.php?page=wpcode-headers-footers 7.00 55.28
Conversion Pixels /wp-admin/admin.php?page=wpcode-pixel 6.99 56.53
Tools /wp-admin/admin.php?page=wpcode-tools 7.00 58.44
Code Snippets /wp-admin/admin.php?page=wpcode 7.19 67.93
Welcome to WPCode /wp-admin/index.php?page=wpcode-upgrade-welcome 6.99 51.58
+ Add Snippet /wp-admin/admin.php?page=wpcode-snippet-manager 7.12 69.25
Generator /wp-admin/admin.php?page=wpcode-generator 6.99 56.72

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 127 new files
Database: no new tables, 10 new options
New WordPress options
wpcode_snippets
wpcode_admin_notices
can_compress_scripts
widget_recent-comments
ihaf_activated
theysaidso_admin_options
db_upgraded
wpcode_snippets_errors
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager
Normal browser usage
Page Nodes Memory (MB) Script (ms) Layout (ms)
Home / 2,988 ▲226 14.21 ▼0.06 2.58 ▲0.86 42.31 ▼0.36
Dashboard /wp-admin 2,309 ▲135 5.59 ▼0.06 89.92 ▼13.58 43.55 ▲1.27
Posts /wp-admin/edit.php 2,218 ▲118 2.04 ▲0.09 37.28 ▼0.90 32.42 ▼2.22
Add New Post /wp-admin/post-new.php 7,121 ▲5,595 20.84 ▼2.43 886.24 ▲232.73 83.72 ▲36.76
Media Library /wp-admin/upload.php 1,517 ▲117 4.23 ▲0.01 104.92 ▲7.19 44.45 ▲3.87
Library /wp-admin/admin.php?page=wpcode-library 3,560 3.86 62.87 54.08
File Editor /wp-admin/admin.php?page=wpcode-file-editor 1,813 4.08 88.70 45.50
1-Click /wp-admin/admin.php?page=wpcode-click 1,476 2.47 31.47 35.18
Header & Footer /wp-admin/admin.php?page=wpcode-headers-footers 1,851 4.71 97.55 45.79
Conversion Pixels /wp-admin/admin.php?page=wpcode-pixel 1,732 2.37 34.82 38.74
Tools /wp-admin/admin.php?page=wpcode-tools 1,653 2.37 38.08 35.34
Code Snippets /wp-admin/admin.php?page=wpcode 2,171 2.30 33.91 36.63
Welcome to WPCode /wp-admin/index.php?page=wpcode-upgrade-welcome 1,227 2.21 29.83 44.15
+ Add Snippet /wp-admin/admin.php?page=wpcode-snippet-manager 3,572 3.96 62.76 47.25
Generator /wp-admin/admin.php?page=wpcode-generator 1,886 2.26 34.16 40.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 10 options
    • ihaf_activated
    • theysaidso_admin_options
    • wpcode_snippets_errors
    • wpcode_admin_notices
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • wpcode_snippets
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 37× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Admin_Page' not found in wp-content/plugins/insert-headers-and-footers/includes/admin/pages/class-wpcode-admin-page-generator.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Usage_Tracking' not found in wp-content/plugins/insert-headers-and-footers/includes/lite/admin/class-wpcode-usage-tracking-lite.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Generator_Type' not found in wp-content/plugins/insert-headers-and-footers/includes/generator/class-wpcode-generator-post-status.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Snippet_Execute_Type' not found in wp-content/plugins/insert-headers-and-footers/includes/execute/class-wpcode-snippet-execute-php.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Admin_Page' not found in wp-content/plugins/insert-headers-and-footers/includes/admin/pages/class-wpcode-admin-page-headers-footers.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Importer_Type' not found in wp-content/plugins/insert-headers-and-footers/includes/admin/importers/class-wpcode-importer-woody.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Admin_Page' not found in wp-content/plugins/insert-headers-and-footers/includes/admin/pages/class-wpcode-admin-page-click.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Smart_Tags' not found in wp-content/plugins/insert-headers-and-footers/includes/lite/class-wpcode-smart-tags-lite.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Metabox_Snippets' not found in wp-content/plugins/insert-headers-and-footers/includes/lite/admin/class-wpcode-metabox-snippets-lite.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPCode_Admin_Page_Loader' not found in wp-content/plugins/insert-headers-and-footers/includes/lite/admin/class-wpcode-admin-page-loader-lite.php:12

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (27 tag instead of maximum 10)
You can look at the official readme.txt

insert-headers-and-footers/ihaf.php 85% from 13 tests

The primary PHP file in "WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager" version 2.1.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 169 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("insert-headers-and-footers.php" instead of "ihaf.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
Everything looks great! No dangerous files found in this plugin19,204 lines of code in 119 files:
Language Files Blank lines Comment lines Lines of code
PHP 110 2,819 8,575 19,188
SVG 1 0 0 6
CSS 3 4 0 5
JavaScript 5 0 0 5

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code 0.35
Average class complexity 17.98
▷ Minimum class complexity 1.00
▷ Maximum class complexity 170.00
Average method complexity 2.78
▷ Minimum method complexity 1.00
▷ Maximum method complexity 40.00
Code structure
Namespaces 0
Interfaces 0
Traits 0
Classes 89
▷ Abstract classes 9 10.11%
▷ Concrete classes 80 89.89%
▷ Final classes 0 0.00%
Methods 852
▷ Static methods 17 2.00%
▷ Public methods 730 85.68%
▷ Protected methods 71 8.33%
▷ Private methods 51 5.99%
Functions 69
▷ Named functions 65 94.20%
▷ Anonymous functions 4 5.80%
Constants 11
▷ Global constants 5 45.45%
▷ Class constants 6 54.55%
▷ Public constants 6 100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
File Size - original Size - compressed Savings
admin/images/wpcode-logo.png 9.29KB 4.46KB ▼ 52.02%
admin/images/syed.png 15.37KB 6.01KB ▼ 60.90%
admin/images/mircea.png 15.49KB 6.05KB ▼ 60.97%