Search Everything - Version 8.1.5

Version Description

  • Compatibility with PHP 7
  • Bypassing highlighting in dashboard searches
Download this release

Release Info

Developer ddksr
Plugin Icon wp plugin Search Everything
Version 8.1.5
Comparing to
See all releases

Code changes from version 8.1.4 to 8.1.5

Files changed (5) hide show
  1. config.php +6 -0
  2. options.php +10 -10
  3. readme.txt +6 -2
  4. search-everything.php +16 -16
  5. static/img/search.png +0 -0
config.php CHANGED
@@ -109,6 +109,12 @@ function se_upgrade() {
109
  }
110
  }
111
 
 
 
 
 
 
 
112
  function se_migrate_8_1_3() {
113
  $se_meta = get_option('se_meta', false);
114
  $se_meta['version'] = '8.1.4';
109
  }
110
  }
111
 
112
+ function se_migrate_8_1_4() {
113
+ $se_meta = get_option('se_meta', false);
114
+ $se_meta['version'] = '8.1.5';
115
+ update_option('se_meta', $se_meta);
116
+ }
117
+
118
  function se_migrate_8_1_3() {
119
  $se_meta = get_option('se_meta', false);
120
  $se_meta['version'] = '8.1.4';
options.php CHANGED
@@ -5,8 +5,8 @@ Class se_admin {
5
  function se_localization() {
6
  load_plugin_textdomain('SearchEverything', false, dirname(plugin_basename( __FILE__ )) . '/lang/');
7
  }
8
-
9
- function se_admin() {
10
  // Load language file
11
  $locale = get_locale();
12
  $meta = se_get_meta();
@@ -72,17 +72,17 @@ Class se_admin {
72
  <input placeholder="Type search here" data-ajaxurl="<?php echo admin_url('admin-ajax.php'); ?>" type="search" placeholder="Search interesting stuff" name="se-metabox-text" id="se-metabox-text" value="" />
73
  <a id="se-metabox-search">Search</a>
74
  </div>
75
- <?php
76
  }
77
 
78
 
79
  function se_meta_box_search($post_id) {
80
  // Bail if we're doing an auto save
81
  if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
82
-
83
  // if our nonce isn't there, or we can't verify it, bail
84
  if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'se-meta-box-nonce' ) ) return;
85
-
86
  // if our current user can't edit this post, bail
87
  if( !current_user_can( 'edit_post' ) ) return;
88
 
@@ -113,11 +113,11 @@ Class se_admin {
113
  }
114
  return $errors;
115
  }
116
-
117
  //build admin interface
118
  function se_option_page() {
119
  global $wpdb, $table_prefix, $wp_version;
120
-
121
  if($_POST) {
122
  check_admin_referer('se-everything-nonce');
123
  $errors = $this->se_validation(array(
@@ -137,7 +137,7 @@ Class se_admin {
137
  return;
138
  }
139
  }
140
-
141
  $new_options = array(
142
  'se_exclude_categories' => (isset($_POST['exclude_categories']) && !empty($_POST['exclude_categories'])) ? $_POST['exclude_categories'] : '',
143
  'se_exclude_categories_list' => (isset($_POST['exclude_categories_list']) && !empty($_POST['exclude_categories_list'])) ? $_POST['exclude_categories_list'] : '',
@@ -258,7 +258,7 @@ function se_api($arguments)
258
  $meta = se_get_meta();
259
 
260
  $api_key = $meta['api_key'] ? $meta['api_key'] : '';
261
-
262
  $arguments = array_merge($arguments, array(
263
  'api_key'=> $api_key
264
  ));
@@ -298,4 +298,4 @@ function se_get_prefs() {
298
  'format' => 'json',
299
  'interface' => 'wordpress-se'
300
  ));
301
- }
5
  function se_localization() {
6
  load_plugin_textdomain('SearchEverything', false, dirname(plugin_basename( __FILE__ )) . '/lang/');
7
  }
8
+
9
+ function __construct() {
10
  // Load language file
11
  $locale = get_locale();
12
  $meta = se_get_meta();
72
  <input placeholder="Type search here" data-ajaxurl="<?php echo admin_url('admin-ajax.php'); ?>" type="search" placeholder="Search interesting stuff" name="se-metabox-text" id="se-metabox-text" value="" />
73
  <a id="se-metabox-search">Search</a>
74
  </div>
75
+ <?php
76
  }
77
 
78
 
79
  function se_meta_box_search($post_id) {
80
  // Bail if we're doing an auto save
81
  if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
82
+
83
  // if our nonce isn't there, or we can't verify it, bail
84
  if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'se-meta-box-nonce' ) ) return;
85
+
86
  // if our current user can't edit this post, bail
87
  if( !current_user_can( 'edit_post' ) ) return;
88
 
113
  }
114
  return $errors;
115
  }
