89% heroic-table-of-contents

Code Review | Heroic Table of Contents

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

About plugin

  • Plugin page: heroic-table-of-c...
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Mar 16, 2020
  • Latest release: May 19, 2022
  • Number of updates: 18
  • Update frequency: every 44.4 days
  • Top authors: herothemes (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

6,000+ active /31,147 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.61ms] Passed 4 tests

This is a short check of server-side resources used by Heroic Table of Contents
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.64 ▼7.66
Dashboard /wp-admin3.32 ▲0.0243.30 ▼5.92
Posts /wp-admin/edit.php3.37 ▲0.0143.19 ▼2.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.38 ▼14.37
Media Library /wp-admin/upload.php3.24 ▲0.0133.45 ▼2.50

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Heroic Table of Contents: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5813.17 ▼1.202.25 ▲0.2344.48 ▼0.49
Dashboard /wp-admin2,209 ▲215.91 ▲1.05100.51 ▼14.1038.90 ▼5.54
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0136.60 ▼1.7735.05 ▲0.50
Add New Post /wp-admin/post-new.php6,189 ▲4,66918.93 ▼4.34907.88 ▲219.4453.60 ▼10.38
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0594.75 ▼25.4243.56 ▼5.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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
5 plugin tags: index, table of contents, navigation, seo, toc

heroic-table-of-contents/ht-toc.php 85% from 13 tests

The main PHP file in "Heroic Table of Contents" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("heroic-table-of-contents.php" instead of "ht-toc.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected76 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP2124162
JavaScript34012
CSS2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
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
PNG images were not found in this plugin