10% wp-hr-gdpr

Code Review | WP-HR GDPR: GDPR Tools for Human Resources on WordPress

WordPress plugin WP-HR GDPR: GDPR Tools for Human Resources on WordPress scored 10% from 54 tests.

About plugin

  • Plugin page: wp-hr-gdpr
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 9, 2018
  • Latest release: Feb 28, 2022
  • Number of updates: 19
  • Update frequency: every 73.6 days
  • Top authors: wphrmanager (89.47%)blackandwhitedigital (15.79%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,658 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-hr-gdpr/includes/class-wp-hr-gdrp.php+315
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲4.53MB] [CPU: ▼4.76ms] Passed 4 tests

A check of server-side resources used by WP-HR GDPR: GDPR Tools for Human Resources on WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.51 ▲5.0548.59 ▲9.84
Dashboard /wp-admin8.53 ▲5.2357.28 ▲6.76
Posts /wp-admin/edit.php8.53 ▲5.1858.06 ▲8.34
Add New Post /wp-admin/post-new.php8.53 ▲2.6550.14 ▼43.98
Media Library /wp-admin/upload.php8.53 ▲5.3054.67 ▲20.30
Create Consent form /wp-admin/admin.php?page=wphrgdpr_consent8.5352.37
Privacy Notice /wp-admin/edit.php?post_type=wp_hr_privacy_policy8.5353.32
View Consents /wp-admin/admin.php?page=wphrgdpr_consent_rec8.5348.51
Support /wp-admin/admin.php?page=wphr-gdpr8.5349.69
Create Notice /wp-admin/post-new.php?post_type=wp_hr_privacy_policy8.5347.98
Email Templates /wp-admin/admin.php?page=wphrgdpr_email_template8.5360.42
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.5350.71

Server storage [IO: ▲3.25MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 202 new files
Database: 1 new table, 19 new options
New tables
wp_wphrgdprlite_consent_records
New WordPress options
wphrgdpr_email_templates_label
widget_theysaidso_widget
theysaidso_admin_options
wphrgdpr_email_templates_data
fs_gdpr
fs_accounts
wphrgdpr_consent_quetions
widget_recent-posts
wphr_email_settings_data-protection-form
wphrgdpr_last_update_post
...

Browser metrics Passed 4 tests

WP-HR GDPR: GDPR Tools for Human Resources on WordPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,014 ▲26813.81 ▼0.438.55 ▲6.7229.73 ▼12.76
Dashboard /wp-admin2,276 ▲885.15 ▲0.26115.05 ▼2.5051.18 ▲5.14
Posts /wp-admin/edit.php2,179 ▲902.32 ▲0.2845.31 ▲4.4440.55 ▲4.24
Add New Post /wp-admin/post-new.php1,574 ▲4023.10 ▼0.13650.61 ▼2.9065.69 ▼0.48
Media Library /wp-admin/upload.php1,468 ▲834.35 ▲0.11104.74 ▼0.4343.09 ▲0.18
Create Consent form /wp-admin/admin.php?page=wphrgdpr_consent1,8948.13180.0874.07
Privacy Notice /wp-admin/edit.php?post_type=wp_hr_privacy_policy3,0022.4348.3937.37
View Consents /wp-admin/admin.php?page=wphrgdpr_consent_rec1,0381.9431.4030.03
Support /wp-admin/admin.php?page=wphr-gdpr1,0641.9328.0249.56
Create Notice /wp-admin/post-new.php?post_type=wp_hr_privacy_policy2,6429.43210.6068.67
Email Templates /wp-admin/admin.php?page=wphrgdpr_email_template1,7166.90140.1849.55
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,1351.9529.3028.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_wphrgdprlite_consent_records
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • wphrgdpr_consent_quetions
    • wphrgdpr_last_update_post
    • wphrgdpr_consent_contents
    • widget_recent-posts
    • db_upgraded
    • wphrgdpr_created_posts
    • widget_recent-comments
    • fs_active_plugins
    • wphrgdpr_email_templates_data
    • wphr_email_settings_data-protection-form
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/wp-hr-gdpr/includes/frontend/shortcode-template/privacy-form-template.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-hr-gdpr/includes/admin/custom_tables/wp-hr-training.php on line 3
    • > PHP Notice
      Undefined variable: display_consent_form in wp-content/plugins/wp-hr-gdpr/includes/admin/templates/edit_recruitment.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wp-hr-gdpr/includes/admin/templates/wp-hr-meta-box-field.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-hr-gdpr/includes/admin/custom_tables/wp-hr-request.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-hr-gdpr/includes/admin/templates/wp-hr-consent-form.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-hr-gdpr/includes/admin/custom_tables/wp-hr-training.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-hr-gdpr/includes/admin/templates/dependency_error.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wphr_html_form_input() in wp-content/plugins/wp-hr-gdpr/includes/admin/templates/training-add.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-hr-gdpr/includes/admin/templates/wp-hr-support-template.php:2

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 90% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 21 tag instead of maximum 10
  • Requires at least: Invalid version format
  • Screenshots: Please add descriptions for these screenshots #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in wp-hr-gdpr/assets to your readme.txt
You can look at the official readme.txt

wp-hr-gdpr/wp-hr-gdpr.php Passed 13 tests

This is the main PHP file of "WP-HR GDPR: GDPR Tools for Human Resources on WordPress" version 0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
119 characters long description:
Create a GDPR data protection policy (called the ‘Data Privacy Notice’) and record consents to this from employees.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin35,864 lines of code in 158 files:
LanguageFilesBlank linesComment linesLines of code
PHP1397,64516,59433,964
JavaScript61421771,015
CSS131108885

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity70.62
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes11.69%
Methods1,265
▷ Static methods18314.47%
▷ Public methods92372.96%
▷ Protected methods151.19%
▷ Private methods32725.85%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants125
▷ Global constants10080.00%
▷ Class constants2520.00%
▷ Public constants25100.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
4 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/Barbara-Podium-600px-Trans.png11.81KB10.73KB▼ 9.17%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/wp-hr-gdpr.png29.07KB10.30KB▼ 64.59%