| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/www/wp-content/plugins/wp-store-locator/admin/templates/ |
Upload File : |
<?php
if ( !defined( 'ABSPATH' ) ) exit;
$campaign_params = '?utm_source=wpsl-add-ons&utm_medium=banner&utm_campaign=add-ons';
// Load the add-on data from an existing transient, or grab new data from the remote URL.
if ( false === ( $add_ons = get_transient( 'wpsl_addons' ) ) ) {
$response = wp_remote_get( 'https://s3.amazonaws.com/wpsl/add-ons.json' );
if ( !is_wp_error( $response ) ) {
$add_ons = json_decode( wp_remote_retrieve_body( $response ) );
if ( $add_ons ) {
set_transient( 'wpsl_addons', $add_ons, WEEK_IN_SECONDS );
}
}
}
?>
<div class="wrap wpsl-add-ons">
<h2><?php _e( 'WP Store Locator Add-Ons', 'wpsl' ); ?></h2>
<?php
if ( $add_ons ) {
foreach ( $add_ons as $add_on ) {
?>
<div class="wpsl-add-on">
<?php if ( !empty( $add_on->url ) ) { ?>
<a title="<?php echo esc_attr( $add_on->name ); ?>" href="<?php echo esc_url( $add_on->url ) . $campaign_params; ?>">
<img src="<?php echo esc_url( $add_on->img ); ?>"/>
</a>
<?php } else { ?>
<img src="<?php echo esc_url( $add_on->img ); ?>"/>
<?php } ?>
<div class="wpsl-add-on-desc">
<p><?php echo esc_html( $add_on->desc ); ?></p>
<div class="wpsl-add-on-status">
<?php if ( !empty( $add_on->class ) && class_exists( $add_on->class ) ) { ?>
<p><strong><?php _e( 'Already Installed.', 'wpsl' ); ?></strong></p>
<?php } else if ( isset( $add_on->soon ) && $add_on->soon ) { ?>
<p><strong><?php _e( 'Coming soon!', 'wpsl' ); ?></strong></p>
<?php } else { ?>
<a class="button-primary" href="<?php echo esc_url( $add_on->url ) . $campaign_params; ?>">
<?php esc_html_e( 'Get This Add-On', 'wpsl' ); ?>
</a>
<?php } ?>
</div>
</div>
</div>
<?php
}
} else {
echo '<p>'. __( 'Failed to load the add-on list from the server.', 'wpsl' ) . '</p>';
echo '<p>'. __( 'Please try again later!', 'wpsl' ) . '</p>';
}
?>
</div>