WPIntell

Source evidence

Media library links broken

Rackspace CDN · support · 2015-01-29T03:18:00+00:00

mixedsentiment
highseverity
0.94relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 37 rows with source links

18.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

30 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
FS resolved
After installing this plugin (which is great by the way!), the links in the media library have all broken. Everything works fine otherwise. What is happening is the plugin is adding the custom CNAME subdomain I have set in the program’s settings in addition to the old full URL to the images to make a non-existent full URL for each item in the library, i.e. http://img.example.com/http://www.example.com/wp-content/uploads/2015/01/file.jpg The link should be http://img.example.com/2015/01/file.jpg to display the images properly in the library as per the new configuration under the plugin. As best I can tell, it appears that the function set_cdn_path inside of lib/functions.php is where the problem is coming from. Any suggestions on how to fix this? If more information is needed please let me know. https://wordpress.org/plugins/rackspace-cloud-files-cdn/ I fixed this problem. It’s not ideal as it’s hardcoded based on the actual URL’s for my website and custom CNAME for the Rackspace cloud files container, but it works. I hope the developer can use this information to implement a permanent fix in a future upgrade because overall this plugin seems great. Here are the details for anybody else who might encounter this problem. The change I made assumes a custom CNAME of http://img.example.com is being used to point to the Rackspace cloud files container. In lib/functions.php around line 493, you will find this line: $attachment = str_replace($cur_attachment, $cdn_url.'/'.$new_attachment, $attachment); Immediately after this line, I added the following line (including a few lines of comments for explanation): // this function is returning media attachment urls as: // http://img.example.com/http://www.example.com/wp-content/uploads/2015/01/RetirementIncomePlan_PartTime.png // added the below line to strip out the extraneous URL $attachment = str_replace('http://www.example.com/wp-content/uploads/', '', $attachment); I used your fix to get mine working… though the instrcution confused me a bit. I found the line 493 and the code. I had to make this edit to get it to work. $attachment = str_replace('myCDN-CNAME.r59.cf2.rackcdn.com', '/wp-content/uploads/', $attachment); then it worked… thanks so much for the fix.

Comments

2 shown
FS 2015-02-03T15:01:00+00:00

I fixed this problem. It’s not ideal as it’s hardcoded based on the actual URL’s for my website and custom CNAME for the Rackspace cloud files container, but it works. I hope the developer can use this information to implement a permanent fix in a future upgrade because overall this plugin seems great. Here are the details for anybody else who might encounter this problem. The change I made assumes a custom CNAME of http://img.example.com is being used to point to the Rackspace cloud files container. In lib/functions.php around line 493, you will find this line: $attachment = str_replace($cur_attachment, $cdn_url.'/'.$new_attachment, $attachment); Immediately after this line, I added the following line (including a few lines of comments for explanation): // this function is returning media attachment urls as: // http://img.example.com/http://www.example.com/wp-content/uploads/2015/01/RetirementIncomePlan_PartTime.png // added the below line to strip out the extraneous URL $attachment = str_replace('http://www.example.com/wp-content/uploads/', '', $attachment);

krisidious 2015-04-03T13:20:00+00:00

I used your fix to get mine working… though the instrcution confused me a bit. I found the line 493 and the code. I had to make this edit to get it to work. $attachment = str_replace('myCDN-CNAME.r59.cf2.rackcdn.com', '/wp-content/uploads/', $attachment); then it worked… thanks so much for the fix.