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_www = 'https://freemius.com'; $freemius_usage_tracking_url = $fs->get_usage_tracking_terms_url(); $freemius_plugin_terms_url = $fs->get_eula_url(); $freemius_site_url = $fs->is_premium() ? $freemius_site_www : $freemius_usage_tracking_url; if ( $fs->is_premium() ) { $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->_add_license_activation_dialog_box(); } $is_optin_dialog = ( $fs->is_theme() && $fs->is_themes_page() && $fs->show_opt_in_on_themes_page() ); 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 ) ); } } $is_network_level_activation = ( fs_is_network_admin() && $fs->is_network_active() && ! $fs->is_network_delegated_connection() ); $fs_user = Freemius::_get_user_by_email( $current_user->user_email ); $activate_with_current_user = ( is_object( $fs_user ) && ! $is_pending_activation && // If requires a license for activation, use the user associated with the license for the opt-in. ! $require_license_key && ! $is_network_level_activation ); $optin_params = $fs->get_opt_in_params( array(), $is_network_level_activation ); $sites = isset( $optin_params['sites'] ) ? $optin_params['sites'] : array(); $is_network_upgrade_mode = ( fs_is_network_admin() && $fs->is_network_upgrade_mode() ); /* translators: %s: name (e.g. Hey John,) */ $hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $first_name ) ); $is_gdpr_required = ( ! $is_pending_activation && ! $require_license_key ) ? FS_GDPR_Manager::instance()->is_required() : false; if ( is_null( $is_gdpr_required ) ) { $is_gdpr_required = $fs->fetch_and_store_current_user_gdpr_anonymously(); } ?>
apply_filters( 'pending_activation_message', sprintf(
/* translators: %s: name (e.g. Thanks John!) */
fs_text_inline( 'Thanks %s!', 'thanks-x', $slug ) . '
' .
fs_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message', $slug ),
$first_name,
'' . $fs->get_plugin_name() . '',
'' . $current_user->user_email . '',
fs_text_inline( 'complete the install', 'complete-the-install', $slug )
) );
} else if ( $require_license_key ) {
$button_label = $is_network_upgrade_mode ?
fs_text_inline( 'Activate License', 'agree-activate-license', $slug ) :
fs_text_inline( 'Agree & Activate License', 'agree-activate-license', $slug );
$message = $fs->apply_filters(
'connect-message_on-premium',
sprintf( fs_text_inline( 'Welcome to %s! To get started, please enter your license key:', 'thanks-for-purchasing', $slug ), '' . $fs->get_plugin_name() . '' ),
$first_name,
$fs->get_plugin_name()
);
} else {
$filter = 'connect_message';
$default_optin_message = $is_gdpr_required ?
fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug) :
fs_text_inline( 'Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug);
if ( $fs->is_plugin_update() ) {
// If Freemius was added on a plugin update, set different
// opt-in message.
$default_optin_message = $is_gdpr_required ?
fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ) :
fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug );
// 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';
}
}
$message = $fs->apply_filters(
$filter,
($is_network_upgrade_mode ?
'' :
/* translators: %s: name (e.g. Hey John,) */
$hey_x_text . '
'
) .
sprintf(
esc_html( $default_optin_message ),
'' . esc_html( $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,
$is_gdpr_required
);
}
if ( $is_network_upgrade_mode ) {
$network_integration_text = esc_html( fs_text_inline( 'We\'re excited to introduce the Freemius network-level integration.', 'connect_message_network_upgrade', $slug ) );
if ($is_premium_code){
$message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %d site(s) that are still pending license activation.', 'connect_message_network_upgrade-premium', $slug ), count( $sites ) );
$message .= '
' . sprintf( fs_text_inline( 'If you\'d like to use the %s on those sites, please enter your license key below and click the activation button.', 'connect_message_network_upgrade-premium-activate-license', $slug ), $is_premium_only ? $fs->get_module_label( true ) : sprintf(
/* translators: %s: module type (plugin, theme, or add-on) */
fs_text_inline( "%s's paid features", 'x-paid-features', $slug ),
$fs->get_module_label( true )
) );
/* translators: %s: module type (plugin, theme, or add-on) */
$message .= ' ' . sprintf( fs_text_inline( 'Alternatively, you can skip it for now and activate the license later, in your %s\'s network-level Account page.', 'connect_message_network_upgrade-premium-skip-license', $slug ), $fs->get_module_label( true ) );
}else {
$message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %s site(s) in the network that are still pending your attention.', 'connect_message_network_upgrade-free', $slug ), count( $sites ) ) . '
' . ( fs_starts_with( $message, $hey_x_text . '
' ) ? substr( $message, strlen( $hey_x_text . '
' ) ) : $message );
}
}
echo $message;
?>