83% sticky-toc-advance-table-of-contents

Code Review | Sticky TOC - Advance Table Of Contents

WordPress plugin Sticky TOC - Advance Table Of Contents scored83%from 54 tests.

About plugin

  • Plugin page: sticky-toc-advanc...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 22, 2022
  • Latest release: Dec 9, 2022
  • Number of updates: 11
  • Update frequency: every 26.4 days
  • Top authors: ahmadderar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,515 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼1.94ms] Passed 4 tests

A check of server-side resources used by Sticky TOC - Advance Table Of Contents
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2838.22 ▲0.01
Dashboard /wp-admin3.73 ▲0.3852.15 ▼10.79
Posts /wp-admin/edit.php3.78 ▲0.4256.93 ▲5.82
Add New Post /wp-admin/post-new.php6.22 ▲0.3394.29 ▼0.87
Media Library /wp-admin/upload.php3.56 ▲0.3337.52 ▲3.90

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 9 new options
New WordPress options
wpig_custom_css
wpig_settings
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
wpig_adv_settings
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Sticky TOC - Advance Table Of Contents
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,080 ▲33415.46 ▲1.177.25 ▲5.6140.32 ▼4.73
Dashboard /wp-admin2,356 ▲1656.63 ▲1.51132.83 ▲31.9889.14 ▲45.48
Posts /wp-admin/edit.php2,277 ▲1913.49 ▲1.4855.21 ▲18.5764.75 ▲32.77
Add New Post /wp-admin/post-new.php1,694 ▲17522.62 ▼0.67650.03 ▼8.8339.26 ▼8.70
Media Library /wp-admin/upload.php1,416 ▲314.35 ▲0.0491.87 ▼3.6676.48 ▲31.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • wpig_custom_css
    • wpig_adv_settings
    • wpig_settings
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'WPIG_PATH/includes/class.settings-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/sticky-toc-advance-table-of-contents/includes/wpig-settings.php on line 9
    • > PHP Warning
      Use of undefined constant WPIG_PATH - assumed 'WPIG_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sticky-toc-advance-table-of-contents/includes/wpig-settings.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_index_generator\\plugin_dir_path() in wp-content/plugins/sticky-toc-advance-table-of-contents/sticky-toc-advance-table-of-contents.php:18
    • > PHP Warning
      require_once(WPIG_PATH/includes/class.settings-api.php): failed to open stream: No such file or directory in wp-content/plugins/sticky-toc-advance-table-of-contents/includes/wpig-settings.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: You can take inspiration from this readme.txt

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

This is the main PHP file of "Sticky TOC - Advance Table Of Contents" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 194 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected1,815 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP42972851,244
CSS3337387
JavaScript3356184

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity44.50
▷ Minimum class complexity2.00
▷ Maximum class complexity84.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods55
▷ Static methods814.55%
▷ Public methods55100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/menu-icon.png16.06KB1.08KB▼ 93.30%
assets/logo.png15.72KB0.98KB▼ 93.77%
assets/menu.png9.90KB6.18KB▼ 37.60%