static function create_from_index_indice($index_indice)
 {
     // Build Solarium config from the default indexing Solr index
     WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_INDEXES, true);
     $options_indexes = new OptionIndexes();
     $solarium_config = $options_indexes->build_solarium_config($index_indice, null, self::DEFAULT_SOLR_TIMEOUT_IN_SECOND);
     return new self($solarium_config);
 }
 public function __construct($solr_index_indice = null, $language_code = null)
 {
     // Load active extensions
     $this->wpsolr_extensions = new WpSolrExtensions();
     $path = plugin_dir_path(__FILE__) . '../../vendor/autoload.php';
     require_once $path;
     // Load options
     $this->solr_indexing_options = get_option('wdm_solr_form_data');
     // Build Solarium config from the default indexing Solr index
     WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_INDEXES, true);
     $options_indexes = new OptionIndexes();
     $config = $options_indexes->build_solarium_config($solr_index_indice, $language_code, self::DEFAULT_SOLR_TIMEOUT_IN_SECOND);
     $this->index_indice = $solr_index_indice;
     $this->solarium_client = new Solarium\Client($config);
 }
<?php

include WPSOLR_PLUGIN_DIR . '/classes/solr/wpsolr-index-solr-client.php';
include WPSOLR_PLUGIN_DIR . '/classes/solr/wpsolr-search-solr-client.php';
include WPSOLR_PLUGIN_DIR . '/classes/ui/WPSOLR_Data_facets.php';
// Load localization class
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_LOCALIZATION, true);
//WpSolrExtensions::load();
function solr_format_date($thedate)
{
    $datere = '/(\\d{4}-\\d{2}-\\d{2})\\s(\\d{2}:\\d{2}:\\d{2})/';
    $replstr = '${1}T${2}Z';
    return preg_replace($datere, $replstr, $thedate);
}
function fun_search_indexed_data()
{
    $ad_url = admin_url();
    // Retrieve search form page url
    $get_page_info = WPSolrSearchSolrClient::get_search_page();
    $url = get_permalink($get_page_info->ID);
    // Filter the search page url. Used for multi-language search forms.
    $url = apply_filters(WpSolrFilters::WPSOLR_FILTER_SEARCH_PAGE_URL, $url, $get_page_info->ID);
    // Load localization options
    $localization_options = OptionLocalization::get_options();
    $wdm_typehead_request_handler = !empty($_GET['nofacet']) ? 'wdm_return_solr_rows' : 'wdm_return_facet_solr_rows';
    echo "<div class='cls_search' style='width:100%'> <form action='{$url}' method='get'  class='search-frm' >";
    echo '<input type="hidden" value="' . $wdm_typehead_request_handler . '" id="path_to_fold">';
    echo '<input type="hidden" value="' . $ad_url . '" id="path_to_admin">';
    echo '<input type="hidden" value="' . WPSOLR_Global::getQuery()->get_wpsolr_query() . '" id="search_opt">';
    $ajax_nonce = wp_create_nonce("nonce_for_autocomplete");
    echo $form = '
<?php

// Load WPML class for inheritance
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_WPML, true);
/**
 * Class PluginPolylang
 *
 * Manage Polylang plugin
 * @link https://polylang.wordpress.com/documentation/
 */
