| @@ -84,9 +84,9 @@ | ||
| 84 | 84 | * @since 2.8.2 |
| 85 | 85 | * @return bool |
| 86 | 86 | */ |
| 87 | 87 | public function allow_load() { |
| 88 | - if ( ! is_admin() ) { | |
| 88 | + if ( ! is_admin() || Helper::hide_promotions() ) { | |
| 89 | 89 | return false; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Gate on the cap required to actually manage SureForms forms |
| @@ -180,8 +180,29 @@ | ||
| 180 | 180 | [], |
| 181 | 181 | SRFM_VER |
| 182 | 182 | ); |
| 183 | 183 | |
| 184 | + // Editor nudge UTM attribution — start. | |
| 185 | + // Tag the "Create Form" CTA with the same UTM scheme used by other | |
| 186 | + // SureForms nudge links so the destination flow can attribute the | |
| 187 | + // click. Only fills keys not already present in the URL. | |
| 188 | + $create_form_url = admin_url( 'admin.php?page=add-new-form' ); | |
| 189 | + $nudge_utm = [ | |
| 190 | + 'utm_source' => 'sureforms_plugin', | |
| 191 | + 'utm_medium' => 'editor_nudge', | |
| 192 | + 'utm_campaign' => 'core_plugin', | |
| 193 | + ]; | |
| 194 | + $existing_args = []; | |
| 195 | + $query_string = wp_parse_url( $create_form_url, PHP_URL_QUERY ); | |
| 196 | + if ( is_string( $query_string ) && '' !== $query_string ) { | |
| 197 | + parse_str( $query_string, $existing_args ); | |
| 198 | + } | |
| 199 | + $missing_utm = array_diff_key( $nudge_utm, $existing_args ); | |
| 200 | + if ( ! empty( $missing_utm ) ) { | |
| 201 | + $create_form_url = add_query_arg( $missing_utm, $create_form_url ); | |
| 202 | + } | |
| 203 | + // Editor nudge UTM attribution — end. | |
| 204 | + | |
| 184 | 205 | wp_localize_script( |
| 185 | 206 | $handle, |
| 186 | 207 | 'srfm_editor_nudge', |
| 187 | 208 | [ |
| @@ -186,9 +207,9 @@ | ||
| 186 | 207 | 'srfm_editor_nudge', |
| 187 | 208 | [ |
| 188 | 209 | 'ajax_url' => admin_url( 'admin-ajax.php' ), |
| 189 | 210 | 'nonce' => wp_create_nonce( self::NONCE_ACTION ), |
| 190 | - 'create_form_url' => admin_url( 'admin.php?page=add-new-form' ), | |
| 211 | + 'create_form_url' => $create_form_url, | |
| 191 | 212 | 'message' => __( 'Hey! It looks like you\'re creating a form. Build a ready-to-use form in under 30 seconds with SureForms AI, with no extra setup required.', 'sureforms' ), |
| 192 | 213 | 'button_label' => __( 'Create Form', 'sureforms' ), |
| 193 | 214 | 'logo_url' => SRFM_URL . 'admin/assets/sureforms-logo.png', |
| 194 | 215 | ] |