Changeset 3770725
- Timestamp:
- 10/28/2026 01:05:04 PM (3 days ago)
- Location:
- lvm-chat-click-stats/trunk
- Files:
-
- 6 edited
-
assets/js/admin-check.js (modified) (1 diff)
-
includes/admin-settings.php (modified) (2 diffs)
-
includes/helpers.php (modified) (1 diff)
-
lvm-chat-click-stats.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lvm-chat-click-stats/trunk/assets/js/admin-check.js
r3770681 r3770725 27 27 .then(function (r) { return r.text(); }) 28 28 .then(function (html) { 29 render(el, html.indexOf('cswaConfig') !== -1 ? 'ok' : 'missing'); 29 /* WordPress prints our script as <script id="cswa-tracker-js" ...> and its config as id="cswa-tracker-js-extra". 30 Optimizers (LiteSpeed, WP Rocket, Autoptimize) may combine, defer or base64-encode the contents, but keep the id. */ 31 render(el, /id=["']cswa-tracker-js(-extra)?["']/.test(html) ? 'ok' : 'missing'); 30 32 }) 31 33 .catch(function () { render(el, 'error'); }); -
lvm-chat-click-stats/trunk/includes/admin-settings.php
r3770681 r3770725 44 44 $out['button_text'] = isset( $in['button_text'] ) ? sanitize_text_field( (string) $in['button_text'] ) : ''; 45 45 $out['button_position'] = ( isset( $in['button_position'] ) && 'left' === $in['button_position'] ) ? 'left' : 'right'; 46 $out['delete_on_uninstall'] = empty( $in['delete_on_uninstall'] ) ? 0 : 1; 46 47 47 48 return $out; … … 172 173 <div class="cswa-card cswa-danger"> 173 174 <h2><?php esc_html_e( 'Delete all data', 'lvm-chat-click-stats' ); ?></h2> 175 <form method="post" action="options.php" style="margin-bottom:14px"> 176 <?php settings_fields( 'cswa_settings_group' ); ?> 177 <?php foreach ( $s as $k => $v ) : if ( 'delete_on_uninstall' === $k ) { continue; } ?> 178 <input type="hidden" name="cswa_settings[<?php echo esc_attr( $k ); ?>]" value="<?php echo esc_attr( $v ); ?>"> 179 <?php endforeach; ?> 180 <label><input type="checkbox" name="cswa_settings[delete_on_uninstall]" value="1" <?php checked( $s['delete_on_uninstall'], 1 ); ?>> <?php esc_html_e( 'Also delete all click data when the plugin is uninstalled', 'lvm-chat-click-stats' ); ?></label> 181 <p class="description"><?php esc_html_e( 'Off by default: your statistics survive uninstalling and reinstalling the plugin. Turn it on only if you want a clean removal.', 'lvm-chat-click-stats' ); ?></p> 182 <?php submit_button( __( 'Save', 'lvm-chat-click-stats' ), 'secondary', 'submit', false ); ?> 183 </form> 174 184 <p class="description"><?php esc_html_e( 'Removes every recorded click. This cannot be undone.', 'lvm-chat-click-stats' ); ?></p> 175 185 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" onsubmit="return confirm('<?php echo esc_js( __( 'Delete all click data?', 'lvm-chat-click-stats' ) ); ?>');"> -
lvm-chat-click-stats/trunk/includes/helpers.php
r3770681 r3770725 25 25 'button_text' => '', 26 26 'button_position' => 'right', 27 'delete_on_uninstall' => 0, 27 28 ); 28 29 } -
lvm-chat-click-stats/trunk/lvm-chat-click-stats.php
r3770681 r3770725 3 3 * Plugin Name: LVM Chat Click Stats 4 4 * Description: Counts every click on the WhatsApp links and buttons of your site, with no setup. See clicks per day, page, source and link right from your dashboard. 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Requires at least: 6.2 7 7 * Requires PHP: 7.4 … … 20 20 } 21 21 22 define( 'CSWA_VERSION', '1.0. 0' );22 define( 'CSWA_VERSION', '1.0.1' ); 23 23 define( 'CSWA_FILE', __FILE__ ); 24 24 define( 'CSWA_DIR', plugin_dir_path( __FILE__ ) ); -
lvm-chat-click-stats/trunk/readme.txt
r3770681 r3770725 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 43 43 **Privacy first** 44 44 45 No cookies, no IP addresses, no personal data, nothing sent to external servers. Everything stays in your WordPress database. Clicks by administrators are ignored by default, and old data is deleted automatically after the number of days you choose. 45 No cookies, no IP addresses, no personal data, nothing sent to external servers. Everything stays in your WordPress database. Clicks by administrators are ignored by default, and old data is deleted automatically after the number of days you choose. Your statistics are kept if you uninstall and reinstall the plugin, unless you choose otherwise in Settings. 46 46 47 47 **Lightweight** … … 102 102 == Changelog == 103 103 104 = 1.0.1 = 105 * Tracker status check now looks for the script tag id, so it also works when LiteSpeed, WP Rocket or Autoptimize defer or combine scripts. 106 * Uninstalling no longer deletes click data by default; a new option in Settings lets you opt in to a full cleanup. 107 104 108 = 1.0.0 = 105 109 * First release. … … 107 111 == Upgrade Notice == 108 112 109 = 1.0. 0=110 Fi rst release.113 = 1.0.1 = 114 Fixes a false "tracker missing" warning on sites with cache or CDN. -
lvm-chat-click-stats/trunk/uninstall.php
r3770681 r3770725 12 12 global $wpdb; 13 13 14 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- uninstall cleanup. 15 $ wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $wpdb->prefix . 'cswa_clicks' ));14 $cswa_settings = get_option( 'cswa_settings', array() ); 15 $cswa_wipe = is_array( $cswa_settings ) && ! empty( $cswa_settings['delete_on_uninstall'] ); 16 16 17 delete_option( 'cswa_settings' ); 18 delete_option( 'cswa_db_version' ); 17 // Click data is kept unless the user opted in (Settings → Delete all data), so reinstalling never loses history. 18 if ( $cswa_wipe ) { 19 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- uninstall cleanup. 20 $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $wpdb->prefix . 'cswa_clicks' ) ); 21 delete_option( 'cswa_settings' ); 22 delete_option( 'cswa_db_version' ); 23 } 24 19 25 wp_clear_scheduled_hook( 'cswa_daily_cleanup' ); 20 26
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)