79% wpjura-table-of-contents

Code Review | WPjura Table of Contents

WordPress plugin WPjura Table of Contents scored79%from 54 tests.

About plugin

  • Plugin page: wpjura-table-of-c...
  • Plugin version: 0.0.17
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.2-5.5.0
  • WordPress version: 6.3.1
  • First release: Oct 25, 2017
  • Latest release: Aug 13, 2020
  • Number of updates: 22
  • Update frequency: every 46.5 days
  • Top authors: wpjura (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /714 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.07ms] Passed 4 tests

A check of server-side resources used by WPjura Table of Contents
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0444.39 ▲5.89
Dashboard /wp-admin3.34 ▲0.0345.47 ▼1.05
Posts /wp-admin/edit.php3.45 ▲0.0948.54 ▲0.21
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.55 ▼7.24
Media Library /wp-admin/upload.php3.26 ▲0.0337.12 ▲3.79
Table Of Contents /wp-admin/options-general.php?page=raonline_tableOfContents3.2333.79

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
raoTableOfContents
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WPjura Table of Contents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.47 ▼0.912.75 ▲0.5237.29 ▼11.22
Dashboard /wp-admin2,214 ▲264.86 ▼0.25108.97 ▲11.0337.20 ▼6.87
Posts /wp-admin/edit.php2,097 ▲112.04 ▲0.0035.44 ▼4.3132.91 ▼4.54
Add New Post /wp-admin/post-new.php1,521 ▼2123.24 ▲4.62636.37 ▲21.1847.42 ▼6.06
Media Library /wp-admin/upload.php1,396 ▲84.20 ▼0.0796.21 ▼0.5540.33 ▼7.06
Table Of Contents /wp-admin/options-general.php?page=raonline_tableOfContents1,4671.7829.3833.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'uninstall' not found or invalid function name
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • raoTableOfContents

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Everything seems fine, however this is by no means an exhaustive test

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt is a good inspiration

wpjura-table-of-contents/raoTableOfContents.php 85% from 13 tests

Analyzing the main PHP file in "WPjura Table of Contents" version 0.0.17
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpjura-table-of-contents.php" instead of "raoTableOfContents.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,629 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3576811,394
JavaScript291121
CSS260114

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity247.00
▷ Minimum class complexity217.00
▷ Maximum class complexity277.00
Average method complexity7.91
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes150.00%
▷ Concrete classes150.00%
▷ Final classes00.00%
Methods67
▷ Static methods1217.91%
▷ Public methods5683.58%
▷ Protected methods710.45%
▷ Private methods45.97%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants9
▷ Global constants9100.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
2 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/layout2.png85.08KB39.75KB▼ 53.27%
img/layout1.png92.11KB39.75KB▼ 56.85%