73% basepress

Code Review | Knowledge Base documentation & wiki plugin - BasePress Docs

WordPress plugin Knowledge Base documentation & wiki plugin - BasePress Docs scored73%from 54 tests.

About plugin

  • Plugin page: basepress
  • Plugin version: 2.15.24
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 24, 2017
  • Latest release: Nov 29, 2023
  • Number of updates: 161
  • Update frequency: every 14.3 days
  • Top authors: codesavory (65.84%)8bitsinarow (34.78%)

Code review

54 tests

User reviews

65 reviews

Install metrics

2,000+ active /74,755 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲5.84MB] [CPU: ▲35.85ms] 50% from 4 tests

Analyzing server-side resources used by Knowledge Base documentation & wiki plugin - BasePress Docs
The following require your attention
  • RAM: You should keep total memory usage under 10MB (currently 11.58MB on /wp-admin/post-new.php?post_type=knowledgebase)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.84MB on /wp-admin/edit.php?post_type=knowledgebase&page=basepress_manage_kbs)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7969.83 ▲28.54
Dashboard /wp-admin9.27 ▲5.9782.75 ▲34.72
Posts /wp-admin/edit.php9.27 ▲5.9194.49 ▲46.05
Add New Post /wp-admin/post-new.php11.56 ▲5.67131.97 ▲41.52
Media Library /wp-admin/upload.php9.27 ▲6.0471.55 ▲38.60
Add New Article /wp-admin/post-new.php?post_type=knowledgebase11.58124.11
All Articles /wp-admin/edit.php?post_type=knowledgebase9.2787.87
Setup Wizard /wp-admin/admin.php?page=basepress_wizard9.2764.41
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2767.59
Sections /wp-admin/edit.php?post_type=knowledgebase&page=basepress_sections9.2772.97
Manage KBs /wp-admin/edit.php?post_type=knowledgebase&page=basepress_manage_kbs9.2779.97

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 370 new files
Database: no new tables, 19 new options
New WordPress options
widget_basepress_sections_widget
fs_active_plugins
widget_basepress_products_widget
widget_basepress_related_articles_widget
basepress_plan
knowledgebase_cat_children
widget_basepress_nav_widget
basepress_settings
basepress_db_ver
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Knowledge Base documentation & wiki plugin - BasePress Docs
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲12614.30 ▼0.391.57 ▼0.2328.48 ▼15.28
Dashboard /wp-admin2,287 ▲1095.55 ▼0.0898.55 ▼16.0948.44 ▲4.01
Posts /wp-admin/edit.php2,196 ▲962.16 ▲0.1339.46 ▲2.2138.69 ▼0.40
Add New Post /wp-admin/post-new.php6,427 ▲4,89827.66 ▲4.07892.34 ▲283.3439.37 ▼17.12
Media Library /wp-admin/upload.php1,496 ▲964.14 ▼0.0197.04 ▼0.3544.88 ▲2.76
Add New Article /wp-admin/post-new.php?post_type=knowledgebase2,26016.88851.9854.96
All Articles /wp-admin/edit.php?post_type=knowledgebase1,3072.1040.5735.95
Setup Wizard /wp-admin/admin.php?page=basepress_wizard1,1232.0429.2748.17
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1381.6624.6427.29
Sections /wp-admin/edit.php?post_type=knowledgebase&page=basepress_sections1,7163.4864.1736.12
Manage KBs /wp-admin/edit.php?post_type=knowledgebase&page=basepress_manage_kbs1,4103.2241.6829.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/basepress/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 19 options in the database
    • fs_active_plugins
    • widget_basepress_related_articles_widget
    • basepress_run_wizard
    • widget_recent-comments
    • basepress_settings
    • widget_basepress_products_widget
    • knowledgebase_cat_children
    • widget_basepress_sections_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • ...

Smoke tests 75% 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 50% from 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
Almost there! Just fix the following items
  • 60× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_kb() in wp-content/plugins/basepress/themes/zen/tag.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_kb() in wp-content/plugins/basepress/themes/default/sections-boxed.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_sidebar_position() in wp-content/plugins/basepress/themes/default/restricted.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/basepress/themes/default/template-parts/post-content.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_kb() in wp-content/plugins/basepress/themes/default/sections.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_kb() in wp-content/plugins/basepress/themes/default/two-columns-left.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_kbs() in wp-content/plugins/basepress/themes/modern/products.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_sections() in wp-content/plugins/basepress/themes/modern/template-parts/single-section-content.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_sections() in wp-content/plugins/basepress/themes/zen/template-parts/sections-content.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basepress_kb() in wp-content/plugins/basepress/themes/zen/restricted.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #4, #5, #6, #7, #8, #9 in basepress/assets to your readme.txt
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
The official readme.txt might help

basepress/basepress.php Passed 13 tests

The main PHP file in "Knowledge Base documentation & wiki plugin - BasePress Docs" ver. 2.15.24 adds more information about the plugin and also serves as the entry point for this plugin
47 characters long description:
The perfect Knowledge Base plugin for WordPress

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin60,010 lines of code in 284 files:
LanguageFilesBlank linesComment linesLines of code
PHP21410,90920,74644,674
CSS221,2663697,869
PO File31,6542,3853,383
JavaScript276153972,693
SVG100685
XML2111396
JSON1100224
HTML46086

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity69.51
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes83
▷ Abstract classes22.41%
▷ Concrete classes8197.59%
▷ Final classes00.00%
Methods1,601
▷ Static methods19912.43%
▷ Public methods1,17373.27%
▷ Protected methods171.06%
▷ Private methods41125.67%
Functions174
▷ Named functions16695.40%
▷ Anonymous functions84.60%
Constants155
▷ Global constants10869.68%
▷ Class constants4730.32%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
themes/zen/img/plus-circle.png3.30KB1.88KB▼ 42.95%
assets/img/wizard-header.png6.94KB4.04KB▼ 41.85%
assets/img/logo.png0.87KB0.79KB▼ 8.99%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%