Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosescri committed Sep 3, 2018
2 parents c6fd074 + b14d7d8 commit 161cbd5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions doofinder/doofinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Doofinder
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Version: 0.1.0
* Version: 0.1.1
* Author: Doofinder
* Description: Integrate Doofinder Search in your WordPress website.
*
Expand All @@ -30,7 +30,7 @@ class Doofinder_For_WordPress {
*
* @var string
*/
public static $version = '0.1.0';
public static $version = '0.1.1';

/**
* The only instance of Doofinder_For_WordPress
Expand Down
2 changes: 1 addition & 1 deletion doofinder/includes/api/class-local-dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function send_batch( $items_type, array $items ) {

$this->log->log( $items_type );
$this->log->log( array_map( function ( $item ) {
return $item['id'] . ' - ' . $item['title'];
return $item['id'] . ' - ' . $item['title'] . ' - ' . $item['post_date'];
}, $items ) );

return Api_Status::$success;
Expand Down
11 changes: 6 additions & 5 deletions doofinder/includes/class-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private static function handle_additional_settings_save( $post_id ) {
* that the post should not be indexed.
*
* @param \WP_Post $post
* @param bool $updated
* @param bool $updated
*/
private static function webhook_update_post( $post, $updated ) {
$api = Api_Factory::get();
Expand Down Expand Up @@ -207,7 +207,7 @@ private static function webhook_update_post( $post, $updated ) {
* Post constructor.
*
* @param \WP_Post|int $post
* @param \stdClass[] $meta
* @param \stdClass[] $meta
*/
public function __construct( $post, $meta = null ) {
if ( $meta !== null ) {
Expand Down Expand Up @@ -288,9 +288,10 @@ public function format_for_api() {
// Base data, that all posts must have.
// All other data will be added if present.
$data = array(
'id' => $this->post->ID,
'title' => $this->post->post_title,
'link' => get_the_permalink( $this->post ),
'id' => $this->post->ID,
'title' => $this->post->post_title,
'link' => get_the_permalink( $this->post ),
'post_date' => $this->post->post_date
);

// Post content.
Expand Down
10 changes: 7 additions & 3 deletions doofinder/includes/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,9 @@ private function render_html_pick_language_prompt() {
<div class="wrap">
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>

<div class="notice notice-error"><p><?php _e('You have a multi-language plugin installed. Please choose language first to configure Doofinder.', 'doofinder_for_wp'); ?></p></div>
<div class="notice notice-error">
<p><?php _e( 'You have a multi-language plugin installed. Please choose language first to configure Doofinder.', 'doofinder_for_wp' ); ?></p>
</div>
</div>

<?php
Expand Down Expand Up @@ -764,6 +766,7 @@ private function render_html_enable_internal_search( $option_name ) {
$saved_value = get_option( $option_name );

?>

<span class="doofinder-tooltip"><span><?php _e( 'Enabling this setting will make WordPress use Doofinder internally for search.', 'doofinder_for_wp' ); ?></span></span>
<label>
<input type="checkbox" name="<?php echo $option_name; ?>"
Expand Down Expand Up @@ -856,11 +859,12 @@ public function validate_post_types( $input ) {
return $input;
}

/*
/**
* Helper function to search two dimensional array.
*
* @param string $needle
* @param array $haystack
* @param array $haystack
*
* @return bool
*/
private function in_2d_array( $needle, array $haystack ) {
Expand Down
6 changes: 4 additions & 2 deletions doofinder/includes/search/class-doofinder-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ public function search( $query, $page = 1, $per_page = 10 ) {
// throws an exception, the list of IDs will be empty
// and Internal Search will display empty list of results.
try {
$this->results = $this->client->query( $query, $page, array(
$queryParams = array(
'rpp' => $per_page,
) );
);

$this->results = $this->client->query( $query, $page, $queryParams );

$this->extract_ids();
$this->calculate_totals();
Expand Down
5 changes: 4 additions & 1 deletion doofinder/readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== Doofinder ===
Contributors: doofinder, chopchoporg
Tags: search, autocomplete
Version: 0.1.0
Version: 0.1.1
Requires at least: 4.1
Tested up to: 4.9.6
Stable tag: trunk
Expand Down Expand Up @@ -112,5 +112,8 @@ Just send your questions to <mailto:[email protected]> and we will try to an

== Changelog ==

= 0.1.1 =
Post date is indexed for all data types.

= 0.1.0 =
First usable version.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "doofinder-wordpress",
"version": "0.1.0",
"version": "0.1.1",
"description": "Integrate Doofinder in your WordPress site with (almost) no effort.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 161cbd5

Please sign in to comment.