From a24a06002081ad71a78ffeff9072725ba39cf121 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 17 Feb 2026 20:05:31 +0000
Subject: [PATCH] =minor changes, particularly around the JVB_CHILD_URL pattern

---
 activate.php |   36 ++++++++++++++----------------------
 1 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/activate.php b/activate.php
index 72e59e5..8287709 100644
--- a/activate.php
+++ b/activate.php
@@ -1,7 +1,10 @@
 <?php
 
 use JVBase\integrations\Umami;
+use JVBase\managers\Cache;
+use JVBase\managers\DirectoryManager;
 use JVBase\managers\ReferralManager;
+use JVBase\managers\SEO\SEOAdminPage;
 use JVBase\utility\Features;
 
 if (!defined('ABSPATH')) {
@@ -10,7 +13,6 @@
 
 function jvbActivatePlugin():void
 {
-	ob_start();
 	$validator = new JVBase\utility\Validator();
 	$validation = $validator->validateAll();
 	error_log('Validation result: '.print_r($validation, true));
@@ -47,23 +49,12 @@
 		error_log('Adding Umami tables');
 		Umami::createTables();
 	}
-	error_log('Activation done! Huzzah!');
 
-	$output = ob_get_clean();
-	if ( $output ) {
-		// Grab a backtrace to see what caused the output
-		$trace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
-		$formatted = [];
-		foreach ( $trace as $step ) {
-			if ( isset( $step['file'], $step['line'] ) ) {
-				$formatted[] = $step['file'] . ':' . $step['line'];
-			}
-		}
-
-		error_log( "⚠️ Plugin activation produced unexpected output (" . strlen( $output ) . " chars)" );
-		error_log( "Output: " . trim( $output ) );
-		error_log( "Backtrace: " . implode( ' <- ', $formatted ) );
+	if (Features::forSite()->has('is_directory')) {
+		error_log('Activating DirectoryManager');
+		DirectoryManager::activate();
 	}
+	error_log('Activation done! Huzzah!');
 }
 
 function jvbAddAdminCaps()
@@ -202,6 +193,7 @@
     jvbDeleteOptions();
     jvbDeleteDashboard();
     jvbDeleteDirectories();
+	Cache::flushAll();
     do_action('jvbDeactivate');
 }
 
@@ -237,14 +229,13 @@
     $pages = new WP_Query([
         'post_type' => BASE.'directory',
         'posts_per_page'    => -1,
-        'post_status'   => 'any',
+        'post_status'   => ['publish', 'draft','trash'],
         'fields'    => 'ids'
     ]);
-    if ($pages->have_posts()) {
-        foreach ($pages->posts as $ID) {
-            wp_delete_post($ID, true);
-        }
-    }
+	foreach ($pages->posts as $ID) {
+		wp_delete_post($ID, true);
+	}
+
 }
 function jvbClearSchedules()
 {
@@ -278,4 +269,5 @@
 	if (Features::forSite()->has('referrals')){
 		ReferralManager::addSubpage();
 	}
+	SEOAdminPage::addSubpage();
 }

--
Gitblit v1.10.0