84% wpwing-table-of-contents-block

Code Review | Table Of Contents Block for Gutenberg

WordPress plugin Table Of Contents Block for Gutenberg scored84%from 54 tests.

About plugin

  • Plugin page: wpwing-table-of-c...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.2
  • WordPress version: 6.3.1
  • First release: Jun 8, 2022
  • Latest release: Jun 14, 2023
  • Number of updates: 5
  • Update frequency: every 74.2 days
  • Top authors: wpwing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /996 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲1.30ms] Passed 4 tests

Analyzing server-side resources used by Table Of Contents Block for Gutenberg
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0747.98 ▲10.48
Dashboard /wp-admin3.36 ▲0.0550.83 ▲4.21
Posts /wp-admin/edit.php3.41 ▲0.0551.33 ▲2.74
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.14 ▼4.44
Media Library /wp-admin/upload.php3.28 ▲0.0536.31 ▲2.69

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Table Of Contents Block for Gutenberg
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲6814.60 ▼0.171.76 ▼0.3042.81 ▼7.74
Dashboard /wp-admin2,206 ▲154.83 ▼0.07109.14 ▲7.8640.07 ▼5.45
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0240.06 ▼1.1539.29 ▲0.65
Add New Post /wp-admin/post-new.php6,352 ▲4,83827.74 ▲10.18845.23 ▲129.3254.30 ▲0.97
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.0498.76 ▼10.1041.89 ▼8.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpwing-table-of-contents-block/wpwing-table-of-contents-block.php:34

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: navigation, toc, seo, table of contents, gutenberg

wpwing-table-of-contents-block/wpwing-table-of-contents-block.php 85% from 13 tests

This is the main PHP file of "Table Of Contents Block for Gutenberg" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: Required version does not match the one declared in readme.txt ("4.8" instead of "5.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin277 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP25896224
JSON10051
CSS1001
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin