Changeset 1288803
- Timestamp:
- 11/18/2015 03:40:34 PM (10 years ago)
- Location:
- wow-analytics
- Files:
-
- 13 added
- 6 edited
-
tags/2.0.6 (added)
-
tags/2.0.6/admin.php (added)
-
tags/2.0.6/includes (added)
-
tags/2.0.6/includes/admin.inc.php (added)
-
tags/2.0.6/includes/ajax_functions.php (added)
-
tags/2.0.6/includes/restclient.php (added)
-
tags/2.0.6/includes/trackingcode.php (added)
-
tags/2.0.6/install.php (added)
-
tags/2.0.6/js (added)
-
tags/2.0.6/js/wow_analytics_admin.js (added)
-
tags/2.0.6/readme.txt (added)
-
tags/2.0.6/uninstall.php (added)
-
tags/2.0.6/wow-analytics.php (added)
-
trunk/admin.php (modified) (3 diffs)
-
trunk/includes/admin.inc.php (modified) (3 diffs)
-
trunk/install.php (modified) (1 diff)
-
trunk/js/wow_analytics_admin.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wow-analytics.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wow-analytics/trunk/admin.php
r1250215 r1288803 41 41 <h2>WOW Analytics</h2> 42 42 43 <div id="wow_head_method_detect" class="notice-warning below-h2 notice is-dismissible" style="display: none;"> 44 <p> 45 <strong>Unable to detect wp_head() method in your theme. This means that tracking may not work.</strong> 46 </p> 47 <button type="button" class="notice-dismiss"> 48 <span class="screen-reader-text">Dismiss this notice.</span> 49 </button> 50 </div> 51 43 52 <form action="options.php" method="post"> 44 53 <?php … … 49 58 50 59 </form> 60 51 61 </div> 52 62 … … 78 88 79 89 90 80 91 // Ajax code 81 92 function wow_wowanalytics_load_scripts($hook) -
wow-analytics/trunk/includes/admin.inc.php
r1255897 r1288803 3 3 function wow_wowanalytics_admin_init() 4 4 { 5 $wowOptions = get_option('wow_wowanalytics_options');6 7 5 // Absolute path to your specific plugin 8 6 $my_plugin = 'wow-analytics/wow-analytics.php'; 9 if (isset($wowOptions['admin_messages'])) { // check whether to display the message 10 add_action('admin_notices' , 'wow_wowanalytics_error'); 11 return; 12 } 7 13 8 // Check to see if plugin is already active 14 9 if(!is_plugin_active($my_plugin)) { … … 16 11 } 17 12 else{ 18 // Build the url to call, NOTE: uses home_url and thus requires WordPress 3.0 19 $url = add_query_arg( array( 'wow-wowanalytics-test-head' => '', 'wow-wowanalytics-test-footer' => '' ), home_url() ); 20 21 22 // Perform the HTTP GET ignoring SSL errors 23 $response = wp_remote_get( $url ); 24 25 // Grab the response code and make sure the request was sucessful 26 $code = (int) wp_remote_retrieve_response_code( $response ); 27 28 if ( $code == 200 ) { 29 //global $head_footer_errors; 30 $head_footer_errors = array(); 31 32 // Strip all tabs, line feeds, carriage returns and spaces 33 $html = preg_replace( '/[s]/', '', wp_remote_retrieve_body( $response ) ); 34 35 // Check to see if we found the existence of wp_head 36 if ( ! strstr( $html, '<!--wp_head-->' ) ) 37 $head_footer_errors['nohead'] = 'Is missing the call to <?php wp_head(); ?> which should appear directly before </head>'; 38 // Check to see if we found the existence of wp_footer 39 /* 40 if ( ! strstr( $html, '<!--wp_footer-->' ) ) 41 $head_footer_errors['nofooter'] = 'Is missing the call to <?php wp_footer(); ?> which should appear directly before </body>'; 42 */ 43 44 // Check to see if we found wp_head and if was located in the proper spot 45 /* 46 if ( ! strstr( $html, '<!--wp_head--></head>' ) && ! isset( $head_footer_errors['nohead'] ) ) 47 $head_footer_errors[] = 'Has the call to <?php wp_head(); ?> but it is not called directly before </head>'; 48 */ 49 // Check to see if we found wp_footer and if was located in the proper spot 50 /* 51 if ( ! strstr( $html, '<!--wp_footer--></body>' ) && ! isset( $head_footer_errors['nofooter'] ) ) 52 $head_footer_errors[] = 'Has the call to <?php wp_footer(); ?> but it is not called directly before </body>'; 53 */ 54 55 // If we found errors with the existence of wp_head or wp_footer hook into admin_notices to complain about it 56 if ( ! empty( $head_footer_errors ) ) 57 { 58 add_action ( 'admin_notices', 'wow_wowanalytics_error' ); 59 60 $wowOptions['admin_messages'] = $head_footer_errors; 61 update_option( 'wow_wowanalytics_options', $wowOptions ) ; 62 63 deactivate_plugins( $my_plugin ); // Deactivate our plugin 64 //return new WP_Error( '', 'my favorite toy is dolly'); 65 return; 66 } 67 } 68 13 69 14 add_settings_section( 70 15 'wow_wowanalytics_main', … … 155 100 return $valid; 156 101 } 102 103 -
wow-analytics/trunk/install.php
r1250215 r1288803 82 82 83 83 84 // Output the notices85 function wow_wowanalytics_error() {86 87 global $pagenow;88 89 $wowOptions = get_option('wow_wowanalytics_options');90 $head_footer_errors = $wowOptions['admin_messages'];91 92 if ( $pagenow == 'plugins.php' ) {93 // If we made it here it is because there were errors, lets loop through and state them all94 echo '<div class="error"><p><strong>WOW Analytics Plugin has been deactivated</strong></p>';95 echo '<p>Your active theme:</p>';96 97 echo '<ul></ul>';98 99 foreach ( $head_footer_errors as $error )100 echo '<li>' . esc_html( $error ) . '</li>';101 102 echo '</ul></div>';103 }104 105 106 unset($wowOptions['admin_messages']);107 update_option( 'wow_wowanalytics_options', $wowOptions ) ;108 109 } -
wow-analytics/trunk/js/wow_analytics_admin.js
r917749 r1288803 57 57 } 58 58 }); 59 60 61 jQuery.get("/?wow-wowanalytics-test-head", function(data, status){ 62 63 var pos = data.indexOf('<!--wp_head-->'); 64 65 if (pos === -1){ 66 jQuery('#wow_head_method_detect').show(); 67 } 68 }); 59 69 }); -
wow-analytics/trunk/readme.txt
r1255897 r1288803 4 4 Requires at least: 4.0 5 5 Tested up to: 4.3.1 6 Stable tag: 2.0. 56 Stable tag: 2.0.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 48 48 == Changelog == 49 49 50 = 2.0.6 = 51 * Just warn if we can't detect the wp_head method. 52 50 53 = 2.0.5 = 51 54 * Allow the wp_head call to be located anywhere in the <head> 55 52 56 = 2.0.4 = 53 57 * Resolve versioning issue -
wow-analytics/trunk/wow-analytics.php
r1255897 r1288803 4 4 Plugin URI: http://wordpress.org/extend/plugins/wow-analytics/ 5 5 Description: Inserts the WOW Analytics tracker into the footer of Wordpress pages 6 Version: 2.0. 56 Version: 2.0.6 7 7 Author: WOW Analytics 8 8 Author URI: http://www.wowanalytics.co.uk … … 21 21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 22 */ 23 define('WOWANALYTICS_VERSION', '2.0. 5');23 define('WOWANALYTICS_VERSION', '2.0.6'); 24 24 25 25 require_once(dirname(__FILE__).'/includes/trackingcode.php');
Note: See TracChangeset
for help on using the changeset viewer.