From 744b84dc708e63cd1c726c623740790aa099d221 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Mon, 19 Jun 2023 15:21:51 +0100 Subject: [PATCH] Move the settings to the 'media' section --- wp-mat.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wp-mat.php b/wp-mat.php index 315f5a2..bf9ecbe 100644 --- a/wp-mat.php +++ b/wp-mat.php @@ -3,7 +3,7 @@ * Plugin Name: wp-mat * Plugin URI: https://git.autistici.org/noblogs/wp-mat * Description: Process uploaded files through MAT - * Version: 0.1.1 + * Version: 0.1.2 * Author: Autistici/Inventati * Author URI: https://www.autistici.org/ * License: MIT @@ -38,7 +38,7 @@ class WP_Mat { // store the results into '$output_path'. function issue_cleanup_request($path, $mimetype, $output_path) { $upfile = new CURLFile($path, $mimetype, 'input'); - + $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, WP_MAT_ENDPOINT); curl_setopt($curl, CURLOPT_USERAGENT, 'Wordpress'); @@ -53,7 +53,7 @@ class WP_Mat { } curl_setopt($curl, CURLOPT_FILE, $fp); curl_setopt($curl, CURLOPT_BINARYTRANSFER, true); - + $ret = curl_exec($curl); fclose($fp); @@ -115,7 +115,7 @@ class WP_Mat { 'wpmat_settings_section', 'Metadata anonymization for uploads', array($this, 'settings_section_callback'), - 'writing' + 'media' ); // Add the field with the names and function to use for our new @@ -124,17 +124,18 @@ class WP_Mat { 'wpmat_disabled', 'Disable metadata anonymization', array($this, 'settings_field_callback'), - 'writing', + 'media', 'wpmat_settings_section' ); // Register our setting so that $_POST handling is done for us and // our callback function just has to echo the <input>. - register_setting('writing', 'wpmat_disabled'); + register_setting('media', 'wpmat_disabled'); } function settings_section_callback() { - echo('<p>Control whether uploaded files are run through metadata anonymization (using MAT2).</p>'); + echo('<p>Control whether uploaded files are run through metadata anonymization (using <a href="https://0xacab.org/jvoisin/mat2">MAT2</a>). '); + echo('This feature is enabled by default but it can be disabled in case you are experiencing problems uploading files.</p>'); } function settings_field_callback() { -- GitLab