Skip to:
Content

bbPress.org

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#2291 closed enhancement (fixed)

bbPress Reply [Title+Slug+Link] Logic !

Reported by: alex-ye Owned by: johnjamesjacoby
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.2.3
Component: Component - Replies Keywords: has-patch 2nd-opinion
Cc: nashwan.doaqan@…, gawain.lynch@…, alexvornoffice@…

Description

Hi, I think the title is so general but it's good for what I want to discuss.

I really like bbPress and many staff in it, I love it simplify and performance but I am not feel good with the current bbPress replies title/slug/permlink logic !

Why ?

At first I want you to understand the bugs that I faced with the current logic.

1- Reply title is not dynamic:
As you know the current bbPress replies structure is "Reply To: %topic_title%" and saved in the database, but what if I change the topic title ? The reply title should be change too, but this what it doesn't happened because it will cost the sever performance a lot !

2 - Post a new reply is too slow :
It's true, when you post a new reply in a topic it might be too slow because it runs many queries, as n example did you tried to post a new reply in a topic had a "1000" reply ? you will be surprised !!

as you know the reply title is the same for every reply in each topic, the reply slug is the same !, So WordPress loop thought all replies just to make the reply slug unique !!

and this makes bbPress stuck when it handle a topic with many replies !

3 - The reply permalink isn't cool
I am thinking that the current reply URL structure isn't excellent, It's good that it's support the pretty permalinks , but do we need this, really?

/?reply=reply-to-topic-46
/reply/reply-to-topic-46

I think it's fine to be just like that:
/?reply=109
/reply/109

So when you move the replies or change the topic title the reply URL will not be broken !, The reply URL should be more flexible :)


How I suggest to solve all this ?

After all, I believe that we should take care of backward compatibility and the respect the user choices, so the fix should be so easy.

The key to solve all this is to have an empty reply title in the database ! WordPress support now the empty post title, So this can help us to make the replies logic better, and having an empty reply title will help us to do this:

1- The reply slug will be the reply ID (WordPress do this automaticly) so posting a new reply will be more faster and reply permlinks will be shorter !

2- The reply title could be dynamic :)

3- Search result will be better !
Try to search by a topic title in the bbPress search form, You will find that all the topic replies is in the results !, and the topic it self is in the last page !

hope to listen to your opinions :)

Attachments (9)

common-template-tags.patch (1.3 KB) - added by alex-ye 7 years ago.
core-filters.patch (918 bytes) - added by alex-ye 7 years ago.
replies-functions.patch (851 bytes) - added by alex-ye 7 years ago.
replies-template-tags.patch (4.4 KB) - added by alex-ye 7 years ago.
common-template-tags-2.patch (1.1 KB) - added by alex-ye 7 years ago.
replies-template-tags-2.patch (2.2 KB) - added by alex-ye 7 years ago.
2291.patch (4.6 KB) - added by alex-ye 7 years ago.
Third Draft
2291.2.patch (4.1 KB) - added by johnjamesjacoby 6 years ago.
Updated for latest trunk
2291.1.diff (4.3 KB) - added by netweb 6 years ago.

Download all attachments as: .zip

Change History (20)

#1 @alex-ye
7 years ago

  • Cc nashwan.doaqan@… added

For who like the idea please test the first-draft patches above :)

#2 @gawain
7 years ago

  • Cc gawain.lynch@… added

#3 @alex-ye
7 years ago

Done in the second patches:

1- Remove the $fallback_to_topic_title parameter, I think it was so tricky !

2- Remove the hidden reply title input form the edit screen.

3- a less codes :)

I left the $_POSTbbp_reply_title? checks because compatibility, and for any theme/plugin need to make a custom reply title.

Last edited 7 years ago by alex-ye (previous) (diff)

#4 @johnjamesjacoby
7 years ago

  • Milestone changed from Awaiting Review to 2.4

Seems like a neat change for 2.4. Moving to 2.4 to look into this more then. Thanks for the patches. These all make sense, and seem like good ideas for the future.

#5 @alexvorn2
7 years ago

  • Cc alexvornoffice@… added

#6 @johnjamesjacoby
7 years ago

  • Keywords early added; 2nd-opinion removed
  • Milestone changed from 2.4 to 2.5

No time. Moving to 2.5 and tagging early.

@alex-ye
7 years ago

Third Draft

#7 @alex-ye
7 years ago

The patch is refreshed now, I think we will have enough time to test in the beta versions.

@johnjamesjacoby
6 years ago

Updated for latest trunk

#8 @johnjamesjacoby
6 years ago

  • Keywords 2nd-opinion added; needs-testing early removed

Patch looks good to me. Undecided if we should make this change, but the code works well.

#9 @johnjamesjacoby
6 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to closed

In 5177:

When creating new replies, do not force them to have a title. This is new as of WordPress 3.7, to be more accommodating to post formats that don't cater to titles very well (image/status/video/etc...)

Until now, replies to topics have always shared the topic title (and incremental slugs) in common with each other. With this change, replies will now mostly be identified via their post ID. This helps with search results, and avoids some reply-slug confusion as to why they need to have titles or slugs at all.

Props alex-ye for the clever solution. Fixes #2291.

@netweb
6 years ago

#10 @johnjamesjacoby
6 years ago

In 5178:

Move filter adding higher up in filters.php. See #2291.

#11 @johnjamesjacoby
6 years ago

In 5179:

Bump priority from 1 to 2, to give some wiggle room for third party developers. See #2291.

Note: See TracTickets for help on using tickets.