Changeset 415355
- Timestamp:
- 07/26/2011 01:17:53 PM (15 years ago)
- Location:
- coremetrics/trunk
- Files:
-
- 4 edited
-
core_admin.php (modified) (4 diffs)
-
coremetrics.php (modified) (1 diff)
-
footer_test.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coremetrics/trunk/core_admin.php
r392850 r415355 27 27 $cm_languageAttribute = get_option('cm_language_attribute'); 28 28 $cm_trackDraft_val = get_option('cm_track_drafts'); 29 30 $cm_error_dismissed = ''; 31 if (isset($_POST['dismiss_error']) && $_POST['dismiss_error'] != '') { 32 $cm_error_dismissed = $_POST['dismiss_error']; 33 update_option('cm_dismiss_option', $cm_error_dismissed); 34 test_head_footer_notices(); 35 } 29 36 30 37 // See if the user has posted us some information … … 141 148 <textarea name="coremetrics_customPageID_field" rows="5" cols="40" title="You can create a custom page ID setup here. To hardcode a single value, make sure you enclose your ID in single quotes."><?php echo stripslashes($cm_customPageID_val); ?></textarea></p> 142 149 143 144 145 150 151 152 146 153 <!-- test override section --> 147 154 <p><strong>Test override</strong></p> … … 156 163 <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" title="Save your changes and update preview code" /> 157 164 </p> 165 166 167 168 <!-- test output section --> 158 169 <p>Need help? Compare the code below to what's on your other sites, or copy and paste it into a Coremetrics support ticket to check you've got it right.</p> 159 170 <p class="previewCode"> … … 197 208 </p> 198 209 </form> 210 211 <!-- override footer test --> 212 <p><strong>Test for wp_footer();</strong></p> 213 <p>If you've ever reset a "wp_footer(); not found" message and want to test again, click the button below. If you don't know what this means, ignore it! Your theme is great.</p> 214 <p>You may want to do this if you add a new theme and suddenly Coremetrics isn't working. It will look for the vital wp_footer(); function for you, but might give you false results... it depends on your server settings. It can be a useful first check if you're having issues, and you can always dismiss the error.</p> 215 <form id="cm-reinstate-updates" action="" method="post" style=""> 216 <input type="hidden" name="dismiss_error" value="false" /> 217 <input type="submit" value="Reset footer test" /> 218 </form> 219 220 199 221 </div> -
coremetrics/trunk/coremetrics.php
r392853 r415355 4 4 Plugin URI: http:// 5 5 Description: Stats tracking plugin for Coremetrics 6 Version: 1.2 6 Version: 1.2.1 7 7 Author: Adam Maltpress 8 8 Author URI: http://www.maltpress.co.uk -
coremetrics/trunk/footer_test.php
r415211 r415355 37 37 } 38 38 39 40 // Add dismiss form handling to admin pages IF not dismissed 41 42 function cm_dismiss_footererror () { 43 $cm_error_dismissed = ''; 44 if (isset($_POST['dismiss_error']) && $_POST['dismiss_error'] != '') { 45 $cm_error_dismissed = $_POST['dismiss_error']; 46 update_option('cm_dismiss_option', $cm_error_dismissed); 47 } 48 } 49 if (get_option('cm_dismiss_option') != 'true') { 50 add_action('admin_init', 'cm_dismiss_footererror'); 51 } 52 39 53 // Check for the existence of the strings where wp_head and wp_footer should have been called from 40 54 function check_head_footer() { … … 54 68 // Check to see if we found the existence of wp_footer 55 69 if ( ! strstr( $html, '<!--wp_footer-->' ) ) 56 $head_footer_errors['nofooter'] = ' Is missing the call to <?php wp_footer(); ?> which should appear directly before </body> - your Coremetrics plugin will not work';70 $head_footer_errors['nofooter'] = 'might be missing the call to <?php wp_footer(); ?> which should appear directly before </body> - your Coremetrics plugin might not work. There are lots of reasons you might see this. If your Coremetrics code is appearing on your site, you can dismiss this message. If not, check your footer.php file for the <?php wp_footer(); ?> function.'; 57 71 58 72 59 73 60 74 // If we found errors with the existence of wp_head or wp_footer hook into admin_notices to complain about it … … 68 82 global $head_footer_errors; 69 83 70 // If we made it here it is because there were errors, lets loop through and state them all 71 echo '<div class="error"><p><strong>Your active theme:</strong></p><ul>'; 72 foreach ( $head_footer_errors as $error ) 73 echo '<li>' . esc_html( $error ) . '</li>'; 74 echo '</ul></div>'; 84 // let's test to see if this has been dismissed 85 if (get_option('cm_dismiss_option') != 'true' && $head_footer_errors) { 86 // If we made it here it is because there were errors, lets loop through and state them all 87 echo '<div class="error"><p><strong>Your active theme:</strong></p><ul>'; 88 foreach ( $head_footer_errors as $error ) 89 echo '<li>' . esc_html( $error ) . '</li>'; 90 ?> 91 <form id="cm-dismiss-updates" action="" method="post" style="padding: 10px;"> 92 <input type="hidden" name="dismiss_error" value="true" /> 93 <input type="submit" value="Ignore message" /> 94 </form> 95 96 <?php 97 echo '</ul></div>'; 98 } elseif (!$head_footer_errors && isset($_POST['dismiss_error']) && $_POST['dismiss_error'] == 'false') { 99 echo '<div class="updated"><p><strong>Your active theme contains wp_footer();</strong></p>'; 100 echo '</div>'; 101 } 75 102 } 76 103 ?> -
coremetrics/trunk/readme.txt
r392850 r415355 3 3 Tags: tracking, statistics 4 4 Requires at least: 2.7 5 Tested up to: 3. 1.35 Tested up to: 3.2.1 6 6 Stable tag: trunk 7 7 … … 55 55 Check you've got wp_footer() in your footer.php file (you should always have this!). There's a function to check that it's there, but double check. 56 56 57 = There's a big red box telling me I don't have wp_footer(); in my theme, but I do! = 58 59 Sorry! It's entirely possible that there's something about your server setup which means you get false negatives. You can dismiss this message if you're happy that everything is working as expected - you can always test again by going to the Coremetrics settings page and clicking the button at the bottom of the page. You'll be told if wp_footer(); is found or not. 60 57 61 == Changelog == 62 63 = 1.2.1 = 64 * You can now dismiss the wp_footer() warning - certain themes and server setups might give false positives. 58 65 59 66 = 1.2 = … … 70 77 == Upgrade Notice == 71 78 79 = 1.2.1 = 80 Now dismiss false negative wp_footer(); checks 81 72 82 = 1.1 = 73 83 Adds extra functionality and fixed important bug on multiple user IDs
Note: See TracChangeset
for help on using the changeset viewer.