67% betterdocs

Code Review | BetterDocs - Best Documentation & Knowledge Base Plugin

WordPress plugin BetterDocs - Best Documentation & Knowledge Base Plugin scored67%from 54 tests.

About plugin

  • Plugin page: betterdocs
  • Plugin version: 3.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 15, 2019
  • Latest release: Nov 20, 2023
  • Number of updates: 141
  • Update frequency: every 11.1 days
  • Top authors: re_enter_rupok (54.61%)wpdevteam (39.01%)priyomukul (7.8%)

Code review

54 tests

User reviews

267 reviews

Install metrics

30,000+ active /1,011,527 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲3.30MB] [CPU: ▲32.21ms] 75% from 4 tests

This is a short check of server-side resources used by BetterDocs - Best Documentation & Knowledge Base Plugin
Please fix the following
  • RAM: Try to keep total memory usage under 10MB (currently 10.02MB on /wp-admin/post-new.php?post_type=docs)
PageMemory (MB)CPU Time (ms)
Home /6.43 ▲2.9760.84 ▲22.21
Dashboard /wp-admin6.73 ▲3.4379.67 ▲31.01
Posts /wp-admin/edit.php6.76 ▲3.4188.07 ▲41.51
Add New Post /wp-admin/post-new.php10.02 ▲4.13135.74 ▲43.05
Media Library /wp-admin/upload.php6.63 ▲3.4069.49 ▲34.09
Analytics /wp-admin/admin.php?page=betterdocs-analytics6.6362.29
Categories /wp-admin/edit-tags.php?taxonomy=doc_category&post_type=docs6.6670.13
Settings /wp-admin/admin.php?page=betterdocs-settings6.7270.05
Tags /wp-admin/edit-tags.php?taxonomy=doc_tag&post_type=docs6.6362.98
FAQ Builder /wp-admin/admin.php?page=betterdocs-faq6.6061.00
Quick Setup /wp-admin/admin.php?page=betterdocs-setup6.6563.97
Add New /wp-admin/post-new.php?post_type=docs10.02125.84
All Docs /wp-admin/admin.php?page=betterdocs-admin6.6768.20

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 873 new files
Database: 3 new tables, 8 new options
New tables
wp_betterdocs_search_log
wp_betterdocs_search_keyword
wp_betterdocs_analytics
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
betterdocs_version
widget_recent-posts
betterdocs_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

