Skip to content

Commit

Permalink
v 0.8.1
Browse files Browse the repository at this point in the history
- Update lang files.
- Better UX for action filter.
  • Loading branch information
Darklg committed Apr 28, 2024
1 parent c840d2a commit 2897551
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lang/wpuerrorlogs-fr_FR.l10n.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['Make sense of your log files'=>'Donnez un sens à vos fichiers logs','Settings'=>'Réglages','Count'=>'Nombre','Date'=>'Date','Type'=>'Type','Text'=>'Texte','Filter results'=>'Filtrer les résultats','Check the last :'=>'Vérifiez les derniers :','1 day'=>'1 jour','%s days'=>'%s jours','Search in errors'=>'Rechercher dans les erreurs','Search'=>'Rechercher','Top errors'=>'Principales erreurs','No errors at the moment.'=>'Pas d’erreurs pour le moment.','Latest errors'=>'Dernières erreurs','Latest fatal errors'=>'Dernières erreurs fatales','Full error'=>'Erreur complète'],'language'=>'fr_FR','x-generator'=>'Poedit 3.4.2'];
12 changes: 8 additions & 4 deletions wpuerrorlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://github.com/WordPressUtilities/wpuerrorlogs
Update URI: https://github.com/WordPressUtilities/wpuerrorlogs
Description: Make sense of your log files
Version: 0.8.0
Version: 0.8.1
Author: Darklg
Author URI: https://github.com/Darklg
Text Domain: wpuerrorlogs
Expand All @@ -23,7 +23,7 @@
class WPUErrorLogs {
public $settings_update;
private $number_of_days = 10;
private $plugin_version = '0.8.0';
private $plugin_version = '0.8.1';
private $plugin_settings = array(
'id' => 'wpuerrorlogs',
'name' => 'WPU Error Logs'
Expand Down Expand Up @@ -116,17 +116,18 @@ public function page_content__main() {
'text' => __('Text', 'wpuerrorlogs')
);

echo '<details>';
echo '<details ' . ($search || isset($_GET['has_action']) ? 'open' : '') . '>';
echo '<summary>' . __('Filter results', 'wpuerrorlogs') . '</summary>';

/* Select number of days */
echo '<p>';
echo '<label for="wpuerrorlogs_switch_day">' . __('Check the last :', 'wpuerrorlogs') . '</label><br />';
echo '<select name="number_of_days" id="wpuerrorlogs_switch_day" onchange="document.location.href=\'' . $this->adminpages->get_page_url('main') . '&number_of_days=\' + this.value;">';
echo '<select name="number_of_days" id="wpuerrorlogs_switch_day">';
for ($i = $this->number_of_days; $i > 0; $i--) {
echo '<option value="' . $i . '"' . ($number_of_days == $i ? ' selected' : '') . '>' . ($i < 2 ? __('1 day', 'wpuerrorlogs') : sprintf(__('%s days', 'wpuerrorlogs'), $i)) . '</option>';
}
echo '</select>';
echo '<input type="hidden" name="wpuerrorlogs_search_action" value="1">';
echo '</p>';

/* Search bar */
Expand Down Expand Up @@ -184,6 +185,9 @@ function page_action__main() {
if (isset($_POST['wpuerrorlogs_search'])) {
$new_url = add_query_arg('s', urlencode($_POST['wpuerrorlogs_search']), $new_url);
}
if (isset($_POST['wpuerrorlogs_search_action'])) {
$new_url = add_query_arg('has_action', 1, $new_url);
}

wp_redirect($new_url);
die;
Expand Down

0 comments on commit 2897551

Please sign in to comment.