Version Description
(January 2015) =
- Fixed: Comments where not logged correctly.
- Fixed: Comments where not translated correctly.
- Updated: German translation updated.
Download this release
Release Info
Developer | eskapism |
Plugin | Simple History |
Version | 2.0.11 |
Comparing to | |
See all releases |
Code changes from version 2.0.10 to 2.0.11
- SimpleHistory.php +174 -175
- index.php +11 -11
- languages/simple-history-de_DE.mo +0 -0
- languages/simple-history-de_DE.po +135 -72
- languages/simple-history-sv_SE.mo +0 -0
- languages/simple-history-sv_SE.po +17 -17
- languages/simple-history.pot +20 -20
- loggers/SimpleCommentsLogger.php +15 -3
- loggers/SimpleUserLogger.php +47 -46
- readme.txt +14 -4
SimpleHistory.php
CHANGED
@@ -2,17 +2,17 @@
|
|
2 |
|
3 |
/**
|
4 |
* Main class for Simple History
|
5 |
-
*/
|
6 |
class SimpleHistory {
|
7 |
|
8 |
const NAME = "Simple History";
|
9 |
-
const VERSION = "2.0.
|
10 |
|
11 |
/**
|
12 |
* Capability required to view the history log
|
13 |
*/
|
14 |
private $view_history_capability;
|
15 |
-
|
16 |
/**
|
17 |
* Capability required to view and edit the settings page
|
18 |
*/
|
@@ -81,7 +81,7 @@ class SimpleHistory {
|
|
81 |
add_action( 'admin_menu', array($this, 'add_settings') );
|
82 |
|
83 |
add_action( 'admin_footer', array( $this, "add_js_templates" ) );
|
84 |
-
|
85 |
add_action( 'wp_dashboard_setup', array($this, 'add_dashboard_widget') );
|
86 |
|
87 |
add_action( 'admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
@@ -144,7 +144,7 @@ class SimpleHistory {
|
|
144 |
public function onAdminHead() {
|
145 |
|
146 |
if ( $this->is_on_our_own_pages() ) {
|
147 |
-
|
148 |
do_action( "simple_history/admin_head", $this );
|
149 |
|
150 |
}
|
@@ -154,7 +154,7 @@ class SimpleHistory {
|
|
154 |
public function onAdminFooter() {
|
155 |
|
156 |
if ( $this->is_on_our_own_pages() ) {
|
157 |
-
|
158 |
do_action( "simple_history/admin_footer", $this );
|
159 |
|
160 |
}
|
@@ -165,11 +165,11 @@ class SimpleHistory {
|
|
165 |
* Output JS templated into footer
|
166 |
*/
|
167 |
public function add_js_templates($hook) {
|
168 |
-
|
169 |
if ( $this->is_on_our_own_pages() ) {
|
170 |
|
171 |
?>
|
172 |
-
|
173 |
<script type="text/html" id="tmpl-simple-history-base">
|
174 |
|
175 |
<div class="SimpleHistory__waitingForFirstLoad">
|
@@ -191,22 +191,22 @@ class SimpleHistory {
|
|
191 |
</script>
|
192 |
|
193 |
<script type="text/html" id="tmpl-simple-history-logitems-pagination">
|
194 |
-
|
195 |
<!-- this uses the (almost) the same html as WP does -->
|
196 |
<div class="SimpleHistoryPaginationPages">
|
197 |
-
<!--
|
198 |
-
{{ data.page_rows_from }}–{{ data.page_rows_to }}
|
199 |
<span class="SimpleHistoryPaginationDisplayNum"> of {{ data.total_row_count }} </span>
|
200 |
-->
|
201 |
<span class="SimpleHistoryPaginationLinks">
|
202 |
-
<a
|
203 |
-
data-direction="first"
|
204 |
-
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--firstPage <# if ( data.api_args.paged <= 1 ) { #> disabled <# } #>"
|
205 |
-
title="{{ data.strings.goToTheFirstPage }}"
|
206 |
href="#">«</a>
|
207 |
-
<a
|
208 |
-
data-direction="prev"
|
209 |
-
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--prevPage <# if ( data.api_args.paged <= 1 ) { #> disabled <# } #>"
|
210 |
title="{{ data.strings.goToThePrevPage }}"
|
211 |
href="#">‹</a>
|
212 |
<span class="SimpleHistoryPaginationInput">
|
@@ -214,14 +214,14 @@ class SimpleHistory {
|
|
214 |
<?php _x("of", "page n of n", "simple-history") ?>
|
215 |
<span class="total-pages">{{ data.pages_count }}</span>
|
216 |
</span>
|
217 |
-
<a
|
218 |
-
data-direction="next"
|
219 |
-
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--nextPage <# if ( data.api_args.paged >= data.pages_count ) { #> disabled <# } #>"
|
220 |
title="{{ data.strings.goToTheNextPage }}"
|
221 |
href="#">›</a>
|
222 |
-
<a
|
223 |
-
data-direction="last"
|
224 |
-
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--lastPage <# if ( data.api_args.paged >= data.pages_count ) { #> disabled <# } #>"
|
225 |
title="{{ data.strings.goToTheLastPage }}"
|
226 |
href="#">»</a>
|
227 |
</span>
|
@@ -267,7 +267,7 @@ class SimpleHistory {
|
|
267 |
*
|
268 |
*/
|
269 |
public function api() {
|
270 |
-
|
271 |
global $wpdb;
|
272 |
|
273 |
// Fake slow answers
|
@@ -305,16 +305,16 @@ class SimpleHistory {
|
|
305 |
// API use SimpleHistoryLogQuery, so simply pass args on to that
|
306 |
$logQuery = new SimpleHistoryLogQuery();
|
307 |
$data = $logQuery->query($args);
|
308 |
-
|
309 |
$data["api_args"] = $args;
|
310 |
|
311 |
// Output can be array or HMTL
|
312 |
if ( isset( $args["format"] ) && "html" === $args["format"] ) {
|
313 |
-
|
314 |
$data["log_rows_raw"] = array();
|
315 |
|
316 |
foreach ($data["log_rows"] as $key => $oneLogRow) {
|
317 |
-
|
318 |
$args = array();
|
319 |
if ($type == "single") {
|
320 |
$args["type"] = "single";
|
@@ -325,7 +325,7 @@ class SimpleHistory {
|
|
325 |
}
|
326 |
|
327 |
} else {
|
328 |
-
|
329 |
$data["logRows"] = $logRows;
|
330 |
}
|
331 |
|
@@ -360,7 +360,7 @@ class SimpleHistory {
|
|
360 |
}
|
361 |
|
362 |
return $translated_text;
|
363 |
-
|
364 |
}
|
365 |
|
366 |
/**
|
@@ -380,20 +380,20 @@ class SimpleHistory {
|
|
380 |
}
|
381 |
|
382 |
return $translated_text;
|
383 |
-
|
384 |
}
|
385 |
|
386 |
/**
|
387 |
* Load language files.
|
388 |
* Uses the method described here:
|
389 |
* http://geertdedeckere.be/article/loading-wordpress-language-files-the-right-way
|
390 |
-
*
|
391 |
* @since 2.0
|
392 |
*/
|
393 |
public function load_plugin_textdomain() {
|
394 |
|
395 |
$domain = 'simple-history';
|
396 |
-
|
397 |
// The "plugin_locale" filter is also used in load_plugin_textdomain()
|
398 |
$locale = apply_filters('plugin_locale', get_locale(), $domain);
|
399 |
|
@@ -406,7 +406,7 @@ class SimpleHistory {
|
|
406 |
* Setup variables and things
|
407 |
*/
|
408 |
public function setupVariables() {
|
409 |
-
|
410 |
// Capability required to view history = for who will the History page be added
|
411 |
$this->view_history_capability = "edit_pages";
|
412 |
$this->view_history_capability = apply_filters("simple_history_view_history_capability", $this->view_history_capability);
|
@@ -425,10 +425,10 @@ class SimpleHistory {
|
|
425 |
* Adds default tabs to settings
|
426 |
*/
|
427 |
public function add_default_settings_tabs() {
|
428 |
-
|
429 |
// Add default settings tabs
|
430 |
$this->arr_settings_tabs = array(
|
431 |
-
|
432 |
array(
|
433 |
"slug" => "settings",
|
434 |
"name" => __("Settings", "simple-history"),
|
@@ -438,7 +438,7 @@ class SimpleHistory {
|
|
438 |
);
|
439 |
|
440 |
if ( defined("SIMPLE_HISTORY_DEV") && SIMPLE_HISTORY_DEV ) {
|
441 |
-
|
442 |
$arr_dev_tabs = array(
|
443 |
array(
|
444 |
"slug" => "log",
|
@@ -464,7 +464,7 @@ class SimpleHistory {
|
|
464 |
* and instantiates them
|
465 |
*/
|
466 |
public function loadLoggers() {
|
467 |
-
|
468 |
$loggersDir = __DIR__ . "/loggers/";
|
469 |
|
470 |
/**
|
@@ -489,14 +489,14 @@ class SimpleHistory {
|
|
489 |
* @since 2.0
|
490 |
*
|
491 |
* @param array $loggersFiles Array with filenames
|
492 |
-
*/
|
493 |
$loggersFiles = apply_filters("simple_history/loggers_files", $loggersFiles);
|
494 |
-
|
495 |
$arrLoggersToInstantiate = array();
|
496 |
foreach ( $loggersFiles as $oneLoggerFile) {
|
497 |
-
|
498 |
if ( basename($oneLoggerFile) == "SimpleLogger.php" ) {
|
499 |
-
|
500 |
// SimpleLogger is already loaded
|
501 |
|
502 |
} else {
|
@@ -506,7 +506,7 @@ class SimpleHistory {
|
|
506 |
}
|
507 |
|
508 |
$arrLoggersToInstantiate[] = basename($oneLoggerFile, ".php");
|
509 |
-
|
510 |
}
|
511 |
|
512 |
/**
|
@@ -515,11 +515,11 @@ class SimpleHistory {
|
|
515 |
* @since 2.0
|
516 |
*
|
517 |
* @param array $arrLoggersToInstantiate Array with class names
|
518 |
-
*/
|
519 |
$arrLoggersToInstantiate = apply_filters("simple_history/loggers_to_instantiate", $arrLoggersToInstantiate);
|
520 |
// Instantiate each logger
|
521 |
foreach ($arrLoggersToInstantiate as $oneLoggerName ) {
|
522 |
-
|
523 |
if ( ! class_exists($oneLoggerName) ) {
|
524 |
continue;
|
525 |
}
|
@@ -531,7 +531,7 @@ class SimpleHistory {
|
|
531 |
}
|
532 |
|
533 |
$loggerInstance->loaded();
|
534 |
-
|
535 |
// Tell gettext-filter to add untranslated messages
|
536 |
$this->doFilterGettext = true;
|
537 |
$this->doFilterGettext_currentLogger = $loggerInstance;
|
@@ -542,11 +542,11 @@ class SimpleHistory {
|
|
542 |
$this->doFilterGettext = false;
|
543 |
$this->doFilterGettext_currentLogger = null;
|
544 |
|
545 |
-
// LoggerInfo contains all messages, both translated an not, by key.
|
546 |
// Add messages to the loggerInstance
|
547 |
$loopNum = 0;
|
548 |
foreach ( $loggerInfo["messages"] as $message_key => $message ) {
|
549 |
-
|
550 |
$loggerInstance->messages[ $message_key ] = $loggerInstance->messages[ $loopNum ];
|
551 |
$loopNum++;
|
552 |
|
@@ -559,8 +559,8 @@ class SimpleHistory {
|
|
559 |
unset( $loggerInstance->messages[$key] );
|
560 |
}
|
561 |
}
|
562 |
-
}
|
563 |
-
|
564 |
// Add logger to array of loggers
|
565 |
$this->instantiatedLoggers[ $loggerInstance->slug ] = array(
|
566 |
"name" => $loggerInfo["name"],
|
@@ -580,7 +580,7 @@ class SimpleHistory {
|
|
580 |
* and instantiates them
|
581 |
*/
|
582 |
public function loadDropins() {
|
583 |
-
|
584 |
$dropinsDir = __DIR__ . "/dropins/";
|
585 |
|
586 |
/**
|
@@ -602,13 +602,13 @@ class SimpleHistory {
|
|
602 |
* @since 2.0
|
603 |
*
|
604 |
* @param array $dropinsFiles Array with filenames
|
605 |
-
*/
|
606 |
$dropinsFiles = apply_filters("simple_history/dropins_files", $dropinsFiles);
|
607 |
-
|
608 |
$arrDropinsToInstantiate = array();
|
609 |
|
610 |
foreach ( $dropinsFiles as $oneDropinFile ) {
|
611 |
-
|
612 |
// path/path/simplehistory/dropins/SimpleHistoryDonateDropin.php => SimpleHistoryDonateDropin
|
613 |
$oneDropinFileBasename = basename($oneDropinFile, ".php");
|
614 |
|
@@ -630,7 +630,7 @@ class SimpleHistory {
|
|
630 |
include_once($oneDropinFile);
|
631 |
|
632 |
$arrDropinsToInstantiate[] = $oneDropinFileBasename;
|
633 |
-
|
634 |
}
|
635 |
|
636 |
/**
|
@@ -639,12 +639,12 @@ class SimpleHistory {
|
|
639 |
* @since 2.0
|
640 |
*
|
641 |
* @param array $arrDropinsToInstantiate Array with class names
|
642 |
-
*/
|
643 |
$arrDropinsToInstantiate = apply_filters("simple_history/dropins_to_instantiate", $arrDropinsToInstantiate);
|
644 |
|
645 |
// Instantiate each dropin
|
646 |
foreach ($arrDropinsToInstantiate as $oneDropinName ) {
|
647 |
-
|
648 |
if ( ! class_exists( $oneDropinName ) ) {
|
649 |
continue;
|
650 |
}
|
@@ -658,7 +658,7 @@ class SimpleHistory {
|
|
658 |
}
|
659 |
|
660 |
/**
|
661 |
-
* Gets the pager size,
|
662 |
* i.e. the number of items to show on each page in the history
|
663 |
*
|
664 |
* @return int
|
@@ -679,24 +679,24 @@ class SimpleHistory {
|
|
679 |
return $pager_size;
|
680 |
|
681 |
}
|
682 |
-
|
683 |
|
684 |
/**
|
685 |
* Show a link to our settings page on the Plugins -> Installed Plugins screen
|
686 |
*/
|
687 |
function plugin_action_links($actions, $b, $c, $d) {
|
688 |
-
|
689 |
// Only add link if user has the right to view the settings page
|
690 |
if ( ! current_user_can($this->view_settings_capability) ) {
|
691 |
return $actions;
|
692 |
}
|
693 |
|
694 |
$settings_page_url = menu_page_url(SimpleHistory::SETTINGS_MENU_SLUG, 0);
|
695 |
-
|
696 |
$actions[] = "<a href='$settings_page_url'>" . __("Settings", "simple-history") . "</a>";
|
697 |
|
698 |
return $actions;
|
699 |
-
|
700 |
}
|
701 |
|
702 |
/**
|
@@ -705,11 +705,11 @@ class SimpleHistory {
|
|
705 |
* and a setting to show dashboard to be set
|
706 |
*/
|
707 |
function add_dashboard_widget() {
|
708 |
-
|
709 |
if ( $this->setting_show_on_dashboard() && current_user_can($this->view_history_capability) ) {
|
710 |
-
|
711 |
wp_add_dashboard_widget("simple_history_dashboard_widget", __("Simple History", 'simple-history'), array($this, "dashboard_widget_output"));
|
712 |
-
|
713 |
}
|
714 |
}
|
715 |
|
@@ -717,7 +717,7 @@ class SimpleHistory {
|
|
717 |
* Output html for the dashboard widget
|
718 |
*/
|
719 |
function dashboard_widget_output() {
|
720 |
-
|
721 |
$pager_size = $this->get_pager_size();
|
722 |
|
723 |
/**
|
@@ -738,13 +738,13 @@ class SimpleHistory {
|
|
738 |
<?php
|
739 |
|
740 |
}
|
741 |
-
|
742 |
function is_on_our_own_pages($hook = "") {
|
743 |
|
744 |
$current_screen = get_current_screen();
|
745 |
|
746 |
if ( $current_screen && $current_screen->base == "settings_page_" . SimpleHistory::SETTINGS_MENU_SLUG ) {
|
747 |
-
|
748 |
return true;
|
749 |
|
750 |
} else if ( $current_screen && $current_screen->base == "dashboard_page_simple_history_page" ) {
|
@@ -770,20 +770,20 @@ class SimpleHistory {
|
|
770 |
* Only adds scripts to pages where the log is shown or the settings page.
|
771 |
*/
|
772 |
function enqueue_admin_scripts($hook) {
|
773 |
-
|
774 |
if ( $this->is_on_our_own_pages() ) {
|
775 |
-
|
776 |
add_thickbox();
|
777 |
|
778 |
$plugin_url = plugin_dir_url(__FILE__);
|
779 |
-
wp_enqueue_style( "simple_history_styles", $plugin_url . "css/styles.css", false, SimpleHistory::VERSION );
|
780 |
wp_enqueue_script("simple_history_script", $plugin_url . "js/scripts.js", array("jquery", "backbone", "wp-util"), SimpleHistory::VERSION, true);
|
781 |
-
|
782 |
wp_enqueue_script("select2", $plugin_url . "/js/select2/select2.min.js", array("jquery"));
|
783 |
wp_enqueue_style("select2", $plugin_url . "/js/select2/select2.css");
|
784 |
|
785 |
// Translations that we use in JavaScript
|
786 |
-
wp_localize_script('simple_history_script', 'simple_history_script_vars', array(
|
787 |
'settingsConfirmClearLog' => __("Remove all log items?", 'simple-history'),
|
788 |
'pagination' => array(
|
789 |
'goToTheFirstPage' => __("Go to the first page", 'simple-history'),
|
@@ -812,7 +812,7 @@ class SimpleHistory {
|
|
812 |
* @param SimpleHistory $SimpleHistory This class.
|
813 |
*/
|
814 |
do_action("simple_history/enqueue_admin_scripts", $this);
|
815 |
-
|
816 |
}
|
817 |
|
818 |
}
|
@@ -820,7 +820,7 @@ class SimpleHistory {
|
|
820 |
function filter_option_page_capability($capability) {
|
821 |
return $capability;
|
822 |
}
|
823 |
-
|
824 |
/**
|
825 |
* Check if plugin version have changed, i.e. has been upgraded
|
826 |
* If upgrade is detected then maybe modify database and so on for that version
|
@@ -834,16 +834,16 @@ class SimpleHistory {
|
|
834 |
$table_name_contexts = $wpdb->prefix . SimpleHistory::DBTABLE_CONTEXTS;
|
835 |
$first_install = false;
|
836 |
|
837 |
-
// If no db_version is set then this
|
838 |
// is a version of Simple History < 0.4
|
839 |
// or it's a first install
|
840 |
// Fix database not using UTF-8
|
841 |
if ( false === $db_version ) {
|
842 |
-
|
843 |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
844 |
|
845 |
// Table creation, used to be in register_activation_hook
|
846 |
-
/*
|
847 |
$sql = "CREATE TABLE " . $table_name . " (
|
848 |
id int(10) NOT NULL AUTO_INCREMENT,
|
849 |
date datetime NOT NULL,
|
@@ -875,11 +875,11 @@ class SimpleHistory {
|
|
875 |
|
876 |
// Upgrade db / fix utf for varchars
|
877 |
dbDelta($sql);
|
878 |
-
|
879 |
// Fix UTF-8 for table
|
880 |
$sql = sprintf('alter table %1$s charset=utf8;', $table_name);
|
881 |
$wpdb->query($sql);
|
882 |
-
|
883 |
$db_version_prev = $db_version;
|
884 |
$db_version = 1;
|
885 |
|
@@ -890,10 +890,10 @@ class SimpleHistory {
|
|
890 |
"to_version" => $db_version
|
891 |
)
|
892 |
);*/
|
893 |
-
|
894 |
update_option("simple_history_db_version", $db_version);
|
895 |
|
896 |
-
// We are not 100% sure that this is a first install,
|
897 |
// but it is at least a very old version that is being updated
|
898 |
$first_install = true;
|
899 |
|
@@ -920,7 +920,7 @@ class SimpleHistory {
|
|
920 |
$arr_options = array(
|
921 |
array(
|
922 |
"name" => "simple_history_show_as_page",
|
923 |
-
"default_value" => 1
|
924 |
),
|
925 |
array(
|
926 |
"name" => "simple_history_show_on_dashboard",
|
@@ -929,7 +929,7 @@ class SimpleHistory {
|
|
929 |
);
|
930 |
|
931 |
foreach ($arr_options as $one_option) {
|
932 |
-
|
933 |
if ( false === ($option_value = get_option( $one_option["name"] ) ) ) {
|
934 |
|
935 |
// Value is not set in db, so set it to a default
|
@@ -971,7 +971,7 @@ class SimpleHistory {
|
|
971 |
KEY date (date),
|
972 |
KEY loggerdate (logger, date)
|
973 |
) CHARSET=utf8;";
|
974 |
-
|
975 |
dbDelta($sql);
|
976 |
|
977 |
// Add context table
|
@@ -996,11 +996,11 @@ class SimpleHistory {
|
|
996 |
// Update old items to use SimpleLegacyLogger
|
997 |
$sql = sprintf('
|
998 |
UPDATE %1$s
|
999 |
-
SET
|
1000 |
logger = "SimpleLegacyLogger",
|
1001 |
level = "info"
|
1002 |
WHERE logger IS NULL
|
1003 |
-
',
|
1004 |
$table_name
|
1005 |
);
|
1006 |
|
@@ -1013,11 +1013,11 @@ class SimpleHistory {
|
|
1013 |
} // db version 2 » 3
|
1014 |
|
1015 |
/**
|
1016 |
-
* If db version = 3
|
1017 |
* then we need to update database to allow null values for some old columns
|
1018 |
* that used to work in pre wp 4.1 beta, but since 4.1 wp uses STRICT_ALL_TABLES
|
1019 |
* WordPress Commit: https://github.com/WordPress/WordPress/commit/f17d168a0f72211a9bfd9d3fa680713069871bb6
|
1020 |
-
*
|
1021 |
* @since 2.0
|
1022 |
*/
|
1023 |
if ( 3 == intval($db_version) ) {
|
@@ -1032,28 +1032,28 @@ class SimpleHistory {
|
|
1032 |
MODIFY `user_id` int(10) NULL,
|
1033 |
MODIFY `object_id` int(10) NULL,
|
1034 |
MODIFY `object_name` varchar(255) NULL
|
1035 |
-
',
|
1036 |
$table_name
|
1037 |
);
|
1038 |
$wpdb->query( $sql );
|
1039 |
|
1040 |
$db_version_prev = $db_version;
|
1041 |
$db_version = 4;
|
1042 |
-
|
1043 |
update_option("simple_history_db_version", $db_version);
|
1044 |
|
1045 |
} // end db version 3 » 4
|
1046 |
|
1047 |
-
|
1048 |
} // end check_for_upgrade
|
1049 |
-
|
1050 |
/**
|
1051 |
* Greet users to version 2!
|
1052 |
*/
|
1053 |
public function addWelcomeLogMessage() {
|
1054 |
|
1055 |
SimpleLogger()->info(
|
1056 |
-
"Welcome to Simple History 2! Hope you will enjoy this plugin.
|
1057 |
Found bugs? Got great ideas? Send them to the plugin developer at par.thernstrom@gmail.com.",
|
1058 |
array(
|
1059 |
"_initiator" => SimpleLoggerLogInitiators::WORDPRESS
|
@@ -1077,9 +1077,9 @@ class SimpleHistory {
|
|
1077 |
/**
|
1078 |
* Output HTML for the settings page
|
1079 |
* Called from add_options_page
|
1080 |
-
*/
|
1081 |
function settings_page_output() {
|
1082 |
-
|
1083 |
$arr_settings_tabs = $this->getSettingsTabs();
|
1084 |
|
1085 |
?>
|
@@ -1089,7 +1089,7 @@ class SimpleHistory {
|
|
1089 |
<div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
|
1090 |
<?php _e("Simple History Settings", "simple-history") ?>
|
1091 |
</h2>
|
1092 |
-
|
1093 |
<?php
|
1094 |
$active_tab = isset( $_GET["selected-tab"] ) ? $_GET["selected-tab"] : "settings";
|
1095 |
$settings_base_url = menu_page_url(SimpleHistory::SETTINGS_MENU_SLUG, 0);
|
@@ -1100,9 +1100,9 @@ class SimpleHistory {
|
|
1100 |
foreach ( $arr_settings_tabs as $one_tab ) {
|
1101 |
|
1102 |
$tab_slug = $one_tab["slug"];
|
1103 |
-
|
1104 |
printf(
|
1105 |
-
'<a href="%3$s" class="nav-tab %4$s">%1$s</a>',
|
1106 |
$one_tab["name"], // 1
|
1107 |
$tab_slug, // 2
|
1108 |
add_query_arg("selected-tab", $tab_slug, $settings_base_url), // 3
|
@@ -1114,11 +1114,11 @@ class SimpleHistory {
|
|
1114 |
</h3>
|
1115 |
|
1116 |
<?php
|
1117 |
-
|
1118 |
// Output contents for selected tab
|
1119 |
$arr_active_tab = wp_filter_object_list( $arr_settings_tabs, array("slug" => $active_tab));
|
1120 |
$arr_active_tab = current($arr_active_tab);
|
1121 |
-
|
1122 |
// We must have found an active tab and it must have a callable function
|
1123 |
if ( ! $arr_active_tab || ! is_callable( $arr_active_tab["function"] ) ) {
|
1124 |
wp_die( __("No valid callback found", "simple-history") );
|
@@ -1134,23 +1134,23 @@ class SimpleHistory {
|
|
1134 |
|
1135 |
</div>
|
1136 |
<?php
|
1137 |
-
|
1138 |
}
|
1139 |
|
1140 |
public function settings_output_log() {
|
1141 |
-
|
1142 |
include( __DIR__ . "/templates/settings-log.php" );
|
1143 |
|
1144 |
}
|
1145 |
|
1146 |
public function settings_output_general() {
|
1147 |
-
|
1148 |
include( __DIR__ . "/templates/settings-general.php" );
|
1149 |
|
1150 |
}
|
1151 |
|
1152 |
public function settings_output_styles_example() {
|
1153 |
-
|
1154 |
include( __DIR__ . "/templates/settings-style-example.php" );
|
1155 |
|
1156 |
}
|
@@ -1161,7 +1161,7 @@ class SimpleHistory {
|
|
1161 |
* Called from add_sections_setting.
|
1162 |
*/
|
1163 |
function settings_section_output() {
|
1164 |
-
|
1165 |
}
|
1166 |
|
1167 |
|
@@ -1169,15 +1169,15 @@ class SimpleHistory {
|
|
1169 |
* Add pages (history page and settings page)
|
1170 |
*/
|
1171 |
function add_admin_pages() {
|
1172 |
-
|
1173 |
// Add a history page as a sub-page below the Dashboard menu item
|
1174 |
if ( $this->setting_show_as_page() ) {
|
1175 |
-
|
1176 |
add_dashboard_page(
|
1177 |
-
SimpleHistory::NAME,
|
1178 |
_x("Simple History", 'dashboard menu name', 'simple-history'),
|
1179 |
-
$this->view_history_capability,
|
1180 |
-
"simple_history_page",
|
1181 |
array($this, "history_page_output")
|
1182 |
);
|
1183 |
|
@@ -1190,10 +1190,10 @@ class SimpleHistory {
|
|
1190 |
if ($show_settings_page) {
|
1191 |
|
1192 |
add_options_page(
|
1193 |
-
__('Simple History Settings', "simple-history"),
|
1194 |
-
SimpleHistory::NAME,
|
1195 |
-
$this->view_settings_capability,
|
1196 |
-
SimpleHistory::SETTINGS_MENU_SLUG,
|
1197 |
array($this, 'settings_page_output')
|
1198 |
);
|
1199 |
|
@@ -1209,7 +1209,7 @@ class SimpleHistory {
|
|
1209 |
|
1210 |
// Clear the log if clear button was clicked in settings
|
1211 |
if ( isset( $_GET["simple_history_clear_log_nonce"] ) && wp_verify_nonce( $_GET["simple_history_clear_log_nonce"], 'simple_history_clear_log')) {
|
1212 |
-
|
1213 |
$this->clear_log();
|
1214 |
$msg = __("Cleared database", 'simple-history');
|
1215 |
add_settings_error( "simple_history_rss_feed_regenerate_secret", "simple_history_rss_feed_regenerate_secret", $msg, "updated" );
|
@@ -1225,9 +1225,9 @@ class SimpleHistory {
|
|
1225 |
// Will contain settings like where to show simple history and number of items
|
1226 |
$settings_section_general_id = self::SETTINGS_SECTION_GENERAL_ID;
|
1227 |
add_settings_section(
|
1228 |
-
$settings_section_general_id,
|
1229 |
-
"", // No title __("General", "simple-history"),
|
1230 |
-
array($this, "settings_section_output"),
|
1231 |
SimpleHistory::SETTINGS_MENU_SLUG // same slug as for options menu page
|
1232 |
);
|
1233 |
|
@@ -1237,7 +1237,7 @@ class SimpleHistory {
|
|
1237 |
|
1238 |
// Checkboxes for where to show simple history
|
1239 |
add_settings_field(
|
1240 |
-
"simple_history_show_where",
|
1241 |
__("Show history", "simple-history"),
|
1242 |
array($this, "settings_field_where_to_show"),
|
1243 |
SimpleHistory::SETTINGS_MENU_SLUG,
|
@@ -1250,7 +1250,7 @@ class SimpleHistory {
|
|
1250 |
|
1251 |
// Dropdown number if items to show
|
1252 |
add_settings_field(
|
1253 |
-
"simple_history_number_of_items",
|
1254 |
__("Number of items per page", "simple-history"),
|
1255 |
array($this, "settings_field_number_of_items"),
|
1256 |
SimpleHistory::SETTINGS_MENU_SLUG,
|
@@ -1297,7 +1297,7 @@ class SimpleHistory {
|
|
1297 |
?>
|
1298 |
|
1299 |
<div class="wrap SimpleHistoryWrap">
|
1300 |
-
|
1301 |
<h2 class="SimpleHistoryPageHeadline">
|
1302 |
<div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
|
1303 |
<?php echo _x("Simple History", 'history page headline', 'simple-history') ?>
|
@@ -1332,7 +1332,7 @@ class SimpleHistory {
|
|
1332 |
do_action( "simple_history/history_page/after_gui", $this );
|
1333 |
|
1334 |
?>
|
1335 |
-
|
1336 |
</div>
|
1337 |
|
1338 |
</div>
|
@@ -1342,13 +1342,13 @@ class SimpleHistory {
|
|
1342 |
}
|
1343 |
|
1344 |
/**
|
1345 |
-
* Get setting if plugin should be visible on dasboard.
|
1346 |
* Defaults to true
|
1347 |
*
|
1348 |
* @return bool
|
1349 |
*/
|
1350 |
function setting_show_on_dashboard() {
|
1351 |
-
|
1352 |
$show_on_dashboard = get_option("simple_history_show_on_dashboard", 1);
|
1353 |
$show_on_dashboard = apply_filters("simple_history_show_on_dashboard", $show_on_dashboard);
|
1354 |
return (bool) $show_on_dashboard;
|
@@ -1373,7 +1373,7 @@ class SimpleHistory {
|
|
1373 |
* Settings field for how many rows/items to show in log
|
1374 |
*/
|
1375 |
function settings_field_number_of_items() {
|
1376 |
-
|
1377 |
$current_pager_size = $this->get_pager_size();
|
1378 |
|
1379 |
?>
|
@@ -1401,15 +1401,15 @@ class SimpleHistory {
|
|
1401 |
$show_on_dashboard = $this->setting_show_on_dashboard();
|
1402 |
$show_as_page = $this->setting_show_as_page();
|
1403 |
?>
|
1404 |
-
|
1405 |
<input <?php echo $show_on_dashboard ? "checked='checked'" : "" ?> type="checkbox" value="1" name="simple_history_show_on_dashboard" id="simple_history_show_on_dashboard" class="simple_history_show_on_dashboard" />
|
1406 |
<label for="simple_history_show_on_dashboard"><?php _e("on the dashboard", 'simple-history') ?></label>
|
1407 |
|
1408 |
<br />
|
1409 |
-
|
1410 |
<input <?php echo $show_as_page ? "checked='checked'" : "" ?> type="checkbox" value="1" name="simple_history_show_as_page" id="simple_history_show_as_page" class="simple_history_show_as_page" />
|
1411 |
<label for="simple_history_show_as_page"><?php _e("as a page under the dashboard menu", 'simple-history') ?></label>
|
1412 |
-
|
1413 |
<?php
|
1414 |
}
|
1415 |
|
@@ -1417,7 +1417,7 @@ class SimpleHistory {
|
|
1417 |
* Settings section to clear database
|
1418 |
*/
|
1419 |
function settings_field_clear_log() {
|
1420 |
-
|
1421 |
$clear_link = add_query_arg("", "");
|
1422 |
$clear_link = wp_nonce_url( $clear_link, "simple_history_clear_log", "simple_history_clear_log_nonce" );
|
1423 |
$clear_days = $this->get_clear_history_interval();
|
@@ -1434,7 +1434,7 @@ class SimpleHistory {
|
|
1434 |
}
|
1435 |
|
1436 |
/**
|
1437 |
-
* How old log entried are allowed to be.
|
1438 |
* 0 = don't delete old entries.
|
1439 |
*
|
1440 |
* @return int Number of days.
|
@@ -1456,11 +1456,11 @@ class SimpleHistory {
|
|
1456 |
function clear_log() {
|
1457 |
|
1458 |
global $wpdb;
|
1459 |
-
|
1460 |
$tableprefix = $wpdb->prefix;
|
1461 |
$simple_history_table = SimpleHistory::DBTABLE;
|
1462 |
$simple_history_context_table = SimpleHistory::DBTABLE_CONTEXTS;
|
1463 |
-
|
1464 |
$sql = "DELETE FROM {$tableprefix}{$simple_history_table}";
|
1465 |
$wpdb->query($sql);
|
1466 |
|
@@ -1504,11 +1504,11 @@ class SimpleHistory {
|
|
1504 |
* Uses the getLogRowPlainTextOutput of the logger that logged the row
|
1505 |
* with fallback to SimpleLogger if logger is not available
|
1506 |
*
|
1507 |
-
* @param array $row
|
1508 |
* @return string
|
1509 |
*/
|
1510 |
public function getLogRowPlainTextOutput($row) {
|
1511 |
-
|
1512 |
$row_logger = $row->logger;
|
1513 |
$logger = null;
|
1514 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
@@ -1516,7 +1516,7 @@ class SimpleHistory {
|
|
1516 |
if ( ! isset( $row->context["_message_key"] ) ) {
|
1517 |
$row->context["_message_key"] = null;
|
1518 |
}
|
1519 |
-
|
1520 |
// Fallback to SimpleLogger if no logger exists for row
|
1521 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1522 |
$row_logger = "SimpleLogger";
|
@@ -1525,7 +1525,7 @@ class SimpleHistory {
|
|
1525 |
$logger = $this->instantiatedLoggers[ $row_logger ]["instance"];
|
1526 |
|
1527 |
return $logger->getLogRowPlainTextOutput( $row );
|
1528 |
-
|
1529 |
}
|
1530 |
|
1531 |
/**
|
@@ -1533,9 +1533,9 @@ class SimpleHistory {
|
|
1533 |
* Uses the getLogRowHeaderOutput of the logger that logged the row
|
1534 |
* with fallback to SimpleLogger if logger is not available
|
1535 |
*
|
1536 |
-
* Loggers are discouraged to override this in the loggers,
|
1537 |
* because the output should be the same for all items in the gui
|
1538 |
-
*
|
1539 |
* @param array $row
|
1540 |
* @return string
|
1541 |
*/
|
@@ -1544,21 +1544,21 @@ class SimpleHistory {
|
|
1544 |
$row_logger = $row->logger;
|
1545 |
$logger = null;
|
1546 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1547 |
-
|
1548 |
// Fallback to SimpleLogger if no logger exists for row
|
1549 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1550 |
$row_logger = "SimpleLogger";
|
1551 |
}
|
1552 |
|
1553 |
-
$logger = $this->instantiatedLoggers[$row_logger]["instance"];
|
1554 |
|
1555 |
return $logger->getLogRowHeaderOutput( $row );
|
1556 |
|
1557 |
}
|
1558 |
|
1559 |
/**
|
1560 |
-
*
|
1561 |
-
*
|
1562 |
* @param array $row
|
1563 |
* @return string
|
1564 |
*/
|
@@ -1567,13 +1567,13 @@ class SimpleHistory {
|
|
1567 |
$row_logger = $row->logger;
|
1568 |
$logger = null;
|
1569 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1570 |
-
|
1571 |
// Fallback to SimpleLogger if no logger exists for row
|
1572 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1573 |
$row_logger = "SimpleLogger";
|
1574 |
}
|
1575 |
|
1576 |
-
$logger = $this->instantiatedLoggers[$row_logger]["instance"];
|
1577 |
|
1578 |
return $logger->getLogRowSenderImageOutput( $row );
|
1579 |
|
@@ -1584,13 +1584,13 @@ class SimpleHistory {
|
|
1584 |
$row_logger = $row->logger;
|
1585 |
$logger = null;
|
1586 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1587 |
-
|
1588 |
// Fallback to SimpleLogger if no logger exists for row
|
1589 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1590 |
$row_logger = "SimpleLogger";
|
1591 |
}
|
1592 |
|
1593 |
-
$logger = $this->instantiatedLoggers[$row_logger]["instance"];
|
1594 |
|
1595 |
return $logger->getLogRowDetailsOutput( $row );
|
1596 |
|
@@ -1599,11 +1599,11 @@ class SimpleHistory {
|
|
1599 |
/**
|
1600 |
* Works like json_encode, but adds JSON_PRETTY_PRINT if the current php version supports it
|
1601 |
* i.e. PHP is 5.4.0 or greated
|
1602 |
-
*
|
1603 |
* @param $value array|object|string|whatever that is json_encode'able
|
1604 |
*/
|
1605 |
public static function json_encode($value) {
|
1606 |
-
|
1607 |
return version_compare(PHP_VERSION, '5.4.0') >=0 ? json_encode($value, JSON_PRETTY_PRINT) : json_encode($value);
|
1608 |
|
1609 |
}
|
@@ -1631,10 +1631,10 @@ class SimpleHistory {
|
|
1631 |
|
1632 |
$args = wp_parse_args( $args, $defaults );
|
1633 |
|
1634 |
-
$header_html = $this->getLogRowHeaderOutput($oneLogRow);
|
1635 |
$plain_text_html = $this->getLogRowPlainTextOutput($oneLogRow);
|
1636 |
$sender_image_html = $this->getLogRowSenderImageOutput($oneLogRow);
|
1637 |
-
|
1638 |
// Details = for example thumbnail of media
|
1639 |
$details_html = trim( $this->getLogRowDetailsOutput($oneLogRow) );
|
1640 |
if ($details_html) {
|
@@ -1652,7 +1652,7 @@ class SimpleHistory {
|
|
1652 |
if ($occasions_count > 0) {
|
1653 |
|
1654 |
$occasions_html = '<div class="SimpleHistoryLogitem__occasions">';
|
1655 |
-
|
1656 |
$occasions_html .= '<a href="#" class="SimpleHistoryLogitem__occasionsLink">';
|
1657 |
$occasions_html .= sprintf(
|
1658 |
__('+%1$s more', "simple-history"),
|
@@ -1673,7 +1673,7 @@ class SimpleHistory {
|
|
1673 |
$occasions_count
|
1674 |
);
|
1675 |
$occasions_html .= '</span>';
|
1676 |
-
|
1677 |
$occasions_html .= '</div>';
|
1678 |
|
1679 |
}
|
@@ -1802,7 +1802,7 @@ class SimpleHistory {
|
|
1802 |
);
|
1803 |
|
1804 |
// Get the main message row.
|
1805 |
-
// Should be as plain as possible, like plain text
|
1806 |
// but with links to for example users and posts
|
1807 |
#SimpleLoggerFormatter::getRowTextOutput($oneLogRow);
|
1808 |
|
@@ -1821,13 +1821,13 @@ class SimpleHistory {
|
|
1821 |
}
|
1822 |
|
1823 |
public function getInstantiatedLoggerBySlug($slug = "") {
|
1824 |
-
|
1825 |
if (empty( $slug )) {
|
1826 |
return false;
|
1827 |
}
|
1828 |
-
|
1829 |
foreach ($this->getInstantiatedLoggers() as $one_logger) {
|
1830 |
-
|
1831 |
if ( $slug == $one_logger["instance"]->slug ) {
|
1832 |
return $one_logger["instance"];
|
1833 |
}
|
@@ -1860,7 +1860,7 @@ class SimpleHistory {
|
|
1860 |
$logger_capability = $one_logger["instance"]->getCapability();
|
1861 |
|
1862 |
//$arr_loggers_user_can_view = apply_filters("simple_history/loggers_user_can_read", $user_id, $arr_loggers_user_can_view);
|
1863 |
-
$user_can_read_logger = user_can( $user_id, $logger_capability );
|
1864 |
$user_can_read_logger = apply_filters("simple_history/loggers_user_can_read/can_read_single_logger", $user_can_read_logger, $one_logger["instance"], $user_id);
|
1865 |
|
1866 |
if ( $user_can_read_logger ) {
|
@@ -1883,16 +1883,16 @@ class SimpleHistory {
|
|
1883 |
if ( "sql" == $format ) {
|
1884 |
|
1885 |
$str_return = "(";
|
1886 |
-
|
1887 |
foreach ($arr_loggers_user_can_view as $one_logger) {
|
1888 |
-
|
1889 |
$str_return .= sprintf(
|
1890 |
'"%1$s", ',
|
1891 |
$one_logger["instance"]->slug
|
1892 |
);
|
1893 |
|
1894 |
}
|
1895 |
-
|
1896 |
$str_return = rtrim($str_return, " ,");
|
1897 |
$str_return .= ")";
|
1898 |
|
@@ -1907,7 +1907,7 @@ class SimpleHistory {
|
|
1907 |
|
1908 |
/**
|
1909 |
* Retrieve the avatar for a user who provided a user ID or email address.
|
1910 |
-
* A modified version of the function that comes with WordPress, but we
|
1911 |
* want to allow/show gravatars even if they are disabled in discussion settings
|
1912 |
*
|
1913 |
* @since 2.0
|
@@ -1986,7 +1986,7 @@ class SimpleHistory {
|
|
1986 |
* Uses filter "simple_history/history_page/before_gui" to output its contents
|
1987 |
*/
|
1988 |
public function output_quick_stats() {
|
1989 |
-
|
1990 |
global $wpdb;
|
1991 |
|
1992 |
// Get number of events today
|
@@ -1998,17 +1998,17 @@ class SimpleHistory {
|
|
1998 |
|
1999 |
$sql_loggers_in = $this->getLoggersThatUserCanRead(get_current_user_id(), "sql");
|
2000 |
$sql_users_today = sprintf('
|
2001 |
-
SELECT
|
2002 |
DISTINCT(c.value) AS user_id
|
2003 |
#h.id, h.logger, h.level, h.initiator, h.date
|
2004 |
FROM %3$s AS h
|
2005 |
-
INNER JOIN %4$s AS c
|
2006 |
ON c.history_id = h.id AND c.key = "_user_id"
|
2007 |
-
WHERE
|
2008 |
initiator = "wp_user"
|
2009 |
AND logger IN %1$s
|
2010 |
AND date > "%2$s"
|
2011 |
-
',
|
2012 |
$sql_loggers_in,
|
2013 |
date("Y-m-d H:i", strtotime("today")),
|
2014 |
$wpdb->prefix . SimpleHistory::DBTABLE,
|
@@ -2016,16 +2016,16 @@ class SimpleHistory {
|
|
2016 |
);
|
2017 |
|
2018 |
$results_users_today = $wpdb->get_results($sql_users_today);
|
2019 |
-
|
2020 |
?>
|
2021 |
<div class="SimpleHistoryQuickStats">
|
2022 |
<p>
|
2023 |
<?php
|
2024 |
-
|
2025 |
$msg_tmpl = "";
|
2026 |
|
2027 |
if ( $logResults["total_row_count"] == 0 ) {
|
2028 |
-
|
2029 |
$msg_tmpl = __("No events today so far.", "simple-history");
|
2030 |
|
2031 |
} elseif ( $logResults["total_row_count"] == 1 ) {
|
@@ -2037,8 +2037,8 @@ class SimpleHistory {
|
|
2037 |
$msg_tmpl = __('%1$d events today from %2$d users.', "simple-history");
|
2038 |
|
2039 |
} elseif ( $logResults["total_row_count"] > 0 && sizeof( $results_users_today ) == 1 ) {
|
2040 |
-
|
2041 |
-
$msg_tmpl = __('%1$d events today from one user.', "simple-history");
|
2042 |
|
2043 |
}
|
2044 |
|
@@ -2063,13 +2063,12 @@ class SimpleHistory {
|
|
2063 |
*/
|
2064 |
|
2065 |
}
|
2066 |
-
|
2067 |
?>
|
2068 |
</p>
|
2069 |
-
</div>
|
2070 |
<?php
|
2071 |
|
2072 |
}
|
2073 |
|
2074 |
} // class
|
2075 |
-
|
2 |
|
3 |
/**
|
4 |
* Main class for Simple History
|
5 |
+
*/
|
6 |
class SimpleHistory {
|
7 |
|
8 |
const NAME = "Simple History";
|
9 |
+
const VERSION = "2.0.11";
|
10 |
|
11 |
/**
|
12 |
* Capability required to view the history log
|
13 |
*/
|
14 |
private $view_history_capability;
|
15 |
+
|
16 |
/**
|
17 |
* Capability required to view and edit the settings page
|
18 |
*/
|
81 |
add_action( 'admin_menu', array($this, 'add_settings') );
|
82 |
|
83 |
add_action( 'admin_footer', array( $this, "add_js_templates" ) );
|
84 |
+
|
85 |
add_action( 'wp_dashboard_setup', array($this, 'add_dashboard_widget') );
|
86 |
|
87 |
add_action( 'admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
144 |
public function onAdminHead() {
|
145 |
|
146 |
if ( $this->is_on_our_own_pages() ) {
|
147 |
+
|
148 |
do_action( "simple_history/admin_head", $this );
|
149 |
|
150 |
}
|
154 |
public function onAdminFooter() {
|
155 |
|
156 |
if ( $this->is_on_our_own_pages() ) {
|
157 |
+
|
158 |
do_action( "simple_history/admin_footer", $this );
|
159 |
|
160 |
}
|
165 |
* Output JS templated into footer
|
166 |
*/
|
167 |
public function add_js_templates($hook) {
|
168 |
+
|
169 |
if ( $this->is_on_our_own_pages() ) {
|
170 |
|
171 |
?>
|
172 |
+
|
173 |
<script type="text/html" id="tmpl-simple-history-base">
|
174 |
|
175 |
<div class="SimpleHistory__waitingForFirstLoad">
|
191 |
</script>
|
192 |
|
193 |
<script type="text/html" id="tmpl-simple-history-logitems-pagination">
|
194 |
+
|
195 |
<!-- this uses the (almost) the same html as WP does -->
|
196 |
<div class="SimpleHistoryPaginationPages">
|
197 |
+
<!--
|
198 |
+
{{ data.page_rows_from }}–{{ data.page_rows_to }}
|
199 |
<span class="SimpleHistoryPaginationDisplayNum"> of {{ data.total_row_count }} </span>
|
200 |
-->
|
201 |
<span class="SimpleHistoryPaginationLinks">
|
202 |
+
<a
|
203 |
+
data-direction="first"
|
204 |
+
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--firstPage <# if ( data.api_args.paged <= 1 ) { #> disabled <# } #>"
|
205 |
+
title="{{ data.strings.goToTheFirstPage }}"
|
206 |
href="#">«</a>
|
207 |
+
<a
|
208 |
+
data-direction="prev"
|
209 |
+
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--prevPage <# if ( data.api_args.paged <= 1 ) { #> disabled <# } #>"
|
210 |
title="{{ data.strings.goToThePrevPage }}"
|
211 |
href="#">‹</a>
|
212 |
<span class="SimpleHistoryPaginationInput">
|
214 |
<?php _x("of", "page n of n", "simple-history") ?>
|
215 |
<span class="total-pages">{{ data.pages_count }}</span>
|
216 |
</span>
|
217 |
+
<a
|
218 |
+
data-direction="next"
|
219 |
+
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--nextPage <# if ( data.api_args.paged >= data.pages_count ) { #> disabled <# } #>"
|
220 |
title="{{ data.strings.goToTheNextPage }}"
|
221 |
href="#">›</a>
|
222 |
+
<a
|
223 |
+
data-direction="last"
|
224 |
+
class="button SimpleHistoryPaginationLink SimpleHistoryPaginationLink--lastPage <# if ( data.api_args.paged >= data.pages_count ) { #> disabled <# } #>"
|
225 |
title="{{ data.strings.goToTheLastPage }}"
|
226 |
href="#">»</a>
|
227 |
</span>
|
267 |
*
|
268 |
*/
|
269 |
public function api() {
|
270 |
+
|
271 |
global $wpdb;
|
272 |
|
273 |
// Fake slow answers
|
305 |
// API use SimpleHistoryLogQuery, so simply pass args on to that
|
306 |
$logQuery = new SimpleHistoryLogQuery();
|
307 |
$data = $logQuery->query($args);
|
308 |
+
|
309 |
$data["api_args"] = $args;
|
310 |
|
311 |
// Output can be array or HMTL
|
312 |
if ( isset( $args["format"] ) && "html" === $args["format"] ) {
|
313 |
+
|
314 |
$data["log_rows_raw"] = array();
|
315 |
|
316 |
foreach ($data["log_rows"] as $key => $oneLogRow) {
|
317 |
+
|
318 |
$args = array();
|
319 |
if ($type == "single") {
|
320 |
$args["type"] = "single";
|
325 |
}
|
326 |
|
327 |
} else {
|
328 |
+
|
329 |
$data["logRows"] = $logRows;
|
330 |
}
|
331 |
|
360 |
}
|
361 |
|
362 |
return $translated_text;
|
363 |
+
|
364 |
}
|
365 |
|
366 |
/**
|
380 |
}
|
381 |
|
382 |
return $translated_text;
|
383 |
+
|
384 |
}
|
385 |
|
386 |
/**
|
387 |
* Load language files.
|
388 |
* Uses the method described here:
|
389 |
* http://geertdedeckere.be/article/loading-wordpress-language-files-the-right-way
|
390 |
+
*
|
391 |
* @since 2.0
|
392 |
*/
|
393 |
public function load_plugin_textdomain() {
|
394 |
|
395 |
$domain = 'simple-history';
|
396 |
+
|
397 |
// The "plugin_locale" filter is also used in load_plugin_textdomain()
|
398 |
$locale = apply_filters('plugin_locale', get_locale(), $domain);
|
399 |
|
406 |
* Setup variables and things
|
407 |
*/
|
408 |
public function setupVariables() {
|
409 |
+
|
410 |
// Capability required to view history = for who will the History page be added
|
411 |
$this->view_history_capability = "edit_pages";
|
412 |
$this->view_history_capability = apply_filters("simple_history_view_history_capability", $this->view_history_capability);
|
425 |
* Adds default tabs to settings
|
426 |
*/
|
427 |
public function add_default_settings_tabs() {
|
428 |
+
|
429 |
// Add default settings tabs
|
430 |
$this->arr_settings_tabs = array(
|
431 |
+
|
432 |
array(
|
433 |
"slug" => "settings",
|
434 |
"name" => __("Settings", "simple-history"),
|
438 |
);
|
439 |
|
440 |
if ( defined("SIMPLE_HISTORY_DEV") && SIMPLE_HISTORY_DEV ) {
|
441 |
+
|
442 |
$arr_dev_tabs = array(
|
443 |
array(
|
444 |
"slug" => "log",
|
464 |
* and instantiates them
|
465 |
*/
|
466 |
public function loadLoggers() {
|
467 |
+
|
468 |
$loggersDir = __DIR__ . "/loggers/";
|
469 |
|
470 |
/**
|
489 |
* @since 2.0
|
490 |
*
|
491 |
* @param array $loggersFiles Array with filenames
|
492 |
+
*/
|
493 |
$loggersFiles = apply_filters("simple_history/loggers_files", $loggersFiles);
|
494 |
+
|
495 |
$arrLoggersToInstantiate = array();
|
496 |
foreach ( $loggersFiles as $oneLoggerFile) {
|
497 |
+
|
498 |
if ( basename($oneLoggerFile) == "SimpleLogger.php" ) {
|
499 |
+
|
500 |
// SimpleLogger is already loaded
|
501 |
|
502 |
} else {
|
506 |
}
|
507 |
|
508 |
$arrLoggersToInstantiate[] = basename($oneLoggerFile, ".php");
|
509 |
+
|
510 |
}
|
511 |
|
512 |
/**
|
515 |
* @since 2.0
|
516 |
*
|
517 |
* @param array $arrLoggersToInstantiate Array with class names
|
518 |
+
*/
|
519 |
$arrLoggersToInstantiate = apply_filters("simple_history/loggers_to_instantiate", $arrLoggersToInstantiate);
|
520 |
// Instantiate each logger
|
521 |
foreach ($arrLoggersToInstantiate as $oneLoggerName ) {
|
522 |
+
|
523 |
if ( ! class_exists($oneLoggerName) ) {
|
524 |
continue;
|
525 |
}
|
531 |
}
|
532 |
|
533 |
$loggerInstance->loaded();
|
534 |
+
|
535 |
// Tell gettext-filter to add untranslated messages
|
536 |
$this->doFilterGettext = true;
|
537 |
$this->doFilterGettext_currentLogger = $loggerInstance;
|
542 |
$this->doFilterGettext = false;
|
543 |
$this->doFilterGettext_currentLogger = null;
|
544 |
|
545 |
+
// LoggerInfo contains all messages, both translated an not, by key.
|
546 |
// Add messages to the loggerInstance
|
547 |
$loopNum = 0;
|
548 |
foreach ( $loggerInfo["messages"] as $message_key => $message ) {
|
549 |
+
|
550 |
$loggerInstance->messages[ $message_key ] = $loggerInstance->messages[ $loopNum ];
|
551 |
$loopNum++;
|
552 |
|
559 |
unset( $loggerInstance->messages[$key] );
|
560 |
}
|
561 |
}
|
562 |
+
}
|
563 |
+
|
564 |
// Add logger to array of loggers
|
565 |
$this->instantiatedLoggers[ $loggerInstance->slug ] = array(
|
566 |
"name" => $loggerInfo["name"],
|
580 |
* and instantiates them
|
581 |
*/
|
582 |
public function loadDropins() {
|
583 |
+
|
584 |
$dropinsDir = __DIR__ . "/dropins/";
|
585 |
|
586 |
/**
|
602 |
* @since 2.0
|
603 |
*
|
604 |
* @param array $dropinsFiles Array with filenames
|
605 |
+
*/
|
606 |
$dropinsFiles = apply_filters("simple_history/dropins_files", $dropinsFiles);
|
607 |
+
|
608 |
$arrDropinsToInstantiate = array();
|
609 |
|
610 |
foreach ( $dropinsFiles as $oneDropinFile ) {
|
611 |
+
|
612 |
// path/path/simplehistory/dropins/SimpleHistoryDonateDropin.php => SimpleHistoryDonateDropin
|
613 |
$oneDropinFileBasename = basename($oneDropinFile, ".php");
|
614 |
|
630 |
include_once($oneDropinFile);
|
631 |
|
632 |
$arrDropinsToInstantiate[] = $oneDropinFileBasename;
|
633 |
+
|
634 |
}
|
635 |
|
636 |
/**
|
639 |
* @since 2.0
|
640 |
*
|
641 |
* @param array $arrDropinsToInstantiate Array with class names
|
642 |
+
*/
|
643 |
$arrDropinsToInstantiate = apply_filters("simple_history/dropins_to_instantiate", $arrDropinsToInstantiate);
|
644 |
|
645 |
// Instantiate each dropin
|
646 |
foreach ($arrDropinsToInstantiate as $oneDropinName ) {
|
647 |
+
|
648 |
if ( ! class_exists( $oneDropinName ) ) {
|
649 |
continue;
|
650 |
}
|
658 |
}
|
659 |
|
660 |
/**
|
661 |
+
* Gets the pager size,
|
662 |
* i.e. the number of items to show on each page in the history
|
663 |
*
|
664 |
* @return int
|
679 |
return $pager_size;
|
680 |
|
681 |
}
|
682 |
+
|
683 |
|
684 |
/**
|
685 |
* Show a link to our settings page on the Plugins -> Installed Plugins screen
|
686 |
*/
|
687 |
function plugin_action_links($actions, $b, $c, $d) {
|
688 |
+
|
689 |
// Only add link if user has the right to view the settings page
|
690 |
if ( ! current_user_can($this->view_settings_capability) ) {
|
691 |
return $actions;
|
692 |
}
|
693 |
|
694 |
$settings_page_url = menu_page_url(SimpleHistory::SETTINGS_MENU_SLUG, 0);
|
695 |
+
|
696 |
$actions[] = "<a href='$settings_page_url'>" . __("Settings", "simple-history") . "</a>";
|
697 |
|
698 |
return $actions;
|
699 |
+
|
700 |
}
|
701 |
|
702 |
/**
|
705 |
* and a setting to show dashboard to be set
|
706 |
*/
|
707 |
function add_dashboard_widget() {
|
708 |
+
|
709 |
if ( $this->setting_show_on_dashboard() && current_user_can($this->view_history_capability) ) {
|
710 |
+
|
711 |
wp_add_dashboard_widget("simple_history_dashboard_widget", __("Simple History", 'simple-history'), array($this, "dashboard_widget_output"));
|
712 |
+
|
713 |
}
|
714 |
}
|
715 |
|
717 |
* Output html for the dashboard widget
|
718 |
*/
|
719 |
function dashboard_widget_output() {
|
720 |
+
|
721 |
$pager_size = $this->get_pager_size();
|
722 |
|
723 |
/**
|
738 |
<?php
|
739 |
|
740 |
}
|
741 |
+
|
742 |
function is_on_our_own_pages($hook = "") {
|
743 |
|
744 |
$current_screen = get_current_screen();
|
745 |
|
746 |
if ( $current_screen && $current_screen->base == "settings_page_" . SimpleHistory::SETTINGS_MENU_SLUG ) {
|
747 |
+
|
748 |
return true;
|
749 |
|
750 |
} else if ( $current_screen && $current_screen->base == "dashboard_page_simple_history_page" ) {
|
770 |
* Only adds scripts to pages where the log is shown or the settings page.
|
771 |
*/
|
772 |
function enqueue_admin_scripts($hook) {
|
773 |
+
|
774 |
if ( $this->is_on_our_own_pages() ) {
|
775 |
+
|
776 |
add_thickbox();
|
777 |
|
778 |
$plugin_url = plugin_dir_url(__FILE__);
|
779 |
+
wp_enqueue_style( "simple_history_styles", $plugin_url . "css/styles.css", false, SimpleHistory::VERSION );
|
780 |
wp_enqueue_script("simple_history_script", $plugin_url . "js/scripts.js", array("jquery", "backbone", "wp-util"), SimpleHistory::VERSION, true);
|
781 |
+
|
782 |
wp_enqueue_script("select2", $plugin_url . "/js/select2/select2.min.js", array("jquery"));
|
783 |
wp_enqueue_style("select2", $plugin_url . "/js/select2/select2.css");
|
784 |
|
785 |
// Translations that we use in JavaScript
|
786 |
+
wp_localize_script('simple_history_script', 'simple_history_script_vars', array(
|
787 |
'settingsConfirmClearLog' => __("Remove all log items?", 'simple-history'),
|
788 |
'pagination' => array(
|
789 |
'goToTheFirstPage' => __("Go to the first page", 'simple-history'),
|
812 |
* @param SimpleHistory $SimpleHistory This class.
|
813 |
*/
|
814 |
do_action("simple_history/enqueue_admin_scripts", $this);
|
815 |
+
|
816 |
}
|
817 |
|
818 |
}
|
820 |
function filter_option_page_capability($capability) {
|
821 |
return $capability;
|
822 |
}
|
823 |
+
|
824 |
/**
|
825 |
* Check if plugin version have changed, i.e. has been upgraded
|
826 |
* If upgrade is detected then maybe modify database and so on for that version
|
834 |
$table_name_contexts = $wpdb->prefix . SimpleHistory::DBTABLE_CONTEXTS;
|
835 |
$first_install = false;
|
836 |
|
837 |
+
// If no db_version is set then this
|
838 |
// is a version of Simple History < 0.4
|
839 |
// or it's a first install
|
840 |
// Fix database not using UTF-8
|
841 |
if ( false === $db_version ) {
|
842 |
+
|
843 |
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
844 |
|
845 |
// Table creation, used to be in register_activation_hook
|
846 |
+
/*
|
847 |
$sql = "CREATE TABLE " . $table_name . " (
|
848 |
id int(10) NOT NULL AUTO_INCREMENT,
|
849 |
date datetime NOT NULL,
|
875 |
|
876 |
// Upgrade db / fix utf for varchars
|
877 |
dbDelta($sql);
|
878 |
+
|
879 |
// Fix UTF-8 for table
|
880 |
$sql = sprintf('alter table %1$s charset=utf8;', $table_name);
|
881 |
$wpdb->query($sql);
|
882 |
+
|
883 |
$db_version_prev = $db_version;
|
884 |
$db_version = 1;
|
885 |
|
890 |
"to_version" => $db_version
|
891 |
)
|
892 |
);*/
|
893 |
+
|
894 |
update_option("simple_history_db_version", $db_version);
|
895 |
|
896 |
+
// We are not 100% sure that this is a first install,
|
897 |
// but it is at least a very old version that is being updated
|
898 |
$first_install = true;
|
899 |
|
920 |
$arr_options = array(
|
921 |
array(
|
922 |
"name" => "simple_history_show_as_page",
|
923 |
+
"default_value" => 1
|
924 |
),
|
925 |
array(
|
926 |
"name" => "simple_history_show_on_dashboard",
|
929 |
);
|
930 |
|
931 |
foreach ($arr_options as $one_option) {
|
932 |
+
|
933 |
if ( false === ($option_value = get_option( $one_option["name"] ) ) ) {
|
934 |
|
935 |
// Value is not set in db, so set it to a default
|
971 |
KEY date (date),
|
972 |
KEY loggerdate (logger, date)
|
973 |
) CHARSET=utf8;";
|
974 |
+
|
975 |
dbDelta($sql);
|
976 |
|
977 |
// Add context table
|
996 |
// Update old items to use SimpleLegacyLogger
|
997 |
$sql = sprintf('
|
998 |
UPDATE %1$s
|
999 |
+
SET
|
1000 |
logger = "SimpleLegacyLogger",
|
1001 |
level = "info"
|
1002 |
WHERE logger IS NULL
|
1003 |
+
',
|
1004 |
$table_name
|
1005 |
);
|
1006 |
|
1013 |
} // db version 2 » 3
|
1014 |
|
1015 |
/**
|
1016 |
+
* If db version = 3
|
1017 |
* then we need to update database to allow null values for some old columns
|
1018 |
* that used to work in pre wp 4.1 beta, but since 4.1 wp uses STRICT_ALL_TABLES
|
1019 |
* WordPress Commit: https://github.com/WordPress/WordPress/commit/f17d168a0f72211a9bfd9d3fa680713069871bb6
|
1020 |
+
*
|
1021 |
* @since 2.0
|
1022 |
*/
|
1023 |
if ( 3 == intval($db_version) ) {
|
1032 |
MODIFY `user_id` int(10) NULL,
|
1033 |
MODIFY `object_id` int(10) NULL,
|
1034 |
MODIFY `object_name` varchar(255) NULL
|
1035 |
+
',
|
1036 |
$table_name
|
1037 |
);
|
1038 |
$wpdb->query( $sql );
|
1039 |
|
1040 |
$db_version_prev = $db_version;
|
1041 |
$db_version = 4;
|
1042 |
+
|
1043 |
update_option("simple_history_db_version", $db_version);
|
1044 |
|
1045 |
} // end db version 3 » 4
|
1046 |
|
1047 |
+
|
1048 |
} // end check_for_upgrade
|
1049 |
+
|
1050 |
/**
|
1051 |
* Greet users to version 2!
|
1052 |
*/
|
1053 |
public function addWelcomeLogMessage() {
|
1054 |
|
1055 |
SimpleLogger()->info(
|
1056 |
+
"Welcome to Simple History 2! Hope you will enjoy this plugin.
|
1057 |
Found bugs? Got great ideas? Send them to the plugin developer at par.thernstrom@gmail.com.",
|
1058 |
array(
|
1059 |
"_initiator" => SimpleLoggerLogInitiators::WORDPRESS
|
1077 |
/**
|
1078 |
* Output HTML for the settings page
|
1079 |
* Called from add_options_page
|
1080 |
+
*/
|
1081 |
function settings_page_output() {
|
1082 |
+
|
1083 |
$arr_settings_tabs = $this->getSettingsTabs();
|
1084 |
|
1085 |
?>
|
1089 |
<div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
|
1090 |
<?php _e("Simple History Settings", "simple-history") ?>
|
1091 |
</h2>
|
1092 |
+
|
1093 |
<?php
|
1094 |
$active_tab = isset( $_GET["selected-tab"] ) ? $_GET["selected-tab"] : "settings";
|
1095 |
$settings_base_url = menu_page_url(SimpleHistory::SETTINGS_MENU_SLUG, 0);
|
1100 |
foreach ( $arr_settings_tabs as $one_tab ) {
|
1101 |
|
1102 |
$tab_slug = $one_tab["slug"];
|
1103 |
+
|
1104 |
printf(
|
1105 |
+
'<a href="%3$s" class="nav-tab %4$s">%1$s</a>',
|
1106 |
$one_tab["name"], // 1
|
1107 |
$tab_slug, // 2
|
1108 |
add_query_arg("selected-tab", $tab_slug, $settings_base_url), // 3
|
1114 |
</h3>
|
1115 |
|
1116 |
<?php
|
1117 |
+
|
1118 |
// Output contents for selected tab
|
1119 |
$arr_active_tab = wp_filter_object_list( $arr_settings_tabs, array("slug" => $active_tab));
|
1120 |
$arr_active_tab = current($arr_active_tab);
|
1121 |
+
|
1122 |
// We must have found an active tab and it must have a callable function
|
1123 |
if ( ! $arr_active_tab || ! is_callable( $arr_active_tab["function"] ) ) {
|
1124 |
wp_die( __("No valid callback found", "simple-history") );
|
1134 |
|
1135 |
</div>
|
1136 |
<?php
|
1137 |
+
|
1138 |
}
|
1139 |
|
1140 |
public function settings_output_log() {
|
1141 |
+
|
1142 |
include( __DIR__ . "/templates/settings-log.php" );
|
1143 |
|
1144 |
}
|
1145 |
|
1146 |
public function settings_output_general() {
|
1147 |
+
|
1148 |
include( __DIR__ . "/templates/settings-general.php" );
|
1149 |
|
1150 |
}
|
1151 |
|
1152 |
public function settings_output_styles_example() {
|
1153 |
+
|
1154 |
include( __DIR__ . "/templates/settings-style-example.php" );
|
1155 |
|
1156 |
}
|
1161 |
* Called from add_sections_setting.
|
1162 |
*/
|
1163 |
function settings_section_output() {
|
1164 |
+
|
1165 |
}
|
1166 |
|
1167 |
|
1169 |
* Add pages (history page and settings page)
|
1170 |
*/
|
1171 |
function add_admin_pages() {
|
1172 |
+
|
1173 |
// Add a history page as a sub-page below the Dashboard menu item
|
1174 |
if ( $this->setting_show_as_page() ) {
|
1175 |
+
|
1176 |
add_dashboard_page(
|
1177 |
+
SimpleHistory::NAME,
|
1178 |
_x("Simple History", 'dashboard menu name', 'simple-history'),
|
1179 |
+
$this->view_history_capability,
|
1180 |
+
"simple_history_page",
|
1181 |
array($this, "history_page_output")
|
1182 |
);
|
1183 |
|
1190 |
if ($show_settings_page) {
|
1191 |
|
1192 |
add_options_page(
|
1193 |
+
__('Simple History Settings', "simple-history"),
|
1194 |
+
SimpleHistory::NAME,
|
1195 |
+
$this->view_settings_capability,
|
1196 |
+
SimpleHistory::SETTINGS_MENU_SLUG,
|
1197 |
array($this, 'settings_page_output')
|
1198 |
);
|
1199 |
|
1209 |
|
1210 |
// Clear the log if clear button was clicked in settings
|
1211 |
if ( isset( $_GET["simple_history_clear_log_nonce"] ) && wp_verify_nonce( $_GET["simple_history_clear_log_nonce"], 'simple_history_clear_log')) {
|
1212 |
+
|
1213 |
$this->clear_log();
|
1214 |
$msg = __("Cleared database", 'simple-history');
|
1215 |
add_settings_error( "simple_history_rss_feed_regenerate_secret", "simple_history_rss_feed_regenerate_secret", $msg, "updated" );
|
1225 |
// Will contain settings like where to show simple history and number of items
|
1226 |
$settings_section_general_id = self::SETTINGS_SECTION_GENERAL_ID;
|
1227 |
add_settings_section(
|
1228 |
+
$settings_section_general_id,
|
1229 |
+
"", // No title __("General", "simple-history"),
|
1230 |
+
array($this, "settings_section_output"),
|
1231 |
SimpleHistory::SETTINGS_MENU_SLUG // same slug as for options menu page
|
1232 |
);
|
1233 |
|
1237 |
|
1238 |
// Checkboxes for where to show simple history
|
1239 |
add_settings_field(
|
1240 |
+
"simple_history_show_where",
|
1241 |
__("Show history", "simple-history"),
|
1242 |
array($this, "settings_field_where_to_show"),
|
1243 |
SimpleHistory::SETTINGS_MENU_SLUG,
|
1250 |
|
1251 |
// Dropdown number if items to show
|
1252 |
add_settings_field(
|
1253 |
+
"simple_history_number_of_items",
|
1254 |
__("Number of items per page", "simple-history"),
|
1255 |
array($this, "settings_field_number_of_items"),
|
1256 |
SimpleHistory::SETTINGS_MENU_SLUG,
|
1297 |
?>
|
1298 |
|
1299 |
<div class="wrap SimpleHistoryWrap">
|
1300 |
+
|
1301 |
<h2 class="SimpleHistoryPageHeadline">
|
1302 |
<div class="dashicons dashicons-backup SimpleHistoryPageHeadline__icon"></div>
|
1303 |
<?php echo _x("Simple History", 'history page headline', 'simple-history') ?>
|
1332 |
do_action( "simple_history/history_page/after_gui", $this );
|
1333 |
|
1334 |
?>
|
1335 |
+
|
1336 |
</div>
|
1337 |
|
1338 |
</div>
|
1342 |
}
|
1343 |
|
1344 |
/**
|
1345 |
+
* Get setting if plugin should be visible on dasboard.
|
1346 |
* Defaults to true
|
1347 |
*
|
1348 |
* @return bool
|
1349 |
*/
|
1350 |
function setting_show_on_dashboard() {
|
1351 |
+
|
1352 |
$show_on_dashboard = get_option("simple_history_show_on_dashboard", 1);
|
1353 |
$show_on_dashboard = apply_filters("simple_history_show_on_dashboard", $show_on_dashboard);
|
1354 |
return (bool) $show_on_dashboard;
|
1373 |
* Settings field for how many rows/items to show in log
|
1374 |
*/
|
1375 |
function settings_field_number_of_items() {
|
1376 |
+
|
1377 |
$current_pager_size = $this->get_pager_size();
|
1378 |
|
1379 |
?>
|
1401 |
$show_on_dashboard = $this->setting_show_on_dashboard();
|
1402 |
$show_as_page = $this->setting_show_as_page();
|
1403 |
?>
|
1404 |
+
|
1405 |
<input <?php echo $show_on_dashboard ? "checked='checked'" : "" ?> type="checkbox" value="1" name="simple_history_show_on_dashboard" id="simple_history_show_on_dashboard" class="simple_history_show_on_dashboard" />
|
1406 |
<label for="simple_history_show_on_dashboard"><?php _e("on the dashboard", 'simple-history') ?></label>
|
1407 |
|
1408 |
<br />
|
1409 |
+
|
1410 |
<input <?php echo $show_as_page ? "checked='checked'" : "" ?> type="checkbox" value="1" name="simple_history_show_as_page" id="simple_history_show_as_page" class="simple_history_show_as_page" />
|
1411 |
<label for="simple_history_show_as_page"><?php _e("as a page under the dashboard menu", 'simple-history') ?></label>
|
1412 |
+
|
1413 |
<?php
|
1414 |
}
|
1415 |
|
1417 |
* Settings section to clear database
|
1418 |
*/
|
1419 |
function settings_field_clear_log() {
|
1420 |
+
|
1421 |
$clear_link = add_query_arg("", "");
|
1422 |
$clear_link = wp_nonce_url( $clear_link, "simple_history_clear_log", "simple_history_clear_log_nonce" );
|
1423 |
$clear_days = $this->get_clear_history_interval();
|
1434 |
}
|
1435 |
|
1436 |
/**
|
1437 |
+
* How old log entried are allowed to be.
|
1438 |
* 0 = don't delete old entries.
|
1439 |
*
|
1440 |
* @return int Number of days.
|
1456 |
function clear_log() {
|
1457 |
|
1458 |
global $wpdb;
|
1459 |
+
|
1460 |
$tableprefix = $wpdb->prefix;
|
1461 |
$simple_history_table = SimpleHistory::DBTABLE;
|
1462 |
$simple_history_context_table = SimpleHistory::DBTABLE_CONTEXTS;
|
1463 |
+
|
1464 |
$sql = "DELETE FROM {$tableprefix}{$simple_history_table}";
|
1465 |
$wpdb->query($sql);
|
1466 |
|
1504 |
* Uses the getLogRowPlainTextOutput of the logger that logged the row
|
1505 |
* with fallback to SimpleLogger if logger is not available
|
1506 |
*
|
1507 |
+
* @param array $row
|
1508 |
* @return string
|
1509 |
*/
|
1510 |
public function getLogRowPlainTextOutput($row) {
|
1511 |
+
|
1512 |
$row_logger = $row->logger;
|
1513 |
$logger = null;
|
1514 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1516 |
if ( ! isset( $row->context["_message_key"] ) ) {
|
1517 |
$row->context["_message_key"] = null;
|
1518 |
}
|
1519 |
+
|
1520 |
// Fallback to SimpleLogger if no logger exists for row
|
1521 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1522 |
$row_logger = "SimpleLogger";
|
1525 |
$logger = $this->instantiatedLoggers[ $row_logger ]["instance"];
|
1526 |
|
1527 |
return $logger->getLogRowPlainTextOutput( $row );
|
1528 |
+
|
1529 |
}
|
1530 |
|
1531 |
/**
|
1533 |
* Uses the getLogRowHeaderOutput of the logger that logged the row
|
1534 |
* with fallback to SimpleLogger if logger is not available
|
1535 |
*
|
1536 |
+
* Loggers are discouraged to override this in the loggers,
|
1537 |
* because the output should be the same for all items in the gui
|
1538 |
+
*
|
1539 |
* @param array $row
|
1540 |
* @return string
|
1541 |
*/
|
1544 |
$row_logger = $row->logger;
|
1545 |
$logger = null;
|
1546 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1547 |
+
|
1548 |
// Fallback to SimpleLogger if no logger exists for row
|
1549 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1550 |
$row_logger = "SimpleLogger";
|
1551 |
}
|
1552 |
|
1553 |
+
$logger = $this->instantiatedLoggers[$row_logger]["instance"];
|
1554 |
|
1555 |
return $logger->getLogRowHeaderOutput( $row );
|
1556 |
|
1557 |
}
|
1558 |
|
1559 |
/**
|
1560 |
+
*
|
1561 |
+
*
|
1562 |
* @param array $row
|
1563 |
* @return string
|
1564 |
*/
|
1567 |
$row_logger = $row->logger;
|
1568 |
$logger = null;
|
1569 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1570 |
+
|
1571 |
// Fallback to SimpleLogger if no logger exists for row
|
1572 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1573 |
$row_logger = "SimpleLogger";
|
1574 |
}
|
1575 |
|
1576 |
+
$logger = $this->instantiatedLoggers[$row_logger]["instance"];
|
1577 |
|
1578 |
return $logger->getLogRowSenderImageOutput( $row );
|
1579 |
|
1584 |
$row_logger = $row->logger;
|
1585 |
$logger = null;
|
1586 |
$row->context = isset( $row->context ) && is_array( $row->context ) ? $row->context : array();
|
1587 |
+
|
1588 |
// Fallback to SimpleLogger if no logger exists for row
|
1589 |
if ( ! isset( $this->instantiatedLoggers[$row_logger] ) ) {
|
1590 |
$row_logger = "SimpleLogger";
|
1591 |
}
|
1592 |
|
1593 |
+
$logger = $this->instantiatedLoggers[$row_logger]["instance"];
|
1594 |
|
1595 |
return $logger->getLogRowDetailsOutput( $row );
|
1596 |
|
1599 |
/**
|
1600 |
* Works like json_encode, but adds JSON_PRETTY_PRINT if the current php version supports it
|
1601 |
* i.e. PHP is 5.4.0 or greated
|
1602 |
+
*
|
1603 |
* @param $value array|object|string|whatever that is json_encode'able
|
1604 |
*/
|
1605 |
public static function json_encode($value) {
|
1606 |
+
|
1607 |
return version_compare(PHP_VERSION, '5.4.0') >=0 ? json_encode($value, JSON_PRETTY_PRINT) : json_encode($value);
|
1608 |
|
1609 |
}
|
1631 |
|
1632 |
$args = wp_parse_args( $args, $defaults );
|
1633 |
|
1634 |
+
$header_html = $this->getLogRowHeaderOutput($oneLogRow);
|
1635 |
$plain_text_html = $this->getLogRowPlainTextOutput($oneLogRow);
|
1636 |
$sender_image_html = $this->getLogRowSenderImageOutput($oneLogRow);
|
1637 |
+
|
1638 |
// Details = for example thumbnail of media
|
1639 |
$details_html = trim( $this->getLogRowDetailsOutput($oneLogRow) );
|
1640 |
if ($details_html) {
|
1652 |
if ($occasions_count > 0) {
|
1653 |
|
1654 |
$occasions_html = '<div class="SimpleHistoryLogitem__occasions">';
|
1655 |
+
|
1656 |
$occasions_html .= '<a href="#" class="SimpleHistoryLogitem__occasionsLink">';
|
1657 |
$occasions_html .= sprintf(
|
1658 |
__('+%1$s more', "simple-history"),
|
1673 |
$occasions_count
|
1674 |
);
|
1675 |
$occasions_html .= '</span>';
|
1676 |
+
|
1677 |
$occasions_html .= '</div>';
|
1678 |
|
1679 |
}
|
1802 |
);
|
1803 |
|
1804 |
// Get the main message row.
|
1805 |
+
// Should be as plain as possible, like plain text
|
1806 |
// but with links to for example users and posts
|
1807 |
#SimpleLoggerFormatter::getRowTextOutput($oneLogRow);
|
1808 |
|
1821 |
}
|
1822 |
|
1823 |
public function getInstantiatedLoggerBySlug($slug = "") {
|
1824 |
+
|
1825 |
if (empty( $slug )) {
|
1826 |
return false;
|
1827 |
}
|
1828 |
+
|
1829 |
foreach ($this->getInstantiatedLoggers() as $one_logger) {
|
1830 |
+
|
1831 |
if ( $slug == $one_logger["instance"]->slug ) {
|
1832 |
return $one_logger["instance"];
|
1833 |
}
|
1860 |
$logger_capability = $one_logger["instance"]->getCapability();
|
1861 |
|
1862 |
//$arr_loggers_user_can_view = apply_filters("simple_history/loggers_user_can_read", $user_id, $arr_loggers_user_can_view);
|
1863 |
+
$user_can_read_logger = user_can( $user_id, $logger_capability );
|
1864 |
$user_can_read_logger = apply_filters("simple_history/loggers_user_can_read/can_read_single_logger", $user_can_read_logger, $one_logger["instance"], $user_id);
|
1865 |
|
1866 |
if ( $user_can_read_logger ) {
|
1883 |
if ( "sql" == $format ) {
|
1884 |
|
1885 |
$str_return = "(";
|
1886 |
+
|
1887 |
foreach ($arr_loggers_user_can_view as $one_logger) {
|
1888 |
+
|
1889 |
$str_return .= sprintf(
|
1890 |
'"%1$s", ',
|
1891 |
$one_logger["instance"]->slug
|
1892 |
);
|
1893 |
|
1894 |
}
|
1895 |
+
|
1896 |
$str_return = rtrim($str_return, " ,");
|
1897 |
$str_return .= ")";
|
1898 |
|
1907 |
|
1908 |
/**
|
1909 |
* Retrieve the avatar for a user who provided a user ID or email address.
|
1910 |
+
* A modified version of the function that comes with WordPress, but we
|
1911 |
* want to allow/show gravatars even if they are disabled in discussion settings
|
1912 |
*
|
1913 |
* @since 2.0
|
1986 |
* Uses filter "simple_history/history_page/before_gui" to output its contents
|
1987 |
*/
|
1988 |
public function output_quick_stats() {
|
1989 |
+
|
1990 |
global $wpdb;
|
1991 |
|
1992 |
// Get number of events today
|
1998 |
|
1999 |
$sql_loggers_in = $this->getLoggersThatUserCanRead(get_current_user_id(), "sql");
|
2000 |
$sql_users_today = sprintf('
|
2001 |
+
SELECT
|
2002 |
DISTINCT(c.value) AS user_id
|
2003 |
#h.id, h.logger, h.level, h.initiator, h.date
|
2004 |
FROM %3$s AS h
|
2005 |
+
INNER JOIN %4$s AS c
|
2006 |
ON c.history_id = h.id AND c.key = "_user_id"
|
2007 |
+
WHERE
|
2008 |
initiator = "wp_user"
|
2009 |
AND logger IN %1$s
|
2010 |
AND date > "%2$s"
|
2011 |
+
',
|
2012 |
$sql_loggers_in,
|
2013 |
date("Y-m-d H:i", strtotime("today")),
|
2014 |
$wpdb->prefix . SimpleHistory::DBTABLE,
|
2016 |
);
|
2017 |
|
2018 |
$results_users_today = $wpdb->get_results($sql_users_today);
|
2019 |
+
|
2020 |
?>
|
2021 |
<div class="SimpleHistoryQuickStats">
|
2022 |
<p>
|
2023 |
<?php
|
2024 |
+
|
2025 |
$msg_tmpl = "";
|
2026 |
|
2027 |
if ( $logResults["total_row_count"] == 0 ) {
|
2028 |
+
|
2029 |
$msg_tmpl = __("No events today so far.", "simple-history");
|
2030 |
|
2031 |
} elseif ( $logResults["total_row_count"] == 1 ) {
|
2037 |
$msg_tmpl = __('%1$d events today from %2$d users.', "simple-history");
|
2038 |
|
2039 |
} elseif ( $logResults["total_row_count"] > 0 && sizeof( $results_users_today ) == 1 ) {
|
2040 |
+
|
2041 |
+
$msg_tmpl = __('%1$d events today from one user.', "simple-history");
|
2042 |
|
2043 |
}
|
2044 |
|
2063 |
*/
|
2064 |
|
2065 |
}
|
2066 |
+
|
2067 |
?>
|
2068 |
</p>
|
2069 |
+
</div>
|
2070 |
<?php
|
2071 |
|
2072 |
}
|
2073 |
|
2074 |
} // class
|
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Simple History
|
4 |
Plugin URI: http://simple-history.com
|
5 |
Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
|
6 |
-
Version: 2.0.
|
7 |
Author: Pär Thernström
|
8 |
Author URI: http://simple-history.com/
|
9 |
License: GPL2
|
@@ -12,7 +12,7 @@ License: GPL2
|
|
12 |
/* Copyright 2014 Pär Thernström (email: par.thernstrom@gmail.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
-
it under the terms of the GNU General Public License, version 2, as
|
16 |
published by the Free Software Foundation.
|
17 |
|
18 |
This program is distributed in the hope that it will be useful,
|
@@ -26,7 +26,7 @@ License: GPL2
|
|
26 |
*/
|
27 |
|
28 |
if ( version_compare( phpversion(), "5.3", ">=") ) {
|
29 |
-
|
30 |
/** Load required files */
|
31 |
require_once(__DIR__ . "/SimpleHistory.php");
|
32 |
require_once(__DIR__ . "/SimpleHistoryLogQuery.php");
|
@@ -43,21 +43,21 @@ if ( version_compare( phpversion(), "5.3", ">=") ) {
|
|
43 |
$GLOBALS["simple_history"] = new SimpleHistory();
|
44 |
|
45 |
} else {
|
46 |
-
|
47 |
// user is running to old version of php, add admin notice about that
|
48 |
-
add_action( 'admin_notices', 'simple_history_old_version_admin_notice' );
|
49 |
|
50 |
function simple_history_old_version_admin_notice() {
|
51 |
?>
|
52 |
<div class="updated error">
|
53 |
-
<p><?php
|
54 |
-
printf(
|
55 |
-
__( 'Simple History is a great plugin, but to use it your server must have at least PHP 5.3 installed (you have version %s).', 'simple-history' ),
|
56 |
-
phpversion()
|
57 |
-
);
|
58 |
?></p>
|
59 |
</div>
|
60 |
-
<?php
|
61 |
|
62 |
}
|
63 |
|
3 |
Plugin Name: Simple History
|
4 |
Plugin URI: http://simple-history.com
|
5 |
Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
|
6 |
+
Version: 2.0.11
|
7 |
Author: Pär Thernström
|
8 |
Author URI: http://simple-history.com/
|
9 |
License: GPL2
|
12 |
/* Copyright 2014 Pär Thernström (email: par.thernstrom@gmail.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License, version 2, as
|
16 |
published by the Free Software Foundation.
|
17 |
|
18 |
This program is distributed in the hope that it will be useful,
|
26 |
*/
|
27 |
|
28 |
if ( version_compare( phpversion(), "5.3", ">=") ) {
|
29 |
+
|
30 |
/** Load required files */
|
31 |
require_once(__DIR__ . "/SimpleHistory.php");
|
32 |
require_once(__DIR__ . "/SimpleHistoryLogQuery.php");
|
43 |
$GLOBALS["simple_history"] = new SimpleHistory();
|
44 |
|
45 |
} else {
|
46 |
+
|
47 |
// user is running to old version of php, add admin notice about that
|
48 |
+
add_action( 'admin_notices', 'simple_history_old_version_admin_notice' );
|
49 |
|
50 |
function simple_history_old_version_admin_notice() {
|
51 |
?>
|
52 |
<div class="updated error">
|
53 |
+
<p><?php
|
54 |
+
printf(
|
55 |
+
__( 'Simple History is a great plugin, but to use it your server must have at least PHP 5.3 installed (you have version %s).', 'simple-history' ),
|
56 |
+
phpversion()
|
57 |
+
);
|
58 |
?></p>
|
59 |
</div>
|
60 |
+
<?php
|
61 |
|
62 |
}
|
63 |
|
languages/simple-history-de_DE.mo
CHANGED
Binary file
|
languages/simple-history-de_DE.po
CHANGED
@@ -4,13 +4,14 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple History 2.0.3\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/Simple-History\n"
|
7 |
-
"POT-Creation-Date: 2014-12-
|
|
|
|
|
|
|
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2014-12-30 10:10+0100\n"
|
12 |
-
"Last-Translator: Ralph Stenzel <ralph@klein-aber-fein.de>\n"
|
13 |
-
"Language-Team: Ralph Stenzel <ralph@klein-aber-fein.de>\n"
|
14 |
"X-Generator: Poedit 1.7.1\n"
|
15 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
16 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
@@ -19,135 +20,135 @@ msgstr ""
|
|
19 |
"X-Poedit-SourceCharset: UTF-8\n"
|
20 |
"X-Poedit-Basepath: ../\n"
|
21 |
"X-Textdomain-Support: yes\n"
|
22 |
-
"Language: de_DE\n"
|
23 |
"X-Poedit-SearchPath-0: .\n"
|
24 |
|
25 |
-
#: SimpleHistory.php:
|
26 |
msgid "Settings"
|
27 |
msgstr "Einstellungen"
|
28 |
|
29 |
-
#: SimpleHistory.php:
|
30 |
msgid "Log (debug)"
|
31 |
msgstr "Logbuch (Fehlersuche)"
|
32 |
|
33 |
-
#: SimpleHistory.php:
|
34 |
msgid "Styles example (debug)"
|
35 |
msgstr "Stil-Beispiel (Fehlersuche)"
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
40 |
|
41 |
-
#: SimpleHistory.php:
|
42 |
msgid "Remove all log items?"
|
43 |
msgstr "Alle Einträge im Logbuch entfernen?"
|
44 |
|
45 |
-
#: SimpleHistory.php:
|
46 |
msgid "Go to the first page"
|
47 |
msgstr "Gehe zur ersten Seite"
|
48 |
|
49 |
-
#: SimpleHistory.php:
|
50 |
msgid "Go to the previous page"
|
51 |
msgstr "Gehe zur vorherigen Seite"
|
52 |
|
53 |
-
#: SimpleHistory.php:
|
54 |
msgid "Go to the next page"
|
55 |
msgstr "Gehe zur nächsten Seite"
|
56 |
|
57 |
-
#: SimpleHistory.php:
|
58 |
msgid "Go to the last page"
|
59 |
msgstr "Gehe zur letzten Seite"
|
60 |
|
61 |
-
#: SimpleHistory.php:
|
62 |
msgid "Current page"
|
63 |
msgstr "Aktuelle Seite"
|
64 |
|
65 |
-
#: SimpleHistory.php:
|
66 |
msgid "Oups, the log could not be loaded right now."
|
67 |
msgstr "Hoppla, das Logbuch konnte eben nicht geladen werden."
|
68 |
|
69 |
-
#: SimpleHistory.php:
|
70 |
msgid "Your search did not match any history events."
|
71 |
msgstr "Deine Suche erbrachte keine Übereinstimmungen mit Ereignissen."
|
72 |
|
73 |
-
#: SimpleHistory.php:
|
74 |
msgid "Simple History Settings"
|
75 |
msgstr "Simple History Einstellungen"
|
76 |
|
77 |
-
#: SimpleHistory.php:
|
78 |
msgid "No valid callback found"
|
79 |
msgstr "Kein valider Rückruf gefunden"
|
80 |
|
81 |
-
#: SimpleHistory.php:
|
82 |
msgid "Cleared database"
|
83 |
msgstr "Datenbank geleert"
|
84 |
|
85 |
-
#: SimpleHistory.php:
|
86 |
msgid "Show history"
|
87 |
msgstr "Zeige Logbuch"
|
88 |
|
89 |
-
#: SimpleHistory.php:
|
90 |
msgid "Number of items per page"
|
91 |
msgstr "Zahl der Einträge pro Seite"
|
92 |
|
93 |
-
#: SimpleHistory.php:
|
94 |
msgid "Clear log"
|
95 |
msgstr "Logbuch leeren"
|
96 |
|
97 |
-
#: SimpleHistory.php:
|
98 |
msgid "on the dashboard"
|
99 |
msgstr "auf dem Dashboard"
|
100 |
|
101 |
-
#: SimpleHistory.php:
|
102 |
msgid "as a page under the dashboard menu"
|
103 |
msgstr "als eine Seite im Dashboard-Menü"
|
104 |
|
105 |
-
#: SimpleHistory.php:
|
106 |
msgid "Items in the database are automatically removed after %1$s days."
|
107 |
msgstr "Einträge in der Datenbank werden nach %1$s Tagen automatisch entfernt."
|
108 |
|
109 |
-
#: SimpleHistory.php:
|
110 |
msgid "Items in the database are kept forever."
|
111 |
msgstr "Einträge in der Datenbank werden auf ewig behalten."
|
112 |
|
113 |
-
#: SimpleHistory.php:
|
114 |
msgid "Clear log now"
|
115 |
msgstr "Logbuch jetzt leeren"
|
116 |
|
117 |
-
#: SimpleHistory.php:
|
118 |
msgid "+%1$s more"
|
119 |
msgstr "+%1$s mehr"
|
120 |
|
121 |
-
#: SimpleHistory.php:
|
122 |
msgid "Loading…"
|
123 |
msgstr "Lade..."
|
124 |
|
125 |
-
#: SimpleHistory.php:
|
126 |
msgid "Showing %1$s more"
|
127 |
msgstr "Zeige %1$s mehr"
|
128 |
|
129 |
-
#: SimpleHistory.php:
|
130 |
msgid "Context data"
|
131 |
msgstr "Kontext-Daten"
|
132 |
|
133 |
-
#: SimpleHistory.php:
|
134 |
-
msgid "This is potentially useful meta data that a logger
|
135 |
msgstr ""
|
136 |
"Dies sind potentiell nützliche Meta-Daten, die ein Logger abgespeichert hat."
|
137 |
|
138 |
-
#: SimpleHistory.php:
|
139 |
msgid "No events today so far."
|
140 |
msgstr "Heute sind noch keine Ereignisse aufgetreten."
|
141 |
|
142 |
-
#: SimpleHistory.php:
|
143 |
msgid "%1$d event today from one user."
|
144 |
msgstr "%1$d Ereignis heute von einem Benutzer."
|
145 |
|
146 |
-
#: SimpleHistory.php:
|
147 |
msgid "%1$d events today from %2$d users."
|
148 |
msgstr "%1$d Ereignisse heute von %2$d Benutzern."
|
149 |
|
150 |
-
#: SimpleHistory.php:
|
151 |
msgid "%1$d events today from one user."
|
152 |
msgstr "%1$d Ereignisse heute von einem Benutzer."
|
153 |
|
@@ -265,7 +266,7 @@ msgstr "Test-Daten (Fehlersuche)"
|
|
265 |
msgid "Stats"
|
266 |
msgstr "Statistiken"
|
267 |
|
268 |
-
#: index.php:
|
269 |
msgid ""
|
270 |
"Simple History is a great plugin, but to use it your server must have at "
|
271 |
"least PHP 5.3 installed (you have version %s)."
|
@@ -504,7 +505,7 @@ msgstr ""
|
|
504 |
#: loggers/SimpleUserLogger.php:24
|
505 |
msgid ""
|
506 |
"Failed to login with username \"{failed_login_username}\" because no user "
|
507 |
-
"with that username
|
508 |
msgstr ""
|
509 |
"Anmeldung mit dem Benutzernamen \"{failed_login_username}\" fehlgeschlagen, "
|
510 |
"weil kein Benutzer mit diesem Namen existiert"
|
@@ -539,19 +540,19 @@ msgstr ""
|
|
539 |
msgid "Deleted user {deleted_user_login} ({deleted_user_email})"
|
540 |
msgstr "Hat den Benutzer {deleted_user_login} ({deleted_user_email}) gelöscht"
|
541 |
|
542 |
-
#: loggers/SimpleUserLogger.php:
|
543 |
msgid "Edited <a href=\"{edit_profile_link}\">your profile</a>"
|
544 |
msgstr "Hat <a href=\"{edit_profile_link}\">Dein Profil</a> geändert"
|
545 |
|
546 |
-
#: loggers/SimpleUserLogger.php:
|
547 |
msgid "Edited <a href=\"{edit_profile_link}\">their profile</a>"
|
548 |
msgstr "Hat <a href=\"{edit_profile_link}\">deren Profil</a> geändert"
|
549 |
|
550 |
-
#: loggers/SimpleUserLogger.php:
|
551 |
msgid "Edited your profile"
|
552 |
msgstr "Hat Dein Profil geändert"
|
553 |
|
554 |
-
#: loggers/SimpleUserLogger.php:
|
555 |
msgid ""
|
556 |
"Edited the profile for user <a href="
|
557 |
"\"{edit_profile_link}\">{edited_user_login} ({edited_user_email})</a>"
|
@@ -609,10 +610,6 @@ msgstr ""
|
|
609 |
msgid "Deleted users are also included."
|
610 |
msgstr "Gelöschte Benutzer sind auch enthalten."
|
611 |
|
612 |
-
#. Plugin Name of the plugin/theme
|
613 |
-
msgid "Simple History"
|
614 |
-
msgstr "Simple History"
|
615 |
-
|
616 |
#. Plugin URI of the plugin/theme
|
617 |
msgid "http://simple-history.com"
|
618 |
msgstr "http://simple-history.com"
|
@@ -634,28 +631,28 @@ msgstr "Pär Thernström"
|
|
634 |
msgid "http://simple-history.com/"
|
635 |
msgstr "http://simple-history.com/"
|
636 |
|
637 |
-
#: SimpleHistory.php:
|
638 |
msgctxt ""
|
639 |
"Message visible while waiting for log to load from server the first time"
|
640 |
msgid "Loading history..."
|
641 |
msgstr "Lade Historie..."
|
642 |
|
643 |
-
#: SimpleHistory.php:
|
644 |
msgctxt "page n of n"
|
645 |
msgid "of"
|
646 |
msgstr "von"
|
647 |
|
648 |
-
#: SimpleHistory.php:
|
649 |
msgctxt "API: not enought arguments passed"
|
650 |
msgid "Not enough args specified"
|
651 |
msgstr "Nicht genügend Argumente angegeben"
|
652 |
|
653 |
-
#: SimpleHistory.php:
|
654 |
msgctxt "dashboard menu name"
|
655 |
msgid "Simple History"
|
656 |
msgstr "Simple History"
|
657 |
|
658 |
-
#: SimpleHistory.php:
|
659 |
msgctxt "history page headline"
|
660 |
msgid "Simple History"
|
661 |
msgstr "Simple History"
|
@@ -665,6 +662,47 @@ msgctxt "donate settings headline"
|
|
665 |
msgid "Donate"
|
666 |
msgstr "Spende"
|
667 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
#: dropins/SimpleHistoryNewRowsNotifier.php:38
|
669 |
msgctxt "New rows notifier: error while checking for new rows"
|
670 |
msgid "An error occured while checking for new log rows"
|
@@ -991,42 +1029,42 @@ msgctxt "User logger: search"
|
|
991 |
msgid "WordPress core updates"
|
992 |
msgstr "WordPress-Kern-Aktualisierungen"
|
993 |
|
994 |
-
#: loggers/SimpleUserLogger.php:
|
995 |
msgctxt "User logger: search"
|
996 |
msgid "Users"
|
997 |
msgstr "Benutzer"
|
998 |
|
999 |
-
#: loggers/SimpleUserLogger.php:
|
1000 |
msgctxt "User logger: search"
|
1001 |
msgid "All user activity"
|
1002 |
msgstr "Alle Benutzer-Aktivitäten"
|
1003 |
|
1004 |
-
#: loggers/SimpleUserLogger.php:
|
1005 |
msgctxt "User logger: search"
|
1006 |
msgid "Successful user logins"
|
1007 |
msgstr "Erfolgreiche Benutzer-Anmeldungen"
|
1008 |
|
1009 |
-
#: loggers/SimpleUserLogger.php:
|
1010 |
msgctxt "User logger: search"
|
1011 |
msgid "Failed user logins"
|
1012 |
msgstr "Fehlgeschlagene Benutzer-Anmeldungen"
|
1013 |
|
1014 |
-
#: loggers/SimpleUserLogger.php:
|
1015 |
msgctxt "User logger: search"
|
1016 |
msgid "User logouts"
|
1017 |
msgstr "Benutzer-Abmeldungen"
|
1018 |
|
1019 |
-
#: loggers/SimpleUserLogger.php:
|
1020 |
msgctxt "User logger: search"
|
1021 |
msgid "Created users"
|
1022 |
msgstr "Benutzer erzeugt"
|
1023 |
|
1024 |
-
#: loggers/SimpleUserLogger.php:
|
1025 |
msgctxt "User logger: search"
|
1026 |
msgid "User profile updates"
|
1027 |
msgstr "Benutzerprofil-Aktualisierungen"
|
1028 |
|
1029 |
-
#: loggers/SimpleUserLogger.php:
|
1030 |
msgctxt "User logger: search"
|
1031 |
msgid "User deletions"
|
1032 |
msgstr "Löschungen von Benutzern"
|
@@ -1208,47 +1246,47 @@ msgctxt "Plugin logger: search"
|
|
1208 |
msgid "Deleted plugins"
|
1209 |
msgstr "Gelöschte Plugins"
|
1210 |
|
1211 |
-
#: loggers/SimplePluginLogger.php:
|
1212 |
msgctxt "plugin logger - detailed output version"
|
1213 |
msgid "Version"
|
1214 |
msgstr "Version"
|
1215 |
|
1216 |
-
#: loggers/SimplePluginLogger.php:
|
1217 |
msgctxt "plugin logger - detailed output author"
|
1218 |
msgid "Author"
|
1219 |
msgstr "Autor"
|
1220 |
|
1221 |
-
#: loggers/SimplePluginLogger.php:
|
1222 |
msgctxt "plugin logger - detailed output author"
|
1223 |
msgid "Requires"
|
1224 |
msgstr "erfordert"
|
1225 |
|
1226 |
-
#: loggers/SimplePluginLogger.php:
|
1227 |
msgctxt "plugin logger - detailed output url"
|
1228 |
msgid "URL"
|
1229 |
msgstr "URL"
|
1230 |
|
1231 |
-
#: loggers/SimplePluginLogger.php:
|
1232 |
msgctxt "plugin logger - detailed output compatible"
|
1233 |
msgid "Compatible up to"
|
1234 |
msgstr "kompatibel bis zu"
|
1235 |
|
1236 |
-
#: loggers/SimplePluginLogger.php:
|
1237 |
msgctxt "plugin logger - detailed output downloaded"
|
1238 |
msgid "Downloads"
|
1239 |
msgstr "Downloads"
|
1240 |
|
1241 |
-
#: loggers/SimplePluginLogger.php:
|
1242 |
msgctxt "plugin logger: plugin info thickbox title view all info"
|
1243 |
msgid "View plugin info"
|
1244 |
msgstr "Zeige Plugin-Info"
|
1245 |
|
1246 |
-
#: loggers/SimplePluginLogger.php:
|
1247 |
msgctxt "plugin logger: plugin info thickbox title"
|
1248 |
msgid "View plugin info"
|
1249 |
msgstr "Zeige Plugin-Info"
|
1250 |
|
1251 |
-
#: loggers/SimplePluginLogger.php:
|
1252 |
msgctxt "plugin logger: plugin info thickbox title"
|
1253 |
msgid "View changelog"
|
1254 |
msgstr "Zeige Changelog"
|
@@ -1323,7 +1361,32 @@ msgctxt "Theme logger: search"
|
|
1323 |
msgid "Background of themes changed"
|
1324 |
msgstr "Geänderte Theme-Hintergründe"
|
1325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1326 |
#: templates/settings-statsRowsPerDay.php:36
|
1327 |
msgctxt "stats: date in rows per day chart"
|
1328 |
msgid "M j"
|
1329 |
msgstr "M j"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple History 2.0.3\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/Simple-History\n"
|
7 |
+
"POT-Creation-Date: 2014-12-31 10:41:42+00:00\n"
|
8 |
+
"PO-Revision-Date: 2015-01-02 15:52+0100\n"
|
9 |
+
"Last-Translator: Ralph Stenzel <ralph@klein-aber-fein.de>\n"
|
10 |
+
"Language-Team: Ralph Stenzel <ralph@klein-aber-fein.de>\n"
|
11 |
+
"Language: de_DE\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
|
|
|
15 |
"X-Generator: Poedit 1.7.1\n"
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
20 |
"X-Poedit-SourceCharset: UTF-8\n"
|
21 |
"X-Poedit-Basepath: ../\n"
|
22 |
"X-Textdomain-Support: yes\n"
|
|
|
23 |
"X-Poedit-SearchPath-0: .\n"
|
24 |
|
25 |
+
#: SimpleHistory.php:434 SimpleHistory.php:696
|
26 |
msgid "Settings"
|
27 |
msgstr "Einstellungen"
|
28 |
|
29 |
+
#: SimpleHistory.php:445
|
30 |
msgid "Log (debug)"
|
31 |
msgstr "Logbuch (Fehlersuche)"
|
32 |
|
33 |
+
#: SimpleHistory.php:450
|
34 |
msgid "Styles example (debug)"
|
35 |
msgstr "Stil-Beispiel (Fehlersuche)"
|
36 |
|
37 |
+
#. Plugin Name of the plugin/theme
|
38 |
+
#: SimpleHistory.php:711
|
39 |
+
msgid "Simple History"
|
40 |
+
msgstr "Simple History"
|
41 |
|
42 |
+
#: SimpleHistory.php:787
|
43 |
msgid "Remove all log items?"
|
44 |
msgstr "Alle Einträge im Logbuch entfernen?"
|
45 |
|
46 |
+
#: SimpleHistory.php:789
|
47 |
msgid "Go to the first page"
|
48 |
msgstr "Gehe zur ersten Seite"
|
49 |
|
50 |
+
#: SimpleHistory.php:790
|
51 |
msgid "Go to the previous page"
|
52 |
msgstr "Gehe zur vorherigen Seite"
|
53 |
|
54 |
+
#: SimpleHistory.php:791
|
55 |
msgid "Go to the next page"
|
56 |
msgstr "Gehe zur nächsten Seite"
|
57 |
|
58 |
+
#: SimpleHistory.php:792
|
59 |
msgid "Go to the last page"
|
60 |
msgstr "Gehe zur letzten Seite"
|
61 |
|
62 |
+
#: SimpleHistory.php:793
|
63 |
msgid "Current page"
|
64 |
msgstr "Aktuelle Seite"
|
65 |
|
66 |
+
#: SimpleHistory.php:795
|
67 |
msgid "Oups, the log could not be loaded right now."
|
68 |
msgstr "Hoppla, das Logbuch konnte eben nicht geladen werden."
|
69 |
|
70 |
+
#: SimpleHistory.php:796
|
71 |
msgid "Your search did not match any history events."
|
72 |
msgstr "Deine Suche erbrachte keine Übereinstimmungen mit Ereignissen."
|
73 |
|
74 |
+
#: SimpleHistory.php:1090 SimpleHistory.php:1193
|
75 |
msgid "Simple History Settings"
|
76 |
msgstr "Simple History Einstellungen"
|
77 |
|
78 |
+
#: SimpleHistory.php:1124
|
79 |
msgid "No valid callback found"
|
80 |
msgstr "Kein valider Rückruf gefunden"
|
81 |
|
82 |
+
#: SimpleHistory.php:1214
|
83 |
msgid "Cleared database"
|
84 |
msgstr "Datenbank geleert"
|
85 |
|
86 |
+
#: SimpleHistory.php:1241
|
87 |
msgid "Show history"
|
88 |
msgstr "Zeige Logbuch"
|
89 |
|
90 |
+
#: SimpleHistory.php:1254
|
91 |
msgid "Number of items per page"
|
92 |
msgstr "Zahl der Einträge pro Seite"
|
93 |
|
94 |
+
#: SimpleHistory.php:1266
|
95 |
msgid "Clear log"
|
96 |
msgstr "Logbuch leeren"
|
97 |
|
98 |
+
#: SimpleHistory.php:1406
|
99 |
msgid "on the dashboard"
|
100 |
msgstr "auf dem Dashboard"
|
101 |
|
102 |
+
#: SimpleHistory.php:1411
|
103 |
msgid "as a page under the dashboard menu"
|
104 |
msgstr "als eine Seite im Dashboard-Menü"
|
105 |
|
106 |
+
#: SimpleHistory.php:1427
|
107 |
msgid "Items in the database are automatically removed after %1$s days."
|
108 |
msgstr "Einträge in der Datenbank werden nach %1$s Tagen automatisch entfernt."
|
109 |
|
110 |
+
#: SimpleHistory.php:1429
|
111 |
msgid "Items in the database are kept forever."
|
112 |
msgstr "Einträge in der Datenbank werden auf ewig behalten."
|
113 |
|
114 |
+
#: SimpleHistory.php:1433
|
115 |
msgid "Clear log now"
|
116 |
msgstr "Logbuch jetzt leeren"
|
117 |
|
118 |
+
#: SimpleHistory.php:1658
|
119 |
msgid "+%1$s more"
|
120 |
msgstr "+%1$s mehr"
|
121 |
|
122 |
+
#: SimpleHistory.php:1665
|
123 |
msgid "Loading…"
|
124 |
msgstr "Lade..."
|
125 |
|
126 |
+
#: SimpleHistory.php:1672
|
127 |
msgid "Showing %1$s more"
|
128 |
msgstr "Zeige %1$s mehr"
|
129 |
|
130 |
+
#: SimpleHistory.php:1691
|
131 |
msgid "Context data"
|
132 |
msgstr "Kontext-Daten"
|
133 |
|
134 |
+
#: SimpleHistory.php:1692
|
135 |
+
msgid "This is potentially useful meta data that a logger has saved."
|
136 |
msgstr ""
|
137 |
"Dies sind potentiell nützliche Meta-Daten, die ein Logger abgespeichert hat."
|
138 |
|
139 |
+
#: SimpleHistory.php:2029
|
140 |
msgid "No events today so far."
|
141 |
msgstr "Heute sind noch keine Ereignisse aufgetreten."
|
142 |
|
143 |
+
#: SimpleHistory.php:2033
|
144 |
msgid "%1$d event today from one user."
|
145 |
msgstr "%1$d Ereignis heute von einem Benutzer."
|
146 |
|
147 |
+
#: SimpleHistory.php:2037
|
148 |
msgid "%1$d events today from %2$d users."
|
149 |
msgstr "%1$d Ereignisse heute von %2$d Benutzern."
|
150 |
|
151 |
+
#: SimpleHistory.php:2041
|
152 |
msgid "%1$d events today from one user."
|
153 |
msgstr "%1$d Ereignisse heute von einem Benutzer."
|
154 |
|
266 |
msgid "Stats"
|
267 |
msgstr "Statistiken"
|
268 |
|
269 |
+
#: index.php:55
|
270 |
msgid ""
|
271 |
"Simple History is a great plugin, but to use it your server must have at "
|
272 |
"least PHP 5.3 installed (you have version %s)."
|
505 |
#: loggers/SimpleUserLogger.php:24
|
506 |
msgid ""
|
507 |
"Failed to login with username \"{failed_login_username}\" because no user "
|
508 |
+
"with that username exists"
|
509 |
msgstr ""
|
510 |
"Anmeldung mit dem Benutzernamen \"{failed_login_username}\" fehlgeschlagen, "
|
511 |
"weil kein Benutzer mit diesem Namen existiert"
|
540 |
msgid "Deleted user {deleted_user_login} ({deleted_user_email})"
|
541 |
msgstr "Hat den Benutzer {deleted_user_login} ({deleted_user_email}) gelöscht"
|
542 |
|
543 |
+
#: loggers/SimpleUserLogger.php:229
|
544 |
msgid "Edited <a href=\"{edit_profile_link}\">your profile</a>"
|
545 |
msgstr "Hat <a href=\"{edit_profile_link}\">Dein Profil</a> geändert"
|
546 |
|
547 |
+
#: loggers/SimpleUserLogger.php:233
|
548 |
msgid "Edited <a href=\"{edit_profile_link}\">their profile</a>"
|
549 |
msgstr "Hat <a href=\"{edit_profile_link}\">deren Profil</a> geändert"
|
550 |
|
551 |
+
#: loggers/SimpleUserLogger.php:242
|
552 |
msgid "Edited your profile"
|
553 |
msgstr "Hat Dein Profil geändert"
|
554 |
|
555 |
+
#: loggers/SimpleUserLogger.php:253
|
556 |
msgid ""
|
557 |
"Edited the profile for user <a href="
|
558 |
"\"{edit_profile_link}\">{edited_user_login} ({edited_user_email})</a>"
|
610 |
msgid "Deleted users are also included."
|
611 |
msgstr "Gelöschte Benutzer sind auch enthalten."
|
612 |
|
|
|
|
|
|
|
|
|
613 |
#. Plugin URI of the plugin/theme
|
614 |
msgid "http://simple-history.com"
|
615 |
msgstr "http://simple-history.com"
|
631 |
msgid "http://simple-history.com/"
|
632 |
msgstr "http://simple-history.com/"
|
633 |
|
634 |
+
#: SimpleHistory.php:177
|
635 |
msgctxt ""
|
636 |
"Message visible while waiting for log to load from server the first time"
|
637 |
msgid "Loading history..."
|
638 |
msgstr "Lade Historie..."
|
639 |
|
640 |
+
#: SimpleHistory.php:214
|
641 |
msgctxt "page n of n"
|
642 |
msgid "of"
|
643 |
msgstr "von"
|
644 |
|
645 |
+
#: SimpleHistory.php:285
|
646 |
msgctxt "API: not enought arguments passed"
|
647 |
msgid "Not enough args specified"
|
648 |
msgstr "Nicht genügend Argumente angegeben"
|
649 |
|
650 |
+
#: SimpleHistory.php:1178
|
651 |
msgctxt "dashboard menu name"
|
652 |
msgid "Simple History"
|
653 |
msgstr "Simple History"
|
654 |
|
655 |
+
#: SimpleHistory.php:1303
|
656 |
msgctxt "history page headline"
|
657 |
msgid "Simple History"
|
658 |
msgstr "Simple History"
|
662 |
msgid "Donate"
|
663 |
msgstr "Spende"
|
664 |
|
665 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:66
|
666 |
+
msgctxt "IP Info Dropin"
|
667 |
+
msgid "That IP address does not seem like a public one."
|
668 |
+
msgstr "Diese IP-Adresse scheint keine öffentliche zu sein."
|
669 |
+
|
670 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:85
|
671 |
+
msgctxt "IP Info Dropin"
|
672 |
+
msgid "IP address"
|
673 |
+
msgstr "IP-Adresse"
|
674 |
+
|
675 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:96
|
676 |
+
msgctxt "IP Info Dropin"
|
677 |
+
msgid "Hostname"
|
678 |
+
msgstr "Hostname"
|
679 |
+
|
680 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:107
|
681 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:118
|
682 |
+
msgctxt "IP Info Dropin"
|
683 |
+
msgid "Network"
|
684 |
+
msgstr "Netzwerk"
|
685 |
+
|
686 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:129
|
687 |
+
msgctxt "IP Info Dropin"
|
688 |
+
msgid "City"
|
689 |
+
msgstr "Stadt"
|
690 |
+
|
691 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:140
|
692 |
+
msgctxt "IP Info Dropin"
|
693 |
+
msgid "Region"
|
694 |
+
msgstr "Region"
|
695 |
+
|
696 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:151
|
697 |
+
msgctxt "IP Info Dropin"
|
698 |
+
msgid "Country"
|
699 |
+
msgstr "Land"
|
700 |
+
|
701 |
+
#: dropins/SimpleHistoryIpInfoDropin.php:162
|
702 |
+
msgctxt "IP Info Dropin"
|
703 |
+
msgid "IP info provided by %1$s ipinfo.io %2$s"
|
704 |
+
msgstr "IP-Info bereitgestellt durch %1$s ipinfo.io %2$s"
|
705 |
+
|
706 |
#: dropins/SimpleHistoryNewRowsNotifier.php:38
|
707 |
msgctxt "New rows notifier: error while checking for new rows"
|
708 |
msgid "An error occured while checking for new log rows"
|
1029 |
msgid "WordPress core updates"
|
1030 |
msgstr "WordPress-Kern-Aktualisierungen"
|
1031 |
|
1032 |
+
#: loggers/SimpleUserLogger.php:55
|
1033 |
msgctxt "User logger: search"
|
1034 |
msgid "Users"
|
1035 |
msgstr "Benutzer"
|
1036 |
|
1037 |
+
#: loggers/SimpleUserLogger.php:56
|
1038 |
msgctxt "User logger: search"
|
1039 |
msgid "All user activity"
|
1040 |
msgstr "Alle Benutzer-Aktivitäten"
|
1041 |
|
1042 |
+
#: loggers/SimpleUserLogger.php:58
|
1043 |
msgctxt "User logger: search"
|
1044 |
msgid "Successful user logins"
|
1045 |
msgstr "Erfolgreiche Benutzer-Anmeldungen"
|
1046 |
|
1047 |
+
#: loggers/SimpleUserLogger.php:62
|
1048 |
msgctxt "User logger: search"
|
1049 |
msgid "Failed user logins"
|
1050 |
msgstr "Fehlgeschlagene Benutzer-Anmeldungen"
|
1051 |
|
1052 |
+
#: loggers/SimpleUserLogger.php:66
|
1053 |
msgctxt "User logger: search"
|
1054 |
msgid "User logouts"
|
1055 |
msgstr "Benutzer-Abmeldungen"
|
1056 |
|
1057 |
+
#: loggers/SimpleUserLogger.php:69
|
1058 |
msgctxt "User logger: search"
|
1059 |
msgid "Created users"
|
1060 |
msgstr "Benutzer erzeugt"
|
1061 |
|
1062 |
+
#: loggers/SimpleUserLogger.php:72
|
1063 |
msgctxt "User logger: search"
|
1064 |
msgid "User profile updates"
|
1065 |
msgstr "Benutzerprofil-Aktualisierungen"
|
1066 |
|
1067 |
+
#: loggers/SimpleUserLogger.php:75
|
1068 |
msgctxt "User logger: search"
|
1069 |
msgid "User deletions"
|
1070 |
msgstr "Löschungen von Benutzern"
|
1246 |
msgid "Deleted plugins"
|
1247 |
msgstr "Gelöschte Plugins"
|
1248 |
|
1249 |
+
#: loggers/SimplePluginLogger.php:858
|
1250 |
msgctxt "plugin logger - detailed output version"
|
1251 |
msgid "Version"
|
1252 |
msgstr "Version"
|
1253 |
|
1254 |
+
#: loggers/SimplePluginLogger.php:860
|
1255 |
msgctxt "plugin logger - detailed output author"
|
1256 |
msgid "Author"
|
1257 |
msgstr "Autor"
|
1258 |
|
1259 |
+
#: loggers/SimplePluginLogger.php:862
|
1260 |
msgctxt "plugin logger - detailed output author"
|
1261 |
msgid "Requires"
|
1262 |
msgstr "erfordert"
|
1263 |
|
1264 |
+
#: loggers/SimplePluginLogger.php:861
|
1265 |
msgctxt "plugin logger - detailed output url"
|
1266 |
msgid "URL"
|
1267 |
msgstr "URL"
|
1268 |
|
1269 |
+
#: loggers/SimplePluginLogger.php:863
|
1270 |
msgctxt "plugin logger - detailed output compatible"
|
1271 |
msgid "Compatible up to"
|
1272 |
msgstr "kompatibel bis zu"
|
1273 |
|
1274 |
+
#: loggers/SimplePluginLogger.php:864
|
1275 |
msgctxt "plugin logger - detailed output downloaded"
|
1276 |
msgid "Downloads"
|
1277 |
msgstr "Downloads"
|
1278 |
|
1279 |
+
#: loggers/SimplePluginLogger.php:924
|
1280 |
msgctxt "plugin logger: plugin info thickbox title view all info"
|
1281 |
msgid "View plugin info"
|
1282 |
msgstr "Zeige Plugin-Info"
|
1283 |
|
1284 |
+
#: loggers/SimplePluginLogger.php:939
|
1285 |
msgctxt "plugin logger: plugin info thickbox title"
|
1286 |
msgid "View plugin info"
|
1287 |
msgstr "Zeige Plugin-Info"
|
1288 |
|
1289 |
+
#: loggers/SimplePluginLogger.php:943
|
1290 |
msgctxt "plugin logger: plugin info thickbox title"
|
1291 |
msgid "View changelog"
|
1292 |
msgstr "Zeige Changelog"
|
1361 |
msgid "Background of themes changed"
|
1362 |
msgstr "Geänderte Theme-Hintergründe"
|
1363 |
|
1364 |
+
#: loggers/SimpleUserLogger.php:37
|
1365 |
+
msgctxt "User destroys other login sessions for themself"
|
1366 |
+
msgid "Logged out from all other sessions"
|
1367 |
+
msgstr "Hat sich von allen anderen Sitzungen abgemeldet"
|
1368 |
+
|
1369 |
+
#: loggers/SimpleUserLogger.php:46
|
1370 |
+
msgctxt "User destroys all login sessions for a user"
|
1371 |
+
msgid "Logged out \"{user_display_name}\" from all sessions"
|
1372 |
+
msgstr "Hat den Benutzer \"{user_display_name}\" von allen Sitzungen abgemeldet"
|
1373 |
+
|
1374 |
#: templates/settings-statsRowsPerDay.php:36
|
1375 |
msgctxt "stats: date in rows per day chart"
|
1376 |
msgid "M j"
|
1377 |
msgstr "M j"
|
1378 |
+
|
1379 |
+
#~ msgid "History"
|
1380 |
+
#~ msgstr "Historie"
|
1381 |
+
|
1382 |
+
#~ msgid "This is potentially useful meta data that a logger have saved."
|
1383 |
+
#~ msgstr ""
|
1384 |
+
#~ "Dies sind potentiell nützliche Meta-Daten, die ein Logger abgespeichert "
|
1385 |
+
#~ "hat."
|
1386 |
+
|
1387 |
+
#~ msgid ""
|
1388 |
+
#~ "Failed to login with username \"{failed_login_username}\" because no user "
|
1389 |
+
#~ "with that username exist"
|
1390 |
+
#~ msgstr ""
|
1391 |
+
#~ "Anmeldung mit dem Benutzernamen \"{failed_login_username}\" "
|
1392 |
+
#~ "fehlgeschlagen, weil kein Benutzer mit diesem Namen existiert"
|
languages/simple-history-sv_SE.mo
CHANGED
Binary file
|
languages/simple-history-sv_SE.po
CHANGED
@@ -4,8 +4,8 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple History 2\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/Simple-History\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
-
"PO-Revision-Date:
|
9 |
"Last-Translator: Pär Thernström <par.thernstrom@gmail.com>\n"
|
10 |
"Language-Team: \n"
|
11 |
"Language: sv\n"
|
@@ -271,27 +271,27 @@ msgstr ""
|
|
271 |
"Simple History är en rackarns bra plugin, men för att använda den måste din "
|
272 |
"server ha minst PHP 5.3 installerat (du har version %s)."
|
273 |
|
274 |
-
#: loggers/SimpleCommentsLogger.php:
|
275 |
msgid "Spam"
|
276 |
msgstr "Skräp"
|
277 |
|
278 |
-
#: loggers/SimpleCommentsLogger.php:
|
279 |
msgid "Approved"
|
280 |
msgstr "Godkänd"
|
281 |
|
282 |
-
#: loggers/SimpleCommentsLogger.php:
|
283 |
msgid "Pending"
|
284 |
msgstr "Väntande"
|
285 |
|
286 |
-
#: loggers/SimpleCommentsLogger.php:
|
287 |
msgid "Trackback"
|
288 |
msgstr "Trackback"
|
289 |
|
290 |
-
#: loggers/SimpleCommentsLogger.php:
|
291 |
msgid "Pingback"
|
292 |
msgstr "Pingback"
|
293 |
|
294 |
-
#: loggers/SimpleCommentsLogger.php:
|
295 |
msgid "Comment"
|
296 |
msgstr "Kommentar"
|
297 |
|
@@ -960,35 +960,35 @@ msgctxt "Comments logger: search"
|
|
960 |
msgid "Deleted comments"
|
961 |
msgstr "Borttagna kommentarer"
|
962 |
|
963 |
-
#: loggers/SimpleCommentsLogger.php:
|
964 |
-
#: loggers/SimpleCommentsLogger.php:
|
965 |
msgctxt "comments logger - detailed output comment status"
|
966 |
msgid "Status"
|
967 |
msgstr "Status"
|
968 |
|
969 |
-
#: loggers/SimpleCommentsLogger.php:
|
970 |
-
#: loggers/SimpleCommentsLogger.php:
|
971 |
msgctxt "comments logger - detailed output author"
|
972 |
msgid "Name"
|
973 |
msgstr "Namn"
|
974 |
|
975 |
-
#: loggers/SimpleCommentsLogger.php:
|
976 |
-
#: loggers/SimpleCommentsLogger.php:
|
977 |
msgctxt "comments logger - detailed output email"
|
978 |
msgid "Email"
|
979 |
msgstr "E-post"
|
980 |
|
981 |
-
#: loggers/SimpleCommentsLogger.php:
|
982 |
msgctxt "comments logger - detailed output content"
|
983 |
msgid "Content"
|
984 |
msgstr "Innehåll"
|
985 |
|
986 |
-
#: loggers/SimpleCommentsLogger.php:
|
987 |
msgctxt "comments logger - detailed output content"
|
988 |
msgid "Comment"
|
989 |
msgstr "Kommentar"
|
990 |
|
991 |
-
#: loggers/SimpleCommentsLogger.php:
|
992 |
msgctxt "comments logger - edit comment"
|
993 |
msgid "View/Edit"
|
994 |
msgstr "Visa/Redigera"
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple History 2\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/Simple-History\n"
|
7 |
+
"POT-Creation-Date: 2015-01-03 11:33:40+00:00\n"
|
8 |
+
"PO-Revision-Date: 2015-01-03 12:34+0100\n"
|
9 |
"Last-Translator: Pär Thernström <par.thernstrom@gmail.com>\n"
|
10 |
"Language-Team: \n"
|
11 |
"Language: sv\n"
|
271 |
"Simple History är en rackarns bra plugin, men för att använda den måste din "
|
272 |
"server ha minst PHP 5.3 installerat (du har version %s)."
|
273 |
|
274 |
+
#: loggers/SimpleCommentsLogger.php:687
|
275 |
msgid "Spam"
|
276 |
msgstr "Skräp"
|
277 |
|
278 |
+
#: loggers/SimpleCommentsLogger.php:689
|
279 |
msgid "Approved"
|
280 |
msgstr "Godkänd"
|
281 |
|
282 |
+
#: loggers/SimpleCommentsLogger.php:691
|
283 |
msgid "Pending"
|
284 |
msgstr "Väntande"
|
285 |
|
286 |
+
#: loggers/SimpleCommentsLogger.php:705
|
287 |
msgid "Trackback"
|
288 |
msgstr "Trackback"
|
289 |
|
290 |
+
#: loggers/SimpleCommentsLogger.php:707
|
291 |
msgid "Pingback"
|
292 |
msgstr "Pingback"
|
293 |
|
294 |
+
#: loggers/SimpleCommentsLogger.php:709
|
295 |
msgid "Comment"
|
296 |
msgstr "Kommentar"
|
297 |
|
960 |
msgid "Deleted comments"
|
961 |
msgstr "Borttagna kommentarer"
|
962 |
|
963 |
+
#: loggers/SimpleCommentsLogger.php:604 loggers/SimpleCommentsLogger.php:617
|
964 |
+
#: loggers/SimpleCommentsLogger.php:631
|
965 |
msgctxt "comments logger - detailed output comment status"
|
966 |
msgid "Status"
|
967 |
msgstr "Status"
|
968 |
|
969 |
+
#: loggers/SimpleCommentsLogger.php:606 loggers/SimpleCommentsLogger.php:619
|
970 |
+
#: loggers/SimpleCommentsLogger.php:633
|
971 |
msgctxt "comments logger - detailed output author"
|
972 |
msgid "Name"
|
973 |
msgstr "Namn"
|
974 |
|
975 |
+
#: loggers/SimpleCommentsLogger.php:607 loggers/SimpleCommentsLogger.php:620
|
976 |
+
#: loggers/SimpleCommentsLogger.php:634
|
977 |
msgctxt "comments logger - detailed output email"
|
978 |
msgid "Email"
|
979 |
msgstr "E-post"
|
980 |
|
981 |
+
#: loggers/SimpleCommentsLogger.php:608 loggers/SimpleCommentsLogger.php:621
|
982 |
msgctxt "comments logger - detailed output content"
|
983 |
msgid "Content"
|
984 |
msgstr "Innehåll"
|
985 |
|
986 |
+
#: loggers/SimpleCommentsLogger.php:635
|
987 |
msgctxt "comments logger - detailed output content"
|
988 |
msgid "Comment"
|
989 |
msgstr "Kommentar"
|
990 |
|
991 |
+
#: loggers/SimpleCommentsLogger.php:761
|
992 |
msgctxt "comments logger - edit comment"
|
993 |
msgid "View/Edit"
|
994 |
msgstr "Visa/Redigera"
|
languages/simple-history.pot
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the Simple History package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Simple History 2.0.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/Simple-History\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
"X-Generator: grunt-wp-i18n 0.4.9\n"
|
@@ -37,7 +37,7 @@ msgid "Styles example (debug)"
|
|
37 |
msgstr ""
|
38 |
|
39 |
#: SimpleHistory.php:711
|
40 |
-
#. #-#-#-#-# Simple-History.pot (Simple History 2.0.
|
41 |
#. Plugin Name of the plugin/theme
|
42 |
msgid "Simple History"
|
43 |
msgstr ""
|
@@ -263,27 +263,27 @@ msgid ""
|
|
263 |
"least PHP 5.3 installed (you have version %s)."
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: loggers/SimpleCommentsLogger.php:
|
267 |
msgid "Spam"
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: loggers/SimpleCommentsLogger.php:
|
271 |
msgid "Approved"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: loggers/SimpleCommentsLogger.php:
|
275 |
msgid "Pending"
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: loggers/SimpleCommentsLogger.php:
|
279 |
msgid "Trackback"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: loggers/SimpleCommentsLogger.php:
|
283 |
msgid "Pingback"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: loggers/SimpleCommentsLogger.php:
|
287 |
msgid "Comment"
|
288 |
msgstr ""
|
289 |
|
@@ -892,35 +892,35 @@ msgctxt "Comments logger: search"
|
|
892 |
msgid "Deleted comments"
|
893 |
msgstr ""
|
894 |
|
895 |
-
#: loggers/SimpleCommentsLogger.php:
|
896 |
-
#: loggers/SimpleCommentsLogger.php:
|
897 |
msgctxt "comments logger - detailed output comment status"
|
898 |
msgid "Status"
|
899 |
msgstr ""
|
900 |
|
901 |
-
#: loggers/SimpleCommentsLogger.php:
|
902 |
-
#: loggers/SimpleCommentsLogger.php:
|
903 |
msgctxt "comments logger - detailed output author"
|
904 |
msgid "Name"
|
905 |
msgstr ""
|
906 |
|
907 |
-
#: loggers/SimpleCommentsLogger.php:
|
908 |
-
#: loggers/SimpleCommentsLogger.php:
|
909 |
msgctxt "comments logger - detailed output email"
|
910 |
msgid "Email"
|
911 |
msgstr ""
|
912 |
|
913 |
-
#: loggers/SimpleCommentsLogger.php:
|
914 |
msgctxt "comments logger - detailed output content"
|
915 |
msgid "Content"
|
916 |
msgstr ""
|
917 |
|
918 |
-
#: loggers/SimpleCommentsLogger.php:
|
919 |
msgctxt "comments logger - detailed output content"
|
920 |
msgid "Comment"
|
921 |
msgstr ""
|
922 |
|
923 |
-
#: loggers/SimpleCommentsLogger.php:
|
924 |
msgctxt "comments logger - edit comment"
|
925 |
msgid "View/Edit"
|
926 |
msgstr ""
|
1 |
+
# Copyright (C) 2015 Simple History
|
2 |
# This file is distributed under the same license as the Simple History package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Simple History 2.0.11\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/Simple-History\n"
|
7 |
+
"POT-Creation-Date: 2015-01-03 11:33:40+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
"X-Generator: grunt-wp-i18n 0.4.9\n"
|
37 |
msgstr ""
|
38 |
|
39 |
#: SimpleHistory.php:711
|
40 |
+
#. #-#-#-#-# Simple-History.pot (Simple History 2.0.11) #-#-#-#-#
|
41 |
#. Plugin Name of the plugin/theme
|
42 |
msgid "Simple History"
|
43 |
msgstr ""
|
263 |
"least PHP 5.3 installed (you have version %s)."
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: loggers/SimpleCommentsLogger.php:687
|
267 |
msgid "Spam"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: loggers/SimpleCommentsLogger.php:689
|
271 |
msgid "Approved"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: loggers/SimpleCommentsLogger.php:691
|
275 |
msgid "Pending"
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: loggers/SimpleCommentsLogger.php:705
|
279 |
msgid "Trackback"
|
280 |
msgstr ""
|
281 |
|
282 |
+
#: loggers/SimpleCommentsLogger.php:707
|
283 |
msgid "Pingback"
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: loggers/SimpleCommentsLogger.php:709
|
287 |
msgid "Comment"
|
288 |
msgstr ""
|
289 |
|
892 |
msgid "Deleted comments"
|
893 |
msgstr ""
|
894 |
|
895 |
+
#: loggers/SimpleCommentsLogger.php:604 loggers/SimpleCommentsLogger.php:617
|
896 |
+
#: loggers/SimpleCommentsLogger.php:631
|
897 |
msgctxt "comments logger - detailed output comment status"
|
898 |
msgid "Status"
|
899 |
msgstr ""
|
900 |
|
901 |
+
#: loggers/SimpleCommentsLogger.php:606 loggers/SimpleCommentsLogger.php:619
|
902 |
+
#: loggers/SimpleCommentsLogger.php:633
|
903 |
msgctxt "comments logger - detailed output author"
|
904 |
msgid "Name"
|
905 |
msgstr ""
|
906 |
|
907 |
+
#: loggers/SimpleCommentsLogger.php:607 loggers/SimpleCommentsLogger.php:620
|
908 |
+
#: loggers/SimpleCommentsLogger.php:634
|
909 |
msgctxt "comments logger - detailed output email"
|
910 |
msgid "Email"
|
911 |
msgstr ""
|
912 |
|
913 |
+
#: loggers/SimpleCommentsLogger.php:608 loggers/SimpleCommentsLogger.php:621
|
914 |
msgctxt "comments logger - detailed output content"
|
915 |
msgid "Content"
|
916 |
msgstr ""
|
917 |
|
918 |
+
#: loggers/SimpleCommentsLogger.php:635
|
919 |
msgctxt "comments logger - detailed output content"
|
920 |
msgid "Comment"
|
921 |
msgstr ""
|
922 |
|
923 |
+
#: loggers/SimpleCommentsLogger.php:761
|
924 |
msgctxt "comments logger - edit comment"
|
925 |
msgid "View/Edit"
|
926 |
msgstr ""
|
loggers/SimpleCommentsLogger.php
CHANGED
@@ -383,6 +383,11 @@ class SimpleCommentsLogger extends SimpleLogger
|
|
383 |
"comment_post_type" => $comment_parent_post->post_type,
|
384 |
);
|
385 |
|
|
|
|
|
|
|
|
|
|
|
386 |
return $context;
|
387 |
|
388 |
}
|
@@ -481,7 +486,7 @@ class SimpleCommentsLogger extends SimpleLogger
|
|
481 |
public function on_comment_post($comment_ID, $comment_approved) {
|
482 |
|
483 |
$context = $this->get_context_for_comment($comment_ID);
|
484 |
-
|
485 |
if ( ! $context ) {
|
486 |
return;
|
487 |
}
|
@@ -489,7 +494,7 @@ class SimpleCommentsLogger extends SimpleLogger
|
|
489 |
$comment_data = get_comment( $comment_ID );
|
490 |
|
491 |
$message = "";
|
492 |
-
|
493 |
if ( $comment_data->user_id ) {
|
494 |
|
495 |
// comment was from a logged in user
|
@@ -537,6 +542,12 @@ class SimpleCommentsLogger extends SimpleLogger
|
|
537 |
$context = $row->context;
|
538 |
$message_key = $context["_message_key"];
|
539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
// Wrap links around {comment_post_title}
|
541 |
$comment_post_ID = isset( $context["comment_post_ID"] ) ? (int) $context["comment_post_ID"] : null;
|
542 |
if ( $comment_post_ID && $comment_post = get_post( $comment_post_ID ) ) {
|
@@ -555,6 +566,7 @@ class SimpleCommentsLogger extends SimpleLogger
|
|
555 |
|
556 |
}
|
557 |
|
|
|
558 |
return $this->interpolate($message, $context);
|
559 |
|
560 |
}
|
@@ -568,7 +580,7 @@ class SimpleCommentsLogger extends SimpleLogger
|
|
568 |
$context = $row->context;
|
569 |
$message_key = $context["_message_key"];
|
570 |
$output = "";
|
571 |
-
|
572 |
/*
|
573 |
if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
|
574 |
if ( '0' == $commentdata['comment_approved'] ) { // comment not spam, but not auto-approved
|
383 |
"comment_post_type" => $comment_parent_post->post_type,
|
384 |
);
|
385 |
|
386 |
+
// Note: comment type is empty for normal comments
|
387 |
+
if (empty( $context["comment_type"] ) ) {
|
388 |
+
$context["comment_type"] = "comment";
|
389 |
+
}
|
390 |
+
|
391 |
return $context;
|
392 |
|
393 |
}
|
486 |
public function on_comment_post($comment_ID, $comment_approved) {
|
487 |
|
488 |
$context = $this->get_context_for_comment($comment_ID);
|
489 |
+
|
490 |
if ( ! $context ) {
|
491 |
return;
|
492 |
}
|
494 |
$comment_data = get_comment( $comment_ID );
|
495 |
|
496 |
$message = "";
|
497 |
+
|
498 |
if ( $comment_data->user_id ) {
|
499 |
|
500 |
// comment was from a logged in user
|
542 |
$context = $row->context;
|
543 |
$message_key = $context["_message_key"];
|
544 |
|
545 |
+
// Message is untranslated here, so get translated text
|
546 |
+
// Can't call parent __FUNCTION__ because it will interpolate too, which we don't want
|
547 |
+
if ( ! empty( $message_key ) ) {
|
548 |
+
$message = $this->messages[ $message_key ]["translated_text"];
|
549 |
+
}
|
550 |
+
|
551 |
// Wrap links around {comment_post_title}
|
552 |
$comment_post_ID = isset( $context["comment_post_ID"] ) ? (int) $context["comment_post_ID"] : null;
|
553 |
if ( $comment_post_ID && $comment_post = get_post( $comment_post_ID ) ) {
|
566 |
|
567 |
}
|
568 |
|
569 |
+
|
570 |
return $this->interpolate($message, $context);
|
571 |
|
572 |
}
|
580 |
$context = $row->context;
|
581 |
$message_key = $context["_message_key"];
|
582 |
$output = "";
|
583 |
+
#print_r($row);exit;
|
584 |
/*
|
585 |
if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
|
586 |
if ( '0' == $commentdata['comment_approved'] ) { // comment not spam, but not auto-approved
|
loggers/SimpleUserLogger.php
CHANGED
@@ -267,52 +267,6 @@ class SimpleUserLogger extends SimpleLogger
|
|
267 |
}
|
268 |
|
269 |
|
270 |
-
/**
|
271 |
-
* Log failed login attempt to username that exists
|
272 |
-
*
|
273 |
-
* @param object $user user object that was tried to gain access to
|
274 |
-
* @param string password used
|
275 |
-
*/
|
276 |
-
function on_wp_authenticate_user($user, $password) {
|
277 |
-
|
278 |
-
// Only log failed attempts
|
279 |
-
if ( ! wp_check_password($password, $user->user_pass, $user->ID) ) {
|
280 |
-
|
281 |
-
// Overwrite some vars that Simple History set automagically
|
282 |
-
$context = array(
|
283 |
-
"_initiator" => SimpleLoggerLogInitiators::WEB_USER,
|
284 |
-
"_user_id" => null,
|
285 |
-
"_user_login" => null,
|
286 |
-
"_user_email" => null,
|
287 |
-
"login_user_id" => $user->ID,
|
288 |
-
"login_user_email" => $user->user_email,
|
289 |
-
"login_user_login" => $user->user_login,
|
290 |
-
"server_http_user_agent" => $_SERVER["HTTP_USER_AGENT"],
|
291 |
-
"_occasionsID" => __CLASS__ . '/' . __FUNCTION__ . "/failed_user_login/userid:{$user->ID}"
|
292 |
-
);
|
293 |
-
|
294 |
-
/**
|
295 |
-
* Maybe store password too
|
296 |
-
* Default is to not do this because of privacy and security
|
297 |
-
*
|
298 |
-
* @since 2.0
|
299 |
-
*
|
300 |
-
* @param bool $log_password
|
301 |
-
*/
|
302 |
-
$log_password = false;
|
303 |
-
$log_password = apply_filters("simple_history/comments_logger/log_failed_password", $log_password);
|
304 |
-
if ($log_password) {
|
305 |
-
$context["login_user_password"] = $password;
|
306 |
-
}
|
307 |
-
|
308 |
-
$this->warningMessage("user_login_failed", $context);
|
309 |
-
|
310 |
-
}
|
311 |
-
|
312 |
-
return $user;
|
313 |
-
|
314 |
-
}
|
315 |
-
|
316 |
/**
|
317 |
* User logs in
|
318 |
*
|
@@ -410,6 +364,53 @@ class SimpleUserLogger extends SimpleLogger
|
|
410 |
|
411 |
}
|
412 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
/**
|
414 |
* Attempt to login to user that does not exist
|
415 |
*/
|
267 |
}
|
268 |
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
/**
|
271 |
* User logs in
|
272 |
*
|
364 |
|
365 |
}
|
366 |
|
367 |
+
/**
|
368 |
+
* Log failed login attempt to username that exists
|
369 |
+
*
|
370 |
+
* @param object $user user object that was tried to gain access to
|
371 |
+
* @param string password used
|
372 |
+
*/
|
373 |
+
function on_wp_authenticate_user($user, $password) {
|
374 |
+
|
375 |
+
// Only log failed attempts
|
376 |
+
if ( ! wp_check_password($password, $user->user_pass, $user->ID) ) {
|
377 |
+
|
378 |
+
// Overwrite some vars that Simple History set automagically
|
379 |
+
$context = array(
|
380 |
+
"_initiator" => SimpleLoggerLogInitiators::WEB_USER,
|
381 |
+
"_user_id" => null,
|
382 |
+
"_user_login" => null,
|
383 |
+
"_user_email" => null,
|
384 |
+
"login_user_id" => $user->ID,
|
385 |
+
"login_user_email" => $user->user_email,
|
386 |
+
"login_user_login" => $user->user_login,
|
387 |
+
"server_http_user_agent" => $_SERVER["HTTP_USER_AGENT"],
|
388 |
+
"_occasionsID" => __CLASS__ . '/' . __FUNCTION__ . "/failed_user_login/userid:{$user->ID}"
|
389 |
+
);
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Maybe store password too
|
393 |
+
* Default is to not do this because of privacy and security
|
394 |
+
*
|
395 |
+
* @since 2.0
|
396 |
+
*
|
397 |
+
* @param bool $log_password
|
398 |
+
*/
|
399 |
+
$log_password = false;
|
400 |
+
$log_password = apply_filters("simple_history/comments_logger/log_failed_password", $log_password);
|
401 |
+
if ($log_password) {
|
402 |
+
$context["login_user_password"] = $password;
|
403 |
+
}
|
404 |
+
|
405 |
+
$this->warningMessage("user_login_failed", $context);
|
406 |
+
|
407 |
+
}
|
408 |
+
|
409 |
+
return $user;
|
410 |
+
|
411 |
+
}
|
412 |
+
|
413 |
+
|
414 |
/**
|
415 |
* Attempt to login to user that does not exist
|
416 |
*/
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://eskapism.se/sida/donate/
|
|
4 |
Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin, syslog, feed, activity, stream
|
5 |
Requires at least: 3.6.0
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 2.0.
|
8 |
|
9 |
View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
|
10 |
|
@@ -76,9 +76,13 @@ if ( function_exists("SimpleLogger") ) {
|
|
76 |
|
77 |
#### Translations/Languages
|
78 |
|
79 |
-
|
80 |
|
81 |
-
|
|
|
|
|
|
|
|
|
82 |
|
83 |
#### Contribute at GitHub
|
84 |
|
@@ -104,6 +108,12 @@ initiated by a specific user.
|
|
104 |
|
105 |
== Changelog ==
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
= 2.0.10 (January 2015) =
|
108 |
|
109 |
- Updated: Polish translation updated. Thanks [https://github.com/m-czardybon](m-czardybon)!
|
@@ -189,7 +199,7 @@ I've spend hundreds of hours making this update, so if you use it and like it pl
|
|
189 |
|
190 |
= 1.3.8 =
|
191 |
- Added filter for rss feed: `simple_history/rss_feed_show`. Fixes more things in this thread: http://wordpress.org/support/topic/more-rss-feed-items.
|
192 |
-
|
193 |
= 1.3.7 =
|
194 |
- Added filter for rss feed: `simple_history/rss_feed_args`. Fixes http://wordpress.org/support/topic/more-rss-feed-items.
|
195 |
|
4 |
Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin, syslog, feed, activity, stream
|
5 |
Requires at least: 3.6.0
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 2.0.11
|
8 |
|
9 |
View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
|
10 |
|
76 |
|
77 |
#### Translations/Languages
|
78 |
|
79 |
+
So far Simple History is translated to:
|
80 |
|
81 |
+
* Swedish
|
82 |
+
* German
|
83 |
+
* Polish
|
84 |
+
|
85 |
+
I'm looking for translations of Simple History in more languages! If you're interested please check out the [localization](https://developer.wordpress.org/plugins/internationalization/localization/) part of the Plugin Handbook for info on how to translate plugins. When you're done with your translation email it to me at par.thernstrom@gmail.com, or [add a pull request](https://github.com/bonny/WordPress-Simple-History/tree/v2).
|
86 |
|
87 |
#### Contribute at GitHub
|
88 |
|
108 |
|
109 |
== Changelog ==
|
110 |
|
111 |
+
= 2.0.11 (January 2015) =
|
112 |
+
|
113 |
+
- Fixed: Comments where not logged correctly.
|
114 |
+
- Fixed: Comments where not translated correctly.
|
115 |
+
- Updated: German translation updated.
|
116 |
+
|
117 |
= 2.0.10 (January 2015) =
|
118 |
|
119 |
- Updated: Polish translation updated. Thanks [https://github.com/m-czardybon](m-czardybon)!
|
199 |
|
200 |
= 1.3.8 =
|
201 |
- Added filter for rss feed: `simple_history/rss_feed_show`. Fixes more things in this thread: http://wordpress.org/support/topic/more-rss-feed-items.
|
202 |
+
|
203 |
= 1.3.7 =
|
204 |
- Added filter for rss feed: `simple_history/rss_feed_args`. Fixes http://wordpress.org/support/topic/more-rss-feed-items.
|
205 |
|