PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 1.0.7
Adminify – White Label, Admin Menu Editor, Login Customizer v1.0.7
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Admin / Options / Tweaks_Head.php

Tweaks_Head.php in Adminify – White Label, Admin Menu Editor, Login Customizer 1.0.7, at Inc/Admin/Options/Tweaks_Head.php

277 lines 12.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Admin\Options;
4
5 use WPAdminify\Inc\Utils;
6 use WPAdminify\Inc\Admin\AdminSettingsModel;
7
8 if (!defined('ABSPATH')) {
9 die;
10 } // Cannot access directly.
11
12 class Tweaks_Head extends AdminSettingsModel
13 {
14 public function __construct()
15 {
16 $this->tweaks_head_settings();
17 }
18
19 public function get_defaults()
20 {
21 return [
22 'generator_wp_version' => false,
23 'remove_wc_generator' => false,
24 'remove_revslider_generator' => false,
25 'remove_visual_composer_generator' => false,
26 'remove_wpml_generator' => false,
27 'remove_yoast_generator' => false,
28 'remove_version_strings' => false,
29 'remove_dashicons' => false,
30 'remove_link_url' => false,
31 'remove_wlwmanifest' => false,
32 'remove_dns_prefetch' => false,
33 'remove_rsd' => false,
34 'remove_shortlink' => false,
35 'remove_canonical' => false,
36 'remove_emoji' => false,
37 'remove_prev_next' => false,
38 'remove_recentcomments' => false,
39 'disable_xmlrpc' => false
40 ];
41 }
42
43
44 /**
45 * Tweaks: Head Fields
46 *
47 * @return void
48 */
49 public function tweaks_head_fields(&$head_fields)
50 {
51
52 $head_fields[] = array(
53 'type' => 'subheading',
54 'content' => Utils::adminfiy_help_urls(
55 __('Remove unncessary links, scripts and styles from head section.', WP_ADMINIFY_TD),
56 'https://wpadminify.com/kb/wp-adminify-tweaks/',
57 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
58 'https://www.facebook.com/groups/jeweltheme',
59 'https://wpadminify.com/support/'
60 )
61 );
62
63 $head_fields[] = array(
64 'id' => 'generator_wp_version',
65 'type' => 'switcher',
66 'title' => __('Remove Generator Version', WP_ADMINIFY_TD),
67 'subtitle' => __('Remove WordPress Generator WordPress Version from Frontend and RSS Feed', WP_ADMINIFY_TD),
68 'label' => __('This meta tag just shows your WordPress version. You can remove it for security reasons and keep your head section clean.', WP_ADMINIFY_TD),
69 'text_on' => __('Yes', WP_ADMINIFY_TD),
70 'text_off' => __('No', WP_ADMINIFY_TD),
71 'text_width' => 80,
72 'default' => $this->get_default_field('generator_wp_version'),
73 );
74
75 $head_fields[] = array(
76 'id' => 'remove_wc_generator',
77 'type' => 'switcher',
78 'title' => __('Remove WooCommerce Generator Meta', WP_ADMINIFY_TD),
79 'subtitle' => __('Remove "<meta name="generator" content="WooCommerce x.x.x" />" from head section', WP_ADMINIFY_TD),
80 'text_on' => __('Yes', WP_ADMINIFY_TD),
81 'text_off' => __('No', WP_ADMINIFY_TD),
82 'text_width' => 80,
83 );
84
85 $head_fields[] = array(
86 'id' => 'remove_revslider_generator',
87 'type' => 'switcher',
88 'title' => __('Remove Revolution Slider Generator Meta', WP_ADMINIFY_TD),
89 'subtitle' => __('Remove "<meta name="generator" content="Revolution Slider x.x.x" />" from head section', WP_ADMINIFY_TD),
90 'text_on' => __('Yes', WP_ADMINIFY_TD),
91 'text_off' => __('No', WP_ADMINIFY_TD),
92 'text_width' => 80,
93 );
94
95 $head_fields[] = array(
96 'id' => 'remove_visual_composer_generator',
97 'type' => 'switcher',
98 'title' => __('Remove Visual Composer Generator Meta', WP_ADMINIFY_TD),
99 'subtitle' => __('Remove "<meta name="generator" content="Visual Composer x.x.x" />" from head section', WP_ADMINIFY_TD),
100 'text_on' => __('Yes', WP_ADMINIFY_TD),
101 'text_off' => __('No', WP_ADMINIFY_TD),
102 'text_width' => 80,
103 );
104
105 $head_fields[] = array(
106 'id' => 'remove_wpml_generator',
107 'type' => 'switcher',
108 'title' => __('Remove WPML Generator Meta', WP_ADMINIFY_TD),
109 'subtitle' => __('Remove "<meta name="generator" content="Visual Composer x.x.x" />" from head section', WP_ADMINIFY_TD),
110 'text_on' => __('Yes', WP_ADMINIFY_TD),
111 'text_off' => __('No', WP_ADMINIFY_TD),
112 'text_width' => 80,
113 );
114
115 $head_fields[] = array(
116 'id' => 'remove_yoast_generator',
117 'type' => 'switcher',
118 'title' => __('Remove All Yoast HTML Comments', WP_ADMINIFY_TD),
119 'subtitle' => __('Remove Yoast HTML Comments', WP_ADMINIFY_TD),
120 'label' => __('Remove message - "This site is optimized with the Yoast WordPress SEO plugin" generated by Yoast', WP_ADMINIFY_TD),
121 'text_on' => __('Yes', WP_ADMINIFY_TD),
122 'text_off' => __('No', WP_ADMINIFY_TD),
123 'text_width' => 80,
124 );
125
126 $head_fields[] = array(
127 'id' => 'remove_version_strings',
128 'type' => 'switcher',
129 'title' => __('Remove Version from Style and Script', WP_ADMINIFY_TD),
130 'subtitle' => __('Remove Version Number from Styles/Scripts', WP_ADMINIFY_TD),
131 'text_on' => __('Yes', WP_ADMINIFY_TD),
132 'text_off' => __('No', WP_ADMINIFY_TD),
133 'text_width' => 80,
134 );
135
136 $head_fields[] = array(
137 'id' => 'remove_dashicons',
138 'type' => 'switcher',
139 'title' => __('Remove Dashicons', WP_ADMINIFY_TD),
140 'subtitle' => __('Remove Dashicons from Admin Bar for non logged in users', WP_ADMINIFY_TD),
141 'text_on' => __('Yes', WP_ADMINIFY_TD),
142 'text_off' => __('No', WP_ADMINIFY_TD),
143 'text_width' => 80,
144 );
145
146 $head_fields[] = array(
147 'id' => 'remove_link_url',
148 'type' => 'switcher',
149 'title' => __('Remove Index Link', WP_ADMINIFY_TD),
150 'subtitle' => esc_html__('Remove "<link rel=\'index\'..." from head section', WP_ADMINIFY_TD),
151 'label' => 'Remove Homepage Index Link',
152 'text_on' => __('Yes', WP_ADMINIFY_TD),
153 'text_off' => __('No', WP_ADMINIFY_TD),
154 'text_width' => 80,
155 );
156
157 $head_fields[] = array(
158 'id' => 'remove_wlwmanifest',
159 'type' => 'switcher',
160 'title' => __('Remove WLW Manifest Link', WP_ADMINIFY_TD),
161 'subtitle' => esc_html__('Remove "<link rel=\'wlwmanifest\'..." from head section', WP_ADMINIFY_TD),
162 'label' => 'WLW Manifest Link adds support for Windows Live Writer app. If you are not using this app you can remove this link.',
163 'text_on' => __('Yes', WP_ADMINIFY_TD),
164 'text_off' => __('No', WP_ADMINIFY_TD),
165 'text_width' => 80,
166 );
167
168 $head_fields[] = array(
169 'id' => 'remove_dns_prefetch',
170 'type' => 'switcher',
171 'title' => __('Remove WP.org DNS Prefetch', WP_ADMINIFY_TD),
172 'subtitle' => esc_html__('Remove &lt;link rel=&quot;dns-prefetch&quot; href=&quot;http://www.yourdomain.com/&quot;&gt; from head section', WP_ADMINIFY_TD),
173 'label' => __('If all of your resources has the same domain yo can disable forcing DNS lookup of specific hostnames', WP_ADMINIFY_TD),
174 'text_on' => __('Yes', WP_ADMINIFY_TD),
175 'text_off' => __('No', WP_ADMINIFY_TD),
176 'text_width' => 80,
177 );
178
179 $head_fields[] = array(
180 'id' => 'remove_rsd',
181 'type' => 'switcher',
182 'title' => __('Remove RSD Link (EditURI Link)', WP_ADMINIFY_TD),
183 'subtitle' => esc_html__('Remove "<link rel=\'EditURI\'..." from head section', WP_ADMINIFY_TD),
184 'label' => __('RSD (Real Simple Discovery) is the mechanism used by XML-RPC clients. Also this mechanism can be used by spammers. If do not use this clients with your site, you can remove it.', WP_ADMINIFY_TD),
185 'text_on' => __('Yes', WP_ADMINIFY_TD),
186 'text_off' => __('No', WP_ADMINIFY_TD),
187 'text_width' => 80,
188 );
189
190 $head_fields[] = array(
191 'id' => 'remove_shortlink',
192 'type' => 'switcher',
193 'title' => __('Remove Shortlink', WP_ADMINIFY_TD),
194 'subtitle' => esc_html__('Remove "<link rel=\'shortlink\'..." from head section', WP_ADMINIFY_TD),
195 'label' => __('This meta tag just shows short link (not canonical link) to your posts. You can remove it.', WP_ADMINIFY_TD),
196 'text_on' => __('Yes', WP_ADMINIFY_TD),
197 'text_off' => __('No', WP_ADMINIFY_TD),
198 'text_width' => 80,
199 );
200
201 $head_fields[] = array(
202 'id' => 'remove_canonical',
203 'type' => 'switcher',
204 'title' => __('Remove Canonical URL', WP_ADMINIFY_TD),
205 'subtitle' => esc_html__('Remove &lt;link rel="canonical" href="http://www.site.com/some-url" /&gt; from head section', WP_ADMINIFY_TD),
206 'label' => 'Remove Canonical URL. Details: https://support.google.com/webmasters/answer/139066?hl=en',
207 'text_on' => __('Yes', WP_ADMINIFY_TD),
208 'text_off' => __('No', WP_ADMINIFY_TD),
209 'text_width' => 80,
210 );
211
212 $head_fields[] = array(
213 'id' => 'remove_emoji',
214 'type' => 'switcher',
215 'title' => __('Remove Emoji Styles and Scripts', WP_ADMINIFY_TD),
216 'subtitle' => __('Remove Emoji styles and scripts from head section', WP_ADMINIFY_TD),
217 'label' => __('If you are not using emoji smiles on your site you can disable this feature and keep your head section clean.', WP_ADMINIFY_TD),
218 'text_on' => __('Yes', WP_ADMINIFY_TD),
219 'text_off' => __('No', WP_ADMINIFY_TD),
220 'text_width' => 80,
221 );
222
223 $head_fields[] = array(
224 'id' => 'remove_prev_next',
225 'type' => 'switcher',
226 'title' => __('Remove Prev/Next Links', WP_ADMINIFY_TD),
227 'subtitle' => esc_html__('Remove "<link rel=\'prev\'..." and "<link rel=\'next\'..." from head section', WP_ADMINIFY_TD),
228 'label' => 'This is links to the next and previous post that actually not used. You can remove it and keep your head section clean.',
229 'text_on' => __('Yes', WP_ADMINIFY_TD),
230 'text_off' => __('No', WP_ADMINIFY_TD),
231 'text_width' => 80,
232 );
233
234 $head_fields[] = array(
235 'id' => 'remove_recentcomments',
236 'type' => 'switcher',
237 'title' => __('Remove Hardcoded Styles for Recent Comments', WP_ADMINIFY_TD),
238 'subtitle' => __('Remove styles for ".recentcomments a" from head section', WP_ADMINIFY_TD),
239 'label' => __('This is hard coded CSS for recent comments widget. You can remove it and keep your head section clean.', WP_ADMINIFY_TD),
240 'text_on' => __('Yes', WP_ADMINIFY_TD),
241 'text_off' => __('No', WP_ADMINIFY_TD),
242 'text_width' => 80,
243 );
244
245 $head_fields[] = array(
246 'id' => 'disable_xmlrpc',
247 'type' => 'switcher',
248 'title' => __('Disable XML-RPC', WP_ADMINIFY_TD),
249 'text_on' => __('Yes', WP_ADMINIFY_TD),
250 'text_off' => __('No', WP_ADMINIFY_TD),
251 'text_width' => 80,
252 );
253 }
254
255 public function tweaks_head_settings()
256 {
257
258 if (!class_exists('ADMINIFY')) {
259 return;
260 }
261
262 $head_fields = [];
263 $this->tweaks_head_fields($head_fields);
264
265 \ADMINIFY::createSection(
266 $this->prefix,
267 array(
268 'title' => __('Head', WP_ADMINIFY_TD),
269 'parent' => 'tweaks_performance',
270 'icon' => 'fas fa-newspaper',
271 'class' => 'wp-adminify-two-columns aminify-title-width-40',
272 'fields' => $head_fields
273 )
274 );
275 }
276 }
277