116
+
117
  //build admin interface
118
  function se_option_page() {
119
  global $wpdb, $table_prefix, $wp_version;
120
+
121
  if($_POST) {
122
  check_admin_referer('se-everything-nonce');
123
  $errors = $this->se_validation(array(
137
  return;
138
  }
139
  }
140
+
141
  $new_options = array(
142
  'se_exclude_categories' => (isset($_POST['exclude_categories']) && !empty($_POST['exclude_categories'])) ? $_POST['exclude_categories'] : '',
143
  'se_exclude_categories_list' => (isset($_POST['exclude_categories_list']) && !empty($_POST['exclude_categories_list'])) ? $_POST['exclude_categories_list'] : '',
258
  $meta = se_get_meta();
259
 
260
  $api_key = $meta['api_key'] ? $meta['api_key'] : '';
261
+
262
  $arguments = array_merge($arguments, array(
263
  'api_key'=> $api_key
264
  ));
298
  'format' => 'json',
299
  'interface' => 'wordpress-se'
300
  ));
301
+ }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: zemanta
3
  Tags: search, search highlight, tag search, category search, category exclusion, comment search, page search, admin, seo, post filter, research
4
  Requires at least: 3.6
5
- Tested up to: 4.4
6
- Stable tag: 8.1.4
7
 
8
  Search Everything increases WordPress' default search functionality in three easy steps.
9
 
@@ -116,6 +116,10 @@ Before using the plugin please read the full version of [Zemanta Terms of Servic
116
 
117
  == Changelog ==
118
 
 
 
 
 
119
  = 8.1.4 =
120
  * Removed unnecessary styles on frontend
121
  * Fixed php notice showing up sometimes
2
  Contributors: zemanta
3
  Tags: search, search highlight, tag search, category search, category exclusion, comment search, page search, admin, seo, post filter, research
4
  Requires at least: 3.6
5
+ Tested up to: 4.5.1
6
+ Stable tag: 8.1.5
7
 
8
  Search Everything increases WordPress' default search functionality in three easy steps.
9
 
116
 
117
  == Changelog ==
118
 
119
+ = 8.1.5 =
120
+ * Compatibility with PHP 7
121
+ * Bypassing highlighting in dashboard searches
122
+
123
  = 8.1.4 =
124
  * Removed unnecessary styles on frontend
125
  * Fixed php notice showing up sometimes
search-everything.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Search Everything
4
  Plugin URI: http://wordpress.org/plugins/search-everything/
5
  Description: Adds search functionality without modifying any template pages: Activate, Configure and Search. Options Include: search highlight, search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata). Also offers the ability to exclude specific pages and posts. Does not search password-protected content.
6
- Version: 8.1.4
7
  Author: Zemanta
8
  Author URI: http://www.zemanta.com
9
  */
10
 
11
- define('SE_VERSION', '8.1.4');
12
 
13
  if (!defined('SE_PLUGIN_FILE'))
14
  define('SE_PLUGIN_FILE', plugin_basename(__FILE__));
@@ -48,7 +48,7 @@ add_action('wp_loaded','se_initialize_plugin');
48
 
