79% smart-docs

Code Review | Smart Docs

WordPress plugin Smart Docs scored 79% from 54 tests.

About plugin

  • Plugin page: smart-docs
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 9, 2021
  • Latest release: Jul 22, 2023
  • Number of updates: 10
  • Update frequency: every 93.5 days
  • Top authors: ibachal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 2,105 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.46MB] [CPU: ▼4.56ms] Passed 4 tests

Server-side resources used by Smart Docs
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7742.20 ▲4.02
Dashboard /wp-admin4.01 ▲0.7053.36 ▲6.49
Posts /wp-admin/edit.php4.07 ▲0.7261.30 ▲13.36
Add New Post /wp-admin/post-new.php5.67 ▼0.2161.98 ▼35.08
Media Library /wp-admin/upload.php3.85 ▲0.6242.25 ▲6.34
All Docs /wp-admin/edit.php?post_type=smart-docs3.9946.09
Categories /wp-admin/edit-tags.php?taxonomy=smartdocs_category&post_type=smart-docs3.9343.75
Settings /wp-admin/edit.php?post_type=smart-docs&page=smart_docs_settings3.8641.09
Add New /wp-admin/post-new.php?post_type=smart-docs5.6758.35

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 70 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_smartdocs-categories-widget
smartdocs_installed_time
theysaidso_admin_options
widget_theysaidso_widget
smartdocs_rewrite_rules_flushed
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smart Docs
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,004 ▲26915.21 ▲0.821.67 ▼0.2042.07 ▼1.95
Dashboard /wp-admin2,405 ▲2176.49 ▲1.60133.18 ▲23.4343.93 ▲3.54
Posts /wp-admin/edit.php2,314 ▲2283.56 ▲1.5659.40 ▲24.4337.02 ▲1.75
Add New Post /wp-admin/post-new.php6,627 ▲5,09429.13 ▲6.09891.44 ▲224.6241.34 ▼20.10
Media Library /wp-admin/upload.php1,446 ▲584.22 ▼0.0181.72 ▼17.1539.99 ▼3.72
All Docs /wp-admin/edit.php?post_type=smart-docs1,3393.5845.2128.48
Categories /wp-admin/edit-tags.php?taxonomy=smartdocs_category&post_type=smart-docs1,5473.4754.4129.63
Settings /wp-admin/edit.php?post_type=smart-docs&page=smart_docs_settings1,27412.81229.1631.36
Add New /wp-admin/post-new.php?post_type=smart-docs6,42121.85801.2634.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_smartdocs-categories-widget
    • theysaidso_admin_options
    • smartdocs_installed_time
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=smart-docs
    • > User deprecated in wp-includes/functions.php+5828
    Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

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
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/smart-docs/classes/customizer/sections/layout.php on line 12
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/smart-docs/classes/customizer/sections/archive.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/smart-docs/classes/customizer/sections/archive.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/smart-docs/classes/customizer/sections/breadcrumbs.php:12
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/smart-docs/classes/customizer/sections/single.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/smart-docs/classes/customizer/sections/breakpoints.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/smart-docs/classes/customizer/sections/hero-section.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_section() on null in wp-content/plugins/smart-docs/classes/customizer/sections/single.php:12
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/smart-docs/classes/customizer/sections/breakpoints.php on line 12
    • > PHP Notice
      Undefined variable: wp_customize in wp-content/plugins/smart-docs/classes/customizer/sections/hero-section.php on line 12

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: documents, knowledge base, documentation, docs, wiki

smart-docs/smart-docs.php Passed 13 tests

This is the main PHP file of "Smart Docs" version 1.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
54 characters long description:
Knowledge Base and Documentation plugin for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected7,049 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP458912,1984,366
CSS6224421,354
JavaScript92433611,288
SVG30041

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity21.20
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes16.67%
Methods122
▷ Static methods108.20%
▷ Public methods9275.41%
▷ Protected methods2117.21%
▷ Private methods97.38%
Functions51
▷ Named functions4996.08%
▷ Anonymous functions23.92%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png6.90KB3.33KB▼ 51.80%
assets/images/admin-menu-icon.png1.94KB1.25KB▼ 35.60%