10% faculty-and-staff-directory

Code Review | Faculty and Staff Directory

WordPress plugin Faculty and Staff Directory scored10%from 54 tests.

About plugin

  • Plugin page: faculty-and-staff...
  • Plugin version: 1.51
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: May 27, 2014
  • Latest release: Sep 13, 2014
  • Number of updates: 51
  • Update frequency: every 2.1 days
  • Top authors: jcummings1974 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,151 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/faculty-and-staff-directory/faculty-staff-directory.php+388
    Function create_function() is deprecated

Server metrics [RAM: ▼1.97MB] [CPU: ▼60.04ms] Passed 4 tests

This is a short check of server-side resources used by Faculty and Staff Directory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.28 ▼38.47
Dashboard /wp-admin2.05 ▼1.305.49 ▼56.26
Posts /wp-admin/edit.php2.05 ▼1.316.05 ▼43.76
Add New Post /wp-admin/post-new.php2.05 ▼3.845.84 ▼101.68
Media Library /wp-admin/upload.php2.05 ▼1.184.69 ▼29.60
FSDirectory /wp-admin/options-general.php?page=fsdirectory-options2.055.74
Categories /wp-admin/edit-tags.php?taxonomy=profile-category&post_type=facstaff2.057.65
Faculty and Staff Profiles /wp-admin/edit.php?post_type=facstaff2.054.86
Add New /wp-admin/post-new.php?post_type=facstaff2.055.88

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 49 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
fsdirectory_sortstyle
widget_fsdirectory_widget
fsdirectory_displaystyle
fsdirectory_stylethumbnail
widget_recent-posts
can_compress_scripts
fsdirectory_hidethumbnail
...

Browser metrics Passed 4 tests

A check of browser resources used by Faculty and Staff Directory
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.28 ▼1.074.36 ▲2.5643.92 ▲0.39
Dashboard /wp-admin2,232 ▲555.61 ▼0.0387.68 ▼1.7237.44 ▼1.12
Posts /wp-admin/edit.php2,140 ▲402.02 ▲0.0336.03 ▼1.5532.31 ▼3.68
Add New Post /wp-admin/post-new.php1,557 ▲3123.13 ▼0.48593.68 ▼68.9554.26 ▲6.15
Media Library /wp-admin/upload.php1,434 ▲344.17 ▲0.0797.77 ▼11.3346.68 ▲4.82
FSDirectory /wp-admin/options-general.php?page=fsdirectory-options9911.9923.8237.24
Categories /wp-admin/edit-tags.php?taxonomy=profile-category&post_type=facstaff1,3112.1230.7331.52
Faculty and Staff Profiles /wp-admin/edit.php?post_type=facstaff1,1421.9831.1327.04
Add New /wp-admin/post-new.php?post_type=facstaff2,5437.74169.4769.75

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/faculty-and-staff-directory/faculty-staff-directory.php+388
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 11 options
    • fsdirectory_displaystyle
    • fsdirectory_stylethumbnail
    • widget_recent-posts
    • widget_fsdirectory_widget
    • fsdirectory_hidethumbnail
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • fsdirectory_sortstyle
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=facstaff
    • > Deprecated in wp-content/plugins/faculty-and-staff-directory/faculty-staff-directory.php+388
    Function create_function() is deprecated
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=facstaff
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in fsdirectory_widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=fsdirectory-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=fsdirectory-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/faculty-and-staff-directory/admin/facultystaff-admin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_post() in wp-content/plugins/faculty-and-staff-directory/display-templates/facstaff-template-dual.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_post() in wp-content/plugins/faculty-and-staff-directory/display-templates/facstaff-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/faculty-and-staff-directory/single-facstaff.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_post() in wp-content/plugins/faculty-and-staff-directory/display-templates/facstaff-template-triple.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/faculty-and-staff-directory/archive-facstaff.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/faculty-and-staff-directory/display-templates/facstaff-category-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_post() in wp-content/plugins/faculty-and-staff-directory/display-templates/facstaff-template-list.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: directory, staff, faculty, university

faculty-and-staff-directory/faculty-staff-directory.php 92% from 13 tests

Analyzing the main PHP file in "Faculty and Staff Directory" version 1.51
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 ("faculty-and-staff-directory.php" instead of "faculty-staff-directory.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
There were no executable files found in this plugin5,267 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
CSS49131,641
Sass1319221,158
LESS1319311,149
PHP914252804
SVG100504
JavaScript111388
Markdown1103

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/profile-placeholder.png11.42KB8.46KB▼ 25.91%