84% minerva-knowledge-base-lite

Code Review | MinervaKB Lite

WordPress plugin MinervaKB Lite scored84%from 54 tests.

About plugin

  • Plugin page: minerva-knowledge...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Mar 17, 2017
  • Latest release: Mar 17, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: alex.me (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /2,110 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.01MB] [CPU: ▲4.41ms] Passed 4 tests

This is a short check of server-side resources used by MinervaKB Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.52 ▲1.0653.17 ▲13.27
Dashboard /wp-admin4.30 ▲0.9673.86 ▲10.25
Posts /wp-admin/edit.php4.43 ▲1.0753.71 ▲12.45
Add New Post /wp-admin/post-new.php6.91 ▲1.0283.40 ▼6.70
Media Library /wp-admin/upload.php4.23 ▲1.0037.92 ▲1.63
Settings /wp-admin/admin.php?page=minerva-kb-submenu-settings4.2354.22
Tags /wp-admin/edit-tags.php?taxonomy=kbtag&post_type=kb4.2237.26
Knowledge Base /wp-admin/edit.php?post_type=kb4.2841.44
Add New /wp-admin/post-new.php?post_type=kb4.4457.66
Topics /wp-admin/edit-tags.php?taxonomy=kbtopic&post_type=kb4.2244.36
Upgrade /wp-admin/admin.php?page=minerva-kb-menu4.2036.36

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 87 new files
Database: no new tables, 12 new options
New WordPress options
can_compress_scripts
widget_kb_recent_topics_widget
_mkb_flushed_rewrite_topic
widget_theysaidso_widget
widget_recent-comments
widget_kb_recent_articles_widget
db_upgraded
minerva-kb-options
widget_recent-posts
_mkb_flushed_rewrite_tag
...

Browser metrics 75% from 4 tests

An overview of browser requirements for MinervaKB Lite
It is time to focus on the following
  • Nodes: For the best user experience, please reduce the number of DOM nodes under 25,000 (currently 31,268 on /wp-admin/admin.php?page=minerva-kb-submenu-settings)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,153 ▲40714.10 ▼0.466.98 ▲5.2367.51 ▲22.25
Dashboard /wp-admin2,309 ▲1216.07 ▲1.2098.34 ▼17.4439.20 ▼6.78
Posts /wp-admin/edit.php2,200 ▲1112.43 ▲0.3946.39 ▲11.2937.31 ▲0.75
Add New Post /wp-admin/post-new.php1,599 ▲8023.40 ▼0.00687.52 ▲12.4839.01 ▼17.40
Media Library /wp-admin/upload.php1,494 ▲1064.48 ▲0.3599.95 ▼13.8543.15 ▼4.67
Settings /wp-admin/admin.php?page=minerva-kb-submenu-settings31,2683.78121.8786.89
Tags /wp-admin/edit-tags.php?taxonomy=kbtag&post_type=kb1,3522.3033.2030.35
Knowledge Base /wp-admin/edit.php?post_type=kb1,2432.3733.4628.33
Add New /wp-admin/post-new.php?post_type=kb2,8688.38173.7169.08
Topics /wp-admin/edit-tags.php?taxonomy=kbtopic&post_type=kb1,3802.3232.4029.60
Upgrade /wp-admin/admin.php?page=minerva-kb-menu9922.0927.4334.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 12 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_kb_recent_articles_widget
    • _mkb_flushed_rewrite_topic
    • widget_theysaidso_widget
    • widget_kb_recent_topics_widget
    • _mkb_flushed_rewrite_cpt
    • can_compress_scripts
    • minerva-kb-options
    • ...

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
Please fix the following items
  • 33× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/minerva-knowledge-base-lite/lib/widgets/recent-articles.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/minerva-knowledge-base-lite/lib/templates/category.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'MINERVA_KB_PLUGIN_DIRlib/helpers/settings-builder.php' (include_path='.:/usr/share/php') in wp-content/plugins/minerva-knowledge-base-lite/lib/ajax.php on line 7
    • > PHP Warning
      Use of undefined constant MINERVA_KB_PLUGIN_DIR - assumed 'MINERVA_KB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/minerva-knowledge-base-lite/lib/app.php on line 8
    • > PHP Fatal error
      require_once(): Failed opening required 'MINERVA_KB_PLUGIN_DIRlib/vendor/Mobile_Detect.php' (include_path='.:/usr/share/php') in wp-content/plugins/minerva-knowledge-base-lite/lib/info.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/minerva-knowledge-base-lite/lib/templates/no-content.php:9
    • > PHP Warning
      Use of undefined constant MINERVA_KB_PLUGIN_DIR - assumed 'MINERVA_KB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/minerva-knowledge-base-lite/lib/ajax.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'MINERVA_KB_PLUGIN_DIRlib/helpers/icon-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/minerva-knowledge-base-lite/lib/helpers/settings-builder.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'MKB_TemplateHelper' not found in wp-content/plugins/minerva-knowledge-base-lite/lib/templates/kb-home.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/minerva-knowledge-base-lite/lib/templates/archive.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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: ajax, support desk, knowledge base, helpdesk, live search...

minerva-knowledge-base-lite/minervakb.php 92% from 13 tests

The primary PHP file in "MinervaKB Lite" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("minerva-knowledge-base-lite.php" instead of "minervakb.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin14,706 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP341,0291,4255,405
CSS51481523,792
SVG1002,671
Sass27342112,061
JavaScript4181161777

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
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 complexity19.83
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods226
▷ Static methods6528.76%
▷ Public methods16974.78%
▷ Protected methods3515.49%
▷ Private methods229.73%
Functions13
▷ Named functions17.69%
▷ Anonymous functions1292.31%
Constants20
▷ Global constants630.00%
▷ Class constants1470.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/col-3.png0.87KB0.78KB▼ 10.59%
assets/img/col-4.png1.01KB0.93KB▼ 8.66%
assets/img/logo.png1.97KB1.84KB▼ 6.35%
assets/img/no-sidebar.png0.58KB0.50KB▼ 13.57%
assets/img/col-2.png0.80KB0.71KB▼ 10.88%