84% tinytoc

Code Review | tinyTOC

WordPress plugin tinyTOC scored84%from 54 tests.

About plugin

  • Plugin page: tinytoc
  • Plugin version: 0.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.4
  • WordPress version: 6.3.1
  • First release: Jun 7, 2013
  • Latest release: Feb 9, 2018
  • Number of updates: 19
  • Update frequency: every 89.9 days
  • Top authors: ideag (63.16%)deployer (42.11%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /3,809 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.27ms] Passed 4 tests

Analyzing server-side resources used by tinyTOC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0538.22 ▼1.87
Dashboard /wp-admin3.41 ▲0.1047.67 ▼1.61
Posts /wp-admin/edit.php3.52 ▲0.1749.50 ▲2.14
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.18 ▼11.75
Media Library /wp-admin/upload.php3.33 ▲0.1041.09 ▲3.33
tinyTOC /wp-admin/options-general.php?page=tinytoc/includes/options.php3.3034.30

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by tinyTOC
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.26 ▼0.101.93 ▲0.1242.22 ▼4.13
Dashboard /wp-admin2,199 ▲225.64 ▲0.0493.69 ▲0.5838.64 ▼4.58
Posts /wp-admin/edit.php2,104 ▲11.96 ▼0.0338.00 ▲0.3432.87 ▼4.28
Add New Post /wp-admin/post-new.php1,529 ▲123.27 ▲0.25674.84 ▼12.8854.28 ▲0.74
Media Library /wp-admin/upload.php1,401 ▲14.23 ▲0.1197.04 ▼15.1147.67 ▼1.02
tinyTOC /wp-admin/options-general.php?page=tinytoc/includes/options.php8752.0423.3228.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tinytoc/includes/widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tinytoc/tinytoc.php:30

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)
Everything seems fine, but this is not an exhaustive test

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: headings, shortcode, toc, table of contents, widget

tinytoc/tinytoc.php Passed 13 tests

The main PHP file in "tinyTOC" ver. 0.8.1 adds more information about the plugin and also serves as the entry point for this plugin
86 characters long description:
Automaticly builds a Table of Contents using headings (h1-h6) in post/page/CPT content

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin534 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33851488
PO File119538946

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity18.50
▷ Minimum class complexity3.00
▷ Maximum class complexity39.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods33
▷ Static methods2575.76%
▷ Public methods3090.91%
▷ Protected methods00.00%
▷ Private methods39.09%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin