get_slug(); $is_pending_activation = $fs->is_pending_activation(); $is_premium_only = $fs->is_only_premium(); $has_paid_plans = $fs->has_paid_plan(); $is_premium_code = $fs->is_premium(); $is_freemium = $fs->is_freemium(); $fs->_enqueue_connect_essentials(); $current_user = Freemius::_get_current_wp_user(); $first_name = $current_user->user_firstname; if ( empty( $first_name ) ) { $first_name = $current_user->nickname; } $site_url = get_site_url(); $protocol_pos = strpos( $site_url, '://' ); if ( false !== $protocol_pos ) { $site_url = substr( $site_url, $protocol_pos + 3 ); } $freemius_site_url = $fs->has_paid_plan() ? 'https://freemius.com/wordpress/' : // Insights platform information. 'https://freemius.com/wordpress/usage-tracking/'; $freemius_site_url .= '?' . http_build_query( array( 'id' => $fs->get_id(), 'slug' => $slug, ) ); $freemius_link = 'freemius.com'; $error = fs_request_get( 'error' ); $require_license_key = $is_premium_only || ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) ); if ( $is_pending_activation ) { $require_license_key = false; } if ( $require_license_key ) { $fs->_require_license_activation_dialog(); } global $pagenow; $is_theme_page = ( 'themes.php' === $pagenow ); $is_optin_dialog = ( $is_theme_page && $fs->is_theme() ); if ( $is_optin_dialog ) { $show_close_button = false; $previous_theme_activation_url = ''; if ( ! $is_premium_code ) { $show_close_button = true; } else if ( $is_premium_only ) { $previous_theme_activation_url = $fs->get_previous_theme_activation_url(); $show_close_button = ( ! empty( $previous_theme_activation_url ) ); } } ?>
apply_filters( 'pending_activation_message', sprintf(
__fs( 'thanks-x', $slug ) . '
' .
__fs( 'pending-activation-message', $slug ),
$first_name,
'' . $fs->get_plugin_name() . '',
'' . $current_user->user_email . ''
) );
} else if ( $require_license_key ) {
$button_label = 'agree-activate-license';
echo $fs->apply_filters( 'connect-message_on-premium',
sprintf( __fs( 'hey-x', $slug ), $first_name ) . '
' .
sprintf( __fs( 'thanks-for-purchasing', $slug ), '' . $fs->get_plugin_name() . '' ),
$first_name,
$fs->get_plugin_name()
);
} else {
$filter = 'connect_message';
$default_optin_message = 'connect-message';
if ( $fs->is_plugin_update() ) {
// If Freemius was added on a plugin update, set different
// opt-in message.
$default_optin_message = 'connect-message_on-update';
// If user customized the opt-in message on update, use
// that message. Otherwise, fallback to regular opt-in
// custom message if exist.
if ( $fs->has_filter( 'connect_message_on_update' ) ) {
$filter = 'connect_message_on_update';
}
}
echo $fs->apply_filters( $filter,
sprintf(
__fs( 'hey-x', $slug ) . '
' .
__fs( $default_optin_message, $slug ),
$first_name,
'' . $fs->get_plugin_name() . '',
'' . $current_user->user_login . '',
'' . $site_url . '',
$freemius_link
),
$first_name,
$fs->get_plugin_name(),
$current_user->user_login,
'' . $site_url . '',
$freemius_link
);
}
?>