diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28b5d01..916216a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,15 +117,15 @@ jobs: env: VERSION: ${{ needs.version.outputs.fullSemVer }} run: | - sed -i "s/^ \* Version:.*/ * Version: ${VERSION}/" ipquery.php - sed -i "s/define( 'IPQUERY_VERSION',[^)]*)/define( 'IPQUERY_VERSION', '${VERSION}' )/" ipquery.php + sed -i "s/^ \* Version:.*/ * Version: ${VERSION}/" stracini-visitor-analytics.php + sed -i "s/define( 'SVA_VERSION',[^)]*)/define( 'SVA_VERSION', '${VERSION}' )/" stracini-visitor-analytics.php sed -i "s/^Stable tag:.*/Stable tag: ${VERSION}/" readme.txt - name: Commit version bump, tag, and push env: VERSION: ${{ needs.version.outputs.fullSemVer }} run: | - git add ipquery.php readme.txt + git add stracini-visitor-analytics.php readme.txt # Commit only when the version files actually changed. git diff --cached --quiet \ || git commit -m "chore: bump version to ${VERSION} [skip ci]" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9b590d..e9f182c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,12 +71,12 @@ jobs: - name: Stage plugin under its slug directory run: | - mkdir -p /tmp/ipquery - git archive HEAD | tar -x -C /tmp/ipquery + mkdir -p /tmp/stracini-visitor-analytics + git archive HEAD | tar -x -C /tmp/stracini-visitor-analytics - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} wp-version: 'latest' - build-dir: /tmp/ipquery + build-dir: /tmp/stracini-visitor-analytics diff --git a/README.md b/README.md index e707937..649a4d6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-# 🌍 IpQuery +# 🌍 Stracini Visitor Analytics with IpQuery **Track and analyse every visitor. Visualise traffic. Detect threats.** @@ -16,6 +16,11 @@ A WordPress plugin that enriches visitor IP addresses with real-time geolocation
+> **Plugin renamed for WordPress.org directory compliance** +> The WordPress.org Plugin Review Team flagged "IpQuery" as a trademark that belongs to the [IpQuery API](https://ipquery.io) service. +> The plugin has been renamed to **Stracini Visitor Analytics with IpQuery** to make it clear this is an independent, third-party integration and is not officially affiliated with IpQuery. +> The repository name, internal class names, database table, and option keys are unchanged. + --- ## ✨ Features @@ -40,7 +45,7 @@ A WordPress plugin that enriches visitor IP addresses with real-time geolocation ### Dashboard -The plugin adds an **IpQuery** entry to the WordPress admin sidebar with three sub-pages. +The plugin adds a **Visitor Analytics** entry to the WordPress admin sidebar with three sub-pages. **Dashboard** — a live overview built from four widgets: @@ -136,7 +141,7 @@ The plugin automatically: ## ⚙️ Configuration -Navigate to **IpQuery → Settings** to configure: +Navigate to **Visitor Analytics → Settings** to configure: | Setting | Default | Description | |---|---|---| diff --git a/admin/views/dashboard.php b/admin/views/dashboard.php index 6a17c01..24b72b0 100644 --- a/admin/views/dashboard.php +++ b/admin/views/dashboard.php @@ -2,12 +2,12 @@ /** * Dashboard admin view — stat cards, heatmap, and charts. * - * @package IpQuery + * @package SVA */ defined( 'ABSPATH' ) || exit; ?> -
+

@@ -15,83 +15,83 @@
-
-
-
-
- - +
+
+
+
+ +
-
-
-
- - +
+
+
+ +
-
-
-
- - +
+
+
+ +
-
-
-
+
+
+
0 - ? round( ( ( $ipquery_risk_counts['vpn'] + $ipquery_risk_counts['proxy'] + $ipquery_risk_counts['tor'] ) / $ipquery_unique_ips ) * 100, 1 ) + $sva_risky_pct = $sva_unique_ips > 0 + ? round( ( ( $sva_risk_counts['vpn'] + $sva_risk_counts['proxy'] + $sva_risk_counts['tor'] ) / $sva_unique_ips ) * 100, 1 ) : 0; ?> - % - + % +
-
+
-
+

-
+
-
+

-
- +
+
-
+
-
+

-
- +
+
-
+

- +
@@ -100,22 +100,22 @@ - + - + - - + + @@ -126,10 +126,10 @@ -
-
+
+

-
- - + <?php echo esc_attr( $ipquery_row['country_code'] ); ?> - + 0 ? esc_html( round( ( $ipquery_row['visits'] / $ipquery_total_visits ) * 100, 1 ) ) . '%' : '—'; ?> 0 ? esc_html( round( ( $sva_row['visits'] / $sva_total_visits ) * 100, 1 ) ) . '%' : '—'; ?>
+
@@ -139,23 +139,23 @@ - + - + - + - - + + @@ -165,51 +165,51 @@ -
-
+
+

-
+
__( 'VPN', 'stracini-visitor-analytics' ), - 'count' => $ipquery_risk_counts['vpn'], + 'count' => $sva_risk_counts['vpn'], 'icon' => 'lock', 'class' => 'orange', ), array( 'label' => __( 'Proxy', 'stracini-visitor-analytics' ), - 'count' => $ipquery_risk_counts['proxy'], + 'count' => $sva_risk_counts['proxy'], 'icon' => 'update', 'class' => 'red', ), array( 'label' => __( 'Tor', 'stracini-visitor-analytics' ), - 'count' => $ipquery_risk_counts['tor'], + 'count' => $sva_risk_counts['tor'], 'icon' => 'hidden', 'class' => 'red', ), array( 'label' => __( 'Datacenter', 'stracini-visitor-analytics' ), - 'count' => $ipquery_risk_counts['datacenter'], + 'count' => $sva_risk_counts['datacenter'], 'icon' => 'cloud', 'class' => 'blue', ), array( 'label' => __( 'Mobile', 'stracini-visitor-analytics' ), - 'count' => $ipquery_risk_counts['mobile'], + 'count' => $sva_risk_counts['mobile'], 'icon' => 'smartphone', 'class' => 'green', ), ); - foreach ( $ipquery_risk_items as $ipquery_item ) : + foreach ( $sva_risk_items as $sva_item ) : ?> -
- - - - 0 ) : ?> - % +
+ + + + 0 ) : ?> + %
diff --git a/admin/views/settings.php b/admin/views/settings.php index b1a6b8c..fcf49dd 100644 --- a/admin/views/settings.php +++ b/admin/views/settings.php @@ -2,12 +2,12 @@ /** * Settings admin view. * - * @package IpQuery + * @package SVA */ defined( 'ABSPATH' ) || exit; ?> -
+

