[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/plugins/akismet/views/ -> compatible-plugins.php (source)

   1  <?php
   2  
   3  /** @var array|WP_Error $compatible_plugins */
   4  $bypass_cache       = ! empty( $_GET['akismet_refresh_compatible_plugins'] );
   5  $compatible_plugins = Akismet_Compatible_Plugins::get_installed_compatible_plugins( $bypass_cache );
   6  if ( is_array( $compatible_plugins ) ) :
   7  
   8      $compatible_plugin_count = count( $compatible_plugins );
   9      ?>
  10      <div class="akismet-card akismet-compatible-plugins">
  11          <div class="akismet-section-header">
  12              <h2 class="akismet-section-header__label  akismet-compatible-plugins__section-header-label">
  13                  <?php esc_html_e( 'Compatible plugins', 'akismet' ); ?>
  14              </h2>
  15          </div>
  16  
  17          <div class="akismet-compatible-plugins__content">
  18              <?php
  19  
  20              echo '<p>';
  21              echo esc_html( __( 'Akismet works with other plugins to keep spam away.', 'akismet' ) );
  22              echo '</p>';
  23  
  24              echo '<p>';
  25  
  26              if ( 0 === $compatible_plugin_count ) {
  27                  echo '<a class="akismet-external-link" href="https://akismet.com/developers/plugins-and-libraries/?utm_source=akismet_plugin&amp;utm_campaign=plugin_static_link&amp;utm_medium=in_plugin&amp;utm_content=compatible_plugins#wordpress-plugins" target="_blank" rel="noopener">';
  28                  echo esc_html( __( 'See supported integrations', 'akismet' ) );
  29                  echo Akismet::get_new_tab_screen_reader_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Returns markup escaped in the helper.
  30                  echo '</a>';
  31              } else {
  32                  echo esc_html(
  33                      _n(
  34                          "This plugin you've installed is compatible. Follow the documentation link to get started.",
  35                          "These plugins you've installed are compatible. Follow the documentation links to get started.",
  36                          $compatible_plugin_count,
  37                          'akismet'
  38                      )
  39                  );
  40              }
  41  
  42              echo '</p>';
  43  
  44              ?>
  45  
  46              <?php if ( ! empty( $compatible_plugins ) ) : ?>
  47                  <ul class="akismet-compatible-plugins__list" id="akismet-compatible-plugins__list">
  48                      <?php
  49  
  50                      foreach ( $compatible_plugins as $compatible_plugin ) :
  51                          if ( empty( $compatible_plugin['help_url'] ) ) {
  52                              continue;
  53                          }
  54  
  55                          ?>
  56                          <li class="akismet-compatible-plugins__card">
  57                              <?php if ( strlen( $compatible_plugin['logo'] ) > 0 ) : ?>
  58                                  <?php
  59  
  60                                  $logo_alt = sprintf(
  61                                      /* translators: The placeholder is the name of a plugin, like "Jetpack" . */
  62                                      __( '%s logo', 'akismet' ),
  63                                      $compatible_plugin['name']
  64                                  );
  65  
  66                                  ?>
  67                                  <img
  68                                      src="<?php echo esc_url( $compatible_plugin['logo'] ); ?>"
  69                                      alt="<?php echo esc_attr( $logo_alt ); ?>"
  70                                      class="akismet-compatible-plugins__card-logo"
  71                                      width="36"
  72                                      height="36"
  73                                  />
  74                              <?php endif ?>
  75                              <div class="akismet-compatible-plugins__card-detail">
  76                                  <h3 class="akismet-compatible-plugins__card-title"><?php echo esc_html( $compatible_plugin['name'] ); ?></h3>
  77                                  <div class="akismet-compatible-plugins__docs">
  78                                      <?php
  79                                      $documentation_aria_label = sprintf(
  80                                          /* translators: The placeholder is the name of a plugin, like "Jetpack" . */
  81                                          __( 'Documentation for %s (opens in a new tab)', 'akismet' ),
  82                                          $compatible_plugin['name']
  83                                      );
  84                                      ?>
  85                                      <a
  86                                          class="akismet-external-link"
  87                                          href="<?php echo esc_url( $compatible_plugin['help_url'] ); ?>"
  88                                          target="_blank"
  89                                          rel="nofollow noopener"
  90                                          aria-label="<?php echo esc_attr( $documentation_aria_label ); ?>"
  91                                      ><?php esc_html_e( 'View documentation', 'akismet' ); ?></a>
  92                                  </div>
  93                              </div>
  94                          </li>
  95                      <?php endforeach; ?>
  96                  </ul>
  97  
  98                  <?php if ( $compatible_plugin_count > Akismet_Compatible_Plugins::DEFAULT_VISIBLE_PLUGIN_COUNT ) : ?>
  99                      <button class="akismet-compatible-plugins__show-more"
 100                          aria-expanded="false"
 101                          aria-controls="akismet-compatible-plugins__list"
 102                          data-label-closed="
 103                              <?php
 104  
 105                              /* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
 106                              echo esc_attr( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
 107  
 108                              ?>
 109                          "
 110                          data-label-open="<?php echo esc_attr( __( 'Show less', 'akismet' ) ); ?>">
 111                          <?php
 112  
 113                          /* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
 114                          echo esc_html( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
 115  
 116                          ?>
 117                      </button>
 118                  <?php endif; ?>
 119  
 120              <?php endif; ?>
 121          </div>
 122      </div>
 123      <?php
 124      endif;


Generated : Fri Sep 4 08:20:24 2026 Cross-referenced by PHPXref