72% floating-table-of-contents

Code Review | Floating Table of Contents

WordPress plugin Floating Table of Contents scored 72% from 54 tests.

About plugin

  • Plugin page: floating-table-of...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Dec 17, 2021
  • Latest release: Jan 26, 2022
  • Number of updates: 3
  • Update frequency: every 14.7 days
  • Top authors: rokeimonin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,221 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.27MB] [CPU: ▼17.82ms] Passed 4 tests

Server-side resources used by Floating Table of Contents
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.33 ▼6.37
Dashboard /wp-admin3.36 ▲0.0644.24 ▼6.04
Posts /wp-admin/edit.php3.41 ▲0.0647.45 ▼3.66
Add New Post /wp-admin/post-new.php4.65 ▼1.2345.23 ▼55.22
Media Library /wp-admin/upload.php3.29 ▲0.0637.18 ▲2.17
Table of Contents Plugin Menu /wp-admin/options-general.php?page=blockTOC/admin-page.php3.2330.94

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 1,709 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Floating Table of Contents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲23315.29 ▲1.0231.39 ▲29.6041.20 ▲2.76
Dashboard /wp-admin2,217 ▲355.86 ▲1.00109.12 ▼10.5640.77 ▼2.82
Posts /wp-admin/edit.php2,097 ▲82.04 ▲0.0039.04 ▼0.8035.45 ▲1.73
Add New Post /wp-admin/post-new.php1,521 ▲217.67 ▼5.84646.69 ▼26.5135.92 ▼16.71
Media Library /wp-admin/upload.php1,396 ▲84.26 ▲0.0195.61 ▼17.8241.52 ▼5.76
Table of Contents Plugin Menu /wp-admin/options-general.php?page=blockTOC/admin-page.php1,3763.9333.4741.75

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Notice in wp-content/plugins/floating-table-of-contents/src/admin-page.php+175
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/floating-table-of-contents/src/admin-page.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 245 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 253 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 261 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 268 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 276 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 284 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 291 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 295 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/options-general.php?page=blockTOC/admin-page.php
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=blockTOC%2Fadmin-page.php 299 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention: Please take inspiration from this readme.txt

floating-table-of-contents/TOC_Plugin.php 92% from 13 tests

The main file in "Floating Table of Contents" v. 1.0.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 ("floating-table-of-contents.php" instead of "TOC_Plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin129,297 lines of code in 1,691 files:
LanguageFilesBlank linesComment linesLines of code
JSON20060,839
YAML40025,394
SVG1,61501216,003
JavaScript169433628,836
CSS163,712668,299
Sass18507344,780
LESS18504554,738
PHP28545408

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.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
src/media/WideTransparentOriginal.png42.35KB20.15KB▼ 52.42%