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)
PageMemory (MB)CPU Time (ms)
Home /4.46 ▲0.9948.74 ▲7.59
Dashboard /wp-admin6.98 ▲3.6371.21 ▲10.32
Posts /wp-admin/edit.php7.09 ▲3.7366.53 ▲17.22
Add New Post /wp-admin/post-new.php9.60 ▲3.71103.16 ▲4.24
Media Library /wp-admin/upload.php6.90 ▲3.6761.17 ▲28.13
Library /wp-admin/admin.php?page=wpcode-library7.16512.25
File Editor /wp-admin/admin.php?page=wpcode-file-editor7.04395.46
1-Click /wp-admin/admin.php?page=wpcode-click6.9956.05
Header & Footer /wp-admin/admin.php?page=wpcode-headers-footers7.0055.28
Conversion Pixels /wp-admin/admin.php?page=wpcode-pixel6.9956.53
Tools /wp-admin/admin.php?page=wpcode-tools7.0058.44
Code Snippets /wp-admin/admin.php?page=wpcode7.1967.93
Welcome to WPCode /wp-admin/index.php?page=wpcode-upgrade-welcome6.9951.58
+ Add Snippet /wp-admin/admin.php?page=wpcode-snippet-manager7.1269.25
Generator /wp-admin/admin.php?page=wpcode-generator6.9956.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
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲22614.21 ▼0.062.58 ▲0.8642.31 ▼0.36
Dashboard /wp-admin2,309 ▲1355.59 ▼0.0689.92 ▼13.5843.55 ▲1.27
Posts /wp-admin/edit.php2,218 ▲1182.04 ▲0.0937.28 ▼0.9032.42 ▼2.22
Add New Post /wp-admin/post-new.php7,121 ▲5,59520.84 ▼2.43886.24 ▲232.7383.72 ▲36.76
Media Library /wp-admin/upload.php1,517 ▲1174.23 ▲0.01104.92 ▲7.1944.45 ▲3.87
Library /wp-admin/admin.php?page=wpcode-library3,5603.8662.8754.08
File Editor /wp-admin/admin.php?page=wpcode-file-editor1,8134.0888.7045.50
1-Click /wp-admin/admin.php?page=wpcode-click1,4762.4731.4735.18
Header & Footer /wp-admin/admin.php?page=wpcode-headers-footers1,8514.7197.5545.79
Conversion Pixels /wp-admin/admin.php?page=wpcode-pixel1,7322.3734.8238.74
Tools /wp-admin/admin.php?page=wpcode-tools1,6532.3738.0835.34
Code Snippets /wp-admin/admin.php?page=wpcode2,1712.3033.9136.63
Welcome to WPCode /wp-admin/index.php?page=wpcode-upgrade-welcome1,2272.2129.8344.15
+ Add Snippet /wp-admin/admin.php?page=wpcode-snippet-manager3,5723.9662.7647.25
Generator /wp-admin/admin.php?page=wpcode-generator1,8862.2634.1640.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:
LanguageFilesBlank linesComment linesLines of code
PHP1102,8198,57519,188
SVG1006
CSS3405
JavaScript5005

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 code0.35
Average class complexity17.98
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes89
▷ Abstract classes910.11%
▷ Concrete classes8089.89%
▷ Final classes00.00%
Methods852
▷ Static methods172.00%
▷ Public methods73085.68%
▷ Protected methods718.33%
▷ Private methods515.99%
Functions69
▷ Named functions6594.20%
▷ Anonymous functions45.80%
Constants11
▷ Global constants545.45%
▷ Class constants654.55%
▷ Public constants6100.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
FileSize - originalSize - compressedSavings
admin/images/wpcode-logo.png9.29KB4.46KB▼ 52.02%
admin/images/syed.png15.37KB6.01KB▼ 60.90%
admin/images/mircea.png15.49KB6.05KB▼ 60.97%