84% header-and-footer-snippets

Code Review | Header and Footer Snippets

WordPress plugin Header and Footer Snippets scored 84% from 54 tests.

About plugin

  • Plugin page: header-and-footer...
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Oct 22, 2017
  • Latest release: Oct 22, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: Verb_Form04 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 586 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.02ms] Passed 4 tests

An overview of server-side resources used by Header and Footer Snippets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1038.02 ▼0.55
Dashboard /wp-admin3.38 ▲0.0746.22 ▼4.59
Posts /wp-admin/edit.php3.49 ▲0.1451.48 ▲6.34
Add New Post /wp-admin/post-new.php5.98 ▲0.1086.59 ▼8.72
Media Library /wp-admin/upload.php3.30 ▲0.0734.79 ▲1.79

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Header and Footer Snippets
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.29 ▼1.084.56 ▲2.9139.51 ▲0.19
Dashboard /wp-admin2,227 ▲394.87 ▼0.03109.51 ▼9.3639.68 ▼1.04
Posts /wp-admin/edit.php2,108 ▲192.05 ▲0.0436.76 ▲1.6831.72 ▼4.29
Add New Post /wp-admin/post-new.php6,521 ▲4,98720.15 ▼3.07901.31 ▲266.6863.92 ▼6.50
Media Library /wp-admin/upload.php1,413 ▲254.24 ▲0.0798.06 ▼6.2244.18 ▲0.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/header-and-footer-snippets/headandfoot.php:506

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: javascript, header, footer, css, snippets

header-and-footer-snippets/headandfoot.php 92% from 13 tests

The main PHP script in "Header and Footer Snippets" version 0.9 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("header-and-footer-snippets.php" instead of "headandfoot.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin300 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP113485300

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods323.08%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin