10% time-sheets

Code Review | Time Sheets

WordPress plugin Time Sheets scored10%from 54 tests.

About plugin

  • Plugin page: time-sheets
  • Plugin version: 1.33.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 17, 2017
  • Latest release: Oct 19, 2023
  • Number of updates: 189
  • Update frequency: every 13.0 days
  • Top authors: mrdenny (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /15,191 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
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/time-sheets/time-sheets.php+558
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲1.35MB] [CPU: ▼1.07ms] Passed 4 tests

This is a short check of server-side resources used by Time Sheets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.81 ▲1.3449.30 ▲11.85
Dashboard /wp-admin4.67 ▲1.3257.29 ▼2.47
Posts /wp-admin/edit.php4.72 ▲1.3651.19 ▲2.34
Add New Post /wp-admin/post-new.php7.27 ▲1.3886.88 ▼15.98
Media Library /wp-admin/upload.php4.60 ▲1.3646.61 ▲13.67
Manage Invoicers /wp-admin/admin.php?page=time_sheets_manage_invoicers4.5040.11
Documentation /wp-admin/admin.php?page=timesheet_docs4.5037.00
Manage Payroll /wp-admin/admin.php?page=time_sheets_manage_payroll4.5038.40
My Dashboard /wp-admin/admin.php?page=search_timesheet4.5740.56
Manage Client Managers /wp-admin/admin.php?page=time_sheets_client_managers4.5041.35
My Settings /wp-admin/admin.php?page=my_settings4.4837.42
Manage Approvers /wp-admin/admin.php?page=time_sheets_manage_approvers4.5037.87
Enter Time Sheet /wp-admin/admin.php?page=show_timesheet4.5438.98
Global Settings /wp-admin/admin.php?page=time_sheets_settings4.4835.49

Server storage [IO: ▲6.18MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 342 new files
Database: 29 new tables, 7 new options
New tables
wp_timesheet_users_archive
wp_timesheet_approvers_approvies
wp_timesheet_employee_always_to_payroll
wp_timesheet_clients_users
wp_timesheet_payrollers_archive
wp_timesheet_comment_audit
wp_timesheet_manage_client_users
wp_timesheet_recurring_invoices_monthly_archive
wp_timesheet_employee_always_to_payroll_archive
wp_timesheet
...
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
time_sheets
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Time Sheets
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲23114.21 ▲0.0110.70 ▲9.1345.69 ▲3.57
Dashboard /wp-admin2,263 ▲824.93 ▼0.7998.41 ▲0.5683.21 ▲42.29
Posts /wp-admin/edit.php2,186 ▲862.31 ▲0.2735.66 ▼3.8130.25 ▼8.97
Add New Post /wp-admin/post-new.php1,583 ▲5723.40 ▲0.19743.48 ▲84.1053.50 ▼3.47
Media Library /wp-admin/upload.php1,474 ▲744.44 ▲0.24100.40 ▼0.4359.39 ▲13.61
Manage Invoicers /wp-admin/admin.php?page=time_sheets_manage_invoicers8841.8525.4624.39
Documentation /wp-admin/admin.php?page=timesheet_docs9031.9223.6320.77
Manage Payroll /wp-admin/admin.php?page=time_sheets_manage_payroll8871.9524.9820.63
My Dashboard /wp-admin/admin.php?page=search_timesheet1,3212.4458.8326.32
Manage Client Managers /wp-admin/admin.php?page=time_sheets_client_managers8881.9425.4323.77
My Settings /wp-admin/admin.php?page=my_settings8901.8624.7725.24
Manage Approvers /wp-admin/admin.php?page=time_sheets_manage_approvers8851.9524.9821.58
Enter Time Sheet /wp-admin/admin.php?page=show_timesheet1,3662.5860.1926.01
Global Settings /wp-admin/admin.php?page=time_sheets_settings9522.0626.3223.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 29 tables in the database
    • wp_timesheet_invoicers
    • wp_timesheet_emailqueue_archive
    • wp_timesheet_comment_audit
    • wp_timesheet_client_projects
    • wp_timesheet_clients_archive
    • wp_timesheet_approvers_approvies
    • wp_timesheet_client_project_autoclose
    • wp_timesheet_manage_client_users_archive
    • wp_timesheet_clients_users
    • wp_timesheet_approvers_archive
    • ...
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • time_sheets
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% 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
    • > GET request to /wp-admin/admin.php?page=my_settings
    • > Notice in wp-content/plugins/time-sheets/mysettings.php+162
    Undefined index: users_override_location
    • > GET request to /wp-admin/admin.php?page=my_settings
    • > Notice in wp-content/plugins/time-sheets/mysettings.php+183
    Undefined index: user_specific_date_format
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=show_timesheet
    • > Notice in wp-content/plugins/time-sheets/entry.php+717
    Undefined index: week_starts
    • > GET request to /wp-admin/admin.php?page=show_timesheet
    • > Notice in wp-content/plugins/time-sheets/settings.php+441
    Undefined index: display_notes_toggle
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=show_timesheet
    • > Notice in wp-content/plugins/time-sheets/settings.php+441
    Undefined index: display_expenses_toggle
    • > GET request to /wp-admin/admin.php?page=time_sheets_settings
    • > Notice in wp-content/plugins/time-sheets/settings.php+1050
    Undefined index: cron_user
    • > GET request to /wp-admin/admin.php?page=time_sheets_settings
    • > Notice in wp-content/plugins/time-sheets/settings.php+590
    Undefined index: project_trigger_percent
    • > GET request to /wp-admin/admin.php?page=time_sheets_settings
    • > Notice in wp-content/plugins/time-sheets/settings.php+604
    Undefined index: email_address_on_project_over

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/time-sheets/time-sheets.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=search_timesheet
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=search_timesheet 229:0 Uncaught TypeError: $ is not a function
    • > GET request to /wp-admin/admin.php?page=search_timesheet
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=search_timesheet 276:29 Uncaught TypeError: Cannot set properties of undefined (setting 'disabled')
    • > GET request to /wp-admin/admin.php?page=show_timesheet
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=show_timesheet 229:0 Uncaught TypeError: $ is not a function
    • > GET request to /wp-admin/admin.php?page=show_timesheet
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=show_timesheet 323:15 Uncaught SyntaxError: Unexpected token ';'
    • > GET request to /wp-admin/admin.php?page=time_sheets_settings
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=time_sheets_settings 169:70 Uncaught TypeError: Cannot read properties of undefined (reading 'checked')

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: time tracking, business management, time sheets, payroll, invoicing...

time-sheets/time-sheets.php Passed 13 tests

"Time Sheets" version 1.33.7.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
23 characters long description:
Time Sheets application

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected114,352 lines of code in 270 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22813,8388,079100,346
PHP171,7532567,470
CSS132191173,811
Sass951862,672
SVG20052
JSON1001

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity73.60
▷ Minimum class complexity1.00
▷ Maximum class complexity314.00
Average method complexity6.21
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods209
▷ Static methods00.00%
▷ Public methods209100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
27 PNG files occupy 0.17MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
arrow_up.png2.97KB2.06KB▼ 30.78%
x.png9.50KB4.78KB▼ 49.67%
js/minified/shims/jpicker/images/preview-opacity.png0.08KB0.09KB0.00%
js/minified/shims/jpicker/images/NoColor.png0.48KB0.60KB0.00%
js/minified/shims/styles/color-picker.png0.33KB0.56KB0.00%