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 ) {
|
||||
|
||||
@ -2,16 +2,15 @@
|
||||
|
||||
Contributors: Braekling
|
||||
Requires at least: 5.0
|
||||
Tested up to: 6.9.4
|
||||
Stable tag: 1.1.5
|
||||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
|
||||
Tested up to: 7.0.0
|
||||
Stable tag: 1.1.9
|
||||
Tags: matomo, tracking, statistics, stats, analytics
|
||||
|
||||
Adds Matomo (former Piwik) statistics to your WordPress dashboard and is also able to add the Matomo Tracking Code to your blog.
|
||||
|
||||
== Description ==
|
||||
|
||||
**Version 1.1.4 includes several important security related fixes, it is highly recommended to update to this version.**
|
||||
**Version 1.1.7 includes a security related fix, it is highly recommended to update to this or a later version.**
|
||||
|
||||
If you are not yet using Matomo On-Premise, Matomo Cloud or hosting your own instance of Matomo, please use the [Matomo for WordPress plugin](https://wordpress.org/plugins/matomo/).
|
||||
|
||||
@ -147,6 +146,21 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.1.9 =
|
||||
* Bug fix: correctly check clear parameter value.
|
||||
* Bug fix: fix multisite regression caused by certain SQL query generation.
|
||||
* Bug fix: correctly save custom variable value when editing posts.
|
||||
|
||||
= 1.1.8 =
|
||||
* Dummy release to force wordpress.org to rebuild the plugin package.
|
||||
|
||||
= 1.1.7 =
|
||||
* Bug fix: correctly escape output used to troubleshoot connection issues.
|
||||
|
||||
= 1.1.6 =
|
||||
* Bug fix: remove redundant urlencode during automatic creation of a new site in the target Matomo in auto-config mode.
|
||||
* Bump tested up to version to WP 7.
|
||||
|
||||
= 1.1.5 =
|
||||
* Update Matomo logo and screenshots.
|
||||
* Update tracker proxy code with latest changes.
|
||||
|
||||
@ -86,11 +86,8 @@ function wp_matomo_uninstall() {
|
||||
);
|
||||
|
||||
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
|
||||
if ( isset( $limit ) && isset( $page ) ) {
|
||||
$query_limit = 'LIMIT ' . (int) ( ( $page - 1 ) * $limit ) . ',' . (int) $limit . ' ';
|
||||
}
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
||||
$ary_blogs = $wpdb->get_results( $wpdb->prepare( 'SELECT blog_id FROM %s ' . $query_limit . 'ORDER BY blog_id', $wpdb->blogs ), ARRAY_A );
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
||||
$ary_blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} ORDER BY blog_id", ARRAY_A );
|
||||
if ( is_array( $ary_blogs ) ) {
|
||||
foreach ( $ary_blogs as $ary_blog ) {
|
||||
foreach ( $settings as $key ) {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Plugin Name: Connect Matomo
|
||||
* Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
|
||||
* Description: Adds Matomo statistics to your WordPress dashboard and is also able to add the Matomo Tracking Code to your blog.
|
||||
* Version: 1.1.5
|
||||
* Version: 1.1.9
|
||||
* Author: Matomo, André Bräkling
|
||||
* Author URI: https://matomo.org
|
||||
* Text Domain: wp-piwik
|
||||
|
||||
Reference in New Issue
Block a user