| @@ -2,135 +2,97 @@ | ||
| 2 | 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 3 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 4 | } |
| 5 | 5 | ?> |
| 6 | -<div class="frm-review-notice frm-dismissible frm-card-item frm-compact-card-item frm-box-shadow-xxl"> | |
| 6 | +<div class="notice notice-info is-dismissible frm-review-notice"> | |
| 7 | 7 | <div class="frm-satisfied"> |
| 8 | - <?php | |
| 9 | - FrmAppHelper::icon_by_class( | |
| 10 | - 'frmfont frm-flag frm_svg40 frm-review-notice-icon frm-text-success-500', | |
| 11 | - array( | |
| 12 | - | |
| 13 | - 'aria-hidden' => 'true', | |
| 14 | - ) | |
| 15 | - ); | |
| 16 | - ?> | |
| 17 | - <h3 class="frm-review-notice-title"><?php esc_html_e( 'Congratulations!', 'formidable' ); ?></h3> | |
| 18 | - <p class="frm-review-notice-text"><span><?php echo esc_html( $title ); ?></span> <span><?php esc_html_e( 'Are you enjoying Formidable Forms?', 'formidable' ); ?></span></p> | |
| 19 | - <div class="frm-flex frm-flex-center frm-gap-sm"> | |
| 20 | - <a href="#" class="show-frm-feedback button frm-button-secondary" data-link="feedback"> | |
| 21 | - <?php esc_html_e( 'Not Really', 'formidable' ); ?> | |
| 22 | - </a> | |
| 23 | - <a href="#" class="show-frm-feedback button frm-button-primary" data-link="review"> | |
| 24 | - <?php esc_html_e( 'Yes, I do!', 'formidable' ); ?> | |
| 25 | - </a> | |
| 26 | - </div> | |
| 8 | + <p> | |
| 9 | + <?php echo esc_html( $title ); ?> | |
| 10 | + <br/> | |
| 11 | + <?php esc_html_e( 'Are you enjoying Formidable Forms?', 'formidable' ); ?> | |
| 12 | + </p> | |
| 13 | + <a href="#" class="frm_reverse_button frm_animate_bg show-frm-feedback frm-button-secondary" data-link="feedback"> | |
| 14 | + <?php esc_html_e( 'Not Really', 'formidable' ); ?> | |
| 15 | + </a> | |
| 16 | + <a href="#" class="frm_animate_bg show-frm-feedback frm-button-primary" data-link="review"> | |
| 17 | + <?php esc_html_e( 'Yes!', 'formidable' ); ?> | |
| 18 | + </a> | |
| 27 | 19 | </div> |
| 28 | - | |
| 29 | 20 | <div class="frm-review-request frm_hidden"> |
| 30 | - <?php | |
| 31 | - FrmAppHelper::icon_by_class( | |
| 32 | - 'frmfont frm-star-feedback-icon frm_svg40 frm-review-notice-icon frm-text-warning-500', | |
| 33 | - array( | |
| 34 | - | |
| 35 | - 'aria-hidden' => 'true', | |
| 36 | - ) | |
| 37 | - ); | |
| 38 | - ?> | |
| 39 | - <h3 class="frm-review-notice-title"><?php esc_html_e( 'Awesome!', 'formidable' ); ?></h3> | |
| 40 | - <p class="frm-review-notice-text"><?php esc_html_e( 'Could you do me a BIG favor and give Formidable Forms a review to help me grow my little business and boost our motivation?', 'formidable' ); ?></p> | |
| 41 | - <div class="frm-review-notice-signature frm-flex frm-gap-xs"> | |
| 42 | - <img src="<?php echo esc_url( FrmAppHelper::plugin_url() ); ?>/images/steph-wells.png" alt="<?php esc_attr_e( 'Steph Wells', 'formidable' ); ?>" /> | |
| 43 | - <div class="frm-flex-col"> | |
| 44 | - <span class="frm-font-medium frm-text-grey-900">Steph Wells</span> | |
| 45 | - <span class="frm-text-xs"><?php esc_html_e( 'Co-Founder and CTO of Formidable Forms', 'formidable' ); ?><span> | |
| 46 | - </div> | |
| 47 | - </div> | |
| 48 | - <div class="frm-flex frm-flex-center frm-gap-sm"> | |
| 49 | - <a href="#" class="frm-dismiss-review-notice button frm-button-secondary" data-link="no" target="_blank" rel="noopener noreferrer"> | |
| 50 | - <?php esc_html_e( 'Maybe Later', 'formidable' ); ?> | |
| 51 | - </a> | |
| 52 | - <a href="https://wordpress.org/support/plugin/formidable/reviews/?filter=5#new-post" class="frm-dismiss-review-notice frm-review-out button frm-button-primary" data-link="yes" target="_blank" rel="noopener"> | |
| 53 | - <?php esc_html_e( 'Ok, you deserve it', 'formidable' ); ?> | |
| 54 | - </a> | |
| 55 | - </div> | |
| 21 | + <p><?php esc_html_e( 'Awesome! Could you do me a BIG favor and give Formidable Forms a review to help me grow my little business and boost our motivation?', 'formidable' ); ?></p> | |
| 22 | + <p>- Steph Wells<br/> | |
| 23 | + <span><?php esc_html_e( 'Co-Founder and CTO of Formidable Forms', 'formidable' ); ?><span> | |
| 24 | + </p> | |
| 25 | + <a href="#" class="frm-dismiss-review-notice frm_reverse_button frm-button-secondary" data-link="no" target="_blank" rel="noopener noreferrer"> | |
| 26 | + <?php esc_html_e( 'No thanks, maybe later', 'formidable' ); ?> | |
| 27 | + </a> | |
| 28 | + <a href="https://wordpress.org/support/plugin/formidable/reviews/?filter=5#new-post" class="frm-dismiss-review-notice frm-review-out frm-button-primary" data-link="yes" target="_blank" rel="noopener"> | |
| 29 | + <?php esc_html_e( 'Ok, you deserve it', 'formidable' ); ?> | |
| 30 | + </a> | |
| 31 | + <br/> | |
| 32 | + <a href="#" class="frm-dismiss-review-notice" data-link="done" target="_blank" rel="noopener noreferrer"> | |
| 33 | + <?php esc_html_e( 'I already did', 'formidable' ); ?> | |
| 34 | + </a> | |
| 56 | 35 | </div> |
| 57 | - | |
| 58 | 36 | <div class="frm-feedback-request frm_hidden"> |
| 59 | - <?php | |
| 60 | - FrmAppHelper::icon_by_class( | |
| 61 | - 'frmfont frm-pencil-message-icon frm_svg40 frm-review-notice-icon frm-text-primary-500', | |
| 62 | - array( | |
| 37 | + <p><?php esc_html_e( 'Sorry to hear you aren\'t enjoying building with Formidable. We would love a chance to improve. Could you take a minute and let us know what we can do better?', 'formidable' ); ?></p> | |
| 63 | 38 | |
| 64 | - 'aria-hidden' => 'true', | |
| 65 | - ) | |
| 66 | - ); | |
| 67 | - ?> | |
| 68 | - <p class="frm-review-notice-text"><?php esc_html_e( 'Sorry to hear you aren\'t enjoying building with Formidable. We would love a chance to improve. Could you take a minute and let us know what we can do better?', 'formidable' ); ?></p> | |
| 69 | - <div id="frmapi-feedback" class="frmapi-form" data-url="https://sandbox.formidableforms.com/api/wp-json/frm/v2/forms/feedback?return=html&exclude_script=jquery&exclude_style=formidable-css"> | |
| 39 | + <div id="frmapi-feedback" class="frmapi-form" data-url="https://community.formidableforms.com/wp-json/frm/v2/forms/feedback?return=html"> | |
| 70 | 40 | <span class="frm-wait frm_visible_spinner"></span> |
| 71 | 41 | </div> |
| 72 | 42 | </div> |
| 73 | - | |
| 74 | - <a class="dismiss frm-dismiss-review-notice" aria-label="<?php esc_attr_e( 'Dismiss this notice', 'formidable' ); ?>" role="button"> | |
| 75 | - <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon' ); ?> | |
| 76 | - </a> | |
| 77 | 43 | </div> |
| 78 | - | |
| 79 | 44 | <script type="text/javascript"> |
| 80 | 45 | jQuery( document ).ready( function( $ ) { |
| 81 | - $( document ).on( | |
| 82 | - 'click', | |
| 83 | - '.frm-dismiss-review-notice', | |
| 84 | - function( event ) { | |
| 85 | - if ( ! $( this ).hasClass( 'frm-review-out' ) ) { | |
| 86 | - event.preventDefault(); | |
| 87 | - } | |
| 88 | - let link = $( this ).data( 'link' ); | |
| 89 | - if ( typeof link === 'undefined' ) { | |
| 90 | - link = 'no'; | |
| 91 | - } | |
| 46 | + $(document).on( 'click', '.frm-dismiss-review-notice, .frm-review-notice .notice-dismiss', function( event ) { | |
| 92 | 47 | |
| 93 | - frmDismissReview( link ); | |
| 94 | - $( '.frm-review-notice' ).remove(); | |
| 48 | + if ( ! $( this ).hasClass( 'frm-review-out' ) ) { | |
| 49 | + event.preventDefault(); | |
| 95 | 50 | } |
| 96 | - ); | |
| 51 | + var link = $( this ).data('link'); | |
| 52 | + if ( typeof link === 'undefined' ) { | |
| 53 | + link = 'no'; | |
| 54 | + } | |
| 97 | 55 | |
| 98 | - $( document ).on( 'click', '.frm-feedback-request button', () => frmDismissReview( 'done' ) ); | |
| 56 | + frmDismissReview( link ); | |
| 57 | + $( '.frm-review-notice' ).remove(); | |
| 58 | + } ); | |
| 99 | 59 | |
| 100 | - $( '.show-frm-feedback' ).click( | |
| 101 | - function( e ) { | |
| 102 | - e.preventDefault(); | |
| 103 | - const link = $( this ).data( 'link' ); | |
| 104 | - const className = '.frm-' + link + '-request'; | |
| 105 | - jQuery( '.frm-satisfied' ).hide(); | |
| 106 | - jQuery( className ).show(); | |
| 60 | + $(document).on('click', '.frm-feedback-request button', function() { | |
| 61 | + frmDismissReview( 'done' ); | |
| 62 | + } ); | |
| 107 | 63 | |
| 108 | - if ( className === '.frm-feedback-request' ) { | |
| 109 | - frmapiGetData( $( '#frmapi-feedback' ) ); | |
| 110 | - } | |
| 64 | + $('.show-frm-feedback').click( function( e ){ | |
| 65 | + e.preventDefault(); | |
| 66 | + var link = $(this).data('link'); | |
| 67 | + var className = '.frm-' + link + '-request'; | |
| 68 | + jQuery('.frm-satisfied').hide(); | |
| 69 | + jQuery(className).show(); | |
| 70 | + | |
| 71 | + if ( className === '.frm-feedback-request' ) { | |
| 72 | + var frmapi = $('#frmapi-feedback'); | |
| 73 | + frmapiGetData( frmapi ); | |
| 111 | 74 | } |
| 112 | - ); | |
| 75 | + }); | |
| 113 | 76 | } ); |
| 114 | 77 | |
| 115 | 78 | function frmDismissReview( link ) { |
| 116 | - jQuery.post( | |
| 117 | - ajaxurl, | |
| 118 | - { | |
| 119 | - action: 'frm_dismiss_review', | |
| 120 | - link, | |
| 121 | - nonce: '<?php echo esc_html( wp_create_nonce( 'frm_ajax' ) ); ?>' | |
| 122 | - } | |
| 123 | - ); | |
| 79 | + jQuery.post( ajaxurl, { | |
| 80 | + action: 'frm_dismiss_review', | |
| 81 | + link: link, | |
| 82 | + nonce: '<?php echo esc_html( wp_create_nonce( 'frm_ajax' ) ); ?>' | |
| 83 | + } ); | |
| 124 | 84 | } |
| 125 | 85 | |
| 126 | 86 | function frmapiGetData( frmcont ) { |
| 127 | 87 | jQuery.ajax({ |
| 128 | - dataType: 'json', | |
| 129 | - url: frmcont.data( 'url' ), | |
| 130 | - success: ( json ) => { | |
| 131 | - const form = json.renderedHtml.replace( /<link\b[^>]*(formidableforms.css|action=frmpro_css)[^>]*>/gi, '' ); | |
| 132 | - frmcont.html( form ); | |
| 88 | + dataType:'json', | |
| 89 | + url:frmcont.data('url'), | |
| 90 | + success:function(json){ | |
| 91 | + var form = json.renderedHtml; | |
| 92 | + form = form.replace(/<script\b[^<]*(community.formidableforms.com\/wp-includes\/js\/jquery\/jquery)[^<]*><\/script>/gi, '' ); | |
| 93 | + form = form.replace(/<link\b[^>]*(formidableforms.css)[^>]*>/gi, '' ); | |
| 94 | + frmcont.html(form); | |
| 133 | 95 | } |
| 134 | 96 | }); |
| 135 | 97 | } |
| 136 | 98 | </script> |