49
  function se_initialize_plugin() {
50
  $SE = new SearchEverything();
51
-
52
  //add filters based upon option settings
53
  //include_once(SE_PLUGIN_DIR . '/zemanta/zemanta.php');
54
  //$se_zemanta = new SEZemanta();
@@ -76,7 +76,7 @@ function se_global_notice() {
76
  if (!current_user_can('manage_options')) {
77
  return;
78
  }
79
-
80
  $se_meta = se_get_meta();
81
 
82
  $close_url = admin_url( 'options-general.php' );
@@ -86,7 +86,7 @@ function se_global_notice() {
86
  ), $close_url );
87
 
88
  $notice = $se_meta['se_global_notice'];
89
-
90
  if ($notice && in_array($pagenow, $se_global_notice_pages)) {
91
  include(se_get_view('global_notice'));
92
  }
@@ -103,7 +103,7 @@ class SearchEverything {
103
  var $ajax_request;
104
  private $query_instance;
105
 
106
- function SearchEverything($ajax_query=false) {
107
  global $wp_version;
108
  $this->wp_ver23 = ( $wp_version >= '2.3' );
109
  $this->wp_ver25 = ( $wp_version >= '2.5' );
@@ -116,7 +116,7 @@ class SearchEverything {
116
  }
117
  else {
118
  $this->init();
119
- }
120
  }
121
 
122
  function init_ajax($query) {
@@ -146,7 +146,7 @@ class SearchEverything {
146
 
147
  function search_hooks() {
148
  //add filters based upon option settings
149
-
150
  if ( $this->options['se_use_tag_search'] || $this->options['se_use_category_search'] || $this->options['se_use_tax_search'] ) {
151
  add_filter( 'posts_join', array( &$this, 'se_terms_join' ) );
152
  if ( $this->options['se_use_tag_search'] ) {
@@ -288,7 +288,7 @@ class SearchEverything {
288
  // search for terms in default locations like title and content
289
  // replacing the old search terms seems to be the best way to
290
  // avoid issue with multiple terms
291
- function se_search_default(){
292
 
293
  global $wpdb;
294
 
@@ -309,7 +309,7 @@ class SearchEverything {
309
 
310
  $like_title = "($wpdb->posts.post_title LIKE '$esc_term')";
311
  $like_post = "($wpdb->posts.post_content LIKE '$esc_term')";
312
-
313
  $search_sql_query .= "($like_title OR $like_post)";
314
 
315
  $seperator = ' AND ';
@@ -391,7 +391,7 @@ class SearchEverything {
391
  function se_build_search_excerpt() {
392
  global $wpdb;
393
  $vars = $this->query_instance->query_vars;
394
-
395
  $s = $vars['s'];
396
  $search_terms = $this->se_get_search_terms();
397
  $exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
@@ -457,7 +457,7 @@ class SearchEverything {
457
  function se_build_search_comments() {
458
  global $wpdb;
459
  $vars = $this->query_instance->query_vars;
460
-
461
  $s = $vars['s'];
462
  $search_terms = $this->se_get_search_terms();
463
  $exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
@@ -627,7 +627,7 @@ class SearchEverything {
627
  function se_build_search_categories() {
628
  global $wpdb;
629
  $vars = $this->query_instance->query_vars;
630
-
631
  $s = $vars['s'];
632
  $search_terms = $this->se_get_search_terms();
633
  $exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
@@ -817,7 +817,7 @@ class SearchEverything {
817
  global $wpdb;
818
  $s = isset( $this->query_instance->query_vars['s'] ) ? $this->query_instance->query_vars['s'] : '';
819
  // highlighting
820
- if ( is_search() && $s != '' ) {
821
  $highlight_color = $this->options['se_highlight_color'];
822
  $highlight_style = $this->options['se_highlight_style'];
823
  $search_terms = $this->se_get_search_terms();
@@ -884,7 +884,7 @@ function search_everything_callback() {
884
  $result['external'] = json_decode($zemanta_response['body'])->articles;
885
  }
886
 
887
-
888
  $SE = new SearchEverything(true);
889
 
890
  if (!empty($_GET['exact'])) {
@@ -899,7 +899,7 @@ function search_everything_callback() {
899
  $result['own'][] = get_post();
900
  }
901
  $post_query->reset_postdata();
902
-
903
  }
904
  print json_encode($result);
905
  die();
3
  Plugin Name: Search Everything
4
  Plugin URI: http://wordpress.org/plugins/search-everything/
5
  Description: Adds search functionality without modifying any template pages: Activate, Configure and Search. Options Include: search highlight, search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata). Also offers the ability to exclude specific pages and posts. Does not search password-protected content.
6
+ Version: 8.1.5
7
  Author: Zemanta
8
  Author URI: http://www.zemanta.com
9
  */
10
 
11
+ define('SE_VERSION', '8.1.5');
12
 
13
  if (!defined('SE_PLUGIN_FILE'))
14
  define('SE_PLUGIN_FILE', plugin_basename(__FILE__));
48
 
49
  function se_initialize_plugin() {
50
  $SE = new SearchEverything();
51
+
52
  //add filters based upon option settings
53
  //include_once(SE_PLUGIN_DIR . '/zemanta/zemanta.php');
54
  //$se_zemanta = new SEZemanta();
76
  if (!current_user_can('manage_options')) {
77
  return;
78
  }
79
+
80
  $se_meta = se_get_meta();
81
 
82
  $close_url = admin_url( 'options-general.php' );
86
  ), $close_url );
87
 
88
  $notice = $se_meta['se_global_notice'];
89
+
90
  if ($notice && in_array($pagenow, $se_global_notice_pages)) {
91
  include(se_get_view('global_notice'));
92
  }
103
  var $ajax_request;
104
  private $query_instance;
105
 
106
+ function __construct($ajax_query=false) {
107
  global $wp_version;
108
  $this->wp_ver23 = ( $wp_version >= '2.3' );
109
  $this->wp_ver25 = ( $wp_version >= '2.5' );
116
  }
117
  else {
118
  $this->init();
119
+ }
120
  }
121
 
122
  function init_ajax($query) {
146
 
147
  function search_hooks() {
148
  //add filters based upon option settings
149
+
150
  if ( $this->options['se_use_tag_search'] || $this->options['se_use_category_search'] || $this->options['se_use_tax_search'] ) {
151
  add_filter( 'posts_join', array( &$this, 'se_terms_join' ) );
152
  if ( $this->options['se_use_tag_search'] ) {
288
  // search for terms in default locations like title and content
289
  // replacing the old search terms seems to be the best way to
290
  // avoid issue with multiple terms
291
+ function se_search_default(){
292
 
293
  global $wpdb;
294
 
309
 
310
  $like_title = "($wpdb->posts.post_title LIKE '$esc_term')";
311
  $like_post = "($wpdb->posts.post_content LIKE '$esc_term')";
312
+
313
  $search_sql_query .= "($like_title OR $like_post)";
314
 
315
  $seperator = ' AND ';
391
  function se_build_search_excerpt() {
392
  global $wpdb;
393
  $vars = $this->query_instance->query_vars;
394
+
395
  $s = $vars['s'];
396
  $search_terms = $this->se_get_search_terms();
397
  $exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
457
  function se_build_search_comments() {
458
  global $wpdb;
459
  $vars = $this->query_instance->query_vars;
460
+
461
  $s = $vars['s'];
462
  $search_terms = $this->se_get_search_terms();
463
  $exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
627
  function se_build_search_categories() {
628
  global $wpdb;
629
  $vars = $this->query_instance->query_vars;
630
+
631
  $s = $vars['s'];
632
  $search_terms = $this->se_get_search_terms();
633
  $exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
817
  global $wpdb;
818
  $s = isset( $this->query_instance->query_vars['s'] ) ? $this->query_instance->query_vars['s'] : '';
819
  // highlighting
820
+ if ( !is_admin() && is_search() && $s != '' ) {
821
  $highlight_color = $this->options['se_highlight_color'];
822
  $highlight_style = $this->options['se_highlight_style'];
823
  $search_terms = $this->se_get_search_terms();
884
  $result['external'] = json_decode($zemanta_response['body'])->articles;
885
  }
886
 
887
+
888
  $SE = new SearchEverything(true);
889
 
890
  if (!empty($_GET['exact'])) {
899
  $result['own'][] = get_post();
900
  }
901
  $post_query->reset_postdata();
902
+
903
  }
904
  print json_encode($result);
905
  die();
static/img/search.png CHANGED
Binary file