52% hrm

Code Review | WP Human Resource Management

WordPress plugin WP Human Resource Management scored 52% from 54 tests.

About plugin

  • Plugin page: hrm
  • Plugin version: 2.2.17
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2.3
  • WordPress version: 5.8.1
  • First release: Jul 29, 2014
  • Latest release: Mar 7, 2021
  • Number of updates: 224
  • Update frequency: every 10.8 days
  • Top authors: asaquzzaman (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

300+ active / 27,929 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.93MB] [CPU: ▼123.61ms] Passed 4 tests

Server-side resources used by WP Human Resource Management
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.77 ▲3.0550.54 ▲29.63
Dashboard /wp-admin6.03 ▲2.9771.83 ▲26.48
Posts /wp-admin/edit.php6.08 ▲2.9763.32 ▲17.41
Add New Post /wp-admin/post-new.php8.32 ▲2.88108.98 ▼554.76
Media Library /wp-admin/upload.php5.91 ▲2.9146.49 ▲16.42

Server storage [IO: ▲6.25MB] [DB: ▲0.02MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 724 new files
Database: 22 new tables, 15 new options
New tables
wp_hrm_time_shift
wp_hrm_language
wp_hrm_notice
wp_hrm_work_experience
wp_hrm_personal_skill
wp_hrm_location
wp_hrm_designation
wp_hrm_attendance
wp_hrm_pay_grade
wp_hrm_personal_education
...
New WordPress options
hrm_job_title_option
hrm_notice
hrm_pay_grade
hrm_holiday
hrm_work_week
hrm_general_info
hrm_personal_language
hrm_leave_type
hrm_location_option
hrm_personal_skill
...

Browser metrics Passed 4 tests

WP Human Resource Management: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,789 ▲19316.26 ▲0.649.58 ▲0.6548.11 ▲1.96
Dashboard /wp-admin3,056 ▲1255.94 ▼0.02149.11 ▲0.68121.07 ▲13.80
Posts /wp-admin/edit.php2,825 ▲892.71 ▼0.0066.26 ▼4.7290.67 ▲0.85
Add New Post /wp-admin/post-new.php1,668 ▼1521.42 ▲2.66295.08 ▼109.43113.75 ▲3.22
Media Library /wp-admin/upload.php1,893 ▲865.01 ▼0.02156.39 ▲6.00111.36 ▲5.21
Designation /wp-admin/admin.php?page=hr_management#/designation1,5949.01155.8572.66
Employee /wp-admin/admin.php?page=hr_management#/employee1,6039.18182.8584.90
Profile /wp-admin/admin.php?page=hr_management#/employees1,6578.44124.7767.61
Attendance /wp-admin/admin.php?page=hr_management#/attendance1,6359.14142.5097.07
Recruitment /wp-admin/admin.php?page=hr_management#/recruitment1,64511.77355.32104.76
Settings /wp-admin/admin.php?page=hr_management#/settings1,5298.26119.8866.81
Organization /wp-admin/admin.php?page=hr_management#/organization1,6468.30135.7672.84
Dashboard /wp-admin/admin.php?page=hr_management#/dashboard1,6388.37163.92101.89
Payroll /wp-admin/admin.php?page=hr_management#/payroll1,7559.35130.8391.18
Add-Ons /wp-admin/admin.php?page=hr_management#/addons1,5498.01117.9268.82

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
  • Zombie tables detected upon uninstall: 22 tables
    • wp_hrm_designation
    • wp_hrm_financial_year
    • wp_hrm_notice
    • wp_hrm_salary
    • wp_hrm_salary_group
    • wp_hrm_time_shift
    • wp_hrm_personal_language
    • wp_hrm_relation
    • wp_hrm_language
    • wp_hrm_attendance
    • ...
  • This plugin does not fully uninstall, leaving 15 options in the database
    • hrm_location_option
    • hrm_personal_language
    • hrm_admin
    • hrm_personal_skill
    • hrm_general_info
    • hrm_job_title_option
    • hrm_job_category
    • hrm_holiday
    • hrm_notice
    • hrm_work_week
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/hrm/templates/addons/licenses.php
    • > /wp-content/plugins/hrm/vendor/symfony/translation/Resources/bin/translation-status.php
  • 314× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Exception\\ExceptionInterface' not found in wp-content/plugins/hrm/vendor/symfony/translation/Exception/InvalidResourceException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Database\\Eloquent\\Relations\\MorphOneOrMany' not found in wp-content/plugins/hrm/vendor/illuminate/database/Eloquent/Relations/MorphMany.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hrm/vendor/symfony/translation/Tests/Loader/MoFileLoaderTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'HRM\\Core\\Database\\Abstract_Migration' not found in wp-content/plugins/hrm/db/migrations/create_designation_table.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/hrm/vendor/illuminate/support/Facades/App.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hrm/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Database\\Schema\\Grammars\\Grammar' not found in wp-content/plugins/hrm/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hrm/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hrm/vendor/symfony/translation/Tests/MessageSelectorTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Dumper\\DumperInterface' not found in wp-content/plugins/hrm/vendor/symfony/translation/Dumper/FileDumper.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=hr_management#/attendance
    • > Console-api (severe) in unknown
    /wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17 5:10851 TypeError: jQuery(...).datetimepicker is not a functionat r (/wp-content/plugins/hrm/assets/js/hrm.js?ver=2.2.17:1:454240)at inserted (/wp-content/plugins/hrm/assets/js/hrm.js?ver=2.2.17:1:454877)at ir (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:40165)at f (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:39638)at o (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:12643)at Object.i [as insert] (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:12277)at A (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:55896)at hn.__patch__ (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:57251)at hn._update (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:31690)at hn.i (/wp-content/plugins/hrm/assets/vendor/vue/vue.min.js?ver=2.2.17:6:63773)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: Please a description for screenshot #6 in hrm/assets to your readme.txt
The official readme.txt is a good inspiration

hrm/hrm.php Passed 13 tests

The principal PHP file in "WP Human Resource Management" v. 2.2.17 is loaded by WordPress automatically on each request
46 characters long description:
Organization, Industries and Office management

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/hrm/vendor/nesbot/carbon/bin/upgrade-carbon.bat
83,663 lines of code in 656 files:
LanguageFilesBlank linesComment linesLines of code
PHP55111,60327,49843,878
JavaScript296,3604,55127,424
XSD499764,991
CSS12981243,192
JSON17001,266
LESS1694847
PO File8308381660
SVG302660
XML1870362
Markdown41360348
YAML50019
Qt Linguist10010
DOS Batch1004
HTML1001
INI1001

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 157)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.91
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity157.00
Code structure
Namespaces93
Interfaces87
Traits10
Classes356
▷ Abstract classes246.74%
▷ Concrete classes33293.26%
▷ Final classes10.30%
Methods4,145
▷ Static methods55913.49%
▷ Public methods3,42182.53%
▷ Protected methods63715.37%
▷ Private methods872.10%
Functions399
▷ Named functions23759.40%
▷ Anonymous functions16240.60%
Constants84
▷ Global constants1214.29%
▷ Class constants7285.71%
▷ Public constants72100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
assets/css/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
assets/css/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%