@@ -15,8 +15,8 @@
true, 'track_logged_in' => false, 'track_admins' => false, @@ -24,11 +24,11 @@ 'retention_days' => 90, 'lookup_private_ips' => false, ); - $ipquery_settings = wp_parse_args( $ipquery_raw, $ipquery_defaults ); + $sva_settings = wp_parse_args( $sva_raw, $sva_defaults ); ?>
- +

- - + <?php echo esc_attr( $ipquery_row['country_code'] ); ?> - + 0 ? esc_html( round( ( $ipquery_row['visits'] / $ipquery_total_visits ) * 100, 1 ) ) . '%' : '—'; ?> 0 ? esc_html( round( ( $sva_row['visits'] / $sva_total_visits ) * 100, 1 ) ) . '%' : '—'; ?>
@@ -36,7 +36,7 @@ @@ -57,7 +57,7 @@ @@ -67,7 +67,7 @@ @@ -78,7 +78,7 @@ @@ -89,7 +89,7 @@ @@ -146,26 +146,26 @@ - + diff --git a/admin/views/visitors.php b/admin/views/visitors.php index df2fb10..2ad9c2f 100644 --- a/admin/views/visitors.php +++ b/admin/views/visitors.php @@ -2,12 +2,12 @@ /** * Visitors admin view — searchable, sortable IP log with lookup and purge tools. * - * @package IpQuery + * @package SVA */ defined( 'ABSPATH' ) || exit; ?> -
+

@@ -27,8 +27,8 @@ // translators: %s is the error message returned by the lookup. echo '

' . esc_html( sprintf( __( 'Lookup error: %s', 'stracini-visitor-analytics' ), urldecode( sanitize_text_field( wp_unslash( $_GET['lookup_error'] ) ) ) ) ) . '

'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended elseif ( isset( $_GET['country_deleted'] ) && 'false' !== $_GET['country_deleted'] ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended - $ipquery_deleted_count = (int) $_GET['country_deleted']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended - $ipquery_deleted_country = esc_html( strtoupper( sanitize_text_field( wp_unslash( $_GET['country_code'] ?? '' ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $sva_deleted_count = (int) $_GET['country_deleted']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $sva_deleted_country = esc_html( strtoupper( sanitize_text_field( wp_unslash( $_GET['country_code'] ?? '' ) ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended printf( '

' . esc_html( sprintf( @@ -36,11 +36,11 @@ _n( '%1$d record deleted for country: %2$s.', '%1$d records deleted for country: %2$s.', - $ipquery_deleted_count, + $sva_deleted_count, 'stracini-visitor-analytics' ), - $ipquery_deleted_count, - $ipquery_deleted_country + $sva_deleted_count, + $sva_deleted_country ) ) . '

' ); @@ -50,9 +50,9 @@ ?> -
- - +
+ + @@ -80,50 +80,50 @@ class="regular-text"> if ( ! empty( $_GET['s'] ) || ! empty( $_GET['risk_filter'] ) ) : // phpcs:enable WordPress.Security.NonceVerification.Recommended ?> - + -
- - + + +
-
- - + + + - +
$ipquery_per_page, - 'page' => $ipquery_current_page, - 'orderby' => $ipquery_orderby, - 'order' => $ipquery_order, + 'per_page' => $sva_per_page, + 'page' => $sva_current_page, + 'orderby' => $sva_orderby, + 'order' => $sva_order, 'search' => sanitize_text_field( wp_unslash( $_GET['s'] ?? '' ) ), // phpcs:ignore WordPress.Security.NonceVerification.Recommended - 'risk_filter' => $ipquery_risk_filter, + 'risk_filter' => $sva_risk_filter, ) ); - $ipquery_rows = $ipquery_result['rows']; - $ipquery_total = $ipquery_result['total']; - $ipquery_total_pages = ceil( $ipquery_total / $ipquery_per_page ); + $sva_rows = $sva_result['rows']; + $sva_total = $sva_result['total']; + $sva_total_pages = ceil( $sva_total / $sva_per_page ); /** * Returns a sortable column header link. @@ -134,7 +134,7 @@ class="regular-text"> * @param string $current_order Currently active sort direction. * @return string Safe HTML anchor. */ - function ipquery_sortable_col( string $col, string $label, string $current_orderby, string $current_order ): string { + function sva_sortable_col( string $col, string $label, string $current_orderby, string $current_order ): string { $is_sorted = $col === $current_orderby; $next_order = ( $is_sorted && 'ASC' === $current_order ) ? 'DESC' : 'ASC'; $url = add_query_arg( @@ -148,90 +148,90 @@ function ipquery_sortable_col( string $col, string $label, string $current_order } ?> -

+

' . esc_html( number_format_i18n( $ipquery_total ) ) . '' + esc_html( _n( '%s record found.', '%s records found.', $sva_total, 'stracini-visitor-analytics' ) ), + '' . esc_html( number_format_i18n( $sva_total ) ) . '' ); ?>

- +
- - + + - - - - + + + + - + array( 'class' => true ), ); - foreach ( $ipquery_rows as $ipquery_row ) : - $ipquery_flags = array(); - if ( $ipquery_row['is_vpn'] ) { - $ipquery_flags[] = 'VPN'; + foreach ( $sva_rows as $sva_row ) : + $sva_flags = array(); + if ( $sva_row['is_vpn'] ) { + $sva_flags[] = 'VPN'; } - if ( $ipquery_row['is_proxy'] ) { - $ipquery_flags[] = 'Proxy'; + if ( $sva_row['is_proxy'] ) { + $sva_flags[] = 'Proxy'; } - if ( $ipquery_row['is_tor'] ) { - $ipquery_flags[] = 'Tor'; + if ( $sva_row['is_tor'] ) { + $sva_flags[] = 'Tor'; } - if ( $ipquery_row['is_datacenter'] ) { - $ipquery_flags[] = 'DC'; + if ( $sva_row['is_datacenter'] ) { + $sva_flags[] = 'DC'; } - if ( $ipquery_row['is_mobile'] ) { - $ipquery_flags[] = 'Mobile'; + if ( $sva_row['is_mobile'] ) { + $sva_flags[] = 'Mobile'; } - $ipquery_score = (int) $ipquery_row['risk_score']; - $ipquery_score_cls = $ipquery_score >= 80 ? 'red' : ( $ipquery_score >= 40 ? 'orange' : 'green' ); - $ipquery_location = array_filter( array( $ipquery_row['city'], $ipquery_row['state'], $ipquery_row['country'] ) ); + $sva_score = (int) $sva_row['risk_score']; + $sva_score_cls = $sva_score >= 80 ? 'red' : ( $sva_score >= 40 ? 'orange' : 'green' ); + $sva_location = array_filter( array( $sva_row['city'], $sva_row['state'], $sva_row['country'] ) ); ?> - + - + - - - - + + + +
- - + <?php echo esc_attr( $ipquery_row['country_code'] ); ?> - + Clean'; + echo 'Clean'; } ?>
- - - + + +
- 1 ) : ?> + 1 ) : ?>
add_query_arg( 'paged', '%#%' ), 'format' => '', - 'current' => $ipquery_current_page, - 'total' => $ipquery_total_pages, + 'current' => $sva_current_page, + 'total' => $sva_total_pages, 'prev_text' => '«', 'next_text' => '»', ) @@ -266,11 +266,11 @@ function ipquery_sortable_col( string $col, string $label, string $current_order -
+

- - + +
-
+

- - + +