Viewing 10 replies - 1 through 10 (of 10 total)
  • It sounds like this problem could be related to permalinks. When BLC finds a relative link in a post, it figures out the full URL based on the post permalink and the relative URL. If WP-Portability somehow causes the get_permalink() API function to return the wrong permalink, BLC will get the link URL wrong and report it as broken.

    When you look at your post(s) in the editor, what permalink do you see? Does it match the address bar URL you see when you view the same post as a visitor?

    Thread Starter DivaVocals

    (@divavocals)

    Yes the permalinks match.. what’s happening is BLC is reporting the links INSIDE THE POST incorrect and reporting them as broken links.. WP Portability is a plugin that makes post/page links relative links.. (as they SHOULD be IMHO)

    Thread Starter DivaVocals

    (@divavocals)

    So it happened again today.. Here’s the post:
    http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/tablelegworld-road-show-chicagos-neocon-features-awesome-adjustable-height-seating/

    BOTH images in the post were reported as broken links. In the source here’s what is found:

    <div class="entry-content" itemprop="text"><p><a href="/tablelegblog/wp-content/uploads/2014/07/neocon-1-150x150.jpg"><img class="alignright wp-image-150" src="/tablelegblog/wp-content/uploads/2014/07/neocon-1-150x150.jpg" alt="neocon 1" height="175" width="175"></a>

    ALL WP-Portability does is to turn all of my absolute links into relative links.. That’s it.. If you are using the get_permalink() API function that’s probably why BLC is INCORRECTLY reporting all of my media images as broken links.

    BLC is reporting both the image location and the image URL as broken links. NEITHER of these is broken..

    BLC is apparently expecting the full URL for the image to be http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/tablelegworld-road-show-chicagos-neocon-features-awesome-adjustable-height-seating/wp-content/uploads/2014/07/neocon-1-150×150.jpg.

    The CORRECT URL for the image SHOULD BE: http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/wp-content/uploads/2014/07/neocon-1-150×150.jpg.

    Yes the permalinks match.. what’s happening is BLC is reporting the links INSIDE THE POST incorrect and reporting them as broken links.

    I get that. To be able to check a link, BLC needs to convert it from relative back to absolute. BLC checks links by sending a HTTP request for each one and checking the response to see if was successful or something like “404 Not Found”. You can’t do that if you just have a relative URL like “example.jpg”; you also need the domain name and directory path (if any).

    And that’s why it looks at the post permalink, which is the base URL for all the relative links in that post.

    WP Portability is a plugin that makes post/page links relative links.. (as they SHOULD be IMHO)

    This is a bit misleading. As far as I can tell from WP-Portability docs, testing, and reading plugin source code, WP-Portability doesn’t output relative links by default. Instead, it outputs different absolute URLs depending on the current site URL.

    And yes, I did try WP-Portability on my own site to see how it works in practice. The post source code showed absolute URLs. BLC also showed the correct URLs, both for images and normal links.

    So the question is: how did you make WP-Portability turn your absolute links into relative links? Did you enter the [url] shortcodes manually? Are you using an older/newer version of WP-Portability? I tested version 1.0.1.

    If you are using the get_permalink() API function that’s probably why BLC is INCORRECTLY reporting all of my media images as broken links.

    Well then, what else should it use to resolve relative links?

    BOTH images in the post were reported as broken links. In the source here’s what is found: […]

    Is that the source code from the “Text” tab in the post editor, or is it what you see when you “View Source” in your web browser? In general, the code from the editor is more important since that’s usually what the plugin would see.

    Thread Starter DivaVocals

    (@divavocals)

    Is that the source code from the “Text” tab in the post editor, or is it what you see when you “View Source” in your web browser? In general, the code from the editor is more important since that’s usually what the plugin would see.

    It is from BOTH.. It is what you see in the the “Text” tab in the post editor AND what you see in the browser “View Source”.

    So the question is: how did you make WP-Portability turn your absolute links into relative links? Did you enter the [url] shortcodes manually? Are you using an older/newer version of WP-Portability? I tested version 1.0.1.

    WP-Portability will allow me to use relative links in my posts and they will not break when viewing from browser. This is what I did. I am also using the LATEST version of WP-Porability.

    Well then, what else should it use to resolve relative links?

    from my earlier post.. BLC reports any of my relative links as broken..

    http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/tablelegworld-road-show-chicagos-neocon-features-awesome-adjustable-height-seating/

    BOTH images in the post were reported as broken links. In the source here’s what is found:

    <div class=”entry-content” itemprop=”text”><p><img class=”alignright wp-image-150″ src=”/tablelegblog/wp-content/uploads/2014/07/neocon-1-150×150.jpg” alt=”neocon 1″ height=”175″ width=”175″>

    BLC is reporting both the image location and the image URL as broken links. NEITHER of these is broken..

    BLC is apparently expecting the full URL for the image to be http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/tablelegworld-road-show-chicagos-neocon-features-awesome-adjustable-height-seating/wp-content/uploads/2014/07/neocon-1-150×150.jpg.

    The CORRECT URL for the image SHOULD BE: http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/wp-content/uploads/2014/07/neocon-1-150×150.jpg.

    This part of the URL BLC reports as a broken link: tablelegworld-road-show-chicagos-neocon-features-awesome-adjustable-height-seating doesn’t belong..

    It is from BOTH.. It is what you see in the the “Text” tab in the post editor AND what you see in the browser “View Source”.

    Okay, that’s good to know. So did you enter those relative URLs yourself, or somehow generate them with WP-Portability? If you entered them manually, what caused you assume that WP-Portability was involved in this problem?

    WP-Portability will allow me to use relative links in my posts and they will not break when viewing from browser.

    Relative links usually work fine without needing to install additional plugins. It looks like in this case WP-Portability is necessary because you have multiple URLs for the same site, or the site has been moved to a different URL. Is that correct?

    BLC is apparently expecting the full URL for the image to be http://tlwtestsite(dot)tablelegworld(dot)com/tablelegblog/tablelegworld-road-show-chicagos-neocon-features-awesome-adjustable-height-seating/wp-content/uploads/2014/07/neocon-1-150×150.jpg.

    Looking at that URL, the only way I see that BLC could come up with something like that would be if the relative URL didn’t have a leading slash. For example, <img src="wp-content/uploads/2014/07/neocon-1-150x150.jpg"> would make it return the wrong URL. Presumably, the original code does have the slash. Hmm…

    Well then, what else should it use to resolve relative links?

    from my earlier post.. BLC reports any of my relative links as broken..

    That doesn’t really address the “what should it use instead of permalinks” question at all, but all right. Lets move on.

    Thread Starter DivaVocals

    (@divavocals)

    Relative links usually work fine without needing to install additional plugins. It looks like in this case WP-Portability is necessary because you have multiple URLs for the same site, or the site has been moved to a different URL. Is that correct?

    That is not correct.. I do not have multiple URLs for this site.. This is a development site so that I am not impacting the live site when making changes/updates.. (not an uncommon workflow/setup)

    WP-Portability is necessary because WordPress has NEVER supported relative links.. There’s LOTS of articles about why the developers of WordPress have taken this stance.. WP-Portability is a plugin that makes relative links in WordPress possible..

    So did you enter those relative URLs yourself, or somehow generate them with WP-Portability? If you entered them manually, what caused you assume that WP-Portability was involved in this problem?

    I entered them myself, and WP-Portability makes sure they work correctly..

    WordPress does NOT support relative links natively..

    Lots out there on this topic… See the following:

    Without WP-Portability, if I used relative links/images in posts, WordPress by DEFAULT will precede the relative link with the permalink of the post. (which is INCORRECT). BLC appears to be doing the SAME thing which is why some of my media links are being reported as broken links..

    In any case we appear to be going in circles a bit here.. You don’t think this is an issue.. I disagree, and reported it in case anyone else was having the same issue with WP Portability or plugins like it and BLC..

    For now, I will simply have to live with this apparently. So I will deal with the incorrectly reported broken links by dismissing them, and hopefully this will “stick” and I won’t have to worry about it anymore.. It would be nice if they weren’t being erroneously reported to begin with.. **shrug**

    Info about how WP-Portability works, and it’s purpose..
    Source: http://www.plankdesign.com/blog/2014/08/planks-first-plugin-wp-portability/

    WordPress, on the other hand, depends on a lot of absolute paths. The domain name to your wordpress install is normally hard-coded into the database and the system path is hard-coded into the htaccess file. This can make moving the site a real nuisance and makes sharing a database near impossible (i.e. between a front-end and back-end developer).

    Another point of frustration is the fact that any media or links added to the TinyMCE editor will use absolute links by default, meaning they will all break once the site is deployed to another server. Going through a database to update the urls in hundreds of posts is utterly monotonous. I have seen other plugin which try to address this by making all links root-relative (i.e. leading ‘/’ ), though this will still break if the depth of the WordPress install changes (http://localhost/example vs. http://example.com) This is admittedly an issue that few content management systems are able to adequately address. Until now.

    So What Does This Plugin Do?

    The plugin works by making the following changes to the way WordPress operates in order to remove all the issues that tie it to an install directory or a domain:

    Dynamic File Paths: WP-Portability figures out where it is being run from programmatically so that WordPress no longer needs to depend on an absolute path in the database.
    Dynamic Rewrites: WP-Portability changes the way WordPress writes its htaccess files, so that it always uses relative paths from the install location, rather than the domain root.
    Always local URLs: WP-Portability filters the content of any post being saved in order to store absolute links. Any URL that points to media or pages in the current install is instead silently converted into a shortcode. Whenever the post is edited or viewed, that shortcode is unpacked to rebuild the link so that it works regardless of the current installation directory.

    WP-Portability allows you to freely move the wordpress install however you please with minimal complication. Moving your existing wordpress install from the domain root to /blog? No problem. Copying your theme, database and uploads to a new wordpress install on a new server? Also Easy.

    Thread Starter DivaVocals

    (@divavocals)

    Looking at that URL, the only way I see that BLC could come up with something like that would be if the relative URL didn’t have a leading slash. For example, <img src=”wp-content/uploads/2014/07/neocon-1-150×150.jpg”> would make it return the wrong URL. Presumably, the original code does have the slash. Hmm…

    The original code (which I posted) DOES contain the leading slash.. Gonna just try and work through this.. Hopefully it will be as easy as dismissing the incorrectly reported broken links.. If it becomes too much for my client to manage (ie: too many broken links being reported too often), I may have to consider other options..

    WP-Portability is necessary because WordPress has NEVER supported relative links..

    All right, perhaps I oversimplified the situation. It’s true that WordPress doesn’t offer any special support for relative links. However, it also doesn’t prevent you from manually inserting relative links, and root-relative links usually work fine without additional plugins unless you try to move the site to/from a subdirectory.

    For example, consider these two links you quoted:

    http://www.456bereastreet.com/archive/201010/how_to_make_wordpress_urls_root_relative/
    http://www.deluxeblogtips.com/2012/06/relative-urls.html

    All they do is show how to convert absolute URLs to the root-relative form. Technically speaking, they don’t add support for relative links to WordPress, they just make relative links easier to use.

    Looking at that URL, the only way I see that BLC could come up with something like that would be if the relative URL didn’t have a leading slash. For example, <img src=”wp-content/uploads/2014/07/neocon-1-150×150.jpg”> would make it return the wrong URL. Presumably, the original code does have the slash. Hmm…

    The original code (which I posted) DOES contain the leading slash..

    In that case, I’m afraid I’m out of ideas. Sorry. Normally BLC would parse links like that correctly. If it sees a leading slash, it doesn’t just append the link to the permalink. Instead it takes the permalink, drops the directory path, and appends the relative URL to the domain name to get an absolute URL.

    It might be possible to track down the problem by adding (more) logging to the plugin to see where it gets the wrong URL. However, it would involve sending log files back and forth, and it would take a while anyway.

    Thread Starter DivaVocals

    (@divavocals)

    All right, perhaps I oversimplified the situation.

    Ummm.. yeah.. a bit..

    It’s true that WordPress doesn’t offer any special support for relative links. However, it also doesn’t prevent you from manually inserting relative links, and root-relative links usually work fine without additional plugins unless you try to move the site to/from a subdirectory.

    They don’t work everywhere natively. Try adding a root relative link to the menu.. try adding one to a widget.. see if they work from ANYWHERE on the site.. which is why there’s a tutorial on the WP site for finding and replacing links when moving a WordPress site.. This is why there are still discussion/debates about this topic..

    All they do is show how to convert absolute URLs to the root-relative form. Technically speaking, they don’t add support for relative links to WordPress, they just make relative links easier to use.

    ummmm.. not just make ’em easier to use.. make WordPress NOT make/convert all links to absolute links. Read these articles again..

    Normally BLC would parse links like that correctly. If it sees a leading slash, it doesn’t just append the link to the permalink. Instead it takes the permalink, drops the directory path, and appends the relative URL to the domain name to get an absolute URL.

    Right well I reported what I saw happening… I’m moving on.. I’ll figure out a way to deal or find another solution.. Thanks for trying to help..

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Conflicts with "WP Portability" plugin’ is closed to new replies.