78% footer-header-js-css

Code Review | Footer header JS & CSS

WordPress plugin Footer header JS & CSS scored78%from 54 tests.

About plugin

  • Plugin page: footer-header-js-css
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 23, 2016
  • Latest release: Aug 1, 2020
  • Number of updates: 9
  • Update frequency: every 159.9 days
  • Top authors: ghz1990 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,712 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.87ms] Passed 4 tests

A check of server-side resources used by Footer header JS & CSS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0047.19 ▲1.28
Dashboard /wp-admin3.31 ▲0.0153.06 ▼4.80
Posts /wp-admin/edit.php3.36 ▲0.0050.16 ▼4.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.88 ▼7.93
Media Library /wp-admin/upload.php3.23 ▲0.0036.99 ▲2.60

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Footer header JS & CSS
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.38 ▼0.181.69 ▲0.0143.12 ▼2.87
Dashboard /wp-admin2,199 ▲225.64 ▼0.1388.36 ▼8.1443.11 ▲2.55
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0434.48 ▼5.8337.48 ▲1.86
Add New Post /wp-admin/post-new.php1,552 ▲2623.39 ▲5.81674.91 ▲30.8454.58 ▲1.42
Media Library /wp-admin/upload.php1,401 ▼24.22 ▲0.0395.78 ▼0.8843.01 ▲2.18
Footer header js & css /wp-admin/footer-header-js-and-css.php260.440.1215.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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)
Even though no errors were found, 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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/footer-header-js-css/footer-header-js-and-css.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/footer-header-js-css/main-page.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/footer-header-js-and-css.php
    • > Network (severe)
    wp-admin/footer-header-js-and-css.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: styles, footer, handle, header, scripts...

footer-header-js-css/footer-header-js-and-css.php 92% from 13 tests

The primary PHP file in "Footer header JS & CSS" version 1.2.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("footer-header-js-css.php" instead of "footer-header-js-and-css.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected226 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33758226

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods342.86%
▷ Protected methods457.14%
▷ Private methods00.00%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin