84% luckywp-table-of-contents

Code Review | LuckyWP Table of Contents

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

About plugin

  • Plugin page: luckywp-table-of-...
  • Plugin version: 2.1.4
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.2
  • WordPress version: 6.3.1
  • First release: Nov 14, 2018
  • Latest release: Mar 21, 2022
  • Number of updates: 76
  • Update frequency: every 16.1 days
  • Top authors: theluckywp (100%)

Code review

54 tests

User reviews

797 reviews

Install metrics

100,000+ active /572,045 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.86MB] [CPU: ▲2.13ms] Passed 4 tests

This is a short check of server-side resources used by LuckyWP Table of Contents
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8447.29 ▲0.91
Dashboard /wp-admin4.17 ▲0.8653.86 ▼0.57
Posts /wp-admin/edit.php4.29 ▲0.9258.88 ▲11.77
Add New Post /wp-admin/post-new.php6.78 ▲0.88102.63 ▼3.58
Media Library /wp-admin/upload.php4.10 ▲0.8646.69 ▲13.33
Table of Contents /wp-admin/options-general.php?page=lwptoc_settings4.1939.54

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 102 new files
Database: no new tables, 12 new options
New WordPress options
widget_lpwtoc_widget
widget_recent-comments
widget_theysaidso_widget
lwptoc_appearance
theysaidso_admin_options
lwptoc_general
can_compress_scripts
db_upgraded
lwptoc_rate_time
lwptoc_autoInsert
...

Browser metrics Passed 4 tests

A check of browser resources used by LuckyWP Table of Contents
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.34 ▼0.011.73 ▼0.1541.16 ▼1.91
Dashboard /wp-admin2,206 ▲264.87 ▼0.7889.33 ▼4.0840.12 ▲1.38
Posts /wp-admin/edit.php2,112 ▲122.22 ▲0.2338.89 ▼2.4935.40 ▲0.20
Add New Post /wp-admin/post-new.php6,218 ▲4,68318.81 ▲0.79943.36 ▲309.6038.99 ▼26.40
Media Library /wp-admin/upload.php1,411 ▲114.28 ▲0.03102.23 ▼7.6844.58 ▼0.90
Table of Contents /wp-admin/options-general.php?page=lwptoc_settings1,0432.1330.9730.43

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
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_lpwtoc_widget
    • widget_theysaidso_widget
    • lwptoc_rate_time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 84× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'luckywp\\tableOfContents\\core\\base\\BaseObject' not found in wp-content/plugins/luckywp-table-of-contents/integrations/RankMath.php:8
    • > PHP Notice
      Trying to get property 'processHeadings' of non-object in wp-content/plugins/luckywp-table-of-contents/admin/widgets/metabox/views/box.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'luckywp\\tableOfContents\\core\\base\\Widget' not found in wp-content/plugins/luckywp-table-of-contents/admin/widgets/customizeModal/CustomizeModal.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'luckywp\\tableOfContents\\core\\base\\BaseObject' not found in wp-content/plugins/luckywp-table-of-contents/integrations/BeaverBuilder.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/luckywp-table-of-contents/admin/widgets/metabox/views/box.php:61
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/luckywp-table-of-contents/admin/widgets/metabox/views/box.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'luckywp\\tableOfContents\\core\\base\\BaseObject' not found in wp-content/plugins/luckywp-table-of-contents/integrations/ToolsetViews.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/luckywp-table-of-contents/config/settings.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'luckywp\\tableOfContents\\core\\base\\BaseObject' not found in wp-content/plugins/luckywp-table-of-contents/core/base/Model.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'luckywp\\tableOfContents\\core\\admin\\AdminController' not found in wp-content/plugins/luckywp-table-of-contents/admin/controllers/EditorBlockController.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: navigation, toc, links, table of contents, seo

luckywp-table-of-contents/luckywp-table-of-contents.php Passed 13 tests

"LuckyWP Table of Contents" version 2.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
125 characters long description:
Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).

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
No dangerous file extensions were detected8,624 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP871,0491,6278,590
XML10026
JavaScript5005
CSS3003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity10.90
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces27
Interfaces1
Traits0
Classes67
▷ Abstract classes68.96%
▷ Concrete classes6191.04%
▷ Final classes00.00%
Methods346
▷ Static methods6518.79%
▷ Public methods31089.60%
▷ Protected methods349.83%
▷ Private methods20.58%
Functions60
▷ Named functions11.67%
▷ Anonymous functions5998.33%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin