Skip to content

Commit

Permalink
v 0.31.0
Browse files Browse the repository at this point in the history
- Add a setting to ignore some values of option_name.
  • Loading branch information
Darklg committed Dec 24, 2024
1 parent 59898e8 commit 8ab52cb
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 38 deletions.
2 changes: 1 addition & 1 deletion lang/wpuactionlogs-fr_FR.l10n.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['New Post'=>'Nouvel article','Back'=>'Retour','No'=>'Non','Yes'=>'Oui','Submit'=>'Envoyer','Items %s - %s'=>'Articles %s - %s','<strong>Filter :</strong> %s • <strong>Value :</strong> %s'=>'<strong>Filtre:</strong> %s • <strong>Valeur :</strong> %s','Reset'=>'Réinitialiser','Search'=>'Rechercher','Clear'=>'Vider','Show more details'=>'Afficher plus de détails','Edit'=>'Modifier','View'=>'Voir','Delete'=>'Supprimer','Delete filtered lines'=>'Supprimer les lignes filtrées','Export all'=>'Tout exporter','Export filtered view'=>'Exporter la vue filtrée','Settings'=>'Réglages','Check all'=>'Tout cocher','Uncheck all'=>'Tout décocher','Settings saved.'=>'Paramètres sauvegardés.','Upload New Media'=>'Envoi d\'un nouveau média','Language'=>'Langue','Save'=>'Sauvegarder','Currently online'=>'Actuellement en ligne','Useful logs about what’s happening on your website admin.'=>'Des logs utiles sur ce qui se passe dans l’administration de votre site Web.','Actions'=>'Actions','Active users'=>'Utilisateurs actifs','User ID'=>'ID de l’utilisateur','Action type'=>'Type d’action','Action detail'=>'Détails de l’action','Action source'=>'Source de l’action','Action interface'=>'Interface','Interfaces'=>'Interfaces','Extras'=>'Extras','Enable logs for “%s”'=>'Activer les journaux pour les « %s »','Disable logs on %s'=>'Désactiver les journaux pour %s','Posts'=>'Publications','Menus'=>'Menus','Terms'=>'Termes','Options'=>'Options','Emails'=>'Emails','Users'=>'Utilisateurs','Plugins'=>'Extensions','Disable on web'=>'Désactiver sur web','web interface'=>'l’interface web','Disable on cron'=>'Désactiver sur cron','cron interface'=>'l’interface cron','Disable on CLI'=>'Désactiver sur CLI','CLI interface'=>'l’interface CLI','Display active users'=>'Afficher les utilisateurs actifs','Purge after N days'=>'Purger après N jours','Logs will be automatically deleted after this number of days. Set to 0 to disable'=>'Les logs seront automatiquement supprimés après ce nombre de jours. Définir à 0 pour désactiver','Select an user: '=>'Sélectionnez un utilisateur : ','All values'=>'Toutes les valeurs','None'=>'Aucun','Select an interface: '=>'Sélectionnez une interface : ','ID'=>'ID','Date'=>'Date','Account'=>'Compte','Save Changes'=>'Sauvegarder','Purge old logs'=>'Purger les vieux journaux','Delete all logs'=>'Supprimer tous les journaux','All logs have been deleted'=>'Tous les journaux ont été supprimés','Old logs have been purged'=>'Les vieux journaux ont été purgés','No active users'=>'Aucun utilisateur actif','%s ago'=>'Il y a %s','Online here:'=>'En ligne ici :','(you)'=>'(vous)','Last action'=>'Dernière action'],'language'=>'fr_FR','x-generator'=>'Poedit 3.5'];
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['New Post'=>'Nouvel article','Back'=>'Retour','No'=>'Non','Yes'=>'Oui','Submit'=>'Envoyer','Items %s - %s'=>'Articles %s - %s','<strong>Filter :</strong> %s • <strong>Value :</strong> %s'=>'<strong>Filtre:</strong> %s • <strong>Valeur :</strong> %s','Reset'=>'Réinitialiser','Search'=>'Rechercher','Clear'=>'Vider','Show more details'=>'Afficher plus de détails','Edit'=>'Modifier','View'=>'Voir','Delete'=>'Supprimer','Delete filtered lines'=>'Supprimer les lignes filtrées','Export all'=>'Tout exporter','Export filtered view'=>'Exporter la vue filtrée','Settings'=>'Réglages','Check all'=>'Tout cocher','Uncheck all'=>'Tout décocher','Settings saved.'=>'Paramètres sauvegardés.','Upload New Media'=>'Envoi d\'un nouveau média','Language'=>'Langue','Save'=>'Sauvegarder','Currently online'=>'Actuellement en ligne','Useful logs about what’s happening on your website admin.'=>'Des logs utiles sur ce qui se passe dans l’administration de votre site Web.','Actions'=>'Actions','Active users'=>'Utilisateurs actifs','User ID'=>'ID de l’utilisateur','Action type'=>'Type d’action','Action detail'=>'Détails de l’action','Action source'=>'Source de l’action','Action interface'=>'Interface','Interfaces'=>'Interfaces','Extras'=>'Extras','Enable logs for “%s”'=>'Activer les journaux pour les « %s »','Disable logs on %s'=>'Désactiver les journaux pour %s','Posts'=>'Publications','Menus'=>'Menus','Terms'=>'Termes','Options'=>'Options','Emails'=>'Emails','Users'=>'Utilisateurs','Plugins'=>'Extensions','Disable on web'=>'Désactiver sur web','web interface'=>'l’interface web','Disable on cron'=>'Désactiver sur cron','cron interface'=>'l’interface cron','Disable on CLI'=>'Désactiver sur CLI','CLI interface'=>'l’interface CLI','Display active users'=>'Afficher les utilisateurs actifs','Purge after N days'=>'Purger après N jours','Logs will be automatically deleted after this number of days. Set to 0 to disable'=>'Les logs seront automatiquement supprimés après ce nombre de jours. Définir à 0 pour désactiver','Ignored options'=>'Options ignorées','Options that will not be logged : one option_name per line'=>'Options qui ne seront pas enregistrées : une option_name par ligne','Select an user: '=>'Sélectionnez un utilisateur : ','All values'=>'Toutes les valeurs','None'=>'Aucun','Select an interface: '=>'Sélectionnez une interface : ','ID'=>'ID','Date'=>'Date','Account'=>'Compte','Save Changes'=>'Sauvegarder','Purge old logs'=>'Purger les vieux journaux','Delete all logs'=>'Supprimer tous les journaux','All logs have been deleted'=>'Tous les journaux ont été supprimés','Old logs have been purged'=>'Les vieux journaux ont été purgés','No active users'=>'Aucun utilisateur actif','%s ago'=>'Il y a %s','Online here:'=>'En ligne ici :','(you)'=>'(vous)','Last action'=>'Dernière action'],'language'=>'fr_FR','x-generator'=>'Poedit 3.5'];
Binary file modified lang/wpuactionlogs-fr_FR.mo
Binary file not shown.
52 changes: 30 additions & 22 deletions lang/wpuactionlogs-fr_FR.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: WPU Action Logs\n"
"POT-Creation-Date: 2024-12-14 22:16+0100\n"
"POT-Creation-Date: 2024-12-24 15:43+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -142,19 +142,19 @@ msgstr "Utilisateurs actifs"
msgid "User ID"
msgstr "ID de l’utilisateur"

#: wpuactionlogs.php:221 wpuactionlogs.php:430
#: wpuactionlogs.php:221 wpuactionlogs.php:436
msgid "Action type"
msgstr "Type d’action"

#: wpuactionlogs.php:225 wpuactionlogs.php:432
#: wpuactionlogs.php:225 wpuactionlogs.php:438
msgid "Action detail"
msgstr "Détails de l’action"

#: wpuactionlogs.php:230 wpuactionlogs.php:431
#: wpuactionlogs.php:230 wpuactionlogs.php:437
msgid "Action source"
msgstr "Source de l’action"

#: wpuactionlogs.php:234 wpuactionlogs.php:433
#: wpuactionlogs.php:234 wpuactionlogs.php:439
msgid "Action interface"
msgstr "Interface"

Expand Down Expand Up @@ -244,72 +244,80 @@ msgstr ""
"Les logs seront automatiquement supprimés après ce nombre de jours. Définir "
"à 0 pour désactiver"

#: wpuactionlogs.php:397
#: wpuactionlogs.php:341
msgid "Ignored options"
msgstr "Options ignorées"

#: wpuactionlogs.php:342
msgid "Options that will not be logged : one option_name per line"
msgstr "Options qui ne seront pas enregistrées : une option_name par ligne"

#: wpuactionlogs.php:403
msgid "Select an user: "
msgstr "Sélectionnez un utilisateur : "

#: wpuactionlogs.php:398 wpuactionlogs.php:415
#: wpuactionlogs.php:404 wpuactionlogs.php:421
msgid "All values"
msgstr "Toutes les valeurs"

#: wpuactionlogs.php:399
#: wpuactionlogs.php:405
msgid "None"
msgstr "Aucun"

#: wpuactionlogs.php:414
#: wpuactionlogs.php:420
msgid "Select an interface: "
msgstr "Sélectionnez une interface : "

#: wpuactionlogs.php:427
#: wpuactionlogs.php:433
msgid "ID"
msgstr "ID"

#: wpuactionlogs.php:428
#: wpuactionlogs.php:434
msgid "Date"
msgstr "Date"

#: wpuactionlogs.php:429
#: wpuactionlogs.php:435
msgid "Account"
msgstr "Compte"

#: wpuactionlogs.php:533
#: wpuactionlogs.php:539
msgid "Save Changes"
msgstr "Sauvegarder"

#: wpuactionlogs.php:542
#: wpuactionlogs.php:548
msgid "Purge old logs"
msgstr "Purger les vieux journaux"

