89% cc-toc

Code Review | CC-TOC

WordPress plugin CC-TOC scored89%from 54 tests.

About plugin

  • Plugin page: cc-toc
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-5.4.0
  • WordPress version: 6.3.1
  • First release: Dec 7, 2017
  • Latest release: Apr 3, 2020
  • Number of updates: 4
  • Update frequency: every 212.0 days
  • Top authors: ClearcodeHQ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,163 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.12MB] [CPU: ▼6.92ms] Passed 4 tests

Analyzing server-side resources used by CC-TOC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.39 ▼2.11
Dashboard /wp-admin3.44 ▲0.0949.95 ▼15.97
Posts /wp-admin/edit.php3.55 ▲0.1948.21 ▼6.76
Add New Post /wp-admin/post-new.php6.02 ▲0.1395.69 ▼2.85
Media Library /wp-admin/upload.php3.36 ▲0.1342.60 ▲5.23

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
toc
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for CC-TOC
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.77 ▲0.472.02 ▲0.4142.91 ▼0.51
Dashboard /wp-admin2,209 ▲214.86 ▼0.1997.72 ▼13.4939.50 ▼2.09
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0437.78 ▼3.6835.38 ▲0.38
Add New Post /wp-admin/post-new.php6,233 ▲4,71926.09 ▲8.59977.62 ▲339.5657.64 ▲5.28
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.02100.91 ▲1.7345.98 ▲0.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

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
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (**WordPress Writing Settings** - Configure the plugin.), #2 (**WordPress Post Edit** - Enable/Disable TOC/INDEX for specific post.)
Please take inspiration from this readme.txt

cc-toc/toc.php 85% from 13 tests

Analyzing the main PHP file in "CC-TOC" version 1.1.1
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("cc-toc.php" instead of "toc.php")

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
Everything looks great! No dangerous files found in this plugin386 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP49788352
PO File18934

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity19.33
▷ Minimum class complexity3.00
▷ Maximum class complexity34.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods2884.85%
▷ Protected methods515.15%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.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
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png3.63KB2.00KB▼ 44.76%
screenshot-1.png43.10KB16.25KB▼ 62.29%