| Conditions | 1 |
| Paths | 1 |
| Total Lines | 57 |
| 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 |
||
| 110 | public function render_banner() { |
||
| 111 | $jetpack_logo = new Jetpack_Logo(); |
||
| 112 | ?> |
||
| 113 | |||
| 114 | <div id="jp-wizard-banner" class=""> |
||
| 115 | <div class="jp-setup-wizard-intro"> |
||
| 116 | <span |
||
| 117 | class="notice-dismiss wizard-banner-dismiss" |
||
| 118 | title="<?php esc_attr_e( 'Dismiss this notice', 'jetpack' ); ?>"> |
||
| 119 | </span> |
||
| 120 | <div class="jp-emblem"> |
||
| 121 | <?php |
||
| 122 | echo $jetpack_logo->get_jp_emblem_larger(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
||
| 123 | ?> |
||
| 124 | </div> |
||
| 125 | <img |
||
| 126 | width="200px" |
||
| 127 | height="200px" |
||
| 128 | src=" |
||
| 129 | <?php |
||
| 130 | esc_attr_e( plugins_url( 'images/jetpack-powering-up.svg', JETPACK__PLUGIN_FILE ), 'jetpack' ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText |
||
| 131 | ?> |
||
| 132 | " |
||
| 133 | alt="<?php esc_attr_e( 'A jetpack site powering up', 'jetpack' ); ?>" |
||
| 134 | /> |
||
| 135 | <h1 class="jp-setup-wizard-header"> |
||
| 136 | <?php esc_html_e( 'Set up Jetpack for better site security, performance, and more', 'jetpack' ); ?> |
||
| 137 | </h1> |
||
| 138 | <p class="jp-setup-wizard-paragraph"> |
||
| 139 | <?php esc_html_e( 'Jetpack is a cloud-powered tool built by Automattic.', 'jetpack' ); ?> |
||
| 140 | </p> |
||
| 141 | <p class="jp-setup-wizard-paragraph"> |
||
| 142 | <?php esc_html_e( 'Answer a few questions and we’ll help you secure, speed up, customize, and grow your WordPress website.', 'jetpack' ); ?> |
||
| 143 | </p> |
||
| 144 | <div class="jp-setup-wizard-intro-question"> |
||
| 145 | <h2> |
||
| 146 | <?php |
||
| 147 | /* translators: %s is the site name */ |
||
| 148 | esc_html_e( sprintf( 'What will %s be used for?', get_bloginfo( 'name' ) ), 'jetpack' ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText |
||
| 149 | ?> |
||
| 150 | </h2> |
||
| 151 | <div class="jp-setup-wizard-answer-buttons"> |
||
| 152 | <a class="button button-primary jp-setup-wizard-button" href="setup/income?use=personal"> |
||
| 153 | <?php esc_html_e( 'Personal Use', 'jetpack' ); ?> |
||
| 154 | </a> |
||
| 155 | <a class="button button-primary jp-setup-wizard-button" href="setup/income?use=business"> |
||
| 156 | <?php esc_html_e( 'Business Use', 'jetpack' ); ?> |
||
| 157 | </a> |
||
| 158 | </div> |
||
| 159 | <a class="jp-setup-wizard-skip-link" href="setup/features"> |
||
| 160 | <?php esc_html_e( 'Skip to recommended features', 'jetpack' ); ?> |
||
| 161 | </a> |
||
| 162 | </div> |
||
| 163 | </div> |
||
| 164 | </div> |
||
| 165 | <?php |
||
| 166 | } |
||
| 167 | } |
||
| 168 |