84% add-html-javascript-and-css-to-head

Code Review | Add HTML, JavaScript and CSS to <head>

WordPress plugin Add HTML, JavaScript and CSS to <head> scored84%from 54 tests.

About plugin

  • Plugin page: add-html-javascri...
  • Plugin version: 0.1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9
  • WordPress version: 6.3.1
  • First release: Jun 29, 2018
  • Latest release: Jun 30, 2018
  • Number of updates: 15
  • Update frequency: every 0.1 days
  • Top authors: rvbakker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /782 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Add HTML, JavaScript and CSS to <head>
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0444.18 ▲1.00
Dashboard /wp-admin3.36 ▲0.0551.05 ▼3.99
Posts /wp-admin/edit.php3.41 ▲0.0549.80 ▼7.79
Add New Post /wp-admin/post-new.php5.94 ▲0.0596.71 ▲2.17
Media Library /wp-admin/upload.php3.28 ▲0.0536.41 ▼2.16

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Add HTML, JavaScript and CSS to <head>
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.28 ▼0.281.91 ▲0.1945.05 ▲4.47
Dashboard /wp-admin2,214 ▲405.62 ▲0.0290.03 ▼9.7944.13 ▼1.36
Posts /wp-admin/edit.php2,119 ▲191.96 ▼0.0439.45 ▲3.9636.65 ▲0.69
Add New Post /wp-admin/post-new.php1,539 ▲1123.24 ▲0.13594.59 ▼86.9948.11 ▼2.55
Media Library /wp-admin/upload.php1,419 ▲224.30 ▲0.11101.28 ▼3.0147.16 ▼0.62

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

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)
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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AddHtmlJavaScriptAndCssToHead\\is_admin() in wp-content/plugins/add-html-javascript-and-css-to-head/add-html-to-head.php:298

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: Please take inspiration from this readme.txt

add-html-javascript-and-css-to-head/add-html-to-head.php 92% from 13 tests

The main file in "Add HTML, JavaScript and CSS to <head>" v. 0.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-html-javascript-and-css-to-head.php" instead of "add-html-to-head.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin282 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13028282

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
No PNG images were found in this plugin