PluginProbe
FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel / trunk
FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel vtrunk
1.7.1 1.7.0 1.6.0 1.5.2 trunk 0.1 0.2.0 0.2.1 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.4 0.4.1 0.4.2 0.4.3 1.0 1.1 1.2 1.3.1 1.4.0 1.4.1 1.5.0 1.5.1 All 26 releases
flywp / includes / Optimizations / Header.php

Header.php in FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel trunk, at includes/Optimizations/Header.php

84 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FlyWP\Optimizations;
4
5 class Header extends Base {
6
7 /**
8 * Group name
9 *
10 * @var string
11 */
12 protected $group = 'header';
13
14 /**
15 * Features to remove.
16 *
17 * @var array
18 */
19 protected $features = [
20 'feed_links' => 'remove_feed_links',
21 'rsd_link' => 'remove_rsd_link',
22 'generator' => 'remove_generator',
23 'rest_api' => 'remove_rest_api',
24 'shortlink' => 'remove_shortlink',
25 'oembed' => 'remove_oembed',
26 ];
27
28 /**
29 * Remove feed links.
30 *
31 * @return void
32 */
33 public function remove_feed_links() {
34 remove_action( 'wp_head', 'feed_links', 2 );
35 remove_action( 'wp_head', 'feed_links_extra', 3 );
36 }
37
38 /**
39 * Remove RSD link.
40 *
41 * @return void
42 */
43 public function remove_rsd_link() {
44 remove_action( 'wp_head', 'rsd_link' );
45 }
46
47 /**
48 * Remove generator.
49 *
50 * @return void
51 */
52 public function remove_generator() {
53 remove_action( 'wp_head', 'wp_generator' );
54 }
55
56 /**
57 * Remove REST API links.
58 *
59 * @return void
60 */
61 public function remove_rest_api() {
62 remove_action( 'wp_head', 'rest_output_link_wp_head' );
63 remove_action( 'template_redirect', 'rest_output_link_header', 11 );
64 }
65
66 /**
67 * Remove shortlink.
68 *
69 * @return void
70 */
71 public function remove_shortlink() {
72 remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
73 }
74
75 /**
76 * Remove oEmbed discovery links.
77 *
78 * @return void
79 */
80 public function remove_oembed() {
81 remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
82 }
83 }
84