84% ultimate-toc

Code Review | Ultimate Table of Contents

WordPress plugin Ultimate Table of Contents scored84%from 54 tests.

About plugin

  • Plugin page: ultimate-toc
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: May 9, 2023
  • Latest release: May 20, 2023
  • Number of updates: 6
  • Update frequency: every 1.8 days
  • Top authors: irfankhan30 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /202 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Ultimate Table of Contents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.53 ▼1.18
Dashboard /wp-admin3.33 ▲0.0348.74 ▲0.90
Posts /wp-admin/edit.php3.41 ▲0.0546.10 ▼2.68
Add New Post /wp-admin/post-new.php5.91 ▲0.0279.26 ▼16.39
Media Library /wp-admin/upload.php3.25 ▲0.0237.30 ▲5.21
Table of Contents Settings /wp-admin/options-general.php?page=toc-setting-admin3.2231.76

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ultimate Table of Contents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲14113.59 ▼0.844.97 ▲2.7938.59 ▼5.69
Dashboard /wp-admin2,213 ▲284.79 ▼1.09103.30 ▲3.7541.05 ▲0.46
Posts /wp-admin/edit.php2,090 ▲11.99 ▼0.0535.65 ▼7.0032.65 ▼6.06
Add New Post /wp-admin/post-new.php1,536 ▲823.59 ▲5.44670.14 ▲58.5952.73 ▼0.64
Media Library /wp-admin/upload.php1,395 ▲74.22 ▼0.0799.33 ▼0.0445.57 ▲3.02
Table of Contents Settings /wp-admin/options-general.php?page=toc-setting-admin9132.0426.4531.28

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/table.php on line 10
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/ultimate-toc/template-parts/template.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/template.php on line 12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/fixed.php on line 10
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/ultimate-toc/template-parts/default.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_template() in wp-content/plugins/ultimate-toc/template-parts/template.php:21
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/collapse.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/template.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/template.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-toc/template-parts/default.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: wordpress, heading, preg_match, anchor, acf...

ultimate-toc/ultimate-toc.php 85% from 13 tests

"Ultimate Table of Contents" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/lang" does not exist
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
No dangerous file extensions were detected692 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1278268458
CSS174170
Markdown123045
JavaScript11019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.25
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants8
▷ Global constants8100.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
No PNG images were found in this plugin