-
Notifications
You must be signed in to change notification settings - Fork 6
more cs fix changes #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Style-focused refactor across the maint plugin PHP files to improve readability/consistency (brace placement, indentation, and comment formatting), while keeping behavior intended to remain the same.
Changes:
- Reformat PHP functions/blocks for consistent brace placement and indentation.
- Convert/standardize comments and string quoting in several UI/controller sections.
- Minor markup adjustments within action confirmation/filters.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| setup.php | Reformats plugin hooks/DB setup code to consistent modern PHP style. |
| maint.php | Large-scale formatting changes across schedule CRUD/actions and tab UIs; includes updated markup strings. |
| functions.php | Reformats maintenance-check helper functions for consistency/readability. |
|
|
||
| $list .= '<li><b>' . html_escape($description) . '</b></li>'; | ||
| $array[] = $matches[1]; | ||
| } | ||
| } | ||
| $list .= '<li><b>' . html_escape($description) . '</b></li>'; | ||
| $array[] = $matches[1]; |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "$save_html" string for the WebSeer empty-selection case has malformed HTML: there is a stray ">" before the onClick attribute ("class='...'> onClick=..."). This makes the onclick handler an orphaned text node and the button won’t work as intended.
| FROM plugin_servcheck_test | ||
| WHERE id = ?', |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Servcheck disassociate confirmation, the submit control is rendered as but then concatenated with inner text and closed with . This is invalid HTML and likely breaks the Continue button. Use either a Continue or an without a closing tag.
| $sql_statement = "SELECT ht.id, ht.name | ||
| FROM host_template AS ht |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The element has an extra trailing quote in the id attribute (id='rows''). This is invalid HTML and can break jQuery selectors like $('#rows'). Remove the stray quote.
| if ($schedule_created) { | ||
| print "<tr><td colspan='8'><em>" . __('No Associated Devices Found', 'maint') . '</em></td></tr>'; |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The element has an extra trailing quote in the id attribute (id='rows''). This is invalid HTML and can break jQuery selectors like $('#rows'). Remove the stray quote.
| '%' . get_request_var('filter') . '%', | ||
| '%' . get_request_var('filter') . '%', | ||
| ]; |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table header includes a "Path" column, but the row rendering outputs hostname twice. This results in the Path column showing the wrong data. Render $test['path'] (or the correct path field) for the Path column instead of repeating hostname.
| /** | ||
| * Install the maintenance plugin | ||
| * | ||
| * Registers all hooks, realms, and creates database tables. |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The realm name "Maintenance Schedules" is user-facing but is not wrapped in a translation function. For consistency with other plugin UI strings (e.g., setup.php:62), wrap it with __('Maintenance Schedules', 'maint') so it can be localized.
| ), | ||
| ) | ||
| . '</b></li>'; |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated "$save_html" Return button markup is missing the closing ">" for the tag, which results in invalid HTML and can break the action confirmation UI. Close the button tag properly.
| * - Filter by search term | ||
| * - Toggle between associated/all tests |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The element has an extra trailing quote in the id attribute (id='rows''). This is invalid HTML and can break jQuery selectors like $('#rows'). Remove the stray quote.
| form_end(); | ||
| } |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section uses __esc('Set/Refresh Filters') / __('Go') without the plugin text domain, while other UI strings in this file consistently pass 'maint' (e.g., maint.php:1246 and maint.php:1888). This can lead to missing translations for these labels; pass the 'maint' domain consistently.
this sould fix it !!
This pull request primarily refactors the code in
maint.phpandfunctions.phpto improve code readability and maintainability. The main changes involve converting block comments to line comments, reformatting code for consistency, and updating the style to modern PHP conventions (such as moving opening braces to the same line as function declarations). No functional logic was changed.The most important changes include:
Code style and readability improvements:
maint.phpandfunctions.phpfor better readability and consistency. [1] [2] [3] [4] [5]Function declaration updates:
maint.phpandfunctions.php. [1] [2] [3] [4] [5] [6] [7]Minor string and array improvements:
UI and messaging consistency:
No logic changes: