90% lh-table-of-contents

Code Review | LH Table of Contents

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

About plugin

  • Plugin page: lh-table-of-contents
  • Plugin version: 1.05
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Nov 23, 2017
  • Latest release: Oct 4, 2019
  • Number of updates: 4
  • Update frequency: every 170.5 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,081 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: ▼9.41ms] Passed 4 tests

Analyzing server-side resources used by LH Table of Contents
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0244.69 ▲3.72
Dashboard /wp-admin3.33 ▼0.0250.90 ▼13.61
Posts /wp-admin/edit.php3.38 ▲0.0247.59 ▼6.38
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.39 ▼18.10
Media Library /wp-admin/upload.php3.25 ▲0.0238.99 ▲0.45

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

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

Browser metrics Passed 4 tests

Checking browser requirements for LH Table of Contents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.27 ▼0.012.13 ▲0.4341.99 ▲2.32
Dashboard /wp-admin2,192 ▲125.53 ▼0.1087.50 ▲0.6639.87 ▼5.53
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0133.48 ▼1.8434.71 ▼3.84
Add New Post /wp-admin/post-new.php1,528 ▼422.86 ▼0.04672.61 ▼41.0853.56 ▲0.60
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.04102.65 ▼16.2644.40 ▼5.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output 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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: table of contents, toc, wiki like toc, semantic

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

Analyzing the main PHP file in "LH Table of Contents" version 1.05
It is important to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin114 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP215226114

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods436.36%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 files were detected