84% header-and-footer-script-adder

Code Review | Header and Footer Scripts Adder

WordPress plugin Header and Footer Scripts Adder scored84%from 54 tests.

About plugin

  • Plugin page: header-and-footer...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-5.5
  • WordPress version: 6.3.1
  • First release: Feb 2, 2017
  • Latest release: Sep 5, 2020
  • Number of updates: 32
  • Update frequency: every 41.0 days
  • Top authors: mahethekiller (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /9,812 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
Installer ran successfully

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

Server-side resources used by Header and Footer Scripts Adder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.97 ▼5.46
Dashboard /wp-admin3.36 ▲0.0647.79 ▼5.86
Posts /wp-admin/edit.php3.41 ▲0.0651.95 ▼1.38
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.02 ▼4.09
Media Library /wp-admin/upload.php3.28 ▲0.0538.29 ▲1.82
Header Footer Script Adder /wp-admin/options-general.php?page=header_footer_script_adder_mk3.2536.12

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Header and Footer Scripts Adder
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.23 ▼0.321.74 ▼0.0839.21 ▼4.92
Dashboard /wp-admin2,202 ▲255.61 ▲0.0091.08 ▲1.2541.46 ▲2.36
Posts /wp-admin/edit.php2,104 ▲41.95 ▼0.0140.96 ▲2.6936.76 ▲3.47
Add New Post /wp-admin/post-new.php6,239 ▲4,71126.06 ▲3.15921.66 ▲314.4860.94 ▲12.01
Media Library /wp-admin/upload.php1,404 ▲74.23 ▲0.08108.30 ▲2.4249.78 ▲7.19
Header Footer Script Adder /wp-admin/options-general.php?page=header_footer_script_adder_mk1,1322.4743.6244.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/header-and-footer-script-adder/header_footer_script_adder.php:293

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: scripts, footer scripts, footer, header scripts, admin...

header-and-footer-script-adder/header_footer_script_adder.php 92% from 13 tests

The principal PHP file in "Header and Footer Scripts Adder" v. 1.2.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("header-and-footer-script-adder.php" instead of "header_footer_script_adder.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected11,670 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71,2301,22711,128
CSS24524312
PHP18159230

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin