Changeset 738380
- Timestamp:
- 07/09/2013 05:29:22 PM (13 years ago)
- Location:
- mpulse-real-user-measurement/trunk
- Files:
-
- 2 edited
-
mpulse-real-user-measurement.php (modified) (7 diffs)
-
soasta_wp.css (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mpulse-real-user-measurement/trunk/mpulse-real-user-measurement.php
r738117 r738380 8 8 */ 9 9 10 // Make sure we don't expose any info if called directly 11 if ( !function_exists( 'add_action' ) ) { 12 echo 'Hi there! I\'m just a plugin, not much I can do when called directly.'; 13 exit; 14 } 15 10 16 //Clean up after ourselves on delete 11 17 function mpulse_cleanup() { … … 13 19 } 14 20 15 //Add submenu to plugin menu e21 //Add submenu to plugin menu 16 22 function mpulse_plugin_config() { 17 23 add_submenu_page( 'plugins.php', 'mPulse Real User Measurement Configuration', 'mPulse RUM', 'manage_options', 'mpulse_plugin_page', 'mpulse_plugin_page' ); … … 20 26 //Add plugin action link to Plugin page for mPulse Settings 21 27 function mpulse_plugin_action_links($links, $file) { 22 static $this_plugin;28 static $this_plugin; 23 29 24 if (!$this_plugin) {25 $this_plugin = plugin_basename(__FILE__);26 }30 if (!$this_plugin) { 31 $this_plugin = plugin_basename(__FILE__); 32 } 27 33 28 if ($file == $this_plugin) { 29 // The "page" query string value must be equal to the slug 30 // of the Settings admin page we defined earlier, which in 31 // this case equals "myplugin-settings". 32 $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=mpulse_plugin_page">Settings</a>'; 33 array_unshift($links, $settings_link); 34 } 34 if ($file == $this_plugin) { 35 $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=mpulse_plugin_page">Settings</a>'; 36 array_unshift($links, $settings_link); 37 } 35 38 36 return $links;39 return $links; 37 40 } 38 41 … … 46 49 47 50 if (isset($_POST['submit'])) { 48 $mp_key = trim($_POST['mpulse_api_key']); 49 update_option('mpulse_api_key', $mp_key); 50 ?><div id="footer" class="soasta_footer"> <p>Your key has been updated.</p></div><?php 51 $mp_key = trim($_POST['mpulse_api_key']); 52 $mp_pattern = '/[A-Z0-9]{5}\-[A-Z0-9]{5}\-[A-Z0-9]{5}\-[A-Z0-9]{5}\-[A-Z0-9]{5}/'; 53 if (preg_match($mp_pattern, $mp_key)) { 54 update_option('mpulse_api_key', $mp_key); 55 echo "<div id=\"footer\" class=\"soasta_footer\"> <p>Your key has been updated.</p></div>"; 56 } else { 57 echo "<div id=\"footer\" class=\"soasta_footer\"> <p>Your API key is invalid! Format: A1A1A-B2B2B-C3C3C-D4D4D </p></div>"; 58 } 51 59 } 52 53 60 ?> 54 61 … … 58 65 <h1>mPulse - Real User Measurement</h1> 59 66 60 <p>Please enter your API KEY below. This can be found in your domain configuration within mPulse. If you do not yet have an mPulse account, you can set this up <a href="http://www.soasta.com/free" target="new">here.</a> (For FREE!).</p>67 <p>Please enter your API KEY below. This can be found in your domain configuration within mPulse. If you do not yet have an mPulse account, you can <a href="http://www.soasta.com/free" target="new" title="Create a free mPulse account">set one up (For FREE!)</a></p> 61 68 <form method="post" action="" class="soasta_form"> 62 69 <input name="mpulse_api_key" type="text" id="mpulse_api_key" class="soasta_input" value="<?php echo get_option('mpulse_api_key');?>" maxlength="29" placeholder="A1A1A-B2B2B-C3C3C-D4D4D-E5E5E"/> … … 72 79 function mpulse_add_rum_header() { 73 80 ?> 74 <script type='text/javascript'>(function(){75 var dom,doc,where,iframe = document.createElement('iframe');76 iframe.src = "javascript:false";77 (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0";78 where = document.getElementsByTagName('script')[0];79 where.parentNode.insertBefore(iframe, where);80 try {81 doc = iframe.contentWindow.document;82 } catch(e) {83 dom = document.domain;84 iframe.src="javascript:var d=document.open();d.domain='"+dom+"';void(0);";85 doc = iframe.contentWindow.document;86 }87 doc.open()._l = function() {88 var js = this.createElement("script");89 if(dom) this.domain = dom;90 js.id = "boomr-if-as";91 js.src = '//c.go-mpulse.net/boomerang/' +92 '<?php echo get_option('mpulse_api_key');?>';93 BOOMR_lstart=new Date().getTime();94 this.body.appendChild(js);95 };96 doc.write('<body onload="document._l();">');97 doc.close();98 })();</script>;81 <script type='text/javascript'>(function(){ 82 var dom,doc,where,iframe = document.createElement('iframe'); 83 iframe.src = "javascript:false"; iframe.title = ""; iframe.role="presentation"; 84 (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; 85 where = document.getElementsByTagName('script')[0]; 86 where.parentNode.insertBefore(iframe, where); 87 try { 88 doc = iframe.contentWindow.document; 89 } catch(e) { 90 dom = document.domain; 91 iframe.src="javascript:var d=document.open();d.domain='"+dom+"';void(0);"; 92 doc = iframe.contentWindow.document; 93 } 94 doc.open()._l = function() { 95 var js = this.createElement("script"); 96 if(dom) this.domain = dom; 97 js.id = "boomr-if-as"; 98 js.src = '//c.go-mpulse.net/boomerang/' + 99 '<?php echo get_option('mpulse_api_key');?>'; 100 BOOMR_lstart=new Date().getTime(); 101 this.body.appendChild(js); 102 }; 103 doc.write('<body onload="document._l();">'); 104 doc.close(); 105 })();</script>; 99 106 100 107 <?php … … 109 116 register_uninstall_hook(__FILE__, 'mpulse_cleanup'); 110 117 } 111 112 // Make sure we don't expose any info if called directly113 if ( !function_exists( 'add_action' ) ) {114 echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';115 exit;116 }117 118 118 ?> -
mpulse-real-user-measurement/trunk/soasta_wp.css
r738117 r738380 4 4 5 5 .soasta_container { 6 margin: 50px 0 0 10px;7 width: 500px;8 font-size: 1 4px;6 margin: 50px 0 0 10px; 7 width: 500px; 8 font-size: 1.000em; 9 9 line-height: 1.4; 10 10 color: #565656; … … 14 14 15 15 .soasta_footer { 16 position:absolute;17 bottom:0;18 width:500px;19 height:40px; /* Height of the footer */20 margin: 10px 0px 0px 10px;21 padding-left: 10px;22 border: 2px solid red;23 font-size: 14px;24 line-height: 1.4;25 color: white;26 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;27 background:#42B4E6;16 position:absolute; 17 bottom:0; 18 width:500px; 19 height:40px; /* Height of the footer */ 20 margin: 10px 0px 0px 10px; 21 padding-left: 10px; 22 border: 2px solid red; 23 font-size: 1.000em; 24 line-height: 1.4em; 25 color: white; 26 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 27 background:#42B4E6; 28 28 } 29 29 30 30 .soasta_container h1 { 31 31 font-size: 2.5em; 32 line-height: 1. 333em;32 line-height: 1.4em; 33 33 font-weight: 200; 34 34 color: #8F8F8F; … … 37 37 .soasta_form { 38 38 background-color: #d8d9da; 39 border: 1px solid #a8a8a8; 40 margin-top: 20px; 41 padding-left: 5px; 42 padding-right: 5px; 43 padding-top: 5px; 44 padding-bottom: 5px; 39 border: 1px solid #a8a8a8; 40 margin-top: 20px; 41 padding: 5px; 45 42 } 46 43 47 44 .soasta_input { 48 font-size: 1 4px;45 font-size: 1.000em; 49 46 width: 390px; 50 47 } … … 53 50 background:#42B4E6; 54 51 border: 1px solid #a8a8a8; 55 -webkit-border-radius: 6px 6px 6px 6px; 56 -moz-border-radius: 6px; 57 border-radius: 6px; 58 margin-left: 6px; 59 color: white; 60 font-size: 14px; 52 border-radius: 6px; 53 margin-left: 6px; 54 color: white; 55 font-size: 1.000em; 61 56 width: 80px; 62 57 }
Note: See TracChangeset
for help on using the changeset viewer.