Comments (2)
Alright, so in developing our own solution for this we concluded that the only sensible option would be to add two filters to the plugin itself, which we have submitted as PR #48
These are simple and harmless unless the filter is used, but allow enormous flexibility to developers implementing Amber.
They have separate filter names (amber_lookup_url
and amber_enqueue_check_link
) so that they can be handled separately if necessary, but should usually have the same filtering function/method attached, since for most cases, you'll want both places to do the same manipulations on the URLs.
In the Twitter case, we can use this filter to remove ?ref_url and any other URL query variables from the URL before it is checked (so the check has a chance to pass) as well as when the link is checked on display (so that it will match the database entry for that URL, which otherwise would be difference since the database would have the sans-ref_url version but the display checker would have the has-ref_url version).
This filter can also be used for all kinds of other things too! It could be used to do a very nuanced "blacklist" task that involved checking something more elaborate than Regex, it could be used to completely replace one domain with another etc.
Please, I beg of you, add this filter to the plugin.
If you like, you can also incorporate the Twitter filter, so that Twitter will work better for all your users. If not that's fine though, having access to the filter is much more important for us.
from amber_wordpress.
NOTE: looking at our error log, I'm seeing a lot of this, despite running the filter described above that avoids triggering twitter.com/robots.txt
:
[28-Jun-2018 15:21:31 UTC] [...]/wp-content/plugins/amberlink/libraries/AmberChecker.php:AmberChecker::check:Blocked by robots.txt:https://t.co/wnn0C8bIVr
Quick look at http://t.co/robots.txt
explains it:
User-agent: twitterbot
Disallow:
User-agent: *
Disallow: /
So it seems any Twitter link in the t.co
format will always die, which is a bummer.
Possibility to fix: Have a filter (like the one above) that does the full permalink expansion of t.co
URLs before doing anything with them, so that the system only gets the working twitter.com
version.
Haven't done it yet but documenting it here for myself and/or others.
from amber_wordpress.
Related Issues (20)
- Dashboard can display misleading messages if snapshot stored in multiple locations HOT 4
- Prevent direct access to saved snapshots HOT 1
- Validate WordPress 4.5 compatibility
- Upgrading to 1.4.3 causes error including AmberDB HOT 3
- Improve error messages when cannot save snapshots due to permissions issues
- Allow administrator to specify alternate hostnames under which the site might be accessed
- Track page/post where links originate and show in dashboard HOT 1
- getallheaders function is undefined (sites using nginx) HOT 1
- Settings page should link to Amber Dashboard
- Facebook blocks all bots via robots.txt - Don't try to snapshot facebook URLs HOT 2
- Dashboard should display "message" field from db rather than always "Could not capture snapshot" HOT 2
- Allow site admins to "speed up" dequeuing process to more than 1/5min
- Preview iframe system in "down" popup needs deep review HOT 2
- Link attributes injected in RSS feeds HOT 1
- Dashboard: Lack of pagination in links table causes WSOD error when DB is large
- Support nginx HOT 1
- Allow multiple snapshots for same link
- Internet Archive API seems to be broken as of Jul 10, 2020: All URLs getting marked as down HOT 8
- Is Amber dead? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amber_wordpress.