Changeset 1380034
- Timestamp:
- 03/28/2016 02:21:32 AM (10 years ago)
- File:
-
- 1 edited
-
chartbeat/trunk/chartbeat.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chartbeat/trunk/chartbeat.php
r1375882 r1380034 38 38 function display_chartbeat_accountid_error() { 39 39 $class = 'notice notice-error'; 40 $message = 'You need to set your Chartbeat <a href="'. admin_url( esc_url('options-general.php?page=chartbeat-options')).'">Account ID</a> in the Chartbeat options page';40 $message = 'You need to set your Chartbeat <a href="'.esc_url(admin_url('options-general.php?page=chartbeat-options')).'">Account ID</a> in the Chartbeat options page'; 41 41 42 42 printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message ); … … 432 432 <script type="text/javascript"> 433 433 var options = { }; 434 new CBTopPagesWidget( <?php echo json_encode( json_decode( get_option('chartbeat_widgetconfig') )); ?> );434 new CBTopPagesWidget( <?php echo json_encode(get_option('chartbeat_widgetconfig')); ?> ); 435 435 </script> 436 436 <?php … … 451 451 $url = 'https://api.chartbeat.com'; 452 452 $url .= $_GET['url']; 453 $url .= '&host=' . chartbeat_get_display_url(esc_js($domain)) .'&apikey=' . get_option('chartbeat_apikey');453 $url .= '&host=' . chartbeat_get_display_url(esc_js($domain)) .'&apikey=' . urlencode(get_option('chartbeat_apikey')); 454 454 $transient = 'cbproxy_' . md5($url); 455 header( 'Content-Type: application/json ' );455 header( 'Content-Type: application/jsonp' ); 456 456 $response = get_transient( $transient ); 457 457 if ( !$response ) { … … 465 465 } 466 466 467 echo json_encode( json_decode( $response) );467 echo htmlspecialchars_decode( esc_js($response) ); 468 468 exit; 469 469 } … … 582 582 583 583 wp_enqueue_style( 'cbplugin_css' ); 584 // wp_enqueue_script( 'closure' );585 // wp_enqueue_script( 'deps' );586 584 wp_enqueue_script( 'cbdashboard' ); 587 585 wp_add_dashboard_widget('chartbeat_dashboard_widget', 'Chartbeat', 'chartbeat_dashboard_widget_function'); … … 590 588 function chartbeat_plugin_admin_init() { 591 589 wp_register_style('cbplugin_css',plugins_url('media/cb_plugin.css', __FILE__)); 592 // wp_register_script( 'closure','http://local.chartbeat.com/chartbeat/frontend/js/closure-library-read-only/closure/goog/base.js');593 // wp_register_script( 'deps','http://local.chartbeat.com/chartbeat/frontend/js/deps.js');594 // wp_register_script( 'cbdashboard','http://local.chartbeat.com/chartbeat/frontend/js/cmswidgets/cbdashboard.js');595 590 596 591 wp_register_script( 'cbdashboard',plugins_url('media/cbdashboard.compiled.js', __FILE__));
Note: See TracChangeset
for help on using the changeset viewer.