77% site-structure-visualizer

Code Review | Site Structure Visualizer

WordPress plugin Site Structure Visualizer scored 77% from 54 tests.

About plugin

  • Plugin page: site-structure-vi...
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 25, 2021
  • Latest release: Jul 28, 2023
  • Number of updates: 8
  • Update frequency: every 87.8 days
  • Top authors: shubshinde (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active / 542 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.03MB] [CPU: ▼0.50ms] Passed 4 tests

A check of server-side resources used by Site Structure Visualizer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.54 ▼3.96
Dashboard /wp-admin3.34 ▲0.0346.51 ▼3.27
Posts /wp-admin/edit.php3.39 ▲0.0350.97 ▲3.71
Add New Post /wp-admin/post-new.php5.94 ▲0.0598.46 ▲2.37
Media Library /wp-admin/upload.php3.26 ▲0.0337.87 ▲2.87

Server storage [IO: ▲0.82MB] [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: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Site Structure Visualizer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.25 ▼1.001.61 ▼0.2341.09 ▼7.48
Dashboard /wp-admin2,216 ▲285.83 ▼0.07103.47 ▲2.4238.59 ▼3.95
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0339.10 ▲2.8034.96 ▲4.62
Add New Post /wp-admin/post-new.php1,546 ▲1323.32 ▼0.20635.50 ▼56.7553.42 ▼2.48
Media Library /wp-admin/upload.php1,404 ▲164.20 ▲0.03101.52 ▲2.2843.18 ▼4.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/site-structure-visualizer/template-parts/view-tabs/tab-tree-view.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'SSVP_PLUGIN_PATH/includes/SSVP-data-engine.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/site-structure-visualizer/template-parts/SSVP-options-content.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/site-structure-visualizer/includes/SSVP-api-routes.php:3
    • > PHP Warning
      include(SSVP_PLUGIN_PATH/includes/SSVP-data-engine.php): failed to open stream: No such file or directory in wp-content/plugins/site-structure-visualizer/template-parts/SSVP-options-content.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/site-structure-visualizer/template-parts/view-tabs/tab-about-us.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/site-structure-visualizer/includes/SSVP-data-engine.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/site-structure-visualizer/template-parts/SSVP-options-content.php:10
    • > PHP Warning
      Use of undefined constant SSVP_PLUGIN_PATH - assumed 'SSVP_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/site-structure-visualizer/template-parts/SSVP-options-content.php on line 8
    • > PHP Warning
      Use of undefined constant SSVP_SITE_URL - assumed 'SSVP_SITE_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/site-structure-visualizer/template-parts/SSVP-options-content.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/site-structure-visualizer/includes/SSVP-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/site-structure-visualizer/includes/SSVP-loader.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 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

site-structure-visualizer/site-structure-visualizer-plugin.php 85% from 13 tests

The main PHP file in "Site Structure Visualizer" ver. 2.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("site-structure-visualizer.php" instead of "site-structure-visualizer-plugin.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,436 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP916091573
JavaScript59687453
JSON110380
CSS23623
Markdown1507

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants6
▷ Global constants6100.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
10 PNG files occupy 0.34MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/dev.png205.50KB65.24KB▼ 68.26%
assets/img/icons/3.png26.17KB11.73KB▼ 55.19%
assets/img/3.png26.17KB11.73KB▼ 55.19%
assets/img/2.png0.50KB0.24KB▼ 50.79%
assets/img/default-logo.png15.74KB6.98KB▼ 55.63%