get_slug();
$open_addon_slug = fs_request_get( 'slug' );
$open_addon = false;
$is_data_debug_mode = $fs->is_data_debug_mode();
$is_whitelabeled = $fs->is_whitelabeled();
/**
* @var FS_Plugin[]
*/
$addons = $fs->get_addons();
$has_addons = ( is_array( $addons ) && 0 < count( $addons ) );
$account_addon_ids = $fs->get_updated_account_addons();
$download_latest_text = fs_text_x_inline( 'Download Latest', 'as download latest version', 'download-latest', $slug );
$view_details_text = fs_text_inline( 'View details', 'view-details', $slug );
$has_tabs = $fs->_add_tabs_before_content();
$fs_blog_id = ( is_multisite() && ! is_network_admin() ) ?
get_current_blog_id() :
0;
?>
get_plugin_name() ) ) ?>
do_action( 'addons/after_title' ) ?>
_get_addons_plans_and_pricing_map_by_id();
$active_plugins_directories_map = Freemius::get_active_plugins_directories_map( $fs_blog_id );
?>
is_whitelabeled_by_flag() ) {
$hide_all_addons_data = true;
$addon_ids = $fs->get_updated_account_addons();
$installed_addons = $fs->get_installed_addons();
foreach ( $installed_addons as $fs_addon ) {
$addon_ids[] = $fs_addon->get_id();
}
if ( ! empty( $addon_ids ) ) {
$addon_ids = array_unique( $addon_ids );
}
foreach ( $addon_ids as $addon_id ) {
$addon = $fs->get_addon( $addon_id );
if ( ! is_object( $addon ) ) {
continue;
}
$addon_storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $addon->slug );
if ( ! $addon_storage->is_whitelabeled ) {
$hide_all_addons_data = false;
break;
}
if ( $is_data_debug_mode ) {
$is_whitelabeled = false;
}
}
}
?>
get_addon_basename( $addon->id );
$is_addon_installed = file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $basename ) );
if ( ! $is_addon_installed && $hide_all_addons_data ) {
continue;
}
$is_addon_activated = $is_addon_installed ?
$fs->is_addon_activated( $addon->id ) :
false;
$is_plugin_active = (
$is_addon_activated ||
isset( $active_plugins_directories_map[ dirname( $basename ) ] )
);
$open_addon = ( $open_addon || ( $open_addon_slug === $addon->slug ) );
$price = 0;
$has_trial = false;
$has_free_plan = false;
$has_paid_plan = false;
if ( isset( $plans_and_pricing_by_addon_id[$addon->id] ) ) {
$plans = $plans_and_pricing_by_addon_id[$addon->id];
if ( is_array( $plans ) && 0 < count( $plans ) ) {
foreach ( $plans as $plan ) {
if ( ! isset( $plan->pricing ) ||
! is_array( $plan->pricing ) ||
0 == count( $plan->pricing )
) {
// No pricing means a free plan.
$has_free_plan = true;
continue;
}
$has_paid_plan = true;
$has_trial = $has_trial || ( is_numeric( $plan->trial_period ) && ( $plan->trial_period > 0 ) );
$min_price = 999999;
foreach ( $plan->pricing as $pricing ) {
$pricing = new FS_Pricing( $pricing );
if ( ! $pricing->is_usd() ) {
/**
* Skip non-USD pricing.
*
* @author Leo Fajardo (@leorw)
* @since 2.3.1
*/
continue;
}
if ( $pricing->has_annual() ) {
$min_price = min( $min_price, $pricing->annual_price );
} else if ( $pricing->has_monthly() ) {
$min_price = min( $min_price, 12 * $pricing->monthly_price );
}
}
if ( $min_price < 999999 ) {
$price = $min_price;
}
}
}
if ( ! $has_paid_plan && ! $has_free_plan ) {
continue;
}
}
?>
-
get_id() . '&plugin=' . $addon->slug .
'&TB_iframe=true&width=600&height=550' ) ),
esc_attr( sprintf( fs_text_inline( 'More information about %s', 'more-information-about-x', $slug ), $addon->title ) ),
esc_attr( $addon->title )
) . ' class="thickbox%s">%s';
echo sprintf(
$view_details_link,
/**
* Additional class.
*
* @author Leo Fajardo (@leorw)
* @since 2.2.4
*/
' fs-overlay',
/**
* Set the view details link text to an empty string since it is an overlay that
* doesn't really need a text and whose purpose is to open the details dialog when
* the card is clicked.
*
* @author Leo Fajardo (@leorw)
* @since 2.2.4
*/
''
);
?>
info ) ) {
$addon->info = new stdClass();
}
if ( ! isset( $addon->info->card_banner_url ) ) {
$addon->info->card_banner_url = '//dashboard.freemius.com/assets/img/marketing/blueprint-300x100.jpg';
}
if ( ! isset( $addon->info->short_description ) ) {
$addon->info->short_description = 'What\'s the one thing your add-on does really, really well?';
}
?>
- %s',
esc_html( $is_plugin_active ?
fs_text_x_inline( 'Active', 'active add-on', 'active-addon', $slug ) :
fs_text_x_inline( 'Installed', 'installed add-on', 'installed-addon', $slug )
)
);
}
?>
- title ?>
-
0)
$descriptors[] = '$' . number_format( $price, 2 );
if ($has_trial)
$descriptors[] = fs_text_x_inline( 'Trial', 'trial period', 'trial', $slug );
echo implode(' - ', $descriptors);
} ?>
- info->short_description ) ? $addon->info->short_description : 'SHORT DESCRIPTION' ?>
is_wp_org_compliant );
$is_allowed_to_install = (
$fs->is_allowed_to_install() ||
$is_free_only_wp_org_compliant
);
$show_premium_activation_or_installation_action = true;
if ( ! in_array( $addon->id, $account_addon_ids ) ) {
$show_premium_activation_or_installation_action = false;
} else if ( $is_addon_installed ) {
/**
* If any add-on's version (free or premium) is installed, check if the
* premium version can be activated and show the relevant action. Otherwise,
* show the relevant action for the free version.
*
* @author Leo Fajardo (@leorw)
* @since 2.4.5
*/
$fs_addon = $is_addon_activated ?
$fs->get_addon_instance( $addon->id ) :
null;
$premium_plugin_basename = is_object( $fs_addon ) ?
$fs_addon->premium_plugin_basename() :
"{$addon->premium_slug}/{$addon->slug}.php";
if (
( $is_addon_activated && $fs_addon->is_premium() ) ||
file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_plugin_basename ) )
) {
$basename = $premium_plugin_basename;
}
$show_premium_activation_or_installation_action = (
( ! $is_addon_activated || ! $fs_addon->is_premium() ) &&
/**
* This check is needed for cases when an active add-on doesn't have an
* associated Freemius instance.
*
* @author Leo Fajardo (@leorw)
* @since 2.4.5
*/
( ! $is_plugin_active )
);
}
?>
_get_latest_download_local_url( $addon->id );
?>
-
do_action( 'addons/after_addons' ) ?>
_add_tabs_after_content();
}
$params = array(
'page' => 'addons',
'module_id' => $fs->get_id(),
'module_type' => $fs->get_module_type(),
'module_slug' => $slug,
'module_version' => $fs->get_plugin_version(),
);
fs_require_template( 'powered-by.php', $params );