78% staff-directory-pro

Code Review | Staff Directory Plugin: Company Directory

WordPress plugin Staff Directory Plugin: Company Directory scored78%from 54 tests.

About plugin

  • Plugin page: staff-directory-pro
  • Plugin version: 4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 8, 2014
  • Latest release: Jun 22, 2022
  • Number of updates: 79
  • Update frequency: every 35.7 days
  • Top authors: richardgabriel (88.61%)ghuger (12.66%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /42,875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.08MB] [CPU: ▲0.59ms] Passed 4 tests

Server-side resources used by Staff Directory Plugin: Company Directory
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.48 ▲1.0234.13 ▼7.40
Dashboard /wp-admin4.38 ▲1.0853.68 ▲5.37
Posts /wp-admin/edit.php4.50 ▲1.1456.11 ▲7.86
Add New Post /wp-admin/post-new.php7.10 ▲1.2189.93 ▼3.48
Media Library /wp-admin/upload.php4.31 ▲1.0745.66 ▲11.86
Error /wp-admin/admin.php?page=company_directory_pro_error_page4.2837.71
Settings /wp-admin/edit.php?post_type=staff-member&page=staff_dir-settings4.3545.28
About Plugin /wp-admin/edit.php?post_type=staff-member_aloha4.1734.33
Help & Instructions /wp-admin/edit.php?post_type=staff-member&page=company-directory-help4.3543.24
Shortcode Generator /wp-admin/edit.php?post_type=staff-member&page=company-directory-shortcode-generator4.3643.33
Upgrade To Pro /wp-admin/edit.php?post_type=staff-member&page=company-directory-upgrade-to-pro4.2840.25
Privacy Notice /wp-admin/admin.php?page=company_directory_pro_privacy_notice4.2849.39
Import & Export /wp-admin/edit.php?post_type=staff-member&page=company-directory-import-export4.2941.35
Add New Staff Member /wp-admin/post-new.php?post_type=staff-member4.5360.34
All Staff Members /wp-admin/edit.php?post_type=staff-member4.3545.99

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 108 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_gp_single_staff_widget
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_gp_staff_list_widget
theysaidso_admin_options
widget_gp_search_staff_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Staff Directory Plugin: Company Directory
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,936 ▲20113.52 ▼0.701.56 ▼0.9537.01 ▼6.49
Dashboard /wp-admin2,333 ▲1425.61 ▼0.2893.09 ▼13.6637.61 ▼6.81
Posts /wp-admin/edit.php2,208 ▲1192.66 ▲0.6048.02 ▲7.3836.21 ▼1.92
Add New Post /wp-admin/post-new.php6,387 ▲4,87323.65 ▲6.02889.99 ▲211.7754.61 ▼1.34
Media Library /wp-admin/upload.php1,516 ▲1314.76 ▲0.5289.45 ▼14.5644.65 ▼0.23
Error /wp-admin/admin.php?page=company_directory_pro_error_page8802.1229.7225.47
Settings /wp-admin/edit.php?post_type=staff-member&page=staff_dir-settings1,1232.4843.9737.54
About Plugin /wp-admin/edit.php?post_type=staff-member_aloha280.440.094.01
Help & Instructions /wp-admin/edit.php?post_type=staff-member&page=company-directory-help9852.3836.7330.18
Shortcode Generator /wp-admin/edit.php?post_type=staff-member&page=company-directory-shortcode-generator1,6737.30145.9859.73
Upgrade To Pro /wp-admin/edit.php?post_type=staff-member&page=company-directory-upgrade-to-pro1,1792.2930.7282.94
Privacy Notice /wp-admin/admin.php?page=company_directory_pro_privacy_notice8882.1429.9023.19
Import & Export /wp-admin/edit.php?post_type=staff-member&page=company-directory-import-export1,1542.6044.2844.81
Add New Staff Member /wp-admin/post-new.php?post_type=staff-member2,7317.82167.2073.12
All Staff Members /wp-admin/edit.php?post_type=staff-member1,1722.5840.7929.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_gp_staff_list_widget
    • widget_gp_search_staff_widget
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_gp_single_staff_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/staff-directory-pro/include/single_staff_widget.php:20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/staff-directory-pro/include/Company_Directory_Update_Notices.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/staff-directory-pro/templates/content-staff-member.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/staff-directory-pro/templates/content-staff-member.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/staff-directory-pro/blocks/single-staff.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/staff-directory-pro/blocks/staff-list.php:50
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/staff-directory-pro/templates/content-staff-member.php on line 5
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/staff-directory-pro/include/Company_Directory_Update_Notices.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/staff-directory-pro/include/content/welcome.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/staff-directory-pro/include/staff_list_widget.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=staff-member_aloha
    • > Network (severe)
    wp-admin/edit.php?post_type=staff-member_aloha - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: directory, skills matrix, staff skills directory, staff skills, directory with contact form...

staff-directory-pro/staff-directory.php 92% from 13 tests

The principal PHP file in "Staff Directory Plugin: Company Directory" v. 4.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("staff-directory-pro.php" instead of "staff-directory.php")

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
Good job! No executable or dangerous file extensions detected19,269 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PHP281,3922,5287,286
PO File171,4491,9934,842
CSS15305934,307
JavaScript102773011,762
SVG100685
Markdown1580281
HTML100106

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity37.88
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods377
▷ Static methods92.39%
▷ Public methods34090.19%
▷ Protected methods236.10%
▷ Private methods143.71%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.50MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/check-mark.png25.95KB14.17KB▼ 45.41%
assets/img/upgrade/custom-fields-editor-small.png32.44KB16.17KB▼ 50.16%
assets/img/upgrade/staff-grid.png329.84KB83.33KB▼ 74.74%
include/lib/GP_MegaSeptember/assets/img/lock.png1.28KB1.25KB▼ 2.52%
assets/img/default-person.png27.00KB12.29KB▼ 54.49%