tigerstyle-heat/test-modular-system.php
Ryan Malloy 0028738e33 Initial commit: TigerStyle Heat v2.0.0
Make your WordPress site irresistible. Natural SEO attraction with:
- robots.txt management
- sitemap.xml generation
- LLMs.txt support
- Google integration (Analytics, Search Console, Tag Manager)
- Schema.org structured data
- Open Graph / Twitter Card meta tags
- AMP support
- Visual elements gallery
- Built-in backup/restore module

Includes build.sh and .distignore for WordPress-installable release ZIPs.
2026-05-27 13:41:35 -06:00

161 lines
4.3 KiB
PHP

<?php
/**
* Test script for TigerStyle Heat modular system
* Simulates WordPress environment to test plugin initialization
*/
// Mock WordPress functions for testing
if (!function_exists('add_action')) {
function add_action($hook, $callback) {
echo "✓ Hook registered: $hook\n";
}
}
if (!function_exists('add_filter')) {
function add_filter($hook, $callback) {
echo "✓ Filter registered: $hook\n";
}
}
if (!function_exists('register_activation_hook')) {
function register_activation_hook($file, $callback) {
echo "✓ Activation hook registered\n";
}
}
if (!function_exists('register_deactivation_hook')) {
function register_deactivation_hook($file, $callback) {
echo "✓ Deactivation hook registered\n";
}
}
if (!function_exists('load_plugin_textdomain')) {
function load_plugin_textdomain($domain, $deprecated = '', $plugin_rel_path = '') {
echo "✓ Text domain loaded: $domain\n";
}
}
if (!function_exists('is_admin')) {
function is_admin() {
return true;
}
}
if (!function_exists('plugin_dir_path')) {
function plugin_dir_path($file) {
return dirname($file) . '/';
}
}
if (!function_exists('plugin_dir_url')) {
function plugin_dir_url($file) {
return 'http://localhost/wp-content/plugins/' . basename(dirname($file)) . '/';
}
}
// Define constants
if (!defined('ABSPATH')) {
define('ABSPATH', '/tmp/wordpress/');
}
echo "=== TigerStyle Heat Modular System Test ===\n\n";
echo "1. Testing Core Plugin Initialization...\n";
try {
require_once __DIR__ . '/tigerstyle-heat-new.php';
echo "✓ Main plugin file loaded successfully\n";
// Test singleton instance
$plugin = tigerstyle_heat();
if ($plugin instanceof TigerStyleSEO) {
echo "✓ Plugin singleton instance created\n";
} else {
echo "✗ Plugin singleton failed\n";
}
// Test second instance (should be same)
$plugin2 = tigerstyle_heat();
if ($plugin === $plugin2) {
echo "✓ Singleton pattern working correctly\n";
} else {
echo "✗ Singleton pattern failed\n";
}
} catch (Exception $e) {
echo "✗ Error loading main plugin: " . $e->getMessage() . "\n";
}
echo "\n2. Testing Module Loading...\n";
try {
$modules = [
'robots_txt',
'sitemap_xml',
'llms_txt',
'google_setup',
'structured_data',
'meta_tags',
'seo_health',
'head_footer',
'visual_elements_gallery'
];
foreach ($modules as $module_name) {
$module = $plugin->get_module($module_name);
if ($module) {
echo "✓ Module '$module_name' loaded successfully\n";
} else {
echo "✗ Module '$module_name' failed to load\n";
}
}
} catch (Exception $e) {
echo "✗ Error testing modules: " . $e->getMessage() . "\n";
}
echo "\n3. Testing Utils Class...\n";
try {
if (class_exists('TigerStyleSEO_Utils')) {
echo "✓ Utils class loaded\n";
// Test business days parser
$days = TigerStyleSEO_Utils::parse_business_days('Mo-Fr');
if (is_array($days) && count($days) === 5) {
echo "✓ Business days parser working\n";
} else {
echo "✗ Business days parser failed\n";
}
// Test format_bytes
$formatted = TigerStyleSEO_Utils::format_bytes(1024);
if ($formatted === '1 KB') {
echo "✓ Bytes formatter working\n";
} else {
echo "✗ Bytes formatter failed\n";
}
} else {
echo "✗ Utils class not found\n";
}
} catch (Exception $e) {
echo "✗ Error testing utils: " . $e->getMessage() . "\n";
}
echo "\n4. Testing Admin Classes...\n";
try {
if (class_exists('TigerStyleSEO_Admin')) {
echo "✓ Admin class loaded\n";
} else {
echo "✗ Admin class not found\n";
}
if (class_exists('TigerStyleSEO_Admin_Pages')) {
echo "✓ Admin Pages class loaded\n";
} else {
echo "✗ Admin Pages class not found\n";
}
} catch (Exception $e) {
echo "✗ Error testing admin classes: " . $e->getMessage() . "\n";
}
echo "\n=== Test Complete ===\n";
echo "If all tests show ✓, the modular system is working correctly!\n";