five-for-the-future icon indicating copy to clipboard operation
five-for-the-future copied to clipboard

Prevent duplicate contributors for same company, remove existing

Open iandunn opened this issue 1 year ago • 0 comments

Some companies have added the same contributor twice, probably by accident or because they forgot they were already added.

We should prevent that from happening, and remove the existing instances.

Examples

  • https://wordpress.org/five-for-the-future/wp-admin/post.php?post=4265&action=edit and https://wordpress.org/five-for-the-future/wp-admin/post.php?post=4280&action=edit
  • https://wordpress.org/five-for-the-future/wp-admin/post.php?post=3866&action=edit and https://wordpress.org/five-for-the-future/wp-admin/post.php?post=4046&action=edit
  • https://wordpress.org/five-for-the-future/wp-admin/post.php?post=3871&action=edit and https://wordpress.org/five-for-the-future/wp-admin/post.php?post=4045&action=edit

There's probably more, though.

This query helps to find them, but it'll also include folks who are legitimately sponsored by multiple companies. Make sure you don't prevent/remove that.

SELECT post_title, count(*) title_count
FROM `wporg_668_posts`
where post_type = '5ftf_contributor' and post_status = 'publish'
group by post_title
having title_count > 1

iandunn avatar Nov 03 '23 14:11 iandunn