[wp-trac] [WordPress Trac] #4575: Add functions to return the last-modified timestamp of a category/tag

WordPress Trac noreply at wordpress.org
Mon Jun 15 21:20:46 UTC 2015


#4575: Add functions to return the last-modified timestamp of a category/tag
--------------------------------------------+-----------------------
 Reporter:  delusions                       |       Owner:  jorbin
     Type:  enhancement                     |      Status:  reopened
 Priority:  normal                          |   Milestone:  4.3
Component:  Feeds                           |     Version:  2.2.1
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch needs-testing commit  |     Focuses:  template
--------------------------------------------+-----------------------

Comment (by stevenkword):

 Replying to [comment:29 nacin]:
 > Something feels a bit off about this. I can't put my finger on it.
 >
 >  * The query for a comments feed looks kind of nasty. Is it actually
 necessary for `/comments/feed/`? I don't think so. I think it's only
 necessary for a comment feed for an individual post, which should be a lot
 easier to query and wouldn't require the IN or MAX. Can a comment feed
 other than `/comments/feed/` have comments from more than one post? Should
 we even try to support that with an insane query that could be a slow
 query against a huge DB table? I'm not sure.

 I see what you are saying regarding the query and I'm taking another look
 at it. I think we can make this perform a lot better given those truths.

 >  * This doesn't patch atom feeds.

 Agreed, this should patch atom as well. I will include this in the
 upcoming patch.

 >  * What's the purpose of get_lastcommentmodified()? Assuming the atom
 feed is also updated, it won't be used anymore. Seems like we might need
 to do some tweaks.

 I did a little digging through the plugin repo and found that
 [https://github.com/stevenkword/WordPress-Plugin-Directory-
 Slurper/blob/master/get_lastcommentmodified.txt: 6 plugins] are using
 `get_lastcommentmodified` and roughly [https://github.com/stevenkword
 /WordPress-Plugin-Directory-Slurper/blob/master/get_lastpostmodified.txt:
 100 plugins] are making calls to `get_lastpostmodified`. Looking at some
 of those plugin names, I am not sure we should deprecate the functions
 since the expected behavior might be slightly different.

 The existing core functions both return a cached value that is relevant to
 all content, system wide.  This might be useful for things like timestamps
 for sitemaps.  On the other hand, the proposed function
 `get_last_build_date_feed` was designed to return the timestamp related to
 the most recently modified unit of content on any given request.  This
 provides a level of granularity that previously did not exist for things
 like category feeds, independently of each other.

 I am thinking now that the function should be more generalized to
 something like `get_last_build_date` (dropping _feed) since we could also
 use it for things like Last-Modified HTTP headers.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/4575#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list