Conditions | 1 |
Paths | 1 |
Total Lines | 68 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
144 | function render_banner() { ?> |
||
145 | <div id="message" class="updated jp-wpcom-connect__container"> |
||
146 | <div class="jp-wpcom-connect__container-top-text"> |
||
147 | <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> |
||
148 | <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> |
||
149 | </div> |
||
150 | <div class="jp-wpcom-connect__inner-container"> |
||
151 | <span |
||
152 | class="notice-dismiss connection-banner-dismiss" |
||
153 | title="<?php esc_attr_e( 'Dismiss this notice', 'jetpack' ); ?>"> |
||
154 | </span> |
||
155 | |||
156 | <div class="jp-wpcom-connect__content-container"> |
||
157 | |||
158 | <!-- slide 1: intro --> |
||
159 | <div class="jp-wpcom-connect__slide jp-wpcom-connect__slide-one jp__slide-is-active"> |
||
160 | |||
161 | <div class="jp-wpcom-connect__content-icon jp-connect-illo"> |
||
162 | <?php echo self::get_jetpack_logo(); ?> |
||
163 | <img |
||
164 | src="<?php echo plugins_url( 'images/jetpack-powering-up.svg', JETPACK__PLUGIN_FILE ); ?>" |
||
165 | class="jp-wpcom-connect__hide-phone-and-smaller" |
||
166 | alt="<?php esc_attr_e( |
||
167 | 'Jetpack premium services offer even more powerful performance, security, ' . |
||
168 | 'and revenue tools to help you keep your site safe, fast, and help generate income.', |
||
169 | 'jetpack' |
||
170 | ); ?>" |
||
171 | height="auto" |
||
172 | width="225" |
||
173 | /> |
||
174 | </div> |
||
175 | |||
176 | <div class="jp-wpcom-connect__slide-text"> |
||
177 | <h2><?php esc_html_e( 'Simplify your site security and performance with Jetpack', 'jetpack' ) ?></h2> |
||
178 | |||
179 | <p> |
||
180 | <?php |
||
181 | esc_html_e( |
||
182 | '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.', |
||
183 | 'jetpack' |
||
184 | ); |
||
185 | ?> |
||
186 | </p> |
||
187 | |||
188 | <p> |
||
189 | <?php |
||
190 | esc_html_e( |
||
191 | '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.', |
||
192 | 'jetpack' |
||
193 | ); |
||
194 | ?> |
||
195 | </p> |
||
196 | |||
197 | <div class="jp-banner__button-container"> |
||
198 | <span class="jp-banner__tos-blurb"><?php jetpack_render_tos_blurb(); ?></span> |
||
199 | <a |
||
200 | href="<?php echo esc_url( $this->build_connect_url_for_slide( '72' ) ); ?>" |
||
201 | class="dops-button is-primary"> |
||
202 | <?php esc_html_e( 'Set up Jetpack', 'jetpack' ); ?> |
||
203 | </a> |
||
204 | </div> |
||
205 | </div> |
||
206 | </div> <!-- end slide 1 --> |
||
207 | </div> |
||
208 | </div> |
||
209 | </div> |
||
210 | <?php |
||
211 | } |
||
212 | |||
236 |