Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lite to pro improvement #2173

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2d88777
Update top upgrade bar styling
truongwp Nov 26, 2024
32e7248
Temp commit
truongwp Nov 27, 2024
9f0530c
Improve views page
truongwp Dec 3, 2024
7c743e2
Improve application placeholder
truongwp Dec 3, 2024
4ee21af
Change form templates upgrade banner
truongwp Dec 4, 2024
12cc1f3
Update tip in fields list
truongwp Dec 4, 2024
36b3017
Update application warning style
truongwp Dec 4, 2024
96ec7d0
Complete bottom banner
truongwp Dec 9, 2024
e68d17f
Fix workflow errors
truongwp Dec 9, 2024
c8e31e1
Update Views video, top bar color, add-ons banner
truongwp Dec 11, 2024
34c0633
Improve button color and spacing
truongwp Dec 11, 2024
d056229
Change video border radius, some colors
truongwp Dec 16, 2024
41c6809
Update upgrade link text
truongwp Dec 16, 2024
75dc0e7
Change button hover gradient
truongwp Dec 17, 2024
35ae839
Update styling
truongwp Dec 17, 2024
10ef1af
Correct views features desc
truongwp Dec 18, 2024
96ac4fa
Reduce translation strings
truongwp Dec 18, 2024
f3dd7f0
Fix e2e test
truongwp Dec 20, 2024
90fda86
Fix e2e tests
truongwp Dec 24, 2024
b85bd34
Fix e2e
truongwp Dec 25, 2024
437d10f
Fix e2e
truongwp Dec 25, 2024
3123f0c
Merge branch 'master' into lite-to-pro-improvement
Crabcyborg Jan 7, 2025
23e9c59
Use gradient button for bottom banner
truongwp Jan 8, 2025
6e87af3
Use link for the whole pro tip
truongwp Jan 8, 2025
7fd7b97
Fix PHP notice in Global settings if Pro is installed
truongwp Jan 8, 2025
a2d1daf
Merge branch 'master' into lite-to-pro-improvement
Crabcyborg Jan 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ public static function show_conditional_action_button( $atts ) {
public static function addon_upgrade_link( $addon, $upgrade_link ) {
$atts = is_array( $upgrade_link ) ? $upgrade_link : array();
$upgrade_link = is_array( $upgrade_link ) ? $upgrade_link['link'] : $upgrade_link;
$text = ! empty( $atts['text'] ) ? $atts['text'] : __( 'Upgrade Now', 'formidable' );

if ( $addon ) {
$upgrade_link .= '&utm_content=' . $addon['slug'];
Expand All @@ -1427,7 +1428,7 @@ public static function addon_upgrade_link( $addon, $upgrade_link ) {
}
?>
<a class="install-now button <?php echo esc_attr( $class ); ?>" href="<?php echo esc_url( $upgrade_link ); ?>" target="_blank" rel="noopener" aria-label="<?php esc_attr_e( 'Upgrade Now', 'formidable' ); ?>">
<?php esc_html_e( 'Upgrade Now', 'formidable' ); ?>
<?php echo esc_html( $text ); ?>
</a>
<?php
}
Expand Down
6 changes: 6 additions & 0 deletions classes/controllers/FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ private static function is_grey_page() {
$grey_pages = array(
'formidable-applications',
'formidable-dashboard',
'formidable-views',
);

$is_grey_page = self::is_page_in_list( $grey_pages );
Expand Down Expand Up @@ -888,6 +889,11 @@ private static function should_show_floating_links() {
public static function admin_enqueue_scripts() {
self::load_wp_admin_style();
self::maybe_force_formidable_block_on_gutenberg_page();

if ( FrmAppHelper::is_admin_page( 'formidable-settings' ) ) {
wp_enqueue_style( FrmDashboardController::PAGE_SLUG, FrmAppHelper::plugin_url() . '/css/admin/dashboard.css', array(), FrmAppHelper::plugin_version() );
}

FrmUsageController::load_scripts();
}

Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmHooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static function load_admin_hooks() {
// Settings Controller.
add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
add_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
add_action( 'frm_after_settings_tabs', 'FrmSettingsController::settings_cta' );

// Styles Controller.
add_action( 'admin_menu', 'FrmStylesController::menu', 14 );
Expand Down
19 changes: 0 additions & 19 deletions classes/controllers/FrmSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,29 +330,10 @@ public static function route( $stop_load = false ) {
* @since 3.04.02
*/
public static function settings_cta( $view ) {

if ( get_option( 'frm_lite_settings_upgrade', false ) ) {
return;
}

$features = array(
__( 'Extra form features like file uploads, pagination, etc', 'formidable' ),
__( 'Repeaters & cascading fields for advanced forms', 'formidable' ),
__( 'Flexibly view, search, edit, and delete entries anywhere', 'formidable' ),
__( 'Display entries with virtually limitless Formidable views', 'formidable' ),
__( 'Create surveys & polls', 'formidable' ),
__( 'WordPress user registration and login forms', 'formidable' ),
__( 'Create Stripe, PayPal or Authorize.net payment forms', 'formidable' ),
__( 'Powerful conditional logic for smart forms', 'formidable' ),
__( 'Integrations with 1000+ marketing & payment services', 'formidable' ),
__( 'Collect digital signatures', 'formidable' ),
__( 'Accept user-submitted content with Post submissions', 'formidable' ),
__( 'Email routing', 'formidable' ),
__( 'Create calculator forms', 'formidable' ),
__( 'Save draft entries and return later', 'formidable' ),
__( 'Analyze form data with graphs & stats', 'formidable' ),
);

include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/settings_cta.php';
}

Expand Down
23 changes: 23 additions & 0 deletions classes/helpers/FrmAddonsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public static function show_upgrade_renew_cta() {
private static function show_expired_cta() {
FrmTipsHelper::show_admin_cta(
array(
'class' => 'frm-gradient',
'icon' => 'frmfont frm_speaker_icon',
'title' => esc_html__( 'Unlock Add-on library', 'formidable' ),
'description' => esc_html__( 'Renew your subscription today and access our library of add-ons to supercharge your forms.', 'formidable' ),
'link_text' => esc_html__( 'Renew Now', 'formidable' ),
Expand All @@ -71,6 +73,8 @@ private static function show_expired_cta() {
private static function show_lite_cta() {
FrmTipsHelper::show_admin_cta(
array(
'class' => 'frm-gradient',
'icon' => 'frmfont frm_speaker_icon',
'title' => esc_html__( 'Unlock Add-on library', 'formidable' ),
'description' => esc_html__( 'Upgrade to Pro and access our library of add-ons to supercharge your forms.', 'formidable' ),
'link_text' => esc_html__( 'Upgrade to PRO', 'formidable' ),
Expand Down Expand Up @@ -261,4 +265,23 @@ private static function set_plan_required( $addon ) {
public static function get_plan() {
return self::$plan_required;
}

public static function show_five_star_rating( $color = 'black' ) {
$icon = file_get_contents( FrmAppHelper::plugin_path() . '/images/star.svg' );
?>
<span style="color: <?php echo esc_attr( $color ); ?>;">
<?php
for ( $i = 0; $i < 5; $i++ ) {
echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</span>
<?php
}
Crabcyborg marked this conversation as resolved.
Show resolved Hide resolved

public static function guarantee_icon() {
?>
<img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/guarantee.svg' ); ?>" alt="" />
<?php
}
truongwp marked this conversation as resolved.
Show resolved Hide resolved
}
8 changes: 5 additions & 3 deletions classes/helpers/FrmFormTemplatesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ public static function show_upgrade_renew_cta( $args ) {
if ( ! in_array( FrmAddonsController::license_type(), array( 'elite', 'business' ), true ) ) {
FrmTipsHelper::show_admin_cta(
array(
'class' => 'frm-gradient',
'icon' => 'frmfont frm_speaker_icon',
'title' => sprintf(
/* translators: %1$s: Open span tag, %2$s: Close span tag */
esc_html__( 'Get Super Powers with %1$s%2$s More Pre-built Forms', 'formidable' ) . ' 🦸',
esc_html__( 'Upgrade to get all %1$s%2$s templates', 'formidable' ),
'<span class="frm-form-templates-extra-templates-count">',
'</span>'
),
'description' => esc_html__( 'Unleash the potential of hundreds of additional form templates and save precious time. Upgrade today for unparalleled form-building capabilities.', 'formidable' ),
'link_text' => esc_html__( 'Upgrade to PRO', 'formidable' ),
'description' => esc_html__( 'Upgrade to PRO to get access to all of our templates and unlock the full potential of your forms.', 'formidable' ),
'link_text' => esc_html__( 'Get More Templates', 'formidable' ),
'link_url' => $args['upgrade_link'],
'id' => 'frm-upgrade-banner',
)
Expand Down
4 changes: 2 additions & 2 deletions classes/helpers/FrmTipsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public static function show_tip( $tip, $html = '' ) {

$link = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] );
?>
<span class="frm_pro_tip">
<?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?>
<span class="frm_pro_tip frm-gradient">
<span class="frm-tip-badge"><?php esc_html_e( 'PRO TIP', 'formidable' ); ?></span>

<?php if ( isset( $tip['call'] ) ) { ?>
<span class="frm-tip-info">
Expand Down
41 changes: 29 additions & 12 deletions classes/views/dashboard/templates/pro-features-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,34 @@
?>
<div class="frm-dashboard-widget frm-card-item frm-px-0 frm-p-0">
<div class="frm-pro-features-list">
<h2><?php esc_html_e( 'Unlock all the Powerful Features to Defy the Limits', 'formidable' ); ?></h2>
<ul class="frm_two_col frm-green-icons">
<?php foreach ( $features as $feature ) : ?>
<li>
<?php FrmAppHelper::icon_by_class( 'frmfont frm_checkmark_icon' ); ?>
<?php echo esc_html( $feature ); ?>
</li>
<?php endforeach; ?>
</ul>
<a target="_blank" href="<?php echo esc_url( $discount_link ); ?>" title="Upgrade" class="frm-button-primary">
<?php esc_html_e( 'Upgrade to Pro & Get 50% Off', 'formidable' ); ?>
</a>
<div class="frm-pro-features-list-left">
<h2><?php esc_html_e( 'Unlock all the Powerful Features to Defy the Limits', 'formidable' ); ?></h2>
<ul class="frm_two_col frm-green-icons">
<?php foreach ( $features as $feature ) : ?>
<li>
<?php FrmAppHelper::icon_by_class( 'frmfont frm_checkmark_icon' ); ?>
<?php echo esc_html( $feature ); ?>
</li>
<?php endforeach; ?>
</ul>
<a target="_blank" href="<?php echo esc_url( $discount_link ); ?>" title="Upgrade" class="frm-button-primary">
<?php esc_html_e( 'Upgrade to Pro & Get 50% Off', 'formidable' ); ?>
</a>
</div>

<div class="frm-pro-features-list-right">
<div class="frm-testimonial-wrapper">
<div class="frm-testimonial">
<div class="frm-testimonial__content">Amazing plugin, amazing support. We've been using FF since 2016. The best form plugin on WP. Its powerful and versatile with an amazing support!</div>
<div class="frm-testimonial__author">Emmanuel Khoury</div>
<div class="frm-testimonial__rating">
<?php FrmAddonsHelper::show_five_star_rating( '#FFD966' ); ?>
</div>
<div class="frm-testimonial__guarantee-icon">
<?php FrmAddonsHelper::guarantee_icon(); ?>
</div>
</div>
</div>
</div>
truongwp marked this conversation as resolved.
Show resolved Hide resolved
</div>
</div>
70 changes: 36 additions & 34 deletions classes/views/frm-settings/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,44 @@

<div id="post-body-content" class="frm-fields">

<?php require FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php'; ?>
<input type="hidden" name="frm_action" value="process-form"/>
<input type="hidden" name="action" value="process-form"/>
<?php wp_nonce_field( 'process_form_nonce', 'process_form' ); ?>
<?php require FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php'; ?>
<input type="hidden" name="frm_action" value="process-form"/>
<input type="hidden" name="action" value="process-form"/>
<?php wp_nonce_field( 'process_form_nonce', 'process_form' ); ?>

<?php
foreach ( $sections as $section ) {
if ( $current === $section['anchor'] ) {
?>
<style type="text/css">.<?php echo esc_attr( $section['anchor'] ); ?> {
display: block;
}</style>
<?php } ?>
<div id="<?php echo esc_attr( $section['anchor'] ); ?>"
class="<?php echo esc_attr( $section['anchor'] ); ?> tabs-panel <?php echo esc_attr( $current === $section['anchor'] ? 'frm_block' : 'frm_hidden' ); ?>">
<h2 class="frm-h2">
<?php echo FrmAppHelper::kses( $section['name'], array( 'span' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</h2>
<?php if ( isset( $section['ajax'] ) ) { ?>
<div class="frm_ajax_settings_tab frm_<?php echo esc_attr( $section['anchor'] ); ?>_ajax">
<span class="frm-wait"></span>
</div>
<?php } else { ?>
<?php
foreach ( $sections as $section ) {
if ( $current === $section['anchor'] ) {
?>
<style type="text/css">.<?php echo esc_attr( $section['anchor'] ); ?> {
display: block;
}</style>
<?php } ?>
<div id="<?php echo esc_attr( $section['anchor'] ); ?>"
class="<?php echo esc_attr( $section['anchor'] ); ?> tabs-panel <?php echo esc_attr( $current === $section['anchor'] ? 'frm_block' : 'frm_hidden' ); ?>">
<h2 class="frm-h2">
<?php echo FrmAppHelper::kses( $section['name'], array( 'span' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</h2>
<?php if ( isset( $section['ajax'] ) ) { ?>
<div class="frm_ajax_settings_tab frm_<?php echo esc_attr( $section['anchor'] ); ?>_ajax">
<span class="frm-wait"></span>
</div>
<?php } else { ?>
<?php
if ( isset( $section['class'] ) ) {
call_user_func( array( $section['class'], $section['function'] ) );
} elseif ( isset( $section['function'] ) ) {
call_user_func( $section['function'] );
}
}
do_action( 'frm_' . $section['anchor'] . '_form', $frm_settings );
?>
</div>
<?php
}//end foreach
?>
if ( isset( $section['class'] ) ) {
call_user_func( array( $section['class'], $section['function'] ) );
} elseif ( isset( $section['function'] ) ) {
call_user_func( $section['function'] );
}
truongwp marked this conversation as resolved.
Show resolved Hide resolved
}
do_action( 'frm_' . $section['anchor'] . '_form', $frm_settings );
?>
</div>
<?php
}//end foreach

do_action( 'frm_after_settings_tabs' );
?>
</div>
</div>
</div>
Expand Down
45 changes: 12 additions & 33 deletions classes/views/frm-settings/settings_cta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,19 @@
die( 'You are not allowed to call this page directly.' );
}
?>
<div id="frm-dismissable-cta" class="frm-modal settings-lite-cta">
<div class="postbox" style="border:none;">
<div class="inside">
<div id="frm-dismissable-cta" class="frm-modal settings-lite-cta" style="margin-top: 40px;">
<div class="postbox" style="border:none;">
<div class="inside">
<a href="#" class="dismiss" style="position:absolute;z-index:999;right: calc(var(--gap-md) + 8px);top:calc(var(--gap-md) + 12px);" title="<?php esc_attr_e( 'Dismiss this message', 'formidable' ); ?>">
<?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => 'Dismiss' ) ); ?>
</a>

<a href="#" class="dismiss alignright" title="<?php esc_attr_e( 'Dismiss this message', 'formidable' ); ?>">
<?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => 'Dismiss' ) ); ?>
</a>
<div class="cta-inside">
<h2><?php esc_html_e( 'Get Formidable Forms Pro and Unlock all the Powerful Features', 'formidable' ); ?></h2>
<p><?php esc_html_e( 'Thanks for being a loyal Formidable Forms user. Upgrade to Formidable Forms Pro to unlock all the awesome features and learn how others are defying the limits by taking on big projects without big resources.', 'formidable' ); ?></p>
<p>
<?php esc_html_e( 'We know that you will truly love Formidable Forms.', 'formidable' ); ?>
</p>
<br/>
<h3><?php esc_html_e( 'Pro Features', 'formidable' ); ?></h3>
<ul class="frm_two_col frm-green-icons">
<?php foreach ( $features as $feature ) { ?>
<li>
<?php FrmAppHelper::icon_by_class( 'frmfont frm_checkmark_icon', array( 'aria-hidden' => 'true' ) ); ?>
<?php echo esc_html( $feature ); ?>
</li>
<?php } ?>
</ul>
<div class="clear"></div>

<p>
<a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( 'settings-upgrade' ) ); ?>" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Get Formidable Forms Pro Today and Unlock all the Powerful Features »', 'formidable' ); ?>
</a>
</p>
<p>
<strong>Bonus:</strong> Formidable Forms Lite users get <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( 'settings-upgrade-bonus' ) ); ?>" target="_blank" rel="noopener noreferrer" class="frm_green">50% off regular price</a>, automatically applied at checkout.
</p>
</div>
<div class="cta-inside">
<?php
$dashboard_helper = new FrmDashboardHelper( array() );
$dashboard_helper->get_bottom_widget();
?>
</div>
</div>
</div>
</div>
18 changes: 16 additions & 2 deletions classes/views/shared/admin-cta.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@
if ( ! defined( 'ABSPATH' ) ) {
die( 'You are not allowed to call this page directly.' );
}
if ( false === strpos( $attributes['class'], 'frm-gradient' ) ) {
$button_class = 'frm-button-primary';
} else {
$button_class = 'frm-button-secondary';
}
?>
<div <?php FrmAppHelper::array_to_html_params( $attributes, true ); ?>>
<div>
<?php
if ( ! empty( $args['icon'] ) ) {
?>
<div class="frm-cta-icon">
<?php FrmAppHelper::icon_by_class( $args['icon'] ); ?>
</div>
<?php
}
?>
<div class="frm-cta-content">
<h4>
<?php echo FrmAppHelper::kses( $args['title'], array( 'a', 'br', 'span', 'p', 'svg', 'use' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</h4>
Expand All @@ -23,7 +37,7 @@
</p>
</div>

<a href="<?php echo esc_url( $args['link_url'] ); ?>" target="<?php echo esc_attr( $args['target'] ); ?>" class="frm-cta-link button button-primary frm-button-primary">
<a href="<?php echo esc_url( $args['link_url'] ); ?>" target="<?php echo esc_attr( $args['target'] ); ?>" class="frm-cta-link button button-primary <?php echo esc_attr( $button_class ); ?>">
<?php echo esc_html( $args['link_text'] ); ?>
</a>
</div>
Loading
Loading