68% joli-table-of-contents

Code Review | Joli Table Of Contents

WordPress plugin Joli Table Of Contents scored68%from 54 tests.

About plugin

  • Plugin page: joli-table-of-con...
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 25, 2019
  • Latest release: Nov 23, 2023
  • Number of updates: 42
  • Update frequency: every 36.2 days
  • Top authors: wpjoli (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

5,000+ active /49,473 total downloads

Benchmarks

Plugin footprint 65% 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: ▲5.33MB] [CPU: ▲33.04ms] 75% from 4 tests

An overview of server-side resources used by Joli Table Of Contents
The following require your attention
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.33MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.86 ▲5.3974.23 ▲33.47
Dashboard /wp-admin8.88 ▲5.5388.66 ▲24.12
Posts /wp-admin/edit.php8.88 ▲5.5291.71 ▲46.69
Add New Post /wp-admin/post-new.php10.76 ▲4.87122.82 ▲27.89
Media Library /wp-admin/upload.php8.88 ▲5.6584.01 ▲49.65
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.8871.35

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 361 new files
Database: no new tables, 12 new options
New WordPress options
fs_debug_mode
theysaidso_admin_options
joli_toc_rating_time
joli_toc_gopro_time
widget_recent-posts
db_upgraded
fs_active_plugins
can_compress_scripts
widget_recent-comments
fs_accounts
...

Browser metrics Passed 4 tests

Joli Table Of Contents: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲9414.35 ▼0.061.53 ▼0.2628.37 ▼17.01
Dashboard /wp-admin2,258 ▲785.74 ▲0.0898.47 ▼4.0344.78 ▲1.13
Posts /wp-admin/edit.php2,167 ▲642.03 ▲0.0944.65 ▲2.1839.16 ▼0.92
Add New Post /wp-admin/post-new.php6,389 ▲4,85327.67 ▲4.61859.07 ▲178.7438.64 ▼16.67
Media Library /wp-admin/upload.php1,463 ▲664.24 ▲0.06101.71 ▲2.4147.09 ▲0.90
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1181.7028.7230.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/joli-table-of-contents/includes/fs/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • fs_active_plugins
    • joli_table_of_contents_settings
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • fs_accounts
    • fs_debug_mode

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
Good news, no errors were detected

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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/joli-table-of-contents/joli-table-of-contents.php
  • 70× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/joli-table-of-contents/v1/views/admin/user-guide/user-guide.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/joli-table-of-contents/v1/views/public/jolitoc.php:2
    • > PHP Notice
      Undefined variable: preserve_theme_styles in wp-content/plugins/joli-table-of-contents/views/public/joli-toc-template.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/joli-table-of-contents/views/notices/go-pro.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WPJoli\\JoliTOC\\JoliApplication' not found in wp-content/plugins/joli-table-of-contents/v1/core/Application.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface' not found in wp-content/plugins/joli-table-of-contents/vendor/slugify/Bridge/ZF2/Module.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function JTOC() in wp-content/plugins/joli-table-of-contents/v1/views/admin/post_settings.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/joli-table-of-contents/v1/vendor/slugify/Bridge/Twig/SlugifyExtension.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Container\\ServiceProvider\\AbstractServiceProvider' not found in wp-content/plugins/joli-table-of-contents/vendor/slugify/Bridge/League/SlugifyServiceProvider.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/joli-table-of-contents/views/notices/rating.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

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

The principal PHP file in "Joli Table Of Contents" v. 2.1.1 is loaded by WordPress automatically on each request
127 characters long description:
The most customizable & user friendly Table Of Contents for your website. Works with Gutenberg Block / Shortcode / Auto-insert.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected57,165 lines of code in 259 files:
LanguageFilesBlank linesComment linesLines of code
PHP2039,66720,21053,701
CSS27201351,310
SVG16615747
JSON100699
PO File1204212506
JavaScript113469202

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity42.62
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces15
Interfaces5
Traits0
Classes125
▷ Abstract classes21.60%
▷ Concrete classes12398.40%
▷ Final classes00.00%
Methods1,607
▷ Static methods21913.63%
▷ Public methods1,15571.87%
▷ Protected methods261.62%
▷ Private methods42626.51%
Functions174
▷ Named functions14784.48%
▷ Anonymous functions2715.52%
Constants193
▷ Global constants10252.85%
▷ Class constants9147.15%
▷ Public constants91100.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
24 PNG files occupy 0.22MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/img/themes/modern.png7.23KB3.52KB▼ 51.29%
v1/assets/admin/img/powered-by-wpjoli-with-title.png3.37KB1.53KB▼ 54.60%
assets/admin/img/themes/original-dark.png7.79KB3.69KB▼ 52.61%
includes/fs/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/admin/img/plugins/wpjoli-joli-faq-seo.png10.86KB5.05KB▼ 53.51%