84% table-of-contents-for-tinymce

Code Review | TinyMCE Table of Contents

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

About plugin

  • Plugin page: table-of-contents...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 31, 2016
  • Latest release: Aug 1, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: julenpardo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,064 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
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼113.52ms] Passed 4 tests

Server-side resources used by TinyMCE Table of Contents
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.50 ▼4.72
Dashboard /wp-admin3.32 ▼0.0747.69 ▼440.71
Posts /wp-admin/edit.php3.37 ▲0.0150.85 ▲1.23
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.45 ▼7.11
Media Library /wp-admin/upload.php3.24 ▲0.0137.17 ▼1.53

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for TinyMCE Table of Contents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.211.69 ▲0.0743.75 ▲7.12
Dashboard /wp-admin2,195 ▲155.58 ▼0.0888.13 ▼6.2940.54 ▼2.21
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0333.94 ▼4.7536.37 ▼6.09
Add New Post /wp-admin/post-new.php1,526 ▼023.39 ▼0.33668.73 ▲14.9057.76 ▲0.83
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.0497.93 ▼5.9941.09 ▼6.16

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
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/table-of-contents-for-tinymce/tinymce-table-of-contents.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: index, tinymce, table of contents

table-of-contents-for-tinymce/tinymce-table-of-contents.php 92% from 13 tests

The main PHP script in "TinyMCE Table of Contents" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("table-of-contents-for-tinymce.php" instead of "tinymce-table-of-contents.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin206 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript24891177
PHP1153029

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/table-of-contents.png0.31KB0.17KB▼ 44.13%