68% work-time-allocator

Code Review | Work Time Allocator

WordPress plugin Work Time Allocator scored68%from 54 tests.

About plugin

  • Plugin page: work-time-allocator
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Jan 7, 2021
  • Latest release: Jan 7, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: marsagnostics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /320 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.13MB] [CPU: ▲1.34ms] Passed 4 tests

This is a short check of server-side resources used by Work Time Allocator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.64 ▲1.1843.93 ▲5.42
Dashboard /wp-admin4.37 ▲1.0751.35 ▲1.19
Posts /wp-admin/edit.php4.49 ▲1.1349.84 ▲0.57
Add New Post /wp-admin/post-new.php7.26 ▲1.3894.81 ▼1.83
Media Library /wp-admin/upload.php4.38 ▲1.1551.22 ▲18.61
Occupations /wp-admin/edit.php?post_type=occupations4.3439.17
Clients /wp-admin/edit.php?post_type=clients4.3437.62
Options /wp-admin/admin.php?page=mwta_options_admin_page4.2634.99
Jobs /wp-admin/edit.php?post_type=jobs4.3436.42
Info /wp-admin/admin.php?page=mwta_dashboard_admin_page4.2634.14
Employees /wp-admin/edit.php?post_type=employees4.3436.45

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 374 new files
Database: 1 new table, 7 new options
New tables
wp_allocation
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
acf_version
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Work Time Allocator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲20714.14 ▼0.2610.62 ▲8.7542.79 ▼2.00
Dashboard /wp-admin2,247 ▲625.82 ▼0.03104.81 ▼9.2941.52 ▼3.52
Posts /wp-admin/edit.php2,164 ▲752.07 ▲0.0437.08 ▼1.7534.68 ▼1.15
Add New Post /wp-admin/post-new.php11,334 ▲9,82026.96 ▲9.331,218.80 ▲548.7540.75 ▼16.54
Media Library /wp-admin/upload.php1,981 ▲5938.31 ▲4.12210.34 ▲106.3949.12 ▲2.55
Occupations /wp-admin/edit.php?post_type=occupations1,0861.9759.6641.65
Clients /wp-admin/edit.php?post_type=clients1,0912.0031.5429.83
Options /wp-admin/admin.php?page=mwta_options_admin_page8442.0924.9427.37
Jobs /wp-admin/edit.php?post_type=jobs1,0992.0132.4229.56
Info /wp-admin/admin.php?page=mwta_dashboard_admin_page8212.0725.4925.62
Employees /wp-admin/edit.php?post_type=employees1,0911.9933.0129.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/work-time-allocator/includes/roles-caps.php+22
    Only variables should be assigned by reference
  • The uninstall procedure has failed, leaving 7 options in the database
    • acf_version
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/work-time-allocator/fpdf/tutorial/tuto1.php
  • 88× 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/work-time-allocator/lib/advanced-custom-fields/includes/fields/class-acf-field-wysiwyg.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/admin/views/html-location-rule.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/fields/class-acf-field-true_false.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/fields/class-acf-field-checkbox.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/api/api-helpers.php:93
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/work-time-allocator/cpt/occupations-acf.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_register_store() in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/acf-form-functions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_render_field_wrap() in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/admin/views/field-group-options.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/fields/class-acf-field-select.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_register_store() in wp-content/plugins/work-time-allocator/lib/advanced-custom-fields/includes/acf-helper-functions.php:142

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Timetracker), #2 (Clients), #3 (Employees), #4 (Jobs), #5 (Occupations), #6 (Options)
The official readme.txt might help

work-time-allocator/work-time-allocator.php Passed 13 tests

The main PHP script in "Work Time Allocator" version 1.0 is automatically included on every request by WordPress
60 characters long description:
Allocates working times to client jobs and generates reports

Code Analysis Passed 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
No dangerous file extensions were detected97,035 lines of code in 295 files:
LanguageFilesBlank linesComment linesLines of code
PO File3123,63339,88649,083
JavaScript176,7476,69122,619
PHP17510,13817,82120,441
HTML597203,240
CSS12208601,638
Markdown111014

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity16.06
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity3.01
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes109
▷ Abstract classes21.83%
▷ Concrete classes10798.17%
▷ Final classes00.00%
Methods817
▷ Static methods10.12%
▷ Public methods77895.23%
▷ Protected methods384.65%
▷ Private methods10.12%
Functions483
▷ Named functions483100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
14 PNG files occupy 0.23MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/advanced-custom-fields/assets/inc/select2/3/select2x2.png0.64KB0.77KB0.00%
assets/screenshot-6.png42.08KB11.79KB▼ 71.99%
assets/screenshot-1.png44.39KB11.48KB▼ 74.14%
fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%
assets/screenshot-4.png49.59KB14.37KB▼ 71.03%