Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined with 2.0.0-wip branch #22

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
382c48d
Added taxonomy, page, and post type archive sections to Wordpress Int…
Jul 7, 2013
2d50fbb
Adding taxonomy, page, and post type sections continued.
Jul 7, 2013
6413366
Added facet widget with checkboxes, multiselect, radio. dropdown, slider
Jul 16, 2013
a71d10d
Removed related-posts (work in progress)
scottrice10 Jul 16, 2013
8f52d44
1.2.3 polished
scottrice10 Jul 17, 2013
e3ef868
Moved facet-widget directory
Jul 17, 2013
7dcbc24
Moving facet-widget directory
scottrice10 Jul 17, 2013
afd7ff6
Moved facet-widget
scottrice10 Jul 17, 2013
349445f
Reset permissions
scottrice10 Jul 17, 2013
ebc4456
Synced with 1.2.4 changes
scottrice10 Jul 17, 2013
47b7e04
Too many parentheses
scottrice10 Jul 17, 2013
c48b981
Edited facet-widget
scottrice10 Jul 17, 2013
292a532
Merge remote-tracking branch 'upstream/master'
scottrice10 Jul 17, 2013
88e618a
Merge remote-tracking branch 'upstream/master' into experiments
scottrice10 Jul 17, 2013
026f110
Merge remote-tracking branch 'upstream/master' into myVersion
scottrice10 Jul 17, 2013
e797ea3
Merge remote-tracking branch 'upstream/2.0.0-wip' into experiments
scottrice10 Jul 17, 2013
e844da5
Removed moved directories
scottrice10 Jul 17, 2013
846d0f8
Map widget in progress
scottrice10 Jul 18, 2013
d6d23ea
Fixed facet-widget relative paths
scottrice10 Jul 18, 2013
72c1e98
Beginnings of charts widget
scottrice10 Jul 18, 2013
fb0b355
Work on Chart Widget
scottrice10 Jul 19, 2013
5e773f8
Charts widget working, Maps Widget still needs work
scottrice10 Jul 23, 2013
39def6a
Merge branch 'myVersion' of https://github.com/scottrice10/wordpress-…
scottrice10 Jul 23, 2013
76cfc29
Fixed git sub-module
scottrice10 Jul 23, 2013
29e4b42
Now fixed git sub-module
scottrice10 Jul 23, 2013
3c6f2e2
Merge remote-tracking branch 'upstream/2.0.0-wip' into rice2.0.0-wip
scottrice10 Jul 23, 2013
ccedcf8
Reset permissions
scottrice10 Jul 23, 2013
dd57739
Closed admin divs
scottrice10 Jul 25, 2013
556817c
Fixed permissions
scottrice10 Jul 25, 2013
a902818
Removed facet-widget
scottrice10 Jul 26, 2013
fb2b5cd
Changed included files
scottrice10 Jul 26, 2013
7d0562a
Merge remote-tracking branch 'upstream/master' into rice2.0.0-wip
scottrice10 Jul 26, 2013
20e2ccb
Cleanup changed directory
scottrice10 Jul 26, 2013
90813af
Permissions
scottrice10 Jul 26, 2013
661ac55
Merge branch 'rice2.0.0-wip'
scottrice10 Jul 26, 2013
e3c4e73
Permissions
scottrice10 Jul 26, 2013
5f9ea62
Removed change directory
scottrice10 Jul 26, 2013
dde316e
Removed widget
scottrice10 Jul 26, 2013
2217b94
Removed changed directories
scottrice10 Jul 26, 2013
0b51a04
Removed unused directories
scottrice10 Jul 26, 2013
0903d70
Git merge changes
scottrice10 Jul 26, 2013
aae2297
Merge remote-tracking branch 'origin' into rice2.0.0-wip
scottrice10 Jul 26, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ php:
- 5.3
services:
- elasticsearch
<<<<<<< HEAD
=======
before_script:
- sleep 3 # wait to make sure ES is up
>>>>>>> upstream/2.0.0-wip
3 changes: 3 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ https://github.com/parisholley/wordpress-fantastic-elasticsearch/wiki
* Integeration tests to ensure intended behavior with ElasticSearch 0.20.6 and 0.90.2
* Continuous integration setup with travis-ci
* Developer documentation for faceting and extending
<<<<<<< HEAD
=======

