← All changes
|
inc/TemplateHooks/Admin/Notices/AdminNotesTemplate.php
+43
-60
4.4.9.1
→
4.4.10
View file →
| @@ -115,15 +115,12 @@ | ||
| 115 | 115 | return ''; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $message = sprintf( |
| 119 | - '<div>%s</div>', | |
| 120 | - sprintf( | |
| 121 | - '<strong>wp_remote</strong>: %s. <a href="%s">%s</a>', | |
| 122 | - $result->get_error_message(), | |
| 123 | - esc_url( admin_url( 'site-health.php' ) ), | |
| 124 | - esc_html__( 'Check Site Health', 'learnpress' ) | |
| 125 | - ) | |
| 119 | + '<strong>wp_remote</strong>: %s. <a href="%s">%s</a>', | |
| 120 | + $result->get_error_message(), | |
| 121 | + esc_url( admin_url( 'site-health.php' ) ), | |
| 122 | + esc_html__( 'Check Site Health', 'learnpress' ) | |
| 126 | 123 | ); |
| 127 | 124 | |
| 128 | 125 | return Template::print_message( $message, 'error', false ); |
| 129 | 126 | } |
| @@ -139,19 +136,16 @@ | ||
| 139 | 136 | if ( ! AdminNoticeService::check_plugin_base() ) { |
| 140 | 137 | return ''; |
| 141 | 138 | } |
| 142 | 139 | |
| 143 | - $message = sprintf( | |
| 144 | - '<div>%s</div>', | |
| 145 | - sprintf( | |
| 146 | - /* translators: 1: expected plugin basename wrapped in strong, 2: current plugin basename wrapped in strong */ | |
| 147 | - __( | |
| 148 | - 'The LearnPress plugin base directory must be %1$s (case-sensitive) to ensure all functions work properly and are fully operational (currently %2$s).', | |
| 149 | - 'learnpress' | |
| 150 | - ), | |
| 151 | - '<strong>learnpress/learnpress.php</strong>', | |
| 152 | - '<strong>' . LP_PLUGIN_BASENAME . '</strong>' | |
| 153 | - ) | |
| 140 | + $message = sprintf( | |
| 141 | + /* translators: 1: expected plugin basename wrapped in strong, 2: current plugin basename wrapped in strong */ | |
| 142 | + __( | |
| 143 | + 'The LearnPress plugin base directory must be %1$s (case-sensitive) to ensure all functions work properly and are fully operational (currently %2$s).', | |
| 144 | + 'learnpress' | |
| 145 | + ), | |
| 146 | + '<strong>learnpress/learnpress.php</strong>', | |
| 147 | + '<strong>' . LP_PLUGIN_BASENAME . '</strong>' | |
| 154 | 148 | ); |
| 155 | 149 | |
| 156 | 150 | return Template::print_message( $message, 'warning', false ); |
| 157 | 151 | } |
| @@ -161,8 +155,9 @@ | ||
| 161 | 155 | * |
| 162 | 156 | * @param array $data Request arguments. |
| 163 | 157 | * |
| 164 | 158 | * @return string |
| 159 | + * @throws Exception | |
| 165 | 160 | */ |
| 166 | 161 | public static function html_lp_upgrade_db( array $data = [] ): string { |
| 167 | 162 | if ( ! LP_Updater::instance()->check_lp_db_need_upgrade() ) { |
| 168 | 163 | return ''; |
| @@ -168,18 +163,15 @@ | ||
| 168 | 163 | return ''; |
| 169 | 164 | } |
| 170 | 165 | |
| 171 | 166 | $message = sprintf( |
| 172 | - '<div>%s</div>', | |
| 173 | - sprintf( | |
| 174 | - '%s | |
| 175 | - <div style="margin-top: 0.5em"> | |
| 176 | - <a class="button lp-btn-go-upgrade-db" data-context="message" href="%s">%s</a> | |
| 177 | - </div>', | |
| 178 | - __( '<strong>LearnPress update</strong> – We need to update your database to the latest version.', 'learnpress' ), | |
| 179 | - admin_url( 'admin.php?page=learn-press-tools&tab=database&action=upgrade-db' ), | |
| 180 | - esc_html__( 'Go to Update', 'learnpress' ) | |
| 181 | - ) | |
| 167 | + '%s | |
| 168 | + <div style="margin-top: 0.5em"> | |
| 169 | + <a class="button lp-btn-go-upgrade-db" data-context="message" href="%s">%s</a> | |
| 170 | + </div>', | |
| 171 | + __( '<strong>LearnPress update</strong> – We need to update your database to the latest version.', 'learnpress' ), | |
| 172 | + admin_url( 'admin.php?page=learn-press-tools&tab=database&action=upgrade-db' ), | |
| 173 | + esc_html__( 'Go to Update', 'learnpress' ) | |
| 182 | 174 | ); |
| 183 | 175 | |
| 184 | 176 | return Template::print_message( $message, 'warning', false ); |
| 185 | 177 | } |
| @@ -197,13 +189,10 @@ | ||
| 197 | 189 | return ''; |
| 198 | 190 | } |
| 199 | 191 | |
| 200 | 192 | $message = sprintf( |
| 201 | - '<div>%s</div>', | |
| 202 | - sprintf( | |
| 203 | - 'LearnPress requires permalink option <strong>Post name</strong> is enabled. Please enable it <a href="%s">here</a> to ensure that all functions work properly.', | |
| 204 | - admin_url( 'options-permalink.php' ) | |
| 205 | - ) | |
| 193 | + 'LearnPress requires permalink option <strong>Post name</strong> is enabled. Please enable it <a href="%s">here</a> to ensure that all functions work properly.', | |
| 194 | + admin_url( 'options-permalink.php' ) | |
| 206 | 195 | ); |
| 207 | 196 | |
| 208 | 197 | return Template::print_message( $message, 'warning', false ); |
| 209 | 198 | } |
| @@ -291,16 +280,13 @@ | ||
| 291 | 280 | return ''; |
| 292 | 281 | } |
| 293 | 282 | |
| 294 | 283 | $message = sprintf( |
| 295 | - '<div>%s</div>', | |
| 296 | - sprintf( | |
| 297 | - '%1$s <strong><a style="color: #E64B50" href="%2$s">%3$s</a></strong>%4$s', | |
| 298 | - esc_html__( 'You have LearnPress Add-on licenses that need to be extended.', 'learnpress' ), | |
| 299 | - esc_url( admin_url( 'admin.php?page=learn-press-addons&tab=license' ) ), | |
| 300 | - esc_html__( 'Check now!', 'learnpress' ), | |
| 301 | - self::html_button_dismiss( 'lp-addons-purchased-extend' ) | |
| 302 | - ) | |
| 284 | + '%1$s <strong><a style="color: #E64B50" href="%2$s">%3$s</a></strong>%4$s', | |
| 285 | + esc_html__( 'You have LearnPress Add-on licenses that need to be extended.', 'learnpress' ), | |
| 286 | + esc_url( admin_url( 'admin.php?page=learn-press-addons&tab=license' ) ), | |
| 287 | + esc_html__( 'Check now!', 'learnpress' ), | |
| 288 | + self::html_button_dismiss( 'lp-addons-purchased-extend' ) | |
| 303 | 289 | ); |
| 304 | 290 | |
| 305 | 291 | return Template::print_message( |
| 306 | 292 | $message, |
| @@ -343,27 +329,24 @@ | ||
| 343 | 329 | esc_html( $version ) |
| 344 | 330 | ); |
| 345 | 331 | |
| 346 | 332 | $message = sprintf( |
| 347 | - '<div>%s</div>', | |
| 348 | - sprintf( | |
| 349 | - '<h3>%1$s</h3> | |
| 350 | - <p>%2$s</p> | |
| 351 | - <p> | |
| 352 | - <a class="button" href="%3$s" target="_blank">%4$s</a> | |
| 353 | - <a class="button" href="%5$s" target="_blank">%6$s</a> | |
| 354 | - <a class="button" href="%7$s" target="_blank">%8$s</a> | |
| 355 | - </p>%9$s', | |
| 356 | - esc_html( $title ), | |
| 357 | - esc_html( $description ), | |
| 358 | - esc_url( $link_download ), | |
| 359 | - __( 'Download', 'learnpress' ), | |
| 360 | - esc_url( $link_feedback ), | |
| 361 | - __( 'Feedback', 'learnpress' ), | |
| 362 | - esc_url( $link_changelog ), | |
| 363 | - __( 'Changelog', 'learnpress' ), | |
| 364 | - self::html_button_dismiss( 'lp-beta-version' ) | |
| 365 | - ) | |
| 333 | + '<h3>%1$s</h3> | |
| 334 | + <p>%2$s</p> | |
| 335 | + <p> | |
| 336 | + <a class="button" href="%3$s" target="_blank">%4$s</a> | |
| 337 | + <a class="button" href="%5$s" target="_blank">%6$s</a> | |
| 338 | + <a class="button" href="%7$s" target="_blank">%8$s</a> | |
| 339 | + </p>%9$s', | |
| 340 | + esc_html( $title ), | |
| 341 | + esc_html( $description ), | |
| 342 | + esc_url( $link_download ), | |
| 343 | + __( 'Download', 'learnpress' ), | |
| 344 | + esc_url( $link_feedback ), | |
| 345 | + __( 'Feedback', 'learnpress' ), | |
| 346 | + esc_url( $link_changelog ), | |
| 347 | + __( 'Changelog', 'learnpress' ), | |
| 348 | + self::html_button_dismiss( 'lp-beta-version' ) | |
| 366 | 349 | ); |
| 367 | 350 | |
| 368 | 351 | return Template::print_message( $message, 'info', false ); |
| 369 | 352 | } |