plugin updates
This commit is contained in:
@@ -399,8 +399,9 @@ function relevanssi_create_database_tables( $relevanssi_db_version ) {
|
||||
$sql = "SHOW INDEX FROM $relevanssi_log_table";
|
||||
$indices = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||
|
||||
$query_exists = false;
|
||||
$id_exists = false;
|
||||
$query_exists = false;
|
||||
$id_exists = false;
|
||||
$session_id_exists = false;
|
||||
foreach ( $indices as $index ) {
|
||||
if ( 'query' === $index->Key_name ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
|
||||
$query_exists = true;
|
||||
@@ -408,6 +409,9 @@ function relevanssi_create_database_tables( $relevanssi_db_version ) {
|
||||
if ( 'id' === $index->Key_name ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
|
||||
$id_exists = true;
|
||||
}
|
||||
if ( 'session_id' === $index->Key_name ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
|
||||
$session_id_exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $query_exists ) {
|
||||
@@ -415,6 +419,11 @@ function relevanssi_create_database_tables( $relevanssi_db_version ) {
|
||||
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||
}
|
||||
|
||||
if ( ! $session_id_exists ) {
|
||||
$sql = "CREATE INDEX session_id ON $relevanssi_log_table (session_id)";
|
||||
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||
}
|
||||
|
||||
if ( $id_exists ) {
|
||||
$sql = "DROP INDEX id ON $relevanssi_log_table";
|
||||
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching
|
||||
@@ -486,9 +495,11 @@ function relevanssi_rest_api_disable() {
|
||||
*/
|
||||
function relevanssi_export_log_check() {
|
||||
if ( isset( $_REQUEST['relevanssi_export'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification, just checking the parameter exists.
|
||||
check_admin_referer( 'relevanssi_export_logs', '_relevanssi_export_nonce' );
|
||||
relevanssi_export_log();
|
||||
}
|
||||
if ( isset( $_REQUEST['relevanssi_export_clicks'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification, just checking the parameter exists.
|
||||
check_admin_referer( 'relevanssi_export_logs', '_relevanssi_export_nonce' );
|
||||
function_exists( 'relevanssi_export_click_log' ) && relevanssi_export_click_log();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1977,7 +1977,7 @@ function relevanssi_post_date_throttle_join( $query_join ) {
|
||||
if ( 'post_date' === get_option( 'relevanssi_default_orderby' ) &&
|
||||
'on' === get_option( 'relevanssi_throttle', 'on' ) ) {
|
||||
global $wpdb;
|
||||
$query_join = ', ' . $wpdb->posts . ' AS p';
|
||||
$query_join .= ', ' . $wpdb->posts . ' AS p';
|
||||
}
|
||||
return $query_join;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ function relevanssi_logging_tab() {
|
||||
$omit_from_logs = get_option( 'relevanssi_omit_from_logs' );
|
||||
$trim_logs = get_option( 'relevanssi_trim_logs' );
|
||||
|
||||
wp_nonce_field( 'relevanssi_export_logs', '_relevanssi_export_nonce', true, true );
|
||||
|
||||
?>
|
||||
<table class="form-table" role="presentation">
|
||||
<tr>
|
||||
|
||||
@@ -108,7 +108,7 @@ function relevanssi_overview_tab() {
|
||||
<td>
|
||||
<p><a href="https://www.relevanssi.com/buy-premium"><?php esc_html_e( 'Buy Relevanssi Premium now', 'relevanssi' ); ?></a> –
|
||||
<?php // Translators: %1$s is the coupon code, %2$s is the year it expires. ?>
|
||||
<?php printf( esc_html__( 'use coupon code %1$s for 20%% discount (valid at least until the end of %2$s)', 'relevanssi' ), '<strong>FREE2023</strong>', '2023' ); ?></p>
|
||||
<?php printf( esc_html__( 'use coupon code %1$s for 20%% discount (valid at least until the end of %2$s)', 'relevanssi' ), '<strong>FREE2024</strong>', '2024' ); ?></p>
|
||||
<p><?php esc_html_e( 'Here are some improvements Relevanssi Premium offers:', 'relevanssi' ); ?></p>
|
||||
<ul class="relevanssi_ul">
|
||||
<li><?php esc_html_e( 'PDF content indexing', 'relevanssi' ); ?></li>
|
||||
|
||||
@@ -429,9 +429,15 @@ function relevanssi_get_current_language( bool $locale = true ) {
|
||||
|
||||
if ( isset( $post ) ) {
|
||||
if ( isset( $post->term_id ) && function_exists( 'pll_get_term_language' ) ) {
|
||||
$current_language = pll_get_term_language( $post->term_id, $locale ? 'locale' : 'slug' );
|
||||
$term_language = pll_get_term_language( $post->term_id, $locale ? 'locale' : 'slug' );
|
||||
if ( $term_language ) {
|
||||
$current_language = $term_language;
|
||||
}
|
||||
} elseif ( ! isset( $post->user_id ) && function_exists( 'pll_get_post_language' ) ) {
|
||||
$current_language = pll_get_post_language( $post->ID, $locale ? 'locale' : 'slug' );
|
||||
$post_language = pll_get_post_language( $post->ID, $locale ? 'locale' : 'slug' );
|
||||
if ( $post_language ) {
|
||||
$current_language = $post_language;
|
||||
}
|
||||
}
|
||||
} elseif ( function_exists( 'pll_current_language' ) ) {
|
||||
$pll_language = pll_current_language( $locale ? 'locale' : 'slug' );
|
||||
|
||||
Reference in New Issue
Block a user