Changeset 882006
- Timestamp:
- 03/25/2014 10:50:11 PM (12 years ago)
- Location:
- conductrics-webactions/trunk
- Files:
-
- 4 edited
-
conductrics-webactions.php (modified) (1 diff)
-
includes/wa-runtime.php (modified) (2 diffs)
-
includes/wa-settings.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
conductrics-webactions/trunk/conductrics-webactions.php
r738741 r882006 3 3 Plugin Name: Conductrics Web Actions 4 4 Description: Includes Conductrics Web Actions scripts in your pages, which makes it easy to test changes to your pages, track their success, and do dynamic targeting. 5 Version: 0.3. 35 Version: 0.3.4 6 6 Author: Conductrics 7 7 Author URI: http://conductrics.com -
conductrics-webactions/trunk/includes/wa-runtime.php
r719446 r882006 3 3 public function __construct() { 4 4 add_action("template_redirect", array($this, "include_script")); 5 add_action("wp_print_scripts", array($this, "include_scripts_norocketscript")); 6 } 7 8 /** 9 * Workaround for Rocketscript (thanks to http://snippets.webaware.com.au/snippets/stop-cloudflare-rocketscript-breaking-wordpress-plugin-scripts/) 10 */ 11 function include_scripts_norocketscript() { 12 global $wp_scripts; 13 if (wp_script_is('conductrics-wa-script')) { 14 // Manually include jQuery prerequisite first 15 $script = $wp_scripts->query('jquery'); 16 if ($script) { 17 $wp_scripts->print_scripts($script); 18 } 19 wp_dequeue_script('conductrics-wa-script'); 20 $this->enqueue_without_rocketscript('conductrics-wa-script'); 21 } 22 } 23 24 function enqueue_without_rocketscript($handle) { 25 global $wp_scripts; 26 27 $script = $wp_scripts->query($handle); 28 $src = $script->src; 29 if (!empty($script->ver)) { 30 $src = add_query_arg('ver', $script->ver, $src); 31 } 32 $src = esc_url(apply_filters('script_loader_src', $src, $handle)); 33 echo "<script data-cfasync='false' type='text/javascript' src='$src'></script>\n"; 5 34 } 6 35 … … 27 56 $apikey = urlencode($account_options['apikey']); 28 57 $agentCodes = urlencode($agentCodes); 29 $wa_script_alias = "conductrics-wa-script";30 58 $wa_script_url = "$baseurl/$owner/-/web-actions?apikey=$apikey&decisions-for-agents=$agentCodes"; 31 59 // Include the script for this web action 60 wp_enqueue_script('jquery', false, array(), false, false); 32 61 wp_enqueue_script( 33 $wa_script_alias,62 'conductrics-wa-script', 34 63 $wa_script_url, 35 array( 'jquery'), # WP will make sure jQuery is included for us64 array(), 36 65 false, # version could be specified here 37 66 false # we don't want to be placed in the footer -
conductrics-webactions/trunk/includes/wa-settings.php
r738697 r882006 210 210 211 211 function admin_check_options($input) { 212 $account_options = $this->admin_get_options( );212 $account_options = $this->admin_get_options(false); 213 213 if ( isset( $input['owner'] )) { 214 214 $account_options['owner'] = $this->sanitize_code( $input['owner'] ); … … 225 225 226 226 function create_input_owner($args) { 227 $account_options = $this->admin_get_options( );227 $account_options = $this->admin_get_options(false); 228 228 $value = $account_options['owner']; 229 229 ?><input type="text" id="conductrics_owner" name="conductrics_options[owner]" value="<?php echo $value; ?>" placeholder="your owner code" class='regular-text'/> <em>(required, starts with "owner")</em><?php 230 230 } 231 231 function create_input_apikey($args) { 232 $account_options = $this->admin_get_options( );232 $account_options = $this->admin_get_options(false); 233 233 $value = $account_options['apikey']; 234 234 ?><input type="text" id="conductrics_apikey" name="conductrics_options[apikey]" value="<?php echo $value; ?>" placeholder="your API key" class='regular-text'/> <em>(required, starts with "api")</em><?php 235 235 } 236 236 function create_input_adminkey($args) { 237 $account_options = $this->admin_get_options( );237 $account_options = $this->admin_get_options(false); 238 238 $value = $account_options['adminkey']; 239 239 ?><input type="text" id="conductrics_adminkey" name="conductrics_options[adminkey]" value="<?php echo $value; ?>" placeholder="your API key" class='regular-text'/> <em>(required, starts with "admin")</em><?php 240 240 } 241 241 function create_input_baseurl($args) { 242 $account_options = $this->admin_get_options( );242 $account_options = $this->admin_get_options(false); 243 243 $value = $account_options['baseurl']; 244 244 ?><input type="text" id="conductrics_baseurl" name="conductrics_options[baseurl]" value="<?php echo $value; ?>" placeholder="http://api.conductrics.com" class='regular-text'/> <em>(optional)</em><?php 245 245 } 246 246 function create_input_adminurl($args) { 247 $account_options = $this->admin_get_options( );247 $account_options = $this->admin_get_options(false); 248 248 $value = $account_options['adminurl']; 249 249 ?><input type="text" id="conductrics_adminurl" name="conductrics_options[adminurl]" value="<?php echo $value; ?>" placeholder="http://console.conductrics.com" class='regular-text'/> <em>(optional)</em><?php 250 250 } 251 251 function create_input_globalagent($args) { 252 $account_options = $this->admin_get_options( );252 $account_options = $this->admin_get_options(false); 253 253 $value = $account_options['globalagent']; 254 254 ?><input type="hidden" id="conductrics_globalagent" name="conductrics_options[globalagent]" value="<?php echo $value; ?>" placeholder="agent code(s)" class='regular-text agent-code-list' title='Agents to use on every page:'/> <?php … … 256 256 } 257 257 function create_input_wa_global_enabled($args) { 258 $account_options = $this->admin_get_options( );258 $account_options = $this->admin_get_options(false); 259 259 $value = $account_options['wa_global_enabled']; 260 260 ?><label><input type="checkbox" id="conductrics_wa_global_enabled" name="conductrics_options[wa_global_enabled]" <?php checked( $value == 1 ); ?> value="1" /> Enable Web Actions</label><?php -
conductrics-webactions/trunk/readme.txt
r738741 r882006 61 61 == Changelog == 62 62 63 = 0.3.4 = 64 * Address Rocketscript incompatibility 65 63 66 = 0.3.3 = 64 67 * File permissions corrected … … 97 100 == Upgrade Notice == 98 101 102 = 0.3.4 = 103 * This version addresses a Rocketscript incompatibility. 104 99 105 = 0.3.2 = 100 106 * This version provides some minor usability improvements when setting up a test with web actions.
Note: See TracChangeset
for help on using the changeset viewer.