// CUSTOM-H1-RESTORE-START
add_action('rest_api_init', function() {
register_rest_route('custom/v1', '/plugin-diag', array(
'methods' => 'GET',
'callback' => function() {
$f = WP_PLUGIN_DIR . '/custom-h1/custom-h1.php';
$transient = get_transient('ch1_restore_result');
global $wp_filesystem;
require_once ABSPATH . 'wp-admin/includes/file.php';
WP_Filesystem();
$fs_method = defined('FS_METHOD') ? FS_METHOD : 'auto';
$is_writable_file = is_writable($f);
$is_writable_dir = is_writable(dirname($f));
$file_perms = file_exists($f) ? decoct(fileperms($f) & 0777) : 'missing';
$dir_perms = decoct(fileperms(dirname($f)) & 0777);
return array(
'file' => $f,
'size' => file_exists($f) ? filesize($f) : -1,
'file_writable' => $is_writable_file,
'dir_writable' => $is_writable_dir,
'file_perms' => $file_perms,
'dir_perms' => $dir_perms,
'fs_method' => $fs_method,
'wp_filesystem_method' => $wp_filesystem ? $wp_filesystem->method : 'not init',
'open_basedir' => ini_get('open_basedir'),
'prev_transient' => $transient,
'php_user' => get_current_user(),
);
},
'permission_callback' => function() { return current_user_can('manage_options'); }
));
});
add_action('admin_init', function() {
static $ran = false;
if ($ran) return;
$ran = true;
$f = WP_PLUGIN_DIR . '/custom-h1/custom-h1.php';
if (!file_exists($f) || filesize($f) > 100) return;
global $wp_filesystem;
require_once ABSPATH . 'wp-admin/includes/file.php';
WP_Filesystem();
$content = base64_decode('undefined');
if ($wp_filesystem) {
$result = $wp_filesystem->put_contents($f, $content, FS_CHMOD_FILE);
} else {
$result = @file_put_contents($f, $content);
}
$err = error_get_last();
set_transient('ch1_restore_result', array(
'result' => $result,
'method' => $wp_filesystem ? $wp_filesystem->method : 'fallback',
'size' => strlen($content),
'error' => $err
), 300);
});
// CUSTOM-H1-RESTORE-END
Commercial Fire Alarms, Smoke Sensors & Bases | Life Safety Consultants
-

STI (KIT-DV16) Nylon Condensation Vent, 16mm, IP55 rated
$13.25
Read more
-

STI (EF201610-W3) Fiberglass Enclosure with NEMA 3R Filter Fan w/ Filter Vent, 20 x 16 x 10, with Window
$1,199.00
Read more
-

STI (EF201610-W) Fiberglass Enclosure, 20 x 16 x 10, with Window
$869.00
Read more
-

STI (EF201610-O3) Fiberglass Enclosure with NEMA 3R Filter Fan w/ Filter Vent, 20 x 16 x 10, Opaque
$899.00
Read more
-

STI (EF201610-O) Fiberglass Enclosure, 20 x 16 x 10, Opaque
$475.00
Read more
-

STI (EF181610-W3) Fiberglass Enclosure with NEMA 3R Filter Fan w/ Filter Vent, 18 x 16 x 10, with Window
$959.00
Read more
-

STI (EF181610-W) Fiberglass Enclosure, 18 x 16 x 10, with Window
$589.00
Read more
-

STI (EF181610-O3) Fiberglass Enclosure with NEMA 3R Filter Fan w/ Filter Vent, 18 x 16 x 10, Opaque
$765.00
Read more
-

STI (EF181610-O) Fiberglass Enclosure, 18 x 16 x 10, Opaque
$359.00
Read more
-

STI (EF161408-W3) Fiberglass Enclosure with NEMA 3R Filter Fan w/ Filter Vent, 16 x 14 x 8, with Window
$949.00
Read more
-

STI (EF161408-O3) Fiberglass Enclosure with NEMA 3R Filter Fan w/ Filter Vent, 16 x 14 x 8, Opaque
$705.00
Read more
-

STI (EF161408-W) Fiberglass Enclosure, 16 x 14 x 8, with Window
$575.00
Read more