84% fx-toc

Code Review | f(x) TOC

WordPress plugin f(x) TOC scored 84% from 54 tests.

About plugin

  • Plugin page: fx-toc
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Feb 25, 2016
  • Latest release: Aug 1, 2016
  • Number of updates: 9
  • Update frequency: every 32.0 days
  • Top authors: turtlepod (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active / 5,865 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by f(x) TOC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.08 ▼0.25
Dashboard /wp-admin3.34 ▲0.0445.57 ▼1.72
Posts /wp-admin/edit.php3.39 ▲0.0453.63 ▲2.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0486.61 ▼12.40
Media Library /wp-admin/upload.php3.27 ▲0.0435.81 ▲1.14

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

f(x) TOC: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼0.961.82 ▼0.0142.35 ▲1.72
Dashboard /wp-admin2,206 ▲185.88 ▲0.97107.73 ▼2.6039.58 ▼0.59
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0440.51 ▲1.1735.07 ▼0.37
Add New Post /wp-admin/post-new.php1,533 ▼123.02 ▼0.20661.19 ▼52.4262.88 ▲2.31
Media Library /wp-admin/upload.php1,391 ▲64.24 ▲0.0697.86 ▼4.1843.10 ▼2.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/fx-toc/includes/shortcode.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/fx-toc/includes/filter-content.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: table of contents, shortcode, toc, toc shortcode, heading...

fx-toc/fx-toc.php Passed 13 tests

"f(x) TOC" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
80 characters long description:
Simple Table Of Contents Plugin. Just add [toc] shortcode in content to display.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected212 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP490142212

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG files were detected