Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tracking of actions as registered/anonymous #1449

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pavelevap
Copy link
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') {

REST requests are handled correctly now (when user is logged in) and there is no need for special method handleAsAdminSectionRoute().
@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
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
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
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 join this conversation on GitHub. Already have an account? Sign in to comment
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
4.0-beta2 → 4.0-beta3
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

Different tracking of admin/public actions
2 participants