wbcorus
Forum Replies Created
-
Hi Pär,
the actual problem is recognizing the field name. Those fields are stored as objects. When we see generaloptions[id] in the rendered field, it means that, in the DB, we have a field called generaloptions which contains an object with several properties (including ID). something like:
{
‘id’: 2,
‘name’: test’
}I realized that if I just track generaloptions instead of generaloptions[id] it will correctly show the field change. But it will show a change to the whole object. I will have to compare each property inside to know what actually changed, but it’s fine.
I am using the form below. But I realized that if I track, in my example above, generaloptions instead of generaloptions[id], it works. ‘generaloptions’ is the actual name of the option on the DB (and that stores an object). The only caveat is that will show the change to the object as a whole and, in case of long objects, I will have to figure out what actually changed, but that’s not a big deal.
SimpleLogger()->info(
‘option “‘ . $option_name . ‘” was edited by ‘ . $logged_in_user->user_login .’.’,
array(
‘option name’ => $option_name,
‘old value’ => $old_value,
‘new value’ => $new_value,
)
);Forum: Plugins
In reply to: [Redirection] How to Deal with Millions of Records in 404 Redirection LogI am having the same issue.
I deleted all the logs, set the expiry date for both logs and redirects to 1 day. Today is the 4th afternoon and I still see logs from the 2nd in the morning.
It seems that expiry date is being ignored.
Looking at the DB, I found out that those options (the part inside the bracket) are stored as sub-objects of a larger object (the part outside the square brackets). Is there a way to track those with SH?
Forum: Plugins
In reply to: [Simple History – Track, Log, and Audit WordPress Changes] Log display formatYes, that’s when I use the API.
I am using this logging method:
SimpleLogger()->info(
‘option “‘ . $option_name . ‘” was edited by ‘ . $logged_in_user->user_login .’.’,
array(
‘option name’ => $option_name,
‘old value’ => $old_value,
‘new value’ => $new_value,
)
);