/** * wp_ajax_wpsd_load_searchterms function. * * @access public * @return void */ function wp_ajax_wpsd_load_searchterms() { $form = new WPSDAdminConfigForm(); if ($form->getWpsdWidgetSearchTerms()) { $result = wpsd_read_cache(); '<!-- WP-Stats-Dashboard - START Search terms-->'; // Parse Search Terms. $pattern = '<div id="searchterms".*?>(.*?)<\\/div>'; preg_match_all('/' . $pattern . '/s', $result, $matches); $st = preg_replace('/<h4>(.*?)<\\/h4>/s', '<h5>$1</h5>', $matches[1][0]); $st = preg_replace('/<h3>(.*?)<\\/h3>/s', '<h4>Search Terms</h4>', $st); $st = str_replace('<table', '<table style="width:100%;"', $st); if (defined('WPSD_PLUGIN_URL')) { $st = str_replace('http://dashboard.wordpress.com/i/stats-icon.gif', WPSD_PLUGIN_URL . '/resources/images/stats-icon.gif', $st); } echo '<div style="overflow:hidden;">'; echo $st; echo '</div>'; echo '<!-- WP-Stats-Dashboard - STOP Search terms -->'; } else { _e('Widget disabled check', 'wpsd'); echo ' <a href="' . wpsd_get_settings_url() . '" title="wp-stats-dashboard settings" target="_self">' . __('settings', 'wpsd') . '</a>'; } exit; }