89% table-of-contents

Code Review | Table of Contents Block

WordPress plugin Table of Contents Block scored89%from 54 tests.

About plugin

  • Plugin page: table-of-contents
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.9.0
  • WordPress version: 6.3.1
  • First release: Jul 21, 2020
  • Latest release: Jan 26, 2022
  • Number of updates: 11
  • Update frequency: every 50.5 days
  • Top authors: ibachal (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

3,000+ active /23,989 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Table of Contents Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.90 ▼2.51
Dashboard /wp-admin3.32 ▼0.0255.78 ▼14.10
Posts /wp-admin/edit.php3.38 ▲0.0249.61 ▼7.41
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.27 ▼15.95
Media Library /wp-admin/upload.php3.25 ▲0.0243.02 ▲4.01

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Table of Contents Block
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12713.52 ▼1.049.10 ▲7.3342.31 ▲0.36
Dashboard /wp-admin2,195 ▲155.59 ▼0.1088.71 ▼4.2541.22 ▲2.18
Posts /wp-admin/edit.php2,103 ▼02.00 ▼0.0139.85 ▼0.0334.04 ▼1.61
Add New Post /wp-admin/post-new.php6,368 ▲4,84227.56 ▲4.39941.51 ▲213.0539.56 ▼24.99
Media Library /wp-admin/upload.php1,394 ▼34.23 ▼0.0498.61 ▼5.6844.15 ▲0.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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
6 plugin tags: gutenberg toc, table of contents, gutenberg, nested toc, toc block...

table-of-contents/index.php 77% from 13 tests

Analyzing the main PHP file in "Table of Contents Block" version 1.0.2
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "5.8")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("table-of-contents.php" instead of "index.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
Success! There were no dangerous files found in this plugin241 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23511179
PHP3121841
JSON10018
CSS2003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.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