78% jcwp-simple-table-of-contents

Code Review | jcwp simple table of contents

WordPress plugin jcwp simple table of contents scored 78% from 54 tests.

About plugin

  • Plugin page: jcwp-simple-table...
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2012
  • Latest release: Apr 16, 2015
  • Number of updates: 4
  • Update frequency: every 247.0 days
  • Top authors: jaschahal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,060 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.90ms] Passed 4 tests

A check of server-side resources used by jcwp simple table of contents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.62 ▼21.12
Dashboard /wp-admin3.32 ▲0.0252.42 ▼8.13
Posts /wp-admin/edit.php3.37 ▲0.0255.45 ▲6.27
Add New Post /wp-admin/post-new.php5.90 ▲0.02102.24 ▲5.64
Media Library /wp-admin/upload.php3.25 ▲0.0241.58 ▼0.00
JCWP Table Of Contents /wp-admin/options-general.php?page=jcorgtoc-plugin3.1935.36

Server storage [IO: ▲0.12MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 18 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
jcorgtoc_position
jcorgtoc_scroll_element
jcorgtoc_linkback
widget_recent-comments
jcorgtoc_minimize
jcorgtoc_active
jcorgtoc_title
...

Browser metrics Passed 4 tests

An overview of browser requirements for jcwp simple table of contents
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲16013.68 ▼1.106.45 ▲3.5242.67 ▼3.47
Dashboard /wp-admin2,207 ▲14.90 ▲0.07108.60 ▼2.2941.38 ▼1.88
Posts /wp-admin/edit.php2,093 ▲72.01 ▲0.0140.47 ▲3.2435.00 ▲0.70
Add New Post /wp-admin/post-new.php1,535 ▼022.98 ▼0.04588.10 ▼34.8450.03 ▼2.83
Media Library /wp-admin/upload.php1,395 ▲44.19 ▼0.0498.37 ▼6.7842.19 ▼7.53
JCWP Table Of Contents /wp-admin/options-general.php?page=jcorgtoc-plugin1,2132.0524.4939.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 18 options in the database
    • jcorgtoc_linkback
    • jcorgtoc_position
    • jcorgtoc_parenttagclass
    • can_compress_scripts
    • jcorgtoc_minimize
    • theysaidso_admin_options
    • db_upgraded
    • jcorgtoc_scroll
    • jcorgtoc_duration
    • widget_recent-posts
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=jcorgtoc-plugin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=jcorgtoc-plugin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/jcwp-simple-table-of-contents/jcwp-simple-table-of-contents.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === jcwp-simple-table-of-contents === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (A screen shot of the options page), #2 (Shows Table of contents in expanded form on left of the screen), #3 (Shows Table of contents minimized)
You can take inspiration from this readme.txt

jcwp-simple-table-of-contents/jcwp-simple-table-of-contents.php Passed 13 tests

The principal PHP file in "jcwp simple table of contents" v. 1.01 is loaded by WordPress automatically on each request
97 characters long description:
This plugin gives options to display "Table of contents" container on your wordpress post or page

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected593 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP11816301
CSS2177162
JavaScript32023130

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.63
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%
Functions9
▷ Named functions9100.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
6 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
active.png0.40KB0.27KB▼ 31.96%
node.png0.20KB0.15KB▼ 22.93%
toc.png6.72KB2.82KB▼ 58.10%
screenshot-3.png6.29KB2.93KB▼ 53.46%
screenshot-1.png53.15KB19.42KB▼ 63.46%