= 1.2.4 =
* Allow plugin to work if downloaded from github or wordpress (images weren't showing up in admin)
>>>>>>> upstream/2.0.0-wip

= 1.2.3 =
* Bug fixes as result of merge
Expand Down
4 changes: 4 additions & 0 deletions elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
THE SOFTWARE.
*/


namespace elasticsearch;

if(!defined('NHP_OPTIONS_URL')){
Expand All @@ -46,6 +47,9 @@

require 'wp/theme/search.php';
require 'wp/theme/category.php';
require 'wp/theme/taxonomy.php';
require 'wp/theme/page.php';
require 'wp/theme/post_type.php';
require 'wp/admin/hooks.php';

add_action( 'admin_enqueue_scripts', function() {
Expand Down
8 changes: 8 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
<phpunit bootstrap="unit-tests/bootstrap.php">
=======
<phpunit bootstrap="tests/unit-tests/bootstrap.php">
>>>>>>> upstream/2.0.0-wip
<testsuites>
<testsuite name="Unit Tests">
<directory>tests/unit-tests</directory>
Expand All @@ -14,4 +18,8 @@
<directory suffix=".php">wp/theme</directory>
</whitelist>
</filter>
<<<<<<< HEAD
</phpunit>
=======
</phpunit>
>>>>>>> upstream/2.0.0-wip
Empty file modified precommit.sh
100755 → 100644
Empty file.
21 changes: 21 additions & 0 deletions src/elasticsearch/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,26 @@ static function taxonomies(){

return self::apply_filters('config_taxonomies', $val);
}

static function parse_query($str) {
global $NHP_Options;
$relation = $NHP_Options->get('multiple_relation');
# result array
$arr = array();

# split on outer delimiter
$pairs = explode('&', $str);

# loop through each pair
foreach ($pairs as $i) {
# split into name and value
list($elasticsearch,$value) = explode('=', $i, 2);
list($name,$key) = explode(urlencode($relation), $elasticsearch, 2);
$arr[$name][] = $value;
}

# return result array
return $arr;
}
}
?>
Empty file modified tests/selenium.sh
100755 → 100644
Empty file.
Empty file modified tests/test.sh
100755 → 100644
Empty file.
Empty file modified tests/version.sh
100755 → 100644
Empty file.
Empty file modified vendor/jeremykendall/php-domain-parser/bin/pdp-psl
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/changes.txt
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/lib/Elastica/Bulk/Action.php
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file modified vendor/ruflin/elastica/lib/Elastica/Index/Status.php
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/lib/Elastica/Node/Info.php
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/lib/Elastica/Type/Mapping.php
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/test/bin/install_php_memcache.sh
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/test/bin/run_elasticsearch.sh
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/test/lib/Elastica/Test/BulkTest.php
100755 → 100644
Empty file.
Empty file modified vendor/ruflin/elastica/test/lib/Elastica/Test/Node/InfoTest.php
100755 → 100644
Empty file.
Empty file.
215 changes: 215 additions & 0 deletions wp/admin/sections/charts-widget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<?php
namespace elasticsearch;

$sections['charts'] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_042_pie_chart.png',
'title' => 'Charts Widget',
'desc' => 'Select options for sidebar charts widget.',
'fields' => array(
'charts_widget_info' => array(
'id' => 'charts_widget_info',
'type' => 'info',
'desc' => 'The Charts Widget takes the facet counts tabulated by Elasticsearch and creates one of the following six charts using charts.js.',
'title' => 'Charts Widget Info',
),
'line_charts' => array(
'id' => 'line_charts',
'type' => 'info',
'desc' => '<div class="info_field_text">Line graphs are probably the most widely used graph for showing trends. Chart.js has a ton of customisation features for line graphs, along with support for multiple datasets to be plotted on one chart.</div>
<p></p>
<div class="chart_pic" style="width:50%" height:"auto" margin:"auto" >
<canvas id="lineChartCanvas" width="449" height="300" style="width: 449px height: 300px"></canvas>
<script>
var lineDemoData = {
labels : ["January","February","March","April","May","June","July"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : [65,59,90,81,56,55,40]
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
pointColor : "rgba(151,187,205,1)",
pointStrokeColor : "#fff",
data : [28,48,40,19,96,27,100]
}
]
};
var lineDemo = new Chart(document.getElementById("lineChartCanvas").getContext("2d")).Line(lineDemoData);
</script>',
'title' => 'Line Charts',
),
'bar_charts' => array(
'id' => 'bar_charts',
'type' => 'info',
'desc' => '<div class="info_field_text">Bar graphs are also great at showing trend data. Chart.js supports bar charts with a load of custom styles and the ability to show multiple bars for each x value.</div>
<p></p>
<div class="chart_pic" style="width:50%" height:"auto" margin:"auto" >
<canvas id="barChartCanvas" width="449" height="300" style="width: 449px height: 300px"></canvas>
<script>
var barDemoData = {
labels : ["January","February","March","April","May","June","July"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
data : [65,59,90,81,56,55,40]
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
data : [28,48,40,19,96,27,100]
}
]
};
var barDemo = new Chart(document.getElementById("barChartCanvas").getContext("2d")).Bar(barDemoData);
</script>',
'title' => 'Bar Charts',
),
'radar_charts' => array(
'id' => 'radar_charts',
'type' => 'info',
'desc' => '<div class="info_field_text">Radar charts are good for comparing a selection of different pieces of data. Chart.js supports multiple data sets plotted on the same radar chart. It also supports all of the customisation and animation options you would expect.</div>
<p></p>
<div class="chart_pic" style="width:50%" height:"auto" margin:"auto" >
<canvas id="radarChartCanvas" width="449" height="300" style="width: 449px height: 300px"></canvas>
<script>
var radarDemoDatasets = {
labels : ["Eating","Drinking","Sleeping","Designing","Coding","Partying","Running"],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : [65,59,90,81,56,55,40]
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
pointColor : "rgba(151,187,205,1)",
pointStrokeColor : "#fff",
data : [28,48,40,19,96,27,100]
}
]};
var radarDemo = new Chart(document.getElementById("radarChartCanvas").getContext("2d")).Radar(radarDemoDatasets);
</script>',
'title' => 'Radar Charts',
),
'pie_charts' => array(
'id' => 'pie_charts',
'type' => 'info',
'desc' => '<div class="info_field_text">Pie charts are great at comparing proportions within a single data set. Chart.js shows animated pie charts with customisable colours, strokes, animation easing and effects.</div>
<p></p>
<div class="chart_pic" style="width:50%" height:"auto" margin:"auto" >
<canvas id="pieChartCanvas" width="449" height="300" style="width: 449px height: 300px"></canvas>
<script>
var pieDemoData = [
{
value: 30,
color:"#F38630",
label: "Apple"
},
{
value : 50,
color : "#E0E4CC",
label: "Pecan"
},
{
value : 100,
color : "#69D2E7",
label: "Pumpkin"
}
];
var pieDemo = new Chart(document.getElementById("pieChartCanvas").getContext("2d")).Pie(pieDemoData);
</script>',
'title' => 'Pie Charts',
),
'polar_area_charts' => array(
'id' => 'polar_area_charts',
'type' => 'info',
'desc' => '<div class="info_field_text">Polar area charts are similar to pie charts, but the variable is not the circumference of the segment, but the radius of it. Chart.js delivers animated polar area charts with custom coloured segments, along with customisable scales and animation.</div>
<p></p>
<div class="chart_pic" style="width:50%" height:"auto" margin:"auto" >
<canvas id="polarAreaChartCanvas" width="449" height="300" style="width: 449px height: 300px"></canvas>
<script>
var polarAreaDemoData = [
{
value : 85,
color: "#D97041",
label: "North Pole"
},
{
value : 90,
color: "#C7604C",
label: "Antarctica"
},
{
value : 80,
color: "#9D9B7F",
label: "Siberia"
}
];
var polarAreaDemoOptions = {
scaleOverride : true,
scaleSteps : 4,
scaleStepWidth : 5,
scaleStartValue : 70
};
var polarAreaDemo = new Chart(document.getElementById("polarAreaChartCanvas").getContext("2d")).PolarArea(polarAreaDemoData,polarAreaDemoOptions);
</script>',
'title' => 'Polar Area Charts',
),
'doughnut_charts' => array(
'id' => 'doughnut_charts',
'type' => 'info',
'desc' => '<div class="info_field_text">Similar to pie charts, doughnut charts are great for showing proportional data. Chart.js offers the same customisation options as for pie charts, but with a custom sized inner cutout to turn your pies into doughnuts.</div>
<p></p>
<div class="chart_pic" style="width:50%" height:"auto" margin:"auto" >
<canvas id="doughnutChartCanvas" width="449" height="300" style="width: 449px height: 300px"></canvas>
<script>
var doughnutDemoData = [
{
value: 30,
color:"#F7464A",
label: "Jelly"
},
{
value : 50,
color : "#E2EAE9",
label: "Glazed"
},
{
value : 100,
color : "#D4CCC5",
label: "Cake"
},
{
value : 40,
color : "#949FB1",
label: "Long John"
},
{
value : 120,
color : "#BCED91",
label: "Custard"
}

];
var doughnutDemo = new Chart(document.getElementById("doughnutChartCanvas").getContext("2d")).Doughnut(doughnutDemoData);
</script>',
'title' => 'Doughnut Charts',
),
'charts_js_info' => array(
'id' => 'charts_js_info',
'type' => 'info',
'desc' => 'The Charts Widget is based on the charts.js library and the <a href= "http://wordpress.org/plugins/wp-charts/" target="_blank">WordPress Charts</a> plugin. For more information on all of the options provided by charts.js, please visit <a href= "http://www.chartjs.org/" target="_blank">chartsjs.org</a>.',
'title' => 'Charts.js Info',
)
)
);
?>
1 change: 0 additions & 1 deletion wp/admin/sections/content-indexing.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
$fields[0]['std'][$field] = 1;
}


