[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
1 <?php 2 3 //phpcs:disable VariableAnalysis 4 // There are "undefined" variables here because they're defined in the code that includes this file as a template. 5 6 ?> 7 <?php if ( $type == 'plugin' ) : ?> 8 <div class="updated" id="akismet_setup_prompt"> 9 <form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST"> 10 <div class="akismet_activate"> 11 <div class="aa_a">A</div> 12 <div class="aa_button_container"> 13 <div class="aa_button_border"> 14 <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" /> 15 </div> 16 </div> 17 <div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div> 18 </div> 19 </form> 20 </div> 21 <?php elseif ( $type == 'spam-check' ) : ?> 22 <div class="notice notice-warning"> 23 <p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' );?></strong></p> 24 <p><?php esc_html_e( 'Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation and will automatically be rechecked later.', 'akismet' ); ?></p> 25 <?php if ( $link_text ) { ?> 26 <p><?php echo $link_text; ?></p> 27 <?php } ?> 28 </div> 29 <?php elseif ( $type == 'alert' ) : ?> 30 <div class='error'> 31 <p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p> 32 <p><?php echo esc_html( $msg ); ?></p> 33 <p><?php 34 35 /* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */ 36 printf( esc_html__( 'For more information: %s' , 'akismet'), '<a href="https://akismet.com/errors/' . $code . '">https://akismet.com/errors/' . $code . '</a>' ); 37 38 ?> 39 </p> 40 </div> 41 <?php elseif ( $type == 'notice' ) : ?> 42 <div class="akismet-alert akismet-critical"> 43 <h3 class="akismet-key-status failed"><?php echo $notice_header; ?></h3> 44 <p class="akismet-description"> 45 <?php echo $notice_text; ?> 46 </p> 47 </div> 48 <?php elseif ( $type == 'missing-functions' ) : ?> 49 <div class="akismet-alert akismet-critical"> 50 <h3 class="akismet-key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3> 51 <p class="akismet-description"><?php printf( __('Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet’s system requirements</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p> 52 </div> 53 <?php elseif ( $type == 'servers-be-down' ) : ?> 54 <div class="akismet-alert akismet-critical"> 55 <h3 class="akismet-key-status failed"><?php esc_html_e("Your site can’t connect to the Akismet servers.", 'akismet'); ?></h3> 56 <p class="akismet-description"><?php printf( __('Your firewall may be blocking Akismet from connecting to its API. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p> 57 </div> 58 <?php elseif ( $type == 'active-dunning' ) : ?> 59 <div class="akismet-alert akismet-critical"> 60 <h3 class="akismet-key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3> 61 <p class="akismet-description"><?php printf( __('We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p> 62 </div> 63 <?php elseif ( $type == 'cancelled' ) : ?> 64 <div class="akismet-alert akismet-critical"> 65 <h3 class="akismet-key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3> 66 <p class="akismet-description"><?php printf( __('Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p> 67 </div> 68 <?php elseif ( $type == 'suspended' ) : ?> 69 <div class="akismet-alert akismet-critical"> 70 <h3 class="akismet-key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3> 71 <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p> 72 </div> 73 <?php elseif ( $type == 'active-notice' && $time_saved ) : ?> 74 <div class="akismet-alert akismet-active"> 75 <h3 class="akismet-key-status"><?php echo esc_html( $time_saved ); ?></h3> 76 <p class="akismet-description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p> 77 </div> 78 <?php elseif ( $type == 'missing' ) : ?> 79 <div class="akismet-alert akismet-critical"> 80 <h3 class="akismet-key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3> 81 <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p> 82 </div> 83 <?php elseif ( $type == 'no-sub' ) : ?> 84 <div class="akismet-alert akismet-critical"> 85 <h3 class="akismet-key-status failed"><?php esc_html_e( 'You don’t have an Akismet plan.', 'akismet'); ?></h3> 86 <p class="akismet-description"> 87 <?php printf( __( 'In 2012, Akismet began using subscription plans for all accounts (even free ones). A plan has not been assigned to your account, and we’d appreciate it if you’d <a href="%s" target="_blank">sign into your account</a> and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?> 88 <br /><br /> 89 <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?> 90 </p> 91 </div> 92 <?php elseif ( $type == 'new-key-valid' ) : 93 global $wpdb; 94 95 $check_pending_link = false; 96 97 $at_least_one_comment_in_moderation = !! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" ); 98 99 if ( $at_least_one_comment_in_moderation) { 100 $check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' ); 101 } 102 103 ?> 104 <div class="akismet-alert akismet-active"> 105 <h3 class="akismet-key-status"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3> 106 <?php if ( $check_pending_link ) { ?> 107 <p class="akismet-description"><?php printf( __( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p> 108 <?php } ?> 109 </div> 110 <?php elseif ( $type == 'new-key-invalid' ) : ?> 111 <div class="akismet-alert akismet-critical"> 112 <h3 class="akismet-key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3> 113 </div> 114 <?php elseif ( $type == 'existing-key-invalid' ) : ?> 115 <div class="akismet-alert akismet-critical"> 116 <h3 class="akismet-key-status"><?php echo esc_html( __( 'Your API key is no longer valid.', 'akismet' ) ); ?></h3> 117 <p class="akismet-description"> 118 <?php 119 120 echo wp_kses( 121 sprintf( 122 /* translators: The placeholder is a URL. */ 123 __( 'Please enter a new key or <a href="%s" target="_blank">contact Akismet support</a>.', 'akismet' ), 124 'https://akismet.com/contact/' 125 ), 126 array( 127 'a' => array( 128 'href' => true, 129 'target' => true, 130 ), 131 ) 132 ); 133 134 ?> 135 </p> 136 </div> 137 <?php elseif ( $type == 'new-key-failed' ) : ?> 138 <div class="akismet-alert akismet-critical"> 139 <h3 class="akismet-key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3> 140 <p class="akismet-description"> 141 <?php 142 143 echo wp_kses( 144 sprintf( 145 /* translators: The placeholder is a URL. */ 146 __( 'The connection to akismet.com could not be established. Please refer to <a href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet' ), 147 'https://blog.akismet.com/akismet-hosting-faq/' 148 ), 149 array( 150 'a' => array( 151 'href' => true, 152 'target' => true, 153 ), 154 ) 155 ); 156 157 ?> 158 </p> 159 </div> 160 <?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) : ?> 161 <div class="akismet-alert akismet-critical"> 162 <?php if ( $level == 'yellow' ): ?> 163 <h3 class="akismet-key-status failed"><?php esc_html_e( 'You’re using your Akismet key on more sites than your Plus subscription allows.', 'akismet' ); ?></h3> 164 <p class="akismet-description"> 165 <?php 166 167 echo wp_kses( 168 sprintf( 169 /* translators: The placeholder is a URL. */ 170 __( 'Your Plus subscription allows the use of Akismet on only one site. Please <a href="%s" target="_blank">purchase additional Plus subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 171 'https://docs.akismet.com/billing/add-more-sites/' 172 ), 173 array( 174 'a' => array( 175 'href' => true, 176 'target' => true, 177 ), 178 ) 179 ); 180 181 ?> 182 <br /><br /> 183 <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?> 184 </p> 185 <?php elseif ( $level == 'red' ): ?> 186 <h3 class="akismet-key-status failed"><?php esc_html_e( 'You’re using Akismet on far too many sites for your Plus subscription.', 'akismet' ); ?></h3> 187 <p class="akismet-description"> 188 <?php printf( __( 'To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?> 189 <br /><br /> 190 <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?> 191 </p> 192 <?php endif; ?> 193 </div> 194 <?php elseif ( $type == 'usage-limit' && isset( Akismet::$limit_notices[ $code ] ) ) : ?> 195 <div class="error akismet-usage-limit-alert"> 196 <div class="akismet-usage-limit-logo"> 197 <img src="<?php echo esc_url( plugins_url( '../_inc/img/logo-a-2x.png', __FILE__ ) ); ?>" alt="Akismet" /> 198 </div> 199 <div class="akismet-usage-limit-text"> 200 <h3> 201 <?php 202 switch ( Akismet::$limit_notices[ $code ] ) { 203 case 'FIRST_MONTH_OVER_LIMIT': 204 case 'SECOND_MONTH_OVER_LIMIT': 205 esc_html_e( 'Your Akismet account usage is over your plan’s limit', 'akismet' ); 206 break; 207 case 'THIRD_MONTH_APPROACHING_LIMIT': 208 esc_html_e( 'Your Akismet account usage is approaching your plan’s limit', 'akismet' ); 209 break; 210 case 'THIRD_MONTH_OVER_LIMIT': 211 case 'FOUR_PLUS_MONTHS_OVER_LIMIT': 212 esc_html_e( 'Your account has been restricted', 'akismet' ); 213 break; 214 default: 215 } 216 ?> 217 </h3> 218 <p> 219 <?php 220 switch ( Akismet::$limit_notices[ $code ] ) { 221 case 'FIRST_MONTH_OVER_LIMIT': 222 echo esc_html( 223 sprintf( 224 /* translators: The first placeholder is a date, the second is a (formatted) number, the third is another formatted number. */ 225 __( 'Since %1$s, your account made %2$s API calls, compared to your plan’s limit of %3$s.', 'akismet' ), 226 esc_html( gmdate( 'F' ) . ' 1' ), 227 number_format( $api_calls ), 228 number_format( $usage_limit ) 229 ) 230 ); 231 232 echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">'; 233 echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); 234 echo '</a>'; 235 236 break; 237 case 'SECOND_MONTH_OVER_LIMIT': 238 echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Please consider upgrading your plan.', 'akismet' ) ); 239 240 echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">'; 241 echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); 242 echo '</a>'; 243 244 break; 245 case 'THIRD_MONTH_APPROACHING_LIMIT': 246 echo esc_html( __( 'Your Akismet usage is nearing your plan’s limit for the third consecutive month. We will restrict your account after you reach the limit. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) ); 247 248 echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">'; 249 echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); 250 echo '</a>'; 251 252 break; 253 case 'THIRD_MONTH_OVER_LIMIT': 254 case 'FOUR_PLUS_MONTHS_OVER_LIMIT': 255 echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for three consecutive months. We have restricted your account for the rest of the month. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) ); 256 257 echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">'; 258 echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); 259 echo '</a>'; 260 261 break; 262 default: 263 } 264 ?> 265 </p> 266 </div> 267 <div class="akismet-usage-limit-cta"> 268 <a href="<?php echo esc_attr( $upgrade_url ); ?>" class="button" target="_blank"> 269 <?php 270 // If only a qty upgrade is required, show a more generic message. 271 if ( ! empty( $upgrade_type ) && 'qty' === $upgrade_type ) { 272 esc_html_e( 'Upgrade your Subscription Level', 'akismet' ); 273 } else { 274 echo esc_html( 275 sprintf( 276 /* translators: The placeholder is the name of a subscription level, like "Plus" or "Enterprise" . */ 277 __( 'Upgrade to %s', 'akismet' ), 278 $upgrade_plan 279 ) 280 ); 281 } 282 ?> 283 </a> 284 </div> 285 </div> 286 <?php endif; ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Dec 22 01:00:02 2024 | Cross-referenced by PHPXref 0.7.1 |