Skip to content

Commit

Permalink
Updating to Version 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ivdimova committed Mar 21, 2014
1 parent 36f6eb0 commit 37b8f73
Show file tree
Hide file tree
Showing 48 changed files with 2,734 additions and 2,006 deletions.
31 changes: 1 addition & 30 deletions README.markdown
@@ -1,27 +1,3 @@
Notice
======

Well, we tried...
-----------------

It took a few years of kick-starting the Search Everything Plus project and it being subverted by new full-time projects at Sprout Venture before realizing it had to stop. Our goal of fixing WordPress search with SE+ needed too much focus, something we couldn't sacrifice because of growing client projects. After a year of trying and nothing awesome to show we decided to cease all planning and development on the Search Everything Plus plugin/service. </p>

But our goal of fixing WordPress search isn't lost and we have <strong>two</strong> recomendations for you:</p>

[SearchWP](http://s-v.me/RgIu)
They claim it's the best search plugin around and we can't agree more. It's seriously close to what we had planned for SE+, in many ways it's much better than what we counted on accomplishing.</p>

[Swiftype Search plugin](http://s-v.me/Q8wb)
It replaces the standard WordPress search with a better, more relevant search engine, and in doing so offloads the performance burden of search queries from your database to theirs.</p>


The advantages of both should be clear but if you're undecided we recomend [SearchWP](http://s-v.me/RgIu) becuase of how it doesn't require a subscription.

Sincerely,
Dan Cameron
Principal and Janitor, Sprout Venture Inc.


Description
===========

Expand Down Expand Up @@ -56,11 +32,6 @@ Search Everything increases the ability of the default Wordpress Search, options
* Exclude Categories from search


Search Everything Plus
============
Premium version coming soon, get notified on updates [here](http://wpsearchplugin.com/get-notified/ "Get updates").


Installation
============

Expand Down Expand Up @@ -105,4 +76,4 @@ What Translations are included?
* Spanish
* Swedish
* Turkish
* Taiwan / Chinese
* Taiwan / Chinese
276 changes: 276 additions & 0 deletions config.php
@@ -0,0 +1,276 @@
<?php

global $se_options, $se_meta, $se_global_notice_pages;
$se_options = false;
$se_meta = false;

$se_global_notice_pages = array('plugins.php', 'index.php', 'update-core.php');

$se_response_messages = array(
SE_PREFS_STATE_NOT_ENGLISH => __('<a href="http://support.zemanta.com/customer/portal/articles/674752-which-languages-does-zemanta-support" target="_blank">Your blog is not in English</a>', 'SearchEverything'),
SE_PREFS_STATE_EMPTY => __('Your blog feed is empty', 'SearchEverything'),
SE_PREFS_STATE_FAILED => __('Unable to reslove URL to a source feed' , 'SearchEverything'),
SE_PREFS_STATE_FOUND => __('You are connected to Zemanta network', 'SearchEverything')
);

function se_get_response_messages() {
global $se_response_messages;
return $se_response_messages;
}

function se_get_options() {
global $se_options, $se_meta;
if($se_options) {
return $se_options;
}

$se_options = get_option('se_options', false);

if(!$se_options || $se_meta['version'] !== SE_VERSION) {
se_upgrade();
$se_meta = get_option('se_meta');
$se_options = get_option('se_options');
}

$se_meta = new ArrayObject($se_meta);
$se_options = new ArrayObject($se_options);

return $se_options;
}


function se_get_meta() {
global $se_meta;

if (!$se_meta) {
se_get_options();
}
return $se_meta;
}

function se_update_meta($new_meta) {
global $se_meta;

$new_meta = (array) $new_meta;

$r = update_option('se_meta', $new_meta);

if($r && $se_meta !== false) {
$se_meta->exchangeArray($new_meta);
}

return $r;
}

function se_update_options($new_options) {
global $se_options;

$new_options = (array) $new_options;
$r = update_option('se_options', $new_options);
if($r && $se_options !== false) {
$se_options->exchangeArray($new_options);
}

return $r;
}

function se_set_global_notice() {
$url = admin_url( 'options-general.php' );
$url = add_query_arg( array(
'page' => 'extend_search',
'se_global_notice' => 0,
), $url );

$se_meta = get_option('se_meta', false);
$se_meta['se_global_notice'] = array(
'title' => 'Search everything has been updated with security fixes!',
'message' => 'Search Everything has been upgraded with security updates and some exciting new features. Visit <a href="'.$url.'">settings</a> to learn more.'
);
se_update_meta($se_meta);
}

//we have to be careful, as previously version was not stored in the options!
function se_upgrade() {
$se_meta = get_option('se_meta', false);
$version = false;

if($se_meta) {
$version = $se_meta['version'];
}

if($version) {
if(version_compare($version, SE_VERSION, '<')) {
call_user_func('se_migrate_' . str_replace('.', '_', $version));
se_upgrade();
}
} else {
//check if se_options exist
$se_options = get_option('se_options', false);
if($se_options) {
se_migrate_7_0_1(); //existing users don't have version stored in their db
} else {
se_install();
}
}
}

function se_migrate_7_0_4() {
$se_meta = get_option('se_meta', false);

if ($se_meta) {
$se_meta['version'] = '8.0';
$se_meta['api_key'] = false;
}

$se_options = get_option('se_options', false);

//enable external search
$se_options['se_research_widget'] = array (
'visible_on_compose' => true,
'external_search_enabled' => false,
'notice_visible' => true,
);
$se_meta['show_options_page_notice'] = false;

update_option('se_meta',$se_meta);
update_option('se_options',$se_options);

se_set_global_notice();
}

function se_migrate_7_0_3() {

$se_meta = get_option('se_meta', false);

if ($se_meta) {
$se_meta['version'] = '7.0.4';
}
update_option('se_meta',$se_meta);
}


function se_migrate_7_0_2() {

$se_meta = get_option('se_meta', false);

if ($se_meta) {
$se_meta['version'] = '7.0.3';
}
update_option('se_meta',$se_meta);
}


function se_migrate_7_0_1() {
$se_meta = array(
'blog_id' => false,
'auth_key' => false,
'version' => '7.0.2',
'first_version' => '7.0.1',
'new_user' => false,
'name' => '',
'email' => '',
'show_options_page_notice' => false
);

update_option('se_meta',$se_meta);

//get options and update values to boolean
$old_options = get_option('se_options', false);

if($old_options) {
$new_options = se_get_default_options();

$boolean_keys = array(
'se_use_page_search' => false,
'se_use_comment_search' => false,
'se_use_tag_search' => false,
'se_use_tax_search' => false,
'se_use_category_search' => false,
'se_approved_comments_only'=> false,
'se_approved_pages_only' => false,
'se_use_excerpt_search' => false,
'se_use_draft_search' => false,
'se_use_attachment_search' => false,
'se_use_authors' => false,
'se_use_cmt_authors' => false,
'se_use_metadata_search' => false,
'se_use_highlight' => false,
);
$text_keys = array(
'se_exclude_categories' => '',
'se_exclude_categories_list' => '',
'se_exclude_posts' => '',
'se_exclude_posts_list' => '',
'se_highlight_color' => '',
'se_highlight_style' => ''
);

foreach ($boolean_keys as $k) {
$new_options[$k] = ('Yes' === $old_options[$k]);
}
foreach ($text_keys as $t) {
$new_options[$t] = $old_options[$t];
}
update_option('se_options',$new_options);
}

//moved to meta
$notice = get_option('se_show_we_tried', false);
if($notice) {
delete_option('se_show_we_tried');
}
}


function se_install() {
$se_meta = array(
'blog_id' => false,
'api_key' => false,
'auth_key' => false,
'version' => SE_VERSION,
'first_version' => SE_VERSION,
'new_user' => true,
'name' => '',
'email' => '',
'show_options_page_notice' => false
);
$se_options = se_get_default_options();

update_option('se_meta', $se_meta);
update_option('se_options', $se_options);

se_set_global_notice();
}

function se_get_default_options() {
$se_options = array(
'se_exclude_categories' => '',
'se_exclude_categories_list' => '',
'se_exclude_posts' => '',
'se_exclude_posts_list' => '',
'se_use_page_search' =>false,
'se_use_comment_search' =>true,
'se_use_tag_search' => false,
'se_use_tax_search' => false,
'se_use_category_search' => true,
'se_approved_comments_only'=> true,
'se_approved_pages_only' => false,
'se_use_excerpt_search' => false,
'se_use_draft_search' => false,
'se_use_attachment_search' => false,
'se_use_authors' => false,
'se_use_cmt_authors' => false,
'se_use_metadata_search' => false,
'se_use_highlight' => true,
'se_highlight_color' => 'orange',
'se_highlight_style' => '',
'se_research_metabox' => array (
'visible_on_compose' => true,
'external_search_enabled' => false,
'notice_visible' => true
)
);

return $se_options;
}

14 changes: 14 additions & 0 deletions css/admin.css
@@ -0,0 +1,14 @@
.thanks {width:400px; }
.thanks p {padding-left:20px; padding-right:20px;}
.info { background: #FFFFCC; border: 1px dotted #D8D2A9; padding: 10px; color: #333; }
.info a { color: #333; text-decoration: none; border-bottom: 1px dotted #333 }
.info a:hover { color: #666; border-bottom: 1px dotted #666; }

#se-basic-settings,#se-advanced-settings, #se-test-search, #se-info {margin-top: 20px;}
#se-basic-settings .manage-column, #se-advanced-settings .manage-column {font-weight:bold;}
#se-basic-settings.widefat, #se-advanced-settings.widefat,#se-test-search.widefat, #se-info.widefat {width:80%;}
.se-col {width:350px;}
.se-suboption label { font-size: smaller;margin-left:10px; color:#666;}

#se-top-notice {width:80%; position:relative;}
#se-top-notice .updated {margin:0;}
Empty file modified gpl.txt 100755 → 100644
Empty file.
Empty file modified lang/se-by_BY.mo 100755 → 100644
Empty file.
Empty file modified lang/se-by_BY.po 100755 → 100644
Empty file.
Empty file modified lang/se-de_DE.mo 100755 → 100644
Empty file.

0 comments on commit 37b8f73

Please sign in to comment.