Opened 4 years ago

Closed 3 years ago

#340 closed enhancement (fixed)

Public Profiles

Reported by: Secretmapper Owned by: Secretmapper
Milestone: 1.0 Priority: normal
Version: Component: General
Keywords: Cc:


Public Profile to view stats of a user.

Now we can link actual profiles when listing user's names (Translated by, Permissions, Validators' profiles, etc.)


Related Tickets: https://glotpress.trac.wordpress.org/ticket/299

Attachments (6)

public.patch (25.1 KB) - added by Secretmapper 4 years ago.
public.2.patch (26.8 KB) - added by Secretmapper 4 years ago.
public.3.patch (25.3 KB) - added by Secretmapper 4 years ago.
public.4.diff (25.9 KB) - added by Secretmapper 4 years ago.
scalability.diff (5.8 KB) - added by markoheijnen 3 years ago.
Proof of concept
scalability.2.diff (7.3 KB) - added by markoheijnen 3 years ago.

Download all attachments as: .zip

Change History (35)

4 years ago

#1 @Secretmapper
4 years ago

Next up would be the API.

#2 @markoheijnen
4 years ago

Awesome, I can't wait to have the API for this. I will check it out tonight.

#4 @yoavf
4 years ago

Some small things to get started:

  • Let's rename get_proj_shortcuts to get_projects_shortcuts.
  • In GP_Route_Profile::profile_view(), you'll need to check if $locale_data[$shortcut->locale] is set before doing a += operation
  • The patch has a diff on gp-templates/public-profile.php, but that file doesn't exist in the repo right now.

#5 @Secretmapper
4 years ago

  • Owner set to Secretmapper
  • Status changed from new to assigned

Glotpress Profile API is done!

Here's a wordpress plugin/widget utilizing it:

#6 @Secretmapper
4 years ago

Patch addresses @yoavf's suggestions. Also reworked the way data is structured for the API.

Do you guys think I should also attach the wordpress plugin file here?

#7 @Secretmapper
4 years ago

#94 was marked as a duplicate.

#8 @markoheijnen
4 years ago

Could you still look at the diff of gp-templates/public-profile.php while the file isn't in the repo?

#9 @Secretmapper
4 years ago

Sorry about that :) I re-diffed and and the new files should now be on Revision 0

#10 @markoheijnen
4 years ago

I do think we should rename the template for public profiles to profile-public.php. Also we should have a function to request the profile url instead of always using gp_url.

#11 @markoheijnen
4 years ago

The "Validator of" is missing the <ul></ul>tag.

Last edited 4 years ago by markoheijnen (previous) (diff)

#12 @markoheijnen
4 years ago

  • Component changed from Accessibility to General

We do need to check if translation sets still belong to a project. Since in GlotPress you can delete a project but it then doesn't delete the translation sets. Currently I put a check in GP_Route_Profile::profile_get() to see if $projects[$contrib->project_id] != false.

#13 @markoheijnen
4 years ago

It also seems you close to many diffs in gp-templates/profile.php. Just before <h3>Settings</h3>

#14 @markoheijnen
4 years ago

Unsure how we want to do the gravatar image. Currently someone can't change the size if it wants to have a different theme.

Also the url is incorrect, it should be $grav_url = 'http://www.gravatar.com/avatar/' . md5(strtolower($user->user_email)) . '?s=200'; .

#15 @Secretmapper
4 years ago

Okay, latest patch did the necessary changes as you mentioned.


is now just a base gravatar image url so that theme makers/customizers can just append their wanted gravatar size.

#16 @markoheijnen
4 years ago

Great, I will do another check this week.

#17 @markoheijnen
3 years ago

In 965:

Add helper methods to the User object to retrieve the gravatar. recent projects and locales known.

Props Secretmapper for the initial patch.

See #340.

#18 @markoheijnen
3 years ago

In 966:

Add public profiles to see a user's recent projects, contributions and which projects they can validate.

Props Secretmapper for the initial patch.

See #340.

#19 @markoheijnen
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Closed as fix.

#20 @markoheijnen
3 years ago

  • Milestone changed from Future Release to 1.0

#21 @markoheijnen
3 years ago

In 971:

Limit recent project. See #340.

#22 @nbachiyski
3 years ago

In 979:

Disable public profiles for scalability reasons

Few of the queries run a full-table scan on the huuge translations table,
so we can't deploy this in production in its current form.

Since we want to deploy some later changes, here we just disable the route
and remove the links until performance is better.

See #340.

#23 @markoheijnen
3 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

3 years ago

Proof of concept

#24 @markoheijnen
3 years ago

Latest patch is just a proof of concept that changes the logic which destroys counts for now.


  • use $amount to limit the result
  • Fix count
  • Change logic for get_project?
  • Move time_since() method to a normal function

#25 @markoheijnen
3 years ago

In 982:

Rewrite how we get recent projects/translation sets of a user.
Increases the performance when you are dealing with a lot of translations.
It also stops returning human readable time through the API which should be calculated on display.

See #340

#26 @markoheijnen
3 years ago

Committed the first big chunk. Changes from last patch is not using a subquery but instead query per translation set.
Because of this I also decided to change how we limit it by breaking the foreach loop early so we don't call queries we don't need. Also the method get_project get renamed to get_translation_set() since that was what it referred too.

#27 @markoheijnen
3 years ago

In 983:

Fix changed variable in GP_User after last changes.

See #340

#28 @markoheijnen
3 years ago

In 987:

Fix getting permissions of the user on the profiles page.
Includes not showing translation sets that belong to deleted projects.

See #340

#29 @markoheijnen
3 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 1001:

Re-enabling profiles after [982], [983] and [987].

Fixes #340

Note: See TracTickets for help on using tickets.