class PluginPolylang extends PluginWpml
{
    const _PLUGIN_NAME_IN_MESSAGES = 'Polylang';
    /*
     * Polylang database constants
     */
    const TABLE_TERM_RELATION_SHIPS = "term_relationships";
    // Polylang options
    const _OPTIONS_NAME = 'wdm_solr_extension_polylang_data';
    /**
     * Factory
     *
     * @return PluginWpml
     */
    static function create()
    {
        return new self();
    }
    /*
     * Constructor
     * Subscribe to actions
<?php

// Load class for inheritance
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_EMBED_ANY_DOCUMENT, true);
/**
 * Class PluginGoogleDocEmbedder
 *
 * Manage Google Doc Embedder plugin
 * @link https://wordpress.org/plugins/google-document-embedder/
 */
class PluginGoogleDocEmbedder extends PluginEmbedAnyDocument
{
    const EMBEDDOC_SHORTCODE = 'gview';
    const EMBEDDOC_SHORTCODE_ATTRIBUTE_URL = 'file';
    protected function set_is_do_embed_documents()
    {
        $this->is_do_embed_documents = WPSOLR_Global::getOption()->get_google_doc_embedder_is_do_embed_documents();
    }
}
<?php

/**
 * Included file to display admin options
 */
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_S2MEMBER, true);
PluginS2Member::update_custom_field_capabilities(PluginS2Member::CUSTOM_FIELD_NAME_STORING_POST_CAPABILITIES);
$extension_options_name = 'wdm_solr_extension_s2member_data';
$settings_fields_name = 'solr_extension_s2member_options';
$array_extension_options = get_option($extension_options_name);
$is_plugin_active = WpSolrExtensions::is_plugin_active(WpSolrExtensions::EXTENSION_S2MEMBER);
$is_plugin_custom_field_for_indexing = PluginS2Member::get_custom_field_capabilities(PluginS2Member::CUSTOM_FIELD_NAME_STORING_POST_CAPABILITIES);
$custom_field_for_indexing_name = PluginS2Member::CUSTOM_FIELD_NAME_STORING_POST_CAPABILITIES;
$plugin_name = "s2member";
?>

<div id="extension_s2member-options" class="wdm-vertical-tabs-content">
	<form action="options.php" method="POST" id='extension_s2member_settings_form'>
		<?php 
settings_fields($settings_fields_name);
$solr_extension_s2member_options = get_option($extension_options_name, array('is_extension_active' => '0', 'is_users_without_capabilities_see_all_results' => '0', 'is_result_without_capabilities_seen_by_all_users' => '0', 'message_user_without_capabilities_shown_no_results' => '', 'message_result_capability_matches_user_group' => ''));
?>

		<div class='wrapper'>
			<h4 class='head_div'>s2Member plugin Options</h4>

			<div class="wdm_note">

				In this section, you will configure how to restrict Solr search with levels
				and capabilities.<br/>
function my_register_activation_hook()
{
    /*
     * Migrate old data on plugin update
     */
    WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_INDEXES, true);
    $option_object = new OptionIndexes();
    $option_object->migrate_data_from_v4_9();
}
<?php

/**
 * Included file to display admin options
 */
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_QTRANSLATEX, true);
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_INDEXES, true);
$extension_options_name = 'wdm_solr_extension_qtranslatex_data';
$settings_fields_name = 'solr_extension_qtranslatex_options';
$options = get_option($extension_options_name, array('is_extension_active' => '0'));
$is_plugin_active = WpSolrExtensions::is_plugin_active(WpSolrExtensions::EXTENSION_QTRANSLATEX);
$plugin_name = "qTranslate X";
$plugin_link = "https://wordpress.org/plugins/qtranslate-x/";
$plugin_version = "";
if ($is_plugin_active) {
    $ml_plugin = PluginQTranslateX::create();
}
?>

<?php 
include_once WpSolrExtensions::get_option_file(WpSolrExtensions::EXTENSION_WPML, 'template.inc.php');
<?php

/**
 * Included file to display admin options
 */
global $license_manager;
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_BBPRESS, true);
$extension_options_name = 'wdm_solr_extension_bbpress_data';
$settings_fields_name = 'solr_extension_bbpress_options';
$options = get_option($extension_options_name, array('is_extension_active' => '0'));
$is_plugin_active = WpSolrExtensions::is_plugin_active(WpSolrExtensions::EXTENSION_BBPRESS);
$plugin_name = "bbPress";
$plugin_link = "https://wordpress.org/plugins/bbpress/";
$plugin_version = "(>= 2.5.10)";
?>

