widget.php
62 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render next steps widget |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | */ |
| 7 | |
| 8 | use AdvancedAds\Constants; |
| 9 | use AdvancedAds\Utilities\Conditional; |
| 10 | |
| 11 | $recent_ads = wp_advads_get_ads_dropdown(); |
| 12 | ?> |
| 13 | <div class="advads-widget-wrapper"> |
| 14 | <?php if ( count( $recent_ads ) === 0 ) : ?> |
| 15 | <p> |
| 16 | <a class="button button-primary" href="<?php echo esc_url( admin_url( 'post-new.php?post_type=' . Constants::POST_TYPE_AD ) ); ?>"> |
| 17 | <?php esc_html_e( 'Create your first ad', 'advanced-ads' ); ?> |
| 18 | </a> |
| 19 | </p> |
| 20 | |
| 21 | <p> |
| 22 | <a class="button button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=advanced-ads-settings#top#adsense' ) ); ?>"> |
| 23 | <?php esc_html_e( 'Connect to AdSense', 'advanced-ads' ); ?> |
| 24 | </a> |
| 25 | </p> |
| 26 | <?php endif; ?> |
| 27 | |
| 28 | <?php |
| 29 | if ( Conditional::user_can_subscribe( 'nl_first_steps' ) || Conditional::user_can_subscribe( 'nl_adsense' ) ) : |
| 30 | include ADVADS_ABSPATH . 'views/admin/widgets/aa-dashboard/next-steps/newsletter.php'; |
| 31 | ?> |
| 32 | <?php elseif ( count( $recent_ads ) > 3 && Advanced_Ads_Admin_Notices::get_instance()->can_display( 'review' ) ) : ?> |
| 33 | <div class="advads-admin-notice" data-notice="review"> |
| 34 | <p><?php esc_html_e( 'Do you find Advanced Ads useful and would like to keep us motivated? Please help us with a review.', 'advanced-ads' ); ?></p> |
| 35 | <p> |
| 36 | <span class="dashicons dashicons-external"></span> <strong><a href="https://wordpress.org/support/plugin/advanced-ads/reviews/?rate=5#new-post" target="_blank"> |
| 37 | <?php esc_html_e( 'Sure, I’ll rate the plugin', 'advanced-ads' ); ?></a></strong> |
| 38 | <span class="dashicons dashicons-smiley"></span> <a href="javascript:void(0)" class="advads-notice-dismiss"> |
| 39 | <?php esc_html_e( 'I already did', 'advanced-ads' ); ?></a> |
| 40 | </p> |
| 41 | </div> |
| 42 | <?php elseif ( count( $recent_ads ) > 0 ) : ?> |
| 43 | <p><a class="button button-secondary" href="<?php echo esc_url( admin_url( 'edit.php?post_type=' . Constants::POST_TYPE_AD ) ); ?>"> |
| 44 | <?php esc_html_e( 'Manage your ads', 'advanced-ads' ); ?></a></p> |
| 45 | <?php endif; ?> |
| 46 | </div> |
| 47 | |
| 48 | <?php do_action( 'advanced-ads-dashbaord-widget_next-steps' ); ?> |
| 49 | |
| 50 | <?php |
| 51 | // Footer. |
| 52 | $all_access = Advanced_Ads_Admin_Licenses::get_instance()->get_probably_all_access(); |
| 53 | if ( ! $all_access ) : |
| 54 | ?> |
| 55 | <footer> |
| 56 | <a class="no-underline" href="https://wpadvancedads.com/add-ons/all-access/?utm_source=advanced-ads&utm_medium=link&utm_campaign=pitch-bundle" target="_blank"> |
| 57 | <?php esc_html_e( 'Get the All Access pass', 'advanced-ads' ); ?> |
| 58 | <span aria-hidden="true" class="dashicons dashicons-external"></span> |
| 59 | </a> |
| 60 | </footer> |
| 61 | <?php endif; ?> |
| 62 |