forked from N-Jaro/iguide-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-plugin-activation.php
More file actions
51 lines (40 loc) · 1.37 KB
/
Copy pathtest-plugin-activation.php
File metadata and controls
51 lines (40 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Plugin Activation Test Script
* Run this directly to test plugin activation without WordPress admin
*/
// Change to the WordPress root directory
$wp_root = dirname(dirname(dirname(__DIR__)));
require_once($wp_root . '/wp-config.php');
require_once($wp_root . '/wp-admin/includes/plugin.php');
echo "Testing I-GUIDE Ethics Toolkit Plugin Activation...\n\n";
$plugin_file = 'iguide-ethics-toolkit/iguide-ethics-toolkit.php';
// Check if plugin file exists
if (!file_exists(WP_PLUGIN_DIR . '/' . $plugin_file)) {
echo "ERROR: Plugin file not found at " . WP_PLUGIN_DIR . '/' . $plugin_file . "\n";
exit(1);
}
echo "Plugin file found.\n";
// Try to activate the plugin
$result = activate_plugin($plugin_file);
if (is_wp_error($result)) {
echo "ERROR: Plugin activation failed with error: " . $result->get_error_message() . "\n";
exit(1);
}
echo "Plugin activated successfully!\n";
// Test if the main class exists
if (class_exists('IDET_Main')) {
echo "Main plugin class loaded successfully.\n";
} else {
echo "WARNING: Main plugin class not found.\n";
}
// Test database component
if (class_exists('IDET_Database')) {
echo "Database class loaded successfully.\n";
$db = new IDET_Database();
echo "Database class instantiated successfully.\n";
} else {
echo "WARNING: Database class not found.\n";
}
echo "\nActivation test completed.\n";
?>