foreach(Defaults::types() as $type){
$fields[1]['options'][$type] = $type;
$fields[1]['std'][$type] = 1;
Expand Down
60 changes: 60 additions & 0 deletions wp/admin/sections/facet-widget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
namespace elasticsearch;

$sections['facet'] = array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_150_check.png',
'title' => 'Facet Widget',
'desc' => 'Select options for sidebar facet widget.',
'fields' => array(
'auto_submit' => array(
'id' => 'auto_submit',
'type' => 'checkbox',
'title' => 'Auto submit form?',
'options' => array(
'auto_submit' => ''),
'std' => 'auto_submit'//this should be the key as defined above
),
'hide_empty' => array(
'id' => 'hide_empty',
'type' => 'checkbox',
'title' => 'Hide empty terms?',
'options' => array(
'hide_empty' => ''),
'std' => 'hide_empty'//this should be the key as defined above
),
'display_search_box' => array(
'id' => 'display_search_box',
'type' => 'checkbox',
'title' => 'Display the search box?',
'options' => array(
'display_search_box' => '')
),
'display_reset_button' => array(
'id' => 'display_reset_button',
'type' => 'checkbox',
'title' => 'Display the reset button?',
'options' => array(
'display_reset_button' => '')
),
'post_count' => array(
'id' => 'post_count',
'type' => 'radio',
'title' => 'Display post count:',
'options' => array(
'total' => 'Total',
'dynamic' => 'Dynamic',
'none' => 'None'),
'std' => 'dynamic'//this should be the key as defined above
),
'multiple_relation' => array(
'id' => 'multiple_relation',
'type' => 'select',
'title' => 'Multiple selection relation:',
'options' => array(
'[or]' => 'OR',
'[and]' => 'AND'),
'std' => '[or]'//this should be the key as defined above
)
)
);
?>
18 changes: 18 additions & 0 deletions wp/admin/sections/wordpress-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@
'id' => 'enable_categories',
'type' => 'cats_multi_select',
'title' => 'Categories to Enable',
'sub_desc' => 'If enabled, category listings will use ElasticSearch for filtering and faceting. To use faceting, read the <a href="https://github.com/parisholley/wordpress-fantastic-elasticsearch/wiki/Faceted-Search">facted search implementation instructions</a>'
),
'enable_taxonomies' => array(
'id' => 'enable_taxonomies',
'type' => 'taxes_multi_select',
'title' => 'Taxonomies to Enable',
'sub_desc' => 'If enabled, taxonomy listings will use ElasticSearch for filtering and faceting. To use faceting, read the <a href="https://github.com/parisholley/wordpress-fantastic-elasticsearch/wiki/Faceted-Search">facted search implementation instructions</a>'
),
'enable_pages' => array(
'id' => 'enable_pages',
'type' => 'pages_multi_select',
'title' => 'Pages to Enable',
'sub_desc' => 'If enabled, page listings will use ElasticSearch for filtering and faceting. To use faceting, read the <a href="https://github.com/parisholley/wordpress-fantastic-elasticsearch/wiki/Faceted-Search">facted search implementation instructions</a>'
),
'enable_post_types' => array(
'id' => 'enable_post_types',
'type' => 'post_types_multi_select',
'title' => 'Post Types to Enable',
'sub_desc' => 'If enabled, category listings will use ElasticSearch for filtering and faceting. To use faceting, read the <a href="https://github.com/parisholley/wordpress-fantastic-elasticsearch/wiki/Faceted-Search">facted search implementation instructions</a>',
'args' => array()
)
Expand Down
Loading