Conditions | 1 |
Paths | 1 |
Total Lines | 66 |
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 |
||
141 | public function render_banner() { |
||
142 | $jetpack_logo = new Jetpack_Logo(); |
||
143 | $powering_up_logo = plugins_url( 'images/jetpack-powering-up.svg', JETPACK__PLUGIN_FILE ); |
||
144 | |||
145 | ?> |
||
146 | <div id="jp-wizard-banner" class="jp-wizard-banner"> |
||
147 | <span |
||
148 | class="notice-dismiss wizard-banner-dismiss" |
||
149 | title="<?php esc_attr_e( 'Dismiss this notice', 'jetpack' ); ?>"> |
||
150 | </span> |
||
151 | <div class="jp-emblem"> |
||
152 | <?php |
||
153 | echo $jetpack_logo->get_jp_emblem_larger(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
||
154 | ?> |
||
155 | </div> |
||
156 | <img |
||
157 | class="powering-up-img" |
||
158 | width="200px" |
||
159 | height="200px" |
||
160 | src="<?php echo esc_url( $powering_up_logo ); ?>" |
||
161 | alt="<?php esc_attr_e( 'A jetpack site powering up', 'jetpack' ); ?>" |
||
162 | /> |
||
163 | <h2 class="jp-wizard-banner-wizard-header"> |
||
164 | <?php esc_html_e( 'Set up Jetpack for better site security, performance, and more', 'jetpack' ); ?> |
||
165 | </h2> |
||
166 | <p class="jp-wizard-banner-wizard-paragraph"> |
||
167 | <?php esc_html_e( 'Jetpack is a cloud-powered tool built by Automattic.', 'jetpack' ); ?> |
||
168 | </p> |
||
169 | <p class="jp-wizard-banner-wizard-paragraph"> |
||
170 | <?php esc_html_e( 'Answer a few questions and we’ll help you secure, speed up, customize, and grow your WordPress website.', 'jetpack' ); ?> |
||
171 | </p> |
||
172 | <div class="jp-wizard-banner-wizard-intro-question"> |
||
173 | <h2> |
||
174 | <?php |
||
175 | /* translators: %s is the site name */ |
||
176 | printf( |
||
177 | /* translators: %s is the site name */ |
||
178 | esc_html__( 'What will %s be used for?', 'jetpack' ), |
||
179 | esc_html( get_bloginfo( 'name' ) ) |
||
180 | ); |
||
181 | ?> |
||
182 | </h2> |
||
183 | <div class="jp-wizard-banner-wizard-answer-buttons"> |
||
184 | <a |
||
185 | class="button button-primary jp-wizard-banner-wizard-button" |
||
186 | href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack#/setup/income?use=personal' ) ); ?>" |
||
187 | > |
||
188 | <?php esc_html_e( 'Personal Use', 'jetpack' ); ?> |
||
189 | </a> |
||
190 | <a |
||
191 | class="button button-primary jp-wizard-banner-wizard-button" |
||
192 | href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack#/setup/income?use=business' ) ); ?>" |
||
193 | > |
||
194 | <?php esc_html_e( 'Business Use', 'jetpack' ); ?> |
||
195 | </a> |
||
196 | </div> |
||
197 | <a |
||
198 | class="jp-wizard-banner-wizard-skip-link" |
||
199 | href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack#/setup/features' ) ); ?>" |
||
200 | > |
||
201 | <?php esc_html_e( 'Skip to recommended features', 'jetpack' ); ?> |
||
202 | </a> |
||
203 | </div> |
||
204 | </div> |
||
205 | <?php |
||
206 | } |
||
207 | } |
||
208 |