-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove-links-scripts.php
118 lines (102 loc) · 3.31 KB
/
remove-links-scripts.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
/**
* Plugin Name: Remove Links and Scripts
* Plugin URI: https://wordpress.org/plugins/remove-links-and-scripts/
* Description: Remove unwanted links and scripts from wordpress header.
* Version: 0.2.4
* Author: YAS Global Team
* Author URI: https://www.yasglobal.com/web-design-development/wordpress/remove-links-scripts/
* Donate link: https://www.paypal.me/yasglobal
* License: GPLv3
*
* Text Domain: remove-links-and-scripts
* Domain Path: /languages/
*
* @package RemoveLinksScripts
*/
/**
* Remove Links and Scripts - Remove extra links and scripts from WordPress
* Copyright (C) 2016-2018, Sami Ahmed Siddiqui <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Make sure we don't expose any info if called directly
if ( ! defined( 'ABSPATH' ) ) {
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
exit;
}
class Remove_Links_Scripts {
/**
* Class constructor.
*/
public function __construct() {
$this->setup_constants();
$this->includes();
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
}
/**
* Setup plugin constants
*
* @access private
* @since 0.3
* @return void
*/
private function setup_constants() {
if ( ! defined( 'REMOVE_LINKS_SCRIPTS_FILE' ) ) {
define( 'REMOVE_LINKS_SCRIPTS_FILE', __FILE__ );
}
if ( ! defined( 'REMOVE_LINKS_SCRIPTS_PLUGIN_VERSION' ) ) {
define( 'REMOVE_LINKS_SCRIPTS_PLUGIN_VERSION', '0.2.4' );
}
if ( ! defined( 'REMOVE_LINKS_SCRIPTS_PATH' ) ) {
define( 'REMOVE_LINKS_SCRIPTS_PATH', plugin_dir_path( REMOVE_LINKS_SCRIPTS_FILE ) );
}
if ( ! defined( 'REMOVE_LINKS_SCRIPTS_BASENAME' ) ) {
define( 'REMOVE_LINKS_SCRIPTS_BASENAME', plugin_basename( REMOVE_LINKS_SCRIPTS_FILE ) );
}
}
/**
* Include required files
*
* @access private
* @since 0.3
* @return void
*/
private function includes() {
require_once(
REMOVE_LINKS_SCRIPTS_PATH . 'frontend/class-remove-links-scripts-frontend.php'
);
new Remove_Links_Scripts_Frontend();
if ( is_admin() ) {
require_once(
REMOVE_LINKS_SCRIPTS_PATH . 'admin/class-remove-links-scripts-admin.php'
);
new Remove_Links_Scripts_Admin();
register_uninstall_hook(
REMOVE_LINKS_SCRIPTS_FILE, 'remove_links_scripts_plugin_uninstall'
);
}
}
/**
* Loads the plugin language files
*
* @access public
* @since 0.3
* @return void
*/
public function load_textdomain() {
load_plugin_textdomain( 'remove-links-scripts', FALSE,
basename( dirname( REMOVE_LINKS_SCRIPTS_FILE ) ) . '/languages/'
);
}
}
new Remove_Links_Scripts();