-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.php
More file actions
35 lines (25 loc) · 1.19 KB
/
plugin.php
File metadata and controls
35 lines (25 loc) · 1.19 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
<?php
/**
* Plugin Name: Breakdance Migration Mode
* Plugin URI: https://breakdance.com/features/migration-mode
* Description: Run Breakdance for specified IP addresses, leaving the site behaving for normal visitors as if Breakdance was not installed. Accidentally locked yourself out or IP address changed? Deactivate and then reactivate this plugin. Ready to go live with Breakdance? Remove this plugin.
* Author: Breakdance
* Version: 1.0
* Author URI: https://breakdance.com/features/migration-mode
*/
namespace Breakdance\MigrationMode;
require_once __DIR__ . "/migration-mode.php";
require_once __DIR__ . "/migration-mode-tab.php";
register_activation_hook(__FILE__, 'Breakdance\MigrationMode\saveActivatingUserIp');
function saveActivatingUserIp()
{
$userIp = $_SERVER['REMOTE_ADDR'];
update_option('breakdance_migration_mode_enabled_ips', $userIp);
}
function addPluginActionLinks($links)
{
$settingsLink = '<a href="' . admin_url('admin.php?page=breakdance_settings&tab=migration-mode') . '">Settings</a>';
array_unshift($links, $settingsLink);
return $links;
}
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'Breakdance\MigrationMode\addPluginActionLinks');