Repository navigation
Expand file tree
/
Copy pathphoenix-sensor.php
More file actions
43 lines (36 loc) · 1.46 KB
/
Copy pathphoenix-sensor.php
File metadata and controls
43 lines (36 loc) · 1.46 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
<?php
/**
* Plugin Name: Phoenix Sensor
* Version: 2.3.6 (V14 Alpha-Bridge Enabled)
* Description: Modular AEO Intelligence Platform.
*/
if (!defined('ABSPATH')) exit;
// 1. GLOBAL BOOTSTRAP
require_once plugin_dir_path(__FILE__) . 'inc/px-core.php';
require_once plugin_dir_path(__FILE__) . 'inc/px-ajax.php';
// 2. REGISTER MENU
add_action('admin_menu', function() {
add_menu_page('Phoenix Sensor', 'Phoenix Sensor', 'manage_options', 'phoenix-sensor', 'px_master_render', 'dashicons-visibility', 2);
});
/**
* 3. THE ALPHA BRIDGE REDIRECT
* Forces the plugin to use the physical V14 bridge file
*/
add_action('admin_post_px_v14_direct_export', function() {
if (!current_user_can('manage_options')) wp_die('Unauthorized');
// Redirect to the physical bridge file with a cache-buster
wp_redirect(site_url('/data-bridge-alpha.php?v=' . time()));
exit;
});
// 4. THE RENDER ENGINE
function px_master_render() {
include plugin_dir_path(__FILE__) . 'inc/px-styles.php';
echo '<div class="wrap px-vibe-wrap">';
// We pass the new direct URL to the header/nav components
$v14_url = admin_url('admin-post.php?action=px_v14_direct_export');
include plugin_dir_path(__FILE__) . 'inc/px-header.php';
include plugin_dir_path(__FILE__) . 'inc/px-sit-rep.php';
include plugin_dir_path(__FILE__) . 'inc/px-navigation.php';
include plugin_dir_path(__FILE__) . 'inc/px-table.php';
echo '</div>';
}