94% easy-table-of-contents-in-amp

Code Review | Easy Table of Contents in AMP

WordPress plugin Easy Table of Contents in AMP scored 94% from 54 tests.

About plugin

  • Plugin page: easy-table-of-con...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6
  • WordPress version: 5.8.1
  • First release: Jan 23, 2021
  • Latest release: Jan 23, 2021
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: amptroop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 324 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼145.73ms] Passed 4 tests

Analyzing server-side resources used by Easy Table of Contents in AMP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0124.95 ▼4.18
Dashboard /wp-admin3.07 ▲0.0137.17 ▼6.87
Posts /wp-admin/edit.php3.12 ▲0.0144.97 ▲0.85
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.81 ▼566.39
Media Library /wp-admin/upload.php3.01 ▲0.0031.79 ▼5.47

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Easy Table of Contents in AMP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.95 ▲0.029.11 ▲0.9249.70 ▼4.47
Dashboard /wp-admin2,992 ▲585.90 ▼0.11139.96 ▼9.79103.20 ▼6.01
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0066.17 ▲0.0799.30 ▲2.84
Add New Post /wp-admin/post-new.php1,498 ▼18518.81 ▲0.17374.27 ▼1.14108.37 ▼3.61
Media Library /wp-admin/upload.php1,810 ▲65.05 ▲0.03145.85 ▼7.84120.84 ▲1.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/easy-table-of-contents-in-amp/style.php

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

easy-table-of-contents-in-amp/easy-table-of-contents-in-amp.php 92% from 13 tests

The main PHP script in "Easy Table of Contents in AMP" version 1.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 plugin101 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21016101

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions4
▷ Named functions4100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon-toc.png5.99KB2.78KB▼ 53.58%