73% organization-chart

Code Review | Organization chart

WordPress plugin Organization chart scored73%from 54 tests.

About plugin

  • Plugin page: organization-chart
  • Plugin version: 1.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 9, 2021
  • Latest release: Oct 10, 2023
  • Number of updates: 103
  • Update frequency: every 8.9 days
  • Top authors: wpdevart (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active /41,888 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Organization chart
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.75 ▼3.32
Dashboard /wp-admin3.36 ▲0.0249.19 ▼18.47
Posts /wp-admin/edit.php3.41 ▲0.0650.52 ▲2.10
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.83 ▼7.47
Media Library /wp-admin/upload.php3.28 ▲0.0639.90 ▼0.39
Popup Themes /wp-admin/admin.php?page=wpda_chart_tree_popup_themes3.2842.28
Featured Plugins /wp-admin/admin.php?page=wpda_chart_featured_plugins3.2634.80
Hire an Expert /wp-admin/admin.php?page=wpda_chart_hire_expert3.2536.54
Themes /wp-admin/admin.php?page=wpda_chart_tree_themes3.2634.05
User Permissions /wp-admin/admin.php?page=wpda_chart_tree_user_permissions3.2834.17
Charts /wp-admin/admin.php?page=wpda_chart_tree_page3.2532.25

Server storage [IO: ▲1.04MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 96 new files
Database: 3 new tables, 7 new options
New tables
wp_wpda_org_chart_popup_theme
wp_wpda_org_chart_tree
wp_wpda_org_chart_theme
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
wpda_org_chart_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Organization chart
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲12714.35 ▲0.002.66 ▲0.7048.41 ▲3.18
Dashboard /wp-admin2,250 ▲765.62 ▲0.0491.24 ▼5.8039.58 ▼2.00
Posts /wp-admin/edit.php2,152 ▲492.01 ▲0.0739.42 ▲0.4337.06 ▲3.38
Add New Post /wp-admin/post-new.php6,414 ▲4,88827.99 ▲4.50940.37 ▲211.7039.57 ▼17.73
Media Library /wp-admin/upload.php1,455 ▲584.20 ▲0.09113.39 ▼3.0647.35 ▼2.38
Popup Themes /wp-admin/admin.php?page=wpda_chart_tree_popup_themes9732.0230.5248.89
Featured Plugins /wp-admin/admin.php?page=wpda_chart_featured_plugins9871.9823.7643.33
Hire an Expert /wp-admin/admin.php?page=wpda_chart_hire_expert9031.9723.3328.37
Themes /wp-admin/admin.php?page=wpda_chart_tree_themes9551.6929.0332.56
User Permissions /wp-admin/admin.php?page=wpda_chart_tree_user_permissions1,0572.1038.7636.65
Charts /wp-admin/admin.php?page=wpda_chart_tree_page9592.0427.2837.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_wpda_org_chart_tree
    • wp_wpda_org_chart_theme
    • wp_wpda_org_chart_popup_theme
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • wpda_org_chart_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 45× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/organization-chart/admin/theme-page/add-edit-theme-template.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/organization-chart/admin/theme-page/add-edit-theme-template.php on line 1
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/organization-chart/admin/theme-page/add-edit-theme-template.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/organization-chart/admin/user-permissions/user-permissions-template.php:23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/organization-chart/admin/popup-page/add-edit-popup-template.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/organization-chart/admin/popup-page/add-edit-popup-template.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/organization-chart/admin/popup-page/add-edit-popup-template.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/organization-chart/admin/theme-page/add-edit-theme-template.php on line 21
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/organization-chart/admin/popup-page/add-edit-popup-template.php on line 1
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/organization-chart/admin/user-permissions/user-permissions-template.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 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: organization chart, staff directory, employee list, organizational chart, org chart

organization-chart/wpdevart_chart.php 85% from 13 tests

The main PHP script in "Organization chart" version 1.4.8 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("organization-chart.php" instead of "wpdevart_chart.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 168 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected9,098 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP183031284,172
CSS1358572,752
JavaScript91662012,171
SVG1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity39.75
▷ Minimum class complexity1.00
▷ Maximum class complexity156.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods187
▷ Static methods12064.17%
▷ Public methods10355.08%
▷ Protected methods00.00%
▷ Private methods8444.92%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
48 PNG files occupy 0.62MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/hire_expert/3.png3.70KB2.55KB▼ 31.03%
admin/assets/images/hire_expert/2.png2.18KB1.83KB▼ 15.82%
admin/assets/images/person_images/chart-man-colo5.png19.25KB4.09KB▼ 78.73%
admin/assets/images/default0.png3.21KB0.58KB▼ 82.01%
admin/assets/images/featured_plugins/contact_forms.png14.11KB6.86KB▼ 51.39%