Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Change tracking of actions as registered/anonymous#1449

Open
pavelevap wants to merge 3 commits intomasterfrom
1442-tracking-admin-public-actions
Open

Change tracking of actions as registered/anonymous#1449
pavelevap wants to merge 3 commits intomasterfrom
1442-tracking-admin-public-actions

Conversation

@pavelevap
Copy link
Copy Markdown
Collaborator

Resolves #1442

Move from tracking admin/frontend actions to registered/anonymous, based on availability of registered WordPress user. It fixes problem for example with REST requests which are not generally depending on administration but authentication.

We should probably also change "Non-admin action" to something else, for example "Anonymous action"? @borekb

$authorName = "Non-admin action";

And also add some back compatibility here?
if (author.name === 'Non-admin action') {

pavelevap added 2 commits May 14, 2019 15:14
REST requests are handled correctly now (when user is logged in) and there is no need for special method handleAsAdminSectionRoute().
@pavelevap pavelevap requested review from JanVoracek and borekb May 14, 2019 14:26
@borekb borekb added needs-migration Breaking change between VP versions due to a change in storage format. Needs migration. scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc. labels May 14, 2019
@borekb borekb added this to the 4.0 milestone May 14, 2019
@borekb
Copy link
Copy Markdown
Member

borekb commented May 14, 2019

We should probably also change "Non-admin action" to something else, for example "Anonymous action"?

Agreed. It currently looks like this in a Git commit:

Author: Non-admin action <nonadmin@example.com>

I'd probably:

  1. Omit the word "action".
  2. Find some good email address that would be stable and suitable for client-side UI rendering (we should compare email rather than name here).
  3. Find a name. It's less important IMO than the email.

Something like:

Author: WordPress <vp+nouser@example.com>

("WordPress" is an idea after trying more obvious options like "Unknown", "Anonymous", "Non-user", "Unauthenticated" and similar; the word "WordPress" at least indicates that the commit was created by this CMS but I'm open to other options as well.)

@pavelevap
Copy link
Copy Markdown
Collaborator Author

I am not sure about naming. I liked "Anonymous" initially, but what about "VersionPress" (commit was created by VersionPress)? Email vp+nouser@example.com is fine, I guess (or vp+anonymous@example.com?).
I like the idea of comparing email (and not name) and removing "action".

@borekb
Copy link
Copy Markdown
Member

borekb commented May 15, 2019

I like the "VersionPress" suggestion, this is how it would look:

Author: VersionPress <vp+nouser@example.com>

What do you think?

BTW, are you comfortable enough trying to update the front-end as well? I think that the icon and tooltip are reasonable for now, just the detection should change to an email (and included the current nonadmin@example.com as well for compatibility).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-migration Breaking change between VP versions due to a change in storage format. Needs migration. scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different tracking of admin/public actions

2 participants