74% employee-directory

Code Review | Staff Directory - Employee Directory for WordPress

WordPress plugin Staff Directory - Employee Directory for WordPress scored74%from 54 tests.

About plugin

  • Plugin page: employee-directory
  • Plugin version: 4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Aug 8, 2015
  • Latest release: Jun 29, 2023
  • Number of updates: 133
  • Update frequency: every 21.7 days
  • Top authors: emarket-design (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

200+ active /36,186 total downloads

Benchmarks

Plugin footprint 65% from 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: ▲3.70MB] [CPU: ▲21.73ms] Passed 4 tests

An overview of server-side resources used by Staff Directory - Employee Directory for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.88 ▲3.4262.35 ▲21.72
Dashboard /wp-admin7.15 ▲3.81120.65 ▲61.56
Posts /wp-admin/edit.php7.20 ▲3.8578.56 ▲27.29
Add New Post /wp-admin/post-new.php9.68 ▲3.80106.29 ▲7.96
Media Library /wp-admin/upload.php6.99 ▲3.7666.26 ▲29.96
Support /wp-admin/admin.php?page=empd_com_support6.9955.68
Employment Types /wp-admin/edit-tags.php?taxonomy=employment_type&post_type=emd_employee7.0259.96
Getting Started /wp-admin/admin.php?page=empd_com6.9860.06
CSV Import/Export /wp-admin/admin.php?page=operations_emd_employee6.9656.62
Job Titles /wp-admin/edit-tags.php?taxonomy=jobtitles&post_type=emd_employee7.0366.25
Genders /wp-admin/edit-tags.php?taxonomy=gender&post_type=emd_employee7.0261.61
Marital Statuses /wp-admin/edit-tags.php?taxonomy=marital_status&post_type=emd_employee7.0260.99
All Employees /wp-admin/edit.php?post_type=emd_employee7.1461.27
Plugins /wp-admin/admin.php?page=empd_com_store7.0053.22
Forms /wp-admin/admin.php?page=empd_com_forms6.9755.52

Server storage [IO: ▲4.39MB] [DB: ▲0.03MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 293 new files
Database: 1 new table, 25 new options
New tables
wp_emd_sessions
New WordPress options
empd_com_attr_list
empd_com_tax_list
empd_com_glob_init_list
empd_com_activation_date
empd_com_add_caps
db_upgraded
widget_empd_com_recent_employees_widget
widget_recent-posts
widget_empd_com_featured_employees_widget
can_compress_scripts
...

Browser metrics Passed 4 tests

Checking browser requirements for Staff Directory - Employee Directory for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲25013.56 ▼0.811.61 ▼0.1035.43 ▼5.63
Dashboard /wp-admin2,397 ▲2065.89 ▲1.00112.72 ▲11.8052.50 ▲12.27
Posts /wp-admin/edit.php2,279 ▲1872.16 ▲0.1142.95 ▲1.3241.40 ▲5.19
Add New Post /wp-admin/post-new.php1,752 ▲23321.71 ▼1.46571.20 ▼82.0557.57 ▼1.37
Media Library /wp-admin/upload.php1,589 ▲2014.29 ▲0.0897.19 ▼15.6044.91 ▼0.04
Support /wp-admin/admin.php?page=empd_com_support1,2791.8324.9445.60
Employment Types /wp-admin/edit-tags.php?taxonomy=employment_type&post_type=emd_employee1,5792.3331.2735.41
Getting Started /wp-admin/admin.php?page=empd_com3,0812.0744.59132.79
CSV Import/Export /wp-admin/admin.php?page=operations_emd_employee1,0381.6824.5842.96
Job Titles /wp-admin/edit-tags.php?taxonomy=jobtitles&post_type=emd_employee2,0022.3329.0439.91
Genders /wp-admin/edit-tags.php?taxonomy=gender&post_type=emd_employee1,6232.3329.7837.46
Marital Statuses /wp-admin/edit-tags.php?taxonomy=marital_status&post_type=emd_employee1,5822.3328.0137.27
All Employees /wp-admin/edit.php?post_type=emd_employee1,3272.3635.9936.21
Plugins /wp-admin/admin.php?page=empd_com_store1,3071.8425.5335.19
Forms /wp-admin/admin.php?page=empd_com_forms1,1261.9935.1130.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 50% 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
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_emd_sessions
  • Zombie WordPress options detected upon uninstall: 22 options
    • empd_com_setup_pages
    • widget_recent-posts
    • widget_empd_com_recent_employees_widget
    • empd_com_cust_roles
    • empd_com_glob_forms_list
    • empd_com_tax_list
    • db_upgraded
    • empd_com_add_caps
    • widget_theysaidso_widget
    • empd_com_init_tax
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
Almost there! Just fix the following items
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/employee-directory/assets/ext/emd-meta-box/inc/init.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'EMD_MB_Field' not found in wp-content/plugins/employee-directory/assets/ext/emd-meta-box/inc/fields/file-input.php:4
    • > PHP Warning
      Use of undefined constant EMPD_COM_PLUGIN_URL - assumed 'EMPD_COM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/employee-directory/includes/admin/plugin-support.php on line 44
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/employee-directory/layouts/widget-featured-employees-content.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/employee-directory/layouts/emd-register.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/employee-directory/assets/ext/emd-session/includes/emd-wp-session.php:86
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/employee-directory/assets/ext/emd-session/includes/emd-wp-session.php:86
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/employee-directory/layouts/single-emd-employee.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/employee-directory/includes/admin/plugin-support.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/employee-directory/layouts/emd-login.php:2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: intranet, active directory, org chart, directory, staff

employee-directory/employee-directory.php 85% from 13 tests

Analyzing the main PHP file in "Staff Directory - Employee Directory for WordPress" version 4.3
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin30,583 lines of code in 196 files:
LanguageFilesBlank linesComment linesLines of code
PHP1008343,76219,817
JavaScript525267315,642
SVG2002,673
CSS421131252,451

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.53
Average class complexity20.20
▷ Minimum class complexity1.00
▷ Maximum class complexity143.00
Average method complexity4.31
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes00.00%
▷ Concrete classes60100.00%
▷ Final classes23.33%
Methods343
▷ Static methods21261.81%
▷ Public methods32594.75%
▷ Protected methods123.50%
▷ Private methods61.75%
Functions192
▷ Named functions19199.48%
▷ Anonymous functions10.52%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
76 compressed PNG files occupy 0.90MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/events-calendar.png4.67KB4.92KB0.00%
assets/img/emd_templating_system.png23.46KB24.44KB0.00%
assets/img/jui-img/ui-bg_highlight-soft_75_cccccc_1x100.png0.08KB0.17KB0.00%
assets/img/zoomin.png1.73KB1.81KB0.00%
assets/img/jui-img/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%