84% mk-table-of-contents

Code Review | MK Table of Contents

WordPress plugin MK Table of Contents scored 84% from 54 tests.

About plugin

  • Plugin page: mk-table-of-contents
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.8
  • WordPress version: 6.3.1
  • First release: Aug 6, 2017
  • Latest release: Aug 17, 2017
  • Number of updates: 7
  • Update frequency: every 1.6 days
  • Top authors: mojo101 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 720 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.01MB] [CPU: ▼0.64ms] Passed 4 tests

This is a short check of server-side resources used by MK Table of Contents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.68 ▼4.29
Dashboard /wp-admin3.32 ▲0.0245.26 ▲0.35
Posts /wp-admin/edit.php3.37 ▲0.0254.17 ▲5.68
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.30 ▼3.54
Media Library /wp-admin/upload.php3.24 ▲0.0140.21 ▲4.91

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for MK Table of Contents
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.41 ▼0.962.24 ▲0.3840.84 ▼5.36
Dashboard /wp-admin2,227 ▲365.88 ▲0.99102.16 ▼13.3542.76 ▲5.93
Posts /wp-admin/edit.php2,110 ▲182.03 ▲0.0539.58 ▲0.9535.81 ▲0.46
Add New Post /wp-admin/post-new.php1,551 ▲3118.56 ▼4.57630.81 ▼24.9055.86 ▼0.23
Media Library /wp-admin/upload.php1,406 ▲154.16 ▼0.0696.06 ▼6.1643.83 ▼1.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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 items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mk-table-of-contents/php/mk-toc-settings.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mk-table-of-contents/php/mk-toc-shortcode.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mk-table-of-contents/php/mk-toc-shortcode.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mk-table-of-contents/php/mk-toc-tinymce-addon.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

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
4 plugin tags: publish, table of contents, toc, post

mk-table-of-contents/mk-toc.php 85% from 13 tests

"MK Table of Contents" version 2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mk-table-of-contents.php" instead of "mk-toc.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin428 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP44631241
JavaScript210877
PO File1101349
Markdown118036
CSS25125

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin