83% reference-knowledgebase-and-docs

Code Review | Reference - WordPress Knowledgebase Plugin

WordPress plugin Reference - WordPress Knowledgebase Plugin scored83%from 54 tests.

About plugin

  • Plugin page: reference-knowled...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-4.8.0
  • WordPress version: 6.3.1
  • First release: Jun 22, 2017
  • Latest release: May 28, 2018
  • Number of updates: 5
  • Update frequency: every 68.0 days
  • Top authors: dunhakdis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /8,685 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.74MB] [CPU: ▲0.81ms] Passed 4 tests

This is a short check of server-side resources used by Reference - WordPress Knowledgebase Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7042.98 ▲7.84
Dashboard /wp-admin4.06 ▲0.7654.50 ▲7.71
Posts /wp-admin/edit.php4.12 ▲0.7755.77 ▲9.74
Add New Post /wp-admin/post-new.php6.65 ▲0.7687.15 ▼22.04
Media Library /wp-admin/upload.php3.96 ▲0.7445.96 ▲13.71
Tags /wp-admin/edit-tags.php?taxonomy=knb-tags&post_type=dsc-knowledgebase3.9948.70
Reference /wp-admin/options-general.php?page=reference_settings3.9647.64
All Articles /wp-admin/edit.php?post_type=dsc-knowledgebase4.0444.42
Add New /wp-admin/post-new.php?post_type=dsc-knowledgebase4.1258.60
Topics /wp-admin/edit-tags.php?taxonomy=knb-categories&post_type=dsc-knowledgebase3.9943.46

Server storage [IO: ▲0.42MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 143 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_reference_related_articles
widget_reference_recent_articles
theysaidso_admin_options
can_compress_scripts
widget_reference_most_upvoted_articles

Browser metrics Passed 4 tests

Checking browser requirements for Reference - WordPress Knowledgebase Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,064 ▲30314.85 ▲0.324.94 ▲3.5044.35 ▲2.38
Dashboard /wp-admin2,378 ▲1976.18 ▲0.48109.00 ▲10.4039.78 ▼1.87
Posts /wp-admin/edit.php2,306 ▲2063.34 ▲1.3949.80 ▲13.2130.42 ▼3.84
Add New Post /wp-admin/post-new.php1,565 ▲3723.53 ▲0.52649.21 ▲50.6338.17 ▼5.20
Media Library /wp-admin/upload.php1,446 ▲494.24 ▲0.1080.90 ▼18.7943.83 ▼1.47
Tags /wp-admin/edit-tags.php?taxonomy=knb-tags&post_type=dsc-knowledgebase1,4583.2241.1929.30
Reference /wp-admin/options-general.php?page=reference_settings1,3903.2538.8033.56
All Articles /wp-admin/edit.php?post_type=dsc-knowledgebase1,3403.3643.7827.50
Add New /wp-admin/post-new.php?post_type=dsc-knowledgebase2,9167.99170.4969.08
Topics /wp-admin/edit-tags.php?taxonomy=knb-categories&post_type=dsc-knowledgebase1,5043.2041.7529.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.08MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 9 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_reference_most_upvoted_articles
    • can_compress_scripts
    • widget_recent-comments
    • widget_reference_related_articles
    • widget_recent-posts
    • widget_reference_recent_articles
    • 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
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
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function reference_category_thumbnail() in wp-content/plugins/reference-knowledgebase-and-docs/templates/thrive/knowledgebase-none.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/thrive/archive-dsc-knowledgebase.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/twentyseventeen/knowledgebase-search.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function reference_breadcrumb() in wp-content/plugins/reference-knowledgebase-and-docs/templates/twentyseventeen/knowledgebase-none.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/thrive/single-dsc-knowledgebase.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/reference-knowledgebase-and-docs/templates/search-form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/thrive/taxonomy-knb-categories.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/twentyseventeen/archive-dsc-knowledgebase.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/twentyseventeen/single-dsc-knowledgebase.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/reference-knowledgebase-and-docs/templates/twentyseventeen/taxonomy-knb-categories.php:13

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 90% 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: project, task, task discussion, collaboration

reference-knowledgebase-and-docs/reference-wordpress-knowledgebase.php 77% from 13 tests

The principal PHP file in "Reference - WordPress Knowledgebase Plugin" v. 1.0.4 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("reference-knowledgebase-and-docs.php" instead of "reference-wordpress-knowledgebase.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 plugin10,243 lines of code in 136 files:
LanguageFilesBlank linesComment linesLines of code
CSS801,0076465,421
PHP508162,4244,358
Markdown11330268
JavaScript512515196

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity14.29
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes1058.82%
Methods122
▷ Static methods4738.52%
▷ Public methods11795.90%
▷ Protected methods00.00%
▷ Private methods54.10%
Functions40
▷ Named functions40100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants29.52%
▷ Class constants1990.48%
▷ Public constants19100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/styles/school-book.png0.47KB0.34KB▼ 27.37%
assets/css/styles/brown-papersq.png17.77KB9.92KB▼ 44.16%