84% automatic-table-of-contents

Code Review | Automatic TOC - Table of Contents

WordPress plugin Automatic TOC - Table of Contents scored84%from 54 tests.

About plugin

  • Plugin page: automatic-table-o...
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2023
  • Latest release: Feb 6, 2023
  • Number of updates: 8
  • Update frequency: every 4.0 days
  • Top authors: pluginsclub (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /535 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Automatic TOC - Table of Contents
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.01 ▼11.03
Dashboard /wp-admin3.33 ▲0.0350.64 ▼3.12
Posts /wp-admin/edit.php3.38 ▲0.0255.88 ▲6.63
Add New Post /wp-admin/post-new.php5.91 ▲0.0296.36 ▲6.82
Media Library /wp-admin/upload.php3.25 ▲0.0234.45 ▼0.06

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_toc_widget
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Automatic TOC - Table of Contents
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.16 ▼0.231.64 ▼0.1745.32 ▼2.03
Dashboard /wp-admin2,195 ▲155.64 ▼0.0393.48 ▼7.0241.28 ▼2.12
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0540.09 ▲4.9535.54 ▼0.92
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.08656.81 ▼19.7547.63 ▼4.24
Media Library /wp-admin/upload.php1,394 ▼64.20 ▲0.0496.81 ▼10.3645.24 ▲0.19

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 does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_toc_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/automatic-table-of-contents/toc-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/automatic-table-of-contents/toc-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: headings, table of content, in this article, on this page, toc

automatic-table-of-contents/automatic-table-of-contents.php Passed 13 tests

The principal PHP file in "Automatic TOC - Table of Contents" v. 1.1 is loaded by WordPress automatically on each request
112 characters long description:
Adds a shortcode and a widget for displaying a nested table of contents from all heading tags found on the page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin84 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2151984

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.20
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin