Changeset 3125910
- Timestamp:
- 07/26/2024 11:50:59 AM (20 months ago)
- Location:
- inazo-flamingo-automatically-delete-old-messages/trunk
- Files:
-
- 2 added
- 8 edited
-
inazo-flamingo-automatically-delete-old-messages.php (modified) (8 diffs)
-
languages/inazo-flamingo-auto-trash-en_EN.mo (modified) (previous)
-
languages/inazo-flamingo-auto-trash-en_EN.po (modified) (4 diffs)
-
languages/inazo-flamingo-auto-trash-en_US.mo (modified) (previous)
-
languages/inazo-flamingo-auto-trash-en_US.po (modified) (5 diffs)
-
languages/inazo-flamingo-auto-trash-fr_FR.mo (added)
-
languages/inazo-flamingo-auto-trash-fr_FR.po (added)
-
readme.txt (modified) (4 diffs)
-
uninstall.php (modified) (2 diffs)
-
view/add.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
inazo-flamingo-automatically-delete-old-messages/trunk/inazo-flamingo-automatically-delete-old-messages.php
r1729723 r3125910 3 3 Plugin Name: Inazo's flamingo automatically delete old messages 4 4 Description: This plugin help you to auto removed all information stored by flamingo. 5 Version: 1. 05 Version: 1.1 6 6 Author: Inazo 7 7 Author URI: https://www.kanjian.fr … … 24 24 class inazo_flamingo_auto_trash{ 25 25 26 const VERSION_IAAM = '1. 0';26 const VERSION_IAAM = '1.1'; 27 27 const PLUGIN_NAME = 'inazo_flamingo_auto_trash'; 28 28 … … 36 36 37 37 38 if (! wp_next_scheduled ( 'inazo_flamingo_auto_trash_cron_task_daily' )) 38 if (! wp_next_scheduled ( 'inazo_flamingo_auto_trash_cron_task_daily' )){ 39 39 wp_schedule_event(time(), 'hourly', 'inazo_flamingo_auto_trash_cron_task_daily'); 40 } 40 41 } 41 42 … … 51 52 add_option( self::PLUGIN_NAME.'_inbound_days', 365 ); 52 53 add_option( self::PLUGIN_NAME.'_outbound_days', 365 ); 54 add_option( self::PLUGIN_NAME.'_spam_days', 30 ); 53 55 54 56 } … … 90 92 $this->check_option_exists_and_update( self::PLUGIN_NAME.'_inbound_days', (integer) $_POST['days_inbound'] ); 91 93 $this->check_option_exists_and_update( self::PLUGIN_NAME.'_outbound_days', (integer) $_POST['days_outbound'] ); 94 $this->check_option_exists_and_update( self::PLUGIN_NAME.'_spam_days', (integer) $_POST['days_spam'] ); 92 95 93 96 include('view/modif-ok.php'); … … 112 115 * Suppression des contacts 113 116 */ 114 $nb_days_contact = get_option( 'inazo_flamingo_auto_trash_contact_days','365');117 $nb_days_contact = get_option(self::PLUGIN_NAME.'_contact_days','365'); 115 118 116 119 $sql = $wpdb->prepare('SELECT ID FROM '.$wpdb->prefix.'posts WHERE post_type="flamingo_contact" AND … … 130 133 * Suppression des inbound 131 134 */ 132 $nb_days_inbound = get_option( 'inazo_flamingo_auto_trash_inbound_days','365');135 $nb_days_inbound = get_option(self::PLUGIN_NAME.'_inbound_days','365'); 133 136 134 137 $sql = $wpdb->prepare('SELECT ID FROM '.$wpdb->prefix.'posts WHERE post_type="flamingo_inbound" AND … … 148 151 * Suppression des outbound 149 152 */ 150 $nb_days_outbound = get_option( 'inazo_flamingo_auto_trash_outbound_days','365');153 $nb_days_outbound = get_option(self::PLUGIN_NAME.'_outbound_days','365'); 151 154 152 155 $sql = $wpdb->prepare('SELECT ID FROM '.$wpdb->prefix.'posts WHERE post_type="flamingo_outbound" AND 153 156 ( TIMESTAMPDIFF(DAY, post_date, NOW()) ) >= %d', $nb_days_outbound); 157 158 $wpdb->query( $sql ); 159 160 if( $wpdb->num_rows > 0 ){ 161 162 foreach( $wpdb->get_results($sql, ARRAY_A) as $k => $v ){ 163 164 wp_delete_post($v['ID'], true); 165 } 166 } 167 168 /** 169 * Deleting spam 170 */ 171 $nb_days_spam = get_option(self::PLUGIN_NAME.'_spam_days','365'); 172 173 $sql = $wpdb->prepare(' 174 SELECT 175 DISTINCT(ID) 176 FROM '.$wpdb->prefix.'posts 177 178 INNER JOIN '.$wpdb->prefix.'postmeta as pm 179 180 WHERE post_type="flamingo_inbound" 181 AND ( TIMESTAMPDIFF(DAY, post_date, NOW()) ) >= %d 182 AND ( (pm.meta_key = "_submission_status" AND pm.meta_value ="spam") OR post_status="flamingo-spam" ) 183 LIMIT 0, 10000 184 ', $nb_days_spam); 154 185 155 186 $wpdb->query( $sql ); -
inazo-flamingo-automatically-delete-old-messages/trunk/languages/inazo-flamingo-auto-trash-en_EN.po
r1729704 r3125910 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 "Content-Transfer-Encoding: 8bit\n"5 3 "Project-Id-Version: Inazo Flamingo auto trash\n" 6 4 "POT-Creation-Date: \n" … … 8 6 "Last-Translator: \n" 9 7 "Language-Team: \n" 8 "Language: en\n" 10 9 "MIME-Version: 1.0\n" 11 "Language: en\n" 12 "X-Generator: Poedit 1.7.1\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3.4.4\n" 13 13 14 14 #. Text in function … … 20 20 #: add.php:19 21 21 msgid "Supprimer tous les contacts de plus de " 22 msgstr "Delete all contacts over "22 msgstr "Delete all contacts over " 23 23 24 24 #. Text in function … … 30 30 #: add.php:31 31 31 msgid "Supprimer tous les messages sortant de plus de " 32 msgstr "Delete all outgoing messages over" 32 msgstr "Delete all outgoing messages over " 33 34 #. Text in function 35 #: add.php:37 36 msgid "Supprimer tous les messages en spam de plus de " 37 msgstr "Delete all spam messages over " 33 38 34 39 #. Text in function -
inazo-flamingo-automatically-delete-old-messages/trunk/languages/inazo-flamingo-auto-trash-en_US.po
r1729704 r3125910 1 1 msgid "" 2 2 msgstr "" 3 "Content-Type: text/plain; charset=UTF-8\n"4 "Content-Transfer-Encoding: 8bit\n"5 3 "Project-Id-Version: Inazo Flamingo auto trash\n" 6 4 "POT-Creation-Date: \n" … … 8 6 "Last-Translator: \n" 9 7 "Language-Team: \n" 8 "Language: en\n" 10 9 "MIME-Version: 1.0\n" 11 "Language: en\n" 12 "X-Generator: Poedit 1.7.1\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 3.4.4\n" 13 13 14 14 #. Text in function … … 20 20 #: add.php:19 21 21 msgid "Supprimer tous les contacts de plus de " 22 msgstr "Delete all contacts over "22 msgstr "Delete all contacts over " 23 23 24 24 #. Text in function … … 30 30 #: add.php:31 31 31 msgid "Supprimer tous les messages sortant de plus de " 32 msgstr "Delete all outgoing messages over "32 msgstr "Delete all outgoing messages over " 33 33 34 34 #. Text in function … … 37 37 msgstr "days" 38 38 39 #. Text in function 40 #: add.php:37 41 msgid "Supprimer tous les messages en spam de plus de " 42 msgstr "Delete all spam messages over " 43 39 44 #. Text in echo 40 45 #: modif-ok.php:9 -
inazo-flamingo-automatically-delete-old-messages/trunk/readme.txt
r1787499 r3125910 4 4 Tags: flamingo, rgpd, gdpr, contact form 7, contact 5 5 Requires at least: 4.5.1 6 Tested up to: 4.9.17 Stable tag: 1. 06 Tested up to: 6.6.1 7 Stable tag: 1.1 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 22 22 - Shelf life of incoming messages 23 23 - Shelf life of outgoing messages 24 - Shelf life of spam messages (30 days by default) 24 25 - It automatically adds to the worpdress CRON natively 25 26 - Complete deletion of data ratachés to the posts of flamingo … … 33 34 - Durée de conservation des messages entrants 34 35 - Durée de conservation des messages sortants 36 - Durée de conservation des messages en spam (30 jours par défaut) 35 37 - Il s'ajoute automatiquement au CRON de worpdress de manière native 36 38 - Suppression complète des données ratachés aux posts de flamingo … … 41 43 == CHANGELOG == 42 44 45 = 1.1 = 46 Feature: 47 * Add auto trash config for spam messages, 30 days by default, like other it's configurable 48 * Adding limit to 10 000 for spam deletion, for avoid denial of service 49 50 Coding: 51 * Adjust some coding style (using variable where needed) 52 53 Translation: 54 * Add French translation 55 43 56 = 1.0 = 44 57 * init version -
inazo-flamingo-automatically-delete-old-messages/trunk/uninstall.php
r1729704 r3125910 7 7 8 8 9 if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit(); 9 if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ){ 10 11 exit(); 12 } 10 13 11 14 delete_option('inazo_flamingo_auto_trash_version'); … … 13 16 delete_option('inazo_flamingo_auto_trash_inbound_days'); 14 17 delete_option('inazo_flamingo_auto_trash_outbound_days'); 18 delete_option('inazo_flamingo_auto_trash_spam_days'); 15 19 16 20 wp_clear_scheduled_hook('inazo_flamingo_auto_trash_cron_task_daily'); -
inazo-flamingo-automatically-delete-old-messages/trunk/view/add.php
r1729704 r3125910 34 34 </p> 35 35 36 <p> 37 <label><?php echo __('Supprimer tous les messages en spam de plus de ','inazo-flamingo-auto-trash');?></label> 38 <input type="text" name="days_spam" value="<?php echo get_option('inazo_flamingo_auto_trash_spam_days','30'); ?>" required /> 39 <?php echo __('jours','inazo-flamingo-auto-trash');?> 40 </p> 41 36 42 <div class="clear"></div> 37 43 <p>
Note: See TracChangeset
for help on using the changeset viewer.