[wp-hackers] shortcode for images?

Chris Jean gaarai at gaarai.com
Thu Jan 29 20:59:20 GMT 2009


I think both you and Paul are onto something in that absolute references 
stored in the database cause many headaches when migrating, testing, or 
dry dock building a site. However, scribu has an edge here with the 
performance issue.

There's no reason to cause a performance penalty for each and every 
image added to a post each and every time that post is rendered simply 
to make certain edge-case situations more manageable. In addition, these 
situations where value would be added never occur for most users. As for 
those who would benefit, most would only get value at that one point 
where the site URL is modified.

Adding a performance hit of this magnitude just to make a single event 
easier to handle is a poor solution. I also think that it's barking up 
the wrong tree.

The problem isn't that the format that image references are stored in 
when added to post content is poor. The problem is that WordPress 
installations as a whole don't transfer well.

So, I propose that some sort of transfer mechanism be added to the core 
of WordPress. This transfer mechanism will intelligently handle updating 
all data in the database that needs to be updated when the siteurl 
and/or home are modified. In addition, an action is fired before and 
after this data transfer occurs so that plugins can do any necessary 
changes as well.

This type of solution doesn't impact the performance of the core in any 
way while still enabling simple migrations of site data.

Chris Jean
http://gaarai.com/
http://wp-roadmap.com/



Mike Schinkel wrote:
> I'm running into exactly the same type of problems, today in fact.
> Hardcoded URLs really cause a lot of deployment headaches. They should ideally be turned into a reference.
> I don't know if shortcodes are the answer, but they sound like a better solution than what we have thus far.
>
> -Mike Schinkel
> http://mikeschinkel.com/
>
> ----- Original Message -----
> From: "Paul" <paul at codehooligans.com>
> To: wp-hackers at lists.automattic.com
> Sent: Thursday, January 29, 2009 1:36:45 PM GMT -05:00 US/Canada Eastern
> Subject: [wp-hackers] shortcode for images?
>
> All,
>
> Just wondering is there are any future core plans to replace the full  
> URL of images inserted into Posts/Pages with some new image shortcode?
>
> Historically I've always disagreed with placing the full image URL  
> into the post body since this limits the overall blog portability. As  
> a full-time developer I usually develop the client WordPress site on  
> my local system. This includes importing any legacy blog posts,  
> images, documents, etc. When I push this to the client server I have  
> to search and replace the local URL the client site URL. Not s big  
> issue really I know.
>
> Another example. I'm converting this HRC blog site http://www.hrcbackstory.org/ 
>   from TypePad to a self-hosted WordPress instance http://blogstaging.hrcsupport.org 
> . The site has over 1460 posts and most post have 2 or more images.  
> The dev URL 'blogstaging.hrcsupport.org' used for the staging site  
> will need to be updated when they point the live domain 'www.hrcbackstory.org 
> ' to the self-hosted WordPress site end of next week. At that time  
> I'll need to update the database. Again, not a big issue. But would be  
> nice if the client could do this themselves. I was thinking there  
> could be a cleaner way.
>
> Seems that shortcodes are all the rage now. Most media plugin  
> developers are utilizing them quite well. So why is WordPress still  
> using the full URL for the image source? I noticed the new image  
> caption already uses shortcode [caption... ]. Seems it would not be a  
> big task to use a shortcode for the image itself. Just wondering.
>
> Paul Menard
> http://www.codehooligans.com
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>   


More information about the wp-hackers mailing list