#: wpuactionlogs.php:543
#: wpuactionlogs.php:549
msgid "Delete all logs"
msgstr "Supprimer tous les journaux"

#: wpuactionlogs.php:555
#: wpuactionlogs.php:561
msgid "All logs have been deleted"
msgstr "Tous les journaux ont été supprimés"

#: wpuactionlogs.php:560
#: wpuactionlogs.php:566
msgid "Old logs have been purged"
msgstr "Les vieux journaux ont été purgés"

#: wpuactionlogs.php:572 wpuactionlogs.php:596
#: wpuactionlogs.php:578 wpuactionlogs.php:602
msgid "No active users"
msgstr "Aucun utilisateur actif"

#: wpuactionlogs.php:584 wpuactionlogs.php:1132
#: wpuactionlogs.php:590 wpuactionlogs.php:1153
#, php-format
msgid "%s ago"
msgstr "Il y a %s"

#: wpuactionlogs.php:1025
#: wpuactionlogs.php:1046
msgid "Online here:"
msgstr "En ligne ici :"

#: wpuactionlogs.php:1032
#: wpuactionlogs.php:1053
msgid "(you)"
msgstr "(vous)"

#: wpuactionlogs.php:1120
#: wpuactionlogs.php:1141
msgid "Last action"
msgstr "Dernière action"

Expand Down
58 changes: 43 additions & 15 deletions wpuactionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://github.com/WordPressUtilities/wpuactionlogs
Update URI: https://github.com/WordPressUtilities/wpuactionlogs
Description: Useful logs about what’s happening on your website admin.
Version: 0.30.0
Version: 0.31.0
Author: Darklg
Author URI: https://darklg.me/
Text Domain: wpuactionlogs
Expand All @@ -26,7 +26,7 @@ class WPUActionLogs {
public $baseadmindatas;
public $settings_details;
public $settings;
private $plugin_version = '0.30.0';
private $plugin_version = '0.31.0';
private $transient_active_duration = 60;
private $plugin_settings = array(
'id' => 'wpuactionlogs',
Expand Down Expand Up @@ -336,6 +336,12 @@ public function load_settings() {
'help' => __('Logs will be automatically deleted after this number of days. Set to 0 to disable', 'wpuactionlogs'),
'type' => 'number',
'section' => 'extras'
),
'ignored_options' => array(
'label' => __('Ignored options', 'wpuactionlogs'),
'help' => __('Options that will not be logged : one option_name per line', 'wpuactionlogs'),
'type' => 'textarea',
'section' => 'extras'
)
);
require_once __DIR__ . '/inc/WPUBaseSettings/WPUBaseSettings.php';
Expand Down Expand Up @@ -801,23 +807,48 @@ public function action__options($option_name) {
return;
}

/* Excluded names */
$excluded_options = apply_filters('wpuactionlogs__action__options__excluded_options', array(
$excluded_options = array(
'cron',
'action_scheduler_lock_async-request-runner'
));
);

$excluded_options_start = array(
'rocket_partial_preload_batch_',
'_site_transient',
'_transient'
);

$excluded_options_end = array(
'_transient_timeout'
);

$ignored_options = $this->settings_obj->get_setting('ignored_options');
if ($ignored_options) {
$ignored_options = explode("\n", $ignored_options);
$ignored_options = array_map('trim', $ignored_options);
$ignored_options = array_filter($ignored_options);
foreach ($ignored_options as $option_name) {
if (substr($option_name, -1) == '*') {
$excluded_options_start[] = substr($option_name, 0, -1);
continue;
}
if (substr($option_name, 0, 1) == '*') {
$excluded_options_end[] = substr($option_name, 1);
continue;
}

$excluded_options[] = $option_name;
}
}

/* Excluded names */
$excluded_options = apply_filters('wpuactionlogs__action__options__excluded_options', $excluded_options);
if (in_array($option_name, $excluded_options)) {
return;
}

/* Excluded start */
$excluded_options_start = apply_filters('wpuactionlogs__action__options__excluded_options_start', array(
'rocket_partial_preload_batch_',
'_site_transient',
'_transient'
));

$excluded_options_start = apply_filters('wpuactionlogs__action__options__excluded_options_start', $excluded_options_start);
foreach ($excluded_options_start as $start) {
$start_length = strlen($start);
if (substr($option_name, 0, $start_length) == $start) {
Expand All @@ -826,10 +857,7 @@ public function action__options($option_name) {
}

/* Excluded end */
$excluded_options_end = apply_filters('wpuactionlogs__action__options__excluded_options_end', array(
'__cron_hook_lastexec'
));

$excluded_options_end = apply_filters('wpuactionlogs__action__options__excluded_options_end', $excluded_options_end);
foreach ($excluded_options_end as $end) {
$end_length = strlen($end);
if (substr($option_name, 0 - $end_length) == $end) {
Expand Down

0 comments on commit 8ab52cb

Please sign in to comment.