| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: GD Security Headers |
| 5 |
Plugin URI: https://plugins.dev4press.com/gd-security-headers/ |
| 6 |
Description: Configure various security related HTTP headers, including Content Security Policy, Referrer Policy and more. All headers can be added to .HTACCESS file. |
| 7 |
Version: 1.0 |
| 8 |
Author: Milan Petrovic |
| 9 |
Author URI: https://www.dev4press.com/ |
| 10 |
Text Domain: gd-security-headers |
| 11 |
|
| 12 |
== Copyright == |
| 13 |
Copyright 2008 - 2019 Milan Petrovic (email: milan@gdragon.info) |
| 14 |
|
| 15 |
This program is free software: you can redistribute it and/or modify |
| 16 |
it under the terms of the GNU General Public License as published by |
| 17 |
the Free Software Foundation, either version 3 of the License, or |
| 18 |
(at your option) any later version. |
| 19 |
|
| 20 |
This program is distributed in the hope that it will be useful, |
| 21 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 |
GNU General Public License for more details. |
| 24 |
|
| 25 |
You should have received a copy of the GNU General Public License |
| 26 |
along with this program. If not, see <http://www.gnu.org/licenses/> |
| 27 |
*/ |
| 28 |
|
| 29 |
$gdsih_dirname_basic = dirname(__FILE__).'/'; |
| 30 |
$gdsih_urlname_basic = plugins_url('/gd-security-headers/'); |
| 31 |
|
| 32 |
define('GDSIH_PATH', $gdsih_dirname_basic); |
| 33 |
define('GDSIH_URL', $gdsih_urlname_basic); |
| 34 |
define('GDSIH_D4PLIB', $gdsih_dirname_basic.'d4plib/'); |
| 35 |
|
| 36 |
/* D4PLIB */ |
| 37 |
if (!defined('D4PLIB_PATH')) { |
| 38 |
define('D4PLIB_PATH', GDSIH_PATH.'d4plib/'); |
| 39 |
} |
| 40 |
|
| 41 |
if (!defined('D4PLIB_URL')) { |
| 42 |
define('D4PLIB_URL', GDSIH_URL.'d4plib/'); |
| 43 |
} |
| 44 |
|
| 45 |
require_once(GDSIH_D4PLIB.'d4p.core.php'); |
| 46 |
/* D4PLIB */ |
| 47 |
|
| 48 |
d4p_includes(array( |
| 49 |
array('name' => 'datetime', 'directory' => 'core'), |
| 50 |
array('name' => 'scope', 'directory' => 'core'), |
| 51 |
array('name' => 'wpdb', 'directory' => 'core'), |
| 52 |
array('name' => 'plugin', 'directory' => 'plugin'), |
| 53 |
array('name' => 'errors', 'directory' => 'plugin'), |
| 54 |
array('name' => 'settings', 'directory' => 'plugin'), |
| 55 |
array('name' => 'ip', 'directory' => 'classes'), |
| 56 |
'functions', |
| 57 |
'sanitize', |
| 58 |
'access', |
| 59 |
'wp' |
| 60 |
), GDSIH_D4PLIB); |
| 61 |
|
| 62 |
require_once(GDSIH_PATH.'core/version.php'); |
| 63 |
require_once(GDSIH_PATH.'core/settings.php'); |
| 64 |
require_once(GDSIH_PATH.'core/functions.php'); |
| 65 |
require_once(GDSIH_PATH.'core/plugin.php'); |
| 66 |
|
| 67 |
require_once(GDSIH_PATH.'core/objects/core.db.php'); |
| 68 |
|
| 69 |
global $_gdsih_core, $_gdsih_settings, $_gdsih_db; |
| 70 |
|
| 71 |
$_gdsih_settings = new gdsih_core_settings(); |
| 72 |
$_gdsih_core = new gdsih_core_plugin(); |
| 73 |
$_gdsih_db = new gdsih_core_db(); |
| 74 |
|
| 75 |
/** @return gdsih_core_plugin */ |
| 76 |
function gdsih() { |
| 77 |
global $_gdsih_core; |
| 78 |
return $_gdsih_core; |
| 79 |
} |
| 80 |
|
| 81 |
/** @return gdsih_core_settings */ |
| 82 |
function gdsih_settings() { |
| 83 |
global $_gdsih_settings; |
| 84 |
return $_gdsih_settings; |
| 85 |
} |
| 86 |
|
| 87 |
/** @return gdsih_core_db */ |
| 88 |
function gdsih_db() { |
| 89 |
global $_gdsih_db; |
| 90 |
return $_gdsih_db; |
| 91 |
} |
| 92 |
|
| 93 |
if (D4P_ADMIN) { |
| 94 |
d4p_includes(array( |
| 95 |
array('name' => 'admin', 'directory' => 'plugin'), |
| 96 |
array('name' => 'functions', 'directory' => 'admin') |
| 97 |
), GDSIH_D4PLIB); |
| 98 |
|
| 99 |
require_once(GDSIH_PATH.'core/admin/plugin.php'); |
| 100 |
} |
| 101 |
|