From ba55e0fe873c70385ad44ffc60927dfb83429525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Thu, 9 Mar 2017 01:48:58 +0100 Subject: [PATCH 01/96] Add WP_Query fields support --- classes/class-ep-api.php | 24 +++ classes/class-ep-wp-query-integration.php | 193 ++++++++++++++++------ features/search/search.php | 6 - features/woocommerce/woocommerce.php | 8 - 4 files changed, 169 insertions(+), 62 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index a52e5b639d..7e27061c59 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -1504,6 +1504,30 @@ public function format_args( $args ) { $formatted_args['post_filter'] = $filter; } + /** + * Support fields. + */ + if ( isset( $args['fields'] ) ) { + switch ( $args['fields'] ) { + case 'ids': + $formatted_args['_source'] = [ + 'include' => [ + 'post_id', + ], + ]; + break; + + case 'id=>parent': + $formatted_args['_source'] = [ + 'include' => [ + 'post_id', + 'post_parent', + ], + ]; + break; + } + } + /** * Aggregations */ diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index 4c7805acc6..34a7449400 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -47,6 +47,9 @@ public function setup() { // Nukes the FOUND_ROWS() database query add_filter( 'found_posts_query', array( $this, 'filter_found_posts_query' ), 5, 2 ); + // Support "fields". + add_filter( 'posts_pre_query', array( $this, 'posts_fields' ), 10, 2 ); + // Query and filter in EP_Posts to WP_Query add_filter( 'the_posts', array( $this, 'filter_the_posts' ), 10, 2 ); @@ -188,6 +191,36 @@ public function filter_found_posts_query( $sql, $query ) { return ''; } + /** + * Workaround for when WP_Query short circuits for special fields arguments. + * + * @since 2.2.1 + * + * @param array $posts + * Return an array of post data to short-circuit WP's query, + * or null to allow WP to run its normal queries. + * @param WP_Query $query + * WP_Query object. + * + * @return array + * An array of fields. + */ + public function posts_fields( $posts, $query ) { + // Make sure the query is EP enabled. + if ( ! ep_elasticpress_enabled( $query ) || apply_filters( 'ep_skip_query_integration', false, $query ) || ! isset( $this->posts_by_query[ spl_object_hash( $query ) ] ) ) { + return $posts; + } + + // Only touch the default behaviour of "ep_fields" is defined to make + // sure we only affect places we specifically ask for. + $fields = $query->get( 'fields', '' ); + if ( $fields === 'ids' || $fields === 'id=>parent' ) { + return $this->posts_by_query[ spl_object_hash( $query ) ]; + } else { + return $posts; + } + } + /** * Filter query string used for get_posts(). Query for posts and save for later. * Return a query that will return nothing. @@ -266,67 +299,131 @@ public function filter_posts_request( $request, $query ) { $query->found_posts = $ep_query['found_posts']; $query->max_num_pages = ceil( $ep_query['found_posts'] / $query->get( 'posts_per_page' ) ); - foreach ( $ep_query['posts'] as $post_array ) { - $post = new stdClass(); + // Determine how we should format the results from ES based on the fields + // parameter. + $fields = $query->get( 'fields', '' ); + if ( $fields === 'ids' ) { + $new_posts = $this->format_hits_as_ids( $ep_query['posts'], $new_posts ); + } + elseif ( $fields === 'id=>parent' ) { + $new_posts = $this->format_hits_as_id_parents( $ep_query['posts'], $new_posts ); + } + else { + $new_posts = $this->format_hits_as_posts( $ep_query['posts'], $new_posts ); + } - $post->ID = $post_array['post_id']; - $post->site_id = get_current_blog_id(); + do_action( 'ep_wp_query_non_cached_search', $new_posts, $ep_query, $query ); + } - if ( ! empty( $post_array['site_id'] ) ) { - $post->site_id = $post_array['site_id']; - } - // ep_search_request_args - $post_return_args = apply_filters( 'ep_search_post_return_args', - array( - 'post_type', - 'post_author', - 'post_name', - 'post_status', - 'post_title', - 'post_parent', - 'post_content', - 'post_excerpt', - 'post_date', - 'post_date_gmt', - 'post_modified', - 'post_modified_gmt', - 'post_mime_type', - 'comment_count', - 'comment_status', - 'ping_status', - 'menu_order', - 'permalink', - 'terms', - 'post_meta', - 'meta', - ) - ); - - foreach ( $post_return_args as $key ) { - if( $key === 'post_author' ) { - $post->$key = $post_array[$key]['id']; - } elseif ( isset( $post_array[ $key ] ) ) { - $post->$key = $post_array[$key]; - } - } + $this->posts_by_query[spl_object_hash( $query )] = $new_posts; - $post->elasticsearch = true; // Super useful for debugging + do_action( 'ep_wp_query_search', $new_posts, $ep_query, $query ); - if ( $post ) { - $new_posts[] = $post; + return "SELECT * FROM $wpdb->posts WHERE 1=0"; + } + + /** + * Format the ES hits/results as post objects. + * + * @since 2.2.1 + * + * @param array $posts The posts that should be formatted. + * @param array $new_posts Array of posts from cache. + * + * @return array + */ + protected function format_hits_as_posts( $posts, $new_posts ) { + foreach ( $posts as $post_array ) { + $post = new stdClass(); + + $post->ID = $post_array['post_id']; + $post->site_id = get_current_blog_id(); + + if ( ! empty( $post_array['site_id'] ) ) { + $post->site_id = $post_array['site_id']; + } + // ep_search_request_args + $post_return_args = apply_filters( 'ep_search_post_return_args', + array( + 'post_type', + 'post_author', + 'post_name', + 'post_status', + 'post_title', + 'post_parent', + 'post_content', + 'post_excerpt', + 'post_date', + 'post_date_gmt', + 'post_modified', + 'post_modified_gmt', + 'post_mime_type', + 'comment_count', + 'comment_status', + 'ping_status', + 'menu_order', + 'permalink', + 'terms', + 'post_meta', + 'meta', + ) + ); + + foreach ( $post_return_args as $key ) { + if( $key === 'post_author' ) { + $post->$key = $post_array[$key]['id']; + } elseif ( isset( $post_array[ $key ] ) ) { + $post->$key = $post_array[$key]; } } - do_action( 'ep_wp_query_non_cached_search', $new_posts, $ep_query, $query ); + $post->elasticsearch = true; // Super useful for debugging + + if ( $post ) { + $new_posts[] = $post; + } } - $this->posts_by_query[spl_object_hash( $query )] = $new_posts; + return $new_posts; + } - do_action( 'ep_wp_query_search', $new_posts, $ep_query, $query ); + /** + * Format the ES hits/results as an array of ids. + * + * @since 2.2.1 + * + * @param array $posts The posts that should be formatted. + * @param array $new_posts Array of posts from cache. + * + * @return array + */ + protected function format_hits_as_ids( $posts, $new_posts ) { + foreach ( $posts as $post_array ) { + $new_posts[] = $post_array['post_id']; + } - return "SELECT * FROM $wpdb->posts WHERE 1=0"; + return $new_posts; } + /** + * Format the ES hits/results as objects containing id and parent id. + * + * @since 2.2.1 + * + * @param array $posts The posts that should be formatted. + * @param array $new_posts Array of posts from cache. + * + * @return array + */ + protected function format_hits_as_id_parents( $posts, $new_posts ) { + foreach ( $posts as $post_array ) { + $post = new stdClass(); + $post->ID = $post_array['post_id']; + $post->post_parent = $post_array['post_parent']; + $new_posts[] = $post; + } + return $new_posts; + } /** * Return a singleton instance of the current class diff --git a/features/search/search.php b/features/search/search.php index 68f250f710..139d2180d7 100644 --- a/features/search/search.php +++ b/features/search/search.php @@ -233,12 +233,6 @@ function ep_integrate_search_queries( $enabled, $query ) { $enabled = false; } else if ( method_exists( $query, 'is_search' ) && $query->is_search() && ! empty( $query->query_vars['s'] ) ) { $enabled = true; - - $fields = $query->get( 'fields' ); - - if ( ! empty( $fields ) ) { - $enabled = false; - } } return $enabled; diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index fefcebff42..0a13597ab4 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -311,14 +311,6 @@ function ep_wc_translate_args( $query ) { $query->set( 'meta_key', '_wc_average_rating' ); } - /** - * We can't support any special fields parameters - */ - $fields = $query->get( 'fields', false ); - if ( 'ids' === $fields || 'id=>parent' === $fields ) { - $query->set( 'fields', 'default' ); - } - /** * Handle meta queries */ From e48bec82cb021f160668c5cff3ad27a6d1777739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Thu, 4 May 2017 10:28:13 +0200 Subject: [PATCH 02/96] Correct comment from prototyping stage --- classes/class-ep-wp-query-integration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index 34a7449400..276c142780 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -211,8 +211,8 @@ public function posts_fields( $posts, $query ) { return $posts; } - // Only touch the default behaviour of "ep_fields" is defined to make - // sure we only affect places we specifically ask for. + // Determine how we should return the posts. The official WP_Query + // supports: ids, id=>parent and post objects. $fields = $query->get( 'fields', '' ); if ( $fields === 'ids' || $fields === 'id=>parent' ) { return $this->posts_by_query[ spl_object_hash( $query ) ]; From f6e8539bee32541062b02fcc12bcb23f45745b3e Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Fri, 12 May 2017 15:27:39 +0200 Subject: [PATCH 03/96] Added decaying configuration --- assets/css/admin.css | 5 +- assets/css/admin.css.map | 2 +- assets/css/admin.scss | 5 ++ assets/js/dashboard.min.js | 2 +- assets/js/src/dashboard.js | 2 + classes/class-ep-feature.php | 4 ++ features/search/search.php | 89 ++++++++++++++++++++++++++++++------ 7 files changed, 93 insertions(+), 16 deletions(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index 6070bcd2d7..2026bf6f43 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -255,11 +255,14 @@ h2.ep-list-features { .ep-feature .settings .field { clear: both; overflow: initial; } + .ep-feature .settings .field div { + padding-top: 5px; } .ep-feature .settings .field > label, .ep-feature .settings .field .field-name { display: block; float: left; - margin-right: 3em; } + margin-right: 3em; + min-width: 115px; } .ep-feature .settings .field .input-wrap { display: block; float: left; } diff --git a/assets/css/admin.css.map b/assets/css/admin.css.map index 92fe4431f0..f72e28403d 100644 --- a/assets/css/admin.css.map +++ b/assets/css/admin.css.map @@ -5,5 +5,5 @@ "admin.scss" ], "names": [], - "mappings": "AAKA;;GAEG;AAEH,AAAM,KAAD,CAAC,OAAO;AACb,AAAQ,KAAH,GAAG,EAAE,CAAC;EACV,OAAO,EAAE,CAAC;EACP,QAAQ,EAAE,QAAQ,GACrB;;AAED,AAAM,KAAD,CAAC,EAAE,CAAC;EACR,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,IAAI;EACjB,MAAM,EAAE,YAAY,GACpB;;AAED,AAAQ,OAAD,CAAC,WAAW;AACnB,AAAQ,OAAD,CAAC,WAAW,CA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E,KAAK;IACd,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,UAAU;IACtB,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,GAAG,GACV;EAED,AAAa,YAAD,CAAC,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,GAAG,GACV;EAED,AAAY,WAAD,CAAC,gBAAgB,CAAC;IAC5B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,CAAC;IACV,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,YAAY;IACrB,WAAW,EAAE,IAAI,GACjB" } \ No newline at end of file diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 1c5ffca6d3..309af350ad 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -319,11 +319,16 @@ h2.ep-list-features { clear: both; overflow: initial; + div { + padding-top: 5px; + } + > label, .field-name { display: block; float: left; margin-right: 3em; + min-width: 115px; } .input-wrap { diff --git a/assets/js/dashboard.min.js b/assets/js/dashboard.min.js index fa91b7afb9..cf90bae06c 100644 --- a/assets/js/dashboard.min.js +++ b/assets/js/dashboard.min.js @@ -1 +1 @@ -!function(a){function b(){if(0===q)i.css({width:"1%"});else{var a=parseInt(q)/parseInt(r)*100;i.css({width:a+"%"})}if("initialsync"===o){var b=epDash.sync_initial;j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("sync"===o){var b=epDash.sync_syncing+" "+parseInt(q)+"/"+parseInt(r);e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("pause"===o){var b=epDash.sync_paused;r&&0!==r&&(b+=" "+parseInt(q)+"/"+parseInt(r)),e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.hide(),h.addClass("syncing"),n.show(),l.show(),k.hide()}else if("wpcli"===o){var b=epDash.sync_wpcli;j.text(b),j.show(),i.hide(),m.hide(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("error"===o){if(j.text(epDash.sync_error),j.show(),k.show(),n.hide(),l.hide(),m.hide(),h.removeClass("syncing"),i.hide(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}else if("cancel"===o){if(j.hide(),i.hide(),m.hide(),h.removeClass("syncing"),n.hide(),l.hide(),k.show(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null}else if("finished"===o){if(j.text(epDash.sync_complete),j.show(),i.hide(),m.hide(),n.hide(),l.hide(),k.show(),h.removeClass("syncing"),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}}function c(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function d(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:p,nonce:epDash.nonce}}).done(function(a){if("sync"===o){if(r=a.data.found_posts,q=a.data.offset,a.data.site_stack&&(f=a.data.site_stack),a.data.current_site&&(e=a.data.current_site),f&&f.length)return o="sync",b(),void d();0!==a.data.found_posts||a.data.start?(o="sync",b(),d()):(o="finished",b())}}).error(function(a){a&&a.status&&parseInt(a.status)>=400&&parseInt(a.status)<600&&(o="error",b(),c())})}var e,f,g=a(document.getElementsByClassName("ep-features")),h=a(document.getElementsByClassName("error-overlay")),i=a(document.getElementsByClassName("progress-bar")),j=a(document.getElementsByClassName("sync-status")),k=a(document.getElementsByClassName("start-sync")),l=a(document.getElementsByClassName("resume-sync")),m=a(document.getElementsByClassName("pause-sync")),n=a(document.getElementsByClassName("cancel-sync")),o="sync",p=!1,q=0,r=0;g.on("click",".learn-more, .collapse",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-full")}),g.on("click",".settings-button",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-settings")}),g.on("click",".save-settings",function(c){c.preventDefault();var e=c.target.getAttribute("data-feature"),f=g.find(".ep-feature-"+e),h={};f.find(".setting-field").each(function(){var b=a(this).attr("type"),c=a(this).attr("data-field-name"),d=a(this).attr("value");"radio"===b&&a(this).attr("checked")&&(h[c]=d)}),f.addClass("saving"),a.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:e,nonce:epDash.nonce,settings:h}}).done(function(c){setTimeout(function(){f.removeClass("saving"),"1"===h.active?f.addClass("feature-active"):f.removeClass("feature-active"),c.data.reindex&&(o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",f.addClass("feature-syncing"),p=e,d())},700)}).error(function(){setTimeout(function(){f.removeClass("saving"),f.removeClass("feature-active"),f.removeClass("feature-syncing")},700)})}),epDash.index_meta?epDash.index_meta.wpcli_sync?(o="wpcli",b()):(q=epDash.index_meta.offset,r=epDash.index_meta.found_posts,epDash.index_meta.feature_sync&&(p=epDash.index_meta.feature_sync),epDash.index_meta.current_site&&(e=epDash.index_meta.current_site),epDash.index_meta.site_stack&&(f=epDash.index_meta.site_stack),f&&f.length?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):0!==r||epDash.index_meta.start?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):(o="finished",b())):epDash.auto_start_index&&(o="initialsync",b(),o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),d()),k.on("click",function(){o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",d()}),m.on("click",function(){o="pause",b()}),l.on("click",function(){o="sync",b(),d()}),n.on("click",function(){o="cancel",b(),c()})}(jQuery); \ No newline at end of file +(function($){var $features=$(document.getElementsByClassName("ep-features"));var $errorOverlay=$(document.getElementsByClassName("error-overlay"));var $progressBar=$(document.getElementsByClassName("progress-bar"));var $syncStatusText=$(document.getElementsByClassName("sync-status"));var $startSyncButton=$(document.getElementsByClassName("start-sync"));var $resumeSyncButton=$(document.getElementsByClassName("resume-sync"));var $pauseSyncButton=$(document.getElementsByClassName("pause-sync"));var $cancelSyncButton=$(document.getElementsByClassName("cancel-sync"));var syncStatus="sync";var featureSync=false;var currentSite;var siteStack;var processed=0;var toProcess=0;$features.on("click",".learn-more, .collapse",function(event){$feature=$(this).parents(".ep-feature");$feature.toggleClass("show-full")});$features.on("click",".settings-button",function(event){$feature=$(this).parents(".ep-feature");$feature.toggleClass("show-settings")});$features.on("click",".save-settings",function(event){event.preventDefault();var feature=event.target.getAttribute("data-feature");var $feature=$features.find(".ep-feature-"+feature);var settings={};var $settings=$feature.find(".setting-field");$settings.each(function(){var type=$(this).attr("type");var name=$(this).attr("data-field-name");var value=$(this).attr("value");if("radio"===type){if($(this).attr("checked")){settings[name]=value}}else{settings[name]=value}});$feature.addClass("saving");$.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:feature,nonce:epDash.nonce,settings:settings}}).done(function(response){setTimeout(function(){$feature.removeClass("saving");if("1"===settings.active){$feature.addClass("feature-active")}else{$feature.removeClass("feature-active")}if(response.data.reindex){syncStatus="initialsync";updateSyncDash();$('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove();syncStatus="sync";$feature.addClass("feature-syncing");featureSync=feature;sync()}},700)}).error(function(){setTimeout(function(){$feature.removeClass("saving");$feature.removeClass("feature-active");$feature.removeClass("feature-syncing")},700)})});if(epDash.index_meta){if(epDash.index_meta.wpcli_sync){syncStatus="wpcli";updateSyncDash()}else{processed=epDash.index_meta.offset;toProcess=epDash.index_meta["found_posts"];if(epDash.index_meta.feature_sync){featureSync=epDash.index_meta.feature_sync}if(epDash.index_meta.current_site){currentSite=epDash.index_meta.current_site}if(epDash.index_meta.site_stack){siteStack=epDash.index_meta.site_stack}if(siteStack&&siteStack.length){if(epDash.auto_start_index){syncStatus="sync";history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,""));updateSyncDash();sync()}else{syncStatus="pause";updateSyncDash()}}else{if(0===toProcess&&!epDash.index_meta.start){syncStatus="finished";updateSyncDash()}else{if(epDash.auto_start_index){syncStatus="sync";history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,""));updateSyncDash();sync()}else{syncStatus="pause";updateSyncDash()}}}}}else{if(epDash.auto_start_index){syncStatus="initialsync";updateSyncDash();syncStatus="sync";history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,""));sync()}}function updateSyncDash(){if(0===processed){$progressBar.css({width:"1%"})}else{var width=parseInt(processed)/parseInt(toProcess)*100;$progressBar.css({width:width+"%"})}if("initialsync"===syncStatus){var text=epDash.sync_initial;$syncStatusText.text(text);$syncStatusText.show();$progressBar.show();$pauseSyncButton.show();$errorOverlay.addClass("syncing");$cancelSyncButton.hide();$resumeSyncButton.hide();$startSyncButton.hide()}else if("sync"===syncStatus){var text=epDash.sync_syncing+" "+parseInt(processed)+"/"+parseInt(toProcess);if(currentSite){text+=" ("+currentSite.url+")"}$syncStatusText.text(text);$syncStatusText.show();$progressBar.show();$pauseSyncButton.show();$errorOverlay.addClass("syncing");$cancelSyncButton.hide();$resumeSyncButton.hide();$startSyncButton.hide()}else if("pause"===syncStatus){var text=epDash.sync_paused;if(toProcess&&0!==toProcess){text+=" "+parseInt(processed)+"/"+parseInt(toProcess)}if(currentSite){text+=" ("+currentSite.url+")"}$syncStatusText.text(text);$syncStatusText.show();$progressBar.show();$pauseSyncButton.hide();$errorOverlay.addClass("syncing");$cancelSyncButton.show();$resumeSyncButton.show();$startSyncButton.hide()}else if("wpcli"===syncStatus){var text=epDash.sync_wpcli;$syncStatusText.text(text);$syncStatusText.show();$progressBar.hide();$pauseSyncButton.hide();$errorOverlay.addClass("syncing");$cancelSyncButton.hide();$resumeSyncButton.hide();$startSyncButton.hide()}else if("error"===syncStatus){$syncStatusText.text(epDash.sync_error);$syncStatusText.show();$startSyncButton.show();$cancelSyncButton.hide();$resumeSyncButton.hide();$pauseSyncButton.hide();$errorOverlay.removeClass("syncing");$progressBar.hide();if(featureSync){var $feature=$features.find(".ep-feature-"+featureSync);$feature.removeClass("feature-syncing")}featureSync=null;setTimeout(function(){$syncStatusText.hide()},7e3)}else if("cancel"===syncStatus){$syncStatusText.hide();$progressBar.hide();$pauseSyncButton.hide();$errorOverlay.removeClass("syncing");$cancelSyncButton.hide();$resumeSyncButton.hide();$startSyncButton.show();if(featureSync){var $feature=$features.find(".ep-feature-"+featureSync);$feature.removeClass("feature-syncing")}featureSync=null}else if("finished"===syncStatus){$syncStatusText.text(epDash.sync_complete);$syncStatusText.show();$progressBar.hide();$pauseSyncButton.hide();$cancelSyncButton.hide();$resumeSyncButton.hide();$startSyncButton.show();$errorOverlay.removeClass("syncing");if(featureSync){var $feature=$features.find(".ep-feature-"+featureSync);$feature.removeClass("feature-syncing")}featureSync=null;setTimeout(function(){$syncStatusText.hide()},7e3)}}function cancelSync(){$.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function sync(){$.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:featureSync,nonce:epDash.nonce}}).done(function(response){if("sync"!==syncStatus){return}toProcess=response.data.found_posts;processed=response.data.offset;if(response.data.site_stack){siteStack=response.data.site_stack}if(response.data.current_site){currentSite=response.data.current_site}if(siteStack&&siteStack.length){syncStatus="sync";updateSyncDash();sync();return}if(0===response.data.found_posts&&!response.data.start){syncStatus="finished";updateSyncDash()}else{syncStatus="sync";updateSyncDash();sync()}}).error(function(response){if(response&&response.status&&parseInt(response.status)>=400&&parseInt(response.status)<600){syncStatus="error";updateSyncDash();cancelSync()}})}$startSyncButton.on("click",function(){syncStatus="initialsync";updateSyncDash();$('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove();syncStatus="sync";sync()});$pauseSyncButton.on("click",function(){syncStatus="pause";updateSyncDash()});$resumeSyncButton.on("click",function(){syncStatus="sync";updateSyncDash();sync()});$cancelSyncButton.on("click",function(){syncStatus="cancel";updateSyncDash();cancelSync()})})(jQuery); \ No newline at end of file diff --git a/assets/js/src/dashboard.js b/assets/js/src/dashboard.js index 28a37f6e22..07238afbcc 100644 --- a/assets/js/src/dashboard.js +++ b/assets/js/src/dashboard.js @@ -45,6 +45,8 @@ if ( $( this ).attr( 'checked' ) ) { settings[ name ] = value; } + } else { + settings[ name ] = value; } }); diff --git a/classes/class-ep-feature.php b/classes/class-ep-feature.php index 8b1f6f9553..9565450068 100644 --- a/classes/class-ep-feature.php +++ b/classes/class-ep-feature.php @@ -298,6 +298,10 @@ public function output_settings_box() { return; } do_action( 'ep_feature_box_settings', $this->slug, $this ); + /** + * @since 2.4 + */ + do_action( "ep_feature_box_settings_{$this->slug}", $this ); ?>
diff --git a/features/search/search.php b/features/search/search.php index 68f250f710..5836dd3eb8 100644 --- a/features/search/search.php +++ b/features/search/search.php @@ -37,6 +37,7 @@ function ep_search_feature_box_long() { */ function ep_delay_search_setup() { add_action( 'init', 'ep_search_setup' ); + add_action( 'ep_feature_box_settings_search', 'ep_integrate_search_box_settings', 10, 1 ); } /** @@ -68,6 +69,7 @@ function ep_search_setup() { add_filter( 'ep_formatted_args', 'ep_weight_recent', 10, 2 ); add_filter( 'ep_query_post_type', 'ep_filter_query_post_type_for_search', 10, 2 ); add_action( 'pre_get_posts', 'ep_improve_default_search', 10, 1 ); + } /** @@ -160,22 +162,35 @@ function ep_get_searchable_post_types() { */ function ep_weight_recent( $formatted_args, $args ) { if ( ! empty( $args['s'] ) ) { - $date_score = array( - 'function_score' => array( - 'query' => $formatted_args['query'], - 'exp' => array( - 'post_date_gmt' => array( - 'scale' => apply_filters( 'epwr_scale', '14d', $formatted_args, $args ), - 'decay' => apply_filters( 'epwr_decay', .25, $formatted_args, $args ), - 'offset' => apply_filters( 'epwr_offset', '7d', $formatted_args, $args ), + $feature = ep_get_registered_feature( 'search' ); + if ( $feature ) { + $settings = $feature->get_settings(); + } + + $settings = wp_parse_args( $settings, array( + 'decaying_enabled' => true, + 'decaying_decay' => 0.25, + 'decaying_scale' => 14, + 'decaying_offset' => 7, + ) ); + if ( (bool)$settings['decaying_enabled'] ) { + $date_score = array( + 'function_score' => array( + 'query' => $formatted_args['query'], + 'exp' => array( + 'post_date_gmt' => array( + 'scale' => apply_filters( 'epwr_scale', sprintf( '%dd', (int) $settings['decaying_scale'] ), $formatted_args, $args ), + 'decay' => apply_filters( 'epwr_decay', sprintf( '%f', (float) $settings['decaying_decay'] ), $formatted_args, $args ), + 'offset' => apply_filters( 'epwr_offset', sprintf( '%dd', (int) $settings['decaying_offset'] ), $formatted_args, $args ), + ), ), + 'score_mode' => 'avg', + 'boost_mode' => 'sum' ), - 'score_mode' => 'avg', - 'boost_mode' => 'sum' - ), - ); + ); - $formatted_args['query'] = $date_score; + $formatted_args['query'] = $date_score; + } } return $formatted_args; @@ -244,6 +259,48 @@ function ep_integrate_search_queries( $enabled, $query ) { return $enabled; } +function ep_integrate_search_box_settings( $feature ) { + $decaying_settings = $feature->get_settings(); + if ( ! $decaying_settings ) { + $decaying_settings = []; + } + $decaying_settings = wp_parse_args( $decaying_settings, $feature->default_settings ); + ?> +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+ 'ep_search_feature_box_summary', 'feature_box_long_cb' => 'ep_search_feature_box_long', 'requires_install_reindex' => false, + 'default_settings' => array( + 'decaying_enabled' => true, + 'decaying_decay' => 0.25, + 'decaying_scale' => 14, + 'decaying_offset' => 7, + ), ) ); From 82302a21d628698c59a3741e62c9e53c0c2dec8d Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Fri, 12 May 2017 15:32:42 +0200 Subject: [PATCH 04/96] Code format and docblocks --- features/search/search.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/features/search/search.php b/features/search/search.php index 5836dd3eb8..3dc5de142f 100644 --- a/features/search/search.php +++ b/features/search/search.php @@ -69,7 +69,6 @@ function ep_search_setup() { add_filter( 'ep_formatted_args', 'ep_weight_recent', 10, 2 ); add_filter( 'ep_query_post_type', 'ep_filter_query_post_type_for_search', 10, 2 ); add_action( 'pre_get_posts', 'ep_improve_default_search', 10, 1 ); - } /** @@ -162,7 +161,8 @@ function ep_get_searchable_post_types() { */ function ep_weight_recent( $formatted_args, $args ) { if ( ! empty( $args['s'] ) ) { - $feature = ep_get_registered_feature( 'search' ); + $feature = ep_get_registered_feature( 'search' ); + $settings = array(); if ( $feature ) { $settings = $feature->get_settings(); } @@ -259,10 +259,19 @@ function ep_integrate_search_queries( $enabled, $query ) { return $enabled; } +/** + * Display decaying settings on dashboard. + * + * @since 2.4 + * + * @param EP_Feature $feature Feature object. + * + * @return void + */ function ep_integrate_search_box_settings( $feature ) { $decaying_settings = $feature->get_settings(); if ( ! $decaying_settings ) { - $decaying_settings = []; + $decaying_settings = array(); } $decaying_settings = wp_parse_args( $decaying_settings, $feature->default_settings ); ?> From 8d3261a78da53fbcde275828b3698261376ec087 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Fri, 12 May 2017 17:48:40 +0200 Subject: [PATCH 05/96] Added tests --- tests/test-decaying-configuration.php | 149 ++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 tests/test-decaying-configuration.php diff --git a/tests/test-decaying-configuration.php b/tests/test-decaying-configuration.php new file mode 100644 index 0000000000..97b64d6624 --- /dev/null +++ b/tests/test-decaying-configuration.php @@ -0,0 +1,149 @@ +suppress_errors(); + + $admin_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); + + wp_set_current_user( $admin_id ); + + ep_delete_index(); + ep_put_mapping(); + + EP_WP_Query_Integration::factory()->setup(); + EP_Sync_Manager::factory()->setup(); + EP_Sync_Manager::factory()->sync_post_queue = array(); + + $this->setup_test_post_type(); + + /** + * Most of our search test are bundled into core tests for legacy reasons + */ + ep_activate_feature( 'search' ); + EP_Features::factory()->setup_features(); + + // Need to call this since it's hooked to init + ep_search_setup(); + } + + /** + * Clean up after each test. Reset our mocks + * + * @since 2.2 + */ + public function tearDown() { + parent::tearDown(); + + //make sure no one attached to this + remove_filter( 'ep_sync_terms_allow_hierarchy', array( $this, 'ep_allow_multiple_level_terms_sync' ), 100 ); + $this->fired_actions = array(); + } + + /** + * Test if decaying is enabled. + * + * @since 2.4 + */ + public function testDecayingEnabled() { + delete_site_option( 'ep_feature_requirement_statuses' ); + delete_site_option( 'ep_feature_settings' ); + + EP_Features::factory()->handle_feature_activation(); + EP_Features::factory()->setup_features(); + + ep_update_feature( 'search', array( + 'active' => true, + 'decaying_enabled' => true, + 'decaying_decay' => 0.55, + 'decaying_scale' => 22, + 'decaying_offset' => 9, + ) ); + + ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); + ep_refresh_index(); + + add_filter( 'ep_formatted_args', array( $this, 'catch_ep_formatted_args' ) ); + $query = new WP_Query( array( + 's' => 'test', + ) ); + $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); + $this->assertTrue( isset( + $this->fired_actions['ep_formatted_args']['query'], + $this->fired_actions['ep_formatted_args']['query']['function_score'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] + ) ); + $this->assertEquals( '22d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'] ); + $this->assertEquals( '9d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] ); + $this->assertEquals( 0.55, (float)$this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'] ); + } + + /** + * Test if decaying is disabled. + * + * @since 2.4 + */ + public function testDecayingDisabled() { + delete_site_option( 'ep_feature_requirement_statuses' ); + delete_site_option( 'ep_feature_settings' ); + + EP_Features::factory()->handle_feature_activation(); + EP_Features::factory()->setup_features(); + + ep_update_feature( 'search', array( + 'active' => true, + 'decaying_enabled' => false, + 'decaying_decay' => 0.55, + 'decaying_scale' => 22, + 'decaying_offset' => 9, + ) ); + + ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); + ep_refresh_index(); + + add_filter( 'ep_formatted_args', array( $this, 'catch_ep_formatted_args' ) ); + $query = new WP_Query( array( + 's' => 'test', + ) ); + $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); + $this->assertTrue( ! isset( + $this->fired_actions['ep_formatted_args']['query']['function_score'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] + ) ); + $this->assertTrue( isset( + $this->fired_actions['ep_formatted_args']['query']['bool'], + $this->fired_actions['ep_formatted_args']['query']['bool']['should'] + ) ); + } + + /** + * Catch ES query args. + * + * @param array $args ES query args. + */ + public function catch_ep_formatted_args( $args ) { + $this->fired_actions['ep_formatted_args'] = $args; + } +} From 3b252e7a5b4a8babcd474ad7827c5acf016ab773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Tue, 23 May 2017 12:42:06 +0200 Subject: [PATCH 06/96] Use old style array --- classes/class-ep-api.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 7e27061c59..91c18ba8c6 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -1510,20 +1510,20 @@ public function format_args( $args ) { if ( isset( $args['fields'] ) ) { switch ( $args['fields'] ) { case 'ids': - $formatted_args['_source'] = [ - 'include' => [ + $formatted_args['_source'] = array( + 'include' => array( 'post_id', - ], - ]; + ), + ); break; case 'id=>parent': - $formatted_args['_source'] = [ - 'include' => [ + $formatted_args['_source'] = array( + 'include' => array( 'post_id', 'post_parent', - ], - ]; + ), + ); break; } } From 713541f3f61fa2a320b0fb43687a6c893b92888a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Tue, 23 May 2017 12:43:54 +0200 Subject: [PATCH 07/96] Yoda comparison --- classes/class-ep-wp-query-integration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index 276c142780..444a19cdc3 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -214,7 +214,7 @@ public function posts_fields( $posts, $query ) { // Determine how we should return the posts. The official WP_Query // supports: ids, id=>parent and post objects. $fields = $query->get( 'fields', '' ); - if ( $fields === 'ids' || $fields === 'id=>parent' ) { + if ( 'ids' === $fields || 'id=>parent' === $fields ) { return $this->posts_by_query[ spl_object_hash( $query ) ]; } else { return $posts; From b24799047511b2c9c84d917a65a00e7f88ecfba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Tue, 23 May 2017 12:44:25 +0200 Subject: [PATCH 08/96] Strip else --- classes/class-ep-wp-query-integration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index 444a19cdc3..a48c1eab30 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -216,9 +216,9 @@ public function posts_fields( $posts, $query ) { $fields = $query->get( 'fields', '' ); if ( 'ids' === $fields || 'id=>parent' === $fields ) { return $this->posts_by_query[ spl_object_hash( $query ) ]; - } else { - return $posts; } + + return $posts; } /** From 695a05c279db7105991ea80e93154eabb1675156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Tue, 23 May 2017 12:45:29 +0200 Subject: [PATCH 09/96] Use switch --- classes/class-ep-wp-query-integration.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index a48c1eab30..67e5fbf193 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -302,14 +302,18 @@ public function filter_posts_request( $request, $query ) { // Determine how we should format the results from ES based on the fields // parameter. $fields = $query->get( 'fields', '' ); - if ( $fields === 'ids' ) { - $new_posts = $this->format_hits_as_ids( $ep_query['posts'], $new_posts ); - } - elseif ( $fields === 'id=>parent' ) { - $new_posts = $this->format_hits_as_id_parents( $ep_query['posts'], $new_posts ); - } - else { - $new_posts = $this->format_hits_as_posts( $ep_query['posts'], $new_posts ); + switch ( $fields ) { + case 'ids' : + $new_posts = $this->format_hits_as_ids( $ep_query['posts'], $new_posts ); + break; + + case 'id=>parent' : + $new_posts = $this->format_hits_as_id_parents( $ep_query['posts'], $new_posts ); + break; + + default: + $new_posts = $this->format_hits_as_posts( $ep_query['posts'], $new_posts ); + break; } do_action( 'ep_wp_query_non_cached_search', $new_posts, $ep_query, $query ); From de94f63af64681ba7b7d2d23a8de92387844600b Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Wed, 7 Jun 2017 10:44:14 +0200 Subject: [PATCH 10/96] Remove decaying settings --- features/search/search.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/features/search/search.php b/features/search/search.php index 45c95bad0d..f21418c233 100644 --- a/features/search/search.php +++ b/features/search/search.php @@ -279,31 +279,6 @@ function ep_integrate_search_box_settings( $feature ) {
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
false, 'default_settings' => array( 'decaying_enabled' => true, - 'decaying_decay' => 0.25, - 'decaying_scale' => 14, - 'decaying_offset' => 7, ), ) ); From 15ba9ce533f9a0052e0ea8ea61834a10922ef459 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Wed, 7 Jun 2017 10:47:48 +0200 Subject: [PATCH 11/96] Adapted tests. --- tests/test-decaying-configuration.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test-decaying-configuration.php b/tests/test-decaying-configuration.php index 97b64d6624..c9ae62e5d6 100644 --- a/tests/test-decaying-configuration.php +++ b/tests/test-decaying-configuration.php @@ -69,9 +69,6 @@ public function testDecayingEnabled() { ep_update_feature( 'search', array( 'active' => true, 'decaying_enabled' => true, - 'decaying_decay' => 0.55, - 'decaying_scale' => 22, - 'decaying_offset' => 9, ) ); ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); @@ -91,9 +88,9 @@ public function testDecayingEnabled() { $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] ) ); - $this->assertEquals( '22d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'] ); - $this->assertEquals( '9d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] ); - $this->assertEquals( 0.55, (float)$this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'] ); + $this->assertEquals( '14d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'] ); + $this->assertEquals( '7d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] ); + $this->assertEquals( 0.25, (float)$this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'] ); } /** @@ -111,9 +108,6 @@ public function testDecayingDisabled() { ep_update_feature( 'search', array( 'active' => true, 'decaying_enabled' => false, - 'decaying_decay' => 0.55, - 'decaying_scale' => 22, - 'decaying_offset' => 9, ) ); ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); From 1533c13702977b1dfc6ad044f7f10f150a96141d Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Wed, 7 Jun 2017 10:49:18 +0200 Subject: [PATCH 12/96] Use original minified dashboard js --- assets/js/dashboard.min.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/dashboard.min.js b/assets/js/dashboard.min.js index 31e45d6ad2..bff59ce980 100644 --- a/assets/js/dashboard.min.js +++ b/assets/js/dashboard.min.js @@ -1 +1,2 @@ !function(a){function b(){if(0===q)i.css({width:"1%"});else{var a=parseInt(q)/parseInt(r)*100;i.css({width:a+"%"})}if("initialsync"===o){var b=epDash.sync_initial;j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("sync"===o){var b=epDash.sync_syncing+" "+parseInt(q)+"/"+parseInt(r);e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("pause"===o){var b=epDash.sync_paused;r&&0!==r&&(b+=" "+parseInt(q)+"/"+parseInt(r)),e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.hide(),h.addClass("syncing"),n.show(),l.show(),k.hide()}else if("wpcli"===o){var b=epDash.sync_wpcli;j.text(b),j.show(),i.hide(),m.hide(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("error"===o){if(j.text(epDash.sync_error),j.show(),k.show(),n.hide(),l.hide(),m.hide(),h.removeClass("syncing"),i.hide(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}else if("cancel"===o){if(j.hide(),i.hide(),m.hide(),h.removeClass("syncing"),n.hide(),l.hide(),k.show(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null}else if("finished"===o){if(j.text(epDash.sync_complete),j.show(),i.hide(),m.hide(),n.hide(),l.hide(),k.show(),h.removeClass("syncing"),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}}function c(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function d(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:p,nonce:epDash.nonce}}).done(function(a){if("sync"===o){if(r=a.data.found_posts,q=a.data.offset,a.data.site_stack&&(f=a.data.site_stack),a.data.current_site&&(e=a.data.current_site),f&&f.length)return o="sync",b(),void d();0!==a.data.found_posts||a.data.start?(o="sync",b(),d()):(o="finished",b())}}).error(function(a){a&&a.status&&parseInt(a.status)>=400&&parseInt(a.status)<600&&(o="error",b(),c())})}var e,f,g=a(document.getElementsByClassName("ep-features")),h=a(document.getElementsByClassName("error-overlay")),i=a(document.getElementsByClassName("progress-bar")),j=a(document.getElementsByClassName("sync-status")),k=a(document.getElementsByClassName("start-sync")),l=a(document.getElementsByClassName("resume-sync")),m=a(document.getElementsByClassName("pause-sync")),n=a(document.getElementsByClassName("cancel-sync")),o="sync",p=!1,q=0,r=0;g.on("click",".learn-more, .collapse",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-full")}),g.on("click",".settings-button",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-settings")}),g.on("click",".save-settings",function(c){if(c.preventDefault(),!a(this).hasClass("disabled")){var e=c.target.getAttribute("data-feature"),f=g.find(".ep-feature-"+e),h={};f.find(".setting-field").each(function(){var b=a(this).attr("type"),c=a(this).attr("data-field-name"),d=a(this).attr("value");"radio"===b&&a(this).attr("checked")&&(h[c]=d)}),f.addClass("saving"),a.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:e,nonce:epDash.nonce,settings:h}}).done(function(c){setTimeout(function(){f.removeClass("saving"),"1"===h.active?f.addClass("feature-active"):f.removeClass("feature-active"),c.data.reindex&&(o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",f.addClass("feature-syncing"),p=e,d())},700)}).error(function(){setTimeout(function(){f.removeClass("saving"),f.removeClass("feature-active"),f.removeClass("feature-syncing")},700)})}}),epDash.index_meta?epDash.index_meta.wpcli_sync?(o="wpcli",b()):(q=epDash.index_meta.offset,r=epDash.index_meta.found_posts,epDash.index_meta.feature_sync&&(p=epDash.index_meta.feature_sync),epDash.index_meta.current_site&&(e=epDash.index_meta.current_site),epDash.index_meta.site_stack&&(f=epDash.index_meta.site_stack),f&&f.length?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):0!==r||epDash.index_meta.start?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):(o="finished",b())):epDash.auto_start_index&&(o="initialsync",b(),o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),d()),k.on("click",function(){o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",d()}),m.on("click",function(){o="pause",b()}),l.on("click",function(){o="sync",b(),d()}),n.on("click",function(){o="cancel",b(),c()})}(jQuery); + From b33cc88676504e012139530c6c0671f3e9220756 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Wed, 7 Jun 2017 10:53:19 +0200 Subject: [PATCH 13/96] Rebuilt dashboard.min.js --- assets/js/dashboard.min.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/dashboard.min.js b/assets/js/dashboard.min.js index bff59ce980..b28b709ed1 100644 --- a/assets/js/dashboard.min.js +++ b/assets/js/dashboard.min.js @@ -1,2 +1 @@ -!function(a){function b(){if(0===q)i.css({width:"1%"});else{var a=parseInt(q)/parseInt(r)*100;i.css({width:a+"%"})}if("initialsync"===o){var b=epDash.sync_initial;j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("sync"===o){var b=epDash.sync_syncing+" "+parseInt(q)+"/"+parseInt(r);e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("pause"===o){var b=epDash.sync_paused;r&&0!==r&&(b+=" "+parseInt(q)+"/"+parseInt(r)),e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.hide(),h.addClass("syncing"),n.show(),l.show(),k.hide()}else if("wpcli"===o){var b=epDash.sync_wpcli;j.text(b),j.show(),i.hide(),m.hide(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("error"===o){if(j.text(epDash.sync_error),j.show(),k.show(),n.hide(),l.hide(),m.hide(),h.removeClass("syncing"),i.hide(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}else if("cancel"===o){if(j.hide(),i.hide(),m.hide(),h.removeClass("syncing"),n.hide(),l.hide(),k.show(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null}else if("finished"===o){if(j.text(epDash.sync_complete),j.show(),i.hide(),m.hide(),n.hide(),l.hide(),k.show(),h.removeClass("syncing"),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}}function c(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function d(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:p,nonce:epDash.nonce}}).done(function(a){if("sync"===o){if(r=a.data.found_posts,q=a.data.offset,a.data.site_stack&&(f=a.data.site_stack),a.data.current_site&&(e=a.data.current_site),f&&f.length)return o="sync",b(),void d();0!==a.data.found_posts||a.data.start?(o="sync",b(),d()):(o="finished",b())}}).error(function(a){a&&a.status&&parseInt(a.status)>=400&&parseInt(a.status)<600&&(o="error",b(),c())})}var e,f,g=a(document.getElementsByClassName("ep-features")),h=a(document.getElementsByClassName("error-overlay")),i=a(document.getElementsByClassName("progress-bar")),j=a(document.getElementsByClassName("sync-status")),k=a(document.getElementsByClassName("start-sync")),l=a(document.getElementsByClassName("resume-sync")),m=a(document.getElementsByClassName("pause-sync")),n=a(document.getElementsByClassName("cancel-sync")),o="sync",p=!1,q=0,r=0;g.on("click",".learn-more, .collapse",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-full")}),g.on("click",".settings-button",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-settings")}),g.on("click",".save-settings",function(c){if(c.preventDefault(),!a(this).hasClass("disabled")){var e=c.target.getAttribute("data-feature"),f=g.find(".ep-feature-"+e),h={};f.find(".setting-field").each(function(){var b=a(this).attr("type"),c=a(this).attr("data-field-name"),d=a(this).attr("value");"radio"===b&&a(this).attr("checked")&&(h[c]=d)}),f.addClass("saving"),a.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:e,nonce:epDash.nonce,settings:h}}).done(function(c){setTimeout(function(){f.removeClass("saving"),"1"===h.active?f.addClass("feature-active"):f.removeClass("feature-active"),c.data.reindex&&(o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",f.addClass("feature-syncing"),p=e,d())},700)}).error(function(){setTimeout(function(){f.removeClass("saving"),f.removeClass("feature-active"),f.removeClass("feature-syncing")},700)})}}),epDash.index_meta?epDash.index_meta.wpcli_sync?(o="wpcli",b()):(q=epDash.index_meta.offset,r=epDash.index_meta.found_posts,epDash.index_meta.feature_sync&&(p=epDash.index_meta.feature_sync),epDash.index_meta.current_site&&(e=epDash.index_meta.current_site),epDash.index_meta.site_stack&&(f=epDash.index_meta.site_stack),f&&f.length?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):0!==r||epDash.index_meta.start?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):(o="finished",b())):epDash.auto_start_index&&(o="initialsync",b(),o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),d()),k.on("click",function(){o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",d()}),m.on("click",function(){o="pause",b()}),l.on("click",function(){o="sync",b(),d()}),n.on("click",function(){o="cancel",b(),c()})}(jQuery); - +!function(a){function b(){if(0===q)i.css({width:"1%"});else{var a=parseInt(q)/parseInt(r)*100;i.css({width:a+"%"})}if("initialsync"===o){var b=epDash.sync_initial;j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("sync"===o){var b=epDash.sync_syncing+" "+parseInt(q)+"/"+parseInt(r);e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("pause"===o){var b=epDash.sync_paused;r&&0!==r&&(b+=" "+parseInt(q)+"/"+parseInt(r)),e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.hide(),h.addClass("syncing"),n.show(),l.show(),k.hide()}else if("wpcli"===o){var b=epDash.sync_wpcli;j.text(b),j.show(),i.hide(),m.hide(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("error"===o){if(j.text(epDash.sync_error),j.show(),k.show(),n.hide(),l.hide(),m.hide(),h.removeClass("syncing"),i.hide(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}else if("cancel"===o){if(j.hide(),i.hide(),m.hide(),h.removeClass("syncing"),n.hide(),l.hide(),k.show(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null}else if("finished"===o){if(j.text(epDash.sync_complete),j.show(),i.hide(),m.hide(),n.hide(),l.hide(),k.show(),h.removeClass("syncing"),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}}function c(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function d(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:p,nonce:epDash.nonce}}).done(function(a){if("sync"===o){if(r=a.data.found_posts,q=a.data.offset,a.data.site_stack&&(f=a.data.site_stack),a.data.current_site&&(e=a.data.current_site),f&&f.length)return o="sync",b(),void d();0!==a.data.found_posts||a.data.start?(o="sync",b(),d()):(o="finished",b())}}).error(function(a){a&&a.status&&parseInt(a.status)>=400&&parseInt(a.status)<600&&(o="error",b(),c())})}var e,f,g=a(document.getElementsByClassName("ep-features")),h=a(document.getElementsByClassName("error-overlay")),i=a(document.getElementsByClassName("progress-bar")),j=a(document.getElementsByClassName("sync-status")),k=a(document.getElementsByClassName("start-sync")),l=a(document.getElementsByClassName("resume-sync")),m=a(document.getElementsByClassName("pause-sync")),n=a(document.getElementsByClassName("cancel-sync")),o="sync",p=!1,q=0,r=0;g.on("click",".learn-more, .collapse",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-full")}),g.on("click",".settings-button",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-settings")}),g.on("click",".save-settings",function(c){if(c.preventDefault(),!a(this).hasClass("disabled")){var e=c.target.getAttribute("data-feature"),f=g.find(".ep-feature-"+e),h={};f.find(".setting-field").each(function(){var b=a(this).attr("type"),c=a(this).attr("data-field-name"),d=a(this).attr("value");"radio"===b?a(this).attr("checked")&&(h[c]=d):h[c]=d}),f.addClass("saving"),a.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:e,nonce:epDash.nonce,settings:h}}).done(function(c){setTimeout(function(){f.removeClass("saving"),"1"===h.active?f.addClass("feature-active"):f.removeClass("feature-active"),c.data.reindex&&(o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",f.addClass("feature-syncing"),p=e,d())},700)}).error(function(){setTimeout(function(){f.removeClass("saving"),f.removeClass("feature-active"),f.removeClass("feature-syncing")},700)})}}),epDash.index_meta?epDash.index_meta.wpcli_sync?(o="wpcli",b()):(q=epDash.index_meta.offset,r=epDash.index_meta.found_posts,epDash.index_meta.feature_sync&&(p=epDash.index_meta.feature_sync),epDash.index_meta.current_site&&(e=epDash.index_meta.current_site),epDash.index_meta.site_stack&&(f=epDash.index_meta.site_stack),f&&f.length?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):0!==r||epDash.index_meta.start?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):(o="finished",b())):epDash.auto_start_index&&(o="initialsync",b(),o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),d()),k.on("click",function(){o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",d()}),m.on("click",function(){o="pause",b()}),l.on("click",function(){o="sync",b(),d()}),n.on("click",function(){o="cancel",b(),c()})}(jQuery); \ No newline at end of file From d28fbfb95904c4add791f61303724bed7ff4929f Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 19 Jun 2017 16:56:03 -0400 Subject: [PATCH 14/96] Remove post_meta key from post args; it was left for backward compat purposes --- classes/class-ep-api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 422947a88f..1abe8089ac 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -593,7 +593,7 @@ public function prepare_post( $post_id ) { 'post_mime_type' => $post->post_mime_type, 'permalink' => get_permalink( $post_id ), 'terms' => $this->prepare_terms( $post ), - 'post_meta' => $this->prepare_meta( $post ), + 'meta' => $this->prepare_meta_types( $this->prepare_meta( $post ) ), // post_meta removed in 2.4 'date_terms' => $this->prepare_date_terms( $post_date ), 'comment_count' => $comment_count, 'comment_status' => $comment_status, @@ -608,8 +608,6 @@ public function prepare_post( $post_id ) { */ $post_args = apply_filters( 'ep_post_sync_args', $post_args, $post_id ); - $post_args['meta'] = $this->prepare_meta_types( $post_args['post_meta'] ); - $post_args = apply_filters( 'ep_post_sync_args_post_prepare_meta', $post_args, $post_id ); // Turn back on updated_postmeta hook From 7061af9f6a24cea3710b7fc4e9c0e9bdcf434f69 Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Mon, 26 Jun 2017 10:01:55 +0700 Subject: [PATCH 15/96] properly unset author_name from the search fields, after translated to post_author.login --- classes/class-ep-api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 422947a88f..3088df0a63 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -1337,7 +1337,8 @@ public function format_args( $args ) { if ( in_array( 'author_name', $search_field_args ) ) { $search_fields[] = 'post_author.login'; - unset( $search_field_args['author_name'] ); + $author_name_index = array_search( 'author_name', $search_field_args ); + unset( $search_field_args[ $author_name_index ] ); } $search_fields = array_merge( $search_field_args, $search_fields ); From b2ffa2673271d6062225dba0bd2d3edb9918d165 Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Tue, 27 Jun 2017 22:53:59 +0700 Subject: [PATCH 16/96] properly unset meta and taxonomies from the search fields --- classes/class-ep-api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 3088df0a63..114984c8f9 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -1321,7 +1321,8 @@ public function format_args( $args ) { $search_fields[] = 'terms.' . $tax . '.name'; } - unset( $search_field_args['taxonomies'] ); + $taxonomies_index = array_search( 'taxonomies', $search_field_args ); + unset( $search_field_args[ $taxonomies_index ] ); } if ( ! empty( $search_field_args['meta'] ) ) { @@ -1331,7 +1332,8 @@ public function format_args( $args ) { $search_fields[] = 'meta.' . $meta . '.value'; } - unset( $search_field_args['meta'] ); + $meta_index = array_search( 'meta', $search_field_args ); + unset( $search_field_args[ $meta_index ] ); } if ( in_array( 'author_name', $search_field_args ) ) { From fc3f45b572289b9d3320499f498f2eaf242e5266 Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Wed, 5 Jul 2017 20:33:19 +0700 Subject: [PATCH 17/96] properlu unset search fields --- classes/class-ep-api.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 1309010864..f7386ebff0 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -1321,8 +1321,7 @@ public function format_args( $args ) { $search_fields[] = 'terms.' . $tax . '.name'; } - $taxonomies_index = array_search( 'taxonomies', $search_field_args ); - unset( $search_field_args[ $taxonomies_index ] ); + unset( $search_field_args['taxonomies'] ); } if ( ! empty( $search_field_args['meta'] ) ) { @@ -1332,8 +1331,7 @@ public function format_args( $args ) { $search_fields[] = 'meta.' . $meta . '.value'; } - $meta_index = array_search( 'meta', $search_field_args ); - unset( $search_field_args[ $meta_index ] ); + unset( $search_field_args['meta'] ); } if ( in_array( 'author_name', $search_field_args ) ) { From 4999d1dd609f065f22779f3d927f1603ceb7271d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Thu, 6 Jul 2017 14:30:34 +0200 Subject: [PATCH 18/96] Added check for WP version for fields support --- features/search/search.php | 11 +++++++++++ features/woocommerce/woocommerce.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/features/search/search.php b/features/search/search.php index 139d2180d7..f02a354cac 100644 --- a/features/search/search.php +++ b/features/search/search.php @@ -233,6 +233,17 @@ function ep_integrate_search_queries( $enabled, $query ) { $enabled = false; } else if ( method_exists( $query, 'is_search' ) && $query->is_search() && ! empty( $query->query_vars['s'] ) ) { $enabled = true; + + /** + * WordPress have to be version 4.6 or newer to have "fields" support + * since it requires the "posts_pre_query" filter. + * + * @see WP_Query::get_posts + */ + $fields = $query->get( 'fields' ); + if ( ! version_compare( get_bloginfo( 'version' ), '4.6', '>=' ) && ! empty( $fields ) ) { + $enabled = false; + } } return $enabled; diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 0a13597ab4..773cd283e6 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -311,6 +311,17 @@ function ep_wc_translate_args( $query ) { $query->set( 'meta_key', '_wc_average_rating' ); } + /** + * WordPress have to be version 4.6 or newer to have "fields" support + * since it requires the "posts_pre_query" filter. + * + * @see WP_Query::get_posts + */ + $fields = $query->get( 'fields', false ); + if ( ! version_compare( get_bloginfo( 'version' ), '4.6', '>=' ) && ( 'ids' === $fields || 'id=>parent' === $fields ) ) { + $query->set( 'fields', 'default' ); + } + /** * Handle meta queries */ From 038645841b77db37f71ba936854a2af8474dadba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Thu, 6 Jul 2017 14:32:27 +0200 Subject: [PATCH 19/96] ElasticPress indicator for "id=>parent" results --- classes/class-ep-wp-query-integration.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index 67e5fbf193..90c1c86a72 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -424,6 +424,7 @@ protected function format_hits_as_id_parents( $posts, $new_posts ) { $post = new stdClass(); $post->ID = $post_array['post_id']; $post->post_parent = $post_array['post_parent']; + $post->elasticsearch = true; // Super useful for debugging $new_posts[] = $post; } return $new_posts; From 44d06b8bd4d6917fb920198f82b54e1440a76bcf Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Tue, 11 Jul 2017 21:21:21 +0700 Subject: [PATCH 20/96] add sanity checkout for the taxonomy in prepare_terms --- classes/class-ep-api.php | 4 ++++ features/woocommerce/woocommerce.php | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index f44e076746..0aed2f45a3 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -687,6 +687,10 @@ private function prepare_terms( $post ) { $allow_hierarchy = apply_filters( 'ep_sync_terms_allow_hierarchy', false ); foreach ( $selected_taxonomies as $taxonomy ) { + if( ! is_a( $taxonomy, 'WP_Taxonomy' ) ){ + continue; + } + $object_terms = get_the_terms( $post->ID, $taxonomy->name ); if ( ! $object_terms || is_wp_error( $object_terms ) ) { diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 3e7e517b5e..b5bdacf234 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -133,10 +133,17 @@ function ep_wc_convert_post_object_to_id( $posts ) { * @return array */ function ep_wc_whitelist_taxonomies( $taxonomies, $post ) { + $woo_taxonomies = array(); + $product_type = get_taxonomy( 'product_type' ); - $product_visibility = get_taxonomy( 'product_visibility' ); + if( false !== $product_type ){ + $woo_taxonomies[] = $product_type; + } - $woo_taxonomies = array( $product_type, $product_visibility ); + $product_visibility = get_taxonomy( 'product_visibility' ); + if( false !== $product_visibility ){ + $woo_taxonomies[] = $product_visibility; + } /** * Note product_shipping_class, product_cat, and product_tag are already public. Make @@ -152,7 +159,7 @@ function ep_wc_whitelist_taxonomies( $taxonomies, $post ) { } } - return array_merge( $taxonomies, $woo_taxonomies ); + return array_merge( $taxonomies, $woo_taxonomies, array( false ) ); } /** From 5d419fcce2dc0f7522578f9d5e04e30dd08b7ef6 Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Tue, 11 Jul 2017 21:27:30 +0700 Subject: [PATCH 21/96] remove typo --- features/woocommerce/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index b5bdacf234..becc4f1d51 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -159,7 +159,7 @@ function ep_wc_whitelist_taxonomies( $taxonomies, $post ) { } } - return array_merge( $taxonomies, $woo_taxonomies, array( false ) ); + return array_merge( $taxonomies, $woo_taxonomies ); } /** From 5c405444673f9efe7623f3c9efdd7941362f6145 Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Tue, 11 Jul 2017 22:13:01 +0700 Subject: [PATCH 22/96] moved setup_feature on init --- classes/class-ep-features.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class-ep-features.php b/classes/class-ep-features.php index 2eb51af15b..ca8fe99f0c 100644 --- a/classes/class-ep-features.php +++ b/classes/class-ep-features.php @@ -27,7 +27,7 @@ class EP_Features { */ public function setup() { add_action( 'plugins_loaded', array( $this, 'handle_feature_activation' ), 12 ); - add_action( 'plugins_loaded', array( $this, 'setup_features' ), 11 ); + add_action( 'init', array( $this, 'setup_features' ), 0 ); } /** From bf797e543fc58dc79497270f82b075b51277305d Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Tue, 11 Jul 2017 10:31:38 -0600 Subject: [PATCH 23/96] Update to travis YAML to install Java 8. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index c7daa9d3ef..6f51fa2e0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ language: php +addons: + apt: + packages: + - oracle-java8-set-default + notifications: email: on_success: never From c6f9c0769384ea65f697922324272a8e15e7b381 Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Tue, 11 Jul 2017 10:38:14 -0600 Subject: [PATCH 24/96] Update to travis YAML that removes elasticsearch as service. --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6f51fa2e0e..3b4e2edcbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,6 @@ php: env: - WP_VERSION=latest WP_MULTISITE=1 -services: - - elasticsearch - before_install: - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.deb && sudo dpkg -i --force-confnew elasticsearch-5.2.2.deb && sudo service elasticsearch restart From f10646aa32ea89b013c47c533b3b043432b7b7c9 Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Tue, 11 Jul 2017 10:54:34 -0600 Subject: [PATCH 25/96] Removing composer.lock. --- composer.lock | 2537 ------------------------------------------------- 1 file changed, 2537 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index c4d29b4ec0..0000000000 --- a/composer.lock +++ /dev/null @@ -1,2537 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "cddfe9d6a35a7fd274871696c0c65143", - "packages": [], - "packages-dev": [ - { - "name": "composer/ca-bundle", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "a795611394b3c05164fd0eb291b492b39339cba4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/a795611394b3c05164fd0eb291b492b39339cba4", - "reference": "a795611394b3c05164fd0eb291b492b39339cba4", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0" - }, - "suggest": { - "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "time": "2016-11-02T18:11:27+00:00" - }, - { - "name": "composer/composer", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "e53f9e5381e70f76e098136343e27d92601eade7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/e53f9e5381e70f76e098136343e27d92601eade7", - "reference": "e53f9e5381e70f76e098136343e27d92601eade7", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.0", - "justinrainbow/json-schema": "^1.6 || ^2.0 || ^3.0 || ^4.0", - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0", - "seld/cli-prompt": "^1.0", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0", - "symfony/filesystem": "^2.7 || ^3.0", - "symfony/finder": "^2.7 || ^3.0", - "symfony/process": "^2.7 || ^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "time": "2016-12-23T23:47:04+00:00" - }, - { - "name": "composer/installers", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "d78064c68299743e0161004f2de3a0204e33b804" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804", - "reference": "d78064c68299743e0161004f2de3a0204e33b804", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Installers\\": "src/Composer/Installers" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "https://composer.github.io/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Hurad", - "ImageCMS", - "MODX Evo", - "Mautic", - "OXID", - "Plentymarkets", - "RadPHP", - "SMF", - "Thelia", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "attogram", - "bitrix", - "cakephp", - "chef", - "cockpit", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "elgg", - "expressionengine", - "fuelphp", - "grav", - "installer", - "joomla", - "kohana", - "laravel", - "lithium", - "magento", - "mako", - "mediawiki", - "modulework", - "moodle", - "phpbb", - "piwik", - "ppi", - "puppet", - "reindex", - "roundcube", - "shopware", - "silverstripe", - "symfony", - "typo3", - "wordpress", - "yawik", - "zend", - "zikula" - ], - "time": "2016-08-13T20:53:52+00:00" - }, - { - "name": "composer/semver", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "time": "2016-08-30T16:08:34+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.1.5", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "96c6a07b05b716e89a44529d060bc7f5c263cb13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/96c6a07b05b716e89a44529d060bc7f5c263cb13", - "reference": "96c6a07b05b716e89a44529d060bc7f5c263cb13", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "time": "2016-09-28T07:17:45+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "d39c56a46b3ebe1f3696479966cd2b9f50aaa24f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d39c56a46b3ebe1f3696479966cd2b9f50aaa24f", - "reference": "d39c56a46b3ebe1f3696479966cd2b9f50aaa24f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "json-schema/json-schema-test-suite": "1.2.0", - "phpdocumentor/phpdocumentor": "~2", - "phpunit/phpunit": "^4.8.22" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2016-12-22T16:43:46+00:00" - }, - { - "name": "mustache/mustache", - "version": "v2.11.1", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "a3f6d55996dd28b58f3a909d474189a3c1aa693f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/a3f6d55996dd28b58f3a909d474189a3c1aa693f", - "reference": "a3f6d55996dd28b58f3a909d474189a3c1aa693f", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "phpunit/phpunit": "~3.7|~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Mustache": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "A Mustache implementation in PHP.", - "homepage": "https://github.com/bobthecow/mustache.php", - "keywords": [ - "mustache", - "templating" - ], - "time": "2016-07-31T06:18:27+00:00" - }, - { - "name": "mustangostang/spyc", - "version": "0.6.1", - "source": { - "type": "git", - "url": "https://github.com/mustangostang/spyc.git", - "reference": "022532641d61d383fd3ae666982bd46e61e5915e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mustangostang/spyc/zipball/022532641d61d383fd3ae666982bd46e61e5915e", - "reference": "022532641d61d383fd3ae666982bd46e61e5915e", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "4.3.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5.x-dev" - } - }, - "autoload": { - "files": [ - "Spyc.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "mustangostang", - "email": "vlad.andersen@gmail.com" - } - ], - "description": "A simple YAML loader/dumper class for PHP", - "homepage": "https://github.com/mustangostang/spyc/", - "keywords": [ - "spyc", - "yaml", - "yml" - ], - "time": "2016-10-21T00:03:34+00:00" - }, - { - "name": "nb/oxymel", - "version": "v0.1.0", - "source": { - "type": "git", - "url": "https://github.com/nb/oxymel.git", - "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nb/oxymel/zipball/cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", - "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "type": "library", - "autoload": { - "psr-0": { - "Oxymel": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nikolay Bachiyski", - "email": "nb@nikolay.bg", - "homepage": "http://extrapolate.me/" - } - ], - "description": "A sweet XML builder", - "homepage": "https://github.com/nb/oxymel", - "keywords": [ - "xml" - ], - "time": "2013-02-24T15:01:54+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03T12:10:50+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.6.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.0", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2016-11-21T14:58:47+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4|~5" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2016-05-12T18:03:57+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2016-11-15T14:06:22+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.31", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "98b2b39a520766bec663ff5b7ff1b729db9dbfe3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/98b2b39a520766bec663ff5b7ff1b729db9dbfe3", - "reference": "98b2b39a520766bec663ff5b7ff1b729db9dbfe3", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2016-12-09T02:45:31+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02T06:51:40+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "ramsey/array_column", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/ramsey/array_column.git", - "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/array_column/zipball/f8e52eb28e67eb50e613b451dd916abcf783c1db", - "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db", - "shasum": "" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "0.8.*", - "phpunit/phpunit": "~4.5", - "satooshi/php-coveralls": "0.6.*", - "squizlabs/php_codesniffer": "~2.2" - }, - "type": "library", - "autoload": { - "files": [ - "src/array_column.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Ramsey", - "homepage": "http://benramsey.com" - } - ], - "description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.", - "homepage": "https://github.com/ramsey/array_column", - "keywords": [ - "array", - "array_column", - "column" - ], - "time": "2015-03-20T22:07:39+00:00" - }, - { - "name": "rmccue/requests", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/rmccue/Requests.git", - "reference": "87932f52ffad70504d93f04f15690cf16a089546" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", - "reference": "87932f52ffad70504d93f04f15690cf16a089546", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "require-dev": { - "requests/test-server": "dev-master" - }, - "type": "library", - "autoload": { - "psr-0": { - "Requests": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Ryan McCue", - "homepage": "http://ryanmccue.info" - } - ], - "description": "A HTTP library written in PHP, for human beings.", - "homepage": "http://github.com/rmccue/Requests", - "keywords": [ - "curl", - "fsockopen", - "http", - "idna", - "ipv6", - "iri", - "sockets" - ], - "time": "2016-10-13T00:11:37+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2016-11-19T09:18:40+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-12-08T07:14:41+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-08-18T05:49:44+00:00" - }, - { - "name": "sebastian/exporter", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-06-17T09:04:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11T19:50:13+00:00" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "seld/cli-prompt", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/cli-prompt.git", - "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", - "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\CliPrompt\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", - "keywords": [ - "cli", - "console", - "hidden", - "input", - "prompt" - ], - "time": "2016-04-18T09:31:41+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "19495c181d6d53a0a13414154e52817e3b504189" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/19495c181d6d53a0a13414154e52817e3b504189", - "reference": "19495c181d6d53a0a13414154e52817e3b504189", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "time": "2016-11-14T17:59:58+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phra" - ], - "time": "2015-10-13T18:44:15+00:00" - }, - { - "name": "symfony/config", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "b522856007b258f46d5ee35d3b7b235c11e76e86" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/b522856007b258f46d5ee35d3b7b235c11e76e86", - "reference": "b522856007b258f46d5ee35d3b7b235c11e76e86", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" - }, - "require-dev": { - "symfony/yaml": "~2.7|~3.0.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2016-12-10T08:21:45+00:00" - }, - { - "name": "symfony/console", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "d5643cd095e5e37d31e004bb2606b5dd7e96602f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d5643cd095e5e37d31e004bb2606b5dd7e96602f", - "reference": "d5643cd095e5e37d31e004bb2606b5dd7e96602f", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/debug": "~2.7,>=2.7.2|~3.0.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2016-12-06T11:59:35+00:00" - }, - { - "name": "symfony/debug", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "62a68f640456f6761d752c62d81631428ef0d8a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/62a68f640456f6761d752c62d81631428ef0d8a1", - "reference": "62a68f640456f6761d752c62d81631428ef0d8a1", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2016-11-15T12:53:17+00:00" - }, - { - "name": "symfony/dependency-injection", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "51a7b5385fb0f42e5edbdb2cfbad1a011ecdaee7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51a7b5385fb0f42e5edbdb2cfbad1a011ecdaee7", - "reference": "51a7b5385fb0f42e5edbdb2cfbad1a011ecdaee7", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/expression-language": "<2.6" - }, - "require-dev": { - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", - "time": "2016-12-08T14:41:31+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "25c576abd4e0f212e678fe8b2bd9a9a98c7ea934" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/25c576abd4e0f212e678fe8b2bd9a9a98c7ea934", - "reference": "25c576abd4e0f212e678fe8b2bd9a9a98c7ea934", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2016-10-13T01:43:15+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "a3784111af9f95f102b6411548376e1ae7c93898" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a3784111af9f95f102b6411548376e1ae7c93898", - "reference": "a3784111af9f95f102b6411548376e1ae7c93898", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2016-10-18T04:28:30+00:00" - }, - { - "name": "symfony/finder", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "c0f10576335743b881ac1ed39d18c0fa66048775" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c0f10576335743b881ac1ed39d18c0fa66048775", - "reference": "c0f10576335743b881ac1ed39d18c0fa66048775", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2016-12-13T09:38:12+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2016-11-14T01:06:16+00:00" - }, - { - "name": "symfony/process", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "1a1bd056395540d0bc549d39818316513565d278" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1a1bd056395540d0bc549d39818316513565d278", - "reference": "1a1bd056395540d0bc549d39818316513565d278", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2016-11-24T00:43:03+00:00" - }, - { - "name": "symfony/translation", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "edbe67e8f729885b55421d5cc58223d48540df07" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/edbe67e8f729885b55421d5cc58223d48540df07", - "reference": "edbe67e8f729885b55421d5cc58223d48540df07", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8", - "symfony/intl": "~2.4|~3.0.0", - "symfony/yaml": "~2.2|~3.0.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2016-11-18T21:10:01+00:00" - }, - { - "name": "symfony/yaml", - "version": "v2.8.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "befb26a3713c97af90d25dd12e75621ef14d91ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/befb26a3713c97af90d25dd12e75621ef14d91ff", - "reference": "befb26a3713c97af90d25dd12e75621ef14d91ff", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2016-11-14T16:15:57+00:00" - }, - { - "name": "wp-cli/php-cli-tools", - "version": "v0.11.1", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/php-cli-tools.git", - "reference": "5311a4b99103c0505db015a334be4952654d6e21" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/5311a4b99103c0505db015a334be4952654d6e21", - "reference": "5311a4b99103c0505db015a334be4952654d6e21", - "shasum": "" - }, - "require": { - "php": ">= 5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "cli": "lib/" - }, - "files": [ - "lib/cli/cli.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "James Logsdon", - "email": "jlogsdon@php.net", - "role": "Developer" - }, - { - "name": "Daniel Bachhuber", - "email": "daniel@handbuilt.co", - "role": "Maintainer" - } - ], - "description": "Console utilities for PHP", - "homepage": "http://github.com/wp-cli/php-cli-tools", - "keywords": [ - "cli", - "console" - ], - "time": "2016-02-08T14:34:01+00:00" - }, - { - "name": "wp-cli/wp-cli", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/wp-cli/wp-cli.git", - "reference": "62d10c72aa1e77f7bf0a84dd495369c41fe12a2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/62d10c72aa1e77f7bf0a84dd495369c41fe12a2e", - "reference": "62d10c72aa1e77f7bf0a84dd495369c41fe12a2e", - "shasum": "" - }, - "require": { - "composer/composer": "^1.0.0", - "composer/semver": "~1.0", - "mustache/mustache": "~2.4", - "mustangostang/spyc": "~0.5", - "nb/oxymel": "~0.1.0", - "php": ">=5.3.29", - "ramsey/array_column": "~1.1", - "rmccue/requests": "~1.6", - "symfony/config": "~2.7", - "symfony/console": "~2.7", - "symfony/debug": "~2.7", - "symfony/dependency-injection": "~2.7", - "symfony/event-dispatcher": "~2.7", - "symfony/filesystem": "~2.7", - "symfony/finder": "~2.7", - "symfony/process": "~2.1", - "symfony/translation": "~2.7", - "symfony/yaml": "~2.7", - "wp-cli/php-cli-tools": "~0.11.1" - }, - "require-dev": { - "behat/behat": "2.5.*", - "phpunit/phpunit": "3.7.*" - }, - "suggest": { - "psy/psysh": "Enhanced `wp shell` functionality" - }, - "bin": [ - "bin/wp.bat", - "bin/wp" - ], - "type": "library", - "autoload": { - "psr-0": { - "WP_CLI": "php" - }, - "classmap": [ - "php/export" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A command line interface for WordPress", - "homepage": "http://wp-cli.org", - "keywords": [ - "cli", - "wordpress" - ], - "time": "2016-11-29T19:33:53+00:00" - }, - { - "name": "wpackagist-plugin/woocommerce", - "version": "dev-trunk", - "source": { - "type": "svn", - "url": "https://plugins.svn.wordpress.org/woocommerce/", - "reference": "trunk" - }, - "dist": { - "type": "zip", - "url": "https://downloads.wordpress.org/plugin/woocommerce.zip", - "reference": null, - "shasum": null - }, - "require": { - "composer/installers": "~1.0" - }, - "type": "wordpress-plugin", - "homepage": "https://wordpress.org/plugins/woocommerce/", - "time": "2016-07-26T17:31:18+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "phpunit/phpunit": 0, - "wp-cli/wp-cli": 0, - "wpackagist-plugin/woocommerce": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.2" - }, - "platform-dev": [], - "platform-overrides": { - "php": "5.3.29" - } -} From 266c76adc084c83915e5e82f93bb2e4a045bcdb9 Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Tue, 11 Jul 2017 13:04:39 -0600 Subject: [PATCH 26/96] Travis YAML. Using sudo. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3b4e2edcbc..7f2402cc71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: php +sudo: true + addons: apt: packages: From 39d4955e3ce940c6f5cf8bbd5c532e8e6f60da21 Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Tue, 11 Jul 2017 13:23:22 -0600 Subject: [PATCH 27/96] Removing sudo in Travis YAML. --- .travis.yml | 2 - composer.lock | 3877 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3877 insertions(+), 2 deletions(-) create mode 100644 composer.lock diff --git a/.travis.yml b/.travis.yml index 7f2402cc71..3b4e2edcbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: php -sudo: true - addons: apt: packages: diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000000..c0a4fdd33a --- /dev/null +++ b/composer.lock @@ -0,0 +1,3877 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "cddfe9d6a35a7fd274871696c0c65143", + "packages": [], + "packages-dev": [ + { + "name": "composer/ca-bundle", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b17e6153cb7f33c7e44eb59578dc12eee5dc8e12", + "reference": "b17e6153cb7f33c7e44eb59578dc12eee5dc8e12", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0" + }, + "suggest": { + "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2017-03-06T11:59:08+00:00" + }, + { + "name": "composer/composer", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "489e09ee6c3ba431fbeeef9147afdaeb6f91b647" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/489e09ee6c3ba431fbeeef9147afdaeb6f91b647", + "reference": "489e09ee6c3ba431fbeeef9147afdaeb6f91b647", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.0", + "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", + "seld/cli-prompt": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.7 || ^3.0", + "symfony/filesystem": "^2.7 || ^3.0", + "symfony/finder": "^2.7 || ^3.0", + "symfony/process": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "time": "2017-05-17T06:17:53+00:00" + }, + { + "name": "composer/installers", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/79ad876c7498c0bbfe7eed065b8651c93bfd6045", + "reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "4.1.*" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "mako", + "mediawiki", + "modulework", + "moodle", + "phpbb", + "piwik", + "ppi", + "puppet", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "time": "2017-04-24T06:37:16+00:00" + }, + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-08-30T16:08:34+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.1.6", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2017-04-03T19:08:52+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.1", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/429be236f296ca249d61c65649cdf2652f4a5e80", + "reference": "429be236f296ca249d61c65649cdf2652f4a5e80", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpdocumentor/phpdocumentor": "^2.7", + "phpunit/phpunit": "^4.8.22" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2017-05-16T21:06:09+00:00" + }, + { + "name": "mustache/mustache", + "version": "v2.12.0", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/mustache.php.git", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~1.11", + "phpunit/phpunit": "~3.7|~4.0|~5.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mustache": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "A Mustache implementation in PHP.", + "homepage": "https://github.com/bobthecow/mustache.php", + "keywords": [ + "mustache", + "templating" + ], + "time": "2017-07-11T12:54:05+00:00" + }, + { + "name": "nb/oxymel", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/nb/oxymel.git", + "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nb/oxymel/zipball/cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", + "reference": "cbe626ef55d5c4cc9b5e6e3904b395861ea76e3c", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "type": "library", + "autoload": { + "psr-0": { + "Oxymel": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nikolay Bachiyski", + "email": "nb@nikolay.bg", + "homepage": "http://extrapolate.me/" + } + ], + "description": "A sweet XML builder", + "homepage": "https://github.com/nb/oxymel", + "keywords": [ + "xml" + ], + "time": "2013-02-24T15:01:54+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-01-25T08:17:30+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02T20:05:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03T07:40:28+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-02-27T10:12:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-06-21T08:07:12+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "ramsey/array_column", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/array_column.git", + "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/array_column/zipball/f8e52eb28e67eb50e613b451dd916abcf783c1db", + "reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db", + "shasum": "" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.8.*", + "phpunit/phpunit": "~4.5", + "satooshi/php-coveralls": "0.6.*", + "squizlabs/php_codesniffer": "~2.2" + }, + "type": "library", + "autoload": { + "files": [ + "src/array_column.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "homepage": "http://benramsey.com" + } + ], + "description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.", + "homepage": "https://github.com/ramsey/array_column", + "keywords": [ + "array", + "array_column", + "column" + ], + "time": "2015-03-20T22:07:39+00:00" + }, + { + "name": "rmccue/requests", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/rmccue/Requests.git", + "reference": "87932f52ffad70504d93f04f15690cf16a089546" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", + "reference": "87932f52ffad70504d93f04f15690cf16a089546", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "requests/test-server": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "time": "2016-10-13T00:11:37+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17T09:04:28+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-10-03T07:41:43+00:00" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21T13:59:46+00:00" + }, + { + "name": "seld/cli-prompt", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/cli-prompt.git", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\CliPrompt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", + "keywords": [ + "cli", + "console", + "hidden", + "input", + "prompt" + ], + "time": "2017-03-18T11:32:45+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77", + "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2017-06-18T15:11:04+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phra" + ], + "time": "2015-10-13T18:44:15+00:00" + }, + { + "name": "symfony/config", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "0b8541d18507d10204a08384640ff6df3c739ebe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/0b8541d18507d10204a08384640ff6df3c739ebe", + "reference": "0b8541d18507d10204a08384640ff6df3c739ebe", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0" + }, + "require-dev": { + "symfony/yaml": "~2.7|~3.0.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-04-12T14:07:15+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "46e65f8d98c9ab629bbfcc16a4ff023f61c37fb2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/46e65f8d98c9ab629bbfcc16a4ff023f61c37fb2", + "reference": "46e65f8d98c9ab629bbfcc16a4ff023f61c37fb2", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-07-03T08:04:30+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "8470d7701177a88edeb0cec59b44d50ef4477e9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/8470d7701177a88edeb0cec59b44d50ef4477e9b", + "reference": "8470d7701177a88edeb0cec59b44d50ef4477e9b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-06-01T20:52:29+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "66d2e252262749e0f3c735c183e4562c72ffb8c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/66d2e252262749e0f3c735c183e4562c72ffb8c8", + "reference": "66d2e252262749e0f3c735c183e4562c72ffb8c8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/expression-language": "<2.6" + }, + "require-dev": { + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2017-06-14T00:55:24+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d", + "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-06-02T07:47:27+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b8c9c18eacc525c980d27c7a2c8fd1e09e0ed4c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8c9c18eacc525c980d27c7a2c8fd1e09e0ed4c7", + "reference": "b8c9c18eacc525c980d27c7a2c8fd1e09e0ed4c7", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-06-20T23:27:56+00:00" + }, + { + "name": "symfony/finder", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", + "reference": "4f4e84811004e065a3bb5ceeb1d9aa592630f9ad", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2017-06-01T20:52:29+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-06-09T14:24:12+00:00" + }, + { + "name": "symfony/process", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", + "reference": "57e52a0a6a80ea0aec4fc1b785a7920a95cb88a8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2017-07-03T08:04:30+00:00" + }, + { + "name": "symfony/translation", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "a89af885b8c6d0142c79a02ca9cc059ed25d40d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/a89af885b8c6d0142c79a02ca9cc059ed25d40d8", + "reference": "a89af885b8c6d0142c79a02ca9cc059ed25d40d8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2017-06-24T16:44:49+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.24", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-06-01T20:52:29+00:00" + }, + { + "name": "wp-cli/autoload-splitter", + "version": "v0.1.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/autoload-splitter.git", + "reference": "446f73de57ab4e7bf38a4ba2779cd3630905185c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/autoload-splitter/zipball/446f73de57ab4e7bf38a4ba2779cd3630905185c", + "reference": "446f73de57ab4e7bf38a4ba2779cd3630905185c", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1" + }, + "type": "composer-plugin", + "extra": { + "class": "WP_CLI\\AutoloadSplitter\\ComposerPlugin" + }, + "autoload": { + "psr-4": { + "WP_CLI\\AutoloadSplitter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alain Schlesser", + "email": "alain.schlesser@gmail.com", + "homepage": "https://www.alainschlesser.com" + } + ], + "description": "Composer plugin for splitting a generated autoloader into two distinct parts.", + "homepage": "https://wp-cli.org", + "time": "2017-05-03T06:21:26+00:00" + }, + { + "name": "wp-cli/cache-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/cache-command.git", + "reference": "d7102d5573d050befc81be5470b5df553e66cc6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/d7102d5573d050befc81be5470b5df553e66cc6e", + "reference": "d7102d5573d050befc81be5470b5df553e66cc6e", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "cache", + "transient" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "cache-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage object and transient caches.", + "homepage": "https://github.com/wp-cli/cache-command", + "time": "2017-05-30T18:00:27+00:00" + }, + { + "name": "wp-cli/checksum-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/checksum-command.git", + "reference": "2b74567a660951380083f02224a21746b2697008" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/checksum-command/zipball/2b74567a660951380083f02224a21746b2697008", + "reference": "2b74567a660951380083f02224a21746b2697008", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "checksum core" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "checksum-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Verify WordPress core checksums.", + "homepage": "https://github.com/wp-cli/checksum-command", + "time": "2017-05-30T18:55:36+00:00" + }, + { + "name": "wp-cli/config-command", + "version": "v1.1.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/config-command.git", + "reference": "8c043f9312a5c35cd7e37a7551d835f46ed0586e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/config-command/zipball/8c043f9312a5c35cd7e37a7551d835f46ed0586e", + "reference": "8c043f9312a5c35cd7e37a7551d835f46ed0586e", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "config", + "config create", + "config get", + "config path" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "config-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage the wp-config.php file.", + "homepage": "https://github.com/wp-cli/config-command", + "time": "2017-07-06T21:17:20+00:00" + }, + { + "name": "wp-cli/core-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/core-command.git", + "reference": "22e0caa140897f87d9e618fc075f80325a6151ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/core-command/zipball/22e0caa140897f87d9e618fc075f80325a6151ee", + "reference": "22e0caa140897f87d9e618fc075f80325a6151ee", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "core check-update", + "core download", + "core install", + "core is-installed", + "core multisite-convert", + "core multisite-install", + "core update", + "core update-db", + "core version" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "core-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Download, install, update and manage a WordPress install.", + "homepage": "https://github.com/wp-cli/core-command", + "time": "2017-05-30T18:56:42+00:00" + }, + { + "name": "wp-cli/cron-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/cron-command.git", + "reference": "1cf8564c0c025520658a8ec872e606bdd7fef319" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/1cf8564c0c025520658a8ec872e606bdd7fef319", + "reference": "1cf8564c0c025520658a8ec872e606bdd7fef319", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "cron test", + "cron event delete", + "cron event list", + "cron event run", + "cron event schedule", + "cron schedule list" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "cron-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage WP-Cron events and schedules.", + "homepage": "https://github.com/wp-cli/cron-command", + "time": "2017-05-30T18:58:24+00:00" + }, + { + "name": "wp-cli/db-command", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/db-command.git", + "reference": "4c65adbd92e81df140beaa985f101b2905561666" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/db-command/zipball/4c65adbd92e81df140beaa985f101b2905561666", + "reference": "4c65adbd92e81df140beaa985f101b2905561666", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "db create", + "db drop", + "db reset", + "db check", + "db optimize", + "db repair", + "db cli", + "db query", + "db export", + "db import", + "db tables", + "db size" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "db-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Perform basic database operations using credentials stored in wp-config.php.", + "homepage": "https://github.com/wp-cli/db-command", + "time": "2017-05-30T18:57:35+00:00" + }, + { + "name": "wp-cli/entity-command", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/entity-command.git", + "reference": "5f925201062c7a308f6cbbfc56bc8dec20d2ff80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/5f925201062c7a308f6cbbfc56bc8dec20d2ff80", + "reference": "5f925201062c7a308f6cbbfc56bc8dec20d2ff80", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "comment", + "comment meta", + "menu", + "menu item", + "menu location", + "network meta", + "post", + "post meta", + "post term", + "post-type", + "site", + "taxonomy", + "term", + "term meta", + "user", + "user meta", + "user term" + ] + }, + "autoload": { + "psr-4": { + "": "src/", + "WP_CLI\\": "src/WP_CLI" + }, + "files": [ + "entity-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage WordPress core entities.", + "homepage": "https://github.com/wp-cli/entity-command", + "time": "2017-06-29T22:26:09+00:00" + }, + { + "name": "wp-cli/eval-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/eval-command.git", + "reference": "996c2ed3ad5bd796abaabe7ed0ce5c368fab62d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/eval-command/zipball/996c2ed3ad5bd796abaabe7ed0ce5c368fab62d1", + "reference": "996c2ed3ad5bd796abaabe7ed0ce5c368fab62d1", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "eval", + "eval-file" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "eval-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Execute arbitrary PHP code.", + "homepage": "https://github.com/wp-cli/eval-command", + "time": "2017-05-30T19:00:48+00:00" + }, + { + "name": "wp-cli/export-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/export-command.git", + "reference": "3507dae2dad0f8bb71070bc0c284ffed304caf21" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/export-command/zipball/3507dae2dad0f8bb71070bc0c284ffed304caf21", + "reference": "3507dae2dad0f8bb71070bc0c284ffed304caf21", + "shasum": "" + }, + "require": { + "nb/oxymel": "~0.1.0", + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "export" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "export-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Export WordPress content to a WXR file.", + "homepage": "https://github.com/wp-cli/export-command", + "time": "2017-05-30T19:01:34+00:00" + }, + { + "name": "wp-cli/extension-command", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/extension-command.git", + "reference": "8489bc23aad242796cba15f78ce75192b1774ea5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/8489bc23aad242796cba15f78ce75192b1774ea5", + "reference": "8489bc23aad242796cba15f78ce75192b1774ea5", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "plugin activate", + "plugin deactivate", + "plugin delete", + "plugin get", + "plugin install", + "plugin is-installed", + "plugin list", + "plugin path", + "plugin search", + "plugin status", + "plugin toggle", + "plugin uninstall", + "plugin update", + "theme activate", + "theme delete", + "theme disable", + "theme enable", + "theme get", + "theme install", + "theme is-installed", + "theme list", + "theme mod get", + "theme mod set", + "theme mod remove", + "theme path", + "theme search", + "theme status", + "theme update" + ] + }, + "autoload": { + "psr-4": { + "": "src/", + "WP_CLI\\": "src/WP_CLI" + }, + "files": [ + "extension-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage WordPress plugins and themes.", + "homepage": "https://github.com/wp-cli/extension-command", + "time": "2017-06-08T09:01:02+00:00" + }, + { + "name": "wp-cli/import-command", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/import-command.git", + "reference": "3d10d138e6f7c4715535fdb3b5a436cc3d143fea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/import-command/zipball/3d10d138e6f7c4715535fdb3b5a436cc3d143fea", + "reference": "3d10d138e6f7c4715535fdb3b5a436cc3d143fea", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "bundled": true, + "commands": [ + "import" + ] + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "import-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Import content from a WXR file.", + "homepage": "https://github.com/wp-cli/import-command", + "time": "2017-07-04T13:14:43+00:00" + }, + { + "name": "wp-cli/language-command", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/language-command.git", + "reference": "5812cac811de1c166b89cf6c78a2c1ff606e1dc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/language-command/zipball/5812cac811de1c166b89cf6c78a2c1ff606e1dc4", + "reference": "5812cac811de1c166b89cf6c78a2c1ff606e1dc4", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "language core activate", + "language core install", + "language core list", + "language core uninstall", + "language core update" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "language-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage language packs.", + "homepage": "https://github.com/wp-cli/language-command", + "time": "2017-05-30T21:29:09+00:00" + }, + { + "name": "wp-cli/media-command", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/media-command.git", + "reference": "dfa3b80a8d7fbc9fb90753d5bf59ba7efd541530" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/media-command/zipball/dfa3b80a8d7fbc9fb90753d5bf59ba7efd541530", + "reference": "dfa3b80a8d7fbc9fb90753d5bf59ba7efd541530", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "media import", + "media regenerate" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "media-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Import and regenerate attachments.", + "homepage": "https://github.com/wp-cli/media-command", + "time": "2017-06-16T08:49:06+00:00" + }, + { + "name": "wp-cli/mustangostang-spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/spyc.git", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Mustangostang\\": "src/" + }, + "files": [ + "includes/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", + "homepage": "https://github.com/mustangostang/spyc/", + "time": "2017-04-25T11:26:20+00:00" + }, + { + "name": "wp-cli/package-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/package-command.git", + "reference": "1163c1e571388c73c54d68a5013c3817b6113dbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/package-command/zipball/1163c1e571388c73c54d68a5013c3817b6113dbf", + "reference": "1163c1e571388c73c54d68a5013c3817b6113dbf", + "shasum": "" + }, + "require": { + "composer/composer": "^1.2.0", + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "package browse", + "package install", + "package list", + "package update", + "package uninstall" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "package-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage WP-CLI packages.", + "homepage": "https://github.com/wp-cli/package-command", + "time": "2017-05-30T19:28:38+00:00" + }, + { + "name": "wp-cli/php-cli-tools", + "version": "v0.11.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/php-cli-tools.git", + "reference": "09075e5a5ba804df43e148f887cbf4466bebfa2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/09075e5a5ba804df43e148f887cbf4466bebfa2c", + "reference": "09075e5a5ba804df43e148f887cbf4466bebfa2c", + "shasum": "" + }, + "require": { + "php": ">= 5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "cli": "lib/" + }, + "files": [ + "lib/cli/cli.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Logsdon", + "email": "jlogsdon@php.net", + "role": "Developer" + }, + { + "name": "Daniel Bachhuber", + "email": "daniel@handbuilt.co", + "role": "Maintainer" + } + ], + "description": "Console utilities for PHP", + "homepage": "http://github.com/wp-cli/php-cli-tools", + "keywords": [ + "cli", + "console" + ], + "time": "2017-06-08T12:06:09+00:00" + }, + { + "name": "wp-cli/rewrite-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/rewrite-command.git", + "reference": "fe4067a3d64359c171306bc7757ec333f409b8d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/rewrite-command/zipball/fe4067a3d64359c171306bc7757ec333f409b8d1", + "reference": "fe4067a3d64359c171306bc7757ec333f409b8d1", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "rewrite flush", + "rewrite list", + "rewrite structure" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "rewrite-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage rewrite rules.", + "homepage": "https://github.com/wp-cli/rewrite-command", + "time": "2017-05-30T19:40:20+00:00" + }, + { + "name": "wp-cli/role-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/role-command.git", + "reference": "fd90b81e85b4d66f47cb3ec51fd1cf27e8bc4a5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/role-command/zipball/fd90b81e85b4d66f47cb3ec51fd1cf27e8bc4a5f", + "reference": "fd90b81e85b4d66f47cb3ec51fd1cf27e8bc4a5f", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "role create", + "role delete", + "role exists", + "role list", + "role reset", + "cap add", + "cap list", + "cap remove" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "role-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage user roles and capabilities.", + "homepage": "https://github.com/wp-cli/role-command", + "time": "2017-05-30T21:23:36+00:00" + }, + { + "name": "wp-cli/scaffold-command", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/scaffold-command.git", + "reference": "8015b662c232565d86962894618e38b5e5d43de1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/8015b662c232565d86962894618e38b5e5d43de1", + "reference": "8015b662c232565d86962894618e38b5e5d43de1", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "scaffold", + "scaffold _s", + "scaffold child-theme", + "scaffold plugin", + "scaffold plugin-tests", + "scaffold post-type", + "scaffold taxonomy", + "scaffold theme-tests" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "scaffold-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Generate code for post types, taxonomies, plugins, child themes, etc.", + "homepage": "https://github.com/wp-cli/scaffold-command", + "time": "2017-05-30T21:18:58+00:00" + }, + { + "name": "wp-cli/search-replace-command", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/search-replace-command.git", + "reference": "bb99b41e3b908f4256c8b7918118a96bb80c1bd6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/bb99b41e3b908f4256c8b7918118a96bb80c1bd6", + "reference": "bb99b41e3b908f4256c8b7918118a96bb80c1bd6", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "search-replace" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/", + "WP_CLI\\": "src/WP_CLI" + }, + "files": [ + "search-replace-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Search/replace strings in the database.", + "homepage": "https://github.com/wp-cli/search-replace-command", + "time": "2017-06-28T19:27:14+00:00" + }, + { + "name": "wp-cli/server-command", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/server-command.git", + "reference": "fb8f7e048b9d7a29d99e019c0a33a71542a856c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/server-command/zipball/fb8f7e048b9d7a29d99e019c0a33a71542a856c9", + "reference": "fb8f7e048b9d7a29d99e019c0a33a71542a856c9", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "server" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "server-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Launch PHP's built-in web server for this specific WordPress installation.", + "homepage": "https://github.com/wp-cli/server-command", + "time": "2017-05-30T19:41:53+00:00" + }, + { + "name": "wp-cli/shell-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/shell-command.git", + "reference": "827ccfe2eceda7a75e9b244e0044fb6f7aac52f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/shell-command/zipball/827ccfe2eceda7a75e9b244e0044fb6f7aac52f5", + "reference": "827ccfe2eceda7a75e9b244e0044fb6f7aac52f5", + "shasum": "" + }, + "require": { + "wp-cli/wp-cli": "*" + }, + "require-dev": { + "behat/behat": "~2.5" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "shell" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/", + "WP_CLI\\": "src/WP_CLI" + }, + "files": [ + "shell-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Interactive PHP console.", + "homepage": "https://github.com/wp-cli/shell-command", + "time": "2017-05-30T19:43:29+00:00" + }, + { + "name": "wp-cli/super-admin-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/super-admin-command.git", + "reference": "3dc1bfc6bef14e11ff33ef691892b1ad1610d128" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/3dc1bfc6bef14e11ff33ef691892b1ad1610d128", + "reference": "3dc1bfc6bef14e11ff33ef691892b1ad1610d128", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "super-admin add", + "super-admin list", + "super-admin remove" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "super-admin-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage super admins on WordPress multisite.", + "homepage": "https://github.com/wp-cli/super-admin-command", + "time": "2017-05-30T19:44:45+00:00" + }, + { + "name": "wp-cli/widget-command", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/widget-command.git", + "reference": "68b5955a7a18d568f69775decbd79ebfbe691d3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/68b5955a7a18d568f69775decbd79ebfbe691d3e", + "reference": "68b5955a7a18d568f69775decbd79ebfbe691d3e", + "shasum": "" + }, + "require-dev": { + "behat/behat": "~2.5", + "wp-cli/wp-cli": "*" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "commands": [ + "widget add", + "widget deactivate", + "widget delete", + "widget list", + "widget move", + "widget reset", + "widget update", + "sidebar list" + ], + "bundled": true + }, + "autoload": { + "psr-4": { + "": "src/" + }, + "files": [ + "widget-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@runcommand.io", + "homepage": "https://runcommand.io" + } + ], + "description": "Manage widgets and sidebars.", + "homepage": "https://github.com/wp-cli/widget-command", + "time": "2017-05-30T21:14:12+00:00" + }, + { + "name": "wp-cli/wp-cli", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/wp-cli.git", + "reference": "9a9b6a63e08e7827669677faa97312972c0f1da2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/9a9b6a63e08e7827669677faa97312972c0f1da2", + "reference": "9a9b6a63e08e7827669677faa97312972c0f1da2", + "shasum": "" + }, + "require": { + "composer/composer": "^1.2.0", + "composer/semver": "~1.0", + "mustache/mustache": "~2.4", + "php": ">=5.3.29", + "ramsey/array_column": "~1.1", + "rmccue/requests": "~1.6", + "symfony/config": "^2.7|^3.0", + "symfony/console": "^2.7|^3.0", + "symfony/debug": "^2.7|^3.0", + "symfony/dependency-injection": "^2.7|^3.0", + "symfony/event-dispatcher": "^2.7|^3.0", + "symfony/filesystem": "^2.7|^3.0", + "symfony/finder": "^2.7|^3.0", + "symfony/process": "^2.1|^3.0", + "symfony/translation": "^2.7|^3.0", + "symfony/yaml": "^2.7|^3.0", + "wp-cli/autoload-splitter": "^0.1", + "wp-cli/cache-command": "^1.0", + "wp-cli/checksum-command": "^1.0", + "wp-cli/config-command": "^1.0", + "wp-cli/core-command": "^1.0", + "wp-cli/cron-command": "^1.0", + "wp-cli/db-command": "^1.0", + "wp-cli/entity-command": "^1.0", + "wp-cli/eval-command": "^1.0", + "wp-cli/export-command": "^1.0", + "wp-cli/extension-command": "^1.0", + "wp-cli/import-command": "^1.0", + "wp-cli/language-command": "^1.0", + "wp-cli/media-command": "^1.0", + "wp-cli/mustangostang-spyc": "^0.6.3", + "wp-cli/package-command": "^1.0", + "wp-cli/php-cli-tools": "~0.11.2", + "wp-cli/rewrite-command": "^1.0", + "wp-cli/role-command": "^1.0", + "wp-cli/scaffold-command": "^1.0", + "wp-cli/search-replace-command": "^1.0", + "wp-cli/server-command": "^1.0", + "wp-cli/shell-command": "^1.0", + "wp-cli/super-admin-command": "^1.0", + "wp-cli/widget-command": "^1.0" + }, + "require-dev": { + "behat/behat": "2.5.*", + "phpunit/phpunit": "3.7.*", + "pyrech/composer-changelogs": "dev-php53 as 1.5.1", + "roave/security-advisories": "dev-master" + }, + "suggest": { + "psy/psysh": "Enhanced `wp shell` functionality" + }, + "bin": [ + "bin/wp.bat", + "bin/wp" + ], + "type": "library", + "extra": { + "autoload-splitter": { + "splitter-logic": "WP_CLI\\AutoloadSplitter", + "splitter-location": "php/WP_CLI/AutoloadSplitter.php", + "split-target-prefix-true": "autoload_commands", + "split-target-prefix-false": "autoload_framework" + } + }, + "autoload": { + "psr-0": { + "WP_CLI": "php" + }, + "psr-4": { + "": "php/commands/src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A command line interface for WordPress", + "homepage": "http://wp-cli.org", + "keywords": [ + "cli", + "wordpress" + ], + "time": "2017-06-06T12:14:53+00:00" + }, + { + "name": "wpackagist-plugin/woocommerce", + "version": "dev-trunk", + "source": { + "type": "svn", + "url": "https://plugins.svn.wordpress.org/woocommerce/", + "reference": "trunk" + }, + "dist": { + "type": "zip", + "url": "https://downloads.wordpress.org/plugin/woocommerce.zip?timestamp=1498667669", + "reference": null, + "shasum": null + }, + "require": { + "composer/installers": "~1.0" + }, + "type": "wordpress-plugin", + "homepage": "https://wordpress.org/plugins/woocommerce/", + "time": "2017-06-28T17:34:29+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "phpunit/phpunit": 0, + "wp-cli/wp-cli": 0, + "wpackagist-plugin/woocommerce": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.2" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.3.29" + } +} From 35d4b7709ee3098f19f48e0c9909dcaccc99c32a Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Wed, 12 Jul 2017 17:15:17 -0600 Subject: [PATCH 28/96] If a taxonomy is not set to public and publicly_queryable, then it should index the terms on ES. Fixes #890 --- classes/class-ep-api.php | 2 +- tests/test-single-site.php | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index f44e076746..a33443e423 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -671,7 +671,7 @@ private function prepare_terms( $post ) { $selected_taxonomies = array(); foreach ( $taxonomies as $taxonomy ) { - if ( $taxonomy->public ) { + if ( $taxonomy->public || $taxonomy->publicly_queryable ) { $selected_taxonomies[] = $taxonomy; } } diff --git a/tests/test-single-site.php b/tests/test-single-site.php index 53fab64116..94d1277ee2 100644 --- a/tests/test-single-site.php +++ b/tests/test-single-site.php @@ -3316,4 +3316,50 @@ function testPostMimeTypeQuery() { $this->assertEquals( 3, $query->found_posts ); } + + /** + * If a taxonomy is not public but is publicly queryable, it should return a result. + * + * @link https://github.com/10up/ElasticPress/issues/890 + * @group single-site + * @since 2.4 + */ + public function testCustomTaxonomyPublic() { + + $post_id = ep_create_and_sync_post(); + $post = get_post( $post_id ); + + $taxName = rand_str( 32 ); + register_taxonomy( $taxName, $post->post_type, array( 'label' => $taxName, + 'public' => false, + 'publicly_queryable' => true + ) ); + register_taxonomy_for_object_type( $taxName, $post->post_type ); + + $term1Name = rand_str( 32 ); + $term1 = wp_insert_term( $term1Name, $taxName ); + + wp_set_object_terms( $post_id, array( $term1['term_id'] ), $taxName, true ); + + ep_sync_post( $post_id ); + ep_refresh_index(); + + $args = array( + 's' => 'test', + 'tax_query' => array( + array( + 'taxonomy' => $taxName, + 'terms' => array( $term1Name ), + 'field' => 'name', + ) + ) + ); + + $query = new WP_Query( $args ); + + $this->assertEquals( $query->post_count, 1 ); + $this->assertEquals( $query->found_posts, 1 ); + $this->assertTrue( isset( $query->posts[0]->elasticsearch ) ); + } + } From 1196d697ed43cbb699c819a6c7899f58edc14a3e Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Thu, 13 Jul 2017 14:11:15 -0600 Subject: [PATCH 29/96] If a normalizer is added to sortable fields, case sensitive sorting is no longer an issue. --- includes/mappings/5-0.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/mappings/5-0.php b/includes/mappings/5-0.php index 137756f8be..dbe0725bdc 100644 --- a/includes/mappings/5-0.php +++ b/includes/mappings/5-0.php @@ -12,8 +12,8 @@ return array( 'settings' => array( - 'index.mapping.total_fields.limit' => apply_filters( 'ep_total_field_limit', 5000 ), - 'index.max_result_window' => apply_filters( 'ep_max_result_window', 1000000 ), + 'index.mapping.total_fields.limit' => apply_filters( 'ep_total_field_limit', 5000 ), + 'index.max_result_window' => apply_filters( 'ep_max_result_window', 1000000 ), 'analysis' => array( 'analyzer' => array( 'default' => array( @@ -53,6 +53,12 @@ 'type' => 'edgeNGram', ), ), + 'normalizer' => array( + 'lowerasciinormalizer' => array( + 'type' => 'custom', + 'filter' => array( 'lowercase', 'asciifolding' ), + ), + ), ), ), 'mappings' => array( @@ -90,6 +96,7 @@ 'sortable' => array( 'type' => 'keyword', 'ignore_above' => 10922, + 'normalizer' => 'lowerasciinormalizer', ), 'raw' => array( 'type' => 'keyword', @@ -141,6 +148,7 @@ ), 'sortable' => array( 'type' => 'keyword', + 'normalizer' => 'lowerasciinormalizer', ), ), ), @@ -191,6 +199,7 @@ ), 'sortable' => array( 'type' => 'keyword', + 'normalizer' => 'lowerasciinormalizer', ), ), ), @@ -235,6 +244,7 @@ 'sortable' => array( 'type' => 'keyword', 'ignore_above' => 10922, + 'normalizer' => 'lowerasciinormalizer', ), ), ), From 5e6270ab22e9bb3cbf85ca077126ef764758b5aa Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Thu, 13 Jul 2017 15:00:18 -0600 Subject: [PATCH 30/96] Adding 5.2 mapping. --- classes/class-ep-api.php | 2 + includes/mappings/5-0.php | 10 -- includes/mappings/5-2.php | 353 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 355 insertions(+), 10 deletions(-) create mode 100644 includes/mappings/5-2.php diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index f44e076746..91702fa392 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -466,6 +466,8 @@ public function put_mapping() { if ( ! $es_version || version_compare( $es_version, '5.0' ) < 0 ) { $mapping_file = 'pre-5-0.php'; + } elseif ( version_compare( $es_version, '5.2' ) >= 0 ) { + $mapping_file = '5-2.php'; } else { $mapping_file = '5-0.php'; } diff --git a/includes/mappings/5-0.php b/includes/mappings/5-0.php index dbe0725bdc..800bb711b5 100644 --- a/includes/mappings/5-0.php +++ b/includes/mappings/5-0.php @@ -53,12 +53,6 @@ 'type' => 'edgeNGram', ), ), - 'normalizer' => array( - 'lowerasciinormalizer' => array( - 'type' => 'custom', - 'filter' => array( 'lowercase', 'asciifolding' ), - ), - ), ), ), 'mappings' => array( @@ -96,7 +90,6 @@ 'sortable' => array( 'type' => 'keyword', 'ignore_above' => 10922, - 'normalizer' => 'lowerasciinormalizer', ), 'raw' => array( 'type' => 'keyword', @@ -148,7 +141,6 @@ ), 'sortable' => array( 'type' => 'keyword', - 'normalizer' => 'lowerasciinormalizer', ), ), ), @@ -199,7 +191,6 @@ ), 'sortable' => array( 'type' => 'keyword', - 'normalizer' => 'lowerasciinormalizer', ), ), ), @@ -244,7 +235,6 @@ 'sortable' => array( 'type' => 'keyword', 'ignore_above' => 10922, - 'normalizer' => 'lowerasciinormalizer', ), ), ), diff --git a/includes/mappings/5-2.php b/includes/mappings/5-2.php new file mode 100644 index 0000000000..203e08b665 --- /dev/null +++ b/includes/mappings/5-2.php @@ -0,0 +1,353 @@ + array( + 'index.mapping.total_fields.limit' => apply_filters( 'ep_total_field_limit', 5000 ), + 'index.max_result_window' => apply_filters( 'ep_max_result_window', 1000000 ), + 'analysis' => array( + 'analyzer' => array( + 'default' => array( + 'tokenizer' => 'standard', + 'filter' => array( 'standard', 'ewp_word_delimiter', 'lowercase', 'stop', 'ewp_snowball' ), + 'language' => apply_filters( 'ep_analyzer_language', 'english', 'analyzer_default' ), + ), + 'shingle_analyzer' => array( + 'type' => 'custom', + 'tokenizer' => 'standard', + 'filter' => array( 'lowercase', 'shingle_filter' ), + ), + 'ewp_lowercase' => array( + 'type' => 'custom', + 'tokenizer' => 'keyword', + 'filter' => array( 'lowercase' ), + ), + ), + 'filter' => array( + 'shingle_filter' => array( + 'type' => 'shingle', + 'min_shingle_size' => 2, + 'max_shingle_size' => 5, + ), + 'ewp_word_delimiter' => array( + 'type' => 'word_delimiter', + 'preserve_original' => true, + ), + 'ewp_snowball' => array( + 'type' => 'snowball', + 'language' => apply_filters( 'ep_analyzer_language', 'english', 'filter_ewp_snowball' ), + ), + 'edge_ngram' => array( + 'side' => 'front', + 'max_gram' => 10, + 'min_gram' => 3, + 'type' => 'edgeNGram', + ), + ), + 'normalizer' => array( + 'lowerasciinormalizer' => array( + 'type' => 'custom', + 'filter' => array( 'lowercase', 'asciifolding' ), + ), + ), + ), + ), + 'mappings' => array( + 'post' => array( + 'date_detection' => false, + 'dynamic_templates' => array( + array( + 'template_meta' => array( + 'path_match' => 'post_meta.*', + 'mapping' => array( + 'type' => 'text', + 'path' => 'full', + 'fields' => array( + '{name}' => array( + 'type' => 'text', + ), + 'raw' => array( + 'type' => 'keyword', + 'ignore_above' => 10922, + ), + ), + ), + ), + ), + array( + 'template_meta_types' => array( + 'path_match' => 'meta.*', + 'mapping' => array( + 'type' => 'object', + 'path' => 'full', + 'properties' => array( + 'value' => array( + 'type' => 'text', + 'fields' => array( + 'sortable' => array( + 'type' => 'keyword', + 'ignore_above' => 10922, + 'normalizer' => 'lowerasciinormalizer', + ), + 'raw' => array( + 'type' => 'keyword', + 'ignore_above' => 10922, + ), + ), + ), + 'raw' => array( /* Left for backwards compat */ + 'type' => 'keyword', + 'ignore_above' => 10922, + ), + 'long' => array( + 'type' => 'long', + ), + 'double' => array( + 'type' => 'double', + ), + 'boolean' => array( + 'type' => 'boolean', + ), + 'date' => array( + 'type' => 'date', + 'format' => 'yyyy-MM-dd', + ), + 'datetime' => array( + 'type' => 'date', + 'format' => 'yyyy-MM-dd HH:mm:ss', + ), + 'time' => array( + 'type' => 'date', + 'format' => 'HH:mm:ss', + ), + ), + ), + ), + ), + array( + 'template_terms' => array( + 'path_match' => 'terms.*', + 'mapping' => array( + 'type' => 'object', + 'path' => 'full', + 'properties' => array( + 'name' => array( + 'type' => 'text', + 'fields' => array( + 'raw' => array( + 'type' => 'keyword', + ), + 'sortable' => array( + 'type' => 'keyword', + 'normalizer' => 'lowerasciinormalizer', + ), + ), + ), + 'term_id' => array( + 'type' => 'long', + ), + 'term_taxonomy_id' => array( + 'type' => 'long', + ), + 'parent' => array( + 'type' => 'long', + ), + 'slug' => array( + 'type' => 'keyword', + ), + ), + ), + ), + ), + array( + 'term_suggest' => array( + 'path_match' => 'term_suggest_*', + 'mapping' => array( + 'type' => 'completion', + 'analyzer' => 'default', + ), + ), + ), + ), + '_all' => array( + 'analyzer' => 'simple', + ), + 'properties' => array( + 'post_id' => array( + 'type' => 'long', + ), + 'ID' => array( + 'type' => 'long', + ), + 'post_author' => array( + 'type' => 'object', + 'properties' => array( + 'display_name' => array( + 'type' => 'text', + 'fields' => array( + 'raw' => array( + 'type' => 'keyword', + ), + 'sortable' => array( + 'type' => 'keyword', + 'normalizer' => 'lowerasciinormalizer', + ), + ), + ), + 'login' => array( + 'type' => 'text', + 'fields' => array( + 'raw' => array( + 'type' => 'keyword', + ), + 'sortable' => array( + 'type' => 'keyword', + ), + ), + ), + 'id' => array( + 'type' => 'long', + ), + 'raw' => array( + 'type' => 'keyword', + ), + ), + ), + 'post_date' => array( + 'type' => 'date', + 'format' => 'YYYY-MM-dd HH:mm:ss', + ), + 'post_date_gmt' => array( + 'type' => 'date', + 'format' => 'YYYY-MM-dd HH:mm:ss', + ), + 'post_title' => array( + 'type' => 'text', + 'fields' => array( + 'post_title' => array( + 'type' => 'text', + 'analyzer' => 'standard', + ), + 'raw' => array( + 'type' => 'keyword', + 'ignore_above' => 10922, + ), + 'sortable' => array( + 'type' => 'keyword', + 'ignore_above' => 10922, + 'normalizer' => 'lowerasciinormalizer', + ), + ), + ), + 'post_excerpt' => array( + 'type' => 'text', + ), + 'post_content' => array( + 'type' => 'text', + ), + 'post_status' => array( + 'type' => 'keyword', + ), + 'post_name' => array( + 'type' => 'text', + 'fields' => array( + 'post_name' => array( + 'type' => 'text', + ), + 'raw' => array( + 'type' => 'keyword', + 'ignore_above' => 10922, + ), + ), + ), + 'post_modified' => array( + 'type' => 'date', + 'format' => 'YYYY-MM-dd HH:mm:ss', + ), + 'post_modified_gmt' => array( + 'type' => 'date', + 'format' => 'YYYY-MM-dd HH:mm:ss', + ), + 'post_parent' => array( + 'type' => 'long', + ), + 'post_type' => array( + 'type' => 'text', + 'fields' => array( + 'post_type' => array( + 'type' => 'text', + ), + 'raw' => array( + 'type' => 'keyword', + ), + ), + ), + 'post_mime_type' => array( + 'type' => 'keyword', + ), + 'permalink' => array( + 'type' => 'keyword', + ), + 'guid' => array( + 'type' => 'keyword', + ), + 'terms' => array( + 'type' => 'object', + ), + 'post_meta' => array( + 'type' => 'object', + ), + 'meta' => array( + 'type' => 'object', + ), + 'date_terms' => array( + 'type' => 'object', + 'properties' => array( + 'year' => array( //4 digit year (e.g. 2011) + 'type' => 'integer', + ), + 'month' => array( //Month number (from 1 to 12) alternate name 'monthnum' + 'type' => 'integer', + ), + 'm' => array( //YearMonth (For e.g.: 201307) + 'type' => 'integer', + ), + 'week' => array( //Week of the year (from 0 to 53) alternate name 'w' + 'type' => 'integer', + ), + 'day' => array( //Day of the month (from 1 to 31) + 'type' => 'integer', + ), + 'dayofweek' => array( //Accepts numbers 1-7 (1 is Sunday) + 'type' => 'integer', + ), + 'dayofweek_iso' => array( //Accepts numbers 1-7 (1 is Monday) + 'type' => 'integer', + ), + 'dayofyear' => array( //Accepts numbers 1-366 + 'type' => 'integer', + ), + 'hour' => array( //Hour (from 0 to 23) + 'type' => 'integer', + ), + 'minute' => array( //Minute (from 0 to 59) + 'type' => 'integer', + ), + 'second' => array( //Second (0 to 59) + 'type' => 'integer', + ), + ), + ), + ), + ), + ), +); From a12dc3ca621d756f7a8aed0cbd6c01e9905c0734 Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Thu, 13 Jul 2017 15:50:45 -0600 Subject: [PATCH 31/96] TravisCI - support multiple ES versions (5.0 and 5.2) --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b4e2edcbc..60b9bf4423 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,11 @@ php: - "5.5" env: - - WP_VERSION=latest WP_MULTISITE=1 + - WP_VERSION=latest WP_MULTISITE=1 ES_VERSION="5.0.2" + - WP_VERSION=latest WP_MULTISITE=1 ES_VERSION="5.2.2" before_install: - - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.deb && sudo dpkg -i --force-confnew elasticsearch-5.2.2.deb && sudo service elasticsearch restart + - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.deb && sudo dpkg -i --force-confnew elasticsearch-$ES_VERSION.deb && sudo service elasticsearch restart before_script: - composer install --dev From 91d17948e034712ee6b1e4b0e4f850f46122c1bd Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Tue, 18 Jul 2017 10:00:05 +0200 Subject: [PATCH 32/96] Changed label and moved tests into tests/features/ directory --- features/search/search.php | 2 +- tests/{ => features}/test-decaying-configuration.php | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/{ => features}/test-decaying-configuration.php (100%) diff --git a/features/search/search.php b/features/search/search.php index f21418c233..e0da5a3c9d 100644 --- a/features/search/search.php +++ b/features/search/search.php @@ -273,7 +273,7 @@ function ep_integrate_search_box_settings( $feature ) { $decaying_settings = wp_parse_args( $decaying_settings, $feature->default_settings ); ?>
-
+

diff --git a/tests/test-decaying-configuration.php b/tests/features/test-decaying-configuration.php similarity index 100% rename from tests/test-decaying-configuration.php rename to tests/features/test-decaying-configuration.php From 477faf5212ae1738c7b5abd8b644c2380d3ea806 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Tue, 18 Jul 2017 10:06:19 +0200 Subject: [PATCH 33/96] Updated SASS file --- assets/css/admin.css | 3 ++- assets/css/admin.css.map | 10 +++++++++- assets/css/admin.scss | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index aaaec24976..be9d844471 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -272,7 +272,7 @@ h2.ep-list-features { display: block; float: left; margin-right: 3em; - min-width: 115px; } + min-width: 135px; } .ep-feature .settings .field .input-wrap { display: block; float: left; } @@ -400,4 +400,5 @@ h2.ep-list-features { vertical-align: middle; display: inline-block; padding-top: .5em; } } + /*# sourceMappingURL=admin.css.map */ \ No newline at end of file diff --git a/assets/css/admin.css.map b/assets/css/admin.css.map index 8fb15cdb2d..066412c1ac 100644 --- a/assets/css/admin.css.map +++ b/assets/css/admin.css.map @@ -1 +1,9 @@ -{"version":3,"sources":["admin.scss"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;EAEC,WAAU;EACP,mBAAkB,EACrB;;AAED;EACC,YAAW;EACX,kBAAiB;EACjB,qBAAoB,EACpB;;AAED;;EAEC,mBAAkB;EAClB,YAAW;EACX,cAAa;EACb,oBAAmB,EACnB;;AAED;EACC,cAAa,EACb;;AAED;;GAEG;AAEH;EACC,uBAAsB;EACtB,mBAAkB;EAClB,mBAAkB;EAClB,mBAAkB;EAClB,oBAAmB;EACnB,iBAAgB;EAChB,oBAAmB;EACnB,8BAA6B;EAC7B,WAAU,EACV;;AAED;EACC,aAAY;EACZ,YAAW;EACX,eAAc,EACd;;AAED;EACC,YAAW,EACX;;AAED;EACC,aAAY;EACZ,mBAAkB;EAClB,aAAY;EACZ,kBAAiB;EACjB,sBAAqB,EACrB;;AAED;EACC,gBAAe;EACf,mBAAkB;EAClB,UAAS,EACT;;AAED;EACC,gBAAe;EACf,uBAAsB;EACtB,eAAc;EACd,mBAAkB;EAClB,UAAS;EACT,iBAAgB;EAChB,gBAAe,EACf;;AAED;;;EAGC,SAAQ;EACR,gBAAe,EACf;;AAED;;;EAGC,cAAa,EACb;;AAED;EACC,cAAa;EACb,YAAW;EACX,aAAY;EACZ,mBAAkB;EAClB,kBAAiB;EACd,uBAAsB;EACtB,mBAAkB,EACrB;;AAED;EACC,oBAAmB;EACnB,YAAW;EACX,mBAAkB;EAClB,UAAS;EACT,QAAO;EACP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C,cAAa,EACb;;AAED;EACC,mBAAkB;EAClB,0BAAyB;EACzB,2BAA0B;EAC1B,eAAc;EACd,YAAW,EACX;;AAED;EACC,mBAAkB;EAClB,0BAAyB;EACzB,eAAc;EACd,sBAAqB;EACrB,gBAAe;EACf,sBAAqB;EACrB,mBAAkB;EAClB,gDAA4C,EAC5C;;AAED;EACC,uBAAsB;EACtB,eAAc,EACd;;AAED;;GAEG;AAEH;EACC;IACC,gCAA+B;IAC/B,wBAAuB,EAAA;EAExB;IACC,kCAAiC;IACjC,0BAAyB,EAAA,EAAA;;AAI3B;EACC;IACC,gCAA+B;IAC/B,wBAAuB,EAAA;EAExB;IACC,kCAAiC;IACjC,0BAAyB,EAAA,EAAA;;AAI3B;EACC;IACC,YAAW;IACX,WAAU,EACV;EAED;IACC,eAAc;IACd,kBAAiB;IACjB,WAAU;IACV,eAAc;IACd,aAAY;IACZ,aAAY,EACZ;EAED;IACC,eAAc;IACd,YAAW;IACX,uBAAsB;IACtB,oBAAmB;IACnB,WAAU,EACV;EAED;IACC,eAAc;IACd,aAAY;IACZ,uBAAsB;IACtB,mBAAkB;IAClB,WAAU,EACV;EAED;IACC,YAAW;IACX,WAAU;IACV,uBAAsB;IACtB,sBAAqB;IACrB,kBAAiB,EACjB,EAAA","file":"admin.css"} \ No newline at end of file +{ + "version": 3, + "file": "admin.css", + "sources": [ + "admin.scss" + ], + "names": [], + "mappings": "AAKA;;GAEG;AAEH,AAAM,KAAD,CAAC,OAAO;AACb,AAAQ,KAAH,GAAG,EAAE,CAAC;EACV,OAAO,EAAE,CAAC;EACP,QAAQ,EAAE,QAAQ,GACrB;;AAED,AAAM,KAAD,CAAC,EAAE,CAAC;EACR,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,IAAI;EACjB,MAAM,EAAE,YAAY,GACpB;;AAED,AAAQ,OAAD,CAAC,WAAW;AACnB,AAAQ,OAAD,CAAC,WAAW,CAAC;EACnB,WAAW,EAAE,KAAK;EAClB,KAAK,EAAE,IA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AAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,UAAU;IACtB,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,GAAG,GACV;EAED,AAAa,YAAD,CAAC,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,GAAG,GACV;EAED,AAAY,WAAD,CAAC,gBAAgB,CAAC;IAC5B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,CAAC;IACV,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,YAAY;IACrB,WAAW,EAAE,IAAI,GACjB" +} \ No newline at end of file diff --git a/assets/css/admin.scss b/assets/css/admin.scss index e43bb7c774..55daf560f8 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -345,7 +345,7 @@ h2.ep-list-features { display: block; float: left; margin-right: 3em; - min-width: 115px; + min-width: 135px; } .input-wrap { From f8e52b042bfb2fb5209084462599fbc89ff773ac Mon Sep 17 00:00:00 2001 From: IWriteThings Date: Tue, 18 Jul 2017 09:03:27 -0700 Subject: [PATCH 34/96] Update class-ep-config.php The word occurring is spelled incorrectly. --- classes/class-ep-config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class-ep-config.php b/classes/class-ep-config.php index fc4d7d7ac4..f2ac221f9f 100644 --- a/classes/class-ep-config.php +++ b/classes/class-ep-config.php @@ -54,7 +54,7 @@ public function is_indexing() { } /** - * Check if wpcli indexing is occuring + * Check if wpcli indexing is occurring * * @since 2.1 * @return boolean From 12bd5f1defbd5ec94d197ef66d06832b55a9eb2d Mon Sep 17 00:00:00 2001 From: IWriteThings Date: Tue, 18 Jul 2017 09:04:09 -0700 Subject: [PATCH 35/96] Update class-ep-dashboard.php The word occurring is spelled incorrectly. --- classes/class-ep-dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class-ep-dashboard.php b/classes/class-ep-dashboard.php index 600db777f4..965167aa73 100644 --- a/classes/class-ep-dashboard.php +++ b/classes/class-ep-dashboard.php @@ -740,7 +740,7 @@ public function action_admin_enqueue_dashboard_scripts() { $data['sync_paused'] = esc_html__( 'Sync paused', 'elasticpress' ); $data['sync_syncing'] = esc_html__( 'Syncing', 'elasticpress' ); $data['sync_initial'] = esc_html__( 'Starting sync', 'elasticpress' ); - $data['sync_wpcli'] = esc_html__( "WP CLI sync is occuring. Refresh the page to see if it's finished", 'elasticpress' ); + $data['sync_wpcli'] = esc_html__( "WP CLI sync is occurring. Refresh the page to see if it's finished", 'elasticpress' ); $data['sync_error'] = esc_html__( 'An error occured while syncing', 'elasticpress' ); wp_localize_script( 'ep_dashboard_scripts', 'epDash', $data ); From 8c6204ca430b45d6ab0f66938aabca8650aff5fc Mon Sep 17 00:00:00 2001 From: IWriteThings Date: Tue, 18 Jul 2017 09:05:02 -0700 Subject: [PATCH 36/96] Update elasticpress.pot Occurring is spelled wrong. Fixed. --- lang/elasticpress.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot index 787d221db5..cb481c3e11 100644 --- a/lang/elasticpress.pot +++ b/lang/elasticpress.pot @@ -249,7 +249,7 @@ msgid "Starting sync" msgstr "" #: classes/class-ep-dashboard.php:743 -msgid "WP CLI sync is occuring. Refresh the page to see if it's finished" +msgid "WP CLI sync is occurring. Refresh the page to see if it's finished" msgstr "" #: classes/class-ep-dashboard.php:744 @@ -497,4 +497,4 @@ msgstr "" #. Author URI of the plugin/theme msgid "http://10up.com" -msgstr "" \ No newline at end of file +msgstr "" From e7effcc258a41794cce229452edf4a1c924b910c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Mon, 31 Jul 2017 15:20:00 +0200 Subject: [PATCH 37/96] Update @since versions --- classes/class-ep-wp-query-integration.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/class-ep-wp-query-integration.php b/classes/class-ep-wp-query-integration.php index 90c1c86a72..8981d9073c 100644 --- a/classes/class-ep-wp-query-integration.php +++ b/classes/class-ep-wp-query-integration.php @@ -194,7 +194,7 @@ public function filter_found_posts_query( $sql, $query ) { /** * Workaround for when WP_Query short circuits for special fields arguments. * - * @since 2.2.1 + * @since 2.4.0 * * @param array $posts * Return an array of post data to short-circuit WP's query, @@ -329,7 +329,7 @@ public function filter_posts_request( $request, $query ) { /** * Format the ES hits/results as post objects. * - * @since 2.2.1 + * @since 2.4.0 * * @param array $posts The posts that should be formatted. * @param array $new_posts Array of posts from cache. @@ -394,7 +394,7 @@ protected function format_hits_as_posts( $posts, $new_posts ) { /** * Format the ES hits/results as an array of ids. * - * @since 2.2.1 + * @since 2.4.0 * * @param array $posts The posts that should be formatted. * @param array $new_posts Array of posts from cache. @@ -412,7 +412,7 @@ protected function format_hits_as_ids( $posts, $new_posts ) { /** * Format the ES hits/results as objects containing id and parent id. * - * @since 2.2.1 + * @since 2.4.0 * * @param array $posts The posts that should be formatted. * @param array $new_posts Array of posts from cache. From e2a93a1b2b926d753b82933026843fb9c28afbaf Mon Sep 17 00:00:00 2001 From: Allan Collins Date: Mon, 31 Jul 2017 14:42:53 -0600 Subject: [PATCH 38/96] Adding normalizer for login sortable in 5.2 mappings. --- includes/mappings/5-2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/mappings/5-2.php b/includes/mappings/5-2.php index 203e08b665..c4dff2ce8a 100644 --- a/includes/mappings/5-2.php +++ b/includes/mappings/5-2.php @@ -211,6 +211,7 @@ ), 'sortable' => array( 'type' => 'keyword', + 'normalizer' => 'lowerasciinormalizer', ), ), ), From 720d15eff33fa7a44827ee2c0b7060e76e07abac Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 10 Aug 2017 23:15:01 -0400 Subject: [PATCH 39/96] Increment to version 2.4 --- elasticpress.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index 09ef3d9fdf..85d2696641 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -3,7 +3,7 @@ /** * Plugin Name: ElasticPress * Description: A fast and flexible search and query engine for WordPress. - * Version: 2.3.2 + * Version: 2.4 * Author: Taylor Lovett, Matt Gross, Aaron Holbrook, 10up * Author URI: http://10up.com * License: GPLv2 or later @@ -22,7 +22,7 @@ define( 'EP_URL', plugin_dir_url( __FILE__ ) ); define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); -define( 'EP_VERSION', '2.3.2' ); +define( 'EP_VERSION', '2.4' ); /** * We compare the current ES version to this compatibility version number. Compatibility is true when: From 333dd808db9e31edd0af97f20977e8f4765781cb Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sat, 12 Aug 2017 18:55:08 -0400 Subject: [PATCH 40/96] Add query request type and add an action for catching errors; up timeouts on delete and put mapping --- classes/class-ep-api.php | 50 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 724dde6c34..ed350dca2d 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -100,7 +100,7 @@ public function index_post( $post, $blocking = true ) { 'blocking' => $blocking, ); - $request = ep_remote_request( $path, apply_filters( 'ep_index_post_request_args', $request_args, $post ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_index_post_request_args', $request_args, $post ), array(), 'index_post' ); do_action( 'ep_index_post_retrieve_raw_response', $request, $post, $path ); @@ -138,7 +138,7 @@ public function refresh_index() { $request_args = array( 'method' => 'POST' ); - $request = ep_remote_request( '_refresh', apply_filters( 'ep_refresh_index_request_args', $request_args ) ); + $request = ep_remote_request( '_refresh', apply_filters( 'ep_refresh_index_request_args', $request_args ), array(), 'refresh_index' ); if ( ! is_wp_error( $request ) ) { if ( isset( $request['response']['code'] ) && 200 === $request['response']['code'] ) { @@ -212,7 +212,7 @@ public function query( $args, $query_args, $scope = 'current' ) { 'method' => 'POST', ); - $request = ep_remote_request( $path, apply_filters( 'ep_search_request_args', $request_args, $args, $scope, $query_args ), $query_args ); + $request = ep_remote_request( $path, apply_filters( 'ep_search_request_args', $request_args, $args, $scope, $query_args ), $query_args, 'query' ); $remote_req_res_code = intval( wp_remote_retrieve_response_code( $request ) ); @@ -308,7 +308,7 @@ public function delete_post( $post_id, $blocking = true ) { $request_args = array( 'method' => 'DELETE', 'timeout' => 15, 'blocking' => $blocking ); - $request = ep_remote_request( $path, apply_filters( 'ep_delete_post_request_args', $request_args, $post_id ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_delete_post_request_args', $request_args, $post_id ), array(), 'delete_post' ); if ( ! is_wp_error( $request ) ) { $response_body = wp_remote_retrieve_body( $request ); @@ -371,7 +371,7 @@ public function get_post( $post_id ) { $request_args = array( 'method' => 'GET' ); - $request = ep_remote_request( $path, apply_filters( 'ep_get_post_request_args', $request_args, $post_id ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_get_post_request_args', $request_args, $post_id ), array(), 'get_post' ); if ( ! is_wp_error( $request ) ) { $response_body = wp_remote_retrieve_body( $request ); @@ -398,7 +398,7 @@ public function delete_network_alias() { $request_args = array( 'method' => 'DELETE' ); - $request = ep_remote_request( $path, apply_filters( 'ep_delete_network_alias_request_args', $request_args ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_delete_network_alias_request_args', $request_args ), array(), 'delete_network_alias' ); if ( ! is_wp_error( $request ) && ( 200 >= wp_remote_retrieve_response_code( $request ) && 300 > wp_remote_retrieve_response_code( $request ) ) ) { $response_body = wp_remote_retrieve_body( $request ); @@ -440,7 +440,7 @@ public function create_network_alias( $indexes ) { 'method' => 'POST', ); - $request = ep_remote_request( $path, apply_filters( 'ep_create_network_alias_request_args', $request_args, $args, $indexes ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_create_network_alias_request_args', $request_args, $args, $indexes ), array(), 'create_network_alias' ); if ( ! is_wp_error( $request ) && ( 200 >= wp_remote_retrieve_response_code( $request ) && 300 > wp_remote_retrieve_response_code( $request ) ) ) { $response_body = wp_remote_retrieve_body( $request ); @@ -504,9 +504,10 @@ public function put_mapping() { $request_args = array( 'body' => json_encode( $mapping ), 'method' => 'PUT', + 'timeout' => 30, ); - $request = ep_remote_request( $index, apply_filters( 'ep_put_mapping_request_args', $request_args ) ); + $request = ep_remote_request( $index, apply_filters( 'ep_put_mapping_request_args', $request_args ), array(), 'put_mapping' ); $request = apply_filters( 'ep_config_mapping_request', $request, $index, $mapping ); @@ -905,9 +906,9 @@ public function delete_index( $index_name = null ) { $index = ( null === $index_name ) ? ep_get_index_name() : sanitize_text_field( $index_name ); - $request_args = array( 'method' => 'DELETE' ); + $request_args = array( 'method' => 'DELETE', 'timeout' => 30, ); - $request = ep_remote_request( $index, apply_filters( 'ep_delete_index_request_args', $request_args ) ); + $request = ep_remote_request( $index, apply_filters( 'ep_delete_index_request_args', $request_args ), array(), 'delete_index' ); // 200 means the delete was successful // 404 means the index was non-existent, but we should still pass this through as we will occasionally want to delete an already deleted index @@ -933,7 +934,7 @@ public function index_exists( $index_name = null ) { $request_args = array( 'method' => 'HEAD' ); - $request = ep_remote_request( $index, apply_filters( 'ep_index_exists_request_args', $request_args, $index_name ) ); + $request = ep_remote_request( $index, apply_filters( 'ep_index_exists_request_args', $request_args, $index_name ), array(), 'index_exists' ); // 200 means the index exists // 404 means the index was non-existent @@ -1906,7 +1907,7 @@ public function bulk_index_posts( $body ) { 'timeout' => 30, ); - $request = ep_remote_request( $path, apply_filters( 'ep_bulk_index_posts_request_args', $request_args, $body ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_bulk_index_posts_request_args', $request_args, $body ), array(), 'bulk_index_posts' ); if ( is_wp_error( $request ) ) { return $request; @@ -2088,10 +2089,11 @@ public function get_query_log() { * @param string $path Site URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @param array $query_args Optional. The query args originally passed to WP_Query + * @param string Type of request, used for debugging * * @return WP_Error|array The response or WP_Error on failure. */ - public function remote_request( $path, $args = array(), $query_args = array() ) { + public function remote_request( $path, $args = array(), $query_args = array(), $type = null ) { $query = array( 'time_start' => microtime( true ), @@ -2117,7 +2119,11 @@ public function remote_request( $path, $args = array(), $query_args = array() ) $request = wp_remote_request( $query['url'], $args ); //try the existing host to avoid unnecessary calls - if ( false === $request || is_wp_error( $request ) || ( isset( $request['response']['code'] ) && 0 !== strpos( $request['response']['code'], '20' ) ) ) { + $request_response_code = (int) wp_remote_retrieve_response_code( $request ); + + $is_valid_res = ( $request_response_code >= 200 && $request_response_code <= 299 ); + + if ( false === $request || is_wp_error( $request ) || ! $is_valid_res ) { $failures++; if ( $failures >= apply_filters( 'ep_max_remote_request_tries', 1, $path, $args ) ) { @@ -2141,6 +2147,10 @@ public function remote_request( $path, $args = array(), $query_args = array() ) $query['request'] = $request; $this->_add_query_log( $query ); + if ( false === $request || is_wp_error( $request ) || ! $is_valid_res ) { + do_action( 'ep_remote_request_error', $query, $type ); + } + return $request; } @@ -2351,7 +2361,7 @@ public function get_pipeline( $id ) { 'method' => 'GET', ); - $request = ep_remote_request( $path, apply_filters( 'ep_get_pipeline_args', $request_args ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_get_pipeline_args', $request_args ), array(), 'get_pipeline' ); if ( is_wp_error( $request ) ) { return $request; @@ -2388,7 +2398,7 @@ public function create_pipeline( $id, $args ) { 'method' => 'PUT', ); - $request = ep_remote_request( $path, apply_filters( 'ep_get_pipeline_args', $request_args ) ); + $request = ep_remote_request( $path, apply_filters( 'ep_get_pipeline_args', $request_args ), array(), 'create_pipeline' ); if ( is_wp_error( $request ) ) { return $request; @@ -2441,7 +2451,7 @@ public function get_index_status( $blog_id = null ) { } - $request = ep_remote_request( $path, array( 'method' => 'GET' ) ); + $request = ep_remote_request( $path, array( 'method' => 'GET' ), array(), 'get_index_status' ); } @@ -2492,7 +2502,7 @@ public function get_search_status( $blog_id = null ) { } - $request = ep_remote_request( $path, array( 'method' => 'GET' ) ); + $request = ep_remote_request( $path, array( 'method' => 'GET' ), array(), 'get_search_status' ); } @@ -2619,8 +2629,8 @@ function ep_format_request_headers() { return EP_API::factory()->format_request_headers(); } -function ep_remote_request( $path, $args = array(), $query_args = array() ) { - return EP_API::factory()->remote_request( $path, $args, $query_args ); +function ep_remote_request( $path, $args = array(), $query_args = array(), $type = null ) { + return EP_API::factory()->remote_request( $path, $args, $query_args, $type ); } function ep_get_query_log() { From 3d038c5a062c298518df7fc7cd02a23d94a25e0f Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sat, 12 Aug 2017 19:21:42 -0400 Subject: [PATCH 41/96] Set default method in remote request --- classes/class-ep-api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index ed350dca2d..36aa02b7cf 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -2095,6 +2095,10 @@ public function get_query_log() { */ public function remote_request( $path, $args = array(), $query_args = array(), $type = null ) { + if ( empty( $args['method'] ) ) { + $args['method'] = 'GET'; + } + $query = array( 'time_start' => microtime( true ), 'time_finish' => false, From a2e97b9b86f8bed3b77fac67dd83d5ac8423ce09 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sat, 12 Aug 2017 19:56:59 -0400 Subject: [PATCH 42/96] Log all queries not just errors --- classes/class-ep-api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 36aa02b7cf..e4fa48e85c 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -2151,9 +2151,7 @@ public function remote_request( $path, $args = array(), $query_args = array(), $ $query['request'] = $request; $this->_add_query_log( $query ); - if ( false === $request || is_wp_error( $request ) || ! $is_valid_res ) { - do_action( 'ep_remote_request_error', $query, $type ); - } + do_action( 'ep_remote_request', $query, $type ); return $request; From aedb60de0585c4c3d003a6ebe7669316be73bd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Sun, 13 Aug 2017 23:24:02 +0200 Subject: [PATCH 43/96] Add shipping class taxonomy to supported tax'es --- features/woocommerce/woocommerce.php | 1 + 1 file changed, 1 insertion(+) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 3e7e517b5e..4636775707 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -234,6 +234,7 @@ function ep_wc_translate_args( $query ) { 'product_type', 'pa_sort-by', 'product_visibility', + 'product_shipping_class', ); /** From b74285aa2279e0df89a25e2934edb77915dfff47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Philip=20Kallehauge?= Date: Mon, 14 Aug 2017 02:37:48 +0200 Subject: [PATCH 44/96] WooCommerce: searchable order item names --- features/woocommerce/woocommerce.php | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index f419a428cf..d9bf87bc0f 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -417,6 +417,7 @@ function ep_wc_translate_args( $query ) { '_billing_first_name', '_shipping_first_name', '_shipping_last_name', + '_items', ) ) ); $query->set( 'search_fields', $search_fields ); @@ -594,6 +595,36 @@ function ep_wc_search_order( $wp ){ } } +/** + * Add order items as a searchable string. + * + * @since TBD + * + * @param array $post_args + * @param string|int $post_id + * + * @return array + */ +function ep_wc_add_order_items_search( $post_args, $post_id ) { + // Make sure it is only WooCommerce orders we touch. + if ( 'shop_order' !== $post_args['post_type'] ) { + return $post_args; + } + + // Get order items. + $order = wc_get_order( $post_id ); + $item_meta = array(); + foreach( $order->get_items() as $delta => $product_item ) { + $item_meta['_items'][] = $product_item->get_name( 'edit' ); + } + + // Prepare order items. + $item_meta['_items'] = implode( '|', $item_meta['_items'] ); + $post_args['meta'] = array_merge( $post_args['meta'], EP_API::factory()->prepare_meta_types( $item_meta ) ); + + return $post_args; +} + /** * Setup all feature filters * @@ -609,6 +640,7 @@ function ep_wc_setup() { add_filter( 'woocommerce_unfiltered_product_ids', 'ep_wc_convert_post_object_to_id', 10, 4 ); add_filter( 'ep_sync_taxonomies', 'ep_wc_whitelist_taxonomies', 10, 2 ); add_filter( 'ep_post_sync_args_post_prepare_meta', 'ep_wc_remove_legacy_meta', 10, 2 ); + add_filter( 'ep_post_sync_args_post_prepare_meta', 'ep_wc_add_order_items_search', 20, 2 ); add_action( 'pre_get_posts', 'ep_wc_translate_args', 11, 1 ); add_action( 'parse_query', 'ep_wc_search_order', 11, 1 ); } From dbc818fef34f0b282b3b4d0482c47aead93e8286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Philip=20Kallehauge?= Date: Mon, 14 Aug 2017 02:43:52 +0200 Subject: [PATCH 45/96] WP code standards --- features/woocommerce/woocommerce.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index d9bf87bc0f..2fba95fc93 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -612,15 +612,15 @@ function ep_wc_add_order_items_search( $post_args, $post_id ) { } // Get order items. - $order = wc_get_order( $post_id ); + $order = wc_get_order( $post_id ); $item_meta = array(); - foreach( $order->get_items() as $delta => $product_item ) { + foreach ( $order->get_items() as $delta => $product_item ) { $item_meta['_items'][] = $product_item->get_name( 'edit' ); } // Prepare order items. $item_meta['_items'] = implode( '|', $item_meta['_items'] ); - $post_args['meta'] = array_merge( $post_args['meta'], EP_API::factory()->prepare_meta_types( $item_meta ) ); + $post_args['meta'] = array_merge( $post_args['meta'], EP_API::factory()->prepare_meta_types( $item_meta ) ); return $post_args; } From 6e294e773606c2f40e3385a27ba5942e11fa3bd2 Mon Sep 17 00:00:00 2001 From: Matt Gross Date: Wed, 16 Aug 2017 16:02:16 -0400 Subject: [PATCH 46/96] Add filter on the admin notices to more granularly control them. --- classes/class-ep-dashboard.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/class-ep-dashboard.php b/classes/class-ep-dashboard.php index 965167aa73..3a4a5ce499 100644 --- a/classes/class-ep-dashboard.php +++ b/classes/class-ep-dashboard.php @@ -273,6 +273,8 @@ public function maybe_notice( $force = false ) { $notice = 'need-setup'; } + $notice = apply_filters( 'ep_admin_notice_type', $notice ); + switch ( $notice ) { case 'bad-host': if ( defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) { From ea7d2a05f10f4ff329d9c77f1192a53b610da6a1 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 17 Aug 2017 17:14:04 -0400 Subject: [PATCH 47/96] Fix date sorting test --- tests/test-single-site.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-single-site.php b/tests/test-single-site.php index 94d1277ee2..d5b8199283 100644 --- a/tests/test-single-site.php +++ b/tests/test-single-site.php @@ -1663,7 +1663,7 @@ public function testSearchPostMetaNumMultipleOrderbyQuery() { * @group single-site */ public function testSearchPostDateOrderbyQuery() { - ep_create_and_sync_post( array( 'post_title' => 'ordertes 333' ) ); + ep_create_and_sync_post( array( 'post_title' => 'ordertesr' ) ); sleep( 3 ); ep_create_and_sync_post( array( 'post_title' => 'ordertest 111' ) ); @@ -1685,7 +1685,7 @@ public function testSearchPostDateOrderbyQuery() { $this->assertEquals( 3, $query->found_posts ); $this->assertEquals( 'Ordertest 222', $query->posts[0]->post_title ); $this->assertEquals( 'ordertest 111', $query->posts[1]->post_title ); - $this->assertEquals( 'ordertes 333', $query->posts[2]->post_title ); + $this->assertEquals( 'ordertesr', $query->posts[2]->post_title ); } /** From 1fa596b71d3391c247cc183bd6fbfe921946d999 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Fri, 18 Aug 2017 22:29:17 -0400 Subject: [PATCH 48/96] Properly namespace functions --- features/documents/documents.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/documents/documents.php b/features/documents/documents.php index 4dc065f45a..5a59da3676 100644 --- a/features/documents/documents.php +++ b/features/documents/documents.php @@ -10,8 +10,8 @@ function ep_documents_setup() { add_filter( 'ep_post_sync_args', 'ep_documents_post_sync_args', 999, 2 ); add_filter( 'ep_indexable_post_status', 'ep_documents_indexable_post_status', 999, 1 ); add_filter( 'ep_bulk_index_post_request_path', 'ep_documents_bulk_index_post_request_path', 999, 1 ); - add_filter( 'pre_get_posts', 'search_attachment_post_type' ); - add_filter( 'ep_config_mapping', 'attachments_mapping' ); + add_filter( 'pre_get_posts', 'ep_documents_search_attachment_post_type' ); + add_filter( 'ep_config_mapping', 'ep_documents_attachments_mapping' ); add_action( 'ep_cli_put_mapping', 'ep_documents_create_pipeline' ); add_action( 'ep_dashboard_put_mapping', 'ep_documents_create_pipeline' ); } @@ -23,7 +23,7 @@ function ep_documents_setup() { * @since 2.3 * @return array */ -function attachments_mapping( $mapping ) { +function ep_documents_attachments_mapping( $mapping ) { $mapping['mappings']['post']['properties']['attachments'] = array( 'type' => 'object', ); @@ -40,7 +40,7 @@ function attachments_mapping( $mapping ) { * @param WP_Query $query * @since 2.3 */ -function search_attachment_post_type( $query ) { +function ep_documents_search_attachment_post_type( $query ) { if ( is_admin() ) { return; } From 38d100d0db93814495ceebba9a812dba4b3b74ca Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 22 Aug 2017 13:54:44 -0400 Subject: [PATCH 49/96] Continue --- Gruntfile.js | 24 +- assets/css/admin.css | 10 +- assets/css/admin.css.map | 2 +- assets/css/admin.min.css | 2 +- assets/css/admin.scss | 10 +- assets/css/autosuggest.css | 34 ++ assets/css/autosuggest.css.map | 1 + assets/css/autosuggest.min.css | 1 + assets/js/admin.min.js | 2 +- assets/js/dashboard.min.js | 2 +- assets/js/src/dashboard.js | 2 + classes/class-ep-feature.php | 29 +- elasticpress.php | 1 + .../autosuggest/assets/css/autosuggest.css | 37 +++ .../assets/css/autosuggest.css.map | 9 + .../autosuggest/assets/css/autosuggest.scss | 50 +++ .../autosuggest/assets/js/autosuggest.min.js | 1 + .../autosuggest/assets/js/src/autosuggest.js | 310 ++++++++++++++++++ features/autosuggest/autosuggest.php | 194 +++++++++++ lang/elasticpress.pot | 99 +++--- 20 files changed, 744 insertions(+), 76 deletions(-) create mode 100644 assets/css/autosuggest.css create mode 100644 assets/css/autosuggest.css.map create mode 100644 assets/css/autosuggest.min.css create mode 100644 features/autosuggest/assets/css/autosuggest.css create mode 100644 features/autosuggest/assets/css/autosuggest.css.map create mode 100644 features/autosuggest/assets/css/autosuggest.scss create mode 100644 features/autosuggest/assets/js/autosuggest.min.js create mode 100644 features/autosuggest/assets/js/src/autosuggest.js create mode 100644 features/autosuggest/autosuggest.php diff --git a/Gruntfile.js b/Gruntfile.js index ff4c8076fc..c6e2adee11 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,20 +9,15 @@ module.exports = function ( grunt ) { uglify : { production : { - options : { - beautify : false, - preserveComments : false, - mangle : { - except : ['jQuery'] - } - }, - files : { 'assets/js/dashboard.min.js' : [ 'assets/js/src/dashboard.js' ], 'assets/js/admin.min.js' : [ 'assets/js/src/admin.js' + ], + 'features/autosuggest/assets/js/autosuggest.min.js': [ + 'features/autosuggest/assets/js/src/autosuggest.js' ] } } @@ -39,7 +34,7 @@ module.exports = function ( grunt ) { files : { expand : true, flatten : true, - src : ['assets/css/admin.css'], + src : ['assets/css/admin.css', 'features/autosuggest/assets/css/autosuggest.css'], dest : 'assets/css' } @@ -52,7 +47,7 @@ module.exports = function ( grunt ) { files : [{ expand : true, cwd : 'assets/css', - src : ['admin.css'], + src : ['admin.css', 'autosuggest.css'], dest : 'assets/css', ext : '.min.css' }] @@ -72,7 +67,8 @@ module.exports = function ( grunt ) { }, files : { - 'assets/css/admin.css' : 'assets/css/admin.scss', + 'assets/css/admin.css': 'assets/css/admin.scss', + 'features/autosuggest/assets/css/autosuggest.css': 'features/autosuggest/assets/css/autosuggest.scss' } } @@ -100,7 +96,8 @@ module.exports = function ( grunt ) { scripts : { files : [ - 'assets/js/src/*.js' + 'assets/js/src/*.js', + 'features/autosuggest/assets/js/src/*.js' ], tasks : ['uglify:production'] @@ -108,7 +105,8 @@ module.exports = function ( grunt ) { styles : { files : [ - 'assets/css/*.scss' + 'assets/css/*.scss', + 'features/autosuggest/assets/css/*.scss' ], tasks : ['sass', 'autoprefixer', 'cssmin'] } diff --git a/assets/css/admin.css b/assets/css/admin.css index 276f2e9db8..77ae42262c 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -243,7 +243,7 @@ h2.ep-list-features { .ep-feature .settings .action-wrap { clear: both; text-align: right; - margin-top: 10px; + padding-top: 15px; vertical-align: middle; } .ep-feature .settings .action-wrap a { cursor: pointer; @@ -264,12 +264,16 @@ h2.ep-list-features { .ep-feature .settings .field { clear: both; - overflow: initial; } + overflow: initial; + padding-top: 15px; } + .ep-feature .settings .field:first-child { + padding-top: 0; } .ep-feature .settings .field > label, .ep-feature .settings .field .field-name { display: block; float: left; - margin-right: 3em; } + width: 25%; + margin-right: 1.5em; } .ep-feature .settings .field .input-wrap { display: block; float: left; } diff --git a/assets/css/admin.css.map b/assets/css/admin.css.map index 8fb15cdb2d..2e252dceda 100644 --- a/assets/css/admin.css.map +++ b/assets/css/admin.css.map @@ -1 +1 @@ -{"version":3,"sources":["admin.scss"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;EAEC,WAAU;EACP,mBAAkB,EACrB;;AAED;EACC,YAAW;EACX,kBAAiB;EACjB,qBAAoB,EACpB;;AAED;;EAEC,mBAAkB;EAClB,YAAW;EACX,cAAa;EACb,oBAAmB,EACnB;;AAED;EACC,cAAa,EACb;;AAED;;GAEG;AAEH;EACC,uBAAsB;EACtB,mBAAkB;EAClB,mBAAkB;EAClB,mBAAkB;EAClB,oBAAmB;EACnB,iBAAgB;EAChB,oBAAmB;EACnB,8BAA6B;EAC7B,WAAU,EACV;;AAED;EACC,aAA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,YAAW;IACX,WAAU;IACV,uBAAsB;IACtB,sBAAqB;IACrB,kBAAiB,EACjB,EAAA","file":"admin.css"} \ No newline at end of file +{"version":3,"sources":["admin.scss"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;EAEC,WAAU;EACP,mBAAkB,EACrB;;AAED;EACC,YAAW;EACX,kBAAiB;EACjB,qBAAoB,EACpB;;AAED;;EAEC,mBAAkB;EAClB,YAAW;EACX,cAAa;EACb,oBAAmB,EACnB;;AAED;EACC,cAAa,EACb;;AAED;;GAEG;AAEH;EACC,uBAAsB;EACtB,mBAAkB;EAClB,mBAAkB;EAClB,mBAAkB;EAClB,oBAAmB;EACnB,iBAAgB;EAChB,oBAAmB;EACnB,8BAA6B;EAC7B,WAAU,EACV;;AAED;EACC,aAAY;EACZ,YAAW;EACX,eAAc,EACd;;AAED;EACC,YAAW,EACX;;AAED;EACC,aAAY;EACZ,mBAAkB;EAClB,aAAY;EACZ,kBAAiB;EACjB,sBAAqB,EACrB;;AAED;EACC,gBAAe;EACf,mBAAkB;EAClB,UAAS,EACT;;AAED;EACC,gBAAe;EACf,uBAAsB;EACtB,eAAc;EACd,mBAAkB;EAClB,UAAS;EACT,iBAAgB;EAChB,gBAAe,EACf;;AAED;;;EAGC,SAAQ;EACR,gBAAe,EACf;;AAED;;;EAGC,cAAa,EACb;;AAED;EACC,cAAa;EACb,YAAW;EACX,aAAY;EACZ,mBAAkB;EAClB,kBAAiB;EACd,uBAAsB;EACtB,mBAAkB,EACrB;;AAED;EACC,oBAAmB;EACnB,YAAW;EACX,mBAAkB;EAClB,UAAS;EACT,QAAO;EACP,0BAAyB,EACzB;;AAED;;GAEG;AAEH;EACC,eAAc,EACd;;AAED;;EAEC,aAAY;EACZ,eAAc;EACd,gBAAe;EACf,UAAS;EACT,QAAO;EACP,SAAQ;EACR,UAAS;EACT,YAAW;EACX,uBAAsB;EACtB,WAAU,EACV;;AAED;EACC;;;IAGC,UAAS;IACT,YAAW,EACX,EAAA;;AAGF;E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AAkB;EAClB,gDAA4C,EAC5C;;AAED;EACC,uBAAsB;EACtB,eAAc,EACd;;AAED;;GAEG;AAEH;EACC;IACC,gCAA+B;IAC/B,wBAAuB,EAAA;EAExB;IACC,kCAAiC;IACjC,0BAAyB,EAAA,EAAA;;AAI3B;EACC;IACC,gCAA+B;IAC/B,wBAAuB,EAAA;EAExB;IACC,kCAAiC;IACjC,0BAAyB,EAAA,EAAA;;AAI3B;EACC;IACC,YAAW;IACX,WAAU,EACV;EAED;IACC,eAAc;IACd,kBAAiB;IACjB,WAAU;IACV,eAAc;IACd,aAAY;IACZ,aAAY,EACZ;EAED;IACC,eAAc;IACd,YAAW;IACX,uBAAsB;IACtB,oBAAmB;IACnB,WAAU,EACV;EAED;IACC,eAAc;IACd,aAAY;IACZ,uBAAsB;IACtB,mBAAkB;IAClB,WAAU,EACV;EAED;IACC,YAAW;IACX,WAAU;IACV,uBAAsB;IACtB,sBAAqB;IACrB,kBAAiB,EACjB,EAAA","file":"admin.css"} \ No newline at end of file diff --git a/assets/css/admin.min.css b/assets/css/admin.min.css index 996ba0e519..55b503548d 100644 --- a/assets/css/admin.min.css +++ b/assets/css/admin.min.css @@ -1 +1 @@ -.wrap .notice,.wrap>h2{z-index:2;position:relative}.wrap h2{color:#888;line-height:1.75;margin:.5em 0 .75em}#wpbody #update-nag,#wpbody .update-nag{margin-left:-20px;width:100%;margin-top:0;margin-bottom:20px}h2.ep-list-features{display:none}.ep-header-menu{background-color:#fff;position:relative;margin-left:-20px;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:5px;border-bottom:2px solid #ddd;z-index:2}.ep-header-menu:after{content:' ';clear:both;display:block}.ep-header-menu img{float:left}.ep-header-menu .icons{float:right;padding-right:3px;height:39px;line-height:39px;display:inline-block}.ep-header-menu .icons .dashicons-update{font-size:29px;margin-right:10px;top:-3px}.ep-header-menu .icons a{font-size:27px;vertical-align:middle;color:inherit;position:relative;top:-3px;margin-left:8px;cursor:pointer}.ep-header-menu .icons .dashicons-controls-pause,.ep-header-menu .icons .dashicons-controls-play,.ep-header-menu .icons .dashicons-no{top:1px;font-size:30px}.ep-header-menu .cancel-sync,.ep-header-menu .pause-sync,.ep-header-menu .resume-sync{display:none}.ep-header-menu .sync-status{display:none;color:#666;bottom:-1px;position:relative;margin-right:8px;vertical-align:middle;font-style:italic}.ep-header-menu .progress-bar{margin-bottom:-5px;height:5px;position:absolute;bottom:0;left:0;background-color:#d84440}.ep-features{overflow:auto}.error-overlay.cant-connect,.error-overlay.syncing{content:' ';display:block;position:fixed;top:46px;left:0;right:0;bottom:0;opacity:.6;background-color:#fff;z-index:1}@media (min-width:768px){.error-overlay,.error-overlay.cant-connect,.error-overlay.syncing{top:32px;left:160px}}.ep-feature .postbox{margin-bottom:0}.ep-feature .postbox .hndle{cursor:inherit}.ep-feature .postbox .hndle .settings-button{float:right;display:inline-block;font-size:13px;background-color:#efefef;border-radius:4px;padding:4px 7px;margin-top:-4px;cursor:pointer;color:inherit;position:relative;padding-left:23px}.ep-feature .settings-button:before{content:"\f140";font:400 19px/1 dashicons;display:inline-block;color:#72777c;padding:0 5px 0 0;vertical-align:middle;top:4px;position:absolute;left:1px}.ep-feature .settings-button:after{border-radius:50%;content:' ';display:inline-block;vertical-align:middle;width:8px;height:8px;margin-left:10px;margin-top:-2px}.feature-requirements-status-2.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid red}.feature-requirements-status-2.ep-feature .settings .requirements-status-notice{border-color:red}.feature-requirements-status-1.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #e3e600}.feature-requirements-status-1.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#e3e600}.feature-requirements-status-1.ep-feature .settings .requirements-status-notice{border-color:#e3e600}.feature-requirements-status-0.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #6aa000}.feature-requirements-status-0.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#6aa000}.feature-requirements-status-0.ep-feature .settings .requirements-status-notice{border-color:#6aa000}.ep-feature{position:relative;vertical-align:top;margin-bottom:20px}.ep-feature.saving .action-wrap:before{content:' ';vertical-align:middle;margin-right:1.4em;top:4px;border-radius:50%;width:8px;height:8px;display:inline-block;font-size:7px;position:relative;text-indent:-9999em;border-top:5px solid #ccc;border-right:5px solid #ccc;border-bottom:5px solid #ccc;border-left:5px solid #999;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}.ep-feature .description,.ep-feature .settings{margin-bottom:0;text-align:left}.ep-feature .settings{display:none;overflow:auto}.ep-feature .settings h3{margin-top:0;font-size:inherit;font-weight:700}.ep-feature.show-settings .settings{display:block}.ep-feature.show-settings .description{display:none}.ep-feature.show-settings .settings-button:before{content:"\f142"}.ep-feature .settings .requirements-status-notice{border-left:4px solid #6aa000;background-color:#efefef;padding:8px 12px;margin-bottom:10px}.ep-feature .settings .action-wrap{clear:both;text-align:right;margin-top:10px;vertical-align:middle}.ep-feature .settings .action-wrap a{cursor:pointer;display:inline-block}.ep-feature .settings .action-wrap .no-dash-sync{color:#aaa;line-height:27px;padding-right:8px;display:none}.ep-feature .settings .action-wrap a.disabled{cursor:default}.ep-feature .settings .action-wrap .cancel{margin-top:4px;margin-right:6px}.ep-feature.dash-sync-disabled .settings .action-wrap .no-dash-sync{display:inline}.ep-feature .settings .field{clear:both;overflow:initial}.ep-feature .settings .field .field-name,.ep-feature .settings .field>label{display:block;float:left;margin-right:3em}.ep-feature .settings .field .input-wrap{display:block;float:left}.ep-feature .settings .field .disabled{color:#c4c3c3}.ep-feature .settings .field .disabled input{cursor:default}.ep-feature .long{display:none}.ep-feature .long p:last-child{margin-bottom:0}.ep-feature.show-full .long{display:block}.ep-feature .collapse,.ep-feature .learn-more{cursor:pointer}.ep-feature.show-full .learn-more{display:none}.ep-feature .learn-more:after{content:"\f140";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.ep-feature .collapse:after{content:"\f142";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.intro h2{padding:9px 15px 4px 0}.wrap.intro{margin-top:30px;margin-bottom:30px;overflow:auto}.wrap.intro .error,.wrap.intro .is-dismissible,.wrap.intro .notice,.wrap.intro .updated{display:none!important}.features-screenshot{display:none}.setup-message{text-align:center;background-color:#e63e3b;margin:20px -20px 0 -20px;padding:2em 0;clear:both}.setup-message .setup-button{border-radius:5px;background-color:#d73c38;color:#f19ea4;display:inline-block;margin:0 .75em;text-decoration:none;padding:.75em 3em;box-shadow:1px 1px 3px 1px rgba(0,0,0,.25)}.setup-message .setup-button-primary{background-color:#fff;color:#d84440}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media (min-width:768px){.intro .left{float:left;width:30%}.features-screenshot{margin:0 auto;max-width:1000px;width:70%;display:block;height:auto;float:right}.ep-features .left{display:block;float:left;box-sizing:border-box;padding-right:10px;width:50%}.ep-features .right{display:block;float:right;box-sizing:border-box;padding-left:10px;width:50%}.ep-feature .feature-message{float:left;padding:0;vertical-align:middle;display:inline-block;padding-top:.5em}} \ No newline at end of file +.wrap .notice,.wrap>h2{z-index:2;position:relative}.wrap h2{color:#888;line-height:1.75;margin:.5em 0 .75em}#wpbody #update-nag,#wpbody .update-nag{margin-left:-20px;width:100%;margin-top:0;margin-bottom:20px}h2.ep-list-features{display:none}.ep-header-menu{background-color:#fff;position:relative;margin-left:-20px;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:5px;border-bottom:2px solid #ddd;z-index:2}.ep-header-menu:after{content:' ';clear:both;display:block}.ep-header-menu img{float:left}.ep-header-menu .icons{float:right;padding-right:3px;height:39px;line-height:39px;display:inline-block}.ep-header-menu .icons .dashicons-update{font-size:29px;margin-right:10px;top:-3px}.ep-header-menu .icons a{font-size:27px;vertical-align:middle;color:inherit;position:relative;top:-3px;margin-left:8px;cursor:pointer}.ep-header-menu .icons .dashicons-controls-pause,.ep-header-menu .icons .dashicons-controls-play,.ep-header-menu .icons .dashicons-no{top:1px;font-size:30px}.ep-header-menu .cancel-sync,.ep-header-menu .pause-sync,.ep-header-menu .resume-sync{display:none}.ep-header-menu .sync-status{display:none;color:#666;bottom:-1px;position:relative;margin-right:8px;vertical-align:middle;font-style:italic}.ep-header-menu .progress-bar{margin-bottom:-5px;height:5px;position:absolute;bottom:0;left:0;background-color:#d84440}.ep-features{overflow:auto}.error-overlay.cant-connect,.error-overlay.syncing{content:' ';display:block;position:fixed;top:46px;left:0;right:0;bottom:0;opacity:.6;background-color:#fff;z-index:1}@media (min-width:768px){.error-overlay,.error-overlay.cant-connect,.error-overlay.syncing{top:32px;left:160px}}.ep-feature .postbox{margin-bottom:0}.ep-feature .postbox .hndle{cursor:inherit}.ep-feature .postbox .hndle .settings-button{float:right;display:inline-block;font-size:13px;background-color:#efefef;border-radius:4px;padding:4px 7px;margin-top:-4px;cursor:pointer;color:inherit;position:relative;padding-left:23px}.ep-feature .settings-button:before{content:"\f140";font:400 19px/1 dashicons;display:inline-block;color:#72777c;padding:0 5px 0 0;vertical-align:middle;top:4px;position:absolute;left:1px}.ep-feature .settings-button:after{border-radius:50%;content:' ';display:inline-block;vertical-align:middle;width:8px;height:8px;margin-left:10px;margin-top:-2px}.feature-requirements-status-2.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid red}.feature-requirements-status-2.ep-feature .settings .requirements-status-notice{border-color:red}.feature-requirements-status-1.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #e3e600}.feature-requirements-status-1.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#e3e600}.feature-requirements-status-1.ep-feature .settings .requirements-status-notice{border-color:#e3e600}.feature-requirements-status-0.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #6aa000}.feature-requirements-status-0.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#6aa000}.feature-requirements-status-0.ep-feature .settings .requirements-status-notice{border-color:#6aa000}.ep-feature{position:relative;vertical-align:top;margin-bottom:20px}.ep-feature.saving .action-wrap:before{content:' ';vertical-align:middle;margin-right:1.4em;top:4px;border-radius:50%;width:8px;height:8px;display:inline-block;font-size:7px;position:relative;text-indent:-9999em;border-top:5px solid #ccc;border-right:5px solid #ccc;border-bottom:5px solid #ccc;border-left:5px solid #999;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}.ep-feature .description,.ep-feature .settings{margin-bottom:0;text-align:left}.ep-feature .settings{display:none;overflow:auto}.ep-feature .settings h3{margin-top:0;font-size:inherit;font-weight:700}.ep-feature.show-settings .settings{display:block}.ep-feature.show-settings .description{display:none}.ep-feature.show-settings .settings-button:before{content:"\f142"}.ep-feature .settings .requirements-status-notice{border-left:4px solid #6aa000;background-color:#efefef;padding:8px 12px;margin-bottom:10px}.ep-feature .settings .action-wrap{clear:both;text-align:right;padding-top:15px;vertical-align:middle}.ep-feature .settings .action-wrap a{cursor:pointer;display:inline-block}.ep-feature .settings .action-wrap .no-dash-sync{color:#aaa;line-height:27px;padding-right:8px;display:none}.ep-feature .settings .action-wrap a.disabled{cursor:default}.ep-feature .settings .action-wrap .cancel{margin-top:4px;margin-right:6px}.ep-feature.dash-sync-disabled .settings .action-wrap .no-dash-sync{display:inline}.ep-feature .settings .field{clear:both;overflow:initial;padding-top:15px}.ep-feature .settings .field:first-child{padding-top:0}.ep-feature .settings .field .field-name,.ep-feature .settings .field>label{display:block;float:left;width:25%;margin-right:1.5em}.ep-feature .settings .field .input-wrap{display:block;float:left}.ep-feature .settings .field .disabled{color:#c4c3c3}.ep-feature .settings .field .disabled input{cursor:default}.ep-feature .long{display:none}.ep-feature .long p:last-child{margin-bottom:0}.ep-feature.show-full .long{display:block}.ep-feature .collapse,.ep-feature .learn-more{cursor:pointer}.ep-feature.show-full .learn-more{display:none}.ep-feature .learn-more:after{content:"\f140";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.ep-feature .collapse:after{content:"\f142";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.intro h2{padding:9px 15px 4px 0}.wrap.intro{margin-top:30px;margin-bottom:30px;overflow:auto}.wrap.intro .error,.wrap.intro .is-dismissible,.wrap.intro .notice,.wrap.intro .updated{display:none!important}.features-screenshot{display:none}.setup-message{text-align:center;background-color:#e63e3b;margin:20px -20px 0 -20px;padding:2em 0;clear:both}.setup-message .setup-button{border-radius:5px;background-color:#d73c38;color:#f19ea4;display:inline-block;margin:0 .75em;text-decoration:none;padding:.75em 3em;box-shadow:1px 1px 3px 1px rgba(0,0,0,.25)}.setup-message .setup-button-primary{background-color:#fff;color:#d84440}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media (min-width:768px){.intro .left{float:left;width:30%}.features-screenshot{margin:0 auto;max-width:1000px;width:70%;display:block;height:auto;float:right}.ep-features .left{display:block;float:left;box-sizing:border-box;padding-right:10px;width:50%}.ep-features .right{display:block;float:right;box-sizing:border-box;padding-left:10px;width:50%}.ep-feature .feature-message{float:left;padding:0;vertical-align:middle;display:inline-block;padding-top:.5em}} \ No newline at end of file diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 8a1a047ce6..41f52e372d 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -301,7 +301,7 @@ h2.ep-list-features { .ep-feature .settings .action-wrap { clear: both; text-align: right; - margin-top: 10px; + padding-top: 15px; vertical-align: middle; a { @@ -335,12 +335,18 @@ h2.ep-list-features { .ep-feature .settings .field { clear: both; overflow: initial; + padding-top: 15px; + + &:first-child { + padding-top: 0; + } > label, .field-name { display: block; float: left; - margin-right: 3em; + width: 25%; + margin-right: 1.5em; } .input-wrap { diff --git a/assets/css/autosuggest.css b/assets/css/autosuggest.css new file mode 100644 index 0000000000..fbd23f9514 --- /dev/null +++ b/assets/css/autosuggest.css @@ -0,0 +1,34 @@ +/** + * ElasticPress Autosuggest + * http://github.com/10up/ElasticPress-Autosuggest + * + * Copyright (c) 2014 Aaron Holbrook, 10up + * Licensed under the GPLv2+ license. + */ +.ep-autosuggest-container { + position: relative; } + .ep-autosuggest-container .ep-autosuggest { + display: none; + background: white; + position: absolute; + border: 1px solid #ccc; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + width: 100%; + z-index: 200; } + .ep-autosuggest-container .ep-autosuggest > ul { + margin: 0 !important; + list-style: none; } + .ep-autosuggest-container .ep-autosuggest > ul > li { + font-family: sans-serif; } + .ep-autosuggest-container .ep-autosuggest > ul > li > span { + display: block; + color: #000; + padding: 2px 10px; + cursor: pointer; } + .ep-autosuggest-container .ep-autosuggest > ul > li > span:hover, .ep-autosuggest-container .ep-autosuggest > ul > li > span:active { + background-color: #EEEEEE; + text-decoration: none; } + .ep-autosuggest-container .selected { + background-color: #EEE; + text-decoration: none; } +/*# sourceMappingURL=autosuggest.css.map */ \ No newline at end of file diff --git a/assets/css/autosuggest.css.map b/assets/css/autosuggest.css.map new file mode 100644 index 0000000000..5251d0c457 --- /dev/null +++ b/assets/css/autosuggest.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../features/autosuggest/assets/css/autosuggest.scss"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;EACC,mBAAkB,EAwClB;EAzCD;IAIE,cAAa;IACb,kBAAiB;IAEjB,mBAAkB;IAElB,uBAAsB;IAItB,yCAAyC;IAEzC,YAAW;IACX,aAAY,EAmBZ;IAnCF;MAkBG,qBAAoB;MACpB,iBAAgB,EAehB;MAlCH;QAqBI,wBAAuB,EAYvB;QAjCJ;UAuBK,eAAc;UACd,YAAW;UACX,kBAAiB;UACjB,gBAAe,EAMf;UAhCL;YA6BM,0BAAyB;YACzB,sBAAqB,EACrB;EA/BN;IAsCE,uBAAsB;IACtB,sBAAqB,EACrB","file":"autosuggest.css"} \ No newline at end of file diff --git a/assets/css/autosuggest.min.css b/assets/css/autosuggest.min.css new file mode 100644 index 0000000000..4adf766ea0 --- /dev/null +++ b/assets/css/autosuggest.min.css @@ -0,0 +1 @@ +.ep-autosuggest-container{position:relative}.ep-autosuggest-container .ep-autosuggest{display:none;background:#fff;position:absolute;border:1px solid #ccc;box-shadow:0 2px 4px rgba(0,0,0,.2);width:100%;z-index:200}.ep-autosuggest-container .ep-autosuggest>ul{margin:0!important;list-style:none}.ep-autosuggest-container .ep-autosuggest>ul>li{font-family:sans-serif}.ep-autosuggest-container .ep-autosuggest>ul>li>span{display:block;color:#000;padding:2px 10px;cursor:pointer}.ep-autosuggest-container .ep-autosuggest>ul>li>span:active,.ep-autosuggest-container .ep-autosuggest>ul>li>span:hover{background-color:#eee;text-decoration:none}.ep-autosuggest-container .selected{background-color:#eee;text-decoration:none} \ No newline at end of file diff --git a/assets/js/admin.min.js b/assets/js/admin.min.js index 4c19f8bc7e..20a581a24e 100644 --- a/assets/js/admin.min.js +++ b/assets/js/admin.min.js @@ -1 +1 @@ -!function(a){"use strict";a(".notice").on("click",".notice-dismiss",function(b){var c=b.delegateTarget.getAttribute("data-ep-notice");c&&a.ajax({method:"post",data:{nonce:epAdmin.nonce,action:"ep_notice_dismiss",notice:c},url:ajaxurl})})}(jQuery); \ No newline at end of file +!function(t){"use strict";t(".notice").on("click",".notice-dismiss",function(e){var i=e.delegateTarget.getAttribute("data-ep-notice");i&&t.ajax({method:"post",data:{nonce:epAdmin.nonce,action:"ep_notice_dismiss",notice:i},url:ajaxurl})})}(jQuery); \ No newline at end of file diff --git a/assets/js/dashboard.min.js b/assets/js/dashboard.min.js index fb9b98ba7b..ec3ed79b64 100644 --- a/assets/js/dashboard.min.js +++ b/assets/js/dashboard.min.js @@ -1 +1 @@ -!function(a){function b(){if(0===q)i.css({width:"1%"});else{var a=parseInt(q)/parseInt(r)*100;i.css({width:a+"%"})}if("initialsync"===o){var b=epDash.sync_initial;j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("sync"===o){var b=epDash.sync_syncing+" "+parseInt(q)+"/"+parseInt(r);e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.show(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("pause"===o){var b=epDash.sync_paused;r&&0!==r&&(b+=" "+parseInt(q)+"/"+parseInt(r)),e&&(b+=" ("+e.url+")"),j.text(b),j.show(),i.show(),m.hide(),h.addClass("syncing"),n.show(),l.show(),k.hide()}else if("wpcli"===o){var b=epDash.sync_wpcli;j.text(b),j.show(),i.hide(),m.hide(),h.addClass("syncing"),n.hide(),l.hide(),k.hide()}else if("error"===o){if(j.text(epDash.sync_error),j.show(),k.show(),n.hide(),l.hide(),m.hide(),h.removeClass("syncing"),i.hide(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}else if("cancel"===o){if(j.hide(),i.hide(),m.hide(),h.removeClass("syncing"),n.hide(),l.hide(),k.show(),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null}else if("finished"===o){if(j.text(epDash.sync_complete),j.show(),i.hide(),m.hide(),n.hide(),l.hide(),k.show(),h.removeClass("syncing"),p){var c=g.find(".ep-feature-"+p);c.removeClass("feature-syncing")}p=null,setTimeout(function(){j.hide()},7e3)}}function c(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function d(){a.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:p,nonce:epDash.nonce}}).done(function(a){if("sync"===o){if(r=a.data.found_posts,q=a.data.offset,a.data.site_stack&&(f=a.data.site_stack),a.data.current_site&&(e=a.data.current_site),f&&f.length)return o="sync",b(),void d();0!==a.data.found_posts||a.data.start?(o="sync",b(),d()):(o="finished",b())}}).error(function(a){a&&a.status&&parseInt(a.status)>=400&&parseInt(a.status)<600&&(o="error",b(),c())})}var e,f,g=a(document.getElementsByClassName("ep-features")),h=a(document.getElementsByClassName("error-overlay")),i=a(document.getElementsByClassName("progress-bar")),j=a(document.getElementsByClassName("sync-status")),k=a(document.getElementsByClassName("start-sync")),l=a(document.getElementsByClassName("resume-sync")),m=a(document.getElementsByClassName("pause-sync")),n=a(document.getElementsByClassName("cancel-sync")),o="sync",p=!1,q=0,r=0;g.on("click",".learn-more, .collapse",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-full")}),g.on("click",".settings-button",function(b){$feature=a(this).parents(".ep-feature"),$feature.toggleClass("show-settings")}),g.on("click",".save-settings",function(c){if(c.preventDefault(),!a(this).hasClass("disabled")){var e=c.target.getAttribute("data-feature"),f=g.find(".ep-feature-"+e),h={};f.find(".setting-field").each(function(){var b=a(this).attr("type"),c=a(this).attr("data-field-name"),d=a(this).attr("value");"radio"===b&&a(this).attr("checked")&&(h[c]=d)}),f.addClass("saving"),a.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:e,nonce:epDash.nonce,settings:h}}).done(function(c){setTimeout(function(){f.removeClass("saving"),"1"===h.active?f.addClass("feature-active"):f.removeClass("feature-active"),c.data.reindex&&(o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",f.addClass("feature-syncing"),p=e,d())},700)}).error(function(){setTimeout(function(){f.removeClass("saving"),f.removeClass("feature-active"),f.removeClass("feature-syncing")},700)})}}),epDash.index_meta?epDash.index_meta.wpcli_sync?(o="wpcli",b()):(q=epDash.index_meta.offset,r=epDash.index_meta.found_posts,epDash.index_meta.feature_sync&&(p=epDash.index_meta.feature_sync),epDash.index_meta.current_site&&(e=epDash.index_meta.current_site),epDash.index_meta.site_stack&&(f=epDash.index_meta.site_stack),f&&f.length?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):0!==r||epDash.index_meta.start?epDash.auto_start_index?(o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),b(),d()):(o="pause",b()):(o="finished",b())):epDash.auto_start_index&&(o="initialsync",b(),o="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),d()),k.on("click",function(){o="initialsync",b(),a('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),o="sync",d()}),m.on("click",function(){o="pause",b()}),l.on("click",function(){o="sync",b(),d()}),n.on("click",function(){o="cancel",b(),c()})}(jQuery); \ No newline at end of file +!function(e){function t(){if(0===y)d.css({width:"1%"});else{var e=parseInt(y)/parseInt(_)*100;d.css({width:e+"%"})}if("initialsync"===f){t=epDash.sync_initial;r.text(t),r.show(),d.show(),h.show(),o.addClass("syncing"),p.hide(),l.hide(),u.hide()}else if("sync"===f){t=epDash.sync_syncing+" "+parseInt(y)+"/"+parseInt(_);n&&(t+=" ("+n.url+")"),r.text(t),r.show(),d.show(),h.show(),o.addClass("syncing"),p.hide(),l.hide(),u.hide()}else if("pause"===f){t=epDash.sync_paused;_&&0!==_&&(t+=" "+parseInt(y)+"/"+parseInt(_)),n&&(t+=" ("+n.url+")"),r.text(t),r.show(),d.show(),h.hide(),o.addClass("syncing"),p.show(),l.show(),u.hide()}else if("wpcli"===f){var t=epDash.sync_wpcli;r.text(t),r.show(),d.hide(),h.hide(),o.addClass("syncing"),p.hide(),l.hide(),u.hide()}else if("error"===f)r.text(epDash.sync_error),r.show(),u.show(),p.hide(),l.hide(),h.hide(),o.removeClass("syncing"),d.hide(),m&&(s=c.find(".ep-feature-"+m)).removeClass("feature-syncing"),m=null,setTimeout(function(){r.hide()},7e3);else if("cancel"===f)r.hide(),d.hide(),h.hide(),o.removeClass("syncing"),p.hide(),l.hide(),u.show(),m&&(s=c.find(".ep-feature-"+m)).removeClass("feature-syncing"),m=null;else if("finished"===f){if(r.text(epDash.sync_complete),r.show(),d.hide(),h.hide(),p.hide(),l.hide(),u.show(),o.removeClass("syncing"),m){var s=c.find(".ep-feature-"+m);s.removeClass("feature-syncing")}m=null,setTimeout(function(){r.hide()},7e3)}}function s(){e.ajax({method:"post",url:ajaxurl,data:{action:"ep_cancel_index",nonce:epDash.nonce}})}function a(){e.ajax({method:"post",url:ajaxurl,data:{action:"ep_index",feature_sync:m,nonce:epDash.nonce}}).done(function(e){if("sync"===f){if(_=e.data.found_posts,y=e.data.offset,e.data.site_stack&&(i=e.data.site_stack),e.data.current_site&&(n=e.data.current_site),i&&i.length)return f="sync",t(),void a();0!==e.data.found_posts||e.data.start?(f="sync",t(),a()):(f="finished",t())}}).error(function(e){e&&e.status&&parseInt(e.status)>=400&&parseInt(e.status)<600&&(f="error",t(),s())})}var n,i,c=e(document.getElementsByClassName("ep-features")),o=e(document.getElementsByClassName("error-overlay")),d=e(document.getElementsByClassName("progress-bar")),r=e(document.getElementsByClassName("sync-status")),u=e(document.getElementsByClassName("start-sync")),l=e(document.getElementsByClassName("resume-sync")),h=e(document.getElementsByClassName("pause-sync")),p=e(document.getElementsByClassName("cancel-sync")),f="sync",m=!1,y=0,_=0;c.on("click",".learn-more, .collapse",function(t){$feature=e(this).parents(".ep-feature"),$feature.toggleClass("show-full")}),c.on("click",".settings-button",function(t){$feature=e(this).parents(".ep-feature"),$feature.toggleClass("show-settings")}),c.on("click",".save-settings",function(s){if(s.preventDefault(),!e(this).hasClass("disabled")){var n=s.target.getAttribute("data-feature"),i=c.find(".ep-feature-"+n),o={};i.find(".setting-field").each(function(){var t=e(this).attr("type"),s=e(this).attr("data-field-name"),a=e(this).attr("value");"radio"===t?e(this).attr("checked")&&(o[s]=a):o[s]=a}),i.addClass("saving"),e.ajax({method:"post",url:ajaxurl,data:{action:"ep_save_feature",feature:n,nonce:epDash.nonce,settings:o}}).done(function(s){setTimeout(function(){i.removeClass("saving"),"1"===o.active?i.addClass("feature-active"):i.removeClass("feature-active"),s.data.reindex&&(f="initialsync",t(),e('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),f="sync",i.addClass("feature-syncing"),m=n,a())},700)}).error(function(){setTimeout(function(){i.removeClass("saving"),i.removeClass("feature-active"),i.removeClass("feature-syncing")},700)})}}),epDash.index_meta?epDash.index_meta.wpcli_sync?(f="wpcli",t()):(y=epDash.index_meta.offset,_=epDash.index_meta.found_posts,epDash.index_meta.feature_sync&&(m=epDash.index_meta.feature_sync),epDash.index_meta.current_site&&(n=epDash.index_meta.current_site),epDash.index_meta.site_stack&&(i=epDash.index_meta.site_stack),i&&i.length?epDash.auto_start_index?(f="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),t(),a()):(f="pause",t()):0!==_||epDash.index_meta.start?epDash.auto_start_index?(f="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),t(),a()):(f="pause",t()):(f="finished",t())):epDash.auto_start_index&&(f="initialsync",t(),f="sync",history.pushState({},document.title,document.location.pathname+document.location.search.replace(/&do_sync/,"")),a()),u.on("click",function(){f="initialsync",t(),e('[data-ep-notice="no-sync"], [data-ep-notice="auto-activate-sync"], [data-ep-notice="upgrade-sync"]').remove(),f="sync",a()}),h.on("click",function(){f="pause",t()}),l.on("click",function(){f="sync",t(),a()}),p.on("click",function(){f="cancel",t(),s()})}(jQuery); \ No newline at end of file diff --git a/assets/js/src/dashboard.js b/assets/js/src/dashboard.js index 4a5dd0c952..e1f822a147 100644 --- a/assets/js/src/dashboard.js +++ b/assets/js/src/dashboard.js @@ -49,6 +49,8 @@ if ( $( this ).attr( 'checked' ) ) { settings[ name ] = value; } + } else { + settings[ name ] = value; } }); diff --git a/classes/class-ep-feature.php b/classes/class-ep-feature.php index 762ff2a8aa..0f620ff5ad 100644 --- a/classes/class-ep-feature.php +++ b/classes/class-ep-feature.php @@ -273,21 +273,24 @@ public function output_settings_box() {

-
-
-
-
- +
+
+
+
+
+ +
-
- feature_box_settings_cb ) ) { - call_user_func( $this->feature_box_settings_cb, $this ); - return; - } - do_action( 'ep_feature_box_settings', $this->slug, $this ); - ?> + feature_box_settings_cb ) ) { + call_user_func( $this->feature_box_settings_cb, $this ); + return; + } + + do_action( 'ep_feature_box_settings_' . $this->slug, $this ); + ?> +
diff --git a/elasticpress.php b/elasticpress.php index 85d2696641..9b4dc9bbe2 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -59,6 +59,7 @@ require_once( 'features/protected-content/protected-content.php' ); require_once( 'features/woocommerce/woocommerce.php' ); require_once( 'features/documents/documents.php' ); +require_once( 'features/autosuggest/autosuggest.php' ); /** * WP CLI Commands diff --git a/features/autosuggest/assets/css/autosuggest.css b/features/autosuggest/assets/css/autosuggest.css new file mode 100644 index 0000000000..5444120f3e --- /dev/null +++ b/features/autosuggest/assets/css/autosuggest.css @@ -0,0 +1,37 @@ +/** + * ElasticPress Autosuggest + * http://github.com/10up/ElasticPress-Autosuggest + * + * Copyright (c) 2014 Aaron Holbrook, 10up + * Licensed under the GPLv2+ license. + */ +.ep-autosuggest-container { + position: relative; } + .ep-autosuggest-container .ep-autosuggest { + display: none; + background: white; + position: absolute; + border: 1px solid #ccc; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + width: 100%; + z-index: 200; } + .ep-autosuggest-container .ep-autosuggest > ul { + margin: 0 !important; + list-style: none; } + .ep-autosuggest-container .ep-autosuggest > ul > li { + font-family: sans-serif; } + .ep-autosuggest-container .ep-autosuggest > ul > li > span { + display: block; + color: #000; + padding: 2px 10px; + cursor: pointer; } + .ep-autosuggest-container .ep-autosuggest > ul > li > span:hover, .ep-autosuggest-container .ep-autosuggest > ul > li > span:active { + background-color: #EEEEEE; + text-decoration: none; } + .ep-autosuggest-container .selected { + background-color: #EEE; + text-decoration: none; } + +/*# sourceMappingURL=autosuggest.css.map */ \ No newline at end of file diff --git a/features/autosuggest/assets/css/autosuggest.css.map b/features/autosuggest/assets/css/autosuggest.css.map new file mode 100644 index 0000000000..327fb8647a --- /dev/null +++ b/features/autosuggest/assets/css/autosuggest.css.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "file": "autosuggest.css", + "sources": [ + "autosuggest.scss" + ], + "names": [], + "mappings": "AAAA;;;;;;GAMG;AAEH,AAAA,yBAAyB,CAAC;EACzB,QAAQ,EAAE,QAAQ,GAwClB;EAzCD,AAGC,yBAHwB,CAGxB,eAAe,CAAC;IACf,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,KAAK;IAEjB,QAAQ,EAAE,QAAQ;IAElB,MAAM,EAAE,cAAc;IAEtB,kBAAkB,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,kBAAmB;IACjD,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,kBAAmB;IAC9C,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,kBAAmB;IAEzC,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,GAAG,GAmBZ;IAnCF,AAiBI,yBAjBqB,CAGxB,eAAe,GAcZ,EAAE,CAAC;MACJ,MAAM,EAAE,YAAY;MACpB,UAAU,EAAE,IAAI,GAehB;MAlCH,AAoBK,yBApBoB,CAGxB,eAAe,GAcZ,EAAE,GAGD,EAAE,CAAC;QACJ,WAAW,EAAE,UAAU,GAYvB;QAjCJ,AAsBM,yBAtBmB,CAGxB,eAAe,GAcZ,EAAE,GAGD,EAAE,GAED,IAAI,CAAC;UACN,OAAO,EAAE,KAAK;UACd,KAAK,EAAE,IAAI;UACX,OAAO,EAAE,QAAQ;UACjB,MAAM,EAAE,OAAO,GAMf;UAhCL,AAsBM,yBAtBmB,CAGxB,eAAe,GAcZ,EAAE,GAGD,EAAE,GAED,IAAI,AAKL,MAAO,EA3BZ,AAsBM,yBAtBmB,CAGxB,eAAe,GAcZ,EAAE,GAGD,EAAE,GAED,IAAI,AAML,OAAQ,CAAC;YACR,gBAAgB,EAAE,OAAO;YACzB,eAAe,EAAE,IAAI,GACrB;EA/BN,AAqCC,yBArCwB,CAqCxB,SAAS,CAAC;IACT,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,IAAI,GACrB" +} \ No newline at end of file diff --git a/features/autosuggest/assets/css/autosuggest.scss b/features/autosuggest/assets/css/autosuggest.scss new file mode 100644 index 0000000000..82effdcd92 --- /dev/null +++ b/features/autosuggest/assets/css/autosuggest.scss @@ -0,0 +1,50 @@ +/** + * ElasticPress Autosuggest + * http://github.com/10up/ElasticPress-Autosuggest + * + * Copyright (c) 2014 Aaron Holbrook, 10up + * Licensed under the GPLv2+ license. + */ + +.ep-autosuggest-container { + position: relative; + + .ep-autosuggest { + display: none; + background: white; + + position: absolute; + + border: 1px solid #ccc; + + -webkit-box-shadow: 0 2px 4px rgba( 0, 0, 0, .2 ); + -moz-box-shadow: 0 2px 4px rgba( 0, 0, 0, .2 ); + box-shadow: 0 2px 4px rgba( 0, 0, 0, .2 ); + + width: 100%; + z-index: 200; + > ul { + margin: 0 !important; + list-style: none; + > li { + font-family: sans-serif; + > span { + display: block; + color: #000; + padding: 2px 10px; + cursor: pointer; + &:hover, + &:active { + background-color: #EEEEEE; + text-decoration: none; + } + } + } + } + } + + .selected { + background-color: #EEE; + text-decoration: none; + } +} \ No newline at end of file diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js new file mode 100644 index 0000000000..62c7172a17 --- /dev/null +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -0,0 +1 @@ +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function n(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{suggest:{"post-suggest":{text:e,completion:{field:"post_title.completion"}},"term-suggest":{text:e,completion:{field:"term_suggest"}}}}}function a(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function i(o,n){var a,i=n.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=i.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),o.length>0?i.show():i.hide(),a=0;a'+r+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){s(n,e.srcElement.innerText),t(n)}),n.off("keydown"),n.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var o,a=n.closest(".ep-autosuggest-container").find(".autosuggest-list li"),i=a.filter(".selected");switch(e.keyCode){case 38:o=i.prev();break;case 40:a.hasClass("selected")?o=i.next():(a.first().addClass("selected"),o=a.first());break;case 13:return a.hasClass("selected")?(s(n,i.find("span").text()),t(n),!1):void 0}if(o.is("li")?(i.removeClass("selected"),o.addClass("selected")):a.removeClass("selected"),38===e.keyCode)return!1}})}function u(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var r=e('input.elasticpress-autosuggest, input[type="search"]'),c=e('
    ');r.each(function(t,s){var o=e('
    '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),c.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),c.css({top:r.outerHeight()-1,"background-color":r.css("background-color")}),e(r).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&u()})}),r.each(function(t,s){var r=e(s);r.on("keyup",o(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=r.val(),o=epas.postType;s.length>=2?a(n(s,o)).done(function(t){if(t._shards.successful>0){var s=t.suggest["post-suggest"][0].options,o=t.suggest["term-suggest"][0].options,n=s.concat(o),a=[];e.each(n,function(t,s){-1===e.inArray(s.text,a)&&a.push(s.text)}),0===a.length?u():i(a,r)}else u()}):0===s.length&&u()}},100))}),window.epasAPI={hideAutosuggestBox:u,updateAutosuggestBox:i,esSearch:a,buildSearchQuery:n}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js new file mode 100644 index 0000000000..f47303a96b --- /dev/null +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -0,0 +1,310 @@ +/** + * ElasticPress Autosuggest + * http://github.com/10up/ElasticPress-Autosuggest + * + * Copyright (c) 2014 Aaron Holbrook, 10up + * Licensed under the GPLv2+ license. + */ +( function( $ ) { + 'use strict'; + + // No host/index set + if ( ! epas.host || '' === epas.host || ! epas.index || '' === epas.index ) { + return; + } + + /** + * Submit the search form + * @param object $localInput + */ + function submitSearchForm( $localInput ) { + $localInput.closest( 'form' ).submit(); + } + + /** + * Take selected item and fill the search input + * @param event + */ + function selectAutosuggestItem( $localInput, text ) { + $localInput.val( text ); + } + + /** + * Simple throttling function for waiting a set amount of time after the last keypress + * So we don't overload the server with too many requests at once + * + * @param fn + * @param delay + * @returns {Function} + */ + function debounce( fn, delay ) { + var timer = null; + + return function() { + var context = this, + args = arguments; + + window.clearTimeout(timer); + + timer = window.setTimeout( function () { + fn.apply( context, args ); + }, delay ); + }; + } + + /** + * Build the search query from the search text + * + * @param searchText + * @returns object + */ + function buildSearchQuery( searchText, postType ) { + if ( postType === 'all' || typeof( postType ) === 'undefined' || postType === '' ) { + postType = 'all'; + } + // TODO: check comma separated + var query = { + suggest: { + 'post-suggest': { + text: searchText, + completion: { + field: 'post_title.completion' + } + }, + 'term-suggest': { + text: searchText, + completion: { + field: 'term_suggest' + } + } + } + }; + + return query; + } + + /** + * Build the ajax request + * + * @param query + * @returns AJAX object request + */ + function esSearch( query ) { + // @todo support multiple different post type search boxes on the same page + var url = epas.host + '/' + epas.index + '/post/_search'; + + // Fixes <=IE9 jQuery AJAX bug that prevents ajax request from firing + jQuery.support.cors = true; + + return $.ajax( { + url: url, + type: 'post', + dataType: 'json', + crossDomain: true, + data: JSON.stringify( query ) + } ); + } + + /** + * Update the auto suggest box with new options or hide if none + * + * @param options + * @return void + */ + function updateAutosuggestBox( options, $localInput ) { + var i, + itemString, + $localESContainer = $localInput.closest( '.ep-autosuggest-container' ).find( '.ep-autosuggest' ), + $localSuggestList = $localESContainer.find( '.autosuggest-list' ); + + $localSuggestList.empty(); + + // Don't listen to potentially previously set items + $( '.autosuggest-item' ).off(); + + if ( options.length > 0 ) { + $localESContainer.show(); + } else { + $localESContainer.hide(); + } + + for ( i = 0; i < options.length; ++i ) { + var item = options[i].toLowerCase(); + itemString = '
  • ' + item + '
  • '; + $( itemString ).appendTo( $localSuggestList ); + } + + // Listen to items to auto-fill search box and submit form + $( '.autosuggest-item' ).on( 'click', function( event ) { + selectAutosuggestItem( $localInput, event.srcElement.innerText ); + submitSearchForm( $localInput ); + } ); + + $localInput.off( 'keydown' ); + + // Listen to the input for up and down navigation between autosuggest items + $localInput.on( 'keydown', function( event ) { + if ( event.keyCode === 38 || event.keyCode === 40 || event.keyCode === 13 ) { + var $results = $localInput.closest( '.ep-autosuggest-container' ).find( '.autosuggest-list li' ); + var $current = $results.filter( '.selected' ); + var $next; + + switch ( event.keyCode ) { + case 38: // Up + $next = $current.prev(); + break; + case 40: // Down + if ( ! $results.hasClass( 'selected' ) ) { + $results.first().addClass( 'selected' ); + $next = $results.first(); + } else { + $next = $current.next(); + } + break; + case 13: // Enter + if ( $results.hasClass( 'selected' ) ) { + selectAutosuggestItem( $localInput, $current.find('span').text() ); + submitSearchForm( $localInput ); + return false; + } else { + // No item selected + return; + } + break; + } + + // only check next element if up and down key pressed + if ( $next.is( 'li' ) ) { + $current.removeClass( 'selected' ); + $next.addClass( 'selected' ); + } else { + $results.removeClass( 'selected' ); + } + + // keep cursor from heading back to the beginning in the input + if( event.keyCode === 38 ) { + return false; + } + + return; + } + + } ); + } + + /** + * Hide the auto suggest box + * + * @return void + */ + function hideAutosuggestBox() { + $( '.autosuggest-list' ).empty(); + $( '.ep-autosuggest' ).hide(); + } + + var $epInput = $( 'input.elasticpress-autosuggest, input[type="search"]' ); + var $epAutosuggest = $( '
      ' ); + + /** + * Build the auto-suggest container + */ + $epInput.each( function( key, input ) { + var $epContainer = $( '
      ' ); + var $input = $( input ); + + // Disable autocomplete + $input.attr( 'autocomplete', 'off' ); + + $epContainer.insertAfter( $input ); + var $epLabel = $input.siblings( 'label' ); + $input + .closest( 'form' ) + .find( '.ep-autosuggest-container' ) + .append( $epLabel ) + .append( $input ); + + $epAutosuggest.clone().insertAfter( $input ); + + $input.trigger( 'elasticpress.input.moved' ); + } ); + + $epAutosuggest.css( { + top: $epInput.outerHeight() - 1, + 'background-color': $epInput.css( 'background-color' ) + } ); + + /** + * Singular bindings for up and down to prevent normal actions so we can use them to navigate + * our autosuggest list + * Listen to the escape key to close the autosuggest box + */ + $( $epInput ).each( function( key, value ) { + $( value ).on( 'keyup keydown keypress', function( event ) { + if ( event.keyCode === 38 || event.keyCode === 40) { + event.preventDefault(); + } + if ( event.keyCode === 27 ) { + hideAutosuggestBox(); + } + } ); + } ); + + /** + * Listen for any keyup events, throttle them to a min threshold of time + * and then send them for a query to the Elasticsearch server + * + */ + $epInput.each( function( key, localInput ) { + var $localInput = $( localInput ); + $localInput.on( 'keyup', debounce( function( event ) { + if ( event.keyCode === 38 || event.keyCode === 40 || event.keyCode === 13 || event.keyCode === 27 ) { + return; + } + + var val = $localInput.val(); + var query; + var request; + var postType = epas.postType; + + if ( val.length >= 2 ) { + query = buildSearchQuery( val, postType ); + request = esSearch( query ); + + request.done( function( response ) { + if ( response._shards.successful > 0 ) { + var titleOptions = response.suggest['post-suggest'][0]['options']; + var termOptions = response.suggest['term-suggest'][0]['options']; + + var options = titleOptions.concat( termOptions ); + var filteredOptions = []; + + $.each( options, function( index, element ){ + if( $.inArray( element.text, filteredOptions ) === -1 ) { + filteredOptions.push( element.text ); + } + } ); + + if ( 0 === filteredOptions.length ) { + hideAutosuggestBox(); + } else { + updateAutosuggestBox( filteredOptions, $localInput ); + } + } else { + hideAutosuggestBox(); + } + } ); + } else if ( 0 === val.length ) { + hideAutosuggestBox(); + } + }, 100 ) ); + } ); + + // Publically expose API + window.epasAPI = { + hideAutosuggestBox: hideAutosuggestBox, + updateAutosuggestBox: updateAutosuggestBox, + esSearch: esSearch, + buildSearchQuery: buildSearchQuery + }; + +} )( jQuery ); diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php new file mode 100644 index 0000000000..1b846ad313 --- /dev/null +++ b/features/autosuggest/autosuggest.php @@ -0,0 +1,194 @@ + +

      + +

      + get_settings(); + + if ( ! $settings ) { + $settings = array(); + } + $settings = wp_parse_args( $settings, $feature->default_settings ); + ?> + +
      +
      +
      + +
      +
      + + 'completion', + 'analyzer' => 'simple', + 'search_analyzer' => 'simple', + ); + + $mapping['mappings']['post']['properties']['term_suggest'] = array( + 'type' => 'completion', + 'analyzer' => 'simple', + 'search_analyzer' => 'simple', + ); + + return $mapping; +} + +/** + * Add term suggestions to be indexed + * + * @param $post_args + * @param $post_id + * @since 2.4 + * @return array + */ +function ep_autosuggest_filter_term_suggest( $post_args, $post_id ) { + $suggest = array(); + + if ( ! empty( $post_args['terms'] ) ) { + foreach ( $post_args['terms'] as $taxonomy ) { + foreach ( $taxonomy as $term ) { + $suggest[] = $term['name']; + } + } + } + + if ( ! empty( $suggest ) ) { + $post_args['term_suggest'] = $suggest; + } + + return $post_args; +} + +/** + * Enqueue our autosuggest script + * + * @since 2.4 + */ +function ep_autosuggest_enqueue_scripts() { + + $js_url = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? EP_URL . 'features/autosuggest/assets/js/src/autosuggest.js' : EP_URL . 'features/autosuggest/assets/js/autosuggest.min.js'; + $css_url = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? EP_URL . 'features/autosuggest/assets/css/autosuggest.css' : EP_URL . 'features/autosuggest/assets/css/autosuggest.min.css'; + + wp_enqueue_script( + 'elasticpress-autosuggest', + $js_url, + array( 'jquery' ), + EP_VERSION, + true + ); + + wp_enqueue_style( + 'elasticpress-autosuggest', + $css_url, + array(), + EP_VERSION + ); + + // Output some variables for our JS to use - namely the index name and the post type to use for suggestions + wp_localize_script( 'elasticpress-autosuggest', 'epas', array( + 'index' => ep_get_index_name( get_current_blog_id() ), + 'host' => apply_filters( 'ep_host', ep_get_host() ), + 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), + ) ); +} + +/** + * Determine WC feature reqs status + * + * @param EP_Feature_Requirements_Status $status + * @since 2.4 + * @return EP_Feature_Requirements_Status + */ +function ep_autosuggest_requirements_status( $status ) { + $host = ep_get_host(); + + if ( ! preg_match( '#elasticpress\.io#i', $host ) ) { + $status->code = 1; + $status->message = __( "You aren't using ElasticPress.io so we can't be sure your Elasticsearch instance is secure.", 'elasticpress' ); + } + + return $status; +} + +/** + * Register the feature + * + * @since 2.4 + */ +ep_register_feature( 'autosuggest', array( + 'title' => 'Autosuggest', + 'setup_cb' => 'ep_autosuggest_setup', + 'feature_box_summary_cb' => 'ep_autosuggest_feature_box_summary', + 'feature_box_long_cb' => 'ep_autosuggest_feature_box_long', + 'requires_install_reindex' => true, + 'requirements_status_cb' => 'ep_autosuggest_requirements_status', + 'default_settings' => array( + 'endpoint' => '', + ), +) ); diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot index cb481c3e11..9ec50a77d7 100644 --- a/lang/elasticpress.pot +++ b/lang/elasticpress.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: ElasticPress 2.3.2\n" +"Project-Id-Version: ElasticPress 2.4\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n" -"POT-Creation-Date: 2017-06-30 17:19:05+00:00\n" +"POT-Creation-Date: 2017-08-22 04:41:20+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -143,27 +143,27 @@ msgstr "" msgid "Unable to reach Elasticsearch Server! Check that service is running." msgstr "" -#: classes/class-ep-api.php:2137 +#: classes/class-ep-api.php:2165 msgid "" "Invalid response from ElasticPress server. Please contact your " "administrator." msgstr "" -#: classes/class-ep-api.php:2150 +#: classes/class-ep-api.php:2178 msgid "" "Site not indexed.

      Please run: wp elasticpress index --setup " "--network-wide using WP-CLI. Or use the index button on the left of " "this screen.

      " msgstr "" -#: classes/class-ep-api.php:2154 +#: classes/class-ep-api.php:2182 msgid "" "Site not indexed.

      Please run: wp elasticpress index --setup " "using WP-CLI. Or use the index button on the left of this screen.

      " msgstr "" -#: classes/class-ep-api.php:2289 classes/class-ep-api.php:2401 -#: classes/class-ep-api.php:2452 +#: classes/class-ep-api.php:2317 classes/class-ep-api.php:2429 +#: classes/class-ep-api.php:2480 msgid "Elasticsearch Host is not available." msgstr "" @@ -171,101 +171,101 @@ msgstr "" msgid "Dashboard" msgstr "" -#: classes/class-ep-dashboard.php:288 +#: classes/class-ep-dashboard.php:290 msgid "" "There is a problem with connecting to your Elasticsearch host. ElasticPress " "can try your host again, or you may need to change your settings." msgstr "" -#: classes/class-ep-dashboard.php:295 +#: classes/class-ep-dashboard.php:297 msgid "" "Your Elasticsearch version %s is above the maximum required Elasticsearch " "version %s. ElasticPress may or may not work properly." msgstr "" -#: classes/class-ep-dashboard.php:302 +#: classes/class-ep-dashboard.php:304 msgid "" "Your Elasticsearch version %s is below the minimum required Elasticsearch " "version %s. ElasticPress may or may not work properly." msgstr "" -#: classes/class-ep-dashboard.php:315 +#: classes/class-ep-dashboard.php:317 msgid "" "Thanks for installing ElasticPress! You will need to run through a quick set up process to get the plugin working." msgstr "" -#: classes/class-ep-dashboard.php:328 +#: classes/class-ep-dashboard.php:330 msgid "" "ElasticPress is almost ready. You will need to complete a sync to get the plugin working." msgstr "" -#: classes/class-ep-dashboard.php:341 +#: classes/class-ep-dashboard.php:343 msgid "" "The new version of ElasticPress requires that you run a " "sync." msgstr "" -#: classes/class-ep-dashboard.php:356 +#: classes/class-ep-dashboard.php:358 msgid "" "The ElasticPress %s feature has been auto-activated! You will need to run a sync for it to work." msgstr "" -#: classes/class-ep-dashboard.php:364 +#: classes/class-ep-dashboard.php:366 msgid "" "Dashboard sync is disabled. The ElasticPress %s feature has been " "auto-activated! You will need to reindex using WP-CLI for it to work." msgstr "" -#: classes/class-ep-dashboard.php:371 +#: classes/class-ep-dashboard.php:373 msgid "" "Dashboard sync is disabled. The new version of ElasticPress requires that " "you to reindex using WP-CLI." msgstr "" -#: classes/class-ep-dashboard.php:378 +#: classes/class-ep-dashboard.php:380 msgid "" "Dashboard sync is disabled. You will need to index using WP-CLI to finish " "setup." msgstr "" -#: classes/class-ep-dashboard.php:739 +#: classes/class-ep-dashboard.php:741 msgid "Sync complete" msgstr "" -#: classes/class-ep-dashboard.php:740 +#: classes/class-ep-dashboard.php:742 msgid "Sync paused" msgstr "" -#: classes/class-ep-dashboard.php:741 +#: classes/class-ep-dashboard.php:743 msgid "Syncing" msgstr "" -#: classes/class-ep-dashboard.php:742 +#: classes/class-ep-dashboard.php:744 msgid "Starting sync" msgstr "" -#: classes/class-ep-dashboard.php:743 +#: classes/class-ep-dashboard.php:745 msgid "WP CLI sync is occurring. Refresh the page to see if it's finished" msgstr "" -#: classes/class-ep-dashboard.php:744 +#: classes/class-ep-dashboard.php:746 msgid "An error occured while syncing" msgstr "" -#: classes/class-ep-dashboard.php:781 +#: classes/class-ep-dashboard.php:783 msgid "Security error!" msgstr "" -#: classes/class-ep-dashboard.php:895 classes/class-ep-dashboard.php:896 +#: classes/class-ep-dashboard.php:897 classes/class-ep-dashboard.php:898 #: classes/class-ep-feature.php:274 includes/settings-page.php:27 msgid "Settings" msgstr "" -#: classes/class-ep-dashboard.php:904 classes/class-ep-dashboard.php:905 +#: classes/class-ep-dashboard.php:906 classes/class-ep-dashboard.php:907 msgid "Welcome" msgstr "" @@ -277,23 +277,23 @@ msgstr "" msgid "Collapse" msgstr "" -#: classes/class-ep-feature.php:277 +#: classes/class-ep-feature.php:278 msgid "Status" msgstr "" -#: classes/class-ep-feature.php:279 +#: classes/class-ep-feature.php:280 msgid "Enabled" msgstr "" -#: classes/class-ep-feature.php:280 +#: classes/class-ep-feature.php:281 msgid "Disabled" msgstr "" -#: classes/class-ep-feature.php:294 +#: classes/class-ep-feature.php:297 msgid "Setting adjustments to this feature require a re-sync. Use WP-CLI." msgstr "" -#: classes/class-ep-feature.php:297 +#: classes/class-ep-feature.php:300 msgid "Save" msgstr "" @@ -315,6 +315,29 @@ msgstr "" msgid "The following values do not describe a valid date: month %1$s, day %2$s." msgstr "" +#: features/autosuggest/autosuggest.php:10 +msgid "Add autosuggest to ElasticPress powered search fields on the front end." +msgstr "" + +#: features/autosuggest/autosuggest.php:21 +msgid "" +"Autosuggest is a very powerful search feature. As a user types a search " +"query, they are automatically suggested items. Autosuggest dramatically " +"increases that users will find what they are looking for on your site, " +"improving overall experience." +msgstr "" + +#: features/autosuggest/autosuggest.php:54 +msgid "Endpoint Address" +msgstr "" + +#: features/autosuggest/autosuggest.php:173 +#: features/protected-content/protected-content.php:143 +msgid "" +"You aren't using ElasticPress.io so " +"we can't be sure your Elasticsearch instance is secure." +msgstr "" + #: features/documents/documents.php:207 msgid "" "The " msgstr "" -#: features/protected-content/protected-content.php:143 -msgid "" -"You aren't using ElasticPress.io so " -"we can't be sure your Elasticsearch instance is secure." -msgstr "" - #: features/protected-content/protected-content.php:153 msgid "Protected Content" msgstr "" @@ -417,14 +434,14 @@ msgid "" "misspellings and verb tenses." msgstr "" -#: features/woocommerce/woocommerce.php:614 +#: features/woocommerce/woocommerce.php:625 msgid "" "“I want a cotton, woman’s t-shirt, for under $15 that’s in stock.” Faceted " "product browsing strains servers and increases load times. Your buyers can " "find the perfect product quickly, and buy it quickly." msgstr "" -#: features/woocommerce/woocommerce.php:625 +#: features/woocommerce/woocommerce.php:636 msgid "" "Most caching and performance tools can’t keep up with the nearly infinite " "ways your visitors might filter or navigate your products. No matter how " @@ -434,7 +451,7 @@ msgid "" "end product management." msgstr "" -#: features/woocommerce/woocommerce.php:639 +#: features/woocommerce/woocommerce.php:650 msgid "WooCommerce not installed." msgstr "" @@ -497,4 +514,4 @@ msgstr "" #. Author URI of the plugin/theme msgid "http://10up.com" -msgstr "" +msgstr "" \ No newline at end of file From 8d3e447efcbb392f29e40da9f09f5a0f0fcb9244 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 23 Aug 2017 00:30:56 -0400 Subject: [PATCH 50/96] Fix warning --- features/woocommerce/woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 7a124f24de..83346bdd05 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -575,7 +575,7 @@ function ep_wc_bypass_order_permissions_check( $override, $post_id ) { */ function ep_wc_search_order( $wp ){ global $pagenow; - if ( 'edit.php' != $pagenow || 'shop_order' !== $wp->query_vars['post_type'] || + if ( 'edit.php' != $pagenow || empty( $wp->query_vars['post_type'] ) || 'shop_order' !== $wp->query_vars['post_type'] || ( empty( $wp->query_vars['s'] ) && empty( $wp->query_vars['shop_order_search'] ) ) ) { return; } From a6e0471163df83d51b956cbe0df012ca7cdf7d0c Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Wed, 23 Aug 2017 09:23:54 -0300 Subject: [PATCH 51/96] porting over https://github.com/10up/elasticpress-autosuggest/pull/11 --- .../autosuggest/assets/js/autosuggest.min.js | 2 +- .../autosuggest/assets/js/src/autosuggest.js | 46 +++++++++++++++---- features/autosuggest/autosuggest.php | 13 ++++-- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 62c7172a17..3c51426689 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function n(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{suggest:{"post-suggest":{text:e,completion:{field:"post_title.completion"}},"term-suggest":{text:e,completion:{field:"term_suggest"}}}}}function a(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function i(o,n){var a,i=n.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=i.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),o.length>0?i.show():i.hide(),a=0;a'+r+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){s(n,e.srcElement.innerText),t(n)}),n.off("keydown"),n.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var o,a=n.closest(".ep-autosuggest-container").find(".autosuggest-list li"),i=a.filter(".selected");switch(e.keyCode){case 38:o=i.prev();break;case 40:a.hasClass("selected")?o=i.next():(a.first().addClass("selected"),o=a.first());break;case 13:return a.hasClass("selected")?(s(n,i.find("span").text()),t(n),!1):void 0}if(o.is("li")?(i.removeClass("selected"),o.addClass("selected")):a.removeClass("selected"),38===e.keyCode)return!1}})}function u(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var r=e('input.elasticpress-autosuggest, input[type="search"]'),c=e('
        ');r.each(function(t,s){var o=e('
        '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),c.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),c.css({top:r.outerHeight()-1,"background-color":r.css("background-color")}),e(r).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&u()})}),r.each(function(t,s){var r=e(s);r.on("keyup",o(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=r.val(),o=epas.postType;s.length>=2?a(n(s,o)).done(function(t){if(t._shards.successful>0){var s=t.suggest["post-suggest"][0].options,o=t.suggest["term-suggest"][0].options,n=s.concat(o),a=[];e.each(n,function(t,s){-1===e.inArray(s.text,a)&&a.push(s.text)}),0===a.length?u():i(a,r)}else u()}):0===s.length&&u()}},100))}),window.epasAPI={hideAutosuggestBox:u,updateAutosuggestBox:i,esSearch:a,buildSearchQuery:n}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function n(e,n){if("navigate"===epas.action)return o(e,n.dataset.url);s(e,n.innerText),t(e)}function a(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{suggest:{"post-suggest":{text:e,completion:{field:"post_title.completion"}},"term-suggest":{text:e,completion:{field:"term_suggest"}}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,a=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=a.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?a.show():a.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){n(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),a=o.filter(".selected");switch(e.keyCode){case 38:t=a.prev();break;case 40:o.hasClass("selected")?t=a.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(n(s,a.get(1)),!1):void 0}if(t.is("li")?(a.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),g=e('
          ');l.each(function(t,s){var o=e('
          '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),g.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),g.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",a(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),n=epas.postType;s.length>=2?i(u(s,n)).done(function(t){if(t._shards.successful>0){var s=t.suggest["post-suggest"][0].options,n=t.suggest["term-suggest"][0].options,a=s.concat(n),u=[],i=[];e.each(a,function(t,s){-1===e.inArray(s.text,u)&&(u.push(s.text),i.push({text:s.text,url:s._source.permalink}))}),0===i.length?c():r(i,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index f47303a96b..2c0ce83098 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -29,6 +29,32 @@ $localInput.val( text ); } + /** + * Navigate to the selected item + * @param event + */ + function goToAutosuggestItem( $localInput, url ) { + return window.location.href = url; + } + + /** + * Respond to an item selection based on the predefined behavior. + * If epas.action is set to "navigate", redirects the browser to the URL of the selected item + * If epas.action is set to any other value (default "search"), fill in the value and perform the search + * + * @param $localInput + * @param element + */ + function selectItem( $localInput, element ) { + + if ( 'navigate' === epas.action ) { + return goToAutosuggestItem( $localInput, element.dataset.url ); + } + + selectAutosuggestItem( $localInput, element.innerText ); + submitSearchForm( $localInput ); + } + /** * Simple throttling function for waiting a set amount of time after the last keypress * So we don't overload the server with too many requests at once @@ -129,15 +155,15 @@ } for ( i = 0; i < options.length; ++i ) { - var item = options[i].toLowerCase(); - itemString = '
        • ' + item + '
        • '; + var text = options[i].text.toLowerCase(); + var url = options[i].url; + itemString = '
        • ' + text + '
        • '; $( itemString ).appendTo( $localSuggestList ); } // Listen to items to auto-fill search box and submit form $( '.autosuggest-item' ).on( 'click', function( event ) { - selectAutosuggestItem( $localInput, event.srcElement.innerText ); - submitSearchForm( $localInput ); + selectItem( $localInput, event.srcElement ); } ); $localInput.off( 'keydown' ); @@ -163,8 +189,7 @@ break; case 13: // Enter if ( $results.hasClass( 'selected' ) ) { - selectAutosuggestItem( $localInput, $current.find('span').text() ); - submitSearchForm( $localInput ); + selectItem( $localInput, $current.get(1) ); return false; } else { // No item selected @@ -277,17 +302,22 @@ var options = titleOptions.concat( termOptions ); var filteredOptions = []; + var filteredObjects = []; $.each( options, function( index, element ){ if( $.inArray( element.text, filteredOptions ) === -1 ) { filteredOptions.push( element.text ); + filteredObjects.push( { + 'text': element.text, + 'url': element._source.permalink + } ); } } ); - if ( 0 === filteredOptions.length ) { + if ( 0 === filteredObjects.length ) { hideAutosuggestBox(); } else { - updateAutosuggestBox( filteredOptions, $localInput ); + updateAutosuggestBox( filteredObjects, $localInput ); } } else { hideAutosuggestBox(); diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 1b846ad313..27d282e81c 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -150,11 +150,18 @@ function ep_autosuggest_enqueue_scripts() { EP_VERSION ); - // Output some variables for our JS to use - namely the index name and the post type to use for suggestions + /** + * Output variables to use in Javascript + * index: the Elasticsearch index name + * host: the Elasticsearch host + * postType: which post types to use for suggestions + * action: the action to take when selecting an item. Possible values are "search" and "navigate". + */ wp_localize_script( 'elasticpress-autosuggest', 'epas', array( 'index' => ep_get_index_name( get_current_blog_id() ), - 'host' => apply_filters( 'ep_host', ep_get_host() ), - 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), + 'host' => apply_filters( 'epas_host', ep_get_host() ), + 'postType' => apply_filters( 'epas_term_suggest_post_type', 'all' ), + 'action' => apply_filters( 'epas_click_action', 'search' ), ) ); } From 67befcdb8ba2b67b9bae9929938fb015cab2a7c6 Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Wed, 23 Aug 2017 09:30:02 -0300 Subject: [PATCH 52/96] fix changed filter prefixes --- features/autosuggest/autosuggest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 27d282e81c..21fd9cb456 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -159,8 +159,8 @@ function ep_autosuggest_enqueue_scripts() { */ wp_localize_script( 'elasticpress-autosuggest', 'epas', array( 'index' => ep_get_index_name( get_current_blog_id() ), - 'host' => apply_filters( 'epas_host', ep_get_host() ), - 'postType' => apply_filters( 'epas_term_suggest_post_type', 'all' ), + 'host' => apply_filters( 'ep_host', ep_get_host() ), + 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), 'action' => apply_filters( 'epas_click_action', 'search' ), ) ); } From 19ff5b0144a8932b43d008bfb7cdec6f2af28eab Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 23 Aug 2017 11:01:17 -0400 Subject: [PATCH 53/96] Increase network alias timeout --- classes/class-ep-api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index e4fa48e85c..5a96f87cec 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -438,6 +438,7 @@ public function create_network_alias( $indexes ) { $request_args = array( 'body' => json_encode( $args ), 'method' => 'POST', + 'timeout' => 25, ); $request = ep_remote_request( $path, apply_filters( 'ep_create_network_alias_request_args', $request_args, $args, $indexes ), array(), 'create_network_alias' ); From c7e44f3d3f64cd5e349e1de0bb34f9bc585b3a20 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 24 Aug 2017 00:59:06 -0400 Subject: [PATCH 54/96] Dont use completion field; use ngram analyzer at index time --- features/autosuggest/autosuggest.php | 84 +++++++++++++++++----------- lang/elasticpress.pot | 2 +- 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 1b846ad313..8ecce0d386 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -29,10 +29,8 @@ function ep_autosuggest_feature_box_long() { */ function ep_autosuggest_setup() { add_action( 'wp_enqueue_scripts', 'ep_autosuggest_enqueue_scripts' ); - add_filter( 'ep_config_mapping', 'ep_autosuggest_completion_mapping' ); + add_filter( 'ep_config_mapping', 'ep_autosuggest_suggest_mapping' ); add_filter( 'ep_post_sync_args', 'ep_autosuggest_filter_term_suggest', 10, 2 ); - add_filter( 'ep_post_sync_args_post_prepare_meta', 'ep_autosuggest_no_blank_title', 10, 2 ); - add_action( 'ep_feature_box_settings_autosuggest', 'ep_autosugguest_settings', 10, 1 ); } /** @@ -47,13 +45,14 @@ function ep_autosugguest_settings( $feature ) { if ( ! $settings ) { $settings = array(); } + $settings = wp_parse_args( $settings, $feature->default_settings ); ?>
          -
          +
          - +
          @@ -61,39 +60,32 @@ function ep_autosugguest_settings( $feature ) { } /** - * Blank titles dont work with the completion mapping type - * - * @param array $post_args - * @param int $post_id - * @since 2.4 - * @return array - */ -function ep_autosuggest_no_blank_title( $post_args, $post_id ) { - if ( empty( $post_args['post_title'] ) ) { - unset( $post_args['post_title'] ); - } - - return $post_args; -} - -/** - * Add mapping for completion fields + * Add mapping for suggest fields * * @param array $mapping * @since 2.4 * @return array */ -function ep_autosuggest_completion_mapping( $mapping ) { - $mapping['mappings']['post']['properties']['post_title']['fields']['completion'] = array( - 'type' => 'completion', - 'analyzer' => 'simple', - 'search_analyzer' => 'simple', +function ep_autosuggest_suggest_mapping( $mapping ) { + $mapping['mappings']['post']['properties']['post_title']['fields']['suggest'] = array( + 'type' => 'text', + 'analyzer' => 'edge_ngram_analyzer', + 'search_analyzer' => 'standard', + ); + + $mapping['settings']['analysis']['analyzer']['edge_ngram_analyzer'] = array( + 'type' => 'custom', + 'tokenizer' => 'standard', + 'filter' => array( + 'lowercase', + 'edge_ngram', + ), ); $mapping['mappings']['post']['properties']['term_suggest'] = array( - 'type' => 'completion', - 'analyzer' => 'simple', - 'search_analyzer' => 'simple', + 'type' => 'text', + 'analyzer' => 'edge_ngram_analyzer', + 'search_analyzer' => 'standard', ); return $mapping; @@ -131,6 +123,19 @@ function ep_autosuggest_filter_term_suggest( $post_args, $post_id ) { * @since 2.4 */ function ep_autosuggest_enqueue_scripts() { + $feature = ep_get_registered_feature( 'autosuggest' ); + + $settings = $feature->get_settings(); + + if ( ! $settings ) { + $settings = array(); + } + + $settings = wp_parse_args( $settings, $feature->default_settings ); + + if ( empty( $settings['host'] ) ) { + return; + } $js_url = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? EP_URL . 'features/autosuggest/assets/js/src/autosuggest.js' : EP_URL . 'features/autosuggest/assets/js/autosuggest.min.js'; $css_url = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? EP_URL . 'features/autosuggest/assets/css/autosuggest.css' : EP_URL . 'features/autosuggest/assets/css/autosuggest.min.css'; @@ -153,7 +158,7 @@ function ep_autosuggest_enqueue_scripts() { // Output some variables for our JS to use - namely the index name and the post type to use for suggestions wp_localize_script( 'elasticpress-autosuggest', 'epas', array( 'index' => ep_get_index_name( get_current_blog_id() ), - 'host' => apply_filters( 'ep_host', ep_get_host() ), + 'host' => apply_filters( 'ep_autosuggest_host', esc_url( untrailingslashit( $settings['host'] ) ) ), 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), ) ); } @@ -168,14 +173,25 @@ function ep_autosuggest_enqueue_scripts() { function ep_autosuggest_requirements_status( $status ) { $host = ep_get_host(); + $status->code = 1; + if ( ! preg_match( '#elasticpress\.io#i', $host ) ) { - $status->code = 1; - $status->message = __( "You aren't using ElasticPress.io so we can't be sure your Elasticsearch instance is secure.", 'elasticpress' ); + $status->message = __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. An insecure or misconfigured autosuggest host poses a severe security risk to your website.", 'elasticpress' ); } return $status; } +/** + * Add autosuggest setting fields + * + * @since 2.4 + */ +function ep_autosuggest_setup_settings() { + add_action( 'ep_feature_box_settings_autosuggest', 'ep_autosugguest_settings', 10, 1 ); +} +add_action( 'admin_init', 'ep_autosuggest_setup_settings' ); + /** * Register the feature * @@ -189,6 +205,6 @@ function ep_autosuggest_requirements_status( $status ) { 'requires_install_reindex' => true, 'requirements_status_cb' => 'ep_autosuggest_requirements_status', 'default_settings' => array( - 'endpoint' => '', + 'host' => ep_get_host(), ), ) ); diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot index 9ec50a77d7..b516615087 100644 --- a/lang/elasticpress.pot +++ b/lang/elasticpress.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: ElasticPress 2.4\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n" -"POT-Creation-Date: 2017-08-22 04:41:20+00:00\n" +"POT-Creation-Date: 2017-08-24 03:29:36+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" From c551f9f1e33632bb8576ead5c6645dd247676153 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 24 Aug 2017 01:06:26 -0400 Subject: [PATCH 55/96] Fix suggest query --- .../autosuggest/assets/js/autosuggest.min.js | 2 +- .../autosuggest/assets/js/src/autosuggest.js | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 62c7172a17..9c14d8343d 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function n(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{suggest:{"post-suggest":{text:e,completion:{field:"post_title.completion"}},"term-suggest":{text:e,completion:{field:"term_suggest"}}}}}function a(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function i(o,n){var a,i=n.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=i.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),o.length>0?i.show():i.hide(),a=0;a'+r+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){s(n,e.srcElement.innerText),t(n)}),n.off("keydown"),n.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var o,a=n.closest(".ep-autosuggest-container").find(".autosuggest-list li"),i=a.filter(".selected");switch(e.keyCode){case 38:o=i.prev();break;case 40:a.hasClass("selected")?o=i.next():(a.first().addClass("selected"),o=a.first());break;case 13:return a.hasClass("selected")?(s(n,i.find("span").text()),t(n),!1):void 0}if(o.is("li")?(i.removeClass("selected"),o.addClass("selected")):a.removeClass("selected"),38===e.keyCode)return!1}})}function u(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var r=e('input.elasticpress-autosuggest, input[type="search"]'),c=e('
            ');r.each(function(t,s){var o=e('
            '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),c.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),c.css({top:r.outerHeight()-1,"background-color":r.css("background-color")}),e(r).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&u()})}),r.each(function(t,s){var r=e(s);r.on("keyup",o(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=r.val(),o=epas.postType;s.length>=2?a(n(s,o)).done(function(t){if(t._shards.successful>0){var s=t.suggest["post-suggest"][0].options,o=t.suggest["term-suggest"][0].options,n=s.concat(o),a=[];e.each(n,function(t,s){-1===e.inArray(s.text,a)&&a.push(s.text)}),0===a.length?u():i(a,r)}else u()}):0===s.length&&u()}},100))}),window.epasAPI={hideAutosuggestBox:u,updateAutosuggestBox:i,esSearch:a,buildSearchQuery:n}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function s(e){e.closest("form").submit()}function t(e,s){e.val(s)}function o(e,s){var t=null;return function(){var o=this,n=arguments;window.clearTimeout(t),t=window.setTimeout(function(){e.apply(o,n)},s)}}function n(e,s){return"all"!==s&&void 0!==s&&""!==s||(s="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function a(s){var t=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:t,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(s)})}function u(o,n){var a,u=n.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=u.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),o.length>0?u.show():u.hide(),a=0;a'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){t(n,e.srcElement.innerText),s(n)}),n.off("keydown"),n.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var o,a=n.closest(".ep-autosuggest-container").find(".autosuggest-list li"),u=a.filter(".selected");switch(e.keyCode){case 38:o=u.prev();break;case 40:a.hasClass("selected")?o=u.next():(a.first().addClass("selected"),o=a.first());break;case 13:return a.hasClass("selected")?(t(n,u.find("span").text()),s(n),!1):void 0}if(o.is("li")?(u.removeClass("selected"),o.addClass("selected")):a.removeClass("selected"),38===e.keyCode)return!1}})}function i(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var r=e('input.elasticpress-autosuggest, input[type="search"]'),c=e('
              ');r.each(function(s,t){var o=e('
              '),n=e(t);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),c.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),c.css({top:r.outerHeight()-1,"background-color":r.css("background-color")}),e(r).each(function(s,t){e(t).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&i()})}),r.each(function(s,t){var r=e(t);r.on("keyup",o(function(s){if(38!==s.keyCode&&40!==s.keyCode&&13!==s.keyCode&&27!==s.keyCode){var t=r.val(),o=epas.postType;t.length>=2?a(n(t,o)).done(function(s){if(s._shards.successful>0){var t=s.suggest["post-suggest"][0].options,o=s.suggest["term-suggest"][0].options,n=t.concat(o),a=[];e.each(n,function(s,t){-1===e.inArray(t.text,a)&&a.push(t.text)}),0===a.length?i():u(a,r)}else i()}):0===t.length&&i()}},100))}),window.epasAPI={hideAutosuggestBox:i,updateAutosuggestBox:u,esSearch:a,buildSearchQuery:n}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index f47303a96b..0fd0a48f83 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -64,18 +64,10 @@ } // TODO: check comma separated var query = { - suggest: { - 'post-suggest': { - text: searchText, - completion: { - field: 'post_title.completion' - } - }, - 'term-suggest': { - text: searchText, - completion: { - field: 'term_suggest' - } + query: { + multi_match: { + query: searchText, + fields: [ 'post_title.suggest', 'term_suggest' ] } } }; From bda8b4f1db3d4ca83e9b482922673179fce8f39a Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Thu, 24 Aug 2017 09:17:03 -0300 Subject: [PATCH 56/96] fix generated response objects to use the new ngram response --- .../autosuggest/assets/js/autosuggest.min.js | 6 +----- .../autosuggest/assets/js/src/autosuggest.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 0a66731ba3..fe467000e6 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1,5 +1 @@ -<<<<<<< HEAD -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function n(e,n){if("navigate"===epas.action)return o(e,n.dataset.url);s(e,n.innerText),t(e)}function a(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{suggest:{"post-suggest":{text:e,completion:{field:"post_title.completion"}},"term-suggest":{text:e,completion:{field:"term_suggest"}}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,a=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=a.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?a.show():a.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){n(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),a=o.filter(".selected");switch(e.keyCode){case 38:t=a.prev();break;case 40:o.hasClass("selected")?t=a.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(n(s,a.get(1)),!1):void 0}if(t.is("li")?(a.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),g=e('
                ');l.each(function(t,s){var o=e('
                '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),g.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),g.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",a(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),n=epas.postType;s.length>=2?i(u(s,n)).done(function(t){if(t._shards.successful>0){var s=t.suggest["post-suggest"][0].options,n=t.suggest["term-suggest"][0].options,a=s.concat(n),u=[],i=[];e.each(a,function(t,s){-1===e.inArray(s.text,u)&&(u.push(s.text),i.push({text:s.text,url:s._source.permalink}))}),0===i.length?c():r(i,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); -======= -!function(e){"use strict";function s(e){e.closest("form").submit()}function t(e,s){e.val(s)}function o(e,s){var t=null;return function(){var o=this,n=arguments;window.clearTimeout(t),t=window.setTimeout(function(){e.apply(o,n)},s)}}function n(e,s){return"all"!==s&&void 0!==s&&""!==s||(s="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function a(s){var t=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:t,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(s)})}function u(o,n){var a,u=n.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=u.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),o.length>0?u.show():u.hide(),a=0;a'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){t(n,e.srcElement.innerText),s(n)}),n.off("keydown"),n.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var o,a=n.closest(".ep-autosuggest-container").find(".autosuggest-list li"),u=a.filter(".selected");switch(e.keyCode){case 38:o=u.prev();break;case 40:a.hasClass("selected")?o=u.next():(a.first().addClass("selected"),o=a.first());break;case 13:return a.hasClass("selected")?(t(n,u.find("span").text()),s(n),!1):void 0}if(o.is("li")?(u.removeClass("selected"),o.addClass("selected")):a.removeClass("selected"),38===e.keyCode)return!1}})}function i(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var r=e('input.elasticpress-autosuggest, input[type="search"]'),c=e('
                  ');r.each(function(s,t){var o=e('
                  '),n=e(t);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),c.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),c.css({top:r.outerHeight()-1,"background-color":r.css("background-color")}),e(r).each(function(s,t){e(t).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&i()})}),r.each(function(s,t){var r=e(t);r.on("keyup",o(function(s){if(38!==s.keyCode&&40!==s.keyCode&&13!==s.keyCode&&27!==s.keyCode){var t=r.val(),o=epas.postType;t.length>=2?a(n(t,o)).done(function(s){if(s._shards.successful>0){var t=s.suggest["post-suggest"][0].options,o=s.suggest["term-suggest"][0].options,n=t.concat(o),a=[];e.each(n,function(s,t){-1===e.inArray(t.text,a)&&a.push(t.text)}),0===a.length?i():u(a,r)}else i()}):0===t.length&&i()}},100))}),window.epasAPI={hideAutosuggestBox:i,updateAutosuggestBox:u,esSearch:a,buildSearchQuery:n}}}(jQuery); ->>>>>>> upstream/feature/autosuggest +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                    ');l.each(function(t,s){var o=e('
                    '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s=[],a=[];e.each(t.hits.hits,function(t,o){var n=o._source.post_title,u=o._source.permalink;-1===e.inArray(n,s)&&(s.push(n),a.push({text:n,url:u}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index 5627e925ac..a8db7af86b 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -289,19 +289,17 @@ request.done( function( response ) { if ( response._shards.successful > 0 ) { - var titleOptions = response.suggest['post-suggest'][0]['options']; - var termOptions = response.suggest['term-suggest'][0]['options']; - - var options = titleOptions.concat( termOptions ); var filteredOptions = []; var filteredObjects = []; - $.each( options, function( index, element ){ - if( $.inArray( element.text, filteredOptions ) === -1 ) { - filteredOptions.push( element.text ); + $.each( response.hits.hits, function( index, element ){ + var text = element._source.post_title; + var url = element._source.permalink; + if( $.inArray( text, filteredOptions ) === -1 ) { + filteredOptions.push( text ); filteredObjects.push( { - 'text': element.text, - 'url': element._source.permalink + 'text': text, + 'url': url } ); } } ); From 4e2da86a8f4540347c9020583ffdaa8e35abb7b2 Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Thu, 24 Aug 2017 09:23:57 -0300 Subject: [PATCH 57/96] reorganizing Gruntfile to keep source/minified files in feature folders --- Gruntfile.js | 19 ++++------- assets/css/admin.css | 1 + assets/css/admin.css.map | 10 +++++- assets/css/autosuggest.css | 34 ------------------- assets/css/autosuggest.css.map | 1 - assets/css/autosuggest.min.css | 1 - .../assets/css/autosuggest.min.css | 1 + 7 files changed, 18 insertions(+), 49 deletions(-) delete mode 100644 assets/css/autosuggest.css delete mode 100644 assets/css/autosuggest.css.map delete mode 100644 assets/css/autosuggest.min.css create mode 100644 features/autosuggest/assets/css/autosuggest.min.css diff --git a/Gruntfile.js b/Gruntfile.js index c6e2adee11..44319e8c4c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -31,11 +31,9 @@ module.exports = function ( grunt ) { map : true }, - files : { - expand : true, - flatten : true, - src : ['assets/css/admin.css', 'features/autosuggest/assets/css/autosuggest.css'], - dest : 'assets/css' + files: { + 'assets/css/admin.css': ['assets/css/admin.css'], + 'features/autosuggest/assets/css/autosuggest.min.css': ['features/autosuggest/assets/css/autosuggest.css'] } }, @@ -44,13 +42,10 @@ module.exports = function ( grunt ) { target : { - files : [{ - expand : true, - cwd : 'assets/css', - src : ['admin.css', 'autosuggest.css'], - dest : 'assets/css', - ext : '.min.css' - }] + files: { + 'assets/css/admin.min.css': ['assets/css/admin.css'], + 'features/autosuggest/assets/css/autosuggest.min.css': ['features/autosuggest/assets/css/autosuggest.css'] + } } diff --git a/assets/css/admin.css b/assets/css/admin.css index 77ae42262c..38d38f2248 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -401,4 +401,5 @@ h2.ep-list-features { vertical-align: middle; display: inline-block; padding-top: .5em; } } + /*# sourceMappingURL=admin.css.map */ \ No newline at end of file diff --git a/assets/css/admin.css.map b/assets/css/admin.css.map index 2e252dceda..3e7f91a244 100644 --- a/assets/css/admin.css.map +++ b/assets/css/admin.css.map @@ -1 +1,9 @@ -{"version":3,"sources":["admin.scss"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;EAEC,WAAU;EACP,mBAAkB,EACrB;;AAED;EACC,YAAW;EACX,kBAAiB;EACjB,qBAAoB,EACpB;;AAED;;EAEC,mBAAkB;EAClB,YAAW;EACX,cAAa;EACb,oBAAmB,EACnB;;AAED;EACC,cAAa,EACb;;AAED;;GAEG;AAEH;EACC,uBAAsB;EACtB,mBAAkB;EAClB,mBAAkB;EAClB,mBAAkB;EAClB,oBAAmB;EACnB,iBAAgB;EAChB,oBAAmB;EACnB,8BAA6B;EAC7B,WAAU,EACV;;AAED;EACC,aAAY;EACZ,YAAW;EACX,eAAc,EACd;;AAED;EACC,YAAW,EACX;;AAED;EACC,aAAY;EACZ,mBAAkB;EAClB,aAAY;EACZ,kBAAiB;EACjB,sBAAqB,EACrB;;AAED;EACC,gBAAe;EACf,mBAAkB;EAClB,UAAS,EACT;;AAED;EACC,gBAAe;EACf,uBAAsB;EACtB,eAAc;EACd,mBAAkB;EAClB,UAAS;EACT,iBAAgB;EAChB,gBAAe,EACf;;AAED;;;EAGC,SAAQ;EACR,gBAAe,EACf;;AAED;;;EAGC,cAAa,EACb;;AAED;EACC,cAAa;EACb,YAAW;EACX,aAAY;EACZ,mBAAkB;EAClB,kBAAiB;EACd,uBAAsB;EACtB,mBAAkB,EACrB;;AAED;EACC,oBAAmB;EACnB,YAAW;EACX,mBAAkB;EAClB,UAAS;EACT,QAAO;EACP,0BAAyB,EACzB;;AAED;;GAEG;AAEH;EACC,eAAc,EACd;;AAED;;EAEC,aAAY;EACZ,eA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AkB;EAClB,0BAAyB;EACzB,2BAA0B;EAC1B,eAAc;EACd,YAAW,EACX;;AAED;EACC,mBAAkB;EAClB,0BAAyB;EACzB,eAAc;EACd,sBAAqB;EACrB,gBAAe;EACf,sBAAqB;EACrB,mBAAkB;EAClB,gDAA4C,EAC5C;;AAED;EACC,uBAAsB;EACtB,eAAc,EACd;;AAED;;GAEG;AAEH;EACC;IACC,gCAA+B;IAC/B,wBAAuB,EAAA;EAExB;IACC,kCAAiC;IACjC,0BAAyB,EAAA,EAAA;;AAI3B;EACC;IACC,gCAA+B;IAC/B,wBAAuB,EAAA;EAExB;IACC,kCAAiC;IACjC,0BAAyB,EAAA,EAAA;;AAI3B;EACC;IACC,YAAW;IACX,WAAU,EACV;EAED;IACC,eAAc;IACd,kBAAiB;IACjB,WAAU;IACV,eAAc;IACd,aAAY;IACZ,aAAY,EACZ;EAED;IACC,eAAc;IACd,YAAW;IACX,uBAAsB;IACtB,oBAAmB;IACnB,WAAU,EACV;EAED;IACC,eAAc;IACd,aAAY;IACZ,uBAAsB;IACtB,mBAAkB;IAClB,WAAU,EACV;EAED;IACC,YAAW;IACX,WAAU;IACV,uBAAsB;IACtB,sBAAqB;IACrB,kBAAiB,EACjB,EAAA","file":"admin.css"} \ No newline at end of file +{ + "version": 3, + "file": "admin.css", + "sources": [ + "admin.scss" + ], + "names": [], + "mappings": "AAKA;;GAEG;AAEH,AAAM,KAAD,CAAC,OAAO;AACb,AAAQ,KAAH,GAAG,EAAE,CAAC;EACV,OAAO,EAAE,CAAC;EACP,QAAQ,EAAE,QAAQ,GACrB;;AAED,AAAM,KAAD,CAAC,EAAE,CAAC;EACR,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,IAAI;EACjB,MAAM,EAAE,YAAY,GACpB;;AAED,AAAQ,OAAD,CAAC,WAAW;AACnB,AAAQ,OAAD,CAAC,WAAW,CAAC;EACnB,WAAW,EAAE,KAAK;EAClB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,CAAC;E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,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,UAAU;IACtB,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,GAAG,GACV;EAED,AAAa,YAAD,CAAC,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,GAAG,GACV;EAED,AAAY,WAAD,CAAC,gBAAgB,CAAC;IAC5B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,CAAC;IACV,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,YAAY;IACrB,WAAW,EAAE,IAAI,GACjB" +} \ No newline at end of file diff --git a/assets/css/autosuggest.css b/assets/css/autosuggest.css deleted file mode 100644 index fbd23f9514..0000000000 --- a/assets/css/autosuggest.css +++ /dev/null @@ -1,34 +0,0 @@ -/** - * ElasticPress Autosuggest - * http://github.com/10up/ElasticPress-Autosuggest - * - * Copyright (c) 2014 Aaron Holbrook, 10up - * Licensed under the GPLv2+ license. - */ -.ep-autosuggest-container { - position: relative; } - .ep-autosuggest-container .ep-autosuggest { - display: none; - background: white; - position: absolute; - border: 1px solid #ccc; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - width: 100%; - z-index: 200; } - .ep-autosuggest-container .ep-autosuggest > ul { - margin: 0 !important; - list-style: none; } - .ep-autosuggest-container .ep-autosuggest > ul > li { - font-family: sans-serif; } - .ep-autosuggest-container .ep-autosuggest > ul > li > span { - display: block; - color: #000; - padding: 2px 10px; - cursor: pointer; } - .ep-autosuggest-container .ep-autosuggest > ul > li > span:hover, .ep-autosuggest-container .ep-autosuggest > ul > li > span:active { - background-color: #EEEEEE; - text-decoration: none; } - .ep-autosuggest-container .selected { - background-color: #EEE; - text-decoration: none; } -/*# sourceMappingURL=autosuggest.css.map */ \ No newline at end of file diff --git a/assets/css/autosuggest.css.map b/assets/css/autosuggest.css.map deleted file mode 100644 index 5251d0c457..0000000000 --- a/assets/css/autosuggest.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../features/autosuggest/assets/css/autosuggest.scss"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;EACC,mBAAkB,EAwClB;EAzCD;IAIE,cAAa;IACb,kBAAiB;IAEjB,mBAAkB;IAElB,uBAAsB;IAItB,yCAAyC;IAEzC,YAAW;IACX,aAAY,EAmBZ;IAnCF;MAkBG,qBAAoB;MACpB,iBAAgB,EAehB;MAlCH;QAqBI,wBAAuB,EAYvB;QAjCJ;UAuBK,eAAc;UACd,YAAW;UACX,kBAAiB;UACjB,gBAAe,EAMf;UAhCL;YA6BM,0BAAyB;YACzB,sBAAqB,EACrB;EA/BN;IAsCE,uBAAsB;IACtB,sBAAqB,EACrB","file":"autosuggest.css"} \ No newline at end of file diff --git a/assets/css/autosuggest.min.css b/assets/css/autosuggest.min.css deleted file mode 100644 index 4adf766ea0..0000000000 --- a/assets/css/autosuggest.min.css +++ /dev/null @@ -1 +0,0 @@ -.ep-autosuggest-container{position:relative}.ep-autosuggest-container .ep-autosuggest{display:none;background:#fff;position:absolute;border:1px solid #ccc;box-shadow:0 2px 4px rgba(0,0,0,.2);width:100%;z-index:200}.ep-autosuggest-container .ep-autosuggest>ul{margin:0!important;list-style:none}.ep-autosuggest-container .ep-autosuggest>ul>li{font-family:sans-serif}.ep-autosuggest-container .ep-autosuggest>ul>li>span{display:block;color:#000;padding:2px 10px;cursor:pointer}.ep-autosuggest-container .ep-autosuggest>ul>li>span:active,.ep-autosuggest-container .ep-autosuggest>ul>li>span:hover{background-color:#eee;text-decoration:none}.ep-autosuggest-container .selected{background-color:#eee;text-decoration:none} \ No newline at end of file diff --git a/features/autosuggest/assets/css/autosuggest.min.css b/features/autosuggest/assets/css/autosuggest.min.css new file mode 100644 index 0000000000..44a8b75f99 --- /dev/null +++ b/features/autosuggest/assets/css/autosuggest.min.css @@ -0,0 +1 @@ +.ep-autosuggest-container{position:relative}.ep-autosuggest-container .ep-autosuggest{display:none;background:#fff;position:absolute;border:1px solid #ccc;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2);width:100%;z-index:200}.ep-autosuggest-container .ep-autosuggest>ul{margin:0!important;list-style:none}.ep-autosuggest-container .ep-autosuggest>ul>li{font-family:sans-serif}.ep-autosuggest-container .ep-autosuggest>ul>li>span{display:block;color:#000;padding:2px 10px;cursor:pointer}.ep-autosuggest-container .ep-autosuggest>ul>li>span:active,.ep-autosuggest-container .ep-autosuggest>ul>li>span:hover{background-color:#eee;text-decoration:none}.ep-autosuggest-container .selected{background-color:#eee;text-decoration:none} \ No newline at end of file From 5460d0ba758c70301a173e03837e0318c5631797 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 24 Aug 2017 09:43:18 -0400 Subject: [PATCH 58/96] Simplify front end filters --- features/autosuggest/autosuggest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 3187a00195..082d6ee4a8 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -162,12 +162,12 @@ function ep_autosuggest_enqueue_scripts() { * postType: which post types to use for suggestions * action: the action to take when selecting an item. Possible values are "search" and "navigate". */ - wp_localize_script( 'elasticpress-autosuggest', 'epas', array( + wp_localize_script( 'elasticpress-autosuggest', 'epas', apply_filters( 'ep_autosuggest_options', array( 'index' => ep_get_index_name( get_current_blog_id() ), - 'host' => apply_filters( 'ep_autosuggest_host', esc_url( untrailingslashit( $settings['host'] ) ) ), - 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), - 'action' => apply_filters( 'epas_click_action', 'search' ), - ) ); + 'host' => esc_url( untrailingslashit( $settings['host'] ) ), + 'postType' => 'all', + 'action' => 'navigate', + ) ) ); } /** From 24a478885ffa9fda91fa0a2115eef05f581dfebf Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 24 Aug 2017 09:46:54 -0400 Subject: [PATCH 59/96] Trim trailing whitespace --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index a1eb91244c..dca2b15957 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,6 +3,7 @@ root = true [*] indent_style = space indent_size = 2 +trim_trailing_whitespace = true [*.{php,js,css,scss}] end_of_line = lf From 29dc134ddf3fbac5ab10898077b2aafc2c1b0971 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 24 Aug 2017 09:49:25 -0400 Subject: [PATCH 60/96] More effectively check if a post is used --- features/autosuggest/assets/js/autosuggest.min.js | 2 +- features/autosuggest/assets/js/src/autosuggest.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index fe467000e6..9f7cd9e286 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                      ');l.each(function(t,s){var o=e('
                      '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s=[],a=[];e.each(t.hits.hits,function(t,o){var n=o._source.post_title,u=o._source.permalink;-1===e.inArray(n,s)&&(s.push(n),a.push({text:n,url:u}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                        ');l.each(function(t,s){var o=e('
                        '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,u=t._source.post_id;s[u]||(s[u]=!0,a.push({text:o,url:n}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index a8db7af86b..97a48a0729 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -289,14 +289,17 @@ request.done( function( response ) { if ( response._shards.successful > 0 ) { - var filteredOptions = []; + var usedPosts = {}; var filteredObjects = []; $.each( response.hits.hits, function( index, element ){ var text = element._source.post_title; var url = element._source.permalink; - if( $.inArray( text, filteredOptions ) === -1 ) { - filteredOptions.push( text ); + var postId = element._source.post_id; + + if( ! usedPosts[ postId ] ) { + usedPosts[ postId ] = true; + filteredObjects.push( { 'text': text, 'url': url From d6400d082f64498619e77b68dfdfc7d461b6e623 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 24 Aug 2017 10:02:30 -0400 Subject: [PATCH 61/96] Sort autosuggest results by relevancy --- features/autosuggest/assets/js/autosuggest.min.js | 2 +- features/autosuggest/assets/js/src/autosuggest.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 9f7cd9e286..4656b06704 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                          ');l.each(function(t,s){var o=e('
                          '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,u=t._source.post_id;s[u]||(s[u]=!0,a.push({text:o,url:n}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{sort:[{_score:{order:"desc"}}],query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                            ');l.each(function(t,s){var o=e('
                            '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,u=t._source.post_id;s[u]||(s[u]=!0,a.push({text:o,url:n}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index 97a48a0729..6bb0c5932a 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -88,8 +88,15 @@ if ( postType === 'all' || typeof( postType ) === 'undefined' || postType === '' ) { postType = 'all'; } - // TODO: check comma separated + var query = { + sort: [ + { + _score: { + order: 'desc' + } + } + ], query: { multi_match: { query: searchText, @@ -319,7 +326,7 @@ } else if ( 0 === val.length ) { hideAutosuggestBox(); } - }, 100 ) ); + }, 200 ) ); } ); // Publically expose API From e9838587ab4d6042f14849cb5baeb0bd550be2d8 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Thu, 24 Aug 2017 12:17:36 -0500 Subject: [PATCH 62/96] Support ES 5.5.x and strict content type checking --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 60b9bf4423..65447f1685 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ php: env: - WP_VERSION=latest WP_MULTISITE=1 ES_VERSION="5.0.2" - WP_VERSION=latest WP_MULTISITE=1 ES_VERSION="5.2.2" + - WP_VERSION=latest WP_MULTISITE=1 ES_VERSION="5.5.1" before_install: - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.deb && sudo dpkg -i --force-confnew elasticsearch-$ES_VERSION.deb && sudo service elasticsearch restart From 270f333765dc28cc3e3d09c40f4cf05358990cd2 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Thu, 24 Aug 2017 12:20:16 -0500 Subject: [PATCH 63/96] Add Content-Type: application/json header to search queries Fixes #925 --- classes/class-ep-api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 5a96f87cec..e00f0e702c 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -210,6 +210,9 @@ public function query( $args, $query_args, $scope = 'current' ) { $request_args = array( 'body' => json_encode( apply_filters( 'ep_search_args', $args, $scope, $query_args ) ), 'method' => 'POST', + 'headers' => array( + 'Content-Type' => 'application/json', + ), ); $request = ep_remote_request( $path, apply_filters( 'ep_search_request_args', $request_args, $args, $scope, $query_args ), $query_args, 'query' ); From f150cbb452a74137c34bd302de5e643bf2dd7b8a Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Thu, 24 Aug 2017 12:27:51 -0500 Subject: [PATCH 64/96] Update max ES version supported --- elasticpress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticpress.php b/elasticpress.php index 85d2696641..a8496e4d50 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -33,7 +33,7 @@ * * @since 2.2 */ -define( 'EP_ES_VERSION_MAX', '5.3' ); +define( 'EP_ES_VERSION_MAX', '5.5' ); define( 'EP_ES_VERSION_MIN', '1.7' ); require_once( 'classes/class-ep-config.php' ); From eead9fecec567c06ddeef20f03b815983531acf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Mon, 28 Aug 2017 11:56:00 +0200 Subject: [PATCH 65/96] Update comment --- features/woocommerce/woocommerce.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 2fba95fc93..501a9fad86 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -598,6 +598,10 @@ function ep_wc_search_order( $wp ){ /** * Add order items as a searchable string. * + * This mimics how WooCommerce currently does in the order_itemmeta + * table. They combine the titles of the products and put them in a + * meta field called "Items". + * * @since TBD * * @param array $post_args From ca3e53e5df5811b81f1c3196037a6173c44f8255 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 28 Aug 2017 10:59:29 -0400 Subject: [PATCH 66/96] Properly hook into search fields; feature language --- .../autosuggest/assets/js/autosuggest.min.js | 2 +- .../autosuggest/assets/js/src/autosuggest.js | 2 +- features/autosuggest/autosuggest.php | 18 ++++++---- lang/elasticpress.pot | 36 +++++++++++++------ 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 4656b06704..08e9b29ddc 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{sort:[{_score:{order:"desc"}}],query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                              ');l.each(function(t,s){var o=e('
                              '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,u=t._source.post_id;s[u]||(s[u]=!0,a.push({text:o,url:n}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{sort:[{_score:{order:"desc"}}],query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                ');l.each(function(t,s){var o=e('
                                '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,u=t._source.post_id;s[u]||(s[u]=!0,a.push({text:o,url:n}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index 6bb0c5932a..efa325d091 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -226,7 +226,7 @@ $( '.ep-autosuggest' ).hide(); } - var $epInput = $( 'input.elasticpress-autosuggest, input[type="search"]' ); + var $epInput = $( '.ep-autosuggest, input[type="search"], .search-field' ); var $epAutosuggest = $( '
                                  ' ); /** diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 082d6ee4a8..1e9b696670 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -2,23 +2,23 @@ /** * Output feature box summary - * + * * @since 2.4 */ function ep_autosuggest_feature_box_summary() { ?> -

                                  +

                                  -

                                  +

                                  code = 1; + $status->message = array(); + + $status->message[] = esc_html__( 'This feature modifies the default user experience of users by showing a dropdown of suggestions as users type in search boxes.', 'elasticpress' ); + if ( ! preg_match( '#elasticpress\.io#i', $host ) ) { - $status->message = __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. An insecure or misconfigured autosuggest host poses a severe security risk to your website.", 'elasticpress' ); + $status->message[] = __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. An insecure or misconfigured autosuggest host poses a severe security risk to your website.", 'elasticpress' ); } return $status; @@ -191,7 +195,7 @@ function ep_autosuggest_requirements_status( $status ) { /** * Add autosuggest setting fields - * + * * @since 2.4 */ function ep_autosuggest_setup_settings() { diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot index b516615087..92688422d4 100644 --- a/lang/elasticpress.pot +++ b/lang/elasticpress.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: ElasticPress 2.4\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n" -"POT-Creation-Date: 2017-08-24 03:29:36+00:00\n" +"POT-Creation-Date: 2017-08-28 14:59:15+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -316,26 +316,34 @@ msgid "The following values do not describe a valid date: month %1$s, day %2$s." msgstr "" #: features/autosuggest/autosuggest.php:10 -msgid "Add autosuggest to ElasticPress powered search fields on the front end." +msgid "Suggest relevant content to users as they type search text." msgstr "" #: features/autosuggest/autosuggest.php:21 msgid "" -"Autosuggest is a very powerful search feature. As a user types a search " -"query, they are automatically suggested items. Autosuggest dramatically " -"increases that users will find what they are looking for on your site, " -"improving overall experience." +"Input fields of type \"search\" or with the CSS class \"search-field\" or " +"\"ep-autosuggest\" will be enhanced with autosuggest functionality. As " +"users type, a dropdown will be shown containing results relevant to their " +"current search. Clicking a suggestion will take a user directly to that " +"piece of content." msgstr "" -#: features/autosuggest/autosuggest.php:54 -msgid "Endpoint Address" +#: features/autosuggest/autosuggest.php:53 +msgid "Host" msgstr "" -#: features/autosuggest/autosuggest.php:173 -#: features/protected-content/protected-content.php:143 +#: features/autosuggest/autosuggest.php:187 +msgid "" +"This feature modifies the default user experience of users by showing a " +"dropdown of suggestions as users type in search boxes." +msgstr "" + +#: features/autosuggest/autosuggest.php:190 msgid "" "You aren't using ElasticPress.io so " -"we can't be sure your Elasticsearch instance is secure." +"we can't be sure your host is properly secured. An insecure or " +"misconfigured autosuggest host poses a severe security " +"risk to your website." msgstr "" #: features/documents/documents.php:207 @@ -386,6 +394,12 @@ msgid "" "the public." msgstr "" +#: features/protected-content/protected-content.php:143 +msgid "" +"You aren't using ElasticPress.io so " +"we can't be sure your Elasticsearch instance is secure." +msgstr "" + #: features/protected-content/protected-content.php:153 msgid "Protected Content" msgstr "" From 2b9b32e2d7c82036f90908da986d27f16ef25a7c Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Tue, 5 Sep 2017 23:25:13 -0300 Subject: [PATCH 67/96] select which post types will be suggested --- .../autosuggest/assets/js/autosuggest.min.js | 2 +- .../autosuggest/assets/js/src/autosuggest.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index fe467000e6..07242c6c34 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function u(e,t){return"all"!==t&&void 0!==t&&""!==t||(t="all"),{query:{multi_match:{query:e,fields:["post_title.suggest","term_suggest"]}}}}function i(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),u=n.find(".autosuggest-list");for(u.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+i+"").appendTo(u)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                                    ');l.each(function(t,s){var o=e('
                                    '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?i(u(s,a)).done(function(t){if(t._shards.successful>0){var s=[],a=[];e.each(t.hits.hits,function(t,o){var n=o._source.post_title,u=o._source.permalink;-1===e.inArray(n,s)&&(s.push(n),a.push({text:n,url:u}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},100))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:i,buildSearchQuery:u}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(t,s){"all"!==s&&void 0!==s&&""!==s||(s="all");var o={query:{multi_match:{query:t,fields:["post_title.suggest","term_suggest"]}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(o.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),o}function u(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+u+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function l(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var c=e('input.elasticpress-autosuggest, input[type="search"]'),d=e('
                                      ');c.each(function(t,s){var o=e('
                                      '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:c.outerHeight()-1,"background-color":c.css("background-color")}),e(c).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&l()})}),c.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?u(i(s,a)).done(function(t){if(t._shards.successful>0){var s=[],a=[];e.each(t.hits.hits,function(t,o){var n=o._source.post_title,i=o._source.permalink;-1===e.inArray(n,s)&&(s.push(n),a.push({text:n,url:i}))}),0===a.length?l():r(a,o)}else l()}):0===s.length&&l()}},100))}),window.epasAPI={hideAutosuggestBox:l,updateAutosuggestBox:r,esSearch:u,buildSearchQuery:i}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index a8db7af86b..69a7b32fbc 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -88,6 +88,7 @@ if ( postType === 'all' || typeof( postType ) === 'undefined' || postType === '' ) { postType = 'all'; } + // TODO: check comma separated var query = { query: { @@ -98,6 +99,22 @@ } }; + // If we're specifying post types, do it in an array + if ( typeof postType === 'string' && postType !== 'all' ) { + postType = postType.split(','); + } + + // Then add it as a filter to the end of the query + if ( $.isArray( postType ) ) { + query.post_filter = { + bool: { + must: [{ + terms: { 'post_type.raw': postType } + }] + } + }; + } + return query; } From fe1a0918c4048b0cb1c077d55ec164ce87e18f17 Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Tue, 5 Sep 2017 23:35:32 -0300 Subject: [PATCH 68/96] remove old comment --- features/autosuggest/assets/js/src/autosuggest.js | 1 - 1 file changed, 1 deletion(-) diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index 18e700ecdb..d999ee0784 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -89,7 +89,6 @@ postType = 'all'; } - // TODO: check comma separated var query = { sort: [ { From e9a398372e2d60068031a8b2bcf677ac9920c89a Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Wed, 6 Sep 2017 10:48:26 -0300 Subject: [PATCH 69/96] add filter --- features/autosuggest/autosuggest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 1e9b696670..d9924f5f0c 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -165,7 +165,7 @@ function ep_autosuggest_enqueue_scripts() { wp_localize_script( 'elasticpress-autosuggest', 'epas', apply_filters( 'ep_autosuggest_options', array( 'index' => ep_get_index_name( get_current_blog_id() ), 'host' => esc_url( untrailingslashit( $settings['host'] ) ), - 'postType' => 'all', + 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), 'action' => 'navigate', ) ) ); } From ed9468bd0b58c764220674c48d97d1acceade5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Philip=20Kallehauge?= Date: Thu, 7 Sep 2017 23:59:16 +0200 Subject: [PATCH 70/96] Add defensive coding to avoid php errors It was possible to get an error if there were no items on the order because we tried to implode on nothing. --- features/woocommerce/woocommerce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 501a9fad86..2a41e2c57e 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -623,8 +623,8 @@ function ep_wc_add_order_items_search( $post_args, $post_id ) { } // Prepare order items. - $item_meta['_items'] = implode( '|', $item_meta['_items'] ); - $post_args['meta'] = array_merge( $post_args['meta'], EP_API::factory()->prepare_meta_types( $item_meta ) ); + $item_meta['_items'] = empty( $item_meta['_items'] ) ? '' : implode( '|', $item_meta['_items'] ); + $post_args['meta'] = array_merge( $post_args['meta'], EP_API::factory()->prepare_meta_types( $item_meta ) ); return $post_args; } From cb68b40e45e73761b87559d6e4fbbe7ba24cd121 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sun, 10 Sep 2017 19:12:26 -0500 Subject: [PATCH 71/96] Add field description and styling --- assets/css/admin.css | 15 ++++++++++++--- assets/css/admin.css.map | 2 +- assets/css/admin.min.css | 2 +- assets/css/admin.scss | 19 ++++++++++++++++--- features/autosuggest/autosuggest.php | 1 + 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index 38d38f2248..ef29e2d2f6 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -268,15 +268,24 @@ h2.ep-list-features { padding-top: 15px; } .ep-feature .settings .field:first-child { padding-top: 0; } - .ep-feature .settings .field > label, + .ep-feature .settings .field label { + margin: 0.25em 0 0.5em; + display: inline-block; } .ep-feature .settings .field .field-name { display: block; float: left; width: 25%; - margin-right: 1.5em; } + padding-right: 1.5em; + box-sizing: border-box; } .ep-feature .settings .field .input-wrap { + width: 75%; display: block; - float: left; } + float: right; } + .ep-feature .settings .field .field-description { + font-style: italic; + margin-top: 4px; + margin-bottom: 0; + color: #666; } .ep-feature .settings .field .disabled { color: #c4c3c3; } .ep-feature .settings .field .disabled input { diff --git a/assets/css/admin.css.map b/assets/css/admin.css.map index 3e7f91a244..b5945a5640 100644 --- a/assets/css/admin.css.map +++ b/assets/css/admin.css.map @@ -5,5 +5,5 @@ "admin.scss" ], "names": [], - "mappings": "AAKA;;GAEG;AAEH,AAAM,KAAD,CAAC,OAAO;AACb,AAAQ,KAAH,GAAG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;IACpB,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,KAAK,GACZ;EAED,AAAa,YAAD,CAAC,KAAK,CAAC;IAClB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,UAAU;IACtB,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,GAAG,GACV;EAED,AAAa,YAAD,CAAC,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,GAAG,GACV;EAED,AAAY,WAAD,CAAC,gBAAgB,CAAC;IAC5B,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,CAAC;IACV,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,YAAY;IACrB,WAAW,EAAE,IAAI,GACjB" } \ No newline at end of file diff --git a/assets/css/admin.min.css b/assets/css/admin.min.css index 55b503548d..d4f72a1032 100644 --- a/assets/css/admin.min.css +++ b/assets/css/admin.min.css @@ -1 +1 @@ -.wrap .notice,.wrap>h2{z-index:2;position:relative}.wrap h2{color:#888;line-height:1.75;margin:.5em 0 .75em}#wpbody #update-nag,#wpbody .update-nag{margin-left:-20px;width:100%;margin-top:0;margin-bottom:20px}h2.ep-list-features{display:none}.ep-header-menu{background-color:#fff;position:relative;margin-left:-20px;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:5px;border-bottom:2px solid #ddd;z-index:2}.ep-header-menu:after{content:' ';clear:both;display:block}.ep-header-menu img{float:left}.ep-header-menu .icons{float:right;padding-right:3px;height:39px;line-height:39px;display:inline-block}.ep-header-menu .icons .dashicons-update{font-size:29px;margin-right:10px;top:-3px}.ep-header-menu .icons a{font-size:27px;vertical-align:middle;color:inherit;position:relative;top:-3px;margin-left:8px;cursor:pointer}.ep-header-menu .icons .dashicons-controls-pause,.ep-header-menu .icons .dashicons-controls-play,.ep-header-menu .icons .dashicons-no{top:1px;font-size:30px}.ep-header-menu .cancel-sync,.ep-header-menu .pause-sync,.ep-header-menu .resume-sync{display:none}.ep-header-menu .sync-status{display:none;color:#666;bottom:-1px;position:relative;margin-right:8px;vertical-align:middle;font-style:italic}.ep-header-menu .progress-bar{margin-bottom:-5px;height:5px;position:absolute;bottom:0;left:0;background-color:#d84440}.ep-features{overflow:auto}.error-overlay.cant-connect,.error-overlay.syncing{content:' ';display:block;position:fixed;top:46px;left:0;right:0;bottom:0;opacity:.6;background-color:#fff;z-index:1}@media (min-width:768px){.error-overlay,.error-overlay.cant-connect,.error-overlay.syncing{top:32px;left:160px}}.ep-feature .postbox{margin-bottom:0}.ep-feature .postbox .hndle{cursor:inherit}.ep-feature .postbox .hndle .settings-button{float:right;display:inline-block;font-size:13px;background-color:#efefef;border-radius:4px;padding:4px 7px;margin-top:-4px;cursor:pointer;color:inherit;position:relative;padding-left:23px}.ep-feature .settings-button:before{content:"\f140";font:400 19px/1 dashicons;display:inline-block;color:#72777c;padding:0 5px 0 0;vertical-align:middle;top:4px;position:absolute;left:1px}.ep-feature .settings-button:after{border-radius:50%;content:' ';display:inline-block;vertical-align:middle;width:8px;height:8px;margin-left:10px;margin-top:-2px}.feature-requirements-status-2.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid red}.feature-requirements-status-2.ep-feature .settings .requirements-status-notice{border-color:red}.feature-requirements-status-1.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #e3e600}.feature-requirements-status-1.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#e3e600}.feature-requirements-status-1.ep-feature .settings .requirements-status-notice{border-color:#e3e600}.feature-requirements-status-0.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #6aa000}.feature-requirements-status-0.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#6aa000}.feature-requirements-status-0.ep-feature .settings .requirements-status-notice{border-color:#6aa000}.ep-feature{position:relative;vertical-align:top;margin-bottom:20px}.ep-feature.saving .action-wrap:before{content:' ';vertical-align:middle;margin-right:1.4em;top:4px;border-radius:50%;width:8px;height:8px;display:inline-block;font-size:7px;position:relative;text-indent:-9999em;border-top:5px solid #ccc;border-right:5px solid #ccc;border-bottom:5px solid #ccc;border-left:5px solid #999;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}.ep-feature .description,.ep-feature .settings{margin-bottom:0;text-align:left}.ep-feature .settings{display:none;overflow:auto}.ep-feature .settings h3{margin-top:0;font-size:inherit;font-weight:700}.ep-feature.show-settings .settings{display:block}.ep-feature.show-settings .description{display:none}.ep-feature.show-settings .settings-button:before{content:"\f142"}.ep-feature .settings .requirements-status-notice{border-left:4px solid #6aa000;background-color:#efefef;padding:8px 12px;margin-bottom:10px}.ep-feature .settings .action-wrap{clear:both;text-align:right;padding-top:15px;vertical-align:middle}.ep-feature .settings .action-wrap a{cursor:pointer;display:inline-block}.ep-feature .settings .action-wrap .no-dash-sync{color:#aaa;line-height:27px;padding-right:8px;display:none}.ep-feature .settings .action-wrap a.disabled{cursor:default}.ep-feature .settings .action-wrap .cancel{margin-top:4px;margin-right:6px}.ep-feature.dash-sync-disabled .settings .action-wrap .no-dash-sync{display:inline}.ep-feature .settings .field{clear:both;overflow:initial;padding-top:15px}.ep-feature .settings .field:first-child{padding-top:0}.ep-feature .settings .field .field-name,.ep-feature .settings .field>label{display:block;float:left;width:25%;margin-right:1.5em}.ep-feature .settings .field .input-wrap{display:block;float:left}.ep-feature .settings .field .disabled{color:#c4c3c3}.ep-feature .settings .field .disabled input{cursor:default}.ep-feature .long{display:none}.ep-feature .long p:last-child{margin-bottom:0}.ep-feature.show-full .long{display:block}.ep-feature .collapse,.ep-feature .learn-more{cursor:pointer}.ep-feature.show-full .learn-more{display:none}.ep-feature .learn-more:after{content:"\f140";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.ep-feature .collapse:after{content:"\f142";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.intro h2{padding:9px 15px 4px 0}.wrap.intro{margin-top:30px;margin-bottom:30px;overflow:auto}.wrap.intro .error,.wrap.intro .is-dismissible,.wrap.intro .notice,.wrap.intro .updated{display:none!important}.features-screenshot{display:none}.setup-message{text-align:center;background-color:#e63e3b;margin:20px -20px 0 -20px;padding:2em 0;clear:both}.setup-message .setup-button{border-radius:5px;background-color:#d73c38;color:#f19ea4;display:inline-block;margin:0 .75em;text-decoration:none;padding:.75em 3em;box-shadow:1px 1px 3px 1px rgba(0,0,0,.25)}.setup-message .setup-button-primary{background-color:#fff;color:#d84440}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media (min-width:768px){.intro .left{float:left;width:30%}.features-screenshot{margin:0 auto;max-width:1000px;width:70%;display:block;height:auto;float:right}.ep-features .left{display:block;float:left;box-sizing:border-box;padding-right:10px;width:50%}.ep-features .right{display:block;float:right;box-sizing:border-box;padding-left:10px;width:50%}.ep-feature .feature-message{float:left;padding:0;vertical-align:middle;display:inline-block;padding-top:.5em}} \ No newline at end of file +.wrap .notice,.wrap>h2{z-index:2;position:relative}.wrap h2{color:#888;line-height:1.75;margin:.5em 0 .75em}#wpbody #update-nag,#wpbody .update-nag{margin-left:-20px;width:100%;margin-top:0;margin-bottom:20px}h2.ep-list-features{display:none}.ep-header-menu{background-color:#fff;position:relative;margin-left:-20px;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:5px;border-bottom:2px solid #ddd;z-index:2}.ep-header-menu:after{content:' ';clear:both;display:block}.ep-header-menu img{float:left}.ep-header-menu .icons{float:right;padding-right:3px;height:39px;line-height:39px;display:inline-block}.ep-header-menu .icons .dashicons-update{font-size:29px;margin-right:10px;top:-3px}.ep-header-menu .icons a{font-size:27px;vertical-align:middle;color:inherit;position:relative;top:-3px;margin-left:8px;cursor:pointer}.ep-header-menu .icons .dashicons-controls-pause,.ep-header-menu .icons .dashicons-controls-play,.ep-header-menu .icons .dashicons-no{top:1px;font-size:30px}.ep-header-menu .cancel-sync,.ep-header-menu .pause-sync,.ep-header-menu .resume-sync{display:none}.ep-header-menu .sync-status{display:none;color:#666;bottom:-1px;position:relative;margin-right:8px;vertical-align:middle;font-style:italic}.ep-header-menu .progress-bar{margin-bottom:-5px;height:5px;position:absolute;bottom:0;left:0;background-color:#d84440}.ep-features{overflow:auto}.error-overlay.cant-connect,.error-overlay.syncing{content:' ';display:block;position:fixed;top:46px;left:0;right:0;bottom:0;opacity:.6;background-color:#fff;z-index:1}@media (min-width:768px){.error-overlay,.error-overlay.cant-connect,.error-overlay.syncing{top:32px;left:160px}}.ep-feature .postbox{margin-bottom:0}.ep-feature .postbox .hndle{cursor:inherit}.ep-feature .postbox .hndle .settings-button{float:right;display:inline-block;font-size:13px;background-color:#efefef;border-radius:4px;padding:4px 7px;margin-top:-4px;cursor:pointer;color:inherit;position:relative;padding-left:23px}.ep-feature .settings-button:before{content:"\f140";font:400 19px/1 dashicons;display:inline-block;color:#72777c;padding:0 5px 0 0;vertical-align:middle;top:4px;position:absolute;left:1px}.ep-feature .settings-button:after{border-radius:50%;content:' ';display:inline-block;vertical-align:middle;width:8px;height:8px;margin-left:10px;margin-top:-2px}.feature-requirements-status-2.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid red}.feature-requirements-status-2.ep-feature .settings .requirements-status-notice{border-color:red}.feature-requirements-status-1.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #e3e600}.feature-requirements-status-1.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#e3e600}.feature-requirements-status-1.ep-feature .settings .requirements-status-notice{border-color:#e3e600}.feature-requirements-status-0.ep-feature .postbox .hndle .settings-button:after{background-color:transparent;border:1px solid #6aa000}.feature-requirements-status-0.ep-feature.feature-active .postbox .hndle .settings-button:after{background-color:#6aa000}.feature-requirements-status-0.ep-feature .settings .requirements-status-notice{border-color:#6aa000}.ep-feature{position:relative;vertical-align:top;margin-bottom:20px}.ep-feature.saving .action-wrap:before{content:' ';vertical-align:middle;margin-right:1.4em;top:4px;border-radius:50%;width:8px;height:8px;display:inline-block;font-size:7px;position:relative;text-indent:-9999em;border-top:5px solid #ccc;border-right:5px solid #ccc;border-bottom:5px solid #ccc;border-left:5px solid #999;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}.ep-feature .description,.ep-feature .settings{margin-bottom:0;text-align:left}.ep-feature .settings{display:none;overflow:auto}.ep-feature .settings h3{margin-top:0;font-size:inherit;font-weight:700}.ep-feature.show-settings .settings{display:block}.ep-feature.show-settings .description{display:none}.ep-feature.show-settings .settings-button:before{content:"\f142"}.ep-feature .settings .requirements-status-notice{border-left:4px solid #6aa000;background-color:#efefef;padding:8px 12px;margin-bottom:10px}.ep-feature .settings .action-wrap{clear:both;text-align:right;padding-top:15px;vertical-align:middle}.ep-feature .settings .action-wrap a{cursor:pointer;display:inline-block}.ep-feature .settings .action-wrap .no-dash-sync{color:#aaa;line-height:27px;padding-right:8px;display:none}.ep-feature .settings .action-wrap a.disabled{cursor:default}.ep-feature .settings .action-wrap .cancel{margin-top:4px;margin-right:6px}.ep-feature.dash-sync-disabled .settings .action-wrap .no-dash-sync{display:inline}.ep-feature .settings .field{clear:both;overflow:initial;padding-top:15px}.ep-feature .settings .field:first-child{padding-top:0}.ep-feature .settings .field label{margin:.25em 0 .5em;display:inline-block}.ep-feature .settings .field .field-name{display:block;float:left;width:25%;padding-right:1.5em;box-sizing:border-box}.ep-feature .settings .field .input-wrap{width:75%;display:block;float:right}.ep-feature .settings .field .field-description{font-style:italic;margin-top:4px;margin-bottom:0;color:#666}.ep-feature .settings .field .disabled{color:#c4c3c3}.ep-feature .settings .field .disabled input{cursor:default}.ep-feature .long{display:none}.ep-feature .long p:last-child{margin-bottom:0}.ep-feature.show-full .long{display:block}.ep-feature .collapse,.ep-feature .learn-more{cursor:pointer}.ep-feature.show-full .learn-more{display:none}.ep-feature .learn-more:after{content:"\f140";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.ep-feature .collapse:after{content:"\f142";font-family:dashicons;font-size:1.5em;vertical-align:middle;top:-.07em;position:relative}.intro h2{padding:9px 15px 4px 0}.wrap.intro{margin-top:30px;margin-bottom:30px;overflow:auto}.wrap.intro .error,.wrap.intro .is-dismissible,.wrap.intro .notice,.wrap.intro .updated{display:none!important}.features-screenshot{display:none}.setup-message{text-align:center;background-color:#e63e3b;margin:20px -20px 0 -20px;padding:2em 0;clear:both}.setup-message .setup-button{border-radius:5px;background-color:#d73c38;color:#f19ea4;display:inline-block;margin:0 .75em;text-decoration:none;padding:.75em 3em;box-shadow:1px 1px 3px 1px rgba(0,0,0,.25)}.setup-message .setup-button-primary{background-color:#fff;color:#d84440}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media (min-width:768px){.intro .left{float:left;width:30%}.features-screenshot{margin:0 auto;max-width:1000px;width:70%;display:block;height:auto;float:right}.ep-features .left{display:block;float:left;box-sizing:border-box;padding-right:10px;width:50%}.ep-features .right{display:block;float:right;box-sizing:border-box;padding-left:10px;width:50%}.ep-feature .feature-message{float:left;padding:0;vertical-align:middle;display:inline-block;padding-top:.5em}} \ No newline at end of file diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 41f52e372d..7ec1818dc3 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -341,17 +341,30 @@ h2.ep-list-features { padding-top: 0; } - > label, + label { + margin: 0.25em 0 0.5em; + display: inline-block; + } + .field-name { display: block; float: left; width: 25%; - margin-right: 1.5em; + padding-right: 1.5em; + box-sizing: border-box; } .input-wrap { + width: 75%; display: block; - float: left; + float: right; + } + + .field-description { + font-style: italic; + margin-top: 4px; + margin-bottom: 0; + color: #666; } .disabled { diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 1e9b696670..00c61bf660 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -53,6 +53,7 @@ function ep_autosugguest_settings( $feature ) {
                                      +

                                      From 2f403bc42bfe2e4fb6b27ffb331a794c5e15e810 Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Mon, 11 Sep 2017 19:10:07 -0300 Subject: [PATCH 72/96] add a new filter to select which fields will be queried --- features/autosuggest/assets/js/autosuggest.min.js | 2 +- features/autosuggest/assets/js/src/autosuggest.js | 7 ++++--- features/autosuggest/autosuggest.php | 12 ++++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 634be415d8..a97a1a95a4 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(t,s){"all"!==s&&void 0!==s&&""!==s||(s="all");var o={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:["post_title.suggest","term_suggest"]}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(o.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),o}function u(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+u+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                        ');l.each(function(t,s){var o=e('
                                        '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType;s.length>=2?u(i(s,a)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?c():r(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:r,esSearch:u,buildSearchQuery:i}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(t,s,o){"all"!==s&&void 0!==s&&""!==s||(s="all");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:o}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(a.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),a}function r(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function u(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                          ');l.each(function(t,s){var o=e('
                                          '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.searchFields;s.length>=2?r(i(s,a,n)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?c():u(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:u,esSearch:r,buildSearchQuery:i}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index d999ee0784..f5a7bc9239 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -84,7 +84,7 @@ * @param searchText * @returns object */ - function buildSearchQuery( searchText, postType ) { + function buildSearchQuery( searchText, postType, searchFields ) { if ( postType === 'all' || typeof( postType ) === 'undefined' || postType === '' ) { postType = 'all'; } @@ -100,7 +100,7 @@ query: { multi_match: { query: searchText, - fields: [ 'post_title.suggest', 'term_suggest' ] + fields: searchFields } } }; @@ -305,9 +305,10 @@ var query; var request; var postType = epas.postType; + var searchFields = epas.searchFields; if ( val.length >= 2 ) { - query = buildSearchQuery( val, postType ); + query = buildSearchQuery( val, postType, searchFields ); request = esSearch( query ); request.done( function( response ) { diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index d9924f5f0c..6e5d0f4f7e 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -163,10 +163,14 @@ function ep_autosuggest_enqueue_scripts() { * action: the action to take when selecting an item. Possible values are "search" and "navigate". */ wp_localize_script( 'elasticpress-autosuggest', 'epas', apply_filters( 'ep_autosuggest_options', array( - 'index' => ep_get_index_name( get_current_blog_id() ), - 'host' => esc_url( untrailingslashit( $settings['host'] ) ), - 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), - 'action' => 'navigate', + 'index' => ep_get_index_name( get_current_blog_id() ), + 'host' => esc_url( untrailingslashit( $settings['host'] ) ), + 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), + 'searchFields' => apply_filters( 'ep_term_suggest_search_fields', array( + 'post_title.suggest', + 'term_suggest', + ) ), + 'action' => 'navigate', ) ) ); } From 8e5fbbd613c91a335f481749e622f9232b40bbe0 Mon Sep 17 00:00:00 2001 From: Ricardo Moraleida Date: Wed, 13 Sep 2017 10:28:57 -0300 Subject: [PATCH 73/96] fix selecting elements with Enter --- features/autosuggest/assets/js/autosuggest.min.js | 2 +- features/autosuggest/assets/js/src/autosuggest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index a97a1a95a4..3482c002a4 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(t,s,o){"all"!==s&&void 0!==s&&""!==s||(s="all");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:o}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(a.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),a}function r(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function u(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.get(1)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                            ');l.each(function(t,s){var o=e('
                                            '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.searchFields;s.length>=2?r(i(s,a,n)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?c():u(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:u,esSearch:r,buildSearchQuery:i}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(t,s,o){"all"!==s&&void 0!==s&&""!==s||(s="all");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:o}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(a.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),a}function r(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function u(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.children("span").get(0)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                              ');l.each(function(t,s){var o=e('
                                              '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.searchFields;s.length>=2?r(i(s,a,n)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?c():u(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:u,esSearch:r,buildSearchQuery:i}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index f5a7bc9239..02be7e873b 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -204,7 +204,7 @@ break; case 13: // Enter if ( $results.hasClass( 'selected' ) ) { - selectItem( $localInput, $current.get(1) ); + selectItem( $localInput, $current.children('span').get(0) ); return false; } else { // No item selected From 439479f9c1e5440e8d13ddac50c63550c6d6599c Mon Sep 17 00:00:00 2001 From: jasonbahl Date: Wed, 13 Sep 2017 13:25:46 -0600 Subject: [PATCH 74/96] #931 - Late escaping per WordPress.com VIP review --- classes/class-ep-dashboard.php | 26 +++++++++---------- .../protected-content/protected-content.php | 2 +- includes/dashboard-page.php | 4 +-- includes/settings-page.php | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/classes/class-ep-dashboard.php b/classes/class-ep-dashboard.php index 3a4a5ce499..6002e96f2a 100644 --- a/classes/class-ep-dashboard.php +++ b/classes/class-ep-dashboard.php @@ -287,21 +287,21 @@ public function maybe_notice( $force = false ) { ?>
                                              -

                                              try your host again, or you may need to change your settings.', 'elasticpress' ), esc_url( add_query_arg( 'ep-retry', 1 ) ), esc_url( $url ) ); ?>

                                              -
                                              +

                                              try your host again, or you may need to change your settings.', 'elasticpress' ) ), esc_url( add_query_arg( 'ep-retry', 1 ) ), esc_url( $url ) ); ?>

                                              +
                                              -

                                              -
                                              +

                                              +
                                              -

                                              +

                                              -

                                              quick set up process to get the plugin working.', 'elasticpress' ), esc_url( $url ) ); ?>

                                              +

                                              quick set up process to get the plugin working.', 'elasticpress' ) ), esc_url( $url ) ); ?>

                                              -

                                              sync to get the plugin working.', 'elasticpress' ), esc_url( $url ) ); ?>

                                              -
                                              +

                                              sync to get the plugin working.', 'elasticpress' ) ), esc_url( $url ) ); ?>

                                              +
                                              -

                                              run a sync.', 'elasticpress' ), esc_url( $url ) ); ?>

                                              +

                                              run a sync.', 'elasticpress' ) ), esc_url( $url ) ); ?>

                                              -

                                              title ) ); ?>

                                              +

                                              title ) ); ?>

                                              -

                                              +

                                              -

                                              -
                                              +

                                              + -

                                              We recommend using a secured Elasticsearch setup, such as ElasticPress.io, to prevent potential exposure of content not intended for the public.', 'elasticpress' ); ?>

                                              +

                                              We recommend using a secured Elasticsearch setup, such as ElasticPress.io, to prevent potential exposure of content not intended for the public.', 'elasticpress' ) ); ?>

                                              - +
                                              - +
                                              diff --git a/includes/settings-page.php b/includes/settings-page.php index 16e9fd4601..2a54a5c0f8 100644 --- a/includes/settings-page.php +++ b/includes/settings-page.php @@ -39,7 +39,7 @@ - + From 2ca62c61890d9e08225edd5f6c5e1bbd67bf71bb Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Fri, 15 Sep 2017 10:33:26 -0400 Subject: [PATCH 75/96] Dont escape already escaped --- includes/dashboard-page.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/dashboard-page.php b/includes/dashboard-page.php index 5371f568ad..40138b3ec2 100644 --- a/includes/dashboard-page.php +++ b/includes/dashboard-page.php @@ -25,7 +25,7 @@
                                              registered_features; ?> -
                                              - +
                                              - +
                                              From dab4b9a0b040086511e9ead35e4ed9db307354a9 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Fri, 15 Sep 2017 12:26:15 -0400 Subject: [PATCH 76/96] Localization escaping --- features/autosuggest/autosuggest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index e40ba89079..d72c4fcdca 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -189,10 +189,10 @@ function ep_autosuggest_requirements_status( $status ) { $status->message = array(); - $status->message[] = esc_html__( 'This feature modifies the default user experience of users by showing a dropdown of suggestions as users type in search boxes.', 'elasticpress' ); + $status->message[] = esc_html__( 'This feature modifies the default user experience on the front-end by showing a dropdown of suggestions as users type in search boxes.', 'elasticpress' ); if ( ! preg_match( '#elasticpress\.io#i', $host ) ) { - $status->message[] = __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. An insecure or misconfigured autosuggest host poses a severe security risk to your website.", 'elasticpress' ); + $status->message[] = wp_kses_post( __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. An insecure or misconfigured autosuggest host poses a severe security threat to your website.", 'elasticpress' ) ); } return $status; From 9ce53e532c4a1b436be9d86b48c3fbe9ef49c5a4 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 18 Sep 2017 09:44:13 -0400 Subject: [PATCH 77/96] Bump ES max version --- elasticpress.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index a30a8ca270..804227edcf 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -28,12 +28,12 @@ * We compare the current ES version to this compatibility version number. Compatibility is true when: * * EP_ES_VERSION_MIN <= YOUR ES VERSION <= EP_ES_VERSION_MAX - * + * * We don't check minor releases so if your ES version if 5.1.1, we consider that 5.1 in our comparison. * * @since 2.2 */ -define( 'EP_ES_VERSION_MAX', '5.5' ); +define( 'EP_ES_VERSION_MAX', '5.6' ); define( 'EP_ES_VERSION_MIN', '1.7' ); require_once( 'classes/class-ep-config.php' ); @@ -139,7 +139,7 @@ function ep_handle_upgrades() { */ function ep_setup_misc() { load_plugin_textdomain( 'elasticpress', false, basename( dirname( __FILE__ ) ) . '/lang' ); // Load any available translations first. - + if ( is_user_logged_in() && ! defined( 'WP_EP_DEBUG' ) ) { require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); define( 'WP_EP_DEBUG', is_plugin_active( 'debug-bar-elasticpress/debug-bar-elasticpress.php' ) ); From 096c35305f212afe706566365f1ba0a3e4855147 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Mon, 25 Sep 2017 00:29:17 -0400 Subject: [PATCH 78/96] Dont check WP_Taxonomy to improve backwards compat --- classes/class-ep-api.php | 88 +++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 46 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index e00f0e702c..9a39194a57 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -28,7 +28,7 @@ public function __construct() { } /** * ES plugins - * + * * @var array * @since 2.2 */ @@ -36,7 +36,7 @@ public function __construct() { } /** * ES version number - * + * * @var string * @since 2.2 */ @@ -625,7 +625,7 @@ public function prepare_post( $post_id ) { /** * Prepare text for ES: Strip html, strip line breaks, etc. - * + * * @param string $content * @since 2.2 * @return string @@ -692,10 +692,6 @@ private function prepare_terms( $post ) { $allow_hierarchy = apply_filters( 'ep_sync_terms_allow_hierarchy', false ); foreach ( $selected_taxonomies as $taxonomy ) { - if( ! is_a( $taxonomy, 'WP_Taxonomy' ) ){ - continue; - } - $object_terms = get_the_terms( $post->ID, $taxonomy->name ); if ( ! $object_terms || is_wp_error( $object_terms ) ) { @@ -1080,7 +1076,7 @@ public function format_args( $args ) { if ( ! empty( $args['tax_query'] ) ) { $tax_filter = array(); $tax_must_not_filter = array(); - + // Main tax_query array for ES $es_tax_query = array(); @@ -1098,7 +1094,7 @@ public function format_args( $args ) { $terms_obj = array( 'terms.' . $single_tax_query['taxonomy'] . '.' . $field => $terms, ); - + /* * add support for "NOT IN" operator * @@ -1123,15 +1119,15 @@ public function format_args( $args ) { $es_tax_query[$relation] = $tax_filter; } - + if ( ! empty( $tax_must_not_filter ) ) { $es_tax_query['must_not'] = $tax_must_not_filter; } - + if( ! empty( $es_tax_query ) ) { $filter['bool']['must'][]['bool'] = $es_tax_query; } - + $use_filters = true; } @@ -1202,7 +1198,7 @@ public function format_args( $args ) { $use_filters = true; } - + /** * Add support for post_mime_type * @@ -1219,7 +1215,7 @@ public function format_args( $args ) { 'post_mime_type' => (array)$args['post_mime_type'], ), ); - + $use_filters = true; } elseif( is_string( $args['post_mime_type'] ) ) { $filter['bool']['must'][] = array( @@ -1227,7 +1223,7 @@ public function format_args( $args ) { 'post_mime_type' => $args['post_mime_type'] . ".*", ), ); - + $use_filters = true; } } @@ -1303,7 +1299,7 @@ public function format_args( $args ) { if ( ! empty( $args['meta_query'] ) && ! empty( $args['meta_query']['relation'] ) && 'or' === strtolower( $args['meta_query']['relation'] ) ) { $relation = 'should'; } - + // get meta query filter $meta_filter = $this->build_meta_query( $meta_queries ); @@ -1408,7 +1404,7 @@ public function format_args( $args ) { 'boost' => 1, ); } - + /** * Order by 'rand' support * @@ -1574,7 +1570,7 @@ public function format_args( $args ) { } return apply_filters( 'ep_formatted_args', $formatted_args, $args ); } - + /** * Build Elasticsearch filter query for WP meta_query * @@ -1586,9 +1582,9 @@ public function format_args( $args ) { */ public function build_meta_query( $meta_queries ){ $meta_filter = array(); - + if ( ! empty( $meta_queries ) ) { - + $meta_query_type_mapping = array( 'numeric' => 'long', 'binary' => 'raw', @@ -1600,9 +1596,9 @@ public function build_meta_query( $meta_queries ){ 'time' => 'time', 'unsigned' => 'long', ); - + foreach( $meta_queries as $single_meta_query ) { - + /** * There is a strange case where meta_query looks like this: * array( @@ -1621,26 +1617,26 @@ public function build_meta_query( $meta_queries ){ if ( is_array( $single_meta_query ) && empty( $single_meta_query['key'] ) ) { reset( $single_meta_query ); $first_key = key( $single_meta_query ); - + if ( is_array( $single_meta_query[$first_key] ) ) { $single_meta_query = $single_meta_query[$first_key]; } } - + if ( ! empty( $single_meta_query['key'] ) ) { - + $terms_obj = false; - + $compare = '='; if ( ! empty( $single_meta_query['compare'] ) ) { $compare = strtolower( $single_meta_query['compare'] ); } - + $type = null; if ( ! empty( $single_meta_query['type'] ) ) { $type = strtolower( $single_meta_query['type'] ); } - + // Comparisons need to look at different paths if ( in_array( $compare, array( 'exists', 'not exists' ) ) ) { $meta_key_path = 'meta.' . $single_meta_query['key']; @@ -1656,7 +1652,7 @@ public function build_meta_query( $meta_queries ){ } else { $meta_key_path = 'meta.' . $single_meta_query['key'] . '.raw'; } - + switch ( $compare ) { case 'not in': case '!=': @@ -1673,7 +1669,7 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; case 'exists': $terms_obj = array( @@ -1681,7 +1677,7 @@ public function build_meta_query( $meta_queries ){ 'field' => $meta_key_path, ), ); - + break; case 'not exists': $terms_obj = array( @@ -1695,7 +1691,7 @@ public function build_meta_query( $meta_queries ){ ), ), ); - + break; case '>=': if ( isset( $single_meta_query['value'] ) ) { @@ -1713,7 +1709,7 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; case 'between': if ( isset( $single_meta_query['value'] ) && is_array( $single_meta_query['value'] ) && 2 === count( $single_meta_query['value'] ) ) { @@ -1738,7 +1734,7 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; case '<=': if ( isset( $single_meta_query['value'] ) ) { @@ -1756,7 +1752,7 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; case '>': if ( isset( $single_meta_query['value'] ) ) { @@ -1774,7 +1770,7 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; case '<': if ( isset( $single_meta_query['value'] ) ) { @@ -1792,7 +1788,7 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; case 'like': if ( isset( $single_meta_query['value'] ) ) { @@ -1814,10 +1810,10 @@ public function build_meta_query( $meta_queries ){ ), ); } - + break; } - + // Add the meta query filter if ( false !== $terms_obj ) { $meta_filter[] = $terms_obj; @@ -1849,7 +1845,7 @@ public function build_meta_query( $meta_queries ){ if ( ! empty( $single_meta_query['relation'] ) && 'or' === strtolower( $single_meta_query['relation'] ) ) { $relation = 'should'; } - + $meta_filter[] = array( 'bool' => array( $relation => $this->build_meta_query( $single_meta_query ), @@ -1858,7 +1854,7 @@ public function build_meta_query( $meta_queries ){ } } } - + return $meta_filter; } @@ -2056,7 +2052,7 @@ protected function parse_orderby( $orderbys, $default_order, $args ) { return $sort; } - + /** * Get Order by args Array * @@ -2069,7 +2065,7 @@ protected function get_orderby_array( $orderbys ){ if ( ! is_array( $orderbys ) ) { $orderbys = explode( ' ', $orderbys ); } - + return $orderbys; } @@ -2247,7 +2243,7 @@ public function get_elasticsearch_info( $force = false ) { /** * Try a different endpoint in case the plugins url is restricted - * + * * @since 2.2.1 */ @@ -2355,7 +2351,7 @@ public function get_cluster_status() { /** * Get a pipeline - * + * * @param string $id * @since 2.3 * @return WP_Error|bool|array @@ -2390,7 +2386,7 @@ public function get_pipeline( $id ) { /** * Put a pipeline - * + * * @param string $id * @param array $args * @since 2.3 From bf7ed880c5a7adf7f8625b3150460f08c9a6e2e5 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Thu, 28 Sep 2017 10:08:41 +0200 Subject: [PATCH 79/96] Reorganized tests --- classes/class-ep-feature.php | 2 +- .../features/test-decaying-configuration.php | 143 ------------------ tests/features/test-search.php | 110 ++++++++++++-- 3 files changed, 98 insertions(+), 157 deletions(-) delete mode 100644 tests/features/test-decaying-configuration.php diff --git a/classes/class-ep-feature.php b/classes/class-ep-feature.php index 8ba09876d4..5aa936e85e 100644 --- a/classes/class-ep-feature.php +++ b/classes/class-ep-feature.php @@ -289,7 +289,7 @@ public function output_settings_box() { } do_action( 'ep_feature_box_settings_' . $this->slug, $this ); - + ?> diff --git a/tests/features/test-decaying-configuration.php b/tests/features/test-decaying-configuration.php deleted file mode 100644 index c9ae62e5d6..0000000000 --- a/tests/features/test-decaying-configuration.php +++ /dev/null @@ -1,143 +0,0 @@ -suppress_errors(); - - $admin_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); - - wp_set_current_user( $admin_id ); - - ep_delete_index(); - ep_put_mapping(); - - EP_WP_Query_Integration::factory()->setup(); - EP_Sync_Manager::factory()->setup(); - EP_Sync_Manager::factory()->sync_post_queue = array(); - - $this->setup_test_post_type(); - - /** - * Most of our search test are bundled into core tests for legacy reasons - */ - ep_activate_feature( 'search' ); - EP_Features::factory()->setup_features(); - - // Need to call this since it's hooked to init - ep_search_setup(); - } - - /** - * Clean up after each test. Reset our mocks - * - * @since 2.2 - */ - public function tearDown() { - parent::tearDown(); - - //make sure no one attached to this - remove_filter( 'ep_sync_terms_allow_hierarchy', array( $this, 'ep_allow_multiple_level_terms_sync' ), 100 ); - $this->fired_actions = array(); - } - - /** - * Test if decaying is enabled. - * - * @since 2.4 - */ - public function testDecayingEnabled() { - delete_site_option( 'ep_feature_requirement_statuses' ); - delete_site_option( 'ep_feature_settings' ); - - EP_Features::factory()->handle_feature_activation(); - EP_Features::factory()->setup_features(); - - ep_update_feature( 'search', array( - 'active' => true, - 'decaying_enabled' => true, - ) ); - - ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); - ep_refresh_index(); - - add_filter( 'ep_formatted_args', array( $this, 'catch_ep_formatted_args' ) ); - $query = new WP_Query( array( - 's' => 'test', - ) ); - $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); - $this->assertTrue( isset( - $this->fired_actions['ep_formatted_args']['query'], - $this->fired_actions['ep_formatted_args']['query']['function_score'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] - ) ); - $this->assertEquals( '14d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'] ); - $this->assertEquals( '7d', $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] ); - $this->assertEquals( 0.25, (float)$this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'] ); - } - - /** - * Test if decaying is disabled. - * - * @since 2.4 - */ - public function testDecayingDisabled() { - delete_site_option( 'ep_feature_requirement_statuses' ); - delete_site_option( 'ep_feature_settings' ); - - EP_Features::factory()->handle_feature_activation(); - EP_Features::factory()->setup_features(); - - ep_update_feature( 'search', array( - 'active' => true, - 'decaying_enabled' => false, - ) ); - - ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); - ep_refresh_index(); - - add_filter( 'ep_formatted_args', array( $this, 'catch_ep_formatted_args' ) ); - $query = new WP_Query( array( - 's' => 'test', - ) ); - $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); - $this->assertTrue( ! isset( - $this->fired_actions['ep_formatted_args']['query']['function_score'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], - $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] - ) ); - $this->assertTrue( isset( - $this->fired_actions['ep_formatted_args']['query']['bool'], - $this->fired_actions['ep_formatted_args']['query']['bool']['should'] - ) ); - } - - /** - * Catch ES query args. - * - * @param array $args ES query args. - */ - public function catch_ep_formatted_args( $args ) { - $this->fired_actions['ep_formatted_args'] = $args; - } -} diff --git a/tests/features/test-search.php b/tests/features/test-search.php index 0131eac7ea..7e25f05634 100644 --- a/tests/features/test-search.php +++ b/tests/features/test-search.php @@ -70,43 +70,127 @@ public function testSearchOn() { $this->assertTrue( ! empty( $this->fired_actions['ep_wp_query_search'] ) ); } - + /** * Test case for when index is deleted, request for Elasticsearch should fall back to WP Query - * + * * @group search */ public function testSearchIndexDeleted(){ global $wpdb; - + ep_activate_feature( 'search' ); EP_Features::factory()->setup_features(); // Need to call this since it's hooked to init ep_search_setup(); - + $post_ids = array(); - + ep_create_and_sync_post(); ep_create_and_sync_post(); ep_create_and_sync_post( array( 'post_content' => 'findme' ) ); - + ep_refresh_index(); - + add_action( 'ep_wp_query_search', array( $this, 'action_wp_query_search' ), 10, 0 ); - + $args = array( 's' => 'findme', ); - + $query = new WP_Query( $args ); - + $this->assertTrue( "SELECT * FROM {$wpdb->posts} WHERE 1=0" == $query->request ); - + ep_delete_index(); - + $query = new WP_Query( $args ); - + $this->assertTrue( "SELECT * FROM {$wpdb->posts} WHERE 1=0" != $query->request ); } + + /** + * Test if decaying is enabled. + * + * @since 2.4 + */ + public function testDecayingEnabled() { + delete_site_option( 'ep_feature_requirement_statuses' ); + delete_site_option( 'ep_feature_settings' ); + + EP_Features::factory()->handle_feature_activation(); + EP_Features::factory()->setup_features(); + + ep_update_feature( 'search', array( + 'active' => true, + 'decaying_enabled' => true, + ) ); + + ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); + ep_refresh_index(); + + add_filter( 'ep_formatted_args', array( $this, 'catch_ep_formatted_args' ) ); + $query = new WP_Query( array( + 's' => 'test', + ) ); + $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); + $this->assertTrue( isset( + $this->fired_actions['ep_formatted_args']['query'], + $this->fired_actions['ep_formatted_args']['query']['function_score'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] + ) ); + } + + /** + * Test if decaying is disabled. + * + * @since 2.4 + */ + public function testDecayingDisabled() { + delete_site_option( 'ep_feature_requirement_statuses' ); + delete_site_option( 'ep_feature_settings' ); + + EP_Features::factory()->handle_feature_activation(); + EP_Features::factory()->setup_features(); + + ep_update_feature( 'search', array( + 'active' => true, + 'decaying_enabled' => false, + ) ); + + ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); + ep_refresh_index(); + + add_filter( 'ep_formatted_args', array( $this, 'catch_ep_formatted_args' ) ); + $query = new WP_Query( array( + 's' => 'test', + ) ); + $this->assertTrue( isset( $this->fired_actions['ep_formatted_args'] ) ); + $this->assertTrue( ! isset( + $this->fired_actions['ep_formatted_args']['query']['function_score'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['scale'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['decay'], + $this->fired_actions['ep_formatted_args']['query']['function_score']['exp']['post_date_gmt']['offset'] + ) ); + $this->assertTrue( isset( + $this->fired_actions['ep_formatted_args']['query']['bool'], + $this->fired_actions['ep_formatted_args']['query']['bool']['should'] + ) ); + } + + /** + * Catch ES query args. + * + * @param array $args ES query args. + */ + public function catch_ep_formatted_args( $args ) { + $this->fired_actions['ep_formatted_args'] = $args; + } } From 68fc94394051ffbb8a1c7e99421fb580caf745dc Mon Sep 17 00:00:00 2001 From: Ivan Kristianto Date: Thu, 28 Sep 2017 18:25:11 +0700 Subject: [PATCH 80/96] backward compatibility to check if the taxonomy has the property we want --- classes/class-ep-api.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 9a39194a57..b4062e42b0 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -692,6 +692,11 @@ private function prepare_terms( $post ) { $allow_hierarchy = apply_filters( 'ep_sync_terms_allow_hierarchy', false ); foreach ( $selected_taxonomies as $taxonomy ) { + // We check if the $taxonomy object as name property. Backward compatibility since WP_Taxonomy introduced in WP 4.7 + if ( ! property_exists( $taxonomy, 'name' ) ) { + continue; + } + $object_terms = get_the_terms( $post->ID, $taxonomy->name ); if ( ! $object_terms || is_wp_error( $object_terms ) ) { From 063d750229321cdc46a62013e959a6bf4a9d2183 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Tue, 3 Oct 2017 12:00:22 -0400 Subject: [PATCH 81/96] Update since --- features/woocommerce/woocommerce.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index b3946b4e5b..f5393a917d 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -603,7 +603,7 @@ function ep_wc_search_order( $wp ){ * table. They combine the titles of the products and put them in a * meta field called "Items". * - * @since TBD + * @since 2.4 * * @param array $post_args * @param string|int $post_id @@ -653,7 +653,7 @@ function ep_wc_setup() { /** * Output feature box summary - * + * * @since 2.1 */ function ep_wc_feature_box_summary() { @@ -664,7 +664,7 @@ function ep_wc_feature_box_summary() { /** * Output feature box long - * + * * @since 2.1 */ function ep_wc_feature_box_long() { From ede3eec380987f0ed898e86f4e92cedde70d84f1 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 4 Oct 2017 10:00:15 -0400 Subject: [PATCH 82/96] Autosuggest language --- README.md | 32 ++++++++++++++++------------ features/autosuggest/autosuggest.php | 8 +++---- readme.txt | 2 ++ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9a7c466106..e78b98796d 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ Optionally index all of your content, including private and unpublished content, Indexes text inside of popular file types, and adds those files types to search results. +### Autosuggest + +Suggest relevant content as text is entered into the search field. + ## `WP_Query` and the ElasticPress Query Integration ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passed (see below) to the query object. If the search feature is activated (which it is by default), all queries with the `s` parameter will be integrated with as well. ElasticPress converts `WP_Query` arguments to Elasticsearch readable queries. Supported `WP_Query` parameters are listed and explained below. ElasticPress also adds some extra `WP_query` arguments for extra functionality. @@ -78,7 +82,7 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe 'posts_per_page' => 20, ) ); ``` - + Get all posts with a specific category slug ```php new WP_Query( array( @@ -157,7 +161,7 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe containing the following parameters ```after```, ```before```, ```inclusive```, ```compare```, ```column```, and ```relation```. ```column``` is used to query specific columns from the ```wp_posts``` table. This will return posts which are created after January 1st 2012 and January 3rd 2012 8AM GMT: - + ```php new WP_Query( array( 's' => 'search phrase', @@ -173,7 +177,7 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe ), ) ); ``` - + Currently only the ```AND``` value is supported for the ```relation``` parameter. ```inclusive``` is used on after/before options to determine whether exact value should be matched or not. If inclusive is used @@ -254,9 +258,9 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe ) ); ``` - ```meta_query``` accepts an array of arrays where each inner array *only* supports ```key``` (string), + ```meta_query``` accepts an array of arrays where each inner array *only* supports ```key``` (string), ```type``` (string), ```value``` (string|array|int), and ```compare``` (string) parameters. ```compare``` supports the following: - + * ```=``` - Posts will be returned that have a post meta key corresponding to ```key``` and a value that equals the value passed to ```value```. * ```!=``` - Posts will be returned that have a post meta key corresponding to ```key``` and a value that does NOT equal the value passed to ```value```. * ```>``` - Posts will be returned that have a post meta key corresponding to ```key``` and a value that is greater than the value passed to ```value```. @@ -288,9 +292,9 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe Possible values for ```relation``` are ```OR``` and ```AND```. If ```relation``` is set to ```AND```, all inner queries must be true for a post to be returned. If ```relation``` is set to ```OR```, only one of the inner meta queries must be true for the post to be returned. - ```type``` supports the following values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', - 'DECIMAL', 'SIGNED', 'TIME', and 'UNSIGNED'. By default WordPress casts meta values to these types - in MySQL so some of these don't make sense in the context of Elasticsearch. ElasticPress does no "runtime" + ```type``` supports the following values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', + 'DECIMAL', 'SIGNED', 'TIME', and 'UNSIGNED'. By default WordPress casts meta values to these types + in MySQL so some of these don't make sense in the context of Elasticsearch. ElasticPress does no "runtime" casting but instead compares the value to a different type compiled during indexing * `NUMERIC` - Compares query `value` to integer version of stored meta value. @@ -303,7 +307,7 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe * `DATETIME` - Compares query `value` to date/time version of stored meta value. Query `value` must be formatted like `2012-01-02 05:00:00` or `yyyy:mm:dd hh:mm:ss`. * `TIME` - Compares query `value` to time version of stored meta value. Query `value` must be formatted like `17:00:00` or `hh:mm:ss`. - If no type is specified, ElasticPress will just deduce the type from the comparator used. ```type``` + If no type is specified, ElasticPress will just deduce the type from the comparator used. ```type``` is very rarely needed to be used. * ```meta_key``` (*string*) @@ -341,11 +345,11 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe * ```author``` (*int*) Show posts associated with certain author ID. - + * ```author_name``` (*string*) Show posts associated with certain author. Use ```user_nicename``` (NOT name). - + * ```orderby``` (*string*) Order results by field name instead of relevance. Supports: ```title```, ```modified```, `meta_value`, `meta_value_num`, ```type```, ```name```, ```date```, and ```relevance```; anything else will be interpretted as a document path i.e. `meta.my_key.long` or `meta.my_key.raw`. You can sort by multiple fields as well i.e. `title meta.my_key.raw` @@ -353,11 +357,11 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe * ```order``` (*string*) Which direction to order results in. Accepts ```ASC``` and ```DESC```. Default is ```DESC```. - + * ```post_parent``` (*int*) Show posts that have the specified post parent. - + The following are special parameters that are only supported by ElasticPress. @@ -428,7 +432,7 @@ The following are special parameters that are only supported by ElasticPress. * ```aggs``` (*array*) Add aggregation results to your search result. For example: - + ```php new WP_Query( array( 's' => 'search phrase', diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index d72c4fcdca..2d341ca7d8 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -7,7 +7,7 @@ */ function ep_autosuggest_feature_box_summary() { ?> -

                                              +

                                              -

                                              +

                                              message = array(); - $status->message[] = esc_html__( 'This feature modifies the default user experience on the front-end by showing a dropdown of suggestions as users type in search boxes.', 'elasticpress' ); + $status->message[] = esc_html__( 'This feature modifies the site’s default user experience by presenting a list of suggestions below detected search fields as text is entered into the field.', 'elasticpress' ); if ( ! preg_match( '#elasticpress\.io#i', $host ) ) { - $status->message[] = wp_kses_post( __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. An insecure or misconfigured autosuggest host poses a severe security threat to your website.", 'elasticpress' ) ); + $status->message[] = wp_kses_post( __( "You aren't using ElasticPress.io so we can't be sure your host is properly secured. Autosuggest requires a publicly accessible endpoint, which can expose private content and allow data modification if improperly configured.", 'elasticpress' ) ); } return $status; diff --git a/readme.txt b/readme.txt index 305300d618..b44f756b65 100644 --- a/readme.txt +++ b/readme.txt @@ -26,6 +26,8 @@ __Protected Content__: Optionally index all of your content, including private a __Documents__: Indexes text inside of popular file types, and adds those files types to search results. +__Autosuggest__: Suggest relevant content as text is entered into the search field. + Please refer to [Github](https://github.com/10up/ElasticPress) for detailed usage instructions and documentation. == Installation == From ddcf61d07fdb6669753d8d4b9b26e820c9ea3ff8 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 4 Oct 2017 18:20:32 -0400 Subject: [PATCH 83/96] Use endpoint url instead of host --- .../autosuggest/assets/js/autosuggest.min.js | 2 +- .../autosuggest/assets/js/src/autosuggest.js | 6 +-- features/autosuggest/autosuggest.php | 44 ++++++++++++------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index 3482c002a4..b0fc52cef0 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(t,s,o){"all"!==s&&void 0!==s&&""!==s||(s="all");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:o}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(a.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),a}function r(t){var s=epas.host+"/"+epas.index+"/post/_search";return jQuery.support.cors=!0,e.ajax({url:s,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function u(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.children("span").get(0)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function c(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.host&&""!==epas.host&&epas.index&&""!==epas.index){var l=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                                ');l.each(function(t,s){var o=e('
                                                '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:l.outerHeight()-1,"background-color":l.css("background-color")}),e(l).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&c()})}),l.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.searchFields;s.length>=2?r(i(s,a,n)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?c():u(a,o)}else c()}):0===s.length&&c()}},200))}),window.epasAPI={hideAutosuggestBox:c,updateAutosuggestBox:u,esSearch:r,buildSearchQuery:i}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function n(e,n){if("navigate"===epas.action)return o(e,n.dataset.url);s(e,n.innerText),t(e)}function a(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function i(t,s,o){"all"!==s&&void 0!==s&&""!==s||(s="all");var n={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:o}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(n.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),n}function r(t){return jQuery.support.cors=!0,e.ajax({url:epas.endpointUrl,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function u(t,s){var o,a=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=a.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?a.show():a.hide(),o=0;o'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){n(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),a=o.filter(".selected");switch(e.keyCode){case 38:t=a.prev();break;case 40:o.hasClass("selected")?t=a.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(n(s,a.children("span").get(0)),!1):void 0}if(t.is("li")?(a.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function l(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.endpointUrl&&""!==epas.endpointUrl){var c=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                                  ');c.each(function(t,s){var o=e('
                                                  '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),d.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),d.css({top:c.outerHeight()-1,"background-color":c.css("background-color")}),e(c).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&l()})}),c.each(function(t,s){var o=e(s);o.on("keyup",a(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),n=epas.postType,a=epas.searchFields;s.length>=2?r(i(s,n,a)).done(function(t){if(t._shards.successful>0){var s={},n=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,a=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,n.push({text:o,url:a}))}),0===n.length?l():u(n,o)}else l()}):0===s.length&&l()}},200))}),window.epasAPI={hideAutosuggestBox:l,updateAutosuggestBox:u,esSearch:r,buildSearchQuery:i}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index 02be7e873b..aabaee7fed 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -9,7 +9,7 @@ 'use strict'; // No host/index set - if ( ! epas.host || '' === epas.host || ! epas.index || '' === epas.index ) { + if ( ! epas.endpointUrl || '' === epas.endpointUrl ) { return; } @@ -131,14 +131,12 @@ * @returns AJAX object request */ function esSearch( query ) { - // @todo support multiple different post type search boxes on the same page - var url = epas.host + '/' + epas.index + '/post/_search'; // Fixes <=IE9 jQuery AJAX bug that prevents ajax request from firing jQuery.support.cors = true; return $.ajax( { - url: url, + url: epas.endpointUrl, type: 'post', dataType: 'json', crossDomain: true, diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 2d341ca7d8..74b02250a6 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -40,6 +40,7 @@ function ep_autosuggest_setup() { * @since 2.4 */ function ep_autosugguest_settings( $feature ) { + $host = ep_get_host(); $settings = $feature->get_settings(); if ( ! $settings ) { @@ -47,17 +48,21 @@ function ep_autosugguest_settings( $feature ) { } $settings = wp_parse_args( $settings, $feature->default_settings ); + + if ( preg_match( '#elasticpress\.io#i', $host ) ) { + return; + } ?>
                                                  -
                                                  +
                                                  - -

                                                  + +

                                                  -get_settings(); + $host = ep_get_host(); - if ( ! $settings ) { - $settings = array(); - } + $endpoint_url = false; - $settings = wp_parse_args( $settings, $feature->default_settings ); + if ( preg_match( '#elasticpress\.io#i', $host ) ) { + $endpoint_url = $host . '/' . ep_get_index_name() . '/post/_search'; + } else { + $settings = $feature->get_settings(); - if ( empty( $settings['host'] ) ) { - return; + if ( ! $settings ) { + $settings = array(); + } + + $settings = wp_parse_args( $settings, $feature->default_settings ); + + if ( empty( $settings['endpoint_url'] ) ) { + return; + } + + $endpoint_url = $settings['endpoint_url']; } $js_url = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? EP_URL . 'features/autosuggest/assets/js/src/autosuggest.js' : EP_URL . 'features/autosuggest/assets/js/autosuggest.min.js'; @@ -159,13 +174,12 @@ function ep_autosuggest_enqueue_scripts() { /** * Output variables to use in Javascript * index: the Elasticsearch index name - * host: the Elasticsearch host + * endpointUrl: the Elasticsearch autosuggest endpoint url * postType: which post types to use for suggestions * action: the action to take when selecting an item. Possible values are "search" and "navigate". */ wp_localize_script( 'elasticpress-autosuggest', 'epas', apply_filters( 'ep_autosuggest_options', array( - 'index' => ep_get_index_name( get_current_blog_id() ), - 'host' => esc_url( untrailingslashit( $settings['host'] ) ), + 'endpointUrl' => esc_url( untrailingslashit( $endpoint_url ) ), 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), 'searchFields' => apply_filters( 'ep_term_suggest_search_fields', array( 'post_title.suggest', @@ -221,6 +235,6 @@ function ep_autosuggest_setup_settings() { 'requires_install_reindex' => true, 'requirements_status_cb' => 'ep_autosuggest_requirements_status', 'default_settings' => array( - 'host' => ep_get_host(), + 'endpoint_url' => '', ), ) ); From 8c76a263d72a60c81112be06e953b775f5b00c91 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 4 Oct 2017 18:21:12 -0400 Subject: [PATCH 84/96] Update pot --- lang/elasticpress.pot | 63 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot index 8f686303b8..64d683c26d 100644 --- a/lang/elasticpress.pot +++ b/lang/elasticpress.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: ElasticPress 2.4\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n" -"POT-Creation-Date: 2017-09-06 02:33:47+00:00\n" +"POT-Creation-Date: 2017-10-04 22:21:05+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -143,27 +143,27 @@ msgstr "" msgid "Unable to reach Elasticsearch Server! Check that service is running." msgstr "" -#: classes/class-ep-api.php:2165 +#: classes/class-ep-api.php:2183 msgid "" "Invalid response from ElasticPress server. Please contact your " "administrator." msgstr "" -#: classes/class-ep-api.php:2178 +#: classes/class-ep-api.php:2196 msgid "" "Site not indexed.

                                                  Please run: wp elasticpress index --setup " "--network-wide using WP-CLI. Or use the index button on the left of " "this screen.

                                                  " msgstr "" -#: classes/class-ep-api.php:2182 +#: classes/class-ep-api.php:2200 msgid "" "Site not indexed.

                                                  Please run: wp elasticpress index --setup " "using WP-CLI. Or use the index button on the left of this screen.

                                                  " msgstr "" -#: classes/class-ep-api.php:2317 classes/class-ep-api.php:2429 -#: classes/class-ep-api.php:2480 +#: classes/class-ep-api.php:2335 classes/class-ep-api.php:2447 +#: classes/class-ep-api.php:2498 msgid "Elasticsearch Host is not available." msgstr "" @@ -281,19 +281,19 @@ msgstr "" msgid "Status" msgstr "" -#: classes/class-ep-feature.php:280 +#: classes/class-ep-feature.php:280 features/search/search.php:283 msgid "Enabled" msgstr "" -#: classes/class-ep-feature.php:281 +#: classes/class-ep-feature.php:281 features/search/search.php:284 msgid "Disabled" msgstr "" -#: classes/class-ep-feature.php:297 +#: classes/class-ep-feature.php:298 msgid "Setting adjustments to this feature require a re-sync. Use WP-CLI." msgstr "" -#: classes/class-ep-feature.php:300 +#: classes/class-ep-feature.php:301 msgid "Save" msgstr "" @@ -316,34 +316,39 @@ msgid "The following values do not describe a valid date: month %1$s, day %2$s." msgstr "" #: features/autosuggest/autosuggest.php:10 -msgid "Suggest relevant content to users as they type search text." +msgid "Suggest relevant content as text is entered into the search field." msgstr "" #: features/autosuggest/autosuggest.php:21 msgid "" "Input fields of type \"search\" or with the CSS class \"search-field\" or " -"\"ep-autosuggest\" will be enhanced with autosuggest functionality. As " -"users type, a dropdown will be shown containing results relevant to their " -"current search. Clicking a suggestion will take a user directly to that " -"piece of content." +"\"ep-autosuggest\" will be enhanced with autosuggest functionality. As text " +"is entered into the search field, suggested content will appear below it, " +"based on top search results for the text. Suggestions link directly to the " +"content." msgstr "" -#: features/autosuggest/autosuggest.php:53 -msgid "Host" +#: features/autosuggest/autosuggest.php:58 +msgid "Endpoint URL" msgstr "" -#: features/autosuggest/autosuggest.php:187 +#: features/autosuggest/autosuggest.php:61 +msgid "This address will be exposed to the public." +msgstr "" + +#: features/autosuggest/autosuggest.php:206 msgid "" -"This feature modifies the default user experience of users by showing a " -"dropdown of suggestions as users type in search boxes." +"This feature modifies the site’s default user experience by presenting a " +"list of suggestions below detected search fields as text is entered into " +"the field." msgstr "" -#: features/autosuggest/autosuggest.php:190 +#: features/autosuggest/autosuggest.php:209 msgid "" "You aren't using ElasticPress.io so " -"we can't be sure your host is properly secured. An insecure or " -"misconfigured autosuggest host poses a severe security " -"risk to your website." +"we can't be sure your host is properly secured. Autosuggest requires a " +"publicly accessible endpoint, which can expose private content and allow " +"data modification if improperly configured." msgstr "" #: features/documents/documents.php:207 @@ -448,14 +453,18 @@ msgid "" "misspellings and verb tenses." msgstr "" -#: features/woocommerce/woocommerce.php:625 +#: features/search/search.php:281 +msgid "Weight results by date" +msgstr "" + +#: features/woocommerce/woocommerce.php:661 msgid "" "“I want a cotton, woman’s t-shirt, for under $15 that’s in stock.” Faceted " "product browsing strains servers and increases load times. Your buyers can " "find the perfect product quickly, and buy it quickly." msgstr "" -#: features/woocommerce/woocommerce.php:636 +#: features/woocommerce/woocommerce.php:672 msgid "" "Most caching and performance tools can’t keep up with the nearly infinite " "ways your visitors might filter or navigate your products. No matter how " @@ -465,7 +474,7 @@ msgid "" "end product management." msgstr "" -#: features/woocommerce/woocommerce.php:650 +#: features/woocommerce/woocommerce.php:686 msgid "WooCommerce not installed." msgstr "" From 814c3e6e004b53bb30024b45fb6e8faa57700f80 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 4 Oct 2017 18:45:38 -0400 Subject: [PATCH 85/96] Update readme --- readme.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/readme.txt b/readme.txt index b44f756b65..57c43240b6 100644 --- a/readme.txt +++ b/readme.txt @@ -46,6 +46,34 @@ Version 2.3.1-2.3.2 is a bug fix release. Here are a listed of issues that have * Fix broken upgrade sync notification. * Properly respect WC product visibility. Props [ivankristianto](https://github.com/ivankristianto). This requires a re-index if you are using the WooCommerce feature. += 2.4 = + +Version 2.4 introduces the Autosuggest feature. When enabled, input fields of type "search" or with the CSS class "search-field" or "ep-autosuggest" will be enhanced with autosuggest functionality. As text is entered into the search field, suggested content will appear below it, based on top search results for the text. Suggestions link directly to the content. + +We also added hooks and filters to ElasticPress that make query logging possible. The [Debug Bar ElasticPress](https://github.com/10up/debug-bar-elasticpress) plugin now adds a Query Log screen to the ElasticPress admin menu. The Query Log is an extremely powerful tool for diagnosing search and indexing issues. + +Here is a comphrensive list of changes: + +### Enhancements +* Autosuggest feature +* Hooks for query log functionality in [Debug Bar ElasticPress](https://github.com/10up/debug-bar-elasticpress) +* Support `WP_Query` `fields` parameter. Props [kallehauge](https://github.com/kallehauge). +* Add setting for enabling/disabling date weighting in search. Props [lukaspawlik](https://github.com/kallehauge). +* Remove extra post meta storage key from Elasticsearch +* Add shipping class as indexed WooCommerce taxonomy. Props [kallehauge](https://github.com/kallehauge). +* Allow WooCommerce orders to be searched by items. Props [kallehauge](https://github.com/kallehauge). +* Support Elasticsearch 5.6 +* Add filter to granularly control admin notices. Props [mattonomics](https://github.com/mattonomics). +* Support ES 5.5+ strict content type checking. Props [sc0ttclark](https://github.com/sc0ttclark) + +### Bug Fixes +* Fix `author_name` search field. Props [ivankristianto](https://github.com/ivankristianto). +* Fix unavailable taxonomy issue in WooCommerce. Props [ivankristianto](https://github.com/ivankristianto). +* Index all publicly queryable taxonomies. Props [allan23](https://github.com/allan23). +* Resolve case insensitive sorting issues. Props [allan23](https://github.com/allan23). +* Add escaping per VIP standards. Props [jasonbahl](https://github.com/jasonbahl). +* Fix WooCommerce post type warnings. + = 2.3 = Version 2.3 introduces the Documents feature which indexes text inside of popular file types, and adds those files types to search results. We've also officially added support for Elasticsearch 5.3. From 9057a0d57ad93dcae4d7c0b3b626fa8c43551f07 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Fri, 6 Oct 2017 19:53:30 +0200 Subject: [PATCH 86/96] Check if $product_item is an object --- features/woocommerce/woocommerce.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index f5393a917d..06ecdc76d8 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -620,7 +620,9 @@ function ep_wc_add_order_items_search( $post_args, $post_id ) { $order = wc_get_order( $post_id ); $item_meta = array(); foreach ( $order->get_items() as $delta => $product_item ) { - $item_meta['_items'][] = $product_item->get_name( 'edit' ); + if ( is_object( $product_item ) && method_exists( $product_item, 'get_name' ) ) { + $item_meta['_items'][] = $product_item->get_name( 'edit' ); + } } // Prepare order items. From 6e2bf6baae9a46da27bcd0adfcc77cf44b1d75aa Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Fri, 6 Oct 2017 20:08:42 +0200 Subject: [PATCH 87/96] Add sanity checks before accessing object properties --- features/woocommerce/woocommerce.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index f5393a917d..d10e615c3a 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -279,11 +279,15 @@ function ep_wc_translate_args( $query ) { // to add child terms to the tax query if ( is_taxonomy_hierarchical( $taxonomy ) ) { $term_object = get_term_by( 'slug', $term, $taxonomy ); - $children = get_term_children( $term_object->term_id, $taxonomy ); - if ( $children ) { - foreach ( $children as $child ) { - $child_object = get_term( $child, $taxonomy ); - $terms[] = $child_object->slug; + if ( $term_object && property_exists( $term_object, 'term_id' ) ) { + $children = get_term_children( $term_object->term_id, $taxonomy ); + if ( $children ) { + foreach ( $children as $child ) { + $child_object = get_term( $child, $taxonomy ); + if ( $child_object && ! is_wp_error( $child_object ) && property_exists( $child_object, 'slug' ) ) { + $terms[] = $child_object->slug; + } + } } } From a92492db51f983eaad19b01c9534f717442f3866 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Fri, 6 Oct 2017 22:14:17 +0200 Subject: [PATCH 88/96] Fix sync error when WooCommerece 2.x installed --- features/woocommerce/woocommerce.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index 06ecdc76d8..de6912f970 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -620,8 +620,11 @@ function ep_wc_add_order_items_search( $post_args, $post_id ) { $order = wc_get_order( $post_id ); $item_meta = array(); foreach ( $order->get_items() as $delta => $product_item ) { + // WooCommerce 3.x uses WC_Order_Item_Product instance while 2.x an array if ( is_object( $product_item ) && method_exists( $product_item, 'get_name' ) ) { $item_meta['_items'][] = $product_item->get_name( 'edit' ); + } elseif ( is_array( $product_item ) && isset( $product_item[ 'name' ] ) ) { + $item_meta['_items'][] = $product_item[ 'name' ]; } } From 41f9f18106245be18bb241abaadeda57a3c6dea6 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Tue, 10 Oct 2017 15:03:59 +0200 Subject: [PATCH 89/96] Make code compatible with multiple terms in taxonomy search --- features/woocommerce/woocommerce.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/features/woocommerce/woocommerce.php b/features/woocommerce/woocommerce.php index d10e615c3a..9f2a3cc6fd 100644 --- a/features/woocommerce/woocommerce.php +++ b/features/woocommerce/woocommerce.php @@ -274,25 +274,27 @@ function ep_wc_translate_args( $query ) { if ( ! empty( $term ) ) { $integrate = true; - $terms = array( $term ); + $terms = (array)$term; + $children_terms = array(); // to add child terms to the tax query if ( is_taxonomy_hierarchical( $taxonomy ) ) { - $term_object = get_term_by( 'slug', $term, $taxonomy ); - if ( $term_object && property_exists( $term_object, 'term_id' ) ) { - $children = get_term_children( $term_object->term_id, $taxonomy ); - if ( $children ) { - foreach ( $children as $child ) { - $child_object = get_term( $child, $taxonomy ); - if ( $child_object && ! is_wp_error( $child_object ) && property_exists( $child_object, 'slug' ) ) { - $terms[] = $child_object->slug; + foreach ( $terms as $term ) { + $term_object = get_term_by( 'slug', $term, $taxonomy ); + if ( $term_object && property_exists( $term_object, 'term_id' ) ) { + $children = get_term_children( $term_object->term_id, $taxonomy ); + if ( $children ) { + foreach ( $children as $child ) { + $child_object = get_term( $child, $taxonomy ); + if ( $child_object && ! is_wp_error( $child_object ) && property_exists( $child_object, 'slug' ) ) { + $children_terms[] = $child_object->slug; + } } } } } - } - + $terms = array_merge( $terms, $children_terms ); $tax_query[] = array( 'taxonomy' => $taxonomy, 'field' => 'slug', From a9d0c0fff7131e24ef0e7e02912ef63d4aac394f Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sun, 15 Oct 2017 22:53:22 -0400 Subject: [PATCH 90/96] Test fixing --- tests/features/test-search.php | 3 + tests/includes/class-ep-test-base.php | 19 ----- tests/test-single-site.php | 118 ++++++++++++++++++-------- 3 files changed, 85 insertions(+), 55 deletions(-) diff --git a/tests/features/test-search.php b/tests/features/test-search.php index 7e25f05634..d4ca98ae00 100644 --- a/tests/features/test-search.php +++ b/tests/features/test-search.php @@ -114,6 +114,7 @@ public function testSearchIndexDeleted(){ * Test if decaying is enabled. * * @since 2.4 + * @group search */ public function testDecayingEnabled() { delete_site_option( 'ep_feature_requirement_statuses' ); @@ -150,6 +151,7 @@ public function testDecayingEnabled() { * Test if decaying is disabled. * * @since 2.4 + * @group search */ public function testDecayingDisabled() { delete_site_option( 'ep_feature_requirement_statuses' ); @@ -188,6 +190,7 @@ public function testDecayingDisabled() { /** * Catch ES query args. * + * @group search * @param array $args ES query args. */ public function catch_ep_formatted_args( $args ) { diff --git a/tests/includes/class-ep-test-base.php b/tests/includes/class-ep-test-base.php index 975d0449d9..e845ea2185 100644 --- a/tests/includes/class-ep-test-base.php +++ b/tests/includes/class-ep-test-base.php @@ -2,25 +2,6 @@ class EP_Test_Base extends WP_UnitTestCase { - /** - * Prevents weird MySQLi error. - * - * @since 1.0 - */ - public function __construct() { - if ( property_exists( __CLASS__, 'ignore_files' ) ) { - self::$ignore_files = true; - } - $this->plugin_path = str_replace( '/tests/includes', '', dirname( __FILE__ ) ); - } - - /** - * Stores the root path for the plugin - * - * @var string - */ - protected $plugin_path = ''; - /** * Helps us keep track of actions that have fired * diff --git a/tests/test-single-site.php b/tests/test-single-site.php index d5b8199283..7da245b09d 100644 --- a/tests/test-single-site.php +++ b/tests/test-single-site.php @@ -1223,7 +1223,7 @@ public function testSearchMetaQuery() { $this->assertEquals( 2, $query->post_count ); $this->assertEquals( 2, $query->found_posts ); - + // Only check for fields which are provided in search_fields. $args = array( 's' => 'findme', @@ -1877,7 +1877,7 @@ public function testSearchDefaultOrderbyASCOrderQuery() { $this->assertEquals( 'ordertestt', $query->posts[0]->post_title ); $this->assertEquals( 'Ordertest', $query->posts[1]->post_title ); } - + /** * Test orderby random * @@ -1888,16 +1888,16 @@ public function testRandOrderby() { ep_create_and_sync_post( array( 'post_title' => 'ordertest 1' ) ); ep_create_and_sync_post( array( 'post_title' => 'ordertest 2' ) ); ep_create_and_sync_post( array( 'post_title' => 'ordertest 3' ) ); - + ep_refresh_index(); - + $args = array( 'ep_integrate' => true, 'orderby' => 'rand', ); - + $query = new WP_Query( $args ); - + /* Since it's test for random order, can't check against exact post ID or content but only found posts and post count. */ @@ -2302,7 +2302,7 @@ public function testMetaQueryAdvanced() { /** * Test a query that searches and filters by a meta value like the query - * + * * @since 1.5 * @group single-site */ @@ -2330,16 +2330,16 @@ public function testMetaQueryLike() { $this->assertEquals( 3, $query->post_count ); $this->assertEquals( 3, $query->found_posts ); } - + public function testMetaQueryMultipleArray() { ep_create_and_sync_post( array( 'post_content' => 'findme' ), array( 'meta_key_1' => '1' ) ); ep_create_and_sync_post( array( 'post_content' => 'findme' ), array( 'meta_key_1' => '1' ) ); ep_create_and_sync_post( array( 'post_content' => 'findme' ), array( 'meta_key_1' => '1', 'meta_key_2' => '4' ) ); ep_create_and_sync_post( array( 'post_content' => 'findme' ), array( 'meta_key_1' => '1', 'meta_key_2' => '0' ) ); ep_create_and_sync_post( array( 'post_content' => 'findme' ), array( 'meta_key_1' => '1', 'meta_key_3' => '4' ) ); - + ep_refresh_index(); - + $args = array( 's' => 'findme', 'meta_query' => array( @@ -2350,12 +2350,12 @@ public function testMetaQueryMultipleArray() { ) ), ); - + $query = new WP_Query( $args ); - + $this->assertEquals( 2, $query->post_count ); $this->assertEquals( 2, $query->found_posts ); - + $args = array( 's' => 'findme', 'meta_query' => array( @@ -2378,9 +2378,9 @@ public function testMetaQueryMultipleArray() { ), ), ); - + $query = new WP_Query( $args ); - + $this->assertEquals( 2, $query->post_count ); $this->assertEquals( 2, $query->found_posts ); } @@ -2562,7 +2562,7 @@ public function testCachedResultIsNotInCache() { /** * Test if $post object values exist after receiving odd values from the 'ep_search_post_return_args' filter. - * + * * @link https://github.com/10up/ElasticPress/issues/306 * @group single-site */ @@ -2600,7 +2600,7 @@ public function mock_indexable_post_status( $post_statuses ) { /** * Test invalid post date time - * + * * @group single-site */ public function testPostInvalidDateTime(){ @@ -3161,7 +3161,7 @@ public function testMetaValueTypeQueryDatetime() { $this->assertEquals( 1, $query->post_count ); } - + /* * Test a post_parent query * @group single-site @@ -3187,7 +3187,7 @@ public function testPostParentQuery() { /** * Test register feature - * + * * @since 2.1 * @group single-site */ @@ -3204,7 +3204,7 @@ public function testRegisterFeature() { /** * Test setup features - * + * * @since 2.1 * @group single-site */ @@ -3227,7 +3227,7 @@ public function testSetupFeatures() { $this->assertTrue( $feature->is_active() ); } - + /** * Test Tax Query NOT IN operator * @@ -3237,9 +3237,9 @@ public function testSetupFeatures() { public function testTaxQueryNotIn() { ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); ep_create_and_sync_post( array( 'post_content' => 'findme test 2', 'tags_input' => array( 'one' ) ) ); - + ep_refresh_index(); - + $args = array( 's' => 'findme', 'tax_query' => array( @@ -3250,12 +3250,12 @@ public function testTaxQueryNotIn() { ) ) ); - + $query = new WP_Query( $args ); - + $this->assertEquals( 2, $query->post_count ); $this->assertEquals( 2, $query->found_posts ); - + $args = array( 's' => 'findme', 'tax_query' => array( @@ -3272,13 +3272,13 @@ public function testTaxQueryNotIn() { ) ) ); - + $query = new WP_Query( $args ); - + $this->assertEquals( 1, $query->post_count ); $this->assertEquals( 1, $query->found_posts ); } - + /** * Test post_mime_type query * @@ -3288,20 +3288,20 @@ function testPostMimeTypeQuery() { ep_create_and_sync_post( array( 'post_type' => 'attachment', 'post_mime_type' => 'image/jpeg', 'post_status' => 'inherit' ) ); ep_create_and_sync_post( array( 'post_type' => 'attachment', 'post_mime_type' => 'image/jpeg', 'post_status' => 'inherit' ) ); ep_create_and_sync_post( array( 'post_type' => 'attachment', 'post_mime_type' => 'application/pdf', 'post_status' => 'inherit' ) ); - + ep_refresh_index(); - + $args = array( 'ep_integrate' => true, 'post_mime_type' => 'image', 'post_type' => 'attachment', 'post_status' => 'inherit' ); - + $query = new WP_Query( $args ); - + $this->assertEquals( 2, $query->post_count ); - + $args = array( 'ep_integrate' => true, 'post_mime_type' => array( @@ -3311,12 +3311,58 @@ function testPostMimeTypeQuery() { 'post_type' => 'attachment', 'post_status' => 'inherit' ); - + $query = new WP_Query( $args ); - + $this->assertEquals( 3, $query->found_posts ); } + /** + * Test Tax Query IN operator + * + * @since 2.4 + * @group single-site + */ + public function testTaxQueryOperatorIn() { + ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); + ep_create_and_sync_post( array( 'post_content' => 'findme test 2', 'tags_input' => array( 'one' ) ) ); + + ep_refresh_index(); + + $args = array( + 's' => 'findme', + 'tax_query' => array( + array( + 'taxonomy' => 'post_tag', + 'terms' => array( 'one', 'two' ), + 'field' => 'slug', + ) + ) + ); + + $query = new WP_Query( $args ); + + $this->assertEquals( 2, $query->post_count ); + $this->assertEquals( 2, $query->found_posts ); + + $args = array( + 's' => 'findme', + 'tax_query' => array( + array( + 'taxonomy' => 'post_tag', + 'terms' => array( 'one', 'two' ), + 'field' => 'slug', + 'operator' => 'in', + ) + ) + ); + + $query = new WP_Query( $args ); + + $this->assertEquals( 2, $query->post_count ); + $this->assertEquals( 2, $query->found_posts ); + } + /** * If a taxonomy is not public but is publicly queryable, it should return a result. * From 6bd8e112c2f8de8126a5a6d20721ecb1e7112f55 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sun, 15 Oct 2017 23:21:16 -0400 Subject: [PATCH 91/96] Support inner tax query array and operator --- classes/class-ep-api.php | 41 ++++++++++++++++++++++++++++++++------ tests/test-single-site.php | 31 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/classes/class-ep-api.php b/classes/class-ep-api.php index 796e8e42fe..b4b0b3e879 100644 --- a/classes/class-ep-api.php +++ b/classes/class-ep-api.php @@ -1100,15 +1100,44 @@ public function format_args( $args ) { 'terms.' . $single_tax_query['taxonomy'] . '.' . $field => $terms, ); - /* - * add support for "NOT IN" operator - * - * @since 2.1 - */ - if ( ! empty( $single_tax_query['operator'] ) && 'NOT IN' === $single_tax_query['operator'] ) { + $operator = ( ! empty( $single_tax_query['operator'] ) ) ? strtolower( $single_tax_query['operator'] ) : 'in'; + + if ( 'not in' === $operator ) { + /** + * add support for "NOT IN" operator + * + * @since 2.1 + */ + // If "NOT IN" than it should filter as must_not $tax_must_not_filter[]['terms'] = $terms_obj; + } elseif ( 'and' === $operator ) { + /** + * add support for "and" operator + * + * @since 2.4 + */ + + $and_nest = array( + 'bool' => array( + 'must' => array() + ), + ); + + foreach ( $terms as $term ) { + $and_nest['bool']['must'][] = array( + 'terms' => array( + 'terms.' . $single_tax_query['taxonomy'] . '.' . $field => (array) $term, + ) + ); + } + + $tax_filter[] = $and_nest; } else { + /** + * Default to IN operator + */ + // Add the tax query filter $tax_filter[]['terms'] = $terms_obj; } diff --git a/tests/test-single-site.php b/tests/test-single-site.php index 7da245b09d..e34c4a18d7 100644 --- a/tests/test-single-site.php +++ b/tests/test-single-site.php @@ -3363,6 +3363,37 @@ public function testTaxQueryOperatorIn() { $this->assertEquals( 2, $query->found_posts ); } + /** + * Test Tax Query and operator + * + * @since 2.4 + * @group single-site + */ + public function testTaxQueryOperatorAnd() { + $this->assertEquals( 1, 1 ); + ep_create_and_sync_post( array( 'post_content' => 'findme test 1', 'tags_input' => array( 'one', 'two' ) ) ); + ep_create_and_sync_post( array( 'post_content' => 'findme test 2', 'tags_input' => array( 'one' ) ) ); + + ep_refresh_index(); + + $args = array( + 's' => 'findme', + 'tax_query' => array( + array( + 'taxonomy' => 'post_tag', + 'terms' => array( 'one', 'two' ), + 'field' => 'slug', + 'operator' => 'and', + ) + ) + ); + + $query = new WP_Query( $args ); + + $this->assertEquals( 1, $query->post_count ); + $this->assertEquals( 1, $query->found_posts ); + } + /** * If a taxonomy is not public but is publicly queryable, it should return a result. * From 98c76d57ba4adcd369e39726f91087220d7dfd17 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Sun, 15 Oct 2017 23:26:56 -0400 Subject: [PATCH 92/96] Documentation --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e78b98796d..d51012045a 100644 --- a/README.md +++ b/README.md @@ -126,8 +126,10 @@ ElasticPress integrates with `WP_Query` if the `ep_integrate` parameter is passe ) ); ``` - ```tax_query``` accepts an array of arrays where each inner array *only* supports ```taxonomy``` (string), ```field``` (string), and - ```terms``` (string|array) parameters. ```field``` must be set to `slug`, `name`, or `term_id`. The default value for `field` is `term_id`. ```terms``` must be a string or an array of term slug(s), name(s), or id(s). + ```tax_query``` accepts an array of arrays where each inner array *only* supports ```taxonomy``` (string), ```field``` (string), `operator` (string), and + ```terms``` (string|array) parameters. ```field``` must be set to `slug`, `name`, or `term_id`. The default value for `field` is `term_id`. ```terms``` must be a string or an array of term slug(s), name(s), or id(s). `operator` defaults to `in` and also supports `not in` and `and`. + + The outer array supports the `relation` parameter. Acceptable values are `and` and `or`. The default is `and`. * The following shorthand parameters can be used for querying posts by specific dates: From d2c4dd47a014fe4d42867c3125f481cfd7e131d5 Mon Sep 17 00:00:00 2001 From: Lukas Pawlik Date: Mon, 16 Oct 2017 18:45:33 +0200 Subject: [PATCH 93/96] Use PHP 5.2 compatible array syntax --- features/documents/documents.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/features/documents/documents.php b/features/documents/documents.php index 5a59da3676..9d881524e8 100644 --- a/features/documents/documents.php +++ b/features/documents/documents.php @@ -18,7 +18,7 @@ function ep_documents_setup() { /** * Add attachments mapping - * + * * @param array $mapping * @since 2.3 * @return array @@ -36,7 +36,7 @@ function ep_documents_attachments_mapping( $mapping ) { * add the attachment post type to post_type and inherit to post_status. If post_status is not set, * we assume publish/inherit is wanted. post_type should always be set. We also add allowed mime types. * If mime types are already set, append. - * + * * @param WP_Query $query * @since 2.3 */ @@ -103,7 +103,7 @@ function ep_documents_index_post_request_path( $path, $post ) { $path = trailingslashit( $index ) . 'post/' . $post['ID'] . '?pipeline=' . apply_filters( 'ep_documents_pipeline_id', ep_get_index_name() . '-attachment' ); } } - + return $path; } @@ -127,19 +127,19 @@ function ep_documents_post_sync_args( $post_args, $post_id ) { } $allowed_ingest_mime_types = ep_documents_get_allowed_ingest_mime_types(); - + if ( 'attachment' == get_post_type( $post_id ) && in_array( get_post_mime_type( $post_id ), $allowed_ingest_mime_types ) ) { $file_name = get_attached_file( $post_id ); $exist = $wp_filesystem->exists( $file_name, false, 'f' ); if ( $exist ) { $file_content = $wp_filesystem->get_contents( $file_name ); - + $post_args['attachments'][] = array( 'data' => base64_encode( $file_content ), ); } } - + return $post_args; } @@ -154,9 +154,9 @@ function ep_filter_ep_search_fields( $search_fields ) { if ( ! is_array( $search_fields ) ) { return $search_fields; } - + $search_fields[] = 'attachments.attachment.content'; - + return $search_fields; } @@ -171,7 +171,7 @@ function ep_documents_indexable_post_status( $statuses ) { if ( ! array_search( 'inherit', $statuses ) ) { $statuses[] = 'inherit'; } - + return $statuses; } @@ -199,8 +199,8 @@ function ep_documents_requirements_status( $status ) { $plugins = ep_get_elasticsearch_plugins(); $status->code = 1; - $status->message = []; - + $status->message = array(); + // Ingest attachment plugin is required for this feature if ( empty( $plugins ) || empty( $plugins['ingest-attachment'] ) ) { $status->code = 2; @@ -208,7 +208,7 @@ function ep_documents_requirements_status( $status ) { } else { $status->message[] = __( "This feature modifies the default user experience for your visitors by adding popular document file types to search results. All supported documents uploaded to your media library will appear in search results.", 'elasticpress' ); } - + return $status; } @@ -225,7 +225,7 @@ function ep_documents_feature_box_summary() { /** * Output feature box long - * + * * @since 2.3 */ function ep_documents_feature_box_long() { @@ -258,7 +258,7 @@ function ep_documents_create_pipeline() { ), ), ); - + ep_create_pipeline( apply_filters( 'ep_documents_pipeline_id', ep_get_index_name() . '-attachment' ), $args ); } From 0a73371474bc934ea41b9c2174f4273ac5b574a4 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 1 Nov 2017 16:07:28 -0400 Subject: [PATCH 94/96] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d51012045a..627dafc522 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ElasticPress integrates with the [WP_Query](http://codex.wordpress.org/Class_Ref ## Requirements -* [Elasticsearch](https://www.elastic.co) 1.7 - 5.2 (2.0+ highly recommended) +* [Elasticsearch](https://www.elastic.co) 1.7+ (5.0+ highly recommended) * [WordPress](http://wordpress.org) 3.7.1+ ## Installation From 0cf39dd61f02cb48a57089be5c6fde837b8aa723 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 1 Nov 2017 16:37:06 -0400 Subject: [PATCH 95/96] Only autosuggest published posts and pages --- .../autosuggest/assets/js/autosuggest.min.js | 2 +- .../autosuggest/assets/js/src/autosuggest.js | 41 +++++++++++++------ features/autosuggest/autosuggest.php | 3 +- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/features/autosuggest/assets/js/autosuggest.min.js b/features/autosuggest/assets/js/autosuggest.min.js index b0fc52cef0..21803be6d5 100644 --- a/features/autosuggest/assets/js/autosuggest.min.js +++ b/features/autosuggest/assets/js/autosuggest.min.js @@ -1 +1 @@ -!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function n(e,n){if("navigate"===epas.action)return o(e,n.dataset.url);s(e,n.innerText),t(e)}function a(e,t){var s=null;return function(){var o=this,n=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,n)},t)}}function i(t,s,o){"all"!==s&&void 0!==s&&""!==s||(s="all");var n={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:t,fields:o}}};return"string"==typeof s&&"all"!==s&&(s=s.split(",")),e.isArray(s)&&(n.post_filter={bool:{must:[{terms:{"post_type.raw":s}}]}}),n}function r(t){return jQuery.support.cors=!0,e.ajax({url:epas.endpointUrl,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function u(t,s){var o,a=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=a.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?a.show():a.hide(),o=0;o'+r+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){n(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),a=o.filter(".selected");switch(e.keyCode){case 38:t=a.prev();break;case 40:o.hasClass("selected")?t=a.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(n(s,a.children("span").get(0)),!1):void 0}if(t.is("li")?(a.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function l(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.endpointUrl&&""!==epas.endpointUrl){var c=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                                    ');c.each(function(t,s){var o=e('
                                                    '),n=e(s);n.attr("autocomplete","off"),o.insertAfter(n);var a=n.siblings("label");n.closest("form").find(".ep-autosuggest-container").append(a).append(n),d.clone().insertAfter(n),n.trigger("elasticpress.input.moved")}),d.css({top:c.outerHeight()-1,"background-color":c.css("background-color")}),e(c).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&l()})}),c.each(function(t,s){var o=e(s);o.on("keyup",a(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),n=epas.postType,a=epas.searchFields;s.length>=2?r(i(s,n,a)).done(function(t){if(t._shards.successful>0){var s={},n=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,a=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,n.push({text:o,url:a}))}),0===n.length?l():u(n,o)}else l()}):0===s.length&&l()}},200))}),window.epasAPI={hideAutosuggestBox:l,updateAutosuggestBox:u,esSearch:r,buildSearchQuery:i}}}(jQuery); \ No newline at end of file +!function(e){"use strict";function t(e){e.closest("form").submit()}function s(e,t){e.val(t)}function o(e,t){return window.location.href=t}function a(e,a){if("navigate"===epas.action)return o(e,a.dataset.url);s(e,a.innerText),t(e)}function n(e,t){var s=null;return function(){var o=this,a=arguments;window.clearTimeout(s),s=window.setTimeout(function(){e.apply(o,a)},t)}}function i(e,t,s,o){"all"!==t&&void 0!==t&&""!==t||(t="all"),""===s&&(t="publish");var a={sort:[{_score:{order:"desc"}}],query:{multi_match:{query:e,fields:o}}};return"string"==typeof t&&"all"!==t&&(t=t.split(",")),"string"==typeof s&&(s=s.split(",")),a.post_filter={bool:{must:[{terms:{post_status:s}}]}},"all"!==t&&a.post_filter.bool.must.push({terms:{"post_type.raw":t}}),a}function u(t){return jQuery.support.cors=!0,e.ajax({url:epas.endpointUrl,type:"post",dataType:"json",crossDomain:!0,data:JSON.stringify(t)})}function r(t,s){var o,n=s.closest(".ep-autosuggest-container").find(".ep-autosuggest"),i=n.find(".autosuggest-list");for(i.empty(),e(".autosuggest-item").off(),t.length>0?n.show():n.hide(),o=0;o'+u+"").appendTo(i)}e(".autosuggest-item").on("click",function(e){a(s,e.srcElement)}),s.off("keydown"),s.on("keydown",function(e){if(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode);else{var t,o=s.closest(".ep-autosuggest-container").find(".autosuggest-list li"),n=o.filter(".selected");switch(e.keyCode){case 38:t=n.prev();break;case 40:o.hasClass("selected")?t=n.next():(o.first().addClass("selected"),t=o.first());break;case 13:return o.hasClass("selected")?(a(s,n.children("span").get(0)),!1):void 0}if(t.is("li")?(n.removeClass("selected"),t.addClass("selected")):o.removeClass("selected"),38===e.keyCode)return!1}})}function l(){e(".autosuggest-list").empty(),e(".ep-autosuggest").hide()}if(epas.endpointUrl&&""!==epas.endpointUrl){var c=e('.ep-autosuggest, input[type="search"], .search-field'),d=e('
                                                      ');c.each(function(t,s){var o=e('
                                                      '),a=e(s);a.attr("autocomplete","off"),o.insertAfter(a);var n=a.siblings("label");a.closest("form").find(".ep-autosuggest-container").append(n).append(a),d.clone().insertAfter(a),a.trigger("elasticpress.input.moved")}),d.css({top:c.outerHeight()-1,"background-color":c.css("background-color")}),e(c).each(function(t,s){e(s).on("keyup keydown keypress",function(e){38!==e.keyCode&&40!==e.keyCode||e.preventDefault(),27===e.keyCode&&l()})}),c.each(function(t,s){var o=e(s);o.on("keyup",n(function(t){if(38!==t.keyCode&&40!==t.keyCode&&13!==t.keyCode&&27!==t.keyCode){var s=o.val(),a=epas.postType,n=epas.postStatus,c=epas.searchFields;s.length>=2?u(i(s,a,n,c)).done(function(t){if(t._shards.successful>0){var s={},a=[];e.each(t.hits.hits,function(e,t){var o=t._source.post_title,n=t._source.permalink,i=t._source.post_id;s[i]||(s[i]=!0,a.push({text:o,url:n}))}),0===a.length?l():r(a,o)}else l()}):0===s.length&&l()}},200))}),window.epasAPI={hideAutosuggestBox:l,updateAutosuggestBox:r,esSearch:u,buildSearchQuery:i}}}(jQuery); \ No newline at end of file diff --git a/features/autosuggest/assets/js/src/autosuggest.js b/features/autosuggest/assets/js/src/autosuggest.js index aabaee7fed..1e8d683843 100644 --- a/features/autosuggest/assets/js/src/autosuggest.js +++ b/features/autosuggest/assets/js/src/autosuggest.js @@ -84,11 +84,15 @@ * @param searchText * @returns object */ - function buildSearchQuery( searchText, postType, searchFields ) { + function buildSearchQuery( searchText, postType, postStatus, searchFields ) { if ( postType === 'all' || typeof( postType ) === 'undefined' || postType === '' ) { postType = 'all'; } + if ( postStatus === '' ) { + postType = 'publish'; + } + var query = { sort: [ { @@ -105,20 +109,30 @@ } }; - // If we're specifying post types, do it in an array + // If we're specifying post types/statuses, do it in an array if ( typeof postType === 'string' && postType !== 'all' ) { - postType = postType.split(','); + postType = postType.split( ',' ); + } + + if ( typeof postStatus === 'string' ) { + postStatus = postStatus.split( ',' ); } // Then add it as a filter to the end of the query - if ( $.isArray( postType ) ) { - query.post_filter = { - bool: { - must: [{ - terms: { 'post_type.raw': postType } - }] - } - }; + query.post_filter = { + bool: { + must: [ + { + terms: { post_status: postStatus } + } + ] + } + }; + + if ( 'all' !== postType ) { + query.post_filter.bool.must.push( { + terms: { 'post_type.raw': postType } + } ); } return query; @@ -168,7 +182,7 @@ } for ( i = 0; i < options.length; ++i ) { - var text = options[i].text.toLowerCase(); + var text = options[i].text; var url = options[i].url; itemString = '
                                                    • ' + text + '
                                                    • '; $( itemString ).appendTo( $localSuggestList ); @@ -303,10 +317,11 @@ var query; var request; var postType = epas.postType; + var postStatus = epas.postStatus; var searchFields = epas.searchFields; if ( val.length >= 2 ) { - query = buildSearchQuery( val, postType, searchFields ); + query = buildSearchQuery( val, postType, postStatus, searchFields ); request = esSearch( query ); request.done( function( response ) { diff --git a/features/autosuggest/autosuggest.php b/features/autosuggest/autosuggest.php index 74b02250a6..7f18fc75f0 100644 --- a/features/autosuggest/autosuggest.php +++ b/features/autosuggest/autosuggest.php @@ -180,7 +180,8 @@ function ep_autosuggest_enqueue_scripts() { */ wp_localize_script( 'elasticpress-autosuggest', 'epas', apply_filters( 'ep_autosuggest_options', array( 'endpointUrl' => esc_url( untrailingslashit( $endpoint_url ) ), - 'postType' => apply_filters( 'ep_term_suggest_post_type', 'all' ), + 'postType' => apply_filters( 'ep_term_suggest_post_type', array( 'post', 'page' ) ), + 'postStatus' => apply_filters( 'ep_term_suggest_post_status', 'publish' ), 'searchFields' => apply_filters( 'ep_term_suggest_search_fields', array( 'post_title.suggest', 'term_suggest', From cdfca16d78df1a6fb488d9a41a8bc9af9b65e527 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Wed, 1 Nov 2017 16:37:28 -0400 Subject: [PATCH 96/96] Compile pot --- lang/elasticpress.pot | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lang/elasticpress.pot b/lang/elasticpress.pot index 64d683c26d..1cf7efdc02 100644 --- a/lang/elasticpress.pot +++ b/lang/elasticpress.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: ElasticPress 2.4\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elasticpress\n" -"POT-Creation-Date: 2017-10-04 22:21:05+00:00\n" +"POT-Creation-Date: 2017-11-01 20:37:24+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -143,27 +143,27 @@ msgstr "" msgid "Unable to reach Elasticsearch Server! Check that service is running." msgstr "" -#: classes/class-ep-api.php:2183 +#: classes/class-ep-api.php:2212 msgid "" "Invalid response from ElasticPress server. Please contact your " "administrator." msgstr "" -#: classes/class-ep-api.php:2196 +#: classes/class-ep-api.php:2225 msgid "" "Site not indexed.

                                                      Please run: wp elasticpress index --setup " "--network-wide using WP-CLI. Or use the index button on the left of " "this screen.

                                                      " msgstr "" -#: classes/class-ep-api.php:2200 +#: classes/class-ep-api.php:2229 msgid "" "Site not indexed.

                                                      Please run: wp elasticpress index --setup " "using WP-CLI. Or use the index button on the left of this screen.

                                                      " msgstr "" -#: classes/class-ep-api.php:2335 classes/class-ep-api.php:2447 -#: classes/class-ep-api.php:2498 +#: classes/class-ep-api.php:2364 classes/class-ep-api.php:2476 +#: classes/class-ep-api.php:2527 msgid "Elasticsearch Host is not available." msgstr "" @@ -336,14 +336,14 @@ msgstr "" msgid "This address will be exposed to the public." msgstr "" -#: features/autosuggest/autosuggest.php:206 +#: features/autosuggest/autosuggest.php:207 msgid "" "This feature modifies the site’s default user experience by presenting a " "list of suggestions below detected search fields as text is entered into " "the field." msgstr "" -#: features/autosuggest/autosuggest.php:209 +#: features/autosuggest/autosuggest.php:210 msgid "" "You aren't using ElasticPress.io so " "we can't be sure your host is properly secured. Autosuggest requires a " @@ -457,14 +457,14 @@ msgstr "" msgid "Weight results by date" msgstr "" -#: features/woocommerce/woocommerce.php:661 +#: features/woocommerce/woocommerce.php:672 msgid "" "“I want a cotton, woman’s t-shirt, for under $15 that’s in stock.” Faceted " "product browsing strains servers and increases load times. Your buyers can " "find the perfect product quickly, and buy it quickly." msgstr "" -#: features/woocommerce/woocommerce.php:672 +#: features/woocommerce/woocommerce.php:683 msgid "" "Most caching and performance tools can’t keep up with the nearly infinite " "ways your visitors might filter or navigate your products. No matter how " @@ -474,7 +474,7 @@ msgid "" "end product management." msgstr "" -#: features/woocommerce/woocommerce.php:686 +#: features/woocommerce/woocommerce.php:697 msgid "WooCommerce not installed." msgstr ""