Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
290 stars 205 forks source link

The Author Page and WP Posts Shows 0 Entries with Plugin Enabled! #869

Open saadirfan opened 2 years ago

saadirfan commented 2 years ago

I inherited a weird bug to troubleshoot. — We have an author with over 3k posts.

With the co-authors plugin enabled:

With the co-authors plugin disabled:

Here is what I've tried:

  1. Deleted the user and re-assigned to a new user using WP CLI tools.
  2. Checked: post_author field in the wp-posts table shows the correct author ID.
  3. No traces of 'cap-xxx" in wp-postmeta for any entries.
  4. No Guest Author with this email or display name

Here is what I think could help me:

Again, disabling the co-authors plugin fixes the issue.

WP: Version 6.0.2 (VIP hosted) Co-Authors Plus: Version 3.5.2

saadirfan commented 2 years ago

If it matters, the issue first appeared when a team member attempted to delete and reassign the author's content to a new profile because their business email address changed.

Old Profile: Name: JOHN SMITH Email: john(at)olddomain.com

New Profile: Name: JOHN SMITH (same display name) Email: john(at)newdomain.com

saadirfan commented 2 years ago
authors-meta

Further, the Authors meta box appears empty for these posts.

rebeccahum commented 1 year ago

@saadirfan Have you run the backfill CLI command wp co-authors-plus create-terms-for-posts?

saadirfan commented 1 year ago

@rebeccahum I just ran the command and got the following. But no changes on the front-end side. The author in question is still missing old posts and only showing recently added (new) entries. Again, disabling the plugin brings back all entries.

Updating author terms with new counts
Success: Done! Of 100244 posts, 15 now have author terms.
bmoredrew commented 1 year ago

@saadirfan Did you fix this? I had a similar issue and the wp cli command did not fix it.

I found extra entries for those users in wp_term_taxonomy - removing the incorrect ones solved this. In my case they were with ones that had a 0 in the count column. One of the users also had a mismatch term_id and term_taxonomy_id

You can verify which ones are correct by searching for each users respective term_id in wp_term_relationships where you'll find all the mapping for their posts.