'advanced-ads',
'plugin_name' => 'Advanced Ads',
'hook' => 'advanced-ads-overview-below-support',
)
);
self::add_meta_box('advads_overview_news', __( 'Next steps', 'advanced-ads' ), 'left',
'render_next_steps');
self::add_meta_box('advads_overview_support', __( 'Manual and Support', 'advanced-ads' ), 'right',
'render_support' );
// add widgets for pro add ons
self::add_meta_box('advads_overview_addons', __( 'Add-Ons', 'advanced-ads' ), 'full', 'render_addons' );
do_action( 'advanced-ads-overview-widgets-after' );
}
/**
* loads a meta box into output
*/
public static function add_meta_box( $id = '', $title = '', $position = 'full', $callback ){
ob_start();
call_user_func(array('Advanced_Ads_Overview_Widgets_Callbacks', $callback));
do_action( 'advanced-ads-overview-widget-content-' . $id, $id );
$content = ob_get_clean();
include( ADVADS_BASE_PATH . 'admin/views/overview-widget.php' );
}
/**
* render next steps widget
*
* @since 1.5.4
*/
public static function render_next_steps(){
$primary_taken = false;
$model = Advanced_Ads::get_instance()->get_model();
$recent_ads = $model->get_ads();
if ( count( $recent_ads ) == 0 ) :
echo '
' . __( 'Create your first ad', 'advanced-ads' ) . '
';
$primary_taken = true;
endif;
$is_subscribed = Advanced_Ads_Admin_Notices::get_instance()->is_subscribed();
$options = Advanced_Ads_Admin_Notices::get_instance()->options();
$_notice = 'nl_free_addons';
if ( ! $is_subscribed ) {
?>
0 ) :
echo '' . __( 'Manage your ads', 'advanced-ads' ) . '
';
endif;
/*$_notice = 'nl_adsense';
if ( ! isset($options['closed'][ $_notice ] ) ) {
?>
how much you can earn with AdSense and Advanced Ads from the dedicated newsletter group.', 'advanced-ads' ); ?>
- Manual', 'advanced-ads' ), ADVADS_URL . 'manual/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-manual' ); ?>
- FAQ and Support', 'advanced-ads' ), ADVADS_URL . 'support/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-support' ); ?>
- wordpress.org', 'advanced-ads' ), 'https://wordpress.org/support/plugin/advanced-ads/reviews/?filter=5#new-post' ); ?>
- %s', 'advanced-ads' ), 'bbPress' ); ?>
- %s', 'advanced-ads' ), 'BuddyPress' ); ?>
- %s', 'advanced-ads' ), 'Paid Memberships Pro' ); ?>
- %s', 'advanced-ads' ), 'WPML' ); ?>
array(
'title' => 'Tracking',
'desc' => __( 'Analyze clicks and impressions of your ads locally or in Google Analytics, share reports, and limit ads to a specific number of impressions or clicks.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/tracking/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 4,
),
'responsive' => array(
'title' => 'Responsive, AMP and Mobile ads',
'desc' => __( 'Display ads based on the device or the size of your visitor’s browser, and control ads on AMP pages.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/responsive-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 4,
),
'pro' => array(
'title' => 'Advanced Ads Pro',
'desc' => $pro_content,
'link' => ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 4,
'class' => 'recommended'
),
'selling' => array(
'title' => 'Selling Ads',
'desc' => __( 'Earn more money and let advertisers pay for ad space directly on the frontend of your site.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/selling-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 5,
),
'geo' => array(
'title' => 'Geo Targeting',
'desc' => __( 'Target visitors with ads that match their geo location and make more money with regional campaigns.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/geo-targeting/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 5,
),
'sticky' => array(
'title' => 'Sticky ads',
'desc' => __( 'Increase click rates on your ads by placing them in sticky positions above, next or below your site.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/sticky-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 5,
),
'layer' => array(
'title' => 'PopUps and Layers',
'desc' => __( 'Users will never miss an ad or other information in a PopUp. Choose when it shows up and for how long a user can close it.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/popup-and-layer-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 5,
),
'slider' => array(
'title' => 'Ad Slider',
'desc' => __( 'Create a beautiful and simple slider from your ads to show more information on less space.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/slider/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'order' => 5,
),
'adsense-in-feed' => array(
'title' => 'AdSense In-feed',
'desc' => __( 'Place AdSense In-feed ads between posts on homepage, category, and archive pages.', 'advanced-ads' ),
'class' => 'free',
'link' => wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . 'advanced-ads-adsense-in-feed'), 'install-plugin_' . 'advanced-ads-adsense-in-feed'),
'link_title' => __( 'Install now', 'advanced-ads' ),
'order' => 9,
)
);
// get all installed plugins; installed is not activated
$installed_plugins = get_plugins();
$installed_pro_plugins = 0;
// handle AdSense In-feed if already installed or not activated
if( isset( $installed_plugins['advanced-ads-adsense-in-feed/advanced-ads-in-feed.php'] ) ){ // is installed, but not active
// remove plugin from the list
unset( $add_ons['adsense-in-feed'] );
}
// PRO
if( isset( $installed_plugins['advanced-ads-pro/advanced-ads-pro.php'] ) && ! class_exists( 'Advanced_Ads_Pro') ){ // is installed, but not active
$add_ons['pro']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-pro/advanced-ads-pro.php&', 'activate-plugin_advanced-ads-pro/advanced-ads-pro.php' );
$add_ons['pro']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Pro') ) {
$add_ons['pro']['link'] = ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['pro']['desc'] = '';
$add_ons['pro']['installed'] = true;
$add_ons['pro']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['pro'] );
}
} elseif( $caching_used ) {
// for now, "recommended" is always set for this plugin since there are so many advantages
// $add_ons['pro']['class'] = 'recommended';
}
// TRACKING
if( isset( $installed_plugins['advanced-ads-tracking/tracking.php'] ) && ! class_exists( 'Advanced_Ads_Tracking_Plugin') ){ // is installed, but not active
$add_ons['tracking']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-tracking/tracking.php&', 'activate-plugin_advanced-ads-tracking/tracking.php' );
$add_ons['tracking']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Tracking_Plugin', false ) ) {
$add_ons['tracking']['link'] = ADVADS_URL . 'add-ons/tracking/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
if( 'ga' !== Advanced_Ads_Tracking_Plugin::get_instance ()->get_tracking_method() ){
// don’t show Tracking link if Analytics method is enabled
$add_ons['tracking']['desc'] = '' . __('Visit your ad stats', 'advanced-ads') . '';
} else {
$add_ons['tracking']['desc'] = '';
}
$add_ons['tracking']['installed'] = true;
$add_ons['tracking']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['tracking'] );
}
}
// RESPONSIVE
if( isset( $installed_plugins['advanced-ads-responsive/responsive-ads.php'] ) && ! class_exists( 'Advanced_Ads_Responsive_Plugin') ){ // is installed, but not active
$add_ons['responsive']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-responsive/responsive-ads.php&', 'activate-plugin_advanced-ads-responsive/responsive-ads.php' );
$add_ons['responsive']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Responsive_Plugin') ) {
$add_ons['responsive']['link'] = ADVADS_URL . 'add-ons/responsive-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['responsive']['desc'] = '' . __('List of responsive ads by browser width', 'advanced-ads-responsive') . '';
$add_ons['responsive']['installed'] = true;
$add_ons['responsive']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['responsive'] );
}
}
// STICKY
if( isset( $installed_plugins['advanced-ads-sticky-ads/sticky-ads.php'] ) && ! class_exists( 'Advanced_Ads_Sticky_Plugin') ){ // is installed, but not active
$add_ons['sticky']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-sticky-ads/sticky-ads.php&', 'activate-plugin_advanced-ads-sticky-ads/sticky-ads.php' );
$add_ons['sticky']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Sticky_Plugin') ) {
$add_ons['sticky']['link'] = ADVADS_URL . 'add-ons/sticky-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['sticky']['desc'] = '';
$add_ons['sticky']['installed'] = true;
$add_ons['sticky']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['sticky'] );
}
}
// LAYER
if( isset( $installed_plugins['advanced-ads-layer/layer-ads.php'] ) && ! class_exists( 'Advanced_Ads_Layer_Plugin') ){ // is installed, but not active
$add_ons['layer']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-layer/layer-ads.php&', 'activate-plugin_advanced-ads-layer/layer-ads.php' );
$add_ons['layer']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Layer_Plugin') ) {
$add_ons['layer']['link'] = ADVADS_URL . 'add-ons/popup-and-layer-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['layer']['desc'] = '';
$add_ons['layer']['installed'] = true;
$add_ons['layer']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['layer'] );
}
}
// SELLING ADS
if( isset( $installed_plugins['advanced-ads-selling/advanced-ads-selling.php'] ) && ! class_exists( 'Advanced_Ads_Selling_Plugin') ){ // is installed, but not active
$add_ons['selling']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-selling/advanced-ads-selling.php&', 'activate-plugin_advanced-ads-selling/advanced-ads-selling.php' );
$add_ons['selling']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Selling_Plugin') ) {
$add_ons['selling']['link'] = ADVADS_URL . 'add-ons/selling-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['selling']['desc'] = '';
$add_ons['selling']['installed'] = true;
$add_ons['selling']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['selling'] );
}
}
// GEO TARGETING
if( isset( $installed_plugins['advanced-ads-geo/advanced-ads-geo.php'] ) && ! class_exists( 'Advanced_Ads_Geo_Plugin') ){ // is installed, but not active
$add_ons['geo']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-geo/advanced-ads-geo.php&', 'activate-plugin_advanced-ads-geo/advanced-ads-geo.php' );
$add_ons['geo']['link_title'] = __( 'Activate now', 'advanced-ads' );
$installed_pro_plugins++;
} elseif( class_exists( 'Advanced_Ads_Geo_Plugin') ) {
$add_ons['geo']['link'] = ADVADS_URL . 'add-ons/geo-targeting/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['geo']['desc'] = '';
$add_ons['geo']['installed'] = true;
$add_ons['geo']['order'] = 20;
$installed_pro_plugins++;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['geo'] );
}
}
// SLIDER
if( isset( $installed_plugins['advanced-ads-slider/slider.php'] ) && ! class_exists( 'Advanced_Ads_Slider_Plugin') ){ // is installed, but not active
$add_ons['slider']['link'] = wp_nonce_url( 'plugins.php?action=activate&plugin=advanced-ads-slider/slider.php&', 'activate-plugin_advanced-ads-slider/slider.php' );
$add_ons['slider']['link_title'] = __( 'Activate now', 'advanced-ads' );
} elseif( class_exists( 'Advanced_Ads_Slider_Plugin') ) {
$add_ons['slider']['link'] = ADVADS_URL . 'add-ons/slider/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons-manual';
$add_ons['slider']['desc'] = '';
$add_ons['slider']['installed'] = true;
$add_ons['slider']['order'] = 20;
// remove the add-on
if( $hide_activated ){
unset( $add_ons['slider'] );
}
}
// add Genesis Ads, if Genesis based theme was detected
if( defined( 'PARENT_THEME_NAME') && 'Genesis' === PARENT_THEME_NAME ) {
$add_ons['genesis'] = array(
'title' => 'Genesis Ads',
'desc' => __( 'Use Genesis specific ad positions.', 'advanced-ads' ),
'order' => 2,
'class' => 'free',
'link' => wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . 'advanced-ads-genesis'), 'install-plugin_' . 'advanced-ads-genesis'),
'link_title' => __( 'Install now', 'advanced-ads' ),
);
// handle install link as long as we can not be sure this is done by the Genesis plugin itself
if( isset( $installed_plugins['advanced-ads-genesis/genesis-ads.php'] ) ){ // is installed (active or not)
unset( $add_ons['genesis'] );
}
}
// add Visual Composer Ads, if VC was detected
if( defined( 'WPB_VC_VERSION') ) {
$add_ons['visual_composer'] = array(
'title' => 'Visual Composer Ads',
'desc' => __( 'Manage ad positions with Visual Composer.', 'advanced-ads' ),
'order' => 2,
'class' => 'free',
'link' => wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . 'ads-for-visual-composer'), 'install-plugin_' . 'ads-for-visual-composer'),
'link_title' => __( 'Install now', 'advanced-ads' ),
);
// handle install link as long as we can not be sure this is done by the Genesis plugin itself
if( isset( $installed_plugins['ads-for-visual-composer/advanced-ads-vc.php'] ) ){ // is installed (active or not)
unset( $add_ons['visual_composer'] );
}
}
// only show Pro Bundle Pitch if less than 2 add-ons exist
if( $installed_pro_plugins < 2 ){
$add_ons['bundle'] = array(
'title' => 'Pro Bundle',
'desc' => __( 'Our best deal with all current and future add-ons included.', 'advanced-ads' ),
'link' => ADVADS_URL . 'add-ons/bundle-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-add-ons',
'link_title' => __( 'Get the Bundle', 'advanced-ads' ),
'link_primary' => true,
'order' => 0,
);
}
// allow add-ons to manipulate the output
$add_ons = apply_filters( 'advanced-ads-overview-add-ons', $add_ons );
uasort( $add_ons, array( 'self', 'sort_by_order' ) );
?> ' . $_addon['title'];
} else {
$link_title = isset( $_addon['link_title'] ) ? $_addon['link_title'] : __( 'Get this add-on', 'advanced-ads' );
}
include ADVADS_BASE_PATH . 'admin/views/overview-addons-line.php';
endforeach;
?>