88% simple-org-chart

Code Review | Simple Org Chart

WordPress plugin Simple Org Chart scored 88% from 54 tests.

About plugin

  • Plugin page: simple-org-chart
  • Plugin version: 2.3.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 5.8.1
  • First release: Sep 7, 2015
  • Latest release: Feb 7, 2022
  • Number of updates: 97
  • Update frequency: every 24.2 days
  • Top authors: gangesh (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

1,000+ active / 33,662 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼164.91ms] Passed 4 tests

Server-side resources used by Simple Org Chart
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0326.42 ▼0.58
Dashboard /wp-admin3.11 ▲0.0540.78 ▼6.08
Posts /wp-admin/edit.php3.22 ▲0.1139.98 ▲5.58
Add New Post /wp-admin/post-new.php2.87 ▼2.5716.64 ▼650.63
Media Library /wp-admin/upload.php3.03 ▲0.0322.75 ▼2.35
Org Chart /wp-admin/options-general.php?page=org_chart3.0022.59

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Simple Org Chart: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,945 ▲34417.97 ▲2.374.95 ▼0.1573.07 ▼0.10
Dashboard /wp-admin3,191 ▲2928.44 ▲2.27141.95 ▲11.58162.05 ▼12.13
Posts /wp-admin/edit.php3,035 ▲2955.05 ▲1.8083.87 ▲17.44137.09 ▼5.31
Add New Post /wp-admin/post-new.php2,345 ▼1,39816.27 ▼2.77387.19 ▼55.19160.93 ▼7.30
Media Library /wp-admin/upload.php1,820 ▲655.92 ▲0.40113.04 ▼29.03183.88 ▼2.47
Org Chart /wp-admin/options-general.php?page=org_chart1,4965.3988.12142.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=org_chart
    • > Notice in wp-content/plugins/simple-org-chart/index.php+147
    Undefined variable: top_level_id

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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-org-chart/index.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: Please take inspiration from this readme.txt

simple-org-chart/index.php 92% from 13 tests

The main PHP script in "Simple Org Chart" version 2.3.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-org-chart.php" instead of "index.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
No dangerous file extensions were detected1,046 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP117533471
JavaScript39264356
CSS2409219

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.32
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%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin