Aha, implicitely you answered already what I wasn't sure about above:
So then: I would 'code' different locales (and other stuff) into one and the same redirect per product, like you suggested earlier.
No, no general offers, I have only specific products too (I said before, this is best anyway, specific links). But Paul look: A normal flow of writing articles is that you DON'T have a recommendation of a certain product only on one page/post, you may have it on 20 or more if you have hundreds or thousands of pages. Basic (bad?) example: Say you have a shoe site. Each post is about one shoe model/one color of it, but on multiple of them you might also 'need' to recommend say, a blister plaster (to help walking-in of that shoe). - Of course you can apply the same logic to ANY industry (i-pads too, say, a silicone cover or whatever! ;-)
After reading you reply above I'd hence conclude:
If it was me, I would have 'the core' of Amazon Link work differently, all the good 'add-ons' you made I would leave, and what's not really helpful for this purpose (Amazon Link!) I would leave out (unless it's implicitely possible, like say OTHER affiliate links, if I use redirects).
The 'core' difference would be:
- For each product the admin wants to link to, I would present him ONE redirect link with arguments in it as you suggested above (mainly for all locales, MAYBE for templates too if considered 'really helpful').
- I would certainly show the cute multinational popup at least for text-links (as you do) and for i-frame image links (as you don't). - The i-frame image links are hugely popular because they show really useful info for any site visitors, and make them click through!
- Now, when a visitor clicks a DEFAULT (Amazon Link plugin based) redirect link, I would make the plugin process this link and send the visitor to the target page (based on a lookup in the wp db table for the ip addresses, which I think, you import into wp).
- And when a visitor chooses a flag from the multinational popup, I would use this info to send the visitor to a different locale (IF it was an Amazon link, else not necessary). Like your plugin does already: It 'notices' which flag the visitor is clicking and sends him to THAT locale! So I don't see much (any?) need for change here.
- The crucial point you made above yourself: ALL locales' affiliates tags (and MAYBE templates too) are embedded in that ONE link for a certain product. And depending on whether the visitor clicks the default link or a flag link, the plugin would process this info and redirect him to the right target page.
Look: The redirect-based solution works in a way that it processes a certain link (eg "http://mydomain.com/go/i-pad-silicone-cover-transparent") and, WHILE LEAVING THE LINK TEXT INTACT EVEN IF THE PLUGIN 'FAILS'(!), if it works, it does a lookup of this 'source' link in the db, finds the associated target link, and sends the visitor there! :-)
That's the aspect 'link generation' of your plugin (which you said above, was its only original purpose anyway).
Re/ the aspect 'content generation' I think you mean that Amazon Link can embed different 'templates' into page/post content?
I may need to think more about this part, but at the moment I'd say, this can still be done too, with redirect-based solution, if the 'source link' already holds the parameters for the template. Then, again even if the plugin fails, the LINK TEXT is still there (as an essential part of all posts/pages content), only it will now certainly just be TEXT, rather than being transformed by the plugin to say, a wishlist template or whatever.
> With regard plugin failure I don't see that the redirect solution is much better as the links will presumably just come up 404 not found if the plugin is not working or removed?
It IS much better because the LINK TEXT would still be there, Paul. And instead of a standard 404 a good admin will have a sensible error page anyway (sending notification to admin, offering user search alternatives, linking to a featured products page, whatever).
> As far as I can see you need something in the post content to trigger the creation of the popup and the querying of the backend database to get alternative ASINS etc.
That 'something' could be the 'source link'. The plugin could 'map' this to whatever it needs to, in addition to processing the redirect. Like Amazon Link now 'maps' locales, templates etc too (I assume).
What do you think of this?