These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | class Jetpack_Connection_Banner { |
||
4 | /** |
||
5 | * @var Jetpack_Connection_Banner |
||
6 | **/ |
||
7 | private static $instance = null; |
||
8 | |||
9 | static function init() { |
||
10 | if ( is_null( self::$instance ) ) { |
||
11 | self::$instance = new Jetpack_Connection_Banner(); |
||
12 | } |
||
13 | |||
14 | return self::$instance; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Jetpack_Connection_Banner constructor. |
||
19 | * |
||
20 | * Since we call the Jetpack_Connection_Banner:init() method from the `Jetpack` class, and after |
||
21 | * the admin_init action fires, we know that the admin is initialized at this point. |
||
22 | */ |
||
23 | private function __construct() { |
||
24 | add_action( 'current_screen', array( $this, 'maybe_initialize_hooks' ) ); |
||
25 | add_action( 'updating_jetpack_version', array( $this, 'cleanup_on_upgrade' ), 10, 2 ); |
||
26 | } |
||
27 | |||
28 | function cleanup_on_upgrade( $new_version = null, $old_version = null ) { |
||
29 | if ( version_compare( $old_version, '4.4', '>=' ) && version_compare( $old_version, '5.3', '<' ) ) { |
||
30 | delete_option( 'jetpack_connection_banner_ab' ); |
||
31 | } |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Checks whether the connection banner A/B test should be ran. |
||
36 | * |
||
37 | * @since 5.3.0 |
||
38 | * |
||
39 | * @param null $now |
||
40 | * |
||
41 | * @return bool |
||
42 | */ |
||
43 | static function check_ab_test_not_expired( $now = null ) { |
||
44 | // Get the current timestamp in GMT |
||
45 | $now = empty( $now ) ? current_time( 'timestamp', 1 ) : $now; |
||
46 | |||
47 | // Arguments are hour, minute, second, month, day, year. So, we are getting the timestamp for GMT timestamp |
||
48 | // for the October 5th, 2017. |
||
49 | $expiration = gmmktime( 0, 0, 0, 10, 5, 2017 ); |
||
50 | |||
51 | return $expiration >= $now; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Gets the value for which connection banner to show, and initializes if not set. |
||
56 | * |
||
57 | * @since 5.3.0 |
||
58 | * |
||
59 | * @return int |
||
60 | */ |
||
61 | static function get_random_connection_banner_value() { |
||
62 | $random_connection_banner = get_option( 'jetpack_connection_banner_ab' ); |
||
63 | if ( ! $random_connection_banner ) { |
||
64 | $random_connection_banner = mt_rand( 1, 2 ); |
||
65 | update_option( 'jetpack_connection_banner_ab', $random_connection_banner ); |
||
66 | } |
||
67 | |||
68 | return $random_connection_banner; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * Given a string for the the banner was added, and an int that represents the slide to |
||
73 | * a URL for, this function returns a connection URL with a from parameter that will |
||
74 | * support split testing. |
||
75 | * |
||
76 | * @since 7.2 Event key format is now banner-connect-banner-72-dashboard or connect-banner-72-plugins. |
||
77 | * The param $slide_num was removed since we removed all slides but the first one. |
||
78 | * @since 4.4.0 |
||
79 | * |
||
80 | * @param string $jp_version_banner_added A short version of when the banner was added. Ex. 44 |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | function build_connect_url_for_slide( $jp_version_banner_added ) { |
||
85 | global $current_screen; |
||
86 | $url = Jetpack::init()->build_connect_url( |
||
87 | true, |
||
88 | false, |
||
89 | sprintf( 'connect-banner-%s-%s', $jp_version_banner_added, $current_screen->base ) |
||
90 | ); |
||
91 | return add_query_arg( 'auth_approved', 'true', $url ); |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * Return an img HTML tag pointing to the Jetpack logo. Includes alt text. |
||
96 | * |
||
97 | * @since 7.2 |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public static function get_jetpack_logo() { |
||
102 | return sprintf( |
||
103 | '<img src="%s" class="jetpack-logo" alt="%s" />', |
||
104 | esc_url( plugins_url( 'images/jetpack-logo-green.svg', JETPACK__PLUGIN_FILE ) ), |
||
105 | esc_attr__( |
||
106 | 'Jetpack is a free plugin that utilizes powerful WordPress.com servers to enhance your site and simplify managing it', |
||
107 | 'jetpack' |
||
108 | ) |
||
109 | ); |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * Will initialize hooks to display the new (as of 4.4) connection banner if the current user can |
||
114 | * connect Jetpack, if Jetpack has not been deactivated, and if the current page is the plugins page. |
||
115 | * |
||
116 | * This method should not be called if the site is connected to WordPress.com or if the site is in development mode. |
||
117 | * |
||
118 | * @since 4.4.0 |
||
119 | * @since 4.5.0 Made the new (as of 4.4) connection banner display to everyone by default. |
||
120 | * @since 5.3.0 Running another split test between 4.4 banner and a new one in 5.3. |
||
121 | * |
||
122 | * @param $current_screen |
||
123 | */ |
||
124 | function maybe_initialize_hooks( $current_screen ) { |
||
125 | // Kill if banner has been dismissed |
||
126 | if ( Jetpack_Options::get_option( 'dismissed_connection_banner' ) ) { |
||
127 | return; |
||
128 | } |
||
129 | |||
130 | // Don't show the connect notice anywhere but the plugins.php after activating |
||
131 | if ( 'plugins' !== $current_screen->base && 'dashboard' !== $current_screen->base ) { |
||
132 | return; |
||
133 | } |
||
134 | |||
135 | if ( ! current_user_can( 'jetpack_connect' ) ) { |
||
136 | return; |
||
137 | } |
||
138 | |||
139 | if ( self::check_ab_test_not_expired() && 2 == self::get_random_connection_banner_value() ) { |
||
140 | add_action( 'admin_notices', array( $this, 'render_banner_b' ) ); |
||
141 | } else { |
||
142 | add_action( 'admin_notices', array( $this, 'render_banner' ) ); |
||
143 | } |
||
144 | |||
145 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_banner_scripts' ) ); |
||
146 | add_action( 'admin_print_styles', array( Jetpack::init(), 'admin_banner_styles' ) ); |
||
147 | |||
148 | if ( Jetpack::state( 'network_nag' ) ) { |
||
149 | add_action( 'network_admin_notices', array( $this, 'network_connect_notice' ) ); |
||
150 | } |
||
151 | |||
152 | // Only fires immediately after plugin activation |
||
153 | if ( get_transient( 'activated_jetpack' ) ) { |
||
154 | add_action( 'admin_notices', array( $this, 'render_connect_prompt_full_screen' ) ); |
||
155 | delete_transient( 'activated_jetpack' ); |
||
156 | } |
||
157 | } |
||
158 | |||
159 | /** |
||
160 | * Enqueues JavaScript for new connection banner. |
||
161 | * |
||
162 | * @since 4.4.0 |
||
163 | */ |
||
164 | View Code Duplication | public static function enqueue_banner_scripts() { |
|
165 | wp_enqueue_script( |
||
166 | 'jetpack-connection-banner-js', |
||
167 | Jetpack::get_file_url_for_environment( |
||
168 | '_inc/build/jetpack-connection-banner.min.js', |
||
169 | '_inc/jetpack-connection-banner.js' |
||
170 | ), |
||
171 | array( 'jquery' ), |
||
172 | JETPACK__VERSION, |
||
173 | true |
||
174 | ); |
||
175 | |||
176 | wp_localize_script( |
||
177 | 'jetpack-connection-banner-js', |
||
178 | 'jp_banner', |
||
179 | array( |
||
180 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
||
181 | 'connectionBannerNonce' => wp_create_nonce( 'jp-connection-banner-nonce' ), |
||
182 | ) |
||
183 | ); |
||
184 | } |
||
185 | |||
186 | /** |
||
187 | * Renders the new connection banner as of 4.4.0. |
||
188 | * |
||
189 | * @since 7.2 Copy and visual elements reduced to show the new focus of Jetpack on Security and Performance. |
||
190 | * @since 4.4.0 |
||
191 | */ |
||
192 | function render_banner() { ?> |
||
193 | <div id="message" class="updated jp-wpcom-connect__container"> |
||
194 | <div class="jp-wpcom-connect__container-top-text"> |
||
195 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="0" fill="none" width="24" height="24"/><g><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2l-.5-6h3l-.5 6z"/></g></svg> |
||
196 | <span><?php esc_html_e( 'You’re almost done. Set up Jetpack to boost your site performance and unlock powerful customization, marketing, and security tools.', 'jetpack' ); ?></span> |
||
197 | </div> |
||
198 | <div class="jp-wpcom-connect__inner-container"> |
||
199 | <span |
||
200 | class="notice-dismiss connection-banner-dismiss" |
||
201 | title="<?php esc_attr_e( 'Dismiss this notice', 'jetpack' ); ?>"> |
||
202 | </span> |
||
203 | |||
204 | <div class="jp-wpcom-connect__content-container"> |
||
205 | |||
206 | <!-- slide 1: intro --> |
||
207 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-one jp__slide-is-active"> |
||
208 | |||
209 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
210 | <?php echo self::get_jetpack_logo(); ?> |
||
211 | <img |
||
212 | src="<?php echo plugins_url( 'images/jetpack-powering-up.svg', JETPACK__PLUGIN_FILE ); ?>" |
||
213 | class="jp-wpcom-connect__hide-phone-and-smaller" |
||
214 | alt="<?php esc_attr_e( |
||
215 | 'Jetpack premium services offer even more powerful performance, security, ' . |
||
216 | 'and revenue tools to help you keep your site safe, fast, and help generate income.', |
||
217 | 'jetpack' |
||
218 | ); ?>" |
||
219 | height="auto" |
||
220 | width="225" |
||
221 | /> |
||
222 | </div> |
||
223 | |||
224 | <div class="jp-wpcom-connect__slide-text"> |
||
225 | <h2><?php esc_html_e( 'Simplify your site security and performance with Jetpack', 'jetpack' ) ?></h2> |
||
226 | |||
227 | <p> |
||
228 | <?php |
||
229 | esc_html_e( |
||
230 | 'Jetpack free protects your site against brute force attacks and unauthorized logins. Our premium security servives also include unlimited backups of your entire site, spam protection, malware scanning, and automated fixes.', |
||
231 | 'jetpack' |
||
232 | ); |
||
233 | ?> |
||
234 | </p> |
||
235 | |||
236 | <p> |
||
237 | <?php |
||
238 | esc_html_e( |
||
239 | 'Activate Jetpack’s site accelerator to load pages faster, optimize your images, and serve your images and static files (like CSS and JavaScript) from our global network of WordPress.com servers. Speed up your site for mobile viewers and reduce bandwidth usage, which may lead to lower hosting costs.', |
||
240 | 'jetpack' |
||
241 | ); |
||
242 | ?> |
||
243 | </p> |
||
244 | |||
245 | <div class="jp-banner__button-container"> |
||
246 | <span class="jp-banner__tos-blurb"><?php jetpack_render_tos_blurb(); ?></span> |
||
247 | <a |
||
248 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '72' ) ); ?>" |
||
249 | class="dops-button is-primary"> |
||
250 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
251 | </a> |
||
252 | </div> |
||
253 | </div> |
||
254 | </div> <!-- end slide 1 --> |
||
255 | </div> |
||
256 | </div> |
||
257 | </div> |
||
258 | <?php |
||
259 | } |
||
260 | |||
261 | /** |
||
262 | * Renders a split-test banner as of 5.3.0. |
||
263 | * |
||
264 | * @since 5.3.0 |
||
265 | */ |
||
266 | function render_banner_b() { ?> |
||
267 | <div id="message" class="updated jp-wpcom-connect__container"> |
||
268 | <div class="jp-wpcom-connect__inner-container"> |
||
269 | <span |
||
270 | class="notice-dismiss connection-banner-dismiss" |
||
271 | title="<?php esc_attr_e( 'Dismiss this notice', 'jetpack' ); ?>"> |
||
272 | </span> |
||
273 | |||
274 | <div class="jp-wpcom-connect__vertical-nav"> |
||
275 | <div class="jp-wpcom-connect__vertical-nav-container"> |
||
276 | <div class="vertical-menu__feature-item jp-feature-intro vertical-menu__feature-item-is-selected"> |
||
277 | <div class="vertical-menu__feature-item-icon"> |
||
278 | <svg class="jp-wpcom-connect__svg-jetpack" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" version="1.1"><path d="M14.4 11.3L10.5 18.1 10.5 8.7 13.7 9.5C14.5 9.7 14.9 10.6 14.4 11.3L14.4 11.3ZM9.6 13.3L6.5 12.5C5.7 12.3 5.3 11.4 5.7 10.7L9.6 3.9 9.6 13.3ZM10 1C4.5 1 0 5.5 0 11 0 16.5 4.5 21 10 21 15.5 21 20 16.5 20 11 20 5.5 15.5 1 10 1L10 1Z" /></svg> |
||
279 | </div> |
||
280 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Welcome to Jetpack', 'jetpack' ); ?></span> |
||
281 | </div> |
||
282 | <div class="vertical-menu__feature-item"> |
||
283 | <div class="vertical-menu__feature-item-icon"> |
||
284 | <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 20 20" version="1.1"><path d="M6 4L6 10.3 9 7 13.9 12.4 14.5 11.7C15.3 10.8 16.7 10.8 17.5 11.7L18 12.2 18 4 6 4ZM20 4L20 16C20 17.1 19.1 18 18 18L6 18C4.9 18 4 17.1 4 16L4 4C4 2.9 4.9 2 6 2L18 2C19.1 2 20 2.9 20 4L20 4ZM2 20L16 20 16 20C16 21.1 15.1 22 14 22L2 22C0.9 22 0 21.1 0 20L0 8C0 6.9 0.9 6 2 6L2 6 2 20ZM13 7.5C13 6.7 13.7 6 14.5 6 15.3 6 16 6.7 16 7.5 16 8.3 15.3 9 14.5 9 13.7 9 13 8.3 13 7.5L13 7.5Z" /></svg> |
||
285 | </div> |
||
286 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Create Your Site', 'jetpack' ); ?></span> |
||
287 | </div> |
||
288 | <div class="vertical-menu__feature-item"> |
||
289 | <div class="vertical-menu__feature-item-icon"> |
||
290 | <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 2 20 20" version="1.1"><path d="M7.8 17.6L12.2 17.6 12.2 2 7.8 2 7.8 17.6ZM14.4 17.6L18.9 17.6 18.9 5.3 14.4 5.3 14.4 17.6ZM1.1 17.6L5.6 17.6 5.6 9.8 1.1 9.8 1.1 17.6ZM0 22L20 22 20 19.8 0 19.8 0 22Z" /></svg> |
||
291 | </div> |
||
292 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Make It Successful', 'jetpack' ); ?></span> |
||
293 | </div> |
||
294 | <div class="vertical-menu__feature-item"> |
||
295 | <div class="vertical-menu__feature-item-icon"> |
||
296 | <svg xmlns="http://www.w3.org/2000/svg" width="16" height="20" viewBox="0 1 16 20" version="1.1"><defs><polygon points="16 10 16 0 0 0 0 10 0 20 16 20"/></defs><g stroke="none" stroke-width="1" transform="translate(0.000000, 1.000000)"><mask fill="white"/><path d="M9 13.7L9 16 7 16 7 13.7C6.4 13.4 6 12.7 6 12 6 10.9 6.9 10 8 10 9.1 10 10 10.9 10 12 10 12.7 9.6 13.4 9 13.7L9 13.7ZM5 5C5 3.3 6.3 2 8 2 9.7 2 11 3.3 11 5L11 6 5 6 5 5ZM14 6L13 6 13 5C13 2.2 10.8 0 8 0 5.2 0 3 2.2 3 5L3 6 2 6C0.9 6 0 6.9 0 8L0 18C0 19.1 0.9 20 2 20L14 20C15.1 20 16 19.1 16 18L16 8C16 6.9 15.1 6 14 6L14 6Z" mask="url(#mask-2)"/></g></svg> |
||
297 | </div> |
||
298 | <span class="vertical-menu__feature-item-label"><?php esc_html_e( 'Keep It Safe', 'jetpack' ); ?></span> |
||
299 | </div> |
||
300 | </div> |
||
301 | </div> |
||
302 | <div class="jp-wpcom-connect__content-container"> |
||
303 | |||
304 | <!-- slide 1: intro --> |
||
305 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-one jp__slide-is-active"> |
||
306 | <h2><?php esc_html_e( 'Welcome to Jetpack', 'jetpack' ) ?></h2> |
||
307 | |||
308 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
309 | <img src="<?php echo plugins_url( 'images/jetpack-welcome.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Your site is automatically protected from brute force attacks, plus you can use single sign-on for extra security." height="auto" width="250" /> |
||
310 | </div> |
||
311 | |||
312 | <p> |
||
313 | <?php |
||
314 | esc_html_e( |
||
315 | 'Jetpack is the best way to experience WordPress, whether your site is brand new or already well established.', |
||
316 | 'jetpack' |
||
317 | ); |
||
318 | ?> |
||
319 | </p> |
||
320 | |||
321 | <p> |
||
322 | <?php |
||
323 | esc_html_e( |
||
324 | 'You get themes and tools to design your site, marketing services to make it successful, and state-of-the-art security.', |
||
325 | 'jetpack' |
||
326 | ); |
||
327 | ?> |
||
328 | </p> |
||
329 | |||
330 | <p> |
||
331 | <?php |
||
332 | esc_html_e( |
||
333 | 'Connect to WordPress.com (free) to get started.', |
||
334 | 'jetpack' |
||
335 | ); |
||
336 | ?> |
||
337 | </p> |
||
338 | |||
339 | <p class="jp-banner__button-container"> |
||
340 | <span class="jp-banner__tos-blurb"> |
||
341 | <?php jetpack_render_tos_blurb(); ?> |
||
342 | </span> |
||
343 | <a |
||
344 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 1 ) ); ?>" |
||
0 ignored issues
–
show
|
|||
345 | class="dops-button is-primary"> |
||
346 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
347 | </a> |
||
348 | <a |
||
349 | href="#" |
||
350 | class="dops-button next-feature" |
||
351 | title="<?php |
||
352 | esc_attr_e( |
||
353 | 'Start tour to Learn about the benefits you receive when you connect Jetpack to WordPress.com', |
||
354 | 'jetpack' |
||
355 | ); |
||
356 | ?>"> |
||
357 | <?php esc_html_e( 'Start quick tour', 'jetpack' ); ?> |
||
358 | </a> |
||
359 | </p> |
||
360 | </div> <!-- end slide 1 --> |
||
361 | |||
362 | <!-- slide 2: design --> |
||
363 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-two"> |
||
364 | <h2><?php esc_html_e( 'Code-Free Design and Publishing', 'jetpack' ) ?></h2> |
||
365 | |||
366 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
367 | <img src="<?php echo plugins_url( 'images/customize-theme.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Customization tools and widgets help you make your site look great without writing any code" height="auto" width="225" /> |
||
368 | </div> |
||
369 | |||
370 | <p> |
||
371 | <?php |
||
372 | esc_html_e( |
||
373 | 'Jetpack gives you access to more than 100 free and 200 premium WordPress themes.', |
||
374 | 'jetpack' |
||
375 | ); |
||
376 | ?> |
||
377 | </p> |
||
378 | |||
379 | <p> |
||
380 | <?php |
||
381 | esc_html_e( |
||
382 | 'Customization tools and widgets help you make your site look great without writing any code, and our CDN speeds up your images.', |
||
383 | 'jetpack' |
||
384 | ); |
||
385 | ?> |
||
386 | </p> |
||
387 | |||
388 | <p> |
||
389 | <?php |
||
390 | esc_html_e( |
||
391 | 'Publish with ease using WordPress.com or the official WordPress mobile apps.', |
||
392 | 'jetpack' |
||
393 | ); |
||
394 | ?> |
||
395 | </p> |
||
396 | |||
397 | <p class="jp-banner__button-container"> |
||
398 | <span class="jp-banner__tos-blurb"> |
||
399 | <?php jetpack_render_tos_blurb(); ?> |
||
400 | </span> |
||
401 | <a href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 2 ) ); ?>" class="dops-button is-primary"> |
||
0 ignored issues
–
show
The call to
Jetpack_Connection_Banne...connect_url_for_slide() has too many arguments starting with 2 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
402 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
403 | </a> |
||
404 | <a href="#" class="dops-button next-feature" title="<?php esc_attr_e( 'Jetpack Tour: Next Feature', 'jetpack' ); ?>"> |
||
405 | <?php esc_html_e( 'Next feature', 'jetpack' ); ?> |
||
406 | </a> |
||
407 | </p> |
||
408 | </div> <!-- end slide 2 --> |
||
409 | |||
410 | <!-- slide 3: marketing --> |
||
411 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-three"> |
||
412 | <h2><?php esc_html_e( 'Get The Traffic You Deserve', 'jetpack' ) ?></h2> |
||
413 | |||
414 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
415 | <img src="<?php echo plugins_url( 'images/stats-people.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Get clear and concise stats and analytics about your visitors." height="auto" width="265" /> |
||
416 | </div> |
||
417 | |||
418 | <p> |
||
419 | <?php |
||
420 | esc_html_e( |
||
421 | 'A site without traffic is like a car without gas. Jetpack helps you fill up so that you can achieve your goals.', |
||
422 | 'jetpack' |
||
423 | ); |
||
424 | ?> |
||
425 | </p> |
||
426 | |||
427 | <p> |
||
428 | <?php |
||
429 | esc_html_e( |
||
430 | 'Kickstart your marketing with social media automation tools, related content, email subscriptions, and sharing tools.', |
||
431 | 'jetpack' |
||
432 | ); |
||
433 | ?> |
||
434 | </p> |
||
435 | |||
436 | <p> |
||
437 | <?php |
||
438 | esc_html_e( |
||
439 | 'You also get clear and concise stats and analytics about your visitors.', |
||
440 | 'jetpack' |
||
441 | ); |
||
442 | ?> |
||
443 | </p> |
||
444 | |||
445 | <p class="jp-banner__button-container"> |
||
446 | <span class="jp-banner__tos-blurb"> |
||
447 | <?php jetpack_render_tos_blurb(); ?> |
||
448 | </span> |
||
449 | <a |
||
450 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 3 ) ); ?>" |
||
0 ignored issues
–
show
The call to
Jetpack_Connection_Banne...connect_url_for_slide() has too many arguments starting with 3 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
451 | class="dops-button is-primary"> |
||
452 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
453 | </a> |
||
454 | <a href="#" class="dops-button next-feature" title="<?php esc_attr_e( 'Jetpack Tour: Next Feature', 'jetpack' ); ?>"> |
||
455 | <?php esc_html_e( 'Next feature', 'jetpack' ); ?> |
||
456 | </a> |
||
457 | </p> |
||
458 | </div> <!-- end slide 3 --> |
||
459 | |||
460 | <!-- slide 4: security --> |
||
461 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-four"> |
||
462 | <h2><?php esc_html_e( 'Make Sure Your Site Is Always Online', 'jetpack' ) ?></h2> |
||
463 | |||
464 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
465 | <img src="<?php echo plugins_url( 'images/security.svg', JETPACK__PLUGIN_FILE ); ?>" alt="Your site is automatically protected from brute force attacks, plus you can use single sign-on for extra security." height="auto" width="250" /> |
||
466 | </div> |
||
467 | |||
468 | <p> |
||
469 | <?php |
||
470 | esc_html_e( 'Jetpack checks your site every few minutes, and if it\'s offline we\'ll notify you instantly.', |
||
471 | 'jetpack' |
||
472 | ); |
||
473 | ?> |
||
474 | </p> |
||
475 | |||
476 | <p> |
||
477 | <?php |
||
478 | esc_html_e( 'Your site is automatically protected from brute force attacks, plus you can use single sign-on for extra security.', |
||
479 | 'jetpack' |
||
480 | ); |
||
481 | ?> |
||
482 | </p> |
||
483 | |||
484 | <?php if ( Jetpack::show_backups_ui() ): ?> |
||
485 | <p> |
||
486 | <?php |
||
487 | esc_html_e( 'Paying customers also benefit from automated backups, malware scans, and priority support.', |
||
488 | 'jetpack' |
||
489 | ); |
||
490 | ?> |
||
491 | </p> |
||
492 | <?php endif; ?> |
||
493 | |||
494 | <p class="jp-banner__button-container"> |
||
495 | <span class="jp-banner__tos-blurb"> |
||
496 | <?php jetpack_render_tos_blurb(); ?> |
||
497 | </span> |
||
498 | <a |
||
499 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '53', 4 ) ); ?>" |
||
0 ignored issues
–
show
The call to
Jetpack_Connection_Banne...connect_url_for_slide() has too many arguments starting with 4 .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
|||
500 | class="dops-button is-primary"> |
||
501 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
502 | </a> |
||
503 | </p> |
||
504 | </div> <!-- end slide 4 --> |
||
505 | </div> |
||
506 | </div> |
||
507 | </div> |
||
508 | <?php |
||
509 | } |
||
510 | |||
511 | /** |
||
512 | * Renders the full-screen connection prompt. Only shown once and on plugin activation. |
||
513 | */ |
||
514 | public static function render_connect_prompt_full_screen() { |
||
515 | $current_screen = get_current_screen(); |
||
516 | |||
517 | if ( 'plugins' === $current_screen->base ) { |
||
518 | $bottom_connect_url_from = 'full-screen-prompt'; |
||
519 | } else { |
||
520 | $bottom_connect_url_from = 'landing-page-bottom'; |
||
521 | } |
||
522 | ?> |
||
523 | <div class="jp-connect-full__container"><div class="jp-connect-full__container-card"> |
||
524 | |||
525 | <?php if ( 'plugins' === $current_screen->base ) : ?> |
||
526 | <?php echo self::get_jetpack_logo(); ?> |
||
527 | |||
528 | <div class="jp-connect-full__dismiss"> |
||
529 | <svg class="jp-connect-full__svg-dismiss" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><title>Dismiss Jetpack Connection Window</title><rect x="0" fill="none" /><g><path d="M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"/></g></svg> |
||
530 | </div> |
||
531 | <?php endif; ?> |
||
532 | |||
533 | <div class="jp-connect-full__step-header"> |
||
534 | <h2 class="jp-connect-full__step-header-title"><?php esc_html_e( 'Activate essential WordPress security and performance tools by setting up Jetpack', 'jetpack' ) ?></h2> |
||
535 | </div> |
||
536 | |||
537 | <div class="jp-connect-full__row"> |
||
538 | <div class="jp-connect-full__slide"> |
||
539 | <div class="jp-connect-full__slide-card illustration"> |
||
540 | <img |
||
541 | src="<?php echo plugins_url( 'images/security.svg', JETPACK__PLUGIN_FILE ); ?>" |
||
542 | alt="<?php esc_attr_e( 'Security & Backups', 'jetpack' ); ?>" |
||
543 | /> |
||
544 | </div> |
||
545 | <div class="jp-connect-full__slide-card"> |
||
546 | <p><?php |
||
547 | esc_html_e( |
||
548 | 'Jetpack protects you against brute force attacks and unauthorized logins. ' . |
||
549 | 'Basic protection is always free, while premium plans add unlimited backups of your whole site, ' . |
||
550 | 'spam protection, malware scanning, and automated fixes.', |
||
551 | 'jetpack' |
||
552 | ); |
||
553 | ?></p> |
||
554 | </div> |
||
555 | </div> |
||
556 | <div class="jp-connect-full__slide"> |
||
557 | <div class="jp-connect-full__slide-card illustration"> |
||
558 | <img |
||
559 | src="<?php echo plugins_url( 'images/jetpack-speed.svg', JETPACK__PLUGIN_FILE ); ?>" |
||
560 | alt="<?php esc_attr_e( 'Built-in Performance', 'jetpack' ); ?>" |
||
561 | /> |
||
562 | </div> |
||
563 | <div class="jp-connect-full__slide-card"> |
||
564 | <p><?php |
||
565 | esc_html_e( |
||
566 | "Activate site accelerator tools and watch your page load times and hosting costs drop—" . |
||
567 | "we'll optimize your images and serve them from our own powerful global network of servers, " . |
||
568 | "and speed up your mobile site to reduce bandwidth usage.", |
||
569 | 'jetpack' |
||
570 | ); |
||
571 | ?></p> |
||
572 | </div> |
||
573 | </div> |
||
574 | </div> |
||
575 | |||
576 | <p class="jp-connect-full__tos-blurb"> |
||
577 | <?php jetpack_render_tos_blurb(); ?> |
||
578 | </p> |
||
579 | <p class="jp-connect-full__button-container"> |
||
580 | <a href="<?php echo esc_url( Jetpack::init()->build_connect_url( true, false, $bottom_connect_url_from ) ); ?>" class="dops-button is-primary"> |
||
581 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
582 | </a> |
||
583 | </p> |
||
584 | <?php if ( 'plugins' === $current_screen->base ) : ?> |
||
585 | <p class="jp-connect-full__dismiss-paragraph"> |
||
586 | <a> |
||
587 | <?php echo esc_html_x( |
||
588 | 'Not now, thank you.', 'a link that closes the modal window that offers to connect Jetpack', 'jetpack' |
||
589 | ); ?> |
||
590 | </a> |
||
591 | </p> |
||
592 | <?php endif; ?> |
||
593 | </div></div> |
||
594 | <?php |
||
595 | } |
||
596 | |||
597 | /** |
||
598 | * Renders the legacy network connection banner. |
||
599 | */ |
||
600 | function network_connect_notice() { |
||
601 | ?> |
||
602 | <div id="message" class="updated jetpack-message"> |
||
603 | <div class="squeezer"> |
||
604 | <h2> |
||
605 | <?php |
||
606 | echo wp_kses( |
||
607 | __( |
||
608 | '<strong>Jetpack is activated!</strong> Each site on your network must be connected individually by an admin on that site.', |
||
609 | 'jetpack' |
||
610 | ), |
||
611 | array( 'strong' => array() ) |
||
612 | ); |
||
613 | ?> |
||
614 | </h2> |
||
615 | </div> |
||
616 | </div> |
||
617 | <?php |
||
618 | } |
||
619 | } |
||
620 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.