[ 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" aria-label="<?php esc_attr_e( 'Compatible plugins (new feature)', 'akismet' ); ?>">
  13                  <span class="akismet-compatible-plugins__section-header-label-text"><?php esc_html_e( 'Compatible plugins', 'akismet' ); ?></span>
  14                  <span class="akismet-new-feature"><?php esc_html_e( 'New', 'akismet' ); ?></span>
  15              </h2>
  16          </div>
  17  
  18          <div class="akismet-compatible-plugins__content">
  19              <?php
  20  
  21              echo '<p>';
  22              echo esc_html( __( 'Akismet works with other plugins to keep spam away.', 'akismet' ) );
  23              echo '</p>';
  24  
  25              echo '<p>';
  26  
  27              if ( 0 === $compatible_plugin_count ) {
  28                  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">';
  29                  echo esc_html( __( 'See supported integrations', 'akismet' ) );
  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="55"
  72                                      height="55"
  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                                      <a
  79                                          class="akismet-external-link"
  80                                          href="<?php echo esc_url( $compatible_plugin['help_url'] ); ?>"
  81                                          aria-label="
  82                                              <?php
  83  
  84                                              echo esc_attr(
  85                                                  sprintf(
  86                                                      /* translators: The placeholder is the name of a plugin, like "Jetpack" . */
  87                                                      __( 'Documentation for %s', 'akismet' ),
  88                                                      $compatible_plugin['name']
  89                                                  )
  90                                              );
  91  
  92                                              ?>
  93                                      "><?php esc_html_e( 'View documentation', 'akismet' ); ?></a>
  94                                  </div>
  95                              </div>
  96                          </li>
  97                      <?php endforeach; ?>
  98                  </ul>
  99  
 100                  <?php if ( $compatible_plugin_count > Akismet_Compatible_Plugins::DEFAULT_VISIBLE_PLUGIN_COUNT ) : ?>
 101                      <button class="akismet-compatible-plugins__show-more"
 102                          aria-expanded="false"
 103                          aria-controls="akismet-compatible-plugins__list"
 104                          data-label-closed="
 105                              <?php
 106  
 107                              /* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
 108                              echo esc_attr( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
 109  
 110                              ?>
 111                          "
 112                          data-label-open="<?php echo esc_attr( __( 'Show less', 'akismet' ) ); ?>">
 113                          <?php
 114  
 115                          /* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
 116                          echo esc_html( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
 117  
 118                          ?>
 119                      </button>
 120                  <?php endif; ?>
 121  
 122              <?php endif; ?>
 123          </div>
 124      </div>
 125      <?php
 126      endif;


Generated : Tue May 5 08:20:14 2026 Cross-referenced by PHPXref