BetterDocs - Best Documentation & Knowledge Base Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,962 ▲20014.33 ▼0.001.97 ▲0.1036.30 ▼8.99
Dashboard /wp-admin2,342 ▲1625.69 ▲0.0595.45 ▼4.0480.68 ▲39.03
Posts /wp-admin/edit.php2,247 ▲1472.11 ▲0.1743.07 ▲9.2741.63 ▲5.28
Add New Post /wp-admin/post-new.php1,707 ▲17325.22 ▼0.21739.52 ▲115.7448.11 ▼10.38
Media Library /wp-admin/upload.php1,541 ▲1414.12 ▼0.0898.05 ▲2.1279.76 ▲36.30
Analytics /wp-admin/admin.php?page=betterdocs-analytics1,2412.4947.6857.88
Categories /wp-admin/edit-tags.php?taxonomy=doc_category&post_type=docs1,6393.2746.4876.23
Settings /wp-admin/admin.php?page=betterdocs-settings2,53410.61454.77110.56
Tags /wp-admin/edit-tags.php?taxonomy=doc_tag&post_type=docs1,4142.1628.9036.20
FAQ Builder /wp-admin/admin.php?page=betterdocs-faq1,1006.10160.9341.55
Quick Setup /wp-admin/admin.php?page=betterdocs-setup1,35911.05244.0878.32
Add New /wp-admin/post-new.php?post_type=docs6,51052.01969.12175.22
All Docs /wp-admin/admin.php?page=betterdocs-admin1,1832.7042.3636.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_betterdocs_search_log
    • wp_betterdocs_search_keyword
    • wp_betterdocs_analytics
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • betterdocs_db_version
    • can_compress_scripts
    • theysaidso_admin_options
    • betterdocs_version
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 23× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/betterdocs/views/widgets/social.php
    • > /wp-content/plugins/betterdocs/views/admin/template-parts/settings-header.php
    • > /wp-content/plugins/betterdocs/views/templates/parts/sticky-toc.php
    • > /wp-content/plugins/betterdocs/views/admin/email/footer.php
    • > /wp-content/plugins/betterdocs/includes/Admin/Customizer/controls.css.php
    • > /wp-content/plugins/betterdocs/views/test.php
    • > /wp-content/plugins/betterdocs/views/templates/parts/faq.php
    • > /wp-content/plugins/betterdocs/views/widgets/reactions.php
    • > /wp-content/plugins/betterdocs/views/admin/partials/mode-switch.php
    • > /wp-content/plugins/betterdocs/views/icons/collapse.php
  • 453× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeveloper\\BetterDocs\\Dependencies\\PhpParser\ode\\Scalar\\MagicConst' not found in wp-content/plugins/betterdocs/includes/Dependencies/PhpParser/Node/Scalar/MagicConst/File.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeveloper\\BetterDocs\\Utils\\Helper' not found in wp-content/plugins/betterdocs/views/admin/docs-ui/classic-partials/filter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeveloper\\BetterDocs\\Dependencies\\PhpParser\ode\\Expr' not found in wp-content/plugins/betterdocs/includes/Dependencies/PhpParser/Node/Expr/New_.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WPDeveloper\\BetterDocs\\Editors\\BlockEditor\\Block' not found in wp-content/plugins/betterdocs/includes/Editors/BlockEditor/Blocks/Navigation.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'WPDeveloper\\BetterDocs\\Dependencies\\DI\\Definition\\Definition' not found in wp-content/plugins/betterdocs/includes/Dependencies/DI/Definition/ExtendsPreviousDefinition.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'WPDeveloper\\BetterDocs\\Dependencies\\Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/betterdocs/includes/Dependencies/Psr/Container/NotFoundExceptionInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/betterdocs/views/admin/customizer/controls/multidimension.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'WPDeveloper\\BetterDocs\\Dependencies\\PhpParser\\Builder' not found in wp-content/plugins/betterdocs/includes/Dependencies/PhpParser/BuilderAbstract.php:12
    • > PHP Notice
      Undefined variable: blockId in wp-content/plugins/betterdocs/views/widgets/print-icon.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_front_page() in wp-content/plugins/betterdocs/views/widgets/breadcrumbs.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 33 tag instead of maximum 10
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6 in betterdocs/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 33 tag instead of maximum 10
The official readme.txt is a good inspiration

betterdocs/betterdocs.php 92% from 13 tests

The main PHP file in "BetterDocs - Best Documentation & Knowledge Base Plugin" ver. 3.0.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 195 characters long)

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
No dangerous file extensions were detected73,578 lines of code in 763 files:
LanguageFilesBlank linesComment linesLines of code
PHP6109,9969,76852,811
SVG4001611,776
CSS54198596,419
JSON16001,737
JavaScript355458346
HTML52171299
Sass270117
XML10073

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.90
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces73
Interfaces26
Traits6
Classes406
▷ Abstract classes276.65%
▷ Concrete classes37993.35%
▷ Final classes92.37%
Methods3,418
▷ Static methods1043.04%
▷ Public methods1,93356.55%
▷ Protected methods1,36139.82%
▷ Private methods1243.63%
Functions89
▷ Named functions1314.61%
▷ Anonymous functions7685.39%
Constants212
▷ Global constants157.08%
▷ Class constants19792.92%
▷ Public constants19699.49%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
68 compressed PNG files occupy 0.90MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/social/reports/graph.png13.14KB14.68KB0.00%
assets/admin/images/customizer/docs-page/layout-1.png3.17KB1.79KB▼ 43.53%
assets/admin/images/icons/author.png0.54KB0.37KB▼ 30.97%
assets/images/social/reports/web.png0.36KB0.55KB0.00%
assets/images/social/reports/youtube.png0.34KB0.35KB0.00%