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:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'before'; }
|
||||
public function title(): string { return 'Before You Start'; }
|
||||
public function blurb(): string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'backup'; }
|
||||
public function title(): string { return 'Step 1 — Take a Full Backup'; }
|
||||
public function blurb(): string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'uptime'; }
|
||||
public function title(): string { return 'Step 10 — Uptime and Availability'; }
|
||||
public function sub_items(): array {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'small_fixes'; }
|
||||
public function title(): string { return 'Step 11 — Small Fixes'; }
|
||||
public function blurb(): string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
|
||||
public function id(): string { return 'email_test'; }
|
||||
public function title(): string { return 'Step — Email Delivery Test'; }
|
||||
@@ -61,10 +61,10 @@ return new class extends WPH_Step {
|
||||
$default_to = $current && $current->user_email ? $current->user_email : get_option('admin_email');
|
||||
$debug_data = $session_state['email_debug'] ?? null;
|
||||
?>
|
||||
<div class="wph-card" style="background:#fafafb;border-radius:6px;padding:.75rem 1rem;margin-top:.6rem">
|
||||
<div class="att-hc-card" style="background:#fafafb;border-radius:6px;padding:.75rem 1rem;margin-top:.6rem">
|
||||
<form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
|
||||
<?php wp_nonce_field('wph_step_action_email_test_send_test'); ?>
|
||||
<input type="hidden" name="action" value="wph_step_action">
|
||||
<?php wp_nonce_field('att_hc_step_action_email_test_send_test'); ?>
|
||||
<input type="hidden" name="action" value="att_hc_step_action">
|
||||
<input type="hidden" name="step" value="email_test">
|
||||
<input type="hidden" name="step_action" value="send_test">
|
||||
<p style="margin:.2rem 0 .5rem"><strong>Send test email</strong></p>
|
||||
@@ -148,7 +148,7 @@ return new class extends WPH_Step {
|
||||
// Stash the debug trace on the session so the UI can render it as a
|
||||
// collapsible block. Returning it inside the finding's detail would
|
||||
// mangle the formatting.
|
||||
$session = WPH_Session::current();
|
||||
$session = ATT_HC_Session::current();
|
||||
if ($session && $debug_requested) {
|
||||
$trace = array_slice($trace, 0, 200); // cap to avoid bloating the option
|
||||
$data = $session->data();
|
||||
@@ -157,7 +157,7 @@ return new class extends WPH_Step {
|
||||
'transport' => $transport,
|
||||
'trace' => $trace,
|
||||
];
|
||||
update_option(WPH_OPT_SESSION, $data, false);
|
||||
update_option(ATT_HC_OPT_SESSION, $data, false);
|
||||
|
||||
// Append the trace to the step's notes so the technician can edit
|
||||
// it and so it lands in the downloadable report (notes are
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'wrap_up'; }
|
||||
public function title(): string { return 'Step 12 — Wrap Up and Document'; }
|
||||
public function sub_items(): array {
|
||||
@@ -19,7 +19,7 @@ return new class extends WPH_Step {
|
||||
$bad = [];
|
||||
$warn = [];
|
||||
$blocked = [];
|
||||
foreach (WPH_Steps::instance()->all() as $sid => $s) {
|
||||
foreach (ATT_HC_Steps::instance()->all() as $sid => $s) {
|
||||
if ($sid === 'wrap_up') continue;
|
||||
// Pull stored autocheck results from session data (we get session_state passed in).
|
||||
$stored = $session_state['autocheck'][$sid] ?? null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'environment'; }
|
||||
public function title(): string { return 'Step 2 — Environment Check'; }
|
||||
public function blurb(): string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'core'; }
|
||||
public function title(): string { return 'Step 3 — WordPress Core Update'; }
|
||||
public function sub_items(): array {
|
||||
@@ -126,16 +126,16 @@ return new class extends WPH_Step {
|
||||
|
||||
/** Direct call to wp.org's version-check endpoint. Cached 1h via transient. */
|
||||
private function wp_org_core_version(): ?string {
|
||||
$cached = get_transient('wph_wp_org_core_latest');
|
||||
$cached = get_transient('att_hc_wp_org_core_latest');
|
||||
if ($cached !== false) return $cached === '' ? null : (string) $cached;
|
||||
$resp = wp_remote_get('https://api.wordpress.org/core/version-check/1.7/', ['timeout' => 5]);
|
||||
if (is_wp_error($resp) || (int) wp_remote_retrieve_response_code($resp) !== 200) {
|
||||
set_transient('wph_wp_org_core_latest', '', 5 * MINUTE_IN_SECONDS);
|
||||
set_transient('att_hc_wp_org_core_latest', '', 5 * MINUTE_IN_SECONDS);
|
||||
return null;
|
||||
}
|
||||
$data = json_decode((string) wp_remote_retrieve_body($resp), true);
|
||||
$latest = isset($data['offers'][0]['version']) ? (string) $data['offers'][0]['version'] : null;
|
||||
set_transient('wph_wp_org_core_latest', $latest ?: '', HOUR_IN_SECONDS);
|
||||
set_transient('att_hc_wp_org_core_latest', $latest ?: '', HOUR_IN_SECONDS);
|
||||
return $latest;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'plugins'; }
|
||||
public function title(): string { return 'Step 4 — Plugin Updates'; }
|
||||
public function sub_items(): array {
|
||||
@@ -148,7 +148,7 @@ return new class extends WPH_Step {
|
||||
private function wp_org_info(string $slug) {
|
||||
// v2: cache now includes 'version' field for cloak detection — fresh prefix
|
||||
// so existing cached entries get re-fetched on the next refresh.
|
||||
$cache_key = 'wph_pi2_' . md5($slug);
|
||||
$cache_key = 'att_hc_pi2_' . md5($slug);
|
||||
$cached = get_transient($cache_key);
|
||||
if ($cached !== false) return $cached;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'theme'; }
|
||||
public function title(): string { return 'Step 5 — Theme Updates'; }
|
||||
public function sub_items(): array {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'visual'; }
|
||||
public function title(): string { return 'Step 6 — Visual and Functional Check'; }
|
||||
public function blurb(): string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'performance'; }
|
||||
public function title(): string { return 'Step 7 — Performance Check'; }
|
||||
public function sub_items(): array {
|
||||
@@ -100,7 +100,7 @@ return new class extends WPH_Step {
|
||||
}
|
||||
|
||||
private function psi(string $url, string $strategy): ?array {
|
||||
$cache_key = 'wph_psi_' . md5($url . '|' . $strategy);
|
||||
$cache_key = 'att_hc_psi_' . md5($url . '|' . $strategy);
|
||||
$cached = get_transient($cache_key);
|
||||
if ($cached !== false) return $cached;
|
||||
$api = add_query_arg([
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'security'; }
|
||||
public function title(): string { return 'Step 8 — Security Check'; }
|
||||
public function sub_items(): array {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
return new class extends WPH_Step {
|
||||
return new class extends ATT_HC_Step {
|
||||
public function id(): string { return 'database'; }
|
||||
public function title(): string { return 'Step 9 — Database'; }
|
||||
public function sub_items(): array {
|
||||
|
||||
Reference in New Issue
Block a user