Skip to content

Commit 139f170

Browse files
explicitly add referer to settings form
1 parent 63d4d0f commit 139f170

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/class-pruner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function run()
2828
global $wpdb;
2929

3030
$settings = get_settings();
31-
if ($settings['prune_data_after_months'] === 0) {
31+
if ($settings['prune_data_after_months'] <= 0) {
3232
return;
3333
}
3434

src/views/settings-page.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
<form method="POST" action="<?php echo esc_attr(add_query_arg(['koko_analytics_action' => 'save_settings'])); ?>">
4040
<?php wp_nonce_field('koko_analytics_save_settings'); ?>
41+
<?php wp_referer_field(); ?>
42+
4143
<div class="ka-margin-m">
4244
<label for="ka-exclude-user-roles" class="ka-settings--label"><?php esc_html_e('Exclude pageviews from these user roles', 'koko-analytics'); ?></label>
4345
<select id="ka-exclude-user-roles" multiple="" name="koko_analytics_settings[exclude_user_roles][]" style="min-height: <?php echo count($user_roles) * 30; ?>px; min-width: 240px;">

0 commit comments

Comments
 (0)