94% acymailing-table-of-contents-generator

Code Review | Table of contents generator - AcyMailing

WordPress plugin Table of contents generator - AcyMailing scored 94% from 54 tests.

About plugin

  • Plugin page: acymailing-table-...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.2
  • WordPress version: 5.9.2
  • First release: Nov 27, 2020
  • Latest release: Mar 21, 2022
  • Number of updates: 6
  • Update frequency: every 80.2 days
  • Top authors: acyba (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 476 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼294.42ms] Passed 4 tests

Analyzing server-side resources used by Table of contents generator - AcyMailing
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0153.80 ▲1.26
Dashboard /wp-admin3.41 ▲0.0132.09 ▼1.13
Posts /wp-admin/edit.php3.65 ▲0.0136.94 ▼2.06
Add New Post /wp-admin/post-new.php6.88 ▼0.0990.95 ▼1,173.69
Media Library /wp-admin/upload.php3.30 ▲0.0023.71 ▼0.79

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Table of contents generator - AcyMailing: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.78 ▲0.626.43 ▲0.172.42 ▼0.14
Dashboard /wp-admin2,889 ▲286.02 ▼0.29124.49 ▼9.39161.13 ▲1.25
Posts /wp-admin/edit.php2,688 ▼03.22 ▼0.0162.33 ▼4.46142.46 ▼2.47
Add New Post /wp-admin/post-new.php1,781 ▲11322.30 ▲3.86413.09 ▼2.52160.38 ▼0.82
Media Library /wp-admin/upload.php1,692 ▼65.49 ▼0.04151.86 ▲13.34188.03 ▲0.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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
Even though everything seems fine, this is not 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 fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/acymailing-table-of-contents-generator/acymailing-tableofcontents.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'AcyMailing\\Libraries\\acymPlugin' not found in wp-content/plugins/acymailing-table-of-contents-generator/plugin.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: newsletter, acymailing

acymailing-table-of-contents-generator/acymailing-tableofcontents.php 92% from 13 tests

Analyzing the main PHP file in "Table of contents generator - AcyMailing" version 1.3
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("acymailing-table-of-contents-generator.php" instead of "acymailing-tableofcontents.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin200 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23521192
SVG1008

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.40
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods466.67%
▷ Protected methods00.00%
▷ Private methods233.33%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
banner.png7.80KB1.26KB▼ 83.90%