Rename to ATT Site Healthcheck (private prefix)
Wholesale rename to avoid clashes with generic 'site healthcheck' plugin names on a target site: - Plugin Name: 'Site Healthcheck' → 'ATT Site Healthcheck' - Main file: site-healthcheck.php → att-site-healthcheck.php - Plugin folder: site-healthcheck → att-site-healthcheck - Admin menu slug: site-healthcheck → att-site-healthcheck - Settings slug: site-healthcheck-settings → att-site-healthcheck-settings - PHP class prefix: WPH_ → ATT_HC_ - Function prefix: wph_ → att_hc_ - Option / transient: wph_* → att_hc_* - Action/filter: wph_* → att_hc_* - CSS class prefix: wph- → att-hc- - Constants: WPH_GITEA_* → ATT_HC_GITEA_* - Class file names: class-wph-*.php → class-att-hc-*.php - Dev folder: ~/dev/wp-healthcheck → ~/dev/att-site-healthcheck Existing in-progress sessions on installs that had the old wph_session option will not migrate — they were intended for dev use only and the user has confirmed this is OK for the rename window. Smoke-tested on testsite: classes load, 14 steps discovered, save/load round-trip works, admin page renders with new att-hc- CSS classes. Recovery plugin detection unchanged — that lives in wp-site-recovery and continues to be detected by Name + Author header.
This commit is contained in:
@@ -6,7 +6,7 @@ if (!defined('ABSPATH')) exit;
|
||||
* Per bead hc-5ix.7: pure Markdown, downloadable. No DB-side report storage
|
||||
* (plugin may be uninstalled at the end of the engagement).
|
||||
*/
|
||||
function wph_build_markdown_report(WPH_Session $session): string {
|
||||
function att_hc_build_markdown_report(ATT_HC_Session $session): string {
|
||||
$tech = get_userdata($session->technician_id());
|
||||
$tech_name = $tech ? $tech->display_name : '#' . $session->technician_id();
|
||||
|
||||
@@ -31,20 +31,20 @@ function wph_build_markdown_report(WPH_Session $session): string {
|
||||
$lines[] = '';
|
||||
$lines[] = '| Step | Status |';
|
||||
$lines[] = '|---|---|';
|
||||
foreach (WPH_Steps::instance()->all() as $step) {
|
||||
foreach (ATT_HC_Steps::instance()->all() as $step) {
|
||||
$state = $session->step_state($step->id());
|
||||
$lines[] = '| ' . $step->title() . ' | ' . wph_status_label($state['status']) . ' |';
|
||||
$lines[] = '| ' . $step->title() . ' | ' . att_hc_status_label($state['status']) . ' |';
|
||||
}
|
||||
$lines[] = '';
|
||||
|
||||
// Per-step detail
|
||||
$lines[] = '## Detail';
|
||||
$lines[] = '';
|
||||
foreach (WPH_Steps::instance()->all() as $step) {
|
||||
foreach (ATT_HC_Steps::instance()->all() as $step) {
|
||||
$state = $session->step_state($step->id());
|
||||
$lines[] = '### ' . $step->title();
|
||||
$lines[] = '';
|
||||
$lines[] = '_Status: ' . wph_status_label($state['status']) . '_';
|
||||
$lines[] = '_Status: ' . att_hc_status_label($state['status']) . '_';
|
||||
if ($state['updated_at']) {
|
||||
$lines[] = '_Saved: ' . date('Y-m-d H:i', $state['updated_at']) . '_';
|
||||
}
|
||||
@@ -80,7 +80,7 @@ function wph_build_markdown_report(WPH_Session $session): string {
|
||||
$lines[] = '- ' . implode(' ', $bits);
|
||||
}
|
||||
}
|
||||
if ($state['status'] === WPH_Session::STATUS_BLOCKED && ($esc = $step->escalation())) {
|
||||
if ($state['status'] === ATT_HC_Session::STATUS_BLOCKED && ($esc = $step->escalation())) {
|
||||
$lines[] = '';
|
||||
$lines[] = '> ⚠ **Escalation:** ' . $esc;
|
||||
}
|
||||
@@ -88,12 +88,12 @@ function wph_build_markdown_report(WPH_Session $session): string {
|
||||
}
|
||||
|
||||
$lines[] = '---';
|
||||
$lines[] = '_Generated by Site Healthcheck plugin v' . WPH_VERSION . '_';
|
||||
$lines[] = '_Generated by Site Healthcheck plugin v' . ATT_HC_VERSION . '_';
|
||||
|
||||
return implode("\n", $lines) . "\n";
|
||||
}
|
||||
|
||||
function wph_build_html_report(WPH_Session $session): string {
|
||||
function att_hc_build_html_report(ATT_HC_Session $session): string {
|
||||
$tech = get_userdata($session->technician_id());
|
||||
$tech_name = $tech ? $tech->display_name : '#' . $session->technician_id();
|
||||
|
||||
@@ -150,7 +150,7 @@ function wph_build_html_report(WPH_Session $session): string {
|
||||
<table>
|
||||
<thead><tr><th>Step</th><th>Status</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach (WPH_Steps::instance()->all() as $step):
|
||||
<?php foreach (ATT_HC_Steps::instance()->all() as $step):
|
||||
$state = $session->step_state($step->id());
|
||||
?>
|
||||
<tr>
|
||||
@@ -162,7 +162,7 @@ function wph_build_html_report(WPH_Session $session): string {
|
||||
</table>
|
||||
|
||||
<h2>Detail</h2>
|
||||
<?php foreach (WPH_Steps::instance()->all() as $step):
|
||||
<?php foreach (ATT_HC_Steps::instance()->all() as $step):
|
||||
$state = $session->step_state($step->id());
|
||||
$auto = $session->get_autocheck($step->id());
|
||||
?>
|
||||
@@ -194,7 +194,7 @@ function wph_build_html_report(WPH_Session $session): string {
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<footer>Generated by Site Healthcheck plugin v<?php echo esc_html(WPH_VERSION); ?> · <?php echo esc_html(date('Y-m-d H:i')); ?></footer>
|
||||
<footer>Generated by Site Healthcheck plugin v<?php echo esc_html(ATT_HC_VERSION); ?> · <?php echo esc_html(date('Y-m-d H:i')); ?></footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -202,13 +202,13 @@ function wph_build_html_report(WPH_Session $session): string {
|
||||
return (string) ob_get_clean();
|
||||
}
|
||||
|
||||
function wph_status_label(string $status): string {
|
||||
function att_hc_status_label(string $status): string {
|
||||
switch ($status) {
|
||||
case WPH_Session::STATUS_DONE: return '✅ Done';
|
||||
case WPH_Session::STATUS_SKIPPED: return '⏭ Skipped';
|
||||
case WPH_Session::STATUS_BLOCKED: return '🛑 Blocked';
|
||||
case WPH_Session::STATUS_NA: return '— N/A';
|
||||
case WPH_Session::STATUS_NOT_STARTED:
|
||||
case ATT_HC_Session::STATUS_DONE: return '✅ Done';
|
||||
case ATT_HC_Session::STATUS_SKIPPED: return '⏭ Skipped';
|
||||
case ATT_HC_Session::STATUS_BLOCKED: return '🛑 Blocked';
|
||||
case ATT_HC_Session::STATUS_NA: return '— N/A';
|
||||
case ATT_HC_Session::STATUS_NOT_STARTED:
|
||||
default: return '◻ Not started';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user