Plugin Directory

source: litespeed-cache/trunk/src/doc.cls.php

Last change on this file was 3009052, checked in by LiteSpeedTech, 7 months ago

Release v6.0

File size: 4.7 KB
Line 
1<?php
2
3/**
4 * The Doc class.
5 *
6 * @since       2.2.7
7 * @package     LiteSpeed
8 * @subpackage  LiteSpeed/src
9 * @author      LiteSpeed Technologies <info@litespeedtech.com>
10 */
11
12namespace LiteSpeed;
13
14defined('WPINC') || exit();
15
16class Doc
17{
18        // protected static $_instance;
19
20        /**
21         * Show option is actually ON by GM
22         *
23         * @since  5.5
24         * @access public
25         */
26        public static function maybe_on_by_gm($id)
27        {
28                if (apply_filters('litespeed_conf', $id)) {
29                        return;
30                }
31                if (!apply_filters('litespeed_conf', Base::O_GUEST)) {
32                        return;
33                }
34                if (!apply_filters('litespeed_conf', Base::O_GUEST_OPTM)) {
35                        return;
36                }
37                echo '<font class="litespeed-warning">';
38                echo '⚠️ ' .
39                        sprintf(
40                                __('This setting is %1$s for certain qualifying requests due to %2$s!', 'litespeed-cache'),
41                                '<code>' . __('ON', 'litespeed-cache') . '</code>',
42                                Lang::title(Base::O_GUEST_OPTM)
43                        );
44                self::learn_more('https://docs.litespeedtech.com/lscache/lscwp/general/#guest-optimization');
45                echo '</font>';
46        }
47
48        /**
49         * Changes affect crawler list warning
50         *
51         * @since  4.3
52         * @access public
53         */
54        public static function crawler_affected()
55        {
56                echo '<font class="litespeed-primary">';
57                echo '⚠️ ' . __('This setting will regenerate crawler list and clear the disabled list!', 'litespeed-cache');
58                echo '</font>';
59        }
60
61        /**
62         * Privacy policy
63         *
64         * @since 2.2.7
65         * @access public
66         */
67        public static function privacy_policy()
68        {
69                return __(
70                        'This site utilizes caching in order to facilitate a faster response time and better user experience. Caching potentially stores a duplicate copy of every web page that is on display on this site. All cache files are temporary, and are never accessed by any third party, except as necessary to obtain technical support from the cache plugin vendor. Cache files expire on a schedule set by the site administrator, but may easily be purged by the admin before their natural expiration, if necessary. We may use QUIC.cloud services to process & cache your data temporarily.',
71                        'litespeed-cache'
72                ) .
73                        sprintf(
74                                __('Please see %s for more details.', 'litespeed-cache'),
75                                '<a href="https://quic.cloud/privacy-policy/" target="_blank">https://quic.cloud/privacy-policy/</a>'
76                        );
77        }
78
79        /**
80         * Learn more link
81         *
82         * @since  2.4.2
83         * @access public
84         */
85        public static function learn_more($url, $title = false, $self = false, $class = false, $return = false)
86        {
87                if (!$class) {
88                        $class = 'litespeed-learn-more';
89                }
90
91                if (!$title) {
92                        $title = __('Learn More', 'litespeed-cache');
93                }
94
95                $self = $self ? '' : "target='_blank'";
96
97                $txt = " <a href='$url' $self class='$class'>$title</a>";
98
99                if ($return) {
100                        return $txt;
101                }
102
103                echo $txt;
104        }
105
106        /**
107         * One per line
108         *
109         * @since  3.0
110         * @access public
111         */
112        public static function one_per_line($return = false)
113        {
114                $str = __('One per line.', 'litespeed-cache');
115                if ($return) {
116                        return $str;
117                }
118                echo $str;
119        }
120
121        /**
122         * One per line
123         *
124         * @since  3.4
125         * @access public
126         */
127        public static function full_or_partial_url($string_only = false)
128        {
129                if ($string_only) {
130                        echo __('Both full and partial strings can be used.', 'litespeed-cache');
131                } else {
132                        echo __('Both full URLs and partial strings can be used.', 'litespeed-cache');
133                }
134        }
135
136        /**
137         * Notice to edit .htaccess
138         *
139         * @since  3.0
140         * @access public
141         */
142        public static function notice_htaccess()
143        {
144                echo '<font class="litespeed-primary">';
145                echo '⚠️ ' . __('This setting will edit the .htaccess file.', 'litespeed-cache');
146                echo ' <a href="https://docs.litespeedtech.com/lscache/lscwp/toolbox/#edit-htaccess-tab" target="_blank" class="litespeed-learn-more">' .
147                        __('Learn More', 'litespeed-cache') .
148                        '</a>';
149                echo '</font>';
150        }
151
152        /**
153         * Notice for whitelist IPs
154         *
155         * @since  3.0
156         * @access public
157         */
158        public static function notice_ips()
159        {
160                echo '<div class="litespeed-primary">';
161                echo '⚠️ ' . sprintf(__('For online services to work correctly, you must allowlist all %s server IPs.', 'litespeed-cache'), 'QUIC.cloud') . '<br/>';
162                echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . __('Before generating key, please verify all IPs on this list are allowlisted', 'litespeed-cache') . ': ';
163                echo '<a href="' . Cloud::CLOUD_IPS . '" target="_blank">' . __('Current Online Server IPs', 'litespeed-cache') . '</a>';
164                echo '</div>';
165        }
166
167        /**
168         * Gentle reminder that web services run asynchronously
169         *
170         * @since  5.3.1
171         * @access public
172         */
173        public static function queue_issues($return = false)
174        {
175                $str =
176                        '<div class="litespeed-desc">' .
177                        esc_html__('The queue is processed asynchronously. It may take time.', 'litespeed-cache') .
178                        self::learn_more('https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#quiccloud-queue-issues', false, false, false, true) .
179                        '</div>';
180                if ($return) {
181                        return $str;
182                }
183                echo $str;
184        }
185}
Note: See TracBrowser for help on using the repository browser.