Plugin Directory

Changeset 2855787


Ignore:
Timestamp:
01/27/2023 11:15:54 AM (3 years ago)
Author:
lando1982
Message:

Committing 3.0.0 to trunk

Location:
cloud-search/trunk
Files:
3232 added
9 edited

Legend:

Unmodified
Added
Removed
  • cloud-search/trunk/actions/cloud-search-action-manage.php

    r2620374 r2855787  
    33 * Imports
    44 */
    5 
    6 // Autoloader
    7 require_once(  plugin_dir_path( __DIR__ ) . 'vendor/aws/aws-autoloader.php' );
    85
    96use \WP_Cloud_Search\Aws\CloudSearchDomain\CloudSearchDomainClient;
     
    3431            /** @noinspection MissedFieldInspection */
    3532            CloudSearchDomainClient::factory( array(
     33                'version' => '2013-01-01',
    3634                'endpoint' => ( defined( 'WP_ACS_SEARCH_ENDPOINT' ) ) ? WP_ACS_SEARCH_ENDPOINT : $settings->acs_search_endpoint,
    3735                'region' => ( defined( 'WP_ACS_REGION' ) ) ? WP_ACS_REGION : $settings->acs_aws_region,
     
    4947            /** @noinspection MissedFieldInspection */
    5048            $client = CloudSearchClient::factory( array(
     49                'version' => '2013-01-01',
    5150                'region' => ( defined( 'WP_ACS_REGION' ) ) ? WP_ACS_REGION : $settings->acs_aws_region
    5251            ) );
  • cloud-search/trunk/actions/cloud-search-action-status.php

    r2170064 r2855787  
    9999    }
    100100    catch ( Exception $e ) {
    101 
    102         echo print_r($e->getMessage(), true);
     101//      echo print_r($e->getMessage(), true);
    103102
    104103        // Prepare error result object
  • cloud-search/trunk/actions/cloud-search-actions.php

    r2620374 r2855787  
    33 * Imports
    44 */
    5 
    6 // Autoloader
    7 require_once(  plugin_dir_path( __DIR__ ) . 'vendor/aws/aws-autoloader.php' );
    85
    96use \WP_Cloud_Search\Aws\CloudSearch\CloudSearchClient;
     
    3431        /** @noinspection MissedFieldInspection */
    3532        $client = CloudSearchClient::factory( array(
     33            'version' => '2013-01-01',
    3634            'region' => ( defined( 'WP_ACS_REGION' ) ) ? WP_ACS_REGION : $settings->acs_aws_region,
    3735            // 'key' => ( defined( 'WP_ACS_ACCESS_KEY' ) ) ? WP_ACS_ACCESS_KEY : $settings->acs_aws_access_key_id,
     
    4846        /** @noinspection MissedFieldInspection */
    4947        $client = CloudSearchClient::factory( array(
     48            'version' => '2013-01-01',
    5049            'region' => ( defined( 'WP_ACS_REGION' ) ) ? WP_ACS_REGION : $settings->acs_aws_region
    5150        ) );
     
    6867    if ( acs_check_basic_configuration() ) {
    6968        /** @noinspection MissedFieldInspection */
    70         $domain_client = CloudSearchDomainClient::factory( array(
     69        $args = array(
    7170            'endpoint' => ( defined( 'WP_ACS_SEARCH_ENDPOINT' ) ) ? WP_ACS_SEARCH_ENDPOINT : $settings->acs_search_endpoint,
    7271            'region' => ( defined( 'WP_ACS_REGION' ) ) ? WP_ACS_REGION : $settings->acs_aws_region,
     
    8079                'connect_timeout' => ( defined( 'WP_ACS_DOMAIN_CLIENT_CONNECT_TIMEOUT' ) ) ? WP_ACS_DOMAIN_CLIENT_CONNECT_TIMEOUT : 0,
    8180                'timeout' => ( defined( 'WP_ACS_DOMAIN_CLIENT_TIMEOUT' ) ) ? WP_ACS_DOMAIN_CLIENT_TIMEOUT : 0
    82             )
    83         ) );
     81            ),
     82            'version' => '2013-01-01',
     83        );
     84
     85        $domain_client = CloudSearchDomainClient::factory( $args );
    8486    }
    8587    else if ( acs_check_mandatory_configuration() ) {
     
    8789        /** @noinspection MissedFieldInspection */
    8890        $domain_client = CloudSearchDomainClient::factory( array(
     91            'version' => '2013-01-01',
    8992            'endpoint' => ( defined( 'WP_ACS_SEARCH_ENDPOINT' ) ) ? WP_ACS_SEARCH_ENDPOINT : $settings->acs_search_endpoint,
    9093            'retries' => ( defined( 'WP_ACS_DOMAIN_CLIENT_RETRIES' ) ) ? WP_ACS_DOMAIN_CLIENT_RETRIES : 3,
  • cloud-search/trunk/admin/cloud-search-admin-manage.php

    r1948518 r2855787  
    104104                        <tr valign="top">
    105105                            <th scope="row"><?php _e( 'Status', ACS::PREFIX ) ?></th>
    106                             <td class="field_index_error"><?php _e( 'Connection with CloudSearch index not works or incomplete', ACS::PREFIX ) ?></td>
     106                            <td class="field_index_error"><?php _e( 'Connection with CloudSearch index is not working or incomplete', ACS::PREFIX ) ?></td>
    107107                        </tr>
    108108                        <?php
  • cloud-search/trunk/admin/cloud-search-admin-settings.php

    r2620374 r2855787  
    3737                    <tr valign="top">
    3838                        <th scope="row"><label for="acs_aws_access_key_id"><?php _e( 'AWS Access key ID', ACS::PREFIX ) ?></label></th>
    39                         <td><input type="text" id="acs_aws_access_key_id" name="acs_aws_access_key_id" value="<?php echo $settings->acs_aws_access_key_id ?>" /></td>
     39                        <td><input type="text" id="acs_aws_access_key_id" name="acs_aws_access_key_id" value="<?php echo $settings->acs_aws_access_key_id ?? '' ?>" /></td>
    4040                    </tr>
    4141                    <tr valign="top">
    4242                        <th scope="row"><label for="acs_aws_secret_access_key"><?php _e( 'AWS Secret access key', ACS::PREFIX ) ?></label></th>
    43                         <td><input type="text" id="acs_aws_secret_access_key" name="acs_aws_secret_access_key" value="<?php echo $settings->acs_aws_secret_access_key ?>" /></td>
     43                        <td><input type="text" id="acs_aws_secret_access_key" name="acs_aws_secret_access_key" value="<?php echo $settings->acs_aws_secret_access_key ?? '' ?>" /></td>
    4444                    </tr>
    4545                    <tr valign="top">
    4646                        <th scope="row"><label for="acs_aws_session_token"><?php _e( 'AWS Session token', ACS::PREFIX ) ?></label></th>
    47                         <td><input type="text" id="acs_aws_session_token" name="acs_aws_session_token" value="<?php echo $settings->acs_aws_session_token ?>" /></td>
     47                        <td><input type="text" id="acs_aws_session_token" name="acs_aws_session_token" value="<?php echo $settings->acs_aws_session_token ?? '' ?>" /></td>
    4848                    </tr>
    4949                    <tr valign="top">
     
    7979                    <tr valign="top">
    8080                        <th scope="row"><label for="acs_search_endpoint"><?php _e( 'Search endpoint', ACS::PREFIX ) ?> *</label></th>
    81                         <td><input type="text" id="acs_search_endpoint" name="acs_search_endpoint" value="<?php echo $settings->acs_search_endpoint ?>" /></td>
     81                        <td><input type="text" id="acs_search_endpoint" name="acs_search_endpoint" value="<?php echo $settings->acs_search_endpoint ?? '' ?>" /></td>
    8282                    </tr>
    8383                    <tr valign="top">
    8484                        <th scope="row"><label for="acs_search_domain_name"><?php _e( 'Domain name', ACS::PREFIX ) ?> *</label></th>
    85                         <td><input type="text" id="acs_search_domain_name" name="acs_search_domain_name" value="<?php echo $settings->acs_search_domain_name ?>" /></td>
     85                        <td><input type="text" id="acs_search_domain_name" name="acs_search_domain_name" value="<?php echo $settings->acs_search_domain_name ?? '' ?>" /></td>
    8686                    </tr>
    8787                </tbody>
     
    102102                        <td>
    103103                            <?php
    104                             $acs_schema_types = $settings->acs_schema_types;
     104                            $acs_schema_types = $settings->acs_schema_types ?? array();
    105105                            $acs_schema_types = $acs_schema_types ? explode( ACS::SEPARATOR, $acs_schema_types ) : array();
    106106                            $count = 0;
     
    122122                        <td>
    123123                            <?php
    124                             $acs_schema_fields = $settings->acs_schema_fields;
     124                            $acs_schema_fields = $settings->acs_schema_fields ?? array();
    125125                            $acs_schema_fields = $acs_schema_fields ? explode( ACS::SEPARATOR, $acs_schema_fields ) : array();
    126126                            $count = 0;
     
    142142                        <td>
    143143                            <?php
    144                             $acs_schema_taxonomies = $settings->acs_schema_taxonomies;
     144                            $acs_schema_taxonomies = $settings->acs_schema_taxonomies ?? array();
    145145                            $acs_schema_taxonomies = $acs_schema_taxonomies ? explode( ACS::SEPARATOR, $acs_schema_taxonomies ) : array();
    146146                            $count = 0;
     
    162162                        <td>
    163163                            <?php
    164                             $acs_schema_searchable_taxonomies = $settings->acs_schema_searchable_taxonomies;
     164                            $acs_schema_searchable_taxonomies = $settings->acs_schema_searchable_taxonomies ?? array();
    165165                            $acs_schema_searchable_taxonomies = $acs_schema_searchable_taxonomies ? explode( ACS::SEPARATOR, $acs_schema_searchable_taxonomies ) : array();
    166166                            $count = 1;
     
    305305                        <th scope="row"><label for="acs_frontpage_custom_css"><?php _e( 'Custom CSS', ACS::PREFIX ) ?></label></th>
    306306                        <td>
    307                             <textarea id="acs_frontpage_custom_css" name="acs_frontpage_custom_css" rows="5"><?php echo $settings->acs_frontpage_custom_css ?></textarea>
     307                            <textarea id="acs_frontpage_custom_css" name="acs_frontpage_custom_css" rows="5"><?php echo $settings->acs_frontpage_custom_css ?? '' ?></textarea>
    308308                            <div class="acs_row_tips">
    309309                                <span><?php _e( 'Customize search page CSS here.', ACS::PREFIX ) ?></span>
     
    785785                $settings->acs_hide_section_import =  ( !empty( $_POST[ 'acs_hide_section_import' ] ) ) ? 1 : 0;
    786786
     787                // Normalize acs_search_endpoint field for adding HTTPS protocol
     788                if ( str_starts_with( $settings->acs_search_endpoint, 'http://' ) ) {
     789                    $settings->acs_search_endpoint = str_replace( 'http://', 'https://', $settings->acs_search_endpoint);
     790                }
     791                if ( ! str_starts_with( $settings->acs_search_endpoint, 'https://' ) ) {
     792                    $settings->acs_search_endpoint = 'https://' . $settings->acs_search_endpoint;
     793                }
     794               
    787795                // Remove '.php' occurrences from boxes value
    788796                $settings->acs_frontpage_content_box_value = str_replace( '.php', '', $settings->acs_frontpage_content_box_value );
  • cloud-search/trunk/classes/cloud-search.php

    r2620374 r2855787  
    99     * Class constants
    1010     */
    11     const VERSION = '2.12.0';
     11    const VERSION = '3.0.0';
    1212    const PREFIX = 'cloud_search';
    1313    const SEPARATOR = ',';
  • cloud-search/trunk/cloud-search.php

    r2620374 r2855787  
    77Text Domain: cloud-search
    88Domain Path: /languages/
    9 Version: 2.12.0
     9Version: 3.0.0
    1010License: GPL v3
    1111
    1212CloudSearch
    13 Copyright (C) 2013-2020, Andrea Landonio - landonio.andrea@gmail.com
     13Copyright (C) 2013-2023, Andrea Landonio - landonio.andrea@gmail.com
    1414
    1515This program is free software: you can redistribute it and/or modify
     
    2929// Security check
    3030if ( ! defined( 'ABSPATH' ) ) die( 'Direct access to files not allowed' );
     31
     32require_once('vendor/scoper-autoload.php');
    3133
    3234/**
  • cloud-search/trunk/languages/cloud_search-it_IT.po

    r2620374 r2855787  
    29022902#: admin/cloud-search-admin-manage.php:106
    29032903#: deploy/admin/cloud-search-admin-manage.php:106
    2904 msgid "Connection with CloudSearch index not works or incomplete"
     2904msgid "Connection with CloudSearch index is not working or incomplete"
    29052905msgstr "La connessione con CloudSearch non funziona o è incompleta"
    29062906
  • cloud-search/trunk/readme.txt

    r2620374 r2855787  
    33Tags: aws, amazon, cloud, search, research, CloudSearch, cs, suggest, facet
    44Requires at least: 4.4
    5 Tested up to: 5.8
    6 Stable tag: 2.12.0
     5Tested up to: 5.9
     6Stable tag: 3.0.0
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    9393== Changelog ==
    9494
     95= 3.0.0 - 2023-01-27 =
     96* Added support to AWS SDK version 3
     97
    9598= 2.12.0 - 2021-10-26 =
    9699* Added AWS session token management
Note: See TracChangeset for help on using the changeset viewer.