updated plugin Connect Matomo version 1.1.9
This commit is contained in:
@ -11,7 +11,7 @@ use WP_Piwik\Widget\Post;
|
||||
class WP_Piwik {
|
||||
|
||||
private static $revision_id = 2023092201;
|
||||
private static $version = '1.1.5';
|
||||
private static $version = '1.1.9';
|
||||
private static $blog_id;
|
||||
private static $plugin_basename = null;
|
||||
private static $logger;
|
||||
@ -1368,7 +1368,7 @@ class WP_Piwik {
|
||||
'SitesManager.addSite',
|
||||
array(
|
||||
'urls' => $is_current ? get_bloginfo( 'url' ) : get_blog_details( $blog_id )->siteurl,
|
||||
'siteName' => rawurlencode( $is_current ? get_bloginfo( 'name' ) : get_blog_details( $blog_id )->blogname ),
|
||||
'siteName' => $is_current ? get_bloginfo( 'name' ) : get_blog_details( $blog_id )->blogname,
|
||||
)
|
||||
);
|
||||
$result = $this->request( $id );
|
||||
|
||||
@ -21,7 +21,7 @@ class Settings extends \WP_Piwik\Admin {
|
||||
return;
|
||||
}
|
||||
if ( ! empty( $_GET['clear'] ) && check_admin_referer() ) {
|
||||
$this->clear( 2 === $_GET['clear'] );
|
||||
$this->clear( 2 === (int) $_GET['clear'] );
|
||||
self::$wp_piwik->reset_request();
|
||||
$page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
|
||||
echo '<form method="post" action="?page=' . esc_attr( $page ) . '"><input type="submit" value="' . esc_attr__( 'Reload', 'wp-piwik' ) . '" /></form>';
|
||||
@ -1158,11 +1158,11 @@ class Settings extends \WP_Piwik\Admin {
|
||||
$GLOBALS ['wp-piwik_debug'] = true;
|
||||
$id = \WP_Piwik\Request::register( 'API.getPiwikVersion', array() );
|
||||
echo "\n\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$wp_piwik->request( $id ) );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$wp_piwik->request( $id ), true ) );
|
||||
echo "\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$wp_piwik->request( $id, true ) );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$wp_piwik->request( $id, true ), true ) );
|
||||
echo "\n";
|
||||
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
|
||||
$GLOBALS ['wp-piwik_debug'] = false;
|
||||
@ -1173,11 +1173,11 @@ class Settings extends \WP_Piwik\Admin {
|
||||
$GLOBALS ['wp-piwik_debug'] = true;
|
||||
$id = \WP_Piwik\Request::register( 'SitesManager.getSitesWithAtLeastViewAccess', array() );
|
||||
echo "\n\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$wp_piwik->request( $id ) );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$wp_piwik->request( $id ), true ) );
|
||||
echo "\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$wp_piwik->request( $id, true ) );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$wp_piwik->request( $id, true ), true ) );
|
||||
echo "\n";
|
||||
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
|
||||
$GLOBALS ['wp-piwik_debug'] = false;
|
||||
@ -1193,15 +1193,15 @@ class Settings extends \WP_Piwik\Admin {
|
||||
)
|
||||
);
|
||||
echo "\n\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$wp_piwik->request( $id ) );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$wp_piwik->request( $id ), true ) );
|
||||
echo "\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$wp_piwik->request( $id, true ) );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$wp_piwik->request( $id, true ), true ) );
|
||||
echo "\n";
|
||||
echo "\n\n";
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
||||
var_dump( self::$settings->get_debug_data() );
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
|
||||
echo esc_textarea( var_export( self::$settings->get_debug_data(), true ) );
|
||||
echo '`';
|
||||
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
|
||||
$GLOBALS ['wp-piwik_debug'] = false;
|
||||
|
||||
@ -60,8 +60,9 @@ class Sitebrowser extends \WP_List_Table {
|
||||
$per_page = 10;
|
||||
|
||||
if ( is_plugin_active_for_network( 'wp-piwik/wp-piwik.php' ) ) {
|
||||
$search = '%' . $wpdb->esc_like( $search ) . '%';
|
||||
$total_items = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM %s WHERE CONCAT(domain, path) LIKE %s AND spam = 0 AND deleted = 0', $wpdb->blogs, $search ) );
|
||||
$search = '%' . $wpdb->esc_like( $search ) . '%';
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
||||
$total_items = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->blogs} WHERE CONCAT(domain, path) LIKE %s AND spam = 0 AND deleted = 0", $search ) );
|
||||
$blogs = \WP_Piwik\Settings::get_blog_list( $per_page, $current_page, $search );
|
||||
foreach ( $blogs as $blog ) {
|
||||
$blog_details = get_blog_details( $blog['blog_id'], true );
|
||||
|
||||
@ -13,7 +13,7 @@ class File extends \WP_Piwik\Logger {
|
||||
|
||||
private function encode_filename( $file_name ) {
|
||||
$file_name = str_replace( ' ', '_', $file_name );
|
||||
preg_replace( '/[^0-9^a-z^_^.]/', '', $file_name );
|
||||
$file_name = preg_replace( '/[^0-9^a-z^_^.]/', '', $file_name );
|
||||
return $file_name;
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,9 @@ class Rest extends \WP_Piwik\Request {
|
||||
} else {
|
||||
$result = $this->unserialize( $result );
|
||||
}
|
||||
curl_close( $c );
|
||||
if ( version_compare( PHP_VERSION, '8', '<' ) ) {
|
||||
curl_close( $c );
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -300,8 +300,8 @@ class Settings {
|
||||
}
|
||||
|
||||
$like = '%' . $wpdb->esc_like( $search ) . '%';
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
||||
return $wpdb->get_results( $wpdb->prepare( 'SELECT blog_id FROM %s WHERE CONCAT(domain, path) LIKE %s AND spam = 0 AND deleted = 0 ORDER BY blog_id' . $query_limit, $wpdb->blogs, $like ), ARRAY_A );
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
||||
return $wpdb->get_results( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blogs} WHERE CONCAT(domain, path) LIKE %s AND spam = 0 AND deleted = 0 ORDER BY blog_id" . $query_limit, $like ), ARRAY_A );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -55,7 +55,8 @@ class MetaBoxCustomVars extends \WP_Piwik\Template {
|
||||
// Create key
|
||||
$str_meta_key = 'wp-piwik_custom_' . $ary_names[ $j ] . $i;
|
||||
// Get data
|
||||
$str_meta_val = isset( $_POST[ $str_meta_key ] ) ? esc_html( $str_meta_key ) : '';
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
||||
$str_meta_val = isset( $_POST[ $str_meta_key ] ) ? esc_html( wp_unslash( $_POST[ $str_meta_key ] ) ) : '';
|
||||
// Get the meta value of the custom field key
|
||||
$str_cur_val = get_post_meta( $int_id, $str_meta_key, true );
|
||||
if ( $str_meta_val && '' === $str_cur_val ) {
|
||||
|
||||
Reference in New Issue
Block a user