90% inline-javascript-in-head

Code Review | Inline JavaScript in Head

WordPress plugin Inline JavaScript in Head scored90%from 54 tests.

About plugin

  • Plugin page: inline-javascript...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Mar 11, 2019
  • Latest release: Apr 29, 2020
  • Number of updates: 9
  • Update frequency: every 46.7 days
  • Top authors: palasthotel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /895 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.07ms] Passed 4 tests

Server-side resources used by Inline JavaScript in Head
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0146.42 ▲3.67
Dashboard /wp-admin3.32 ▲0.0145.78 ▼5.85
Posts /wp-admin/edit.php3.37 ▲0.0147.12 ▲0.39
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.07 ▼12.40
Media Library /wp-admin/upload.php3.24 ▲0.0135.81 ▲1.60

Server storage [IO: ▲0.04MB] [DB: ▲0.64MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Inline JavaScript in Head
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,782 ▲4713.59 ▼0.982.07 ▲0.1849.23 ▼0.38
Dashboard /wp-admin2,200 ▲185.86 ▲0.00103.35 ▲4.9138.10 ▼3.26
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0339.12 ▼0.7635.03 ▲0.73
Add New Post /wp-admin/post-new.php1,514 ▼017.66 ▲0.18605.02 ▼45.6948.96 ▼3.13
Media Library /wp-admin/upload.php1,388 ▲34.20 ▼0.0792.70 ▼20.6539.80 ▼4.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: performance, scripts, head, hook, filter...

inline-javascript-in-head/plugin.php 92% from 13 tests

The main file in "Inline JavaScript in Head" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("inline-javascript-in-head.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected49 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1152049

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods133.33%
▷ Public methods266.67%
▷ Protected methods00.00%
▷ Private methods133.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
There are no PNG files in this plugin