74% support-hours

Code Review | Support Hours

WordPress plugin Support Hours scored74%from 54 tests.

About plugin

  • Plugin page: support-hours
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.0
  • WordPress version: 6.3.1
  • First release: Sep 25, 2016
  • Latest release: Mar 30, 2023
  • Number of updates: 43
  • Update frequency: every 55.3 days
  • Top authors: Levdbas (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /3,712 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.53ms] Passed 4 tests

A check of server-side resources used by Support Hours
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.48 ▼2.19
Dashboard /wp-admin3.33 ▼0.0242.79 ▼16.22
Posts /wp-admin/edit.php3.38 ▲0.0243.99 ▼0.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0278.86 ▼10.00
Media Library /wp-admin/upload.php3.25 ▲0.0232.72 ▼1.71
Settings /wp-admin/admin.php?page=support-hours-settings3.2833.48
Overview /wp-admin/admin.php?page=support-hours3.2728.21

Server storage [IO: ▲0.10MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Support Hours: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲9014.35 ▼0.371.56 ▼0.3736.50 ▼9.39
Dashboard /wp-admin2,270 ▲1025.67 ▼0.0181.51 ▼26.9842.50 ▼6.23
Posts /wp-admin/edit.php2,127 ▲272.02 ▲0.0033.73 ▼1.4233.80 ▼2.49
Add New Post /wp-admin/post-new.php1,557 ▲3118.07 ▼5.09610.00 ▼55.2959.26 ▼10.22
Media Library /wp-admin/upload.php1,427 ▲244.15 ▼0.12100.55 ▲0.3043.65 ▼2.76
Settings /wp-admin/admin.php?page=support-hours-settings1,0091.7024.5623.92
Overview /wp-admin/admin.php?page=support-hours8041.6924.4823.81

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/support-hours/admin/class-support-hours-admin.php+194
    Undefined index: email
  • The uninstall procedure has failed, leaving 7 options in the database
    • support-hours
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Support_Hours\\Support_Hours' not found in wp-content/plugins/support-hours/admin/views/support-hours-admin-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Support_Hours\\__() in wp-content/plugins/support-hours/admin/views/common/notice-configure.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/support-hours/admin/views/settings/work-table-fields.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Support_Hours\\Support_Hours_Data' not found in wp-content/plugins/support-hours/admin/views/widget/widget-clock.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Support_Hours\\Support_Hours_Data' not found in wp-content/plugins/support-hours/admin/views/support-hours-admin-widget.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Support_Hours\\__() in wp-content/plugins/support-hours/admin/views/common/notice-no-hours.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Support_Hours\\Support_Hours_Data' not found in wp-content/plugins/support-hours/admin/views/widget/worktable.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Support_Hours\\esc_html() in wp-content/plugins/support-hours/admin/views/settings/work-table-form.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Support_Hours\\Support_Hours_Data' not found in wp-content/plugins/support-hours/admin/views/support-hours-admin-overview.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Support_Hours\\get_users() in wp-content/plugins/support-hours/admin/views/settings/general-settings-form.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === support-hours === )
You can take inspiration from this readme.txt

support-hours/support-hours.php Passed 13 tests

This is the main PHP file of "Support Hours" version 2.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
92 characters long description:
Use Support hours to give yourself and your clients insights on the status of pre-paid work.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected912 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP21224719814
PO File17718996
CSS1001
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.12
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods41
▷ Static methods1126.83%
▷ Public methods3380.49%
▷ Protected methods00.00%
▷ Private methods819.51%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.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
PNG images were not found in this plugin