77% top-table-of-contents

Code Review | TOP Table Of Contents

WordPress plugin TOP Table Of Contents scored77%from 54 tests.

About plugin

  • Plugin page: top-table-of-cont...
  • Plugin version: 1.3.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 14, 2022
  • Latest release: Nov 11, 2023
  • Number of updates: 81
  • Update frequency: every 7.1 days
  • Top authors: boomdevs (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /23,703 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.56MB] [CPU: ▲15.81ms] Passed 4 tests

A check of server-side resources used by TOP Table Of Contents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.44 ▲2.9759.26 ▲16.40
Dashboard /wp-admin6.30 ▲2.9961.49 ▲12.14
Posts /wp-admin/edit.php9.10 ▲5.7483.85 ▲36.83
Add New Post /wp-admin/post-new.php11.25 ▲5.36107.93 ▲14.35
Media Library /wp-admin/upload.php6.16 ▲2.9354.12 ▲20.34

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 375 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_boomdevs-toc-shortcode-widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
boomdevs-toc

Browser metrics 75% from 4 tests

This is an overview of browser requirements for TOP Table Of Contents
Please improve the following
  • Script duration: Total JavaScript execution time should be lower than 1,500.00ms (currently 2,012.38ms on /wp-admin/admin.php?page=boomdevs-toc-settings#tab=title)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,015 ▲25313.41 ▼0.949.22 ▲7.4636.36 ▼9.14
Dashboard /wp-admin2,318 ▲1445.64 ▼0.0194.86 ▼4.3342.55 ▼4.54
Posts /wp-admin/edit.php2,420 ▲3204.06 ▲2.0479.37 ▲44.6435.78 ▲1.98
Add New Post /wp-admin/post-new.php6,555 ▲5,02028.77 ▲5.50934.27 ▲227.1638.47 ▼17.09
Media Library /wp-admin/upload.php1,520 ▲1204.21 ▲0.0489.62 ▼25.3241.57 ▼7.26
Title /wp-admin/admin.php?page=boomdevs-toc-settings#tab=title12,84254.472,012.38112.21
Sticky sidebar /wp-admin/admin.php?page=boomdevs-toc-settings#tab=sticky-sidebar6,90751.681,671.08141.55
Auto insert /wp-admin/admin.php?page=boomdevs-toc-settings#tab=auto-insert7,21953.411,617.1599.26
Sub headings /wp-admin/admin.php?page=boomdevs-toc-settings#tab=sub-headings7,76060.441,583.55123.81
Floating /wp-admin/admin.php?page=boomdevs-toc-settings#tab=floating7,63058.491,673.45117.83
Headings /wp-admin/admin.php?page=boomdevs-toc-settings#tab=headings12,80948.631,910.91112.84
General /wp-admin/admin.php?page=boomdevs-toc-settings#tab=general7,16452.181,627.7695.01
Progress bar /wp-admin/admin.php?page=boomdevs-toc-settings#tab=progress-bar7,75757.411,548.6392.18
Free Vs Pro /wp-admin/admin.php?page=boomdevs-toc-settings#tab=free-vs-pro6,99153.081,548.33129.78
Pre-made themes /wp-admin/admin.php?page=boomdevs-toc-settings#tab=pre-made-themes7,79055.111,705.5388.32

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • boomdevs-toc
    • widget_recent-comments
    • db_upgraded
    • widget_boomdevs-toc-shortcode-widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/top-table-of-contents/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/top-table-of-contents/public/partials/boomdevs-toc-public-display.php
    • > /wp-content/plugins/top-table-of-contents/admin/partials/boomdevs-toc-admin-display.php
  • 61× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\ServiceProvider' not found in wp-content/plugins/top-table-of-contents/vendor/cocur/slugify/src/Bridge/Laravel/SlugifyServiceProvider.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Cocur\\Slugify\\RuleProvider\\RuleProviderInterface' not found in wp-content/plugins/top-table-of-contents/vendor/cocur/slugify/src/RuleProvider/FileRuleProvider.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Knp\\Menu\\Renderer\\ListRenderer' not found in wp-content/plugins/top-table-of-contents/vendor/caseyamcl/toc/src/OrderedListRenderer.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Knp\\Menu\\Factory\\ExtensionInterface' not found in wp-content/plugins/top-table-of-contents/vendor/knplabs/knp-menu/src/Knp/Menu/Factory/CoreExtension.php:10
    • > PHP Fatal error
      Trait 'TOC\\HtmlHelper' not found in wp-content/plugins/top-table-of-contents/vendor/caseyamcl/toc/src/TocGenerator.php on line 35
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/top-table-of-contents/vendor/caseyamcl/toc/src/TocTwigExtension.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/top-table-of-contents/addons/boomdevs-toc-elementor-widgets.php:9
    • > PHP Warning
      Use of undefined constant BOOMDEVS_TOC_PATH - assumed 'BOOMDEVS_TOC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/top-table-of-contents/includes/class-boomdevs-toc-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'Knp\\Menu\\Renderer\\RendererProviderInterface' not found in wp-content/plugins/top-table-of-contents/vendor/knplabs/knp-menu/src/Knp/Menu/Renderer/ArrayAccessProvider.php:8
    • > PHP Warning
      require_once(BOOMDEVS_TOC_PATHincludes/class-boomdevs-toc-settings.php): failed to open stream: No such file or directory in wp-content/plugins/top-table-of-contents/public/class-boomdevs-toc-public.php on line 3

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 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #11, #12, #13, #14, #15, #16, #17, #18, #19, #2, #20, #21, #22, #23, #24, #25, #3, #4, #5, #6, #7, #8, #9 in top-table-of-contents/assets to your readme.txt
Please take inspiration from this readme.txt

top-table-of-contents/boomdevs-toc.php 77% from 13 tests

The main PHP script in "TOP Table Of Contents" version 1.3.11 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("top-table-of-contents.php" instead of "boomdevs-toc.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 149 characters long)

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 plugin77,189 lines of code in 313 files:
LanguageFilesBlank linesComment linesLines of code
PHP2035,6486,56136,558
JSON1114012,467
JavaScript111,4416367,311
Sass321,07686,740
PO File203,1983,5916,500
CSS94205565,548
Markdown1461401,694
YAML5260156
XML151199
Twig313892
SVG40024

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity16.48
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces29
Interfaces16
Traits1
Classes146
▷ Abstract classes32.05%
▷ Concrete classes14397.95%
▷ Final classes00.00%
Methods895
▷ Static methods829.16%
▷ Public methods76084.92%
▷ Protected methods819.05%
▷ Private methods546.03%
Functions45
▷ Named functions3168.89%
▷ Anonymous functions1431.11%
Constants69
▷ Global constants68.70%
▷ Class constants6391.30%
▷ Public constants6298.41%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.19MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/premade_layout_preview_one.png10.78KB6.24KB▼ 42.13%
admin/img/money-back-logo.png6.89KB4.25KB▼ 38.34%
admin/img/premade_layout_preview_two.png10.67KB6.21KB▼ 41.80%
admin/img/John.png16.63KB6.67KB▼ 59.91%
admin/img/premade_layout_preview_four.png39.33KB18.95KB▼ 51.82%