Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 10
CRAP
0.00% covered (danger)
0.00%
0 / 1
Search
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 10
156
0.00% covered (danger)
0.00%
0 / 1
 name
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 add_search_post_meta_whitelist
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 add_search_options_whitelist
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 is_indexable
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
12
 get_postmeta_spec
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 get_all_postmeta_keys
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 get_all_option_keys
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 get_all_unindexed_postmeta_keys
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 get_all_taxonomies
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Configuration lists for Jetpack Search Fields
4 *
5 * Post Meta: list of post meta keys that are available in the index
6 *   and how they are configured.
7 *
8 * Custom Taxonomy: list of custom taxonomies that are indexed.
9 *
10 * The reason we need an allowed list is that Elasticsearch runs into scaling problems
11 * with more than 200k-ish total fields. The barrier to adding new fields is low,
12 * just open a PR.
13 *
14 * Although the comments indicate specific plugins, you don't need to be running
15 * that plugin for the indexing to work. The metakey just has to match.
16 *
17 * If you need a new meta key or taxonomy also consider using:
18 *   jetpack-search-meta0 - jetpack-search-meta9
19 *   jetpack-search-tag0 - jetpack-search-tag9
20 *
21 * @package automattic/jetpack-sync
22 */
23
24namespace Automattic\Jetpack\Sync\Modules;
25
26if ( ! defined( 'ABSPATH' ) ) {
27    exit( 0 );
28}
29
30/**
31 * Class to handle sync for Jetpack Search.
32 */
33class Search extends Module {
34
35    /**
36     * Sync module name.
37     *
38     * @access public
39     *
40     * @return string
41     */
42    public function name() {
43        return 'search';
44    }
45
46    /**
47     * Constructor.
48     */
49    public function __construct() {
50        // Post meta whitelists.
51        add_filter( 'jetpack_sync_post_meta_whitelist', array( $this, 'add_search_post_meta_whitelist' ), 10 );
52        // Add options
53        add_filter( 'jetpack_sync_options_whitelist', array( $this, 'add_search_options_whitelist' ), 10 );
54    }
55
56    /**
57     * Post meta search specification.
58     *
59     * We sync and index all meta keys in this list. Additionally there are a few
60     * options.
61     *
62     * 'metakey' => [ 'searchable_in_all_content' => true ],
63     *    Field will be included in the all_content fields
64     *
65     * 'metakey' => [ 'available' => false, 'alternatives' => [ 'metakey_processed' ] ],
66     *   Field not in meta.* but has data in an alternative field(s) name that
67     *   should work similarly. For instance, woocommerce total_sales does not go into
68     *   the index, but the percentage of sales does.
69     *
70     * @static
71     * @access private
72     * @var array
73     */
74    private static $postmeta_to_sync = array(
75        // jetpack.
76        'jetpack-search-meta0'                   => array( 'searchable_in_all_content' => true ),
77        'jetpack-search-meta1'                   => array( 'searchable_in_all_content' => true ),
78        'jetpack-search-meta2'                   => array( 'searchable_in_all_content' => true ),
79        'jetpack-search-meta3'                   => array( 'searchable_in_all_content' => true ),
80        'jetpack-search-meta4'                   => array( 'searchable_in_all_content' => true ),
81        'jetpack-search-meta5'                   => array( 'searchable_in_all_content' => true ),
82        'jetpack-search-meta6'                   => array( 'searchable_in_all_content' => true ),
83        'jetpack-search-meta7'                   => array( 'searchable_in_all_content' => true ),
84        'jetpack-search-meta8'                   => array( 'searchable_in_all_content' => true ),
85        'jetpack-search-meta9'                   => array( 'searchable_in_all_content' => true ),
86
87        // woocommerce.
88        'exclude_product_categories'             => array(),
89        'exclude_product_ids'                    => array(),
90        'free_shipping'                          => array(),
91        'id_field'                               => array(),
92        'individual_use'                         => array(),
93        'limit_usage_to_x_items'                 => array(),
94        'maximum_amount'                         => array(),
95        'minimum_amount'                         => array(),
96        'post_id'                                => array(),
97        'product_categories'                     => array( 'searchable_in_all_content' => true ),
98        'product_ids'                            => array(),
99        'total_sales'                            => array(
100            'available'    => false,
101            'alternatives' => array(
102                'wc.percent_of_sales',
103            ),
104        ),
105        'usage_limit'                            => array(),
106        'usage_limit_per_user'                   => array(),
107        '_crosssell_ids'                         => array(),
108        '_downloadable'                          => array(),
109        '_featured'                              => array(),
110        '_height'                                => array(),
111        '_length'                                => array(),
112        '_price'                                 => array(
113            'alternatives' => array(
114                'wc.price',
115                'wc.min_price',
116                'wc.max_price',
117            ),
118        ),
119        '_prices_include_tax'                    => array(),
120        '_product_attributes'                    => array(),
121        '_product_version'                       => array(),
122        '_regular_price'                         => array(
123            'alternatives' => array(
124                'wc.regular_price',
125            ),
126        ),
127        '_sale_price'                            => array(
128            'alternatives' => array(
129                'wc.sale_price',
130            ),
131        ),
132        '_sale_price_dates_from'                 => array(),
133        '_sale_price_dates_to'                   => array(),
134        '_sku'                                   => array( 'searchable_in_all_content' => true ),
135        '_stock_status'                          => array(),
136        '_wc_average_rating'                     => array(
137            'alternatives' => array(
138                'wc.ave_rating_score',
139            ),
140        ),
141        '_wc_rating_count'                       => array(
142            'alternatives' => array(
143                'wc.rating', // wc.rating.count_1, wc.rating.count_2, ...
144            ),
145        ),
146        '_wc_review_count'                       => array(),
147        '_weight'                                => array(),
148        '_width'                                 => array(),
149
150        // co-authors plus.
151        'cap-description'                        => array( 'searchable_in_all_content' => true ),
152        'cap-user_login'                         => array( 'searchable_in_all_content' => true ),
153        'cap-user_email'                         => array(),
154        'cap-last_name'                          => array( 'searchable_in_all_content' => true ),
155        'cap-first_name'                         => array( 'searchable_in_all_content' => true ),
156        'cap-display_name'                       => array( 'searchable_in_all_content' => true ),
157        'cap-website'                            => array(),
158        'cap-jabber'                             => array(),
159        'cap-aim'                                => array(),
160        'cap-twitter'                            => array(),
161        'cap-facebook'                           => array(),
162        'cap-google_plus'                        => array(),
163        'cap-job_title'                          => array( 'searchable_in_all_content' => true ),
164
165        // bbpress.
166        'bbpl_like'                              => array(),
167        'bbpress_discussion_comments_copied'     => array(),
168        'bbpress_discussion_tags_copied'         => array(),
169        'bbpress_discussion_topic_id'            => array(),
170        'bbpress_discussion_use_defaults'        => array(),
171        'bbpress_page_header_bg'                 => array(),
172        'bbpress_title_bg'                       => array(),
173        'use_bbpress_discussion_topic'           => array(),
174
175        // wpml.
176        'tm_meta_wpml'                           => array(),
177        'wpml_language'                          => array(),
178        'wpml_media_lang'                        => array(),
179        'wpml_media_processed'                   => array(),
180
181        // blogger import.
182        'blogger_author'                         => array( 'searchable_in_all_content' => true ),
183        'blogger_blog'                           => array( 'searchable_in_all_content' => true ),
184        'blogger_permalink'                      => array( 'searchable_in_all_content' => true ),
185
186        // geo.
187        'geo_address'                            => array( 'searchable_in_all_content' => true ),
188        'geo_latitude'                           => array(),
189        'geo_longitude'                          => array(),
190        'geo_public'                             => array(),
191        'geolocated'                             => array(),
192        'geolocation_city'                       => array( 'searchable_in_all_content' => true ),
193        'geolocation_country_long'               => array( 'searchable_in_all_content' => true ),
194        'geolocation_country_short'              => array( 'searchable_in_all_content' => true ),
195        'geolocation_formatted_address'          => array( 'searchable_in_all_content' => true ),
196        'geolocation_lat'                        => array(),
197        'geolocation_long'                       => array(),
198        'geolocation_postcode'                   => array( 'searchable_in_all_content' => true ),
199        'geolocation_state_long'                 => array( 'searchable_in_all_content' => true ),
200        'geolocation_state_short'                => array( 'searchable_in_all_content' => true ),
201
202        // wp-ultimate-recipe.
203        'recipe_alternate_image'                 => array(),
204        'recipe_cook_time'                       => array(),
205        'recipe_cook_time_text'                  => array(),
206        'recipe_description'                     => array( 'searchable_in_all_content' => true ),
207        'recipe_ingredients'                     => array( 'searchable_in_all_content' => true ),
208        'recipe_instructions'                    => array( 'searchable_in_all_content' => true ),
209        'recipe_notes'                           => array( 'searchable_in_all_content' => true ),
210        'recipe_nutritional'                     => array( 'searchable_in_all_content' => true ),
211        'recipe_passive_time'                    => array(),
212        'recipe_passive_time_text'               => array(),
213        'recipe_prep_time'                       => array(),
214        'recipe_prep_time_text'                  => array(),
215        'recipe_rating'                          => array(),
216        'recipe_servings'                        => array(),
217        'recipe_servings_normalized'             => array(),
218        'recipe_servings_type'                   => array(),
219        'recipe_terms'                           => array( 'searchable_in_all_content' => true ),
220        'recipe_terms_with_parents'              => array(),
221        'recipe_title'                           => array( 'searchable_in_all_content' => true ),
222        'recipe_user_ratings'                    => array(),
223        'recipe_user_ratings_rating'             => array(),
224
225        // generic fields.
226        // from advanced-custom-fields and metabox.io .
227        'Link'                                   => array(),
228        'Location'                               => array(),
229        'Title'                                  => array( 'searchable_in_all_content' => true ),
230        'ad_code'                                => array(),
231        'address'                                => array(),
232        'admin_mail'                             => array(),
233        'admin_only'                             => array(),
234        'advertisers'                            => array( 'searchable_in_all_content' => true ),
235        'age'                                    => array(),
236        'aliases'                                => array(),
237        'alternate_title'                        => array(),
238        'ama_content'                            => array(),
239        'amazon'                                 => array(),
240        'answer'                                 => array( 'searchable_in_all_content' => true ),
241        'area'                                   => array(),
242        'attention'                              => array(),
243        'attr'                                   => array(),
244        'author'                                 => array( 'searchable_in_all_content' => true ),
245        'author_name'                            => array( 'searchable_in_all_content' => true ),
246        'blog'                                   => array(),
247        'blog_id'                                => array(),
248        'call_to_action'                         => array(),
249        'campaign_preview'                       => array(),
250        'canonical_url'                          => array(),
251        'catch_text'                             => array(),
252        'category'                               => array( 'searchable_in_all_content' => true ),
253        'classificacao'                          => array(),
254        'classification'                         => array(),
255        'code'                                   => array(),
256        'codigo'                                 => array(),
257        'company'                                => array( 'searchable_in_all_content' => true ),
258        'company_website'                        => array(),
259        'config'                                 => array(),
260        'construction'                           => array(),
261        'container_ids'                          => array(),
262        'content'                                => array( 'searchable_in_all_content' => true ),
263        'content_body-full_content'              => array( 'searchable_in_all_content' => true ),
264        'copyright'                              => array(),
265        'custom_page_title'                      => array( 'searchable_in_all_content' => true ),
266        'custom_permalink'                       => array(),
267        'customize'                              => array(),
268        'data'                                   => array(),
269        'date'                                   => array(),
270        'day'                                    => array(),
271        'descripcion'                            => array( 'searchable_in_all_content' => true ),
272        'description'                            => array( 'searchable_in_all_content' => true ),
273        'display_settings'                       => array(),
274        'display_type'                           => array(),
275        'duration'                               => array(),
276        'embed'                                  => array(),
277        'entity_ids'                             => array(),
278        'entity_types'                           => array(),
279        'event_subtitle'                         => array( 'searchable_in_all_content' => true ),
280        'excluded_container_ids'                 => array(),
281        'exclusions'                             => array(),
282        'experience'                             => array(),
283        'external_url'                           => array(),
284        'featured'                               => array(),
285        'featured_image'                         => array(),
286        'featured_post'                          => array(),
287        'featured_story'                         => array(),
288        'fee'                                    => array(),
289        'filter'                                 => array(),
290        'follow'                                 => array(),
291        'footer_text'                            => array(),
292        'from_header'                            => array(),
293        'fullscreen_view'                        => array(),
294        'gallery'                                => array(),
295        'genre'                                  => array( 'searchable_in_all_content' => true ),
296        'guest_bio'                              => array(),
297        'guest_name'                             => array(),
298        'guests'                                 => array( 'searchable_in_all_content' => true ),
299        'has_variations'                         => array(),
300        'hashtag'                                => array(),
301        'header_image'                           => array(),
302        'hidden_from_ui'                         => array(),
303        'hide_on_screen'                         => array(),
304        'homepage_order'                         => array(),
305        'hours'                                  => array(),
306        'i18n'                                   => array(),
307        'id'                                     => array(),
308        'image'                                  => array(),
309        'image_size'                             => array(),
310        'image_source'                           => array(),
311        'index'                                  => array(),
312        'intro_text'                             => array( 'searchable_in_all_content' => true ),
313        'job_mention'                            => array( 'searchable_in_all_content' => true ),
314        'keywords'                               => array( 'searchable_in_all_content' => true ),
315        'latest_news'                            => array(),
316        'layout'                                 => array(),
317        'link'                                   => array(),
318        'link_dump'                              => array( 'searchable_in_all_content' => true ),
319        'link_url'                               => array(),
320        'location'                               => array(),
321        'logo'                                   => array(),
322        'main_title'                             => array( 'searchable_in_all_content' => true ),
323        'maximum_entity_count'                   => array(),
324        'media'                                  => array(),
325        'mentions'                               => array(),
326        'messages'                               => array(),
327        'meta_description'                       => array( 'searchable_in_all_content' => true ),
328        'meta_id'                                => array(),
329        'meta_index'                             => array(),
330        'meta_key'                               => array(),
331        'meta_value'                             => array(),
332        'modal-dialog-id'                        => array(),
333        'name'                                   => array( 'searchable_in_all_content' => true ),
334        'nombre'                                 => array( 'searchable_in_all_content' => true ),
335        'notes'                                  => array( 'searchable_in_all_content' => true ),
336        'options'                                => array(),
337        'order_by'                               => array(),
338        'order_direction'                        => array(),
339        'original_cats'                          => array(),
340        'original_headers'                       => array(),
341        'original_link'                          => array(),
342        'original_message'                       => array(),
343        'original_subject'                       => array(),
344        'original_title'                         => array(),
345        'original_to'                            => array(),
346        'other_setting'                          => array(),
347        'page_canonical'                         => array(),
348        'page_layout'                            => array(),
349        'page_sidebar'                           => array(),
350        'page_tags'                              => array(),
351        'panels_data'                            => array(),
352        'parking'                                => array(),
353        'pdf_upload'                             => array(),
354        'people_mentioned'                       => array(),
355        'photo'                                  => array(),
356        'play_time'                              => array(),
357        'position'                               => array(),
358        'post-rating'                            => array(),
359        'post_background'                        => array(),
360        'post_color'                             => array(),
361        'post_sidebar'                           => array(),
362        'post_subtitle'                          => array( 'searchable_in_all_content' => true ),
363        'price'                                  => array(),
364        'publication'                            => array(),
365        'rating'                                 => array(),
366        'ratings_average'                        => array(),
367        'ratings_score'                          => array(),
368        'ratings_users'                          => array(),
369        'relation'                               => array(),
370        'reply_to_header'                        => array(),
371        'required'                               => array(),
372        'returns'                                => array(),
373        'review_post'                            => array(),
374        'rule'                                   => array(),
375        'section'                                => array( 'searchable_in_all_content' => true ),
376        'selected_links'                         => array(),
377        'session_transcript'                     => array(),
378        'settings'                               => array(),
379        'sex'                                    => array(),
380        'shares_count'                           => array(),
381        'show_description'                       => array( 'searchable_in_all_content' => true ),
382        'show_page_title'                        => array(),
383        'show_notes'                             => array(),
384        'show_notes_preview'                     => array(),
385        'side'                                   => array(),
386        'sidebar'                                => array(),
387        'site'                                   => array(),
388        'situation'                              => array(),
389        'slide_template'                         => array(),
390        'slug'                                   => array(),
391        'sortorder'                              => array(),
392        'source'                                 => array(),
393        'start_date'                             => array(),
394        'status'                                 => array(),
395        'styles'                                 => array(),
396        'subtitle'                               => array( 'searchable_in_all_content' => true ),
397        'subtitulo'                              => array(),
398        'success'                                => array(),
399        'summary'                                => array( 'searchable_in_all_content' => true ),
400        'synopsis'                               => array( 'searchable_in_all_content' => true ),
401        'tel'                                    => array(),
402        'tema'                                   => array(),
403        'testimonial'                            => array(),
404        'testimonial_author'                     => array(),
405        'text_already_subscribed'                => array(),
406        'text_error'                             => array(),
407        'text_invalid_email'                     => array(),
408        'text_not_subscribed'                    => array(),
409        'text_required_field_missing'            => array(),
410        'text_subscribed'                        => array(),
411        'text_unsubscribed'                      => array(),
412        'thumbnail'                              => array(),
413        'time'                                   => array(),
414        'time_jump_list'                         => array( 'searchable_in_all_content' => true ),
415        'title'                                  => array( 'searchable_in_all_content' => true ),
416        'title_view'                             => array(),
417        'titre'                                  => array( 'searchable_in_all_content' => true ),
418        'titulo'                                 => array( 'searchable_in_all_content' => true ),
419        'to_header'                              => array(),
420        'toc'                                    => array(),
421        'transcript'                             => array( 'searchable_in_all_content' => true ),
422        'transport_uri'                          => array(),
423        'type'                                   => array(),
424        'url'                                    => array(),
425        'validation'                             => array(),
426        'value'                                  => array(),
427        'values'                                 => array(),
428        'variation'                              => array(),
429        'video'                                  => array(),
430        'video_type'                             => array(),
431        'video_url'                              => array(),
432        'videopress_guid'                        => array(),
433        'website'                                => array(),
434        'weight'                                 => array(),
435        'year'                                   => array(),
436
437        // wp.com martketplace search - @see https://wp.me/pdh6GB-Ax#comment-2104
438        '_app_icon'                              => array(),
439        '_featured_product_video'                => array(),
440        'wpcom_marketplace_org_slug'             => array(),
441        '_wc_general_product_dependency_theme'   => array(),
442        '_wc_general_product_dependency_plugin'  => array(),
443        'wpcom_marketplace_product_extra_fields' => array(),
444        'wccom_product_search_keywords'          => array( 'searchable_in_all_content' => true ),
445        '_wccom_product_faqs'                    => array( 'searchable_in_all_content' => true ),
446        'wccom_product_features'                 => array( 'searchable_in_all_content' => true ),
447        'wccom_product_compatibility'            => array( 'searchable_in_all_content' => true ),
448
449    ); // end indexed post meta.
450
451    /**
452     * Postmeta being considered for indexing
453     *   but currently not in the index
454     *   this list is really only for documentation.
455     *
456     * @static
457     * @access private
458     * @var array
459     */
460    private static $unindexed_postmeta = array(
461
462        // Core.
463        '_wp_attached_file'                          => array(),
464        '_wp_attachment_context'                     => array(),
465        '_wp_attachment_image_alt'                   => array(),
466        '_wp_attachment_is_custom_header'            => array(),
467        '_wp_attachment_metadata'                    => array(),
468        '_wp_desired_post_slug'                      => array(),
469        '_wp_old_date'                               => array(),
470        '_wp_old_slug'                               => array(),
471        '_wp_page_template'                          => array(),
472
473        // WooCommerce products.
474        // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-product-data-store-cpt.php#L21 .
475        '_backorders'                                => array(),
476        '_default_attributes'                        => array(),
477        '_download_expiry'                           => array(),
478        '_download_limit'                            => array(),
479        '_download_permissions_granted'              => array(),
480        '_downloadable_files'                        => array(),
481        '_file_paths'                                => array(),
482        '_manage_stock'                              => array(),
483        '_product_image_gallery'                     => array(),
484        '_purchase_note'                             => array(),
485        '_recorded_sales'                            => array(),
486        '_sold_individually'                         => array(),
487        '_stock'                                     => array(),
488        '_tax_class'                                 => array(),
489        '_tax_status'                                => array(),
490        '_thumbnail_id'                              => array(),
491        '_upsell_ids'                                => array(),
492        '_variation_description'                     => array(),
493        '_virtual'                                   => array(),
494        '_visibility'                                => array(),
495        'coupon_amount'                              => array(),
496        'default_source'                             => array(),
497        'discount_type'                              => array(),
498        'exclude_sale_items'                         => array(),
499        'expiry_date'                                => array(),
500
501        // Woocommerce orders and refunds.
502        // See https://github.com/woocommerce/woocommerce/blob/8ed6e7436ff87c2153ed30edd83c1ab8abbdd3e9/includes/data-stores/class-wc-order-data-store-cpt.php#L27 .
503        // See https://github.com/woocommerce/woocommerce/blob/b8a2815ae546c836467008739e7ff5150cb08e93/includes/data-stores/class-wc-order-refund-data-store-cpt.php#L20 .
504        '_billing_address_1'                         => array(),
505        '_billing_address_2'                         => array(),
506        '_billing_address_index'                     => array(),
507        '_billing_city'                              => array(),
508        '_billing_company'                           => array(),
509        '_billing_country'                           => array(),
510        '_billing_email'                             => array(),
511        '_billing_first_name'                        => array(),
512        '_billing_last_name'                         => array(),
513        '_billing_phone'                             => array(),
514        '_billing_postcode'                          => array(),
515        '_billing_state'                             => array(),
516        '_cart_discount'                             => array(),
517        '_cart_discount_tax'                         => array(),
518        '_completed_date'                            => array(),
519        '_created_via'                               => array(),
520        '_customer_ip_address'                       => array(),
521        '_customer_user_agent'                       => array(),
522        '_date_completed'                            => array(),
523        '_date_paid'                                 => array(),
524        '_order_currency'                            => array(),
525        '_order_key'                                 => array(),
526        '_order_shipping'                            => array(),
527        '_order_shipping_tax'                        => array(),
528        '_order_stock_reduced'                       => array(),
529        '_order_tax'                                 => array(),
530        '_order_total'                               => array(),
531        '_order_version'                             => array(),
532        '_paid_date'                                 => array(),
533        '_payment_method'                            => array(),
534        '_payment_method_title'                      => array(),
535        '_payment_tokens'                            => array(),
536        '_recorded_coupon_usage_counts'              => array(),
537        '_refund_amount'                             => array(),
538        '_refund_reason'                             => array(),
539        '_refunded_by'                               => array(),
540        '_shipping_address_1'                        => array(),
541        '_shipping_address_2'                        => array(),
542        '_shipping_address_index'                    => array(),
543        '_shipping_city'                             => array(),
544        '_shipping_company'                          => array(),
545        '_shipping_country'                          => array(),
546        '_shipping_first_name'                       => array(),
547        '_shipping_last_name'                        => array(),
548        '_shipping_postcode'                         => array(),
549        '_shipping_state'                            => array(),
550        '_transaction_id'                            => array(),
551
552        // aioseop.
553        '_aioseop_description'                       => array(),
554        '_aioseop_keywords'                          => array(),
555        '_aioseop_title'                             => array(),
556
557        // yoast.
558        '_yoast_wpseo_authorship'                    => array(),
559        '_yoast_wpseo_bctitle'                       => array(),
560        '_yoast_wpseo_canonical'                     => array(),
561        '_yoast_wpseo_content_score'                 => array(),
562        '_yoast_wpseo_focuskw'                       => array(),
563        '_yoast_wpseo_focuskw_text_input'            => array(),
564        '_yoast_wpseo_google-plus-description'       => array(),
565        '_yoast_wpseo_google-plus-image'             => array(),
566        '_yoast_wpseo_linkdex'                       => array(),
567        '_yoast_wpseo_meta-robots-adv'               => array(),
568        '_yoast_wpseo_meta-robots-nofollow'          => array(),
569        '_yoast_wpseo_meta-robots-noindex'           => array(),
570        '_yoast_wpseo_metadesc'                      => array(),
571        '_yoast_wpseo_metakeywords'                  => array(),
572        '_yoast_wpseo_opengraph-description'         => array(),
573        '_yoast_wpseo_opengraph-image'               => array(),
574        '_yoast_wpseo_opengraph-title'               => array(),
575        '_yoast_wpseo_primary_byline'                => array(),
576        '_yoast_wpseo_primary_category'              => array(),
577        '_yoast_wpseo_primary_product_cat'           => array(),
578        '_yoast_wpseo_primary_sponsor-type'          => array(),
579        '_yoast_wpseo_primary_tema_category'         => array(),
580        '_yoast_wpseo_primary_wpdmcategory'          => array(),
581        '_yoast_wpseo_primary_wt_portfolio_category' => array(),
582        '_yoast_wpseo_redirect'                      => array(),
583        '_yoast_wpseo_sitemap-include'               => array(),
584        '_yoast_wpseo_sitemap-prio'                  => array(),
585        '_yoast_wpseo_title'                         => array(),
586        '_yoast_wpseo_twitter-description'           => array(),
587        '_yoast_wpseo_twitter-image'                 => array(),
588
589        // bbpress.
590        'bbppu_read_by'                              => array(),
591        '_bbp_activity_id'                           => array(),
592        '_bbp_attachment'                            => array(),
593        '_bbp_attachment_upload_error'               => array(),
594        '_bbp_forum_id'                              => array(),
595        '_bbp_forum_parent_id'                       => array(),
596        '_bbp_forum_subforum_count'                  => array(),
597        '_bbp_forum_type'                            => array(),
598        '_bbp_group_ids'                             => array(),
599        '_bbp_last_active_id'                        => array(),
600        '_bbp_last_active_time'                      => array(),
601        '_bbp_last_reply_id'                         => array(),
602        '_bbp_last_topic_id'                         => array(),
603        '_bbp_old_forum_id'                          => array(),
604        '_bbp_old_sticky_status'                     => array(),
605        '_bbp_old_topic_id'                          => array(),
606        '_bbp_post_id'                               => array(),
607        '_bbp_reply_count'                           => array(),
608        '_bbp_reply_is_private'                      => array(),
609        '_bbp_reply_to'                              => array(),
610        '_bbp_revision_log'                          => array(),
611        '_bbp_status'                                => array(),
612        '_bbp_sticky_topics'                         => array(),
613        '_bbp_topic_count'                           => array(),
614        '_bbp_topic_id'                              => array(),
615        '_bbp_total_reply_count'                     => array(),
616        '_bbp_total_topic_count'                     => array(),
617        '_bbp_voice_count'                           => array(),
618
619        // ???
620        '_locale'                                    => array(),
621
622        // wp-job-manager.
623        '_job_title'                                 => array(),
624        '_job_description'                           => array(),
625
626        // wpml.
627        '_wpml_media_duplicate'                      => array(),
628        '_wpml_media_featured'                       => array(),
629
630        // generic fields.
631        'ad_clicks_count'                            => array(),
632        'email'                                      => array(),
633        'usage_count'                                => array(),
634        'user_mail'                                  => array(),
635        'views'                                      => array(),
636        '_EventAllDay'                               => array(),
637        '_EventCost'                                 => array(),
638        '_EventCurrencyPosition'                     => array(),
639        '_EventCurrencySymbol'                       => array(),
640        '_EventDuration'                             => array(),
641        '_EventEndDate'                              => array(),
642        '_EventEndDateUTC'                           => array(),
643        '_EventOrganizerID'                          => array(),
644        '_EventOrigin'                               => array(),
645        '_EventShowMap'                              => array(),
646        '_EventShowMapLink'                          => array(),
647        '_EventStartDate'                            => array(),
648        '_EventStartDateUTC'                         => array(),
649        '_EventTimezone'                             => array(),
650        '_EventTimezoneAbbr'                         => array(),
651        '_EventURL'                                  => array(),
652        '_EventVenueID'                              => array(),
653        '_OrganizerEmail'                            => array(),
654        '_OrganizerOrganizer'                        => array(),
655        '_OrganizerOrigin'                           => array(),
656        '_OrganizerPhone'                            => array(),
657        '_OrganizerWebsite'                          => array(),
658        '_VenueAddress'                              => array(),
659        '_VenueCity'                                 => array(),
660        '_VenueCountry'                              => array(),
661        '_VenueOrigin'                               => array(),
662        '_VenuePhone'                                => array(),
663        '_VenueProvince'                             => array(),
664        '_VenueShowMap'                              => array(),
665        '_VenueShowMapLink'                          => array(),
666        '_VenueState'                                => array(),
667        '_VenueStateProvince'                        => array(),
668        '_VenueURL'                                  => array(),
669        '_VenueVenue'                                => array(),
670        '_VenueVenueID'                              => array(),
671        '_VenueZip'                                  => array(),
672        '_description'                               => array(),
673        '_edit_last'                                 => array(),
674        '_feedback_all_fields'                       => array(),
675        '_feedback_author'                           => array(),
676        '_feedback_author_email'                     => array(),
677        '_feedback_author_url'                       => array(),
678        '_feedback_contact_form_url'                 => array(),
679        '_feedback_ip'                               => array(),
680        '_feedback_subject'                          => array(),
681        '_layout'                                    => array(),
682        '_links_to'                                  => array(),
683        '_links_to_target'                           => array(),
684        '_mail'                                      => array(),
685        '_mail_2'                                    => array(),
686        '_messages'                                  => array(),
687        '_numero'                                    => array(),
688        '_post_restored_from'                        => array(),
689        '_video_url'                                 => array(),
690        '_website'                                   => array(),
691
692    ); // end unindexed post meta.
693
694    /**
695     * List of indexed taxonomy slugs - VARCHAR(32)
696     *
697     * @access private
698     * @static
699     *
700     * @var array
701     */
702    private static $taxonomies_to_sync = array(
703
704        // Core.
705        'link_category',
706        'nav_menu',
707        'post_format', // Special, limited to certain values.
708
709        // bbpress.
710        'topic',
711        'topic-tag',
712        'topics',
713
714        // buddypress.
715        'bp-email-type',
716        'bp-email-type',
717        'bp_docs_access',
718        'bp_docs_associated_item',
719        'bp_docs_comment_access',
720        'bp_docs_doc_in_folder',
721        'bp_docs_folder_in_group',
722        'bp_docs_tag',
723        'bp_member_type',
724
725        // co-authors plus.
726        'author',
727
728        // events calendar plus.
729        // the events calendar.
730        'event-categories',
731        'event-category',
732        'event-tag',
733        'event-tags',
734        'event-type',
735        'event-venue',
736        'event_category',
737        'event_location',
738        'event_organizer',
739        'event_tag',
740        'event_type',
741        'event_type_2',
742        'event_users',
743        'events_categories',
744        'events_category',
745        'events_feeds',
746        'events_tags',
747        'tribe_events_cat',
748
749        // jetpack.
750        'jetpack-portfolio-tag',
751        'jetpack-portfolio-type',
752        'jetpack-search-tag0',
753        'jetpack-search-tag1',
754        'jetpack-search-tag2',
755        'jetpack-search-tag3',
756        'jetpack-search-tag4',
757        'jetpack-search-tag5',
758        'jetpack-search-tag6',
759        'jetpack-search-tag7',
760        'jetpack-search-tag8',
761        'jetpack-search-tag9',
762
763        // nextgen gallery.
764        'ngg_tag',
765
766        // polylang.
767        // wpml.
768        'language',
769        'post_translations',
770        'term_language',
771        'term_translations',
772        'translation_priority',
773
774        // woocommerce.
775        'documentation_category',
776        'pa_accessory-type',
777        'pa_actor',
778        'pa_age',
779        'pa_ambulance',
780        'pa_amount',
781        'pa_arm-roll',
782        'pa_aspectratio',
783        'pa_audiencerating',
784        'pa_author',
785        'pa_axle',
786        'pa_battery',
787        'pa_belakang',
788        'pa_binding',
789        'pa_body-type',
790        'pa_bore-x-stroke-mm',
791        'pa_box-cargo',
792        'pa_brakes',
793        'pa_brand',
794        'pa_brands',
795        'pa_bus',
796        'pa_c',
797        'pa_cabin-to-end',
798        'pa_capacity',
799        'pa_catalognumberlist',
800        'pa_ce-keurmerk',
801        'pa_chassis-front',
802        'pa_chassis-rear',
803        'pa_chassis-weight-kg',
804        'pa_chip-log',
805        'pa_clothing-size',
806        'pa_clutch',
807        'pa_clutch-type',
808        'pa_collection',
809        'pa_color',
810        'pa_colors',
811        'pa_colour',
812        'pa_compactor',
813        'pa_condition',
814        'pa_conditions-options',
815        'pa_cor',
816        'pa_couleur',
817        'pa_country',
818        'pa_countryregion-of-manufacture',
819        'pa_crane',
820        'pa_creator',
821        'pa_culoare',
822        'pa_customerpackagetype',
823        'pa_depan',
824        'pa_depan-belakang',
825        'pa_department',
826        'pa_design',
827        'pa_diameter',
828        'pa_diameter-cakram',
829        'pa_dimension-mm',
830        'pa_dimensions',
831        'pa_director',
832        'pa_disc-diameter',
833        'pa_drive-system',
834        'pa_dump',
835        'pa_ean',
836        'pa_eanlist',
837        'pa_edition',
838        'pa_electric-battery',
839        'pa_engine-model',
840        'pa_engine-size',
841        'pa_ethnicity',
842        'pa_exhaust-brake',
843        'pa_fabric',
844        'pa_farbe',
845        'pa_farg',
846        'pa_farge',
847        'pa_features',
848        'pa_final-gear-ratio',
849        'pa_finish',
850        'pa_fire-fighting',
851        'pa_fits',
852        'pa_flat-bed',
853        'pa_flavour',
854        'pa_format',
855        'pa_fragrance',
856        'pa_frame',
857        'pa_front',
858        'pa_front-overhang',
859        'pa_front-rear',
860        'pa_front-tread',
861        'pa_fuel-tank',
862        'pa_fuel-type',
863        'pa_garantie',
864        'pa_geadviseerd-accu-type',
865        'pa_gear-ratio',
866        'pa_gender',
867        'pa_genre',
868        'pa_gewicht-exclusief-accu',
869        'pa_gift-card-amount',
870        'pa_grade-ability-tan-o',
871        'pa_groesse',
872        'pa_gtin',
873        'pa_gvwr-gcwr',
874        'pa_hardwareplatform',
875        'pa_hazardousmaterialtype',
876        'pa_height',
877        'pa_hekmotor-of-boegmotor',
878        'pa_helmet-size',
879        'pa_hersteller',
880        'pa_high-blow-tank',
881        'pa_hoehe',
882        'pa_inhoud',
883        'pa_interchange-part-number',
884        'pa_isadultproduct',
885        'pa_isbn',
886        'pa_iseligiblefortradein',
887        'pa_itemdimensions',
888        'pa_itempartnumber',
889        'pa_kemudi-tipe',
890        'pa_kleur',
891        'pa_kopling-tipe',
892        'pa_label',
893        'pa_languages',
894        'pa_lbs',
895        'pa_legaldisclaimer',
896        'pa_lengte-aansluitkabel',
897        'pa_length',
898        'pa_liquid-tank',
899        'pa_location',
900        'pa_losse-motor-complete-set',
901        'pa_maat',
902        'pa_main-brake',
903        'pa_make',
904        'pa_manufacturer',
905        'pa_manufacturer-part-number',
906        'pa_manufacturermaximumage',
907        'pa_manufacturerminimumage',
908        'pa_manufacturerpartswarrantydesc',
909        'pa_masseinheit',
910        'pa_material',
911        'pa_mau-sac',
912        'pa_maximum-power-ps-rpm',
913        'pa_maximum-speed',
914        'pa_maximum-torque-kgm-rpm',
915        'pa_mediatype',
916        'pa_megethos',
917        'pa_merk',
918        'pa_metal-type',
919        'pa_min-turning-circle',
920        'pa_mixer',
921        'pa_model',
922        'pa_model-tipe',
923        'pa_model-type',
924        'pa_modelo',
925        'pa_mount',
926        'pa_mpn',
927        'pa_nicotine-strength',
928        'pa_nos-of-cylinder',
929        'pa_nos-of-tire',
930        'pa_numberofdiscs',
931        'pa_numberofitems',
932        'pa_numberofpages',
933        'pa_offset',
934        'pa_open-cargo',
935        'pa_operatingsystem',
936        'pa_options',
937        'pa_other-part-number',
938        'pa_overall-height',
939        'pa_overall-length',
940        'pa_overall-width',
941        'pa_overview',
942        'pa_packagedimensions',
943        'pa_packagequantity',
944        'pa_pages',
945        'pa_parking-brake',
946        'pa_part-number',
947        'pa_partnumber',
948        'pa_pattern',
949        'pa_pattern2',
950        'pa_performa',
951        'pa_pictureformat',
952        'pa_pin-size',
953        'pa_piston-displacement-cc',
954        'pa_ploshhad',
955        'pa_plug-type',
956        'pa_power',
957        'pa_product',
958        'pa_productgroup',
959        'pa_producttypename',
960        'pa_publicationdate',
961        'pa_publisher',
962        'pa_quantity',
963        'pa_rear',
964        'pa_rear-overhang',
965        'pa_rear-tread',
966        'pa_refrigerated-box',
967        'pa_region',
968        'pa_regioncode',
969        'pa_releasedate',
970        'pa_rem-parkir',
971        'pa_rem-pelambat',
972        'pa_rem-utama',
973        'pa_reverse',
974        'pa_runningtime',
975        'pa_scent',
976        'pa_schachtlengte',
977        'pa_seeds',
978        'pa_series',
979        'pa_setting',
980        'pa_sex',
981        'pa_shape',
982        'pa_shirt-size',
983        'pa_size',
984        'pa_sizes',
985        'pa_sku',
986        'pa_sky-lift',
987        'pa_sleeve-length',
988        'pa_snelheidsregeling',
989        'pa_staart',
990        'pa_steering',
991        'pa_steering-type',
992        'pa_storlek',
993        'pa_studio',
994        'pa_stuwkracht-lbs',
995        'pa_style',
996        'pa_suspensions',
997        'pa_taille',
998        'pa_talla',
999        'pa_tamanho',
1000        'pa_tamano',
1001        'pa_taxi',
1002        'pa_ticket-type',
1003        'pa_tire-size',
1004        'pa_total-chassis-weight',
1005        'pa_towing-truck',
1006        'pa_tradeinvalue',
1007        'pa_trailer-t-head',
1008        'pa_transmisi-tipe',
1009        'pa_transmission',
1010        'pa_transmission-type',
1011        'pa_types',
1012        'pa_ukuran',
1013        'pa_upc',
1014        'pa_upclist',
1015        'pa_variation',
1016        'pa_vehicle-carrier',
1017        'pa_vergelijkbaar-stuwkracht',
1018        'pa_vermogen',
1019        'pa_voltage',
1020        'pa_volume',
1021        'pa_warranty',
1022        'pa_weight',
1023        'pa_wheel-base',
1024        'pa_wheel-configuration',
1025        'pa_wheel-disc-size',
1026        'pa_width',
1027        'pa_zout-water-geschikt',
1028        'product',
1029        'product-brand',
1030        'product_brand',
1031        'product-category',
1032        'product_cat',
1033        'product_delivery_time',
1034        'product_delivery_times',
1035        'product_price_label',
1036        'product_sale_labels',
1037        'product_shipping_class',
1038        'product_tag',
1039        'product_type',
1040        'product_unit',
1041        'product_visibility',
1042        'products',
1043
1044        // wp-job-manager.
1045        'job-category',
1046        'job-location',
1047        'job-type',
1048        'job_cat',
1049        'job_category',
1050        'job_listing_category',
1051        'job_listing_label',
1052        'job_listing_region',
1053        'job_listing_tag',
1054        'job_listing_type',
1055        'job_salary',
1056        'job_tag',
1057        'job_type',
1058        'jobman_category',
1059        'jobpost_category',
1060        'jobpost_job_type',
1061        'jobpost_location',
1062        'resume_category',
1063        'resume_groups',
1064        'resume_job_type',
1065        'resume_job_type',
1066        'resume_languages',
1067        'resume_region',
1068        'resume_skill',
1069        'resume_specialities',
1070
1071        // generic.
1072        '_resource',
1073        'acadp_categories',
1074        'acadp_locations',
1075        'action-group',
1076        'activity',
1077        'actor',
1078        'actors',
1079        'ad-group',
1080        'adace-ad-group',
1081        'adace-sponsor',
1082        'additional_features',
1083        'adv_location',
1084        'advanced_ads_groups',
1085        'advert_category',
1086        'affcoups_coupon_category',
1087        'affcoups_coupon_type',
1088        'ai_log_context',
1089        'ai_log_level',
1090        'al_product-cat',
1091        'aol_ad_category',
1092        'aol_ad_location',
1093        'aol_ad_type',
1094        'aol_application_status',
1095        'area',
1096        'article-slug',
1097        'asgarosforum-category',
1098        'asgarosforum-usergroup',
1099        'attachment_category',
1100        'attachment_tag',
1101        'atum_location',
1102        'audience_type',
1103        'avhec_catgroup',
1104        'bartype',
1105        'baths',
1106        'beds',
1107        'bepro_listing_types',
1108        'blog_category',
1109        'booked_custom_calendars',
1110        'brand',
1111        'brands',
1112        'business',
1113        'business_cat',
1114        'business_category',
1115        'bwg_tag',
1116        'byline',
1117        'calendar_category',
1118        'calendar_feed',
1119        'calendar_type',
1120        'campaign_category',
1121        'campaign_tag',
1122        'carousel_cat',
1123        'carousels_category',
1124        'case27_job_listing_tags',
1125        'categories',
1126        'category_media',
1127        'category_portfolio',
1128        'celebrity_cat',
1129        'chapters',
1130        'chronosly_category',
1131        'city',
1132        'classified_listing_type',
1133        'client-types',
1134        'clients_groups',
1135        'cm-business-category',
1136        'cmdm_category',
1137        'cn_log_type',
1138        'coderevolution_post_source',
1139        'collection',
1140        'community',
1141        'companies',
1142        'company',
1143        'cont_category',
1144        'content_audit',
1145        'country',
1146        'course',
1147        'course-cat',
1148        'course-category',
1149        'course_cat',
1150        'course_category',
1151        'course_difficulty',
1152        'course_tag',
1153        'courses_type',
1154        'cp_campaign',
1155        'cp_recipe_category',
1156        'csco_post_featured',
1157        'ct_status',
1158        'ctl-stories',
1159        'cuisine',
1160        'dc_vendor_shop',
1161        'ddownload_category',
1162        'ddownload_tag',
1163        'dealstore',
1164        'department',
1165        'departments',
1166        'department-company',
1167        'developed-by',
1168        'dfads_group',
1169        'dgfw_gift_categories',
1170        'director',
1171        'district',
1172        'dlm_download_category',
1173        'dlm_download_tag',
1174        'doc_tag',
1175        'document-category',
1176        'document-type',
1177        'download_artist',
1178        'download_category',
1179        'download_tag',
1180        'downloads_filter',
1181        'dps_book',
1182        'dt_gallery_category',
1183        'dt_logos_category',
1184        'dt_portfolio_category',
1185        'dt_team_category',
1186        'dt_testimonials_category',
1187        'dtcast',
1188        'dtcreator',
1189        'dtdirector',
1190        'dtnetworks',
1191        'dtstudio',
1192        'dtyear',
1193        'dvteamtaxonomy',
1194        'dwqa-question_category',
1195        'dwqa-question_tag',
1196        'eafl_category',
1197        'easy-testimonial-category',
1198        'ecwd_event_category',
1199        'edd_log_type',
1200        'edition',
1201        'ef_editorial_meta',
1202        'ef_usergroup',
1203        'element_category',
1204        'elementor_library_type',
1205        'employees_category',
1206        'encyclopedia-tag',
1207        'envira-tag',
1208        'epkb_post_type_1_category',
1209        'espresso_event_categories',
1210        'espresso_event_type',
1211        'essential_grid_category',
1212        'et_post_format',
1213        'faq-group',
1214        'faq-tags',
1215        'faq-topic',
1216        'faq_cat',
1217        'faq_categories',
1218        'faq_category',
1219        'faqs-category',
1220        'fdm-menu-section',
1221        'feature',
1222        'featured_item_category',
1223        'featured_item_tag',
1224        'feedback_type',
1225        'feeds',
1226        'fl-builder-template-type',
1227        'flamingo_inbound_channel',
1228        'follow_up_email_campaign',
1229        'follow_up_email_type',
1230        'following_users',
1231        'football-team-taxo',
1232        'fpd_design_category',
1233        'gallery-category',
1234        'gallery_cat',
1235        'gallery_categories',
1236        'gallery_category',
1237        'gallery_entries',
1238        'gallerycat',
1239        'gd_event_tags',
1240        'gd_eventcategory',
1241        'gd_place_tags',
1242        'gd_placecategory',
1243        'genre',
1244        'genres',
1245        'gg_connect_hub',
1246        'give_log_type',
1247        'gn-genre',
1248        'gn-location-1',
1249        'gn-location-2',
1250        'gn-location-3',
1251        'gp_hubs',
1252        'gp_portfolios',
1253        'gp_videos',
1254        'group',
1255        'group-documents-category',
1256        'groups',
1257        'guest',
1258        'hashtags',
1259        'hotel_facility',
1260        'ia_invited_groups',
1261        'ia_invitees',
1262        'incsub_wiki_category',
1263        'industry',
1264        'ingredient',
1265        'insight-type',
1266        'issue',
1267        'issuem_issue',
1268        'issuem_issue_tags',
1269        'jbp_category',
1270        'karma-slider-category',
1271        'klaviyo_shop_cart_status',
1272        'kwlogos-carousel',
1273        'layout_category',
1274        'layout_type',
1275        'ld_course_category',
1276        'ld_course_tag',
1277        'ld_lesson_category',
1278        'ld_lesson_tag',
1279        'ld_topic_tag',
1280        'lesson-tag',
1281        'level',
1282        'lingotek_hash',
1283        'lingotek_profile',
1284        'link_library_category',
1285        'linkage',
1286        'list-tags',
1287        'listing-category',
1288        'listing_amenities',
1289        'listing_category',
1290        'liveblog',
1291        'llms_access_plan_visibility',
1292        'llms_product_visibility',
1293        'localisation',
1294        'location',
1295        'location-tag',
1296        'locations',
1297        'magazine',
1298        'map_location_categories',
1299        'masonry_gallery_category',
1300        'mc-event-category',
1301        'mec_category',
1302        'mec_location',
1303        'mec_organizer',
1304        'media-category',
1305        'media-tags',
1306        'media_category',
1307        'media_folder',
1308        'member_cat',
1309        'mentions',
1310        'mesh_template_types',
1311        'ml-slider',
1312        'module',
1313        'module-tag',
1314        'module_width',
1315        'movie_cat',
1316        'mpp-component',
1317        'mpp-status',
1318        'mpp-type',
1319        'muvicast',
1320        'muvicountry',
1321        'muvidirector',
1322        'muviindex',
1323        'muviquality',
1324        'muviyear',
1325        'news-category',
1326        'news-tag',
1327        'news-type',
1328        'news_type_cat',
1329        'news_category',
1330        'nova_menu',
1331        'nova_menu_item_label',
1332        'offer-types',
1333        'organization',
1334        'our_team_category',
1335        'page_category',
1336        'page_condition',
1337        'parisrestaurant',
1338        'parissauna',
1339        'partner_category',
1340        'partners',
1341        'paswdestinatari',
1342        'paypal_ipn_type',
1343        'pdf_lv_tag',
1344        'pec_events_category',
1345        'people',
1346        'people-department',
1347        'people-expertise',
1348        'people-location',
1349        'perfect_quotes_category',
1350        'performer',
1351        'person',
1352        'personnal-category',
1353        'pexcontentslider_category',
1354        'pexfullslider_category',
1355        'pexnivoslider_category',
1356        'pexpricing_category',
1357        'pexservice_category',
1358        'pextestimonial_category',
1359        'pf_feed_item_tag',
1360        'pg_sas_type',
1361        'photo_tag',
1362        'phototype',
1363        'pj-categs',
1364        'pj-tags',
1365        'pl-categs',
1366        'placement',
1367        'plan_status',
1368        'platform',
1369        'player',
1370        'plugins_categories',
1371        'podcast',
1372        'pojo_sidebars',
1373        'popup_category',
1374        'pornstars',
1375        'portada',
1376        'portcat',
1377        'portfolio-category',
1378        'portfolio-gallery',
1379        'portfolio-status',
1380        'portfolio-skills',
1381        'portfolio-tag',
1382        'portfolio-tags',
1383        'portfolio-type',
1384        'portfolio-types',
1385        'portfolio_cat',
1386        'portfolio_categories',
1387        'portfolio_category',
1388        'portfolio_cats',
1389        'portfolio_client',
1390        'portfolio_entries',
1391        'portfolio_filter',
1392        'portfolio_in',
1393        'portfolio_label',
1394        'portfolio_skills',
1395        'portfolio_tag',
1396        'portfolio_tags',
1397        'portfolio_type',
1398        'posicao',
1399        'post-type',
1400        'post_format',
1401        'post_series',
1402        'pp_editorial_meta',
1403        'pp_notify_role',
1404        'pp_usergroup',
1405        'pricingcats',
1406        'print_section',
1407        'print_status',
1408        'product_asset_class',
1409        'product_name',
1410        'programs',
1411        'project-attributes',
1412        'project-cat',
1413        'project-category',
1414        'project-type',
1415        'project_category',
1416        'project_tag',
1417        'projects_category',
1418        'projects_tag',
1419        'prominence',
1420        'promotion-categories',
1421        'property-city',
1422        'property-feature',
1423        'property-status',
1424        'property-type',
1425        'property-types',
1426        'property_action_category',
1427        'property_area',
1428        'property_category',
1429        'property_city',
1430        'property_feature',
1431        'property_status',
1432        'property_type',
1433        'province',
1434        'provinces',
1435        'publisher',
1436        'pwb-brand',
1437        'qmn_log_type',
1438        'qualification',
1439        'qualifications',
1440        'quality',
1441        'question-category',
1442        'question-tag',
1443        'question-type',
1444        'question_cat',
1445        'question_category',
1446        'question_tag',
1447        'quiz',
1448        'quiz-type',
1449        'quote_status',
1450        'rating',
1451        'reaction',
1452        'recipe-category',
1453        'recipe_category',
1454        'recipe_type',
1455        'region',
1456        'registrant-event',
1457        'related_keywords',
1458        'release-date',
1459        'resource-type',
1460        'resource_category',
1461        'resource_type',
1462        'resourcetype',
1463        'review-type',
1464        'review_category',
1465        'rodzaj',
1466        'role',
1467        'room_category',
1468        'room_tag',
1469        'roomtype',
1470        'rubriek_categorie',
1471        'savedreply',
1472        'schools',
1473        'scope',
1474        'scores_cat',
1475        'sdm_categories',
1476        'sdm_tags',
1477        'season',
1478        'secondary_html_features',
1479        'section',
1480        'sector',
1481        'series',
1482        'series_of_posts',
1483        'services_group',
1484        'serving',
1485        'shop_cart_status',
1486        'shop_cat',
1487        'shop_order_status',
1488        'shop_vendor',
1489        'shop_warranty_status',
1490        'shopp_category',
1491        'shopr_category',
1492        'show',
1493        'simple_link_category',
1494        'site-review-category',
1495        'sizes',
1496        'skill',
1497        'skill_level',
1498        'skills',
1499        'sld_cat',
1500        'slide-page',
1501        'slide-types',
1502        'slide_categories',
1503        'slide_type',
1504        'slider',
1505        'slider-locations',
1506        'slider_category',
1507        'slides_category',
1508        'slideshow',
1509        'sm-category',
1510        'snax_format',
1511        'sngg_media_tags',
1512        'solution_channel',
1513        'source_domain',
1514        'source_id',
1515        'sp_league',
1516        'sp_position',
1517        'sp_role',
1518        'sp_season',
1519        'sp_venue',
1520        'speaker',
1521        'speakers',
1522        'special-feature',
1523        'specialty',
1524        'spnl_log_type',
1525        'sponsor_categories',
1526        'sponsor_category',
1527        'sponsor_type',
1528        'spot_tag',
1529        'st_af_category',
1530        'st_af_tags',
1531        'staff',
1532        'staff-member-category',
1533        'staff-member-group',
1534        'staff_category',
1535        'staffgroups',
1536        'state',
1537        'status',
1538        'store',
1539        'stores',
1540        'studio',
1541        'study_level',
1542        'style',
1543        'style_category',
1544        'sub_transaction_action',
1545        'sub_transaction_result',
1546        'subcategory',
1547        'subject',
1548        'subscription_status',
1549        'swift-slider-category',
1550        'syn_sitegroup',
1551        'szbl-content-tag',
1552        'task-queue',
1553        'tax_feature',
1554        'tcb_symbols_tax',
1555        'tcp_product_category',
1556        'team',
1557        'team-category',
1558        'team_cat',
1559        'team_categories',
1560        'team_category',
1561        'team_cats',
1562        'team_department',
1563        'team_designation',
1564        'team_group',
1565        'team_member_position',
1566        'team_mfcategory',
1567        'teams',
1568        'tenant_categories',
1569        'tenant_location',
1570        'tender-category',
1571        'test-type',
1572        'testimonial-category',
1573        'testimonial-group',
1574        'testimonial-types',
1575        'testimonial_categories',
1576        'testimonial_category',
1577        'testimonials-category',
1578        'testimonials_category',
1579        'th_events_cat',
1580        'th_galleries_cat',
1581        'thegem_clients_sets',
1582        'thegem_news_sets',
1583        'thegem_portfolios',
1584        'thegem_quickfinders',
1585        'thegem_teams',
1586        'thegem_testimonials_sets',
1587        'theme',
1588        'themefusion_es_groups',
1589        'themes_categories',
1590        'themo_cpt_group',
1591        'themo_project_type',
1592        'themo_room_type',
1593        'thirstylink-category',
1594        'ticket_channel',
1595        'ticket_priority',
1596        'timeline_post_tag',
1597        'tipo',
1598        'tipologie',
1599        'tips',
1600        'tm-testimonials_category',
1601        'tm_testimonial_group',
1602        'tooltips_categories',
1603        'tour_category',
1604        'tour_destination',
1605        'tour_facility',
1606        'tour_phys',
1607        'tour_type',
1608        'tp_event_category',
1609        'transmission',
1610        'treatment-type',
1611        'tribe_events_cat',
1612        'truethemes-gallery-category',
1613        'tsas-category',
1614        'tshowcase-categories',
1615        'tsml_region',
1616        'ttshowcase_groups',
1617        'tvo_tags',
1618        'type',
1619        'types',
1620        'u_course_cat',
1621        'u_department',
1622        'u_event_cat',
1623        'ufaq-category',
1624        'ufaq-tag',
1625        'um_hashtag',
1626        'um_user_tag',
1627        'uncodeblock_category',
1628        'upg_cate',
1629        'urp-review-category',
1630        'us_portfolio_category',
1631        'us_testimonial_category',
1632        'user-group',
1633        'user_category',
1634        'user_status',
1635        'vendor',
1636        'venue',
1637        'video-category',
1638        'video-series',
1639        'video-tag',
1640        'video_category',
1641        'video_tag',
1642        'videos',
1643        'videos_categories',
1644        'voice_category',
1645        'vtmin_rule_category',
1646        'vtprd_rule_category',
1647        'w2dc-category',
1648        'w2dc-location',
1649        'w2dc-tag',
1650        'wcb_sponsor_level',
1651        'wcb_track',
1652        'wccf_checkout_field_field_type',
1653        'wccf_checkout_field_status',
1654        'wccf_order_field_field_type',
1655        'wccf_order_field_status',
1656        'wccf_product_field_field_type',
1657        'wccf_product_field_status',
1658        'wccf_product_prop_field_type',
1659        'wccf_product_prop_status',
1660        'wccf_user_field_field_type',
1661        'wccf_user_field_status',
1662        'wcfm_knowledgebase_category',
1663        'wcm_task_category',
1664        'wcpv_product_vendors',
1665        'wcs-instructor',
1666        'wcs-room',
1667        'wcs-type',
1668        'wdca_ad_categories',
1669        'webinar_type_cat',
1670        'where',
1671        'who',
1672        'wiki-category',
1673        'wiki_cats',
1674        'wl_entity_type',
1675        'workout_entries',
1676        'works-category',
1677        'wp-rest-api-log-method',
1678        'wp-rest-api-log-source',
1679        'wp-rest-api-log-status',
1680        'wp-type-activity-types',
1681        'wp-type-contacts-subtype',
1682        'wp-type-group',
1683        'wp_bannerize_tax',
1684        'wp_log_type',
1685        'wp_super_faq_category',
1686        'wpbdm-region',
1687        'wpbdp_category',
1688        'wpbdp_tag',
1689        'wpcm_make_model',
1690        'wpdmcategory',
1691        'wpfb_file_category',
1692        'wpfcas-category',
1693        'wpfd-category',
1694        'wplead_list_category',
1695        'wplss_logo_showcase_cat',
1696        'wpm-testimonial-category',
1697        'wpmf-category',
1698        'wpostahs-slider-category',
1699        'wprm_course',
1700        'wprm_cuisine',
1701        'wprm_ingredient',
1702        'wprm_keyword',
1703        'wprss_category',
1704        'wps_forum',
1705        'wpsc-variation',
1706        'wpsc_log_type',
1707        'wpsc_product_category',
1708        'wpseo_locations_category',
1709        'wpsisac_slider-category',
1710        'wpsl_store_category',
1711        'wpt_category',
1712        'wpt_result',
1713        'wpt_scale',
1714        'wpv_sermons_category',
1715        'wpvqgr_tag',
1716        'writer',
1717        'wyz_business_category',
1718        'wyz_business_rating_category',
1719        'wyz_business_tag',
1720        'wzkb_category',
1721        'year',
1722        'years',
1723        'yith_product_brand',
1724        'yith_shop_vendor',
1725        'yst_prominent_words',
1726        'zipcode',
1727        'zoninator_zones',
1728        'zrf_field_group',
1729
1730        // End The Backlog  @see https://wp.me/p9MPsk-X0.
1731        'bill-status',
1732        'etb-audience',
1733        'etb-state',
1734        'etb-target',
1735        'etb-topic',
1736        'etb-year',
1737        'foia-response-status',
1738        'target-type',
1739        'timeline-pillar',
1740        'timeline-type',
1741
1742        // wp.com martketplace search - @see https://wp.me/pdh6GB-Ax#comment-2104
1743        'wpcom_marketplace_categories',
1744
1745        // wp.com a8c-support-theme taxonomies.
1746        'kb_category',
1747        'kb_tag',
1748
1749        // coolhunting.com
1750        'article-type',
1751
1752    ); // end taxonomies.
1753
1754    /**
1755     * List of options to sync
1756     *
1757     * @access private
1758     * @static
1759     *
1760     * @var array
1761     */
1762    private static $options_to_sync = array(
1763        'jetpack_search_ai_prompt_override',
1764        'jetpack_search_color_theme',
1765        'jetpack_search_result_format',
1766        'jetpack_search_default_sort',
1767        'jetpack_search_overlay_trigger',
1768        'jetpack_search_excluded_post_types',
1769        'jetpack_search_highlight_color',
1770        'jetpack_search_enable_sort',
1771        'jetpack_search_inf_scroll',
1772        'jetpack_search_show_powered_by',
1773        'instant_search_enabled',
1774    ); // end options.
1775
1776    /*
1777     * Taxonomies we know don't sync.
1778     * See also sync/src/class-defaults.php
1779     *
1780     * 'network'
1781     * 'post_status'
1782     * 'product_cat'
1783     * 'tags'
1784     *
1785     */
1786
1787    //
1788    // Hooks into sync.
1789
1790    /**
1791     * Add Search post meta to the post meta whitelist.
1792     *
1793     * @param array $list Existing post meta whitelist.
1794     * @return array Updated post meta whitelist.
1795     */
1796    public function add_search_post_meta_whitelist( $list ) {
1797        return array_merge( $list, static::get_all_postmeta_keys() );
1798    }
1799
1800    /**
1801     * Add Search options to the options whitelist.
1802     *
1803     * @param array $list Existing options whitelist.
1804     * @return array Updated options whitelist.
1805     */
1806    public function add_search_options_whitelist( $list ) {
1807        return array_merge( $list, static::get_all_option_keys() );
1808    }
1809
1810    //
1811    // Indexing functions for wp.com.
1812
1813    /**
1814     *
1815     * Check whether a postmeta or taxonomy 'key' is in the indexable
1816     * list. This is called by the indexing code on wp.com to decide
1817     * whether to include something in the index.
1818     *
1819     * @static
1820     * @access public
1821     *
1822     * @param string $type Either 'postmeta' or 'taxonomy'.
1823     * @param string $key The postmeta key or taxonomy name.
1824     * @return boolean
1825     */
1826    public static function is_indexable( $type, $key ) {
1827        switch ( $type ) {
1828            case 'postmeta':
1829                return isset( self::$postmeta_to_sync[ $key ] );
1830            case 'taxonomy':
1831                return in_array( $key, self::$taxonomies_to_sync, true );
1832        }
1833        return false;
1834    }
1835
1836    /**
1837     *
1838     * Get the indexing spec for a postmeta key.
1839     *
1840     * @static
1841     * @access public
1842     *
1843     * @param string $key The postmeta key.
1844     * @return array The spec.
1845     */
1846    public static function get_postmeta_spec( $key ) {
1847        return self::$postmeta_to_sync[ $key ];
1848    }
1849
1850    /**
1851     * Get all post meta keys that get synced.
1852     *
1853     * @access public
1854     *
1855     * @return array List of post meta keys that get synced.
1856     */
1857    public static function get_all_postmeta_keys() {
1858        return array_keys( self::$postmeta_to_sync );
1859    }
1860
1861    /**
1862     * Get all option keys that get synced.
1863     *
1864     * @access public
1865     *
1866     * @return array List of option keys that get synced.
1867     */
1868    public static function get_all_option_keys() {
1869        return self::$options_to_sync;
1870    }
1871
1872    /**
1873     * Get all unindexed postmeta.
1874     *  This is mostly for testing.
1875     *
1876     * @access public
1877     *
1878     * @return array List of postmeta that are not synced.
1879     */
1880    public static function get_all_unindexed_postmeta_keys() {
1881        return array_keys( self::$unindexed_postmeta );
1882    }
1883
1884    /**
1885     * Get all taxonomies that get synced.
1886     *  This is mostly for testing.
1887     *
1888     * @access public
1889     *
1890     * @return array List of taxonomies that get synced.
1891     */
1892    public static function get_all_taxonomies() {
1893        return self::$taxonomies_to_sync;
1894    }
1895}