90% shortcode-toc

Code Review | Shortcode Table of Contents

WordPress plugin Shortcode Table of Contents scored90%from 54 tests.

About plugin

  • Plugin page: shortcode-toc
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Nov 29, 2017
  • Latest release: Jul 31, 2018
  • Number of updates: 15
  • Update frequency: every 16.3 days
  • Top authors: jamesckemp (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /26,541 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Shortcode Table of Contents
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.97 ▲0.70
Dashboard /wp-admin3.33 ▲0.0247.78 ▼0.96
Posts /wp-admin/edit.php3.38 ▲0.0242.42 ▼7.14
Add New Post /wp-admin/post-new.php5.91 ▲0.0279.76 ▼8.43
Media Library /wp-admin/upload.php3.25 ▲0.0232.26 ▼8.97

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Shortcode Table of Contents
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲13513.63 ▼0.649.76 ▲8.0947.01 ▲6.88
Dashboard /wp-admin2,203 ▲124.86 ▼0.03127.89 ▲24.3344.21 ▲4.46
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.1437.05 ▼2.6530.90 ▼0.85
Add New Post /wp-admin/post-new.php1,538 ▲1023.32 ▲0.12681.12 ▲7.7254.48 ▼11.85
Media Library /wp-admin/upload.php1,388 ▲64.18 ▼0.0496.22 ▼9.6942.35 ▼3.87

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: anchors, shortcode, table of contents, anchor links, toc...

shortcode-toc/shortcode-toc.php 92% from 13 tests

The main PHP file in "Shortcode Table of Contents" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 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 detected265 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript24826151
PHP32882114

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.33
▷ Minimum class complexity4.00
▷ Maximum class complexity5.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods444.44%
▷ Public methods555.56%
▷ Protected methods00.00%
▷ Private methods444.44%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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
PNG images were not found in this plugin