PluginProbe
Extendify / 3.2.3
Extendify v3.2.3
3.2.3 3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 All 129 releases
← All changes | app/SiteVisibility.php +32 -2 3.2.1 → 3.2.3 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2
3 3 /**
4 - * Controls whether the site is publicly visible
4 + * Controls whether the site is publicly visible and indexable
5 5 */
6 6
7 7 namespace Extendify;
8 8
@@ -8,9 +8,9 @@
8 8
9 9 defined('ABSPATH') || die('No direct access.');
10 10
11 11 /**
12 - * This class reads and writes the site's public visibility.
12 + * This class reads and writes the site's public visibility and search engine indexing.
13 13 */
14 14
15 15 class SiteVisibility
16 16 {
@@ -50,6 +50,36 @@
50 50 */
51 51 public static function markPublished()
52 52 {
53 53 \update_option(self::OPTION, 'published');
54 + }
55 +
56 + /**
57 + * Whether WordPress's "Discourage search engines" setting is on.
58 + *
59 + * @return boolean
60 + */
61 + public static function searchEnginesBlocked()
62 + {
63 + return (string) \get_option('blog_public') === '0';
64 + }
65 +
66 + /**
67 + * Ask search engines not to index the site.
68 + *
69 + * @return void
70 + */
71 + public static function blockIndexing()
72 + {
73 + \update_option('blog_public', '0');
74 + }
75 +
76 + /**
77 + * Let search engines index the site.
78 + *
79 + * @return void
80 + */
81 + public static function allowIndexing()
82 + {
83 + \update_option('blog_public', '1');
54 84 }
55 85 }