84% knowledgebase

Code Review | Knowledge Base

WordPress plugin Knowledge Base scored84%from 54 tests.

About plugin

  • Plugin page: knowledgebase
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: May 23, 2015
  • Latest release: Jul 26, 2023
  • Number of updates: 34
  • Update frequency: every 87.9 days
  • Top authors: Ajay (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /10,206 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
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼0.04ms] Passed 4 tests

Server-side resources used by Knowledge Base
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2151.62 ▲5.50
Dashboard /wp-admin3.58 ▲0.2852.08 ▼2.35
Posts /wp-admin/edit.php3.63 ▲0.2846.70 ▼6.83
Add New Post /wp-admin/post-new.php6.26 ▲0.38106.23 ▲5.45
Media Library /wp-admin/upload.php3.44 ▲0.2138.22 ▲3.57
Add New Article /wp-admin/post-new.php?post_type=wz_knowledgebase6.2693.72
All Articles /wp-admin/edit.php?post_type=wz_knowledgebase3.4841.23
Settings /wp-admin/edit.php?post_type=wz_knowledgebase&page=wzkb-settings3.5040.28
Sections /wp-admin/edit-tags.php?taxonomy=wzkb_category&post_type=wz_knowledgebase3.4337.44
Tags /wp-admin/edit-tags.php?taxonomy=wzkb_tag&post_type=wz_knowledgebase3.4335.43

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 80 new files
Database: no new tables, 10 new options
New WordPress options
wzkb_settings
theysaidso_admin_options
db_upgraded
widget_widget_wzkb_articles
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_widget_wzkb_breadcrumb
widget_widget_wzkb_sections

Browser metrics Passed 4 tests

This is an overview of browser requirements for Knowledge Base
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲10613.64 ▼1.031.82 ▼0.0541.24 ▼3.68
Dashboard /wp-admin2,253 ▲624.86 ▼0.00101.05 ▼3.8838.39 ▲0.81
Posts /wp-admin/edit.php2,136 ▲442.02 ▼0.0437.07 ▼1.2431.42 ▼3.55
Add New Post /wp-admin/post-new.php6,395 ▲4,86228.03 ▲4.82925.58 ▲258.7642.26 ▼10.44
Media Library /wp-admin/upload.php1,432 ▲414.22 ▲0.0298.75 ▼3.8445.62 ▲1.52
Add New Article /wp-admin/post-new.php?post_type=wz_knowledgebase6,20320.31915.5533.94
All Articles /wp-admin/edit.php?post_type=wz_knowledgebase1,1611.9332.7330.45
Settings /wp-admin/edit.php?post_type=wz_knowledgebase&page=wzkb-settings1,7125.46116.3483.71
Sections /wp-admin/edit-tags.php?taxonomy=wzkb_category&post_type=wz_knowledgebase1,3092.1425.6128.57
Tags /wp-admin/edit-tags.php?taxonomy=wzkb_tag&post_type=wz_knowledgebase1,2782.1327.2627.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_widget_wzkb_breadcrumb
    • can_compress_scripts
    • widget_widget_wzkb_sections
    • widget_widget_wzkb_articles
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/knowledgebase/includes/public/templates/archive-wz_knowledgebase.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/knowledgebase/includes/public/templates/single-wz_knowledgebase.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/knowledgebase/includes/public/templates/wzkb-search.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_active_sidebar() in wp-content/plugins/knowledgebase/includes/public/templates/sidebar-primary.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/knowledgebase/includes/admin/settings/sidebar.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_queried_object() on null in wp-content/plugins/knowledgebase/includes/public/templates/taxonomy-wzkb_category.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: support, faq, documentation, frequently asked questions, knowledge base...

knowledgebase/knowledgebase.php Passed 13 tests

The main PHP file in "Knowledge Base" ver. 2.2.0 adds more information about the plugin and also serves as the entry point for this plugin
69 characters long description:
Fastest way to create a highly-flexible multi-product knowledge base.

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 plugin4,640 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP308662,1312,867
JavaScript1359125480
PO File1173194459
CSS58113358
Sass3540256
JSON200125
Markdown145071
XML18624

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity32.80
▷ Minimum class complexity5.00
▷ Maximum class complexity111.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods88
▷ Static methods55.68%
▷ Public methods8798.86%
▷ Protected methods11.14%
▷ Private methods00.00%
Functions56
▷ Named functions5598.21%
▷ Anonymous functions11.79%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 compressed PNG files occupy 0.01MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/public/images/search-icon.png2.09KB2.11KB0.00%
includes/public/images/default-thumb.png4.22KB4.40KB0.00%
includes/admin/settings/images/fb.png1.51KB1.59KB0.00%
includes/admin/images/fb.png1.51KB1.59KB0.00%