<div id="extension_groups-options" class="wdm-vertical-tabs-content">
	<form action="options.php" method="POST" id='extension_groups_settings_form'>
		<?php 
settings_fields('solr_extension_bbpress_options');
$extension_options = get_option($extension_options_name, array('is_extension_active' => '0'));
?>

		<div class='wrapper'>
			<h4 class='head_div'><?php 
echo $plugin_name;
?>
 plugin Options</h4>

			<div class="wdm_note">
<?php

/**
 * Included file to display admin options
 */
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_LICENSES, true);
// Options name
$option_name = OptionLicenses::get_option_name(WpSolrExtensions::OPTION_LICENSES);
// Options object
$license_manager = new OptionLicenses();
?>

	<script>
		jQuery(document).on("click", "#<?php 
echo OptionLicenses::AJAX_VERIFY_LICENCE;
?>
, #<?php 
echo OptionLicenses::AJAX_ACTIVATE_LICENCE;
?>
, #<?php 
echo OptionLicenses::AJAX_DEACTIVATE_LICENCE;
?>
", function (e) {

			// Remember this for ajax
			var current = this;

			// Show progress
			var button_clicked = jQuery(this);
			var button_form = button_clicked.parents('.wpsolr_form_license');
			var buttonText = button_clicked.val(); // Remmember button text
function wpsolr_activate()
{
    if (!is_multisite()) {
        /**
         * Mark licenses
         */
        WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_LICENSES, true);
        OptionLicenses::upgrade_licenses();
    }
}
<?php

/**
 * Included file to display admin options
 */
global $license_manager;
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_PDF_EMBEDDER, true);
$extension_options_name = WPSOLR_Option::OPTION_PDF_EMBEDDER;
$settings_fields_name = 'extension_pdf_embedder_opt';
$options = get_option($extension_options_name, array('is_extension_active' => '0'));
$is_plugin_active = WpSolrExtensions::is_plugin_active(WpSolrExtensions::EXTENSION_PDF_EMBEDDER);
$plugin_name = "PDF Embedder";
$plugin_link = "https://wordpress.org/plugins/pdf-embedder/";
$plugin_version = "(>= 2.7.3)";
?>

<div id="extension_groups-options" class="wdm-vertical-tabs-content">
	<form action="options.php" method="POST" id='extension_groups_settings_form'>
		<?php 
settings_fields($settings_fields_name);
$extension_options = get_option($extension_options_name, array('is_extension_active' => '0'));
?>

		<div class='wrapper'>
			<h4 class='head_div'><?php 
echo $plugin_name;
?>
 plugin Options</h4>

			<div class="wdm_note">
function wpsolr_admin_tabs($current = 'solr_indexes')
{
    // Get default search solr index indice
    WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_INDEXES, true);
    $option_indexes = new OptionIndexes();
    $default_search_solr_index = $option_indexes->get_default_search_solr_index();
    $nb_indexes = count($option_indexes->get_indexes());
    $are_there_indexes = $nb_indexes > 0;
    $tabs = array();
    $tabs['solr_indexes'] = $are_there_indexes ? '1. Define your Solr Indexes' : '1. Define your Solr Index';
    if ($are_there_indexes) {
        $tabs['solr_option'] = sprintf("2. Define your search with '%s'", !isset($default_search_solr_index) ? $are_there_indexes ? "<span class='text_error'>No index selected</span>" : '' : $option_indexes->get_index_name($default_search_solr_index));
        $tabs['solr_plugins'] = '3. Define which plugins to work with';
        $tabs['solr_operations'] = '4. Send your data';
    }
    echo '<div id="icon-themes" class="icon32"><br></div>';
    echo '<h2 class="nav-tab-wrapper">';
    foreach ($tabs as $tab => $name) {
        $class = $tab == $current ? ' nav-tab-active' : '';
        echo "<a class='nav-tab{$class}' href='admin.php?page=solr_settings&tab={$tab}'>{$name}</a>";
    }
    echo '</h2>';
}
<?php

