84% org-departments

Code Review | Org. Departments

WordPress plugin Org. Departments scored84%from 54 tests.

About plugin

  • Plugin page: org-departments
  • Plugin version: 4.8
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2021
  • Latest release: Oct 21, 2021
  • Number of updates: 5
  • Update frequency: every 4.6 days
  • Top authors: wpgear (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /375 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.30ms] Passed 4 tests

An overview of server-side resources used by Org. Departments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0936.68 ▼4.73
Dashboard /wp-admin3.39 ▲0.0947.33 ▼3.43
Posts /wp-admin/edit.php3.51 ▲0.1544.59 ▼1.00
Add New Post /wp-admin/post-new.php5.97 ▲0.0993.62 ▼0.04
Media Library /wp-admin/upload.php3.32 ▲0.0936.09 ▲2.52
Departments /wp-admin/edit-tags.php?taxonomy=departments3.3133.48
Org. Departments /wp-admin/options-general.php?page=org-departments/includes/admin/options.php3.2929.54

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Org. Departments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.15 ▼1.141.62 ▼0.2839.14 ▼6.39
Dashboard /wp-admin2,214 ▲294.84 ▼0.97110.88 ▼5.1238.30 ▼9.16
Posts /wp-admin/edit.php2,097 ▲82.05 ▲0.0539.74 ▲2.7036.84 ▲0.61
Add New Post /wp-admin/post-new.php1,539 ▲1023.13 ▲4.81623.27 ▼36.6450.62 ▼3.87
Media Library /wp-admin/upload.php1,390 ▲54.22 ▲0.0396.95 ▲1.6540.94 ▼1.86
Departments /wp-admin/edit-tags.php?taxonomy=departments1,2612.1326.0828.98
Org. Departments /wp-admin/options-general.php?page=org-departments/includes/admin/options.php8282.0423.9626.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_send_json() in wp-content/plugins/org-departments/includes/ajax_departments.php:205
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/org-departments/includes/shortcodes.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function OrgDepartments_Get_Options() in wp-content/plugins/org-departments/includes/admin/options.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/org-departments/org-departments.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/org-departments/includes/admin/admin.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: "wpgear.xyz/org-departments"
Please take inspiration from this readme.txt

org-departments/org-departments.php Passed 13 tests

The principal PHP file in "Org. Departments" v. 4.8 is loaded by WordPress automatically on each request
99 characters long description:
Hierarchical Structure of Departments. For each User, you can set a binding to several Departments.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected939 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8172121646
JavaScript14919161
CSS2210132

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin