62% content-table

Code Review | Table of content

WordPress plugin Table of content scored62%from 54 tests.

About plugin

  • Plugin page: content-table
  • Plugin version: 1.5.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 9, 2011
  • Latest release: Jun 30, 2023
  • Number of updates: 153
  • Update frequency: every 28.6 days
  • Top authors: sedLex (96.08%)kaizencoders (4.58%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /16,332 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.14MB] [CPU: ▲1.45ms] Passed 4 tests

This is a short check of server-side resources used by Table of content
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.67 ▲1.2068.73 ▲27.32
Dashboard /wp-admin4.49 ▲1.1457.80 ▼4.02
Posts /wp-admin/edit.php4.54 ▲1.1861.05 ▲5.40
Add New Post /wp-admin/post-new.php7.01 ▲1.12108.59 ▼5.11
Media Library /wp-admin/upload.php4.35 ▲1.1247.91 ▲9.52

Server storage [IO: ▲1.71MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • There were 3 files (3.57KB) illegally modified outside of "wp-content/plugins/content-table/" and "wp-content/uploads/"
    • (new file) wp-content/sedlex/inline_styles/1551f0e18643a043e7ee78a41e9f4c2cedac8bad.css
    • (new file) wp-content/sedlex/inline_scripts/.empty
    • (new file) wp-content/sedlex/inline_styles/346000ebb2724813af78fefc9e86621335cb4848.css
Filesystem: 175 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
coreSLframework_options
tableofcontent_options
db_upgraded
widget_recent-comments
plugin_error_on_activation
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Table of content
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.67 ▲0.321.88 ▼0.0637.92 ▼2.33
Dashboard /wp-admin2,222 ▲425.57 ▼0.0190.48 ▲2.7042.84 ▲1.70
Posts /wp-admin/edit.php2,130 ▲301.99 ▼0.0341.45 ▲5.2634.92 ▲0.88
Add New Post /wp-admin/post-new.php1,553 ▲2723.19 ▼0.00691.04 ▼2.7351.70 ▲0.71
Media Library /wp-admin/upload.php1,421 ▲214.24 ▲0.05100.30 ▼15.7940.99 ▼7.78
About... /wp-admin/sedlex.php260.420.1115.84
Table of content /wp-admin/sedlex.php?page=content-table/content-table.php260.420.097.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method tableofcontent::uninstall_removedata() should not be called statically
  • Zombie WordPress options were found after uninstall: 8 options
    • plugin_error_on_activation
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • coreSLframework_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 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
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/content-table/content-table.php
    • > /wp-content/plugins/content-table/core.php
    • > /wp-content/plugins/content-table/core.class.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/content-table/core/templates/my-plugin.php on line 18
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/content-table/core/templates/my-plugin.php on line 18

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/sedlex.php
    • > Network (severe)
    wp-admin/sedlex.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/sedlex.php?page=content-table/content-table.php
    • > Network (severe)
    wp-admin/sedlex.php?page=content-table/content-table.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (The configuration page of the plugin), #2 (An example of a table of content)
The official readme.txt might help

content-table/content-table.php Passed 13 tests

The main PHP script in "Table of content" version 1.5.3.1 is automatically included on every request by WordPress
42 characters long description:
Insert a *table of content* in your posts.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin17,636 lines of code in 81 files:
LanguageFilesBlank linesComment linesLines of code
PO File404,17309,196
PHP199461,7106,883
JavaScript7246262975
CSS118613467
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity50.47
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity7.31
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods149
▷ Static methods3523.49%
▷ Public methods14697.99%
▷ Protected methods32.01%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
36 PNG files occupy 0.47MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/tab_plug.png0.71KB0.52KB▼ 27.30%
core/img/info.png4.30KB1.51KB▼ 64.82%
core/img/warning.png4.46KB1.51KB▼ 66.10%
img/banner-1544x500.png164.18KB157.93KB▼ 3.80%
core/img/tab_trad.png0.90KB1.08KB0.00%