2 Commits

Author SHA1 Message Date
38c1e569e6 prepare release 1.7.2 2024-06-06 20:29:05 +02:00
4290aed9ce fix: restore database cleanup functionality (#37) (#38)
The cleanup request was no longer precessed since we refactored the
settings page in v1.7.0 to use the WP settings API. Process the request
including nonce verification during page creation restores it.
2024-06-06 20:17:19 +02:00
5 changed files with 34 additions and 6 deletions

View File

@ -8,7 +8,7 @@
* Requires at least: 4.7
* Tested up to: 6.5
* Requires PHP: 5.5
* Stable tag: 1.7.1
* Stable tag: 1.7.2
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@ -93,6 +93,9 @@ Same for IPv6 prefixes like _2001:db8:a0b:12f0::/64_.
## Upgrade Notice ##
### 1.7.2 ###
This is a bugfix release to restore the manual cleanup function that was broken since 1.7.0.
### 1.7.1 ###
This is a service release with minor corrections. Recommended for all users. Tested up to 6.5.
@ -100,7 +103,10 @@ This is a service release with minor corrections. Recommended for all users. Tes
This is a service release with primarily internal rework. Tested up to 6.4 and PHP 8.3.
## Changelog ##
## Changelog
### 1.7.2 / 06.06.2024 ###
* Restore manual database cleanup functionality
### 1.7.1 / 24.03.2024 ###
* Fix HTML syntax for checkboxes on settings page

View File

@ -1,6 +1,6 @@
{
"name": "stklcode/statify-blacklist",
"version": "1.7.1",
"version": "1.7.2",
"description": "A filter extension for the famous Statify WordPress plugin",
"keywords": [
"wordpress",

View File

@ -170,6 +170,27 @@ class StatifyBlacklist_Settings extends StatifyBlacklist {
?>
<div class="wrap">
<h1><?php esc_html_e( 'Statify Filter', 'statify-blacklist' ); ?></h1>
<?php
if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' === $_SERVER['REQUEST_METHOD'] && ! empty( $_POST['cleanup'] ) ) {
// Database cleanup requested.
if ( isset( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'statify-blacklist-options' ) ) {
// Nonce verification successful, proceed with cleanup.
StatifyBlacklist_Admin::cleanup_database();
?>
<div class="notice notice-success is-dismissible">
<p><?php esc_html_e( 'Database cleanup successful', 'statify-blacklist' ); ?></p>
</div>
<?php
} else {
// Nonce verification failed.
?>
<div class="notice notice-error is-dismissible">
<p><?php esc_html_e( 'Database cleanup request failed', 'statify-blacklist' ); ?></p>
</div>
<?php
}
}
?>
<form id="statify-settings" method="post" action="options.php">
<?php
@ -178,7 +199,8 @@ class StatifyBlacklist_Settings extends StatifyBlacklist {
submit_button();
?>
<hr>
<input class="button-secondary" type="submit" name="cleanUp"
<input class="button-secondary" type="submit" name="cleanup"
formaction=""
value="<?php esc_html_e( 'CleanUp Database', 'statify-blacklist' ); ?>"
onclick="return confirm('<?php echo esc_js( __( 'Do you really want to apply filters to database? This cannot be undone.', 'statify-blacklist' ) ); ?>');">
<p class="description">

View File

@ -1,6 +1,6 @@
{
"name": "statify-blacklist",
"version": "1.7.1",
"version": "1.7.2",
"description": "A filter extension for the famous Statify WordPress plugin",
"author": "Stefan Kalscheuer",
"license": "GPL-2.0+"

View File

@ -10,7 +10,7 @@
* Plugin Name: Statify Filter
* Plugin URI: https://wordpress.org/plugins/statify-blacklist/
* Description: Extension for the Statify plugin to add customizable filters. (formerly "Statify Blacklist)
* Version: 1.7.1
* Version: 1.7.2
* Requires at least: 4.7
* Requires PHP: 5.5
* Requires Plugins: statify