| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Displaying loop single plugin. |
| 4 |
* |
| 5 |
* @author ThimPress |
| 6 |
* @package LearnPress/Views |
| 7 |
* @version 3.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit(); |
| 11 |
|
| 12 |
$action_links = LP_Plugins_Helper::get_add_on_action_link( $add_on, $file ); |
| 13 |
?> |
| 14 |
|
| 15 |
<li class="plugin-card" id="learn-press-plugin-<?php echo esc_attr( $add_on['slug'] ); ?>"> |
| 16 |
<div class="plugin-card-top"> |
| 17 |
<span class="plugin-icon"> |
| 18 |
<?php if ( ! is_array( $add_on['icons'] ) && $add_on['icons'] ) : ?> |
| 19 |
<a href="<?php echo esc_url_raw( $add_on['permarklink'] ); ?>"> |
| 20 |
<img src="<?php echo esc_url_raw( $add_on['icons'] ); ?>"> |
| 21 |
</a> |
| 22 |
<?php else : ?> |
| 23 |
<img src="<?php echo LP_Plugins_Helper::get_add_on_icon( $add_on['icons'] ); ?>"> |
| 24 |
<?php endif; ?> |
| 25 |
</span> |
| 26 |
|
| 27 |
<div class="name column-name"> |
| 28 |
<h3 class="item-title"><?php echo esc_html( $add_on['name'] ); ?></h3> |
| 29 |
</div> |
| 30 |
|
| 31 |
<div class="action-links"> |
| 32 |
<?php |
| 33 |
if ( $action_links ) { |
| 34 |
echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>'; |
| 35 |
} |
| 36 |
?> |
| 37 |
</div> |
| 38 |
<?php $short_desc = preg_replace( '!\s+!', ' ', trim( strip_tags( $add_on['short_description'] ) ) ); ?> |
| 39 |
<div class="desc column-description" title="<?php echo esc_attr( $short_desc ); ?>"> |
| 40 |
<p><?php echo strip_tags( $short_desc ); ?></p> |
| 41 |
<p class="authors"><?php printf( '<cite>By %s</cite>', 'learnpress', $add_on['author'] ); ?></p> |
| 42 |
</div> |
| 43 |
</div> |
| 44 |
|
| 45 |
<div class="plugin-card-bottom"> |
| 46 |
<div class="plugin-version"> |
| 47 |
<?php echo esc_html__( 'Version: ', 'learnpress' ) . ( isset( $add_on['version'] ) ? $add_on['version'] : '2.0' ); ?> |
| 48 |
</div> |
| 49 |
<div class="column-compatibility"> |
| 50 |
<?php |
| 51 |
if ( ! empty( $add_on['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $add_on['tested'] ) ), $add_on['tested'], '>' ) ) { |
| 52 |
echo '<span class="compatibility-untested">' . esc_html__( 'Untested with your version of WordPress', 'learnpress' ) . '</span>'; |
| 53 |
} elseif ( ! empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $add_on['requires'] ) ), $add_on['requires'], '<' ) ) { |
| 54 |
echo '<span class="compatibility-incompatible">' . wp_kses( __( '<strong>Incompatible</strong> with your version of WordPress', 'learnpress' ), array( 'strong' => array() ) ) . '</span>'; |
| 55 |
} else { |
| 56 |
echo '<span class="compatibility-compatible">' . wp_kses( __( '<strong>Compatible</strong> with your version of WordPress', 'learnpress' ), array( 'strong' => array() ) ) . '</span>'; |
| 57 |
} |
| 58 |
?> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
</li> |
| 62 |
|