/**
 * Included file to display admin options
 */
global $license_manager;
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_WOOCOMMERCE, true);
$extension_options_name = 'wdm_solr_extension_woocommerce_data';
$settings_fields_name = 'solr_extension_woocommerce_options';
$options = get_option($extension_options_name, array('is_extension_active' => '0'));
$is_plugin_active = WpSolrExtensions::is_plugin_active(WpSolrExtensions::EXTENSION_WOOCOMMERCE);
$plugin_name = "WooCommerce";
$plugin_link = "https://wordpress.org/plugins/woocommerce/";
$plugin_version = "(>= 2.4.10)";
if ($is_plugin_active) {
    $ml_plugin = PluginWooCommerce::create();
}
?>

<div id="extension_groups-options" class="wdm-vertical-tabs-content">
	<form action="options.php" method="POST" id='extension_groups_settings_form'>
		<?php 
settings_fields('solr_extension_woocommerce_options');
$extension_options = get_option($extension_options_name, array('is_extension_active' => '0'));
?>

		<div class='wrapper'>
			<h4 class='head_div'><?php 
echo $plugin_name;
?>
 plugin Options</h4>
<?php

/**
 * Included file to display admin options
 */
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_MANAGED_SOLR_SERVERS, true);
// Options name
$option_name = OptionManagedSolrServer::get_option_name(WpSolrExtensions::OPTION_MANAGED_SOLR_SERVERS);
// Options data
$option_data = OptionManagedSolrServer::get_option_data(WpSolrExtensions::OPTION_MANAGED_SOLR_SERVERS);
?>

<?php 
// Add menu item for unmanaged Solr server
$subtabs = array('unmanaged_solr_servers' => 'Unmanaged Solr server');
// Add menu items for all the managed Solr services
foreach (OptionManagedSolrServer::get_managed_solr_services() as $managed_solr_service_id => $managed_solr_service) {
    $subtabs[$managed_solr_service_id] = $managed_solr_service[OptionManagedSolrServer::MANAGED_SOLR_SERVICE_LABEL];
}
// Display menu
$subtab = wpsolr_admin_sub_tabs($subtabs);
$subtab_exploded = explode(':', $subtab);
$managed_solr_service_id = $subtab_exploded[0];
// When a menu item is selected, display specific template.
switch ($managed_solr_service_id) {
    case 'unmanaged_solr_servers':
        WpSolrExtensions::require_with(WpSolrExtensions::get_option_template_file(WpSolrExtensions::OPTION_MANAGED_SOLR_SERVERS, 'template-unmanaged-form.php'));
        break;
    default:
        $managed_solr_server = new OptionManagedSolrServer($managed_solr_service_id);
        /*
<?php

/**
 * Included file to display admin options
 */
global $license_manager;
WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::EXTENSION_GOOGLE_DOC_EMBEDDER, true);
$extension_options_name = WPSOLR_Option::OPTION_GOOGLE_DOC_EMBEDDER;
$settings_fields_name = 'extension_google_doc_embedder_opt';
$options = get_option($extension_options_name, array('is_extension_active' => '0'));
$is_plugin_active = WpSolrExtensions::is_plugin_active(WpSolrExtensions::EXTENSION_GOOGLE_DOC_EMBEDDER);
$plugin_name = "Google Doc Embedder";
$plugin_link = "https://wordpress.org/plugins/google-document-embedder/";
$plugin_version = "(>= 2.6)";
?>

<div id="extension_groups-options" class="wdm-vertical-tabs-content">
	<form action="options.php" method="POST" id='extension_groups_settings_form'>
		<?php 
settings_fields($settings_fields_name);
$extension_options = get_option($extension_options_name, array('is_extension_active' => '0'));
?>

		<div class='wrapper'>
			<h4 class='head_div'><?php 
echo $plugin_name;
?>
 plugin Options</h4>

			<div class="wdm_note">