| 开发者 | affiblocks |
|---|---|
| 更新时间 | 2026年12月3日 22:32 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
rel="sponsored" on every link.rel attributes (sponsored, nofollow) and an affiliate disclosure you can auto-insert.rel settings, so you never have to remember sponsored again. Change the setting and every button you have ever published changes with it./wp-content/plugins/).Not for this plugin, which never uses one. You type the product details in and the block publishes them. Fetching details from Amazon is what the Pro add-on does: with Creators API credentials you enter there, or, if you switch it on, through the AffiBlocks data service. Amazon only issues those credentials to Associates with at least ten qualifying sales in the past thirty days, which is exactly why entering a product by hand is a first-class feature here rather than a fallback.
Because Amazon's Program Policies allow a price only from Amazon's own data, never one typed by hand. If you type a price on a box that links to Amazon, the box says "See current price on Amazon" instead, and the button sends the reader to Amazon, where the price is current by definition. Leave the price empty and the box simply shows the button. Everything else on the box (name, picture, your description, pros, cons, rating and button) shows as usual. A price you type is shown on a box for any other shop. A price of zero, or a "was" price at or below the current one, is left out, because both are almost always mistakes and a discount that does not exist is the kind of thing that gets affiliate accounts closed. Prices from Amazon's own data are shown for at most 12 hours after they were fetched (Amazon's limit is 24), with the date beside them, as Amazon requires. This plugin never contacts Amazon, so it shows such prices only for products whose data came from Amazon through the Pro add-on. If you run a full-page cache, set it to expire pages at least once a day, so a price that has stopped being shown also disappears from cached pages.
Because Amazon issues one. A amazon.com tag on an amazon.de link tracks nothing, and nothing about the link looks wrong: you simply earn zero and find out weeks later. Enter a tag for every store you are approved for; the block picks the right one from the URL. A store you leave empty produces a plain, untagged link, and the editor warns you before you publish it.
It uses standard block markup and takes its colours and spacing from the theme, so the card looks like part of your site rather than something pasted in. Layout breakpoints respond to the width of the card itself, so it still reads correctly inside a Columns block or a narrow sidebar.
A theme that styles every picture, list or link (borders on images, lines beside list items, underlined links) does not reach inside the blocks: their pictures, lists, icons and buttons keep their own look. To change that look yourself, set the blocks' --apbk-* custom properties in Additional CSS on the block's own class, not on :root, for example :root:root .apbk-product-card { --apbk-accent: #c00; }. A rule has to match or outweigh the blocks' own, and a button's underline also needs !important.
It should not. The card is rendered in PHP, ships no JavaScript at all on the frontend, and its stylesheet (under 10 KB, 2 to 3 KB compressed) is only loaded on pages that actually contain the block.
It adds it, and it is built not to fight. Structured data is the machine-readable description of a product (name, price, availability, link) that search engines read in order to show a rich result. Two descriptions of one product, disagreeing about the price, is worse than none: the search engine has to pick one, and you do not get to say which. So if you run Yoast or Rank Math, the product is added inside their existing data rather than as a separate block, and linked to the page they already describe. If you run All in One SEO or SEOPress, which have no way to accept it, a separate block is added with its own identifiers that cannot collide with theirs. If you run no SEO plugin, you get that separate block. Nothing of theirs is ever changed or removed. We do look at it, to ask one question: is this product already described here? The only thing that answer can do is make us quieter. Nothing at all is added when something else already describes the same product on that page: a WooCommerce product page, for instance, where your card is editorial content rather than the thing the page is about. A missing description costs you nothing; a contradictory one costs you the rich result. Settings → AffiBlocks → Search engines has the switch if you would rather we stayed out entirely, and each block has its own "leave this card out" toggle in the sidebar for a card that is an aside rather than the point. One thing worth knowing: a card is described to search engines only when it has a price or your own review (see the next question). Search engines show nothing for a product with neither, so a card with no price and no review of yours gets no description, and we will not invent either.
Yes, and it is the only kind of rating this plugin will ever show. Open a Product Card, fill in the rating, who is reviewing, and a sentence or two of verdict. All three are needed: a star count with nobody's name on it is not a review, and search engines drop one whose author is not a real name. Your rating appears on the card and is sent to search engines as your review. It is never Amazon's star average: that is not available through their API, and publishing someone else's rating as your editorial judgement is the kind of thing that costs you the rich result and deserves to. Your pros and cons are sent along with it, which is how a search result comes to show a pros-and-cons list. That only works for editorial reviews (a real opinion from the site, which is what yours is), so it needs the review filled in. Without one, the pros and cons still appear on the card; they just have nowhere to go in the data. If you already describe your reviews to search engines some other way (a reviews plugin, your own snippets), Settings → AffiBlocks → Search engines has a switch for leaving ours out. Your pros and cons travel inside that review, so they go with it. Everything still shows on the card either way.
By default, at the top of the post or page, before the first link, or wherever you chose in the settings. It appears only on single posts and pages where one of the plugin's blocks drew an affiliate link, and is kept out of feeds, search results and archive listings, where it would repeat once per post. If you want it somewhere else (just above your first product, after an introduction you want read first, say), add the Affiliate Disclosure block where you want it. Placing it switches the automatic one off for that post, so you never end up with two. Leave the block's text empty and it shows whatever your settings say, so rewording your disclosure later updates every post that did not override it. Type in it and that post uses your wording instead.
It does not need to visit them to find what usually goes wrong with an affiliate link: a missing or wrong Associates tag, a short link whose tag cannot be read, a store you have no tag for, a stored product that has been deleted, a price too old to be shown. All of that is visible from your settings and your content. Sending automated requests to Amazon's product pages is something Amazon blocks and its rules discourage, and a checker that does it reports working links as broken. Whether Amazon still sells a product is something only its API can say; the Pro add-on adds that to the report.
Reading a short link means asking Amazon where it points, and this plugin makes no outbound requests at all. Open the short link in your browser and paste the full product URL from the address bar instead. The block tells you this when you paste one, rather than just refusing.
It counts clicks on the affiliate links its blocks draw, and it is on from the start; switch it off under Settings → AffiBlocks. It keeps one number per day, per post, per product and per block, nothing about who clicked. No address, browser, device, cookie or identifier is stored with the counts, and no script is added to your pages.
The count is sent by the visitor's own browser as the link opens, using the link's standard ping attribute, to your own site. The link itself still points straight at Amazon with your tag. To stop the count being abused, a scrambled form of the visitor's address is kept for the minute of the click: replaced by the next minute's, and never kept longer than a day. It is pseudonymised, not anonymous. Clicks by logged-in editors and in previews are not counted, and neither are links drawn outside a post's content on pages that are not a single post (a footer on an archive, say), because which post they belong to is not certain. Behind a proxy or CDN every visitor arrives from the proxy's address, so the limit of thirty clicks a minute applies to them together; a developer can pass the real address with the apbk_click_client_address filter. The plugin suggests a paragraph for your privacy policy under Settings → Privacy.
Firefox and most ad blockers do not send these counts, so the numbers are lower than Amazon's own reports. Compare them with each other (which post, which product, which block) rather than with Amazon.
No phone-home, no licence check, and nothing at all about your visitors: no request the plugin makes carries any information about who is reading your site. The plugin's server makes no outbound request at all, not to Amazon, not to us, not to anywhere. The one exception is yours to make: the optional email sign-up on the settings screen, which your own browser sends to affiblocks.com only when you tick the consent box and press Subscribe (see External services). The Pro add-on does talk to outside services, as its documentation describes; this one works without it.
They stay readable. Every card keeps its own copy of the product as well as pointing at the shared one, so a card whose product has gone still shows its name, image, price and everything else you typed. Deleting the plugin removes the shared products only if you ticked "Delete this plugin's settings, cached product data and click counts when the plugin is deleted" under Settings → AffiBlocks → Data: it is off by default, and it removes all three. Any Amazon credential left over from an older version is always removed, whatever that setting says: nothing can use it once the plugin is gone.
The screens, the blocks in the editor and the text your readers see come in English, Turkish, Spanish, Portuguese (Brazil) and Japanese. WordPress picks the language you use: your profile's language for the screens and the editor, the site's language for your readers. Other Spanish and Portuguese locales (Mexico, Argentina, Portugal and so on) get the Spanish and Brazilian translations rather than English. When a translation for your language is published on translate.wordpress.org, WordPress installs it and uses it instead of the one inside the plugin. Corrections and new languages are welcome there. The button text and the disclosure follow your site's language until you change them. Once you type your own wording, it is shown as you typed it. The translated Amazon statement uses the wording Amazon's programme in that language publishes; if you belong to another country's programme, check your Associates agreement and type the statement it asks for.
In the plugin itself. The editor scripts in build/ are compiled from the readable sources in blocks/ with @wordpress/scripts: npm install && npm run build rebuilds them from the package.json that ships alongside.
apbk_render_view_model can no longer change a Product Card's wrapper attributes, layout or heading levels, and any value it returns is printed escaped for where it goes.