notices
8 years ago
ad-display-metabox.php
8 years ago
ad-group-edit.php
8 years ago
ad-group-list-ads.php
8 years ago
ad-group-list-form-row.php
8 years ago
ad-group-list-header.php
10 years ago
ad-group-list-row.php
10 years ago
ad-group.php
8 years ago
ad-info-after-textarea.php
8 years ago
ad-info-bottom.php
8 years ago
ad-info-top.php
8 years ago
ad-info.php
10 years ago
ad-list-details-column.php
10 years ago
ad-list-filters.php
8 years ago
ad-list-no-ads.php
8 years ago
ad-list-timing-column.php
8 years ago
ad-main-metabox.php
8 years ago
ad-output-metabox.php
8 years ago
ad-parameters-metabox.php
8 years ago
ad-parameters-size.php
8 years ago
ad-submitbox-meta.php
8 years ago
ad-visitor-metabox.php
8 years ago
feedback-disable.php
8 years ago
index.php
12 years ago
overview-addons-line.php
8 years ago
overview-widget.php
8 years ago
overview.php
8 years ago
placement-injection-top.php
8 years ago
placements-ad-label-position.php
8 years ago
placements-ad-label.php
8 years ago
placements-content-index.php
8 years ago
placements-item.php
8 years ago
placements.php
8 years ago
post-ad-settings-metabox.php
8 years ago
setting-license.php
8 years ago
setting-target.php
8 years ago
settings-disable-ads.php
10 years ago
settings.php
8 years ago
support.php
8 years ago
setting-license.php
56 lines
| 1 | <?php |
| 2 | $errortext = false; |
| 3 | $expires = Advanced_Ads_Admin_Licenses::get_instance()->get_license_expires( $options_slug ); |
| 4 | $expired = false; |
| 5 | $expired_error = __( 'Your license expired.', 'advanced-ads' ); |
| 6 | |
| 7 | ob_start(); |
| 8 | ?><button type="button" class="button-secondary advads-license-activate" |
| 9 | data-addon="<?php echo $index; ?>" |
| 10 | data-pluginname="<?php echo $plugin_name; ?>" |
| 11 | data-optionslug="<?php echo $options_slug; ?>" |
| 12 | name="advads_license_activate"><?php _e( 'Update expiry date', 'advanced-ads' ); ?></button><?php |
| 13 | $update_button = ob_get_clean(); |
| 14 | |
| 15 | $expired_error .= $expired_renew_link = ' ' . sprintf(__( 'Click on %2$s if you renewed it or have a subscription or <a href="%1$s" target="_blank">renew your license with a discount</a>.', 'advanced-ads' ), ADVADS_URL . 'checkout/?edd_license_key=' . esc_attr($license_key) . '#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses', $update_button ); |
| 16 | if( 'lifetime' !== $expires ){ |
| 17 | $expires_time = strtotime( $expires ); |
| 18 | $days_left = ( $expires_time - time() ) / DAY_IN_SECONDS; |
| 19 | } |
| 20 | if( 'lifetime' === $expires ){ |
| 21 | // do nothing |
| 22 | } elseif( $days_left <= 0 ){ |
| 23 | $plugin_url = isset( $plugin_url ) ? $plugin_url : ADVADS_URL; |
| 24 | $errortext = $expired_error; |
| 25 | $expired = true; |
| 26 | } elseif ( 0 < $days_left && 31 > $days_left ){ |
| 27 | $errortext = sprintf( __('(%d days left)', 'advanced-ads' ), $days_left ); |
| 28 | } |
| 29 | $show_active = ( $license_status !== false && $license_status == 'valid' && ! $expired ) ? true : false; |
| 30 | |
| 31 | ?><input type="text" class="regular-text advads-license-key" placeholder="<?php _e( 'License key', 'advanced-ads' ); ?>" |
| 32 | name="<?php echo ADVADS_SLUG . '-licenses'; ?>[<?php echo $index; ?>]" |
| 33 | value="<?php echo esc_attr($license_key); ?>" |
| 34 | <?php if( $license_status !== false && $license_status == 'valid' && ! $expired ) : ?> readonly="readonly"<?php endif; ?>/> |
| 35 | |
| 36 | <button type="button" class="button-secondary advads-license-deactivate" |
| 37 | <?php if( $license_status !== 'valid' ) echo ' style="display: none;" '; ?> |
| 38 | data-addon="<?php echo $index; ?>" |
| 39 | data-pluginname="<?php echo $plugin_name; ?>" |
| 40 | data-optionslug="<?php echo $options_slug; ?>" |
| 41 | name="advads_license_activate"><?php _e('Deactivate License', 'advanced-ads' ); ?></button> |
| 42 | |
| 43 | <button type="button" class="button-primary advads-license-activate" |
| 44 | data-addon="<?php echo $index; ?>" |
| 45 | data-pluginname="<?php echo $plugin_name; ?>" |
| 46 | data-optionslug="<?php echo $options_slug; ?>" |
| 47 | name="advads_license_activate"><?php echo ( $license_status === 'valid' && ! $expired ) ? __('Update License', 'advanced-ads' ) : __('Activate License', 'advanced-ads'); ?></button><?php |
| 48 | if( '' === trim( $license_key ) ){ |
| 49 | $errortext = __('Please enter a valid license key', 'advanced-ads'); |
| 50 | } elseif( ! $expired && ! $errortext ){ |
| 51 | $errortext = ( $license_status == 'invalid') ? __('License key invalid', 'advanced-ads') : ''; |
| 52 | } |
| 53 | ?> |
| 54 | <span class="advads-license-activate-active" <?php if( ! $show_active ) echo 'style="display: none;"'; ?>><?php _e( 'active', 'advanced-ads' ); ?></span> |
| 55 | <span class="advads-license-activate-error" <?php if( ! $errortext ) echo 'style="display: none;"'; ?>><?php echo $errortext; ?></span> |
| 56 | <span class="advads-license-expired-error advads-error-message" style="display: none;"><?php echo $expired_error; ?></span> |