77% wp-documentor

Code Review | WP Documenter

WordPress plugin WP Documenter scored77%from 54 tests.

About plugin

  • Plugin page: wp-documentor
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 17, 2017
  • Latest release: Jun 26, 2021
  • Number of updates: 4
  • Update frequency: every 375.5 days
  • Top authors: RobertGillmer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /5,315 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
Install script ran successfully

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

Analyzing server-side resources used by WP Documenter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.26 ▼1.15
Dashboard /wp-admin3.42 ▲0.1246.13 ▲0.42
Posts /wp-admin/edit.php3.54 ▲0.1849.86 ▲4.66
Add New Post /wp-admin/post-new.php6.00 ▲0.1283.47 ▼8.94
Media Library /wp-admin/upload.php3.35 ▲0.1233.66 ▲0.36
Page Template Descriptions /wp-admin/admin.php?page=wp-documenter-page-templates3.3433.30
Custom Post Type Descriptions /wp-admin/admin.php?page=wp-documenter-cpts3.3137.22
Plugin Descriptions /wp-admin/admin.php?page=wp-documenter-plugins3.3230.48
Print Settings /wp-admin/admin.php?page=wp-documenter-pdf-settings3.3135.26

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 663 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Documenter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲3414.67 ▲0.031.63 ▼0.2935.94 ▼2.09
Dashboard /wp-admin2,226 ▲495.70 ▲0.0293.83 ▼2.9143.40 ▲0.39
Posts /wp-admin/edit.php2,128 ▲282.03 ▲0.0839.77 ▼0.7835.31 ▼2.58
Add New Post /wp-admin/post-new.php1,551 ▲2522.82 ▼0.36695.06 ▲73.5548.23 ▼4.12
Media Library /wp-admin/upload.php1,428 ▲314.25 ▲0.0399.61 ▼0.3342.75 ▲0.62
Page Template Descriptions /wp-admin/admin.php?page=wp-documenter-page-templates8212.0025.1630.17
Custom Post Type Descriptions /wp-admin/admin.php?page=wp-documenter-cpts8661.9923.6933.11
Plugin Descriptions /wp-admin/admin.php?page=wp-documenter-plugins8641.9722.7528.09
Print Settings /wp-admin/admin.php?page=wp-documenter-pdf-settings8622.0028.4231.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% 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 0% 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 take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/lib/php-css-parser/tests/quickdump.php
    • > /wp-content/plugins/wp-documentor/includes/dompdf/lib/php-css-parser/tests/quickdump.php
  • 269× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/wp-documentor/includes/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Svg\\Surface\\SurfaceInterface' not found in wp-content/plugins/wp-documentor/includes/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfacePDFLib.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/lib/php-font-lib/src/FontLib/Table/Type/name.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wp-documentor/includes/dompdf/lib/php-font-lib/src/FontLib/Table/Type/maxp.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/src/FrameDecorator/Table.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/lib/php-font-lib/src/FontLib/Table/Type/cmap.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/src/Renderer/Inline.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/wp-documentor/includes/dompdf/lib/php-font-lib/src/FontLib/TrueType/Collection.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\RuleSet\\RuleSet' not found in wp-content/plugins/wp-documentor/includes/dompdf-pre7/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php:18

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 86% 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
4 plugin tags: wordpress documenter, website documenter, document, documenter

wp-documentor/wpdoc-main.php 69% from 13 tests

The primary PHP file in "WP Documenter" version 1.1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-documentor.php" instead of "wpdoc-main.php")
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 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 plugin66,543 lines of code in 369 files:
LanguageFilesBlank linesComment linesLines of code
PHP28714,52728,13163,004
Markdown949301,775
CSS462321061,105
JSON900270
XML842227
YAML7285129
HTML10017
SVG20016

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity35.44
▷ Minimum class complexity1.00
▷ Maximum class complexity797.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces34
Interfaces11
Traits0
Classes364
▷ Abstract classes246.59%
▷ Concrete classes34093.41%
▷ Final classes00.00%
Methods4,049
▷ Static methods1824.49%
▷ Public methods3,47185.72%
▷ Protected methods4029.93%
▷ Private methods1764.35%
Functions34
▷ Named functions411.76%
▷ Anonymous functions3088.24%
Constants335
▷ Global constants61.79%
▷ Class constants32998.21%
▷ Public constants329100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/dompdf-pre7/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%
includes/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%