78% navthemes-employee-ratings

Code Review | NavThemes Employee Ratings

WordPress plugin NavThemes Employee Ratings scored78%from 54 tests.

About plugin

  • Plugin page: navthemes-employe...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 20, 2018
  • Latest release: Mar 18, 2019
  • Number of updates: 8
  • Update frequency: every 15.1 days
  • Top authors: navthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /575 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.94MB] [CPU: ▼2.04ms] Passed 4 tests

A check of server-side resources used by NavThemes Employee Ratings
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.46 ▲0.9642.77 ▼2.00
Dashboard /wp-admin4.35 ▲1.0456.22 ▲7.55
Posts /wp-admin/edit.php4.45 ▲0.6042.52 ▼12.71
Add New Post /wp-admin/post-new.php7.13 ▲1.2499.23 ▲4.18
Media Library /wp-admin/upload.php4.39 ▲1.1643.80 ▲2.38
Add New /wp-admin/post-new.php?post_type=timesheet-project4.5052.34
Timesheet Project /wp-admin/edit.php?post_type=timesheet-project4.2841.34
Employee Ratings /wp-admin/edit.php?post_type=employee-ratings4.2839.76
Reports /wp-admin/edit.php?post_type=employee-ratings&page=rating-view4.2130.81
Time Sheet Reports /wp-admin/edit.php?post_type=employee-ratings&page=timesheet-view4.1836.27
Add New /wp-admin/post-new.php?post_type=employee-ratings4.5647.60

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 228 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
acf_version
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

NavThemes Employee Ratings: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲12913.29 ▼0.924.72 ▲3.0042.48 ▼8.82
Dashboard /wp-admin2,270 ▲825.85 ▼0.19137.21 ▲29.7761.17 ▲20.84
Posts /wp-admin/edit.php2,153 ▲612.02 ▲0.0433.72 ▼2.4333.02 ▲0.05
Add New Post /wp-admin/post-new.php6,713 ▲5,19428.03 ▲5.271,124.17 ▲469.3444.28 ▼15.34
Media Library /wp-admin/upload.php1,994 ▲6098.16 ▲3.73220.23 ▲93.3054.43 ▲0.16
Add New /wp-admin/post-new.php?post_type=timesheet-project2,1788.37159.3033.66
Timesheet Project /wp-admin/edit.php?post_type=timesheet-project1,1201.9637.5632.67
Employee Ratings /wp-admin/edit.php?post_type=employee-ratings1,1221.9539.4238.90
Reports /wp-admin/edit.php?post_type=employee-ratings&page=rating-view8622.0324.9530.69
Time Sheet Reports /wp-admin/edit.php?post_type=employee-ratings&page=timesheet-view8282.0229.4731.42
Add New /wp-admin/post-new.php?post_type=employee-ratings2,7238.17173.5839.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • acf_version

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit.php?post_type=employee-ratings&page=timesheet-view
    • > Warning in wp-content/plugins/navthemes-employee-ratings/navthemes-employee-ratings.php+195
    include(page-viewtimesheet.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/edit.php?post_type=employee-ratings&page=timesheet-view
    • > Warning in wp-content/plugins/navthemes-employee-ratings/navthemes-employee-ratings.php+195
    include(): Failed opening 'page-viewtimesheet.php' for inclusion (include_path='.:/usr/share/php')

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 70× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/navthemes-employee-ratings/admin/includes/fields/class-acf-field-date_time_picker.php:5
    • > PHP Notice
      Undefined variable: group_id in wp-content/plugins/navthemes-employee-ratings/admin/includes/admin/views/html-location-group.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/navthemes-employee-ratings/admin/includes/fields/class-acf-field-number.php:5
    • > PHP Notice
      Undefined variable: group_id in wp-content/plugins/navthemes-employee-ratings/admin/includes/admin/views/html-location-group.php on line 3
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/navthemes-employee-ratings/admin/includes/admin/views/field-group-field.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/navthemes-employee-ratings/admin/includes/admin/views/field-group-fields.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/navthemes-employee-ratings/admin/includes/fields/class-acf-field-oembed.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_form_head() in wp-content/plugins/navthemes-employee-ratings/page-viewrating.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_get_location_rule_types() in wp-content/plugins/navthemes-employee-ratings/admin/includes/admin/views/html-location-rule.php:12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/navthemes-employee-ratings/admin/includes/admin/views/html-location-rule.php on line 4

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 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

navthemes-employee-ratings/navthemes-employee-ratings.php 85% from 13 tests

The main file in "NavThemes Employee Ratings" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: The description should be shorter than 140 characters (currently 182 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin83,222 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PO File2820,80033,63943,399
JavaScript136,7516,79122,236
PHP12612,79916,97015,773
CSS12210601,660
JSON100124
SVG118030

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.43
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes102
▷ Abstract classes00.00%
▷ Concrete classes102100.00%
▷ Final classes00.00%
Methods661
▷ Static methods00.00%
▷ Public methods661100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions387
▷ Named functions387100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
7 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/inc/datepicker/images/ui-bg_highlight-soft_0_ffffff_1x100.png0.08KB0.08KB0.00%
admin/assets/inc/select2/3/select2x2.png0.64KB0.77KB0.00%
admin/assets/images/acf-logo.png3.40KB3.39KB0.23%
admin/assets/inc/datepicker/images/ui-icons_444444_256x240.png3.68KB4.17KB0.00%
admin/assets/inc/select2/3/select2.png0.51KB0.99KB0.00%