New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 on Amber's JS and CSS files when viewing a WordPress post #25

Closed
aribn opened this Issue Jan 29, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@aribn
Copy link

aribn commented Jan 29, 2016

I just installed the Amber plugin for WordPress (4.4.1) and preserved links for a sample post. When I then viewed the post in my browser, I got 404 errors for Amber's JS file and CSS stylesheet. In both cases, the issue seems to be that the path requested include /plugins/amber/ rather than /plugins/amberlink/. (GET http://favorites.aribadernatal.com/wp-content/plugins/amber/js/amber.js) As a result, clicking the link does not trigger any Amber behavior.

@jlicht jlicht self-assigned this Jan 29, 2016

@jlicht

This comment has been minimized.

Copy link
Member

jlicht commented Jan 29, 2016

Thanks for the report. I believe your diagnosis is correct, and we're working on getting the fix out.

@genevec

This comment has been minimized.

Copy link
Contributor

genevec commented Jan 29, 2016

We just pushed 1.4.1 on WordPress. Once you update, it should be working for you.

@aribn

This comment has been minimized.

Copy link

aribn commented Jan 29, 2016

Those files are successfully loading after updating the plugin, but nothing happens when I hover over a link that has been archived. The Amber Dashboard shows that links were successfully snapshotted. I set Available Links and Unavailable Links both to the "hover" setting, but nothing happens when I hover over a an archived link. Wordpress site at http://favorites.aribadernatal.com.

@genevec

This comment has been minimized.

Copy link
Contributor

genevec commented Jan 29, 2016

How many seconds have you set the "Hover delay" to notify the end user? For immediate display of preserved links, you might want to indicate 0 there.

If this isn't the problem, let me know and we'll keep digging.

@aribn

This comment has been minimized.

Copy link

aribn commented Jan 29, 2016

It had been at 2 seconds. I changed both to 0 seconds, but still nothing pops up.

@genevec

This comment has been minimized.

Copy link
Contributor

genevec commented Feb 1, 2016

Hmm. @jlicht would you be able to look into this?

@jlicht

This comment has been minimized.

Copy link
Member

jlicht commented Feb 1, 2016

It suspect that the regexp in the filter that examines a post before it's displayed to extract URLs is getting confused by the target="_blank" that's part of the links on those pages. It gets the URLs wrong, and therefore can't find a match.

I think we'll fix this by changing the regular expression in the filter() function to use a non-greedy match.

Old:
$re = '/href=["\'](http[^\v()<>{}\[\]]+)[\'"]/i';

New:
$re = '/href=["\'](http[^\v()<>{}\[\]]+?)[\'"]/i';

@aribn

This comment has been minimized.

Copy link

aribn commented Feb 2, 2016

That worked! (I modified amber.php locally to test, loaded a post, and verified that the Amber popover appears when hovering over an archived link.) Thank you for tracking this down!
popover

@genevec genevec closed this Mar 1, 2016

jlicht added a commit that referenced this issue Mar 8, 2016

Improve link detection in HTML to handle additional anchor attributes
Previously, links that contained additional attributes weren't being
correctly identifed as preserved links by our filter() function.
This changes the regexp used for link detection to use non-greedy
matching on href attributes. (#25)

jlicht pushed a commit that referenced this issue Sep 24, 2016

jeffreylicht
Improve link detection in HTML to handle additional anchor attributes
Previously, links that contained additional attributes weren't being
correctly identifed as preserved links by our filter() function.
This changes the regexp used for link detection to use non-greedy
matching on href attributes. (#25)

git-svn-id: http://plugins.svn.wordpress.org/amberlink/trunk@1501688 b8457f37-d9ea-0310-8a92-e5e31aec5664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment