Changeset 2413440
- Timestamp:
- 11/05/2020 05:35:29 PM (4 years ago)
- Location:
- activecampaign-subscription-forms/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
activecampaign-subscription-forms/trunk/README.md
r2378752 r2413440 25 25 4. Choose which subscription forms to cache locally, any optional sub-settings for each, then hit Update again. 26 26 5. Use `[activecampaign form=ID]` shortcode to display a form anywhere on your site where shortcode syntax is supported. 27 6. Embed multiple forms onto a single page! 28 7. Enable site tracking to have page visits tracked to ActiveCampaign. 27 6. Add optional shortcode parameters `css=1` or `css=0` to override the plugin setting's "Use ActiveCampaign's form CSS" value. 28 7. Embed multiple forms onto a single page! 29 8. Enable site tracking to have page visits tracked to ActiveCampaign. 29 30 30 31 ## Frequently Asked Questions … … 72 73 ## Changelog 73 74 75 ### 8.1.0 76 * Improvements to Gutenberg Editor experience, including live preview of Form embeds 77 * Background color bug fix 78 * Shortcode support for optional 'css' and 'static' attributes that default to plugin settings 79 * Avoiding global namespace conflicts of on-demand chunks bug fix 80 74 81 ### 8.0.3 75 82 * Pluggable bug fix -
activecampaign-subscription-forms/trunk/activecampaign.php
r2380663 r2413440 5 5 Description: Allows you to add ActiveCampaign contact forms to any post, page, or sidebar. Also allows you to embed <a href="http://www.activecampaign.com/help/site-event-tracking/" target="_blank">ActiveCampaign site tracking</a> code in your pages. To get started, please activate the plugin and add your <a href="http://www.activecampaign.com/help/using-the-api/" target="_blank">API credentials</a> in the <a href="options-general.php?page=activecampaign">plugin settings</a>. 6 6 Author: ActiveCampaign 7 Version: 8. 0.37 Version: 8.1.0 8 8 Author URI: http://www.activecampaign.com 9 9 */ … … 51 51 ## version 8.0.2: Security fix to address CSRF vulnerability, general fix to address browser warning for invalid cookie attribute 52 52 ## version 8.0.3: Pluggable bug fix 53 ## version 8.1.0: Improvements to Gutenberg Editor experience, including live preview of Form embeds. Background color bug fix. Shortcode support for optional 'css' and 'static' attributes that default to plugin settings. Avoiding global namespace conflicts of on-demand chunks bug fix. 53 54 54 55 define("ACTIVECAMPAIGN_URL", ""); … … 64 65 * @param array form The individual form metadata (that we obtained from the forms/getforms API call). 65 66 * @param boolean static Set to true so the "floating" forms don't float. Typically this is done for the admin section only. 67 * @param boolean nostyles Manual override value for nostyles URL Param. Used in shortcode eval to bypass plugin setting. 68 * @param boolean preview Manual value for preview URL Param. 66 69 * @return string The raw source code that will render the form in the browser. 67 70 */ 68 function activecampaign_form_source($settings, $form, $static = false ) {71 function activecampaign_form_source($settings, $form, $static = false, $nostyles = null, $preview = false) { 69 72 $source = ""; 70 73 if (isset($form["version"]) && $form["version"] == 2) { … … 72 75 $source .= "<div class='_form_" . $form["id"] . "'></div>"; 73 76 } 74 // Set to activehosted.com domain by default. 75 $domain = $settings["account_view"]["account"]; 76 $source .= "<script type='text/javascript' src='"; 77 $source .= sprintf("https://%s/f/embed.php?", $domain); 78 if ($static) { 79 $source .= "static=1&"; 80 } 81 $source .= sprintf("id=%d&%s", $form["id"], strtoupper(uniqid())); 82 if (!isset($settings["css"][$form["id"]]) || !$settings["css"][$form["id"]]) { 83 $source .= "&nostyles=1"; 84 } 85 $source .= "'></script>"; 77 $source .= "<script type='text/javascript' src='".activecampaign_form_script_src($settings, $form, $static, $nostyles, $preview)."'></script>"; 86 78 } else { 87 79 // Version 1 forms. 88 80 } 89 81 return $source; 82 } 83 /** 84 * Get the script src attribute value for the form's embed. 85 * This is used in shortcode rendering as well as block editor initialization. 86 * 87 * @param array settings The saved ActiveCampaign settings (from the WordPress admin section). 88 * @param array form The individual form metadata (that we obtained from the forms/getforms API call). 89 * @param boolean static Set to true so the "floating" forms don't float. Typically this is done for the admin section only. 90 * @param boolean nostyles Manual override value for nostyles URL Param. Used in shortcode eval to bypass plugin setting. 91 * @param boolean preview Manual value for preview URL Param. 92 * @return string The URL-Encoded src for the rendered script tag 93 */ 94 function activecampaign_form_script_src($settings, $form, $static = false, $nostyles = null, $preview = false){ 95 // Set to activehosted.com domain by default. 96 $domain = $settings["account_view"]["account"]; 97 $source = sprintf("https://%s/f/embed.php?", $domain); 98 99 // Always passing params for JS eval in block editor 100 $source .= ($static)? "static=1&" : "static=0&"; 101 102 $source .= sprintf("id=%d&%s", $form["id"], strtoupper(uniqid())); 103 104 $source .= ( 105 (isset($nostyles) && $nostyles === true) 106 || (!isset($nostyles) && (!isset($settings["css"][$form["id"]]) || !$settings["css"][$form["id"]])) 107 )? "&nostyles=1" : "&nostyles=0"; 108 109 $source .= ($preview)? "&preview=1" : "&preview=0"; 110 111 return $source; 90 112 } 91 113 … … 95 117 if ($settings) { 96 118 if (isset($settings["forms"]) && $settings["forms"]) { 97 if (isset($args) && isset($args["form"]) ) {119 if (isset($args) && isset($args["form"]) && isset($settings["forms"][$args["form"]])) { 98 120 $form_id = $args["form"]; 99 121 $form = $settings["forms"][$form_id]; 100 $form_source = activecampaign_form_source($settings, $form); 101 return $form_source; 122 123 $static = false; 124 if(isset($args["static"]) && ($args["static"] === 1 || $args["static"] === '1' || $args["static"] === 'true')){ 125 $static = true; 126 } 127 128 $preview = false; 129 if(isset($args["preview"]) && ($args["preview"] === 1 || $args["preview"] === '1' || $args["preview"] === 'true')){ 130 $preview = true; 131 } 132 133 // Use null default for undefined settings fallback 134 $nostyles = null; 135 if(isset($args["css"])){ 136 if($args["css"] === 1 || $args["css"] === '1' || $args["css"] === 'true'){ 137 $nostyles = false; 138 } 139 else if($args["css"] === 0 || $args["css"] === '0' || $args["css"] === 'false'){ 140 $nostyles = true; 141 } 142 } 143 144 return activecampaign_form_source($settings, $form, $static, $nostyles, $preview); 102 145 } 103 146 } 147 // Returning un-filtered tag for block editor eval 148 return "[activecampaign]"; 104 149 } 105 150 else { … … 362 407 <div style="display: none;"> 363 408 <input type="radio" name="syim[<?php echo $form["id"]; ?>]" id="activecampaign_form_swim_<?php echo $form["id"]; ?>" value="swim" <?php echo $settings_swim_checked; ?> onchange="swim_toggle(<?php echo $form["id"]; ?>, this.checked);" /> 364 <label for="activecampaign_form_swim_<?php echo $form["id"]; ?>" style=""> Add Subscriber</label>409 <label for="activecampaign_form_swim_<?php echo $form["id"]; ?>" style=""><?php echo __("Add Subscriber", "menu-activecampaign"); ?></label> 365 410 <br /> 366 411 <input type="radio" name="syim[<?php echo $form["id"]; ?>]" id="activecampaign_form_sync_<?php echo $form["id"]; ?>" value="sync" <?php echo $settings_sync_checked; ?> onchange="sync_toggle(<?php echo $form["id"]; ?>, this.checked);" /> 367 <label for="activecampaign_form_sync_<?php echo $form["id"]; ?>" style=""> Sync Subscriber</label>412 <label for="activecampaign_form_sync_<?php echo $form["id"]; ?>" style=""><?php echo __("Sync Subscriber", "menu-activecampaign"); ?></label> 368 413 <br /> 369 414 <br /> … … 371 416 <?php if (!isset($form["version"]) || $form["version"] != 2): ?> 372 417 <input type="checkbox" name="ajax[<?php echo $form["id"]; ?>]" id="activecampaign_form_ajax_<?php echo $form["id"]; ?>" value="1" <?php echo $settings_ajax_checked; ?> onchange="ajax_toggle(<?php echo $form["id"]; ?>, this.checked);" /> 373 <label for="activecampaign_form_ajax_<?php echo $form["id"]; ?>" style=""> Submit form without refreshing page</label>418 <label for="activecampaign_form_ajax_<?php echo $form["id"]; ?>" style=""><?php echo __("Submit form without refreshing page", "menu-activecampaign"); ?></label> 374 419 <br /> 375 420 <?php endif; ?> 376 421 <input type="checkbox" name="css[<?php echo $form["id"]; ?>]" id="activecampaign_form_css_<?php echo $form["id"]; ?>" value="1" <?php echo $settings_css_checked; ?> /> 377 <label for="activecampaign_form_css_<?php echo $form["id"]; ?>" style=""> Keep original form CSS</label>422 <label for="activecampaign_form_css_<?php echo $form["id"]; ?>" style=""><?php echo __("Use ActiveCampaign's form CSS", "menu-activecampaign"); ?></label> 378 423 </div> 379 424 -
activecampaign-subscription-forms/trunk/readme.txt
r2378752 r2413440 3 3 Tags: activecampaign, active campaign, email-marketing, newsletter, marketing-automation, subscribe, forms, emails, automation, live-chat, customer-messaging, customer-experience-automation 4 4 Requires at least: 2.0 5 Tested up to: 5. 4.25 Tested up to: 5.5.1 6 6 Stable tag: trunk 7 7 … … 42 42 4. Choose which subscription forms to cache locally, any optional sub-settings for each, then hit Update again. 43 43 5. Use `[activecampaign form=ID]` shortcode to display a form anywhere on your site where shortcode syntax is supported. 44 6. Embed multiple forms onto a single page! 45 7. Enable site tracking to have page visits tracked to ActiveCampaign. 44 6. Add optional shortcode parameters `css=1` or `css=0` to override the plugin setting's "Use ActiveCampaign's form CSS" value. 45 7. Embed multiple forms onto a single page! 46 8. Enable site tracking to have page visits tracked to ActiveCampaign. 46 47 47 48 == Frequently Asked Questions == … … 88 89 89 90 == Changelog == 91 = 8.1.0 = 92 * Improvements to Gutenberg Editor experience, including live preview of Form embeds 93 * Background color bug fix 94 * Shortcode support for optional 'css' and 'static' attributes that default to plugin settings 95 * Avoiding global namespace conflicts of on-demand chunks bug fix 96 90 97 = 8.0.3 = 91 98 * Pluggable bug fix
Note: See TracChangeset
for help on using the changeset viewer.