开发者 |
Michael Uno
miunosoft |
---|---|
更新时间 | 2021年6月17日 10:37 |
捐献地址: | 去捐款 |
PHP版本: | 5.2.4 及以上 |
WordPress版本: | 5.7.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
amazon-auto-links.php
and other files compressed in the zip folder to the /wp-content/plugins/
directory.[amazon_auto_links]
or the PHP function of the plugin, AmazonAutoLinks()
id - the unit ID
[amazon_auto_links id="123"]
`
123 ) ); ?>
`
label - the label associated with the units
[amazon_auto_links label="WordPress"]
`
'WordPress' ) ); ?>
`
asin - ASINs (product IDs) separated by commas (`,`).
[amazon_auto_links asin="B016ZNRC0Q, B00ZV9PXP2"]
`
'B016ZNRC0Q, B00ZV9PXP2' ) ); ?>
`
search - Search keywords separated by commas (`,`).
[amazon_auto_links search="WordPress"]
`
'WordPress' ) ); ?>
The
id,
asinand
search` arguments cannot be used together.
Optionally, the following arguments may be set.
country
- (string) the locale of the store. Accepted values are CA
, CN
, FR
, DE
, IT
, JP
, UK
, ES
, US
, IN
, BR
, MX
, AU
, TR
, AE
, SG
, SE
, and NL
.associate_id
- (string) the Amazon Associates ID for the affiliate.count
- (integer) determines how many items should be displayed.image_size
- (integer) the image size in pixels.title_length
- (integer) the maximum title character length. Set -1
for no limit. Default: -1
.description_length
- (integer) the maximum description character length. Set -1
for no limit. Default: 250
.link_style
- (integer) the link style. Accepted values are 1
, 2
, 3
, 4
, and 5
. Default: 1
.1
- http://www.amazon.[domain-suffix]/[product-name]/dp/[asin]/ref=[...]?tag=[associate-id]2
- http://www.amazon.[domain-suffix]/exec/obidos/ASIN/[asin]/[associate-id]/ref=[...]3
- http://www.amazon.[domain-suffix]/gp/product/[asin]/?tag=[associate-id]&ref=[...]4
- http://www.amazon.[domain-suffix]/dp/ASIN/[asin]/ref=[...]?tag=[associate-id]5
- http://localhost/wp47?productlink=[asin]&locale=[...]&tag=[associate-id]credit_link
- (integer|boolean) whether to show the credit link. 1
/true
to show, 0
/false
to hide.subimage_size
- (integer) the sub-image size in pixels. Default: 100
.subimage_max_count
- (integer) the maximum number of sub-images to display.customer_review_max_count
- (integer) the maximum number of customer reviews.show_now_retrieving_message
- (boolean|integer) whether to show the "Now retrieving..." message when sub-elements are pending to be fetched. true
/1
to show false
/0
to hide.button_type
- (integer) The type of buttons. The following values are accepted. Default: 1
.0
- Link to the product page.1
- Add to cart.load_with_javascript
- [3.6.0+] (boolean|integer) whether to load the unit with JavaScript. true
/1
to yes, false
/0
to no.product_title
- [4.0.0+] (string) An alternative text to alter the product title for anchor text. This is only supported when the asin
argument is set.show_errors
- [4.1.0+] (integer) Whether to show the output error. Default: 2
.0
: do not show error.1
: show the error.2
: show the error in an HTML comment.Dashboard
-> Amazon Auto Links
-> Settings
-> Default
.
If these arguments are omitted, the values set in the setting page will be used.
Shortcode to Display Buttons
Although with the %button%
tag in the Item Format
unit option allows you to insert a button, a button itself can be displayed indipendently with the shortcode, [aal_button ...]
.
It accepts the following parameters.
asin
- (required, string) Comma delimited ASINs.type
- (optional, integer) 0: Link to the product page, 1: Add to cart button. Default: 1
.id
- (optional, integer) The button ID. To use the button created via Dashboard -> Amazon Auto Links -> Manage Buttons, specify the button ID.quantity
- (optional, integer) The quantity of the item to add to cart. When multiple ASINs are specified, separate the values by commas.country
- (optional, string) The locale of the marketplace. If not set, the default value set in the Default setting tab will be applied.associate_id
- (optional, string) The associate tag. If not set, the default value set in the Default setting tab will be applied.access_key
- (optional, string) The public PA-API key. If not set, the default value set in the Authentication tab will be applied.label
- (optional, string) The button label. e.g. 'Buy Now'. Default: Buy Now
.offer_listing_id
- (optional, scalar) An offer listing id that Amazon gives....wp-content/plugins/amazon-auto-links/template
and rename the copied folder.
Step 2
Remove the files besides style.css
and template.php
as other files are optional.
Step 3
Edit style.css
and template.php
to customize the layout.
Step 4
Create a folder named amazon-auto-links
in your theme's folder. If you are using Twenty Thirteen, the location would be ...wp-content\themes\twentythirteen\amazon-auto-links
.
Step 5
Move the working folder(the copied one) to it (the amazon-auto-links
folder you just created).
Step 6
The plugin will automatically detect your template and add it in the template listing table. So activate it.
Upgrading V1 to V2
When upgrading v1 to v2, a few options will be lost. That includes:
My Account/Console
-> Security Credential
.
Step 3 - Create an Access Key
In the Security Credentials page, find the section named Access Keys (Access Key ID and Secret Access Key)
and click on that.
Then press the Create New Access Key
button to create a key. Don't forget to keep the secret access key as well. Amazon has changed the policy not to let the user to obtain the secret key later on.
Also note that at the point that an access key is issued, if you have not created an account with Product Advertising API, the key will be invalid. If that happens, delete the created access key and go back to the previous step.
You can check if your access key is valid or not with Scratchpad.List
template for some themes.List
template to adjust layout and font sizes for mobile screens.List
template to give rounded corners to product thumbnails.%description_text%
tag was not formatted properly for category and some other unit types.embed
unit type.embed
unit type.%feature%
tag displayed the wrong output for the embed
unit type.associate_id
direct unit argument did not take effect, which started from v4.5.0.Item Format
unit option was not saved properly, which started from v4.5.3.Creating Units
option under the Access Rights
section of the Misc
tab which lets the user set a user role to allow creating units.Associates
setting tab.Link Style Query Key
general option could be empty, which resulted in unit RSS and JSON feeds broken.Associates IDs
option in the oEmbed
section in place of Amazon Associates
section.Authentication
setting tab.3rd Party
tab.%description%
and %content%
were not functioning for the embed unit type when the PA-API keys are not set.Tasks
tab in the Reports
page.Site Debug Log
tab in the Reports
page which appears when the site debug mode it turned on.Products
tab.Products
tab in the Reports
page.Details
column in the unit listing table and removed the Template
and Unit Type
columns.List
template regarding the thumbnail width and the font size of now-retrieving elements in embedded iframe.Item Look-up
units failed to retrieve products with PA-API with a certain number of items.Tests
page when an Ajax request failed.Show Errors
unit option to Show errors
.Error Log
and Debug Log
tabs to the Reports
page.File Permissions
field in the About
tab of the Help
page.Server Information
field in the About
tab of the Help
page.unit_format
direct arguments were not taking effects.item_format
, image_format
, title_format
, unit_format
direct arguments were not taking effects, started since v4.0.0.Embed
setting tab.Image Format
unit option regarding widths.<title>
tag.List
template that some sub-images overlapped the thumbnail.max-height
.Language
and Currency
options in the Default
setting screen.Reset
button in the Default
setting screen.Custom Text
unit option.Unit Format
option under the Output Format
unit option.[aal_button ...]
short code to display buttons.Override the button label.
unit option that allows the user override a button label.Select Button
option.target="_blank"
to the unit view links to open the link in a new tabTest
page and Debug Log
tab which appear when the site debug mode is turned on.Manage Units
page.admin-ajax.php
.max-height
.tag
and similarity_lookup
.embed
unit type outputs, started from v4.2.9.%date%
value was not accurate.embed
unit type to display elements as much as possible in the first load when the API keys are set.List
template not to support the min width for the thumbnail.Language
unit option was not set properly.empty()
language construct.List
, Category
, Search
templates.preferred_currency
and language
unit options were not set.embed
unit type outputs.ScratchPad Payload
unit type that allows custom API queries generated on Scratchpad.*
for the Product Filters
options to apply to everything.PhpZon
shortcodes.Show Errors
unit option under the Common Advanced
section that allows the user to decide whether to display output errors.%author%
tag that displays product authors for the Item Format
unit option.%image_size%
Item Format option tag.Item Format
option to set min-width
for the thumbnail container.Image Format
option layout value.Prevent Duplicates
unit option enabled produced no results in the unit preview page when some third-party plugins call the the_content
filters in prior to rendering the post.Output Format
unit options were not loaded properly for some cases.Template
unit option when no template was activated, started from v4.0.0.Secret Access Key
option input field to be masked.Templates
setting screen.List
template regarding the width of sub-image container elements.Image Format
option layout value.Image
template.Now retrieving...
message not to show when API keys are not set.ASINs
option for the Item Look-up
unit type was sanitized properly when saved, started in 3.9.0.List
template for widget areas.Image Format
option layout value.Compress
option in the Cache
section.Output Formats
unit options that support Item Format
, Image Format
, and Title Format
options for each template.Feed
unit type that imports unit data from external sites and display them.product_title
shortcode parameter which alters the product title and serves as anchor text.Text
template.List
template for widget areas and relatively small thumbnail sizes.[amazon_textlink]
shortcode of Amazon Associates Link Builder to remove some outer container.Category
and Search
templates not to be the default activated templates.List
for all the unit types.Item Format
unit option for the new Output Formats
unit option that support item format option per template.Keywords to Exclude
unit option for the Contextual
unit type.Cache
screen.Country
unit option was not property set for some cases.Product Search
unit type.Singapore
locale for the category unit type.About
tab in the Help
admin page which displays plugin information.Delivery Flags
unit option for the search unit type.%content%
and %description%
outputs were no longer available for category units since v3.9.0 due to the use of PA-API5.%description%
output created an empty element when the product description was not available.Raw
Sort
unit option for the category unit type treated as Random
.%prime%
Item Format variable did not show the prime mark.Raw
sort unit option for the category unit type was treated as Random
, which has started since v3.9.3.noopener
rel attribute value for generated hyperlinks.Uncaught Error: Call to undefined method
in the category select page of the category unit type, which has started since v3.9.3.Sort
unit option of the category unit type did not take effect, which has started since v3.9.0.%category%
and %feature%
unit Item Format
option variables were not properly formatted, which has started since v3.9.0.Authentication
page.Minimum Review Rating
advanced unit option for the search unit type.Error Log
page (Tools -> Error Log) that displays plugin errors.%prime%
variable for the Item Format
unit option which displays a prime icon.category
units when the product did not have a review, started since v3.8.12.Similarity Look-up
unit type as PA-API 5 does not support similarity look-up.similar_product_image_size
and similar_product_max_count
unit options.Types
option of category units that lead to find no products.category
and url
unit types to reduce PA API requests when no items are found.Types
option of category units have been no longer available.Access Rights
-> Capability
option did not take effect.category
unit type to reduce unnecessary database queries and API requests.admin-ajax.php
.Manage Units
page regarding PHP codes.aal_ajax_loaded_unit
jQuery event for templates using JavaScript.Text Domain
and Domain Path
to the plugin comment headerItem Count
unit option.%category%
Item Format
variable.%category%
variable for the Item Format
unit option, which inserted debug outputs.List
, Category
and Search
templates.%feature%
variable for the Item Format
unit option, which inserted debug outputs.List
, Category
and Search
templates.Raw
sort select option for the category unit type.Date
sort select option for the category unit type.Keep the raw title
unit option for the category unit type.Manage Units
page.Item Format
unit option value.List
.%category%
, %feature%
, %date%
, %rank%
variables for the Item Format
unit option.error
due to no context in the preview.Toggle Status
bulk action for the Auto-insert listing table.Ready/Loading
unit status to be displayed when the unit has not been loaded yet.Renew Cache
action link of Category units.PHP Notice: Undefined index: constructor_parameters...
in the background, started with v3.7.5.Custom URL Query
unit option field.Renew Cache
action link of URL units.aal_action_activate_templates
and aal_action_deactivate_templates
action hooks so that third parties can toggle the template status.No Products Found
message was moved to the top in the category selection screen of the Category unit type.warning
from error
.Manage Units
page.Item Format
option.aal_filter_api_request_uri
filter hook to allow third-parties to modify API request URI.Associate ID
field in the Authentication
setting section for some locales.Data
section in the Reset
setting page, which handles export/import options.aal_filter_product_link
filter hook to allow third-parties to modify product links.rel='nofollow'
to the button links.Load with Javascript
unit option that lets the user decide whether to display the unit with JavaScript.Renew Cache
action link in the unit listing table.search
shortcode and function argument which performs a keyword search with the set keywords.asin
shortcode and function argument which list products of the set ASINs.Contextual
unit type.Sort Order
option to the Item Look-up
unit type.Interval for Removing Expired Caches
and Caching Mode
. Some users may need to re-save the options.%price%
variable of the Item Format
option.Item ID
option were saved with the Item Look-up
unit.wp_kses_js_entities is deprecated since version 4.7.0
.%price%
variable for the Item Format
unit option to show the lowest offered price from just a discounted price when available.Cache
setting section.debug_backtrace() expects at most 1 parameter, 2 given
.Server Locale
option in the Authentication
section.%price%
variable for the Item Format
unit option.%rating%
variable in the Item Format
option produced HTML outputs with an invalid structure.Interval for Removing Expired Caches
option.%price%
variable in the Item Format
option to display a discounted price when available.ISBN
could not be set with the Item Look-up
unit type even the locale was set to US
.Settings
-> General
-> Unit Preview
-> Post Type Slug
).Description Suffix
unit option that let the uset set own text for the read more
label.Max Image Size for Similar Product Thumbnails
and Max number of Similar Products
unit options.%meta%
variable to the Item Format unit option.%similar%
variable to the Item Format unit option.%content%
variable for the full product description to the Item Format unit option.<description>
tag or the <content>
tag in the feed.Breadcrumb
in the Additional Criteria
option and enabled The home page
in the Available
Page Type` option.%description%
variable of the Category
unit type to include description produced by Amazon Product Advertising API if the user has authenticated the plugin.View
action link was inserted in different post type listing table when a custom unit preview post type slug was set.Maximum function nesting level of 'x' reached
when the server enables the XDebug extension and sets a low value for the xdebug.max_nesting_level
option.600
.Item Look-up
and URL
unit types that the Number of Items
option did not take effect.Query per Item
option was enabled.Search
.Search
and Category
templates for disclaimer elements in widgets.Search
template to wrap descriptions.URL
unit type which enables to search products and list them with given urls.Query per Term
unit option for the Search
, Item Look-up
, Similarity Look-up
unit types.%disclaimer%
variable in the Item Format
unit option.Now Retrieving...
message.Template
unit option section.tag
unit type as it is no longer supported by Amazon.search_per_keyword
argument for the shortcode which can be set to true
when performing search with multiple keywords.Category
and Search
templates.Category
and Search
templates.1
.Call to undefined function mb_detect_encoding()...
in the category select page on the server that does not install the multibite string extension.%price%
variable in the Item Format
unit option was not functional.Button Type
unit option that lets the user add a product to the Amazon shopping cart.Available Page Types
option in the widget form.PHP_MAXPATHLEN
constant.0
for the Max Image Size for Sub-images
option did not disable the images.Tools
setting page.%button%
, %review%
, %rating%
, and %image_set% variables to the template option.Manage Auto-insert
admin menu that did not appear in the Auto-insert listing page.Template
option section when creating a new unit.Add Auto insert
admin menu link.Support
section from the settings.Preview Unit
options including one that allows the user to set a custom url slug to the unit preview page.aal_action_loaded_plugin
action hook.Search
unit type to use the discount price if there is an offered price.Marketpalce
is selected in the Category
option of the Select unit type, an error was shown.Merchant ID
option in the advanced options for the Search
unit type.%price%
variable for the search unit type.Search
template.warning: Array to string conversion in...
message when product links were displayed with the auto-insert.Category
template to center the not found image.Prevent Duplicates
.the_content
filter was ignored in the plugin custom post type page.Caching Mode
option.posts_where
filter.column
option was saved always as 1 for the first time.Where to Enable
section did not take effect.(recently, newly) tagged...
message was inserted in the title of product links of Tag unit type.Strict standards: Declaration of ... should be compatible with ...
when displaying the output of the tag unit type.Number of Items
option for the Similarity Look-up search unit type.Strict standards: Declaration of ... should be compatible with ...
.Single Post
check option did not take effect in the Page post type././
, which may have caused a problem for third-party plugins that minifies CSS.Similarity Look-up
unit type which allows to display similar products by ASIN.Item Look-up
unit type which allows to pick one or more items by item ID.aal_filter_unit_output
filter.