Changeset 3702054
- Timestamp:
- 09/18/2026 01:24:32 PM (6 weeks ago)
- Location:
- amzly-price-badge
- Files:
-
- 45 added
- 12 edited
-
tags/1.1.1 (added)
-
tags/1.1.1/amzly-price-badge.php (added)
-
tags/1.1.1/assets (added)
-
tags/1.1.1/assets/css (added)
-
tags/1.1.1/assets/css/admin.css (added)
-
tags/1.1.1/assets/css/badge.css (added)
-
tags/1.1.1/assets/css/editor.css (added)
-
tags/1.1.1/assets/img (added)
-
tags/1.1.1/assets/img/amzly-mark.svg (added)
-
tags/1.1.1/assets/js (added)
-
tags/1.1.1/assets/js/click.js (added)
-
tags/1.1.1/blocks (added)
-
tags/1.1.1/blocks/price (added)
-
tags/1.1.1/blocks/price/block.json (added)
-
tags/1.1.1/blocks/price/index.js (added)
-
tags/1.1.1/blocks/price/render.php (added)
-
tags/1.1.1/includes (added)
-
tags/1.1.1/includes/class-admin.php (added)
-
tags/1.1.1/includes/class-amazon-client.php (added)
-
tags/1.1.1/includes/class-amazon-credentials.php (added)
-
tags/1.1.1/includes/class-amazon-store.php (added)
-
tags/1.1.1/includes/class-api-client.php (added)
-
tags/1.1.1/includes/class-asin-parser.php (added)
-
tags/1.1.1/includes/class-bestseller.php (added)
-
tags/1.1.1/includes/class-block.php (added)
-
tags/1.1.1/includes/class-chart.php (added)
-
tags/1.1.1/includes/class-clicks.php (added)
-
tags/1.1.1/includes/class-health.php (added)
-
tags/1.1.1/includes/class-legacy-blocks.php (added)
-
tags/1.1.1/includes/class-list.php (added)
-
tags/1.1.1/includes/class-matrix.php (added)
-
tags/1.1.1/includes/class-merge.php (added)
-
tags/1.1.1/includes/class-options.php (added)
-
tags/1.1.1/includes/class-prefetch.php (added)
-
tags/1.1.1/includes/class-renderer.php (added)
-
tags/1.1.1/includes/class-rest.php (added)
-
tags/1.1.1/includes/class-settings.php (added)
-
tags/1.1.1/includes/class-shortcode.php (added)
-
tags/1.1.1/includes/class-shortcodes-extra.php (added)
-
tags/1.1.1/includes/class-stats-page.php (added)
-
tags/1.1.1/includes/class-store.php (added)
-
tags/1.1.1/languages (added)
-
tags/1.1.1/languages/amzly-price-badge.pot (added)
-
tags/1.1.1/readme.txt (added)
-
tags/1.1.1/uninstall.php (added)
-
trunk/amzly-price-badge.php (modified) (2 diffs)
-
trunk/blocks/price/block.json (modified) (1 diff)
-
trunk/blocks/price/index.js (modified) (1 diff)
-
trunk/includes/class-chart.php (modified) (5 diffs)
-
trunk/includes/class-list.php (modified) (9 diffs)
-
trunk/includes/class-matrix.php (modified) (3 diffs)
-
trunk/includes/class-options.php (modified) (3 diffs)
-
trunk/includes/class-renderer.php (modified) (13 diffs)
-
trunk/includes/class-settings.php (modified) (4 diffs)
-
trunk/includes/class-shortcode.php (modified) (1 diff)
-
trunk/languages/amzly-price-badge.pot (modified) (4 diffs)
-
trunk/readme.txt (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
amzly-price-badge/trunk/amzly-price-badge.php
r3698089 r3702054 4 4 * Plugin URI: https://amzly.de/wordpress-plugin 5 5 * Description: Zeigt zu einer Amazon-ASIN oder einem amazon.de-Link ein kleines Preis-Badge im Beitrag — mit Preisbewertung aus der amzly.de-Preishistorie. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Requires at least: 6.5 8 8 * Requires PHP: 7.4 … … 25 25 defined( 'ABSPATH' ) || exit; 26 26 27 define( 'AMZLY_PB_VERSION', '1.1. 0' );27 define( 'AMZLY_PB_VERSION', '1.1.1' ); 28 28 define( 'AMZLY_PB_FILE', __FILE__ ); 29 29 define( 'AMZLY_PB_DIR', plugin_dir_path( __FILE__ ) ); -
amzly-price-badge/trunk/blocks/price/block.json
r3698089 r3702054 3 3 "apiVersion": 3, 4 4 "name": "amzly/price", 5 "version": "1.1. 0",5 "version": "1.1.1", 6 6 "title": "Amzly", 7 7 "category": "widgets", -
amzly-price-badge/trunk/blocks/price/index.js
r3698089 r3702054 728 728 function targetControl( attributes, setAttributes ) { 729 729 return el( SelectControl, { 730 label: __( 'Open link ', 'amzly-price-badge' ),730 label: __( 'Open links to amzly.de', 'amzly-price-badge' ), 731 731 value: attributes.linkTarget || INHERIT, 732 732 options: inheritFirst( [ -
amzly-price-badge/trunk/includes/class-chart.php
r3698089 r3702054 122 122 . '<span class="amzly-chart">'; 123 123 124 $html .= $large ? self::head( $history, $product ) : self::small_title( $history );124 $html .= $large ? self::head( $history, $product, $atts ) : self::small_title( $history ); 125 125 $html .= '<span class="amzly-chart-inner">' . $svg . '</span>'; 126 126 … … 184 184 * @param array $history Verlaufsdaten. 185 185 * @param array $product Produktdaten. 186 * @return string 187 */ 188 private static function head( array $history, array $product ) { 186 * @param array $atts Anzeigeoptionen, für das Linkziel. 187 * @return string 188 */ 189 private static function head( array $history, array $product, array $atts = array() ) { 189 190 $out = '<span class="amzly-chart-head">' 190 191 . '<span class="amzly-chart-head__left">' … … 195 196 196 197 if ( '' !== self::product_link( $product ) ) { 197 $out .= '<a class="amzly-chart-head__link" href="' . esc_url( self::product_link( $product ) ) . '" rel="nofollow noopener"' 198 $out .= '<a class="amzly-chart-head__link" href="' . esc_url( self::product_link( $product ) ) . '" target="' 199 . esc_attr( Amzly_PB_Renderer::target_for( self::product_link( $product ), $atts ) ) . '" rel="nofollow noopener"' 198 200 . Amzly_PB_Renderer::track_attrs( isset( $product['asin'] ) ? (string) $product['asin'] : '', 'chart' ) . '>' 199 201 . esc_html__( '(full history on amzly.de)', 'amzly-price-badge' ) … … 300 302 301 303 /** 302 * Link zur Produktseite auf amzly.de , mit Herkunftskennzeichnung.304 * Link zur Produktseite auf amzly.de. 303 305 * 304 306 * Der Verlauf stammt immer von amzly.de, also führen seine Links auch … … 310 312 */ 311 313 private static function product_link( array $product ) { 312 return Amzly_PB_Renderer::amzly_link( $product );314 return Amzly_PB_Renderer::amzly_link( $product, array(), 'chart' ); 313 315 } 314 316 -
amzly-price-badge/trunk/includes/class-list.php
r3698089 r3702054 149 149 * Die Adresse eines Produkts in den strukturierten Daten. 150 150 * 151 * Hier steht nie ein e Herkunfts- oder Partnerkennung: Für Suchmaschinen151 * Hier steht nie ein Kampagnen-Parameter oder Partner-Tag: Für Suchmaschinen 152 152 * zählt die kanonische Adresse. Ein bezahlter Link ließe sich in JSON-LD 153 153 * auch gar nicht als solcher kennzeichnen — `rel="sponsored"` gibt es nur … … 159 159 */ 160 160 public static function schema_url( $asin, array $data ) { 161 // Die amzly.de-Seite ist die Produktseite dieses Plugins — und sie trägt162 // hier keine Herkunftskennzeichnung.161 // Die amzly.de-Seite ist die Produktseite dieses Plugins — hier ohne 162 // Kampagnen-Parameter. 163 163 if ( ! empty( $data['amzly_url'] ) ) { 164 164 return $data['amzly_url']; … … 272 272 */ 273 273 private static function row( $asin, array $data, array $atts, $number ) { 274 $link = Amzly_PB_Renderer::product_url( $data ); 275 $cells = array(); 274 $link = Amzly_PB_Renderer::product_url( $data, 'name' ); 275 $image_link = Amzly_PB_Renderer::product_url( $data, 'image' ); 276 $cells = array(); 276 277 277 278 $out = '<span class="amzly-list__row">'; … … 282 283 283 284 if ( ! empty( $atts['list_images'] ) && ! empty( $data['image_url'] ) ) { 284 $cells['image'] = '<a class="amzly-list__thumb" href="' . esc_url( $ link ) . '" target="'285 . esc_attr( $atts['target'] ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '" tabindex="-1" aria-hidden="true"'285 $cells['image'] = '<a class="amzly-list__thumb" href="' . esc_url( $image_link ) . '" target="' 286 . esc_attr( Amzly_PB_Renderer::target_for( $image_link, $atts ) ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $image_link ) ) . '" tabindex="-1" aria-hidden="true"' 286 287 . Amzly_PB_Renderer::track_attrs( $asin, 'image' ) . '>' 287 288 . self::thumb_img( $data, $asin ) … … 294 295 $cells['name'] = '<span class="amzly-list__main">' 295 296 . '<a class="amzly-list__name" href="' . esc_url( $link ) . '" target="' 296 . esc_attr( $atts['target']) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '"'297 . esc_attr( Amzly_PB_Renderer::target_for( $link, $atts ) ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '"' 297 298 . ( $short !== $name ? ' title="' . esc_attr( $name ) . '"' : '' ) 298 299 . Amzly_PB_Renderer::track_attrs( $asin, 'name' ) . '>' … … 580 581 */ 581 582 private static function card( $asin, array $data, array $atts, $column = 0 ) { 582 $link = Amzly_PB_Renderer::product_url( $data ); 583 $link = Amzly_PB_Renderer::product_url( $data, 'name' ); 584 $image_link = Amzly_PB_Renderer::product_url( $data, 'image' ); 583 585 584 586 $out = '<span class="amzly-compare__card">'; … … 594 596 595 597 if ( ! empty( $atts['list_images'] ) && ! empty( $data['image_url'] ) ) { 596 $out .= '<a class="amzly-compare__thumb" href="' . esc_url( $ link ) . '" target="'597 . esc_attr( $atts['target'] ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '" tabindex="-1" aria-hidden="true"'598 $out .= '<a class="amzly-compare__thumb" href="' . esc_url( $image_link ) . '" target="' 599 . esc_attr( Amzly_PB_Renderer::target_for( $image_link, $atts ) ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $image_link ) ) . '" tabindex="-1" aria-hidden="true"' 598 600 . Amzly_PB_Renderer::track_attrs( $asin, 'image' ) . '>' 599 601 . self::thumb_img( $data, $asin ) … … 602 604 603 605 $out .= '<a class="amzly-compare__name" href="' . esc_url( $link ) . '" target="' 604 . esc_attr( $atts['target']) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '"'606 . esc_attr( Amzly_PB_Renderer::target_for( $link, $atts ) ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '"' 605 607 . Amzly_PB_Renderer::track_attrs( $asin, 'name' ) . '>' 606 608 . esc_html( '' !== $data['title'] ? $data['title'] : $asin ) … … 887 889 888 890 return '<a class="amzly-price-link" href="' . esc_url( $data['amazon_url'] ) . '" target="' 889 . esc_attr( isset( $atts['target'] ) ? $atts['target'] : '_blank') . '" rel="'891 . esc_attr( Amzly_PB_Renderer::target_for( $data['amazon_url'], $atts ) ) . '" rel="' 890 892 . esc_attr( Amzly_PB_Renderer::rel_for( $data['amazon_url'] ) ) . '"' 891 893 . Amzly_PB_Renderer::track_attrs( isset( $data['asin'] ) ? (string) $data['asin'] : '', 'price' ) . '>' -
amzly-price-badge/trunk/includes/class-matrix.php
r3698089 r3702054 170 170 171 171 foreach ( $products as $asin => $data ) { 172 $link = Amzly_PB_Renderer::product_url( $data ); 173 $is_pick = ( $column === $pick ); 172 $link = Amzly_PB_Renderer::product_url( $data, 'name' ); 173 $image_link = Amzly_PB_Renderer::product_url( $data, 'image' ); 174 $is_pick = ( $column === $pick ); 174 175 175 176 $out .= '<th scope="col" class="amzly-matrix__product' … … 192 193 193 194 if ( ! empty( $atts['list_images'] ) && ! empty( $data['image_url'] ) ) { 194 $out .= '<a class="amzly-matrix__thumb" href="' . esc_url( $ link ) . '" target="'195 . esc_attr( $atts['target'] ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '" tabindex="-1" aria-hidden="true"'195 $out .= '<a class="amzly-matrix__thumb" href="' . esc_url( $image_link ) . '" target="' 196 . esc_attr( Amzly_PB_Renderer::target_for( $image_link, $atts ) ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $image_link ) ) . '" tabindex="-1" aria-hidden="true"' 196 197 . Amzly_PB_Renderer::track_attrs( $asin, 'image' ) . '>' 197 198 . '<img src="' . esc_url( $data['image_url'] ) . '" alt="' … … 201 202 202 203 $out .= '<a class="amzly-matrix__name" href="' . esc_url( $link ) . '" target="' 203 . esc_attr( $atts['target']) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '"'204 . esc_attr( Amzly_PB_Renderer::target_for( $link, $atts ) ) . '" rel="' . esc_attr( Amzly_PB_Renderer::rel_for( $link ) ) . '"' 204 205 . Amzly_PB_Renderer::track_attrs( $asin, 'name' ) . '>' 205 206 . esc_html( isset( $names[ $column ] ) ? $names[ $column ] : $asin ) -
amzly-price-badge/trunk/includes/class-options.php
r3698089 r3702054 33 33 'pulse' => array( 'all', 'deals', 'off' ), 34 34 'target' => array( '_blank', '_self' ), 35 'amazon_target' => array( '_blank', '_self' ), 35 36 'data_source' => array( 'amzly', 'hybrid', 'amazon' ), 36 37 ); … … 123 124 'pulse' => 'all', 124 125 'target' => '_blank', 126 127 // Eigenes Linkziel für alles, was zu Amazon führt — Amazon-Knopf und, 128 // mit Partner-Tag, Name und Bild. Unabhängig von den Links zu amzly.de. 129 'amazon_target' => '_blank', 125 130 'cache_ttl' => 6 * HOUR_IN_SECONDS, 126 131 'attribution' => true, … … 137 142 */ 138 143 'report_clicks' => false, 144 145 /* 146 * Kampagnen-Tracking auf amzly.de: Kennungen im Link zu amzly.de, 147 * damit dort sichtbar wird, welche Beiträge Besucher bringen. Aus 148 * demselben Grund wie oben nur auf ausdrücklichen Wunsch. 149 */ 150 'campaign_tracking' => false, 139 151 ); 140 152 } -
amzly-price-badge/trunk/includes/class-renderer.php
r3698089 r3702054 25 25 private static $mark_printed = false; 26 26 27 /** Suche auf amzly.de. Eine bekannte ASIN leitet sie auf ihre Produktseite weiter. */ 28 const AMZLY_SEARCH = 'https://amzly.de/suche'; 29 27 30 /** 28 31 * Badge für eine ASIN. … … 130 133 131 134 /* 132 * Jedes Element verlinkt dorthin, woher sein Inhalt stammt. Steht in 133 * der Pille ein Preis von Amazon, führt sie über den Link aus der 134 * Creators API zu Amazon — so verlangen es deren Bedingungen. Zeigt sie 135 * nur das Urteil von amzly.de, führt sie wie bisher dorthin. 135 * Die Pille führt immer zu amzly.de — auch dann, wenn der Preis darin 136 * von Amazon stammt. Nach Amazon geht allein der Amazon-Knopf (und, 137 * mit eingetragenem Partner-Tag, Produktname und Bild). 136 138 */ 137 139 $amazon_price = $atts['show_price'] && '' !== $price 138 && isset( $data['price_source'] ) && 'amazon' === $data['price_source'] 139 && ! empty( $data['amazon_url'] ); 140 141 $href = $amazon_price ? $data['amazon_url'] : self::amzly_link( $data ); 140 && isset( $data['price_source'] ) && 'amazon' === $data['price_source']; 141 142 $href = self::amzly_target( $data, array(), 'badge' ); 142 143 143 144 $html = sprintf( … … 280 281 $label = ! empty( $data['price_hidden'] ) 281 282 ? __( 'Price on Amazon', 'amzly-price-badge' ) 282 : __( 'View on Amazon', 'amzly-price-badge' );283 : __( 'View on amzly.de', 'amzly-price-badge' ); 283 284 } else { 284 285 $label = ''; … … 322 323 $tooltip = implode( ' · ', $parts ); 323 324 $post_id = self::countable_post_id(); 324 $href = $data['amazon_url']; 325 326 /* 327 * Auch ohne Daten von amzly.de führt die Pille dorthin: über die Suche, 328 * die eine bekannte ASIN direkt auf ihre Produktseite weiterleitet. 329 */ 330 $href = self::amzly_target( $data, array(), 'badge' ); 325 331 326 332 $html = sprintf( … … 378 384 379 385 /** 380 * Link zur Produktseite auf amzly.de, mit Herkunftskennzeichnung. 386 * Linkziel passend zum Link: Amazon und amzly.de lassen sich getrennt 387 * einstellen — neuer Tab oder derselbe. 388 * 389 * @param string $url Adresse. 390 * @param array $atts Anzeigeoptionen. 391 * @return string _blank oder _self. 392 */ 393 public static function target_for( $url, array $atts ) { 394 if ( self::is_amazon_url( $url ) ) { 395 $target = isset( $atts['amazon_target'] ) ? $atts['amazon_target'] : Amzly_PB_Options::get( 'amazon_target', '_blank' ); 396 } else { 397 $target = isset( $atts['target'] ) ? $atts['target'] : '_blank'; 398 } 399 400 return '_self' === $target ? '_self' : '_blank'; 401 } 402 403 /** 404 * Link zur Produktseite auf amzly.de. 381 405 * 382 406 * @param array $data Produktdaten. … … 384 408 * @return string '' wenn amzly.de das Produkt nicht kennt. 385 409 */ 386 public static function amzly_link( array $data, array $extra = array() ) {410 public static function amzly_link( array $data, array $extra = array(), $element = '' ) { 387 411 if ( ! empty( $data['amzly_url'] ) ) { 388 return self::link( $data['amzly_url'], $extra );412 return self::link( $data['amzly_url'], $extra, $element ); 389 413 } 390 414 391 415 // Datensätze ohne das neue Feld: `url` ist dann die amzly-Seite. 392 416 if ( ! empty( $data['url'] ) && ! self::is_amazon_url( $data['url'] ) ) { 393 return self::link( $data['url'], $extra );417 return self::link( $data['url'], $extra, $element ); 394 418 } 395 419 396 420 return ''; 421 } 422 423 /** 424 * Ein Ziel auf amzly.de, auch wenn amzly.de das Produkt nicht geliefert hat. 425 * 426 * Ohne Produktseite bleibt die Suche: Sie leitet eine ASIN, die amzly.de 427 * kennt, per 302 auf deren Seite weiter. So führt die Pille nie zu Amazon. 428 * 429 * @param array $data Produktdaten. 430 * @param array $extra Zusätzliche Parameter. 431 * @param string $element Kennung des Elements, für das Kampagnen-Tracking. 432 * @return string 433 */ 434 public static function amzly_target( array $data, array $extra = array(), $element = '' ) { 435 $href = self::amzly_link( $data, $extra, $element ); 436 437 if ( '' === $href && ! empty( $data['asin'] ) ) { 438 $href = self::link( 439 add_query_arg( array( 'q' => Amzly_PB_Asin_Parser::normalize( (string) $data['asin'] ) ), self::AMZLY_SEARCH ), 440 $extra, 441 $element 442 ); 443 } 444 445 return $href; 446 } 447 448 /** 449 * Link zum Produkt auf amazon.de mit dem Partner-Tag des Betreibers. 450 * 451 * Mit Creators API der unveränderte Link von Amazon, sonst /dp/ plus Tag. 452 * Ohne Tag ein schlichter Link ohne Kennung. 453 * 454 * @param string $asin ASIN. 455 * @param array|null $data Produktdaten, falls vorhanden. 456 * @return string 457 */ 458 public static function amazon_url_for( $asin, $data = null ) { 459 if ( is_array( $data ) && ! empty( $data['amazon_url'] ) ) { 460 return $data['amazon_url']; 461 } 462 463 $url = 'https://www.amazon.de/dp/' . rawurlencode( $asin ); 464 $tag = self::amazon_tag(); 465 466 return '' !== $tag ? add_query_arg( array( 'tag' => $tag ), $url ) : $url; 397 467 } 398 468 … … 454 524 $post_id = $post_id ? $post_id : self::countable_post_id(); 455 525 456 // Der Name stammt von amzly.de, solange amzly.de das Produkt kennt — 457 // dann führt er auch dorthin. Sonst kommt er von Amazon. 458 $href = self::amzly_link( $data ); 459 460 if ( '' === $href ) { 461 $href = $data['url']; 462 } 526 $href = self::product_url( $data, 'name' ); 463 527 464 528 return sprintf( 465 529 '<a class="amzly-badge__title amzly-badge__title--%6$s" href="%1$s" target="%2$s" rel="%7$s" data-asin="%3$s"%4$s>%5$s</a>', 466 530 esc_url( $href ), 467 esc_attr( $atts['target']),531 esc_attr( self::target_for( $href, $atts ) ), 468 532 esc_attr( $data['asin'] ), 469 533 self::track( $post_id, 'name' ), … … 556 620 } 557 621 558 if ( is_array( $data ) && ! empty( $data['amazon_url'] ) ) { 559 /* 560 * Mit der Creators API gibt es einen Link von Amazon selbst. Er trägt 561 * das Partner-Tag und weitere Kennungen, und er muss unverändert 562 * bleiben — sonst wird der Verkauf laut Amazon nicht zugeordnet. 563 */ 564 $url = $data['amazon_url']; 565 $rel = self::rel_for( $url ); 566 } else { 567 $tag = self::amazon_tag(); 568 $url = 'https://www.amazon.de/dp/' . rawurlencode( $asin ); 569 570 /* 571 * Ohne Partner-Tag führt der Knopf trotzdem zu Amazon, nur eben ohne 572 * Kennung. Wer keins hat, will die Leute ja genauso zum Produkt 573 * schicken — nur verdient dann niemand daran. 574 * 575 * `sponsored` gehört nur an einen Link, an dem tatsächlich Geld hängt. 576 * Ein Link ohne Tag ist keine Werbung und wird deshalb auch nicht so 577 * ausgezeichnet; `nofollow` bleibt, weil das Ziel nicht zum Blog gehört. 578 */ 579 $rel = 'nofollow noopener'; 580 581 if ( '' !== $tag ) { 582 $url = add_query_arg( array( 'tag' => $tag ), $url ); 583 $rel = 'sponsored ' . $rel; 584 } 585 } 622 /* 623 * Mit der Creators API gibt es einen Link von Amazon selbst. Er trägt 624 * das Partner-Tag und weitere Kennungen, und er muss unverändert 625 * bleiben — sonst wird der Verkauf laut Amazon nicht zugeordnet. 626 * 627 * Ohne Partner-Tag führt der Knopf trotzdem zu Amazon, nur eben ohne 628 * Kennung. `sponsored` steht nur an einem Link, an dem tatsächlich 629 * Geld hängt; rel_for() entscheidet das am Link selbst. 630 */ 631 $url = self::amazon_url_for( $asin, $data ); 632 $rel = self::rel_for( $url ); 586 633 587 634 $classes = array( … … 603 650 esc_attr( implode( ' ', $classes ) ), 604 651 esc_url( $url ), 605 esc_attr( $atts['target']),652 esc_attr( self::target_for( $url, $atts ) ), 606 653 esc_attr__( 'Buy on Amazon (affiliate link)', 'amzly-price-badge' ), 607 654 esc_attr( $asin ), … … 625 672 626 673 // Den Preisalarm gibt es nur auf amzly.de. 627 $href = self::amzly_link( $data, array( 'alarm' => '1' ) );674 $href = self::amzly_link( $data, array( 'alarm' => '1' ), 'alert' ); 628 675 629 676 if ( '' === $href ) { … … 725 772 726 773 /** 727 * Fertiger Produktlink aus einem Datensatz — für Liste und Vergleich. 728 * 729 * @param array $data Produktdaten. 730 * @param array $extra Zusätzliche Parameter, etwa `alarm` für den Preisalarm. 731 * @return string 732 */ 733 public static function product_url( array $data, array $extra = array() ) { 734 return empty( $data['url'] ) ? '' : self::link( $data['url'], $extra ); 735 } 736 737 /** 738 * Hängt die Herkunftskennzeichnung an einen Produktlink. 739 * 740 * @param string $url Produkt-URL von amzly.de. 741 * @param array $extra Zusätzliche Parameter. 742 * @return string 743 */ 744 private static function link( $url, array $extra = array() ) { 745 /* 746 * Links zu Amazon bleiben, wie sie sind. Die Herkunftskennzeichnung ist 747 * für amzly.de gedacht, und ein Link aus der Creators API darf laut 748 * Amazon ohnehin nicht verändert werden. 774 * Ziel von Produktname und Produktbild — überall: Badge, Liste, Vergleich, 775 * Tabelle, Chart. 776 * 777 * In der Regel amzly.de. Hat der Betreiber ein eigenes Partner-Tag 778 * eingetragen, verdient er an diesem Klick lieber selbst: Dann führen Name 779 * und Bild zu Amazon, mit seinem Tag. Die Pille bleibt davon unberührt. 780 * 781 * @param array $data Produktdaten. 782 * @param string $element name oder image, für das Kampagnen-Tracking. 783 * @return string 784 */ 785 public static function product_url( array $data, $element = 'name' ) { 786 $asin = isset( $data['asin'] ) ? Amzly_PB_Asin_Parser::normalize( (string) $data['asin'] ) : ''; 787 788 if ( '' !== $asin && '' !== self::amazon_tag() ) { 789 return self::amazon_url_for( $asin, $data ); 790 } 791 792 return self::amzly_target( $data, array(), (string) $element ); 793 } 794 795 /** 796 * Baut einen Link zu amzly.de — sauber, ohne Zusätze. Nur mit 797 * eingeschaltetem Kampagnen-Tracking kommen ad_network und ad_id dazu. 798 * 799 * @param string $url Produkt-URL von amzly.de. 800 * @param array $extra Zusätzliche Parameter. 801 * @param string $element Geklicktes Element, für das Kampagnen-Tracking. 802 * @return string 803 */ 804 private static function link( $url, array $extra = array(), $element = '' ) { 805 /* 806 * Links zu Amazon bleiben, wie sie sind. Das Kampagnen-Tracking ist für 807 * amzly.de gedacht, und ein Link aus der Creators API darf laut Amazon 808 * ohnehin nicht verändert werden. 749 809 */ 750 810 if ( self::is_amazon_url( $url ) ) { … … 755 815 $host = preg_replace( '/^www\./', '', $host ); 756 816 757 $args = $extra; 758 759 if ( '' !== $host ) { 760 // add_query_arg kodiert selbst — hier nicht zusätzlich rawurlencode(), 761 // das ergäbe doppelt kodierte Werte. 762 $args['ref'] = 'wp'; 763 $args['src'] = $host; 764 } 817 $args = array_merge( $extra, self::campaign_args( $host, $element ) ); 765 818 766 819 if ( empty( $args ) ) { … … 769 822 770 823 return add_query_arg( $args, $url ); 824 } 825 826 /** 827 * Kennungen für das Kampagnen-Tracking auf amzly.de — nur, wenn der 828 * Betreiber es eingeschaltet hat. 829 * 830 * Die Namen der Parameter gibt amzly.de fest vor. Belegt werden genau zwei: 831 * 832 * ad_network die Website, von der der Klick kommt 833 * ad_id das geklickte Element: badge, name, image, alert, chart 834 * 835 * Nichts davon betrifft den Besucher. Es steht nur im Link, den er 836 * anklickt, und das Plugin selbst schickt dafür nichts irgendwohin. 837 * 838 * @param string $host Domain des Blogs, ohne www. 839 * @param string $element Geklicktes Element, '' für keins. 840 * @return array<string, string> 841 */ 842 private static function campaign_args( $host, $element ) { 843 $element = sanitize_key( (string) $element ); 844 $network = self::campaign_network( $host ); 845 846 if ( '' === $element || '' === $network || ! Amzly_PB_Options::get( 'campaign_tracking', false ) ) { 847 return array(); 848 } 849 850 return array( 851 'ad_network' => $network, 852 'ad_id' => $element, 853 ); 854 } 855 856 /** 857 * Die Domain als Wert für `ad_network`. 858 * 859 * amzly.de nimmt dort nur Kleinbuchstaben, Ziffern, Binde- und 860 * Unterstriche an, 2 bis 20 Zeichen, und verwirft alles andere. Aus 861 * „mein-blog.de" wird deshalb „mein-blog-de"; längere Domains werden auf 862 * 20 Zeichen gekürzt. 863 * 864 * @param string $host Domain des Blogs, ohne www. 865 * @return string '' wenn nichts Brauchbares übrig bleibt. 866 */ 867 public static function campaign_network( $host ) { 868 $network = strtolower( (string) $host ); 869 $network = str_replace( '.', '-', $network ); 870 $network = preg_replace( '/[^a-z0-9_-]/', '', $network ); 871 $network = trim( substr( $network, 0, 20 ), '-_' ); 872 873 return strlen( $network ) >= 2 ? $network : ''; 771 874 } 772 875 -
amzly-price-badge/trunk/includes/class-settings.php
r3698089 r3702054 253 253 'label' => __( 'Amazon partner tag', 'amzly-price-badge' ), 254 254 'type' => 'text', 255 'help' => __( 'Optional. Your own tag from the Amazon partner programme, for example “meinblog-21”. It is added to the link as ?tag=… — a direct link, no redirect. Only a link that actually carries a tag is marked rel="sponsored".', 'amzly-price-badge' ),255 'help' => __( 'Optional. Your own tag from the Amazon partner programme, for example “meinblog-21”. It is added to the link as ?tag=… — a direct link, no redirect. With a tag, product names and images link to Amazon too; the badge itself always links to amzly.de. Only a link that actually carries a tag is marked rel="sponsored".', 'amzly-price-badge' ), 256 256 ), 257 257 'show_chart' => array( … … 295 295 'target' => array( 296 296 'section' => 'behaviour', 297 'label' => __( 'Open link ', 'amzly-price-badge' ),297 'label' => __( 'Open links to amzly.de', 'amzly-price-badge' ), 298 298 'type' => 'select', 299 299 'choices' => array( … … 301 301 '_self' => __( 'In the same tab', 'amzly-price-badge' ), 302 302 ), 303 'help' => __( 'Badge, price alert and price history. A block can set its own value.', 'amzly-price-badge' ), 304 ), 305 'amazon_target' => array( 306 'section' => 'behaviour', 307 'label' => __( 'Open links to Amazon', 'amzly-price-badge' ), 308 'type' => 'select', 309 'choices' => array( 310 '_blank' => __( 'In a new tab', 'amzly-price-badge' ), 311 '_self' => __( 'In the same tab', 'amzly-price-badge' ), 312 ), 313 'help' => __( 'The Amazon button, and product names and images once you have entered a partner tag.', 'amzly-price-badge' ), 303 314 ), 304 315 'schema' => array( … … 328 339 'checkbox_label' => __( 'Send a daily total', 'amzly-price-badge' ), 329 340 'help' => __( 'Off by default. Sends once a day: your domain, the date, and a click count per ASIN. Nothing about individual visitors. It helps amzly.de see which products are in demand.', 'amzly-price-badge' ), 341 ), 342 'campaign_tracking' => array( 343 'section' => 'stats', 344 'label' => __( 'Campaign tracking on amzly.de', 'amzly-price-badge' ), 345 'type' => 'checkbox', 346 'checkbox_label' => __( 'Mark links to amzly.de with campaign parameters', 'amzly-price-badge' ), 347 'help' => __( 'Off by default. Links to amzly.de then also carry your website and the element that was clicked (badge, name, image, price alert or chart), so amzly.de can show which websites send visitors. Nothing about individual visitors, and your site sends nothing itself — the parameters only travel in the link a visitor clicks.', 'amzly-price-badge' ), 330 348 ), 331 349 'cache_ttl' => array( -
amzly-price-badge/trunk/includes/class-shortcode.php
r3693467 r3702054 119 119 'pulse' => $options['pulse'], 120 120 'target' => $options['target'], 121 'amazon_target' => $options['amazon_target'], 121 122 'show_logo' => $options['show_logo'], 122 123 'show_label' => $options['show_label'], -
amzly-price-badge/trunk/languages/amzly-price-badge.pot
r3698089 r3702054 172 172 173 173 #: blocks/price/index.js:730 174 msgid "Open link "174 msgid "Open links to amzly.de" 175 175 msgstr "" 176 176 … … 1079 1079 msgstr "" 1080 1080 1081 #: includes/class-list.php:55 41081 #: includes/class-list.php:555 1082 1082 msgid "VS" 1083 1083 msgstr "" 1084 1084 1085 #: includes/class-list.php:84 11085 #: includes/class-list.php:843 1086 1086 msgid "%s measurements" 1087 1087 msgstr "" 1088 1088 1089 #: includes/class-list.php:85 51089 #: includes/class-list.php:857 1090 1090 msgid "In stock" 1091 1091 msgstr "" 1092 1092 1093 #: includes/class-list.php:85 61093 #: includes/class-list.php:858 1094 1094 msgid "Out of stock" 1095 1095 msgstr "" 1096 1096 1097 #: includes/class-list.php:85 71097 #: includes/class-list.php:859 1098 1098 msgid "Unknown" 1099 1099 msgstr "" 1100 1100 1101 #: includes/class-list.php:91 31101 #: includes/class-list.php:915 1102 1102 msgid "(instead of %s)" 1103 1103 msgstr "" 1104 1104 1105 #: includes/class-list.php:9 181105 #: includes/class-list.php:920 1106 1106 msgid "Saving on Amazon" 1107 1107 msgstr "" 1108 1108 1109 #: includes/class-list.php:93 71109 #: includes/class-list.php:939 1110 1110 msgid "No. %1$s in %2$s" 1111 1111 msgstr "" 1112 1112 1113 #: includes/class-list.php:94 31113 #: includes/class-list.php:945 1114 1114 msgid "No. %s" 1115 1115 msgstr "" 1116 1116 1117 #: includes/class-list.php:94 71117 #: includes/class-list.php:949 1118 1118 msgid "Bestseller rank" 1119 1119 msgstr "" 1120 1120 1121 #: includes/class-list.php:9 781121 #: includes/class-list.php:980 1122 1122 msgid "%s out of 5" 1123 1123 msgstr "" 1124 1124 1125 #: includes/class-list.php:98 71125 #: includes/class-list.php:989 1126 1126 msgid "(%s reviews)" 1127 1127 msgstr "" 1128 1128 1129 #: includes/class-matrix.php:28 31129 #: includes/class-matrix.php:284 1130 1130 msgid "To Amazon" 1131 1131 msgstr "" 1132 1132 1133 #: includes/class-renderer.php:10 31133 #: includes/class-renderer.php:106 1134 1134 msgid "Currently unavailable" 1135 1135 msgstr "" 1136 1136 1137 #: includes/class-renderer.php:1 691137 #: includes/class-renderer.php:170 1138 1138 msgid "Price rating by amzly.de" 1139 1139 msgstr "" 1140 1140 1141 #: includes/class-renderer.php:28 11141 #: includes/class-renderer.php:282 1142 1142 msgid "Price on Amazon" 1143 1143 msgstr "" 1144 1144 1145 #: includes/class-renderer.php:282 1146 msgid "View on Amazon" 1147 msgstr "" 1148 1149 #: includes/class-renderer.php:317 1145 #: includes/class-renderer.php:318 1150 1146 msgid "Price on Amazon as of %s" 1151 1147 msgstr "" 1152 1148 1153 #: includes/class-renderer.php:6 061149 #: includes/class-renderer.php:653 1154 1150 msgid "Buy on Amazon (affiliate link)" 1155 1151 msgstr "" 1156 1152 1157 #: includes/class-renderer.php:6 101153 #: includes/class-renderer.php:657 1158 1154 msgid "Amazon" 1159 1155 msgstr "" 1160 1156 1161 #: includes/class-renderer.php:6 331157 #: includes/class-renderer.php:680 1162 1158 msgid "Price alert" 1163 1159 msgstr "" 1164 1160 1165 #: includes/class-renderer.php:6 381161 #: includes/class-renderer.php:685 1166 1162 msgid "Set a price alert for %s" 1167 1163 msgstr "" 1168 1164 1169 #: includes/class-renderer.php: 8111165 #: includes/class-renderer.php:922 1170 1166 msgid "%s compared with the 90-day average" 1171 1167 msgstr "" 1172 1168 1173 #: includes/class-renderer.php: 8271169 #: includes/class-renderer.php:938 1174 1170 msgid "As of %s" 1175 1171 msgstr "" 1176 1172 1177 #: includes/class-renderer.php: 9291173 #: includes/class-renderer.php:1040 1178 1174 msgid "View price" 1179 1175 msgstr "" 1180 1176 1181 #: includes/class-renderer.php: 9631177 #: includes/class-renderer.php:1074 1182 1178 msgid "Amzly: no data for %s" 1183 1179 msgstr "" 1184 1180 1185 #: includes/class-renderer.php: 9961181 #: includes/class-renderer.php:1107 1186 1182 msgid "No price data" 1187 1183 msgstr "" … … 1300 1296 1301 1297 #: includes/class-settings.php:255 1302 msgid "Optional. Your own tag from the Amazon partner programme, for example “meinblog-21”. It is added to the link as ?tag=… — a direct link, no redirect. Only a link that actually carries a tag is marked rel=\"sponsored\"."1298 msgid "Optional. Your own tag from the Amazon partner programme, for example “meinblog-21”. It is added to the link as ?tag=… — a direct link, no redirect. With a tag, product names and images link to Amazon too; the badge itself always links to amzly.de. Only a link that actually carries a tag is marked rel=\"sponsored\"." 1303 1299 msgstr "" 1304 1300 … … 1315 1311 msgstr "" 1316 1312 1317 #: includes/class-settings.php:306 1313 #: includes/class-settings.php:303 1314 msgid "Badge, price alert and price history. A block can set its own value." 1315 msgstr "" 1316 1317 #: includes/class-settings.php:307 1318 msgid "Open links to Amazon" 1319 msgstr "" 1320 1321 #: includes/class-settings.php:313 1322 msgid "The Amazon button, and product names and images once you have entered a partner tag." 1323 msgstr "" 1324 1325 #: includes/class-settings.php:317 1318 1326 msgid "Structured data" 1319 1327 msgstr "" 1320 1328 1321 #: includes/class-settings.php:3 081329 #: includes/class-settings.php:319 1322 1330 msgid "Mark up price lists as ItemList" 1323 1331 msgstr "" 1324 1332 1325 #: includes/class-settings.php:3 091333 #: includes/class-settings.php:320 1326 1334 msgid "Tells search engines that the block is a list of products — with names and links, deliberately without prices and without Product markup. Price markup in a blog post signals a shop page to Google and can be reported as an error. Switch this off if your SEO plugin already outputs ItemList data." 1327 1335 msgstr "" 1328 1336 1329 #: includes/class-settings.php:3 151337 #: includes/class-settings.php:326 1330 1338 msgid "Only below badges that sit on their own line. Inline badges carry the logo instead." 1331 1339 msgstr "" 1332 1340 1333 #: includes/class-settings.php:3 191341 #: includes/class-settings.php:330 1334 1342 msgid "Count badge clicks" 1335 1343 msgstr "" 1336 1344 1337 #: includes/class-settings.php:3 211345 #: includes/class-settings.php:332 1338 1346 msgid "Count clicks on this site" 1339 1347 msgstr "" 1340 1348 1341 #: includes/class-settings.php:3 221349 #: includes/class-settings.php:333 1342 1350 msgid "Records only the time, the post, the ASIN and what was clicked — badge, button, name, image or price. No IP address, no cookie, no user agent. Switch it off and the front end loads no JavaScript at all." 1343 1351 msgstr "" 1344 1352 1345 #: includes/class-settings.php:3 261353 #: includes/class-settings.php:337 1346 1354 msgid "Report clicks to amzly.de" 1347 1355 msgstr "" 1348 1356 1349 #: includes/class-settings.php:3 281357 #: includes/class-settings.php:339 1350 1358 msgid "Send a daily total" 1351 1359 msgstr "" 1352 1360 1353 #: includes/class-settings.php:3 291361 #: includes/class-settings.php:340 1354 1362 msgid "Off by default. Sends once a day: your domain, the date, and a click count per ASIN. Nothing about individual visitors. It helps amzly.de see which products are in demand." 1355 1363 msgstr "" 1356 1364 1357 #: includes/class-settings.php:333 1365 #: includes/class-settings.php:344 1366 msgid "Campaign tracking on amzly.de" 1367 msgstr "" 1368 1369 #: includes/class-settings.php:346 1370 msgid "Mark links to amzly.de with campaign parameters" 1371 msgstr "" 1372 1373 #: includes/class-settings.php:347 1374 msgid "Off by default. Links to amzly.de then also carry your website and the element that was clicked (badge, name, image, price alert or chart), so amzly.de can show which websites send visitors. Nothing about individual visitors, and your site sends nothing itself — the parameters only travel in the link a visitor clicks." 1375 msgstr "" 1376 1377 #: includes/class-settings.php:351 1358 1378 msgid "Refresh prices every" 1359 1379 msgstr "" 1360 1380 1361 #: includes/class-settings.php:3 361381 #: includes/class-settings.php:354 1362 1382 msgid "1 hour" 1363 1383 msgstr "" 1364 1384 1365 #: includes/class-settings.php:3 371385 #: includes/class-settings.php:355 1366 1386 msgid "3 hours" 1367 1387 msgstr "" 1368 1388 1369 #: includes/class-settings.php:3 381389 #: includes/class-settings.php:356 1370 1390 msgid "6 hours" 1371 1391 msgstr "" 1372 1392 1373 #: includes/class-settings.php:3 391393 #: includes/class-settings.php:357 1374 1394 msgid "12 hours" 1375 1395 msgstr "" 1376 1396 1377 #: includes/class-settings.php:3 401397 #: includes/class-settings.php:358 1378 1398 msgid "24 hours" 1379 1399 msgstr "" 1380 1400 1381 #: includes/class-settings.php:3 421401 #: includes/class-settings.php:360 1382 1402 msgid "Prices on amzly.de are updated hourly. Shorter intervals mean more requests without fresher data." 1383 1403 msgstr "" 1384 1404 1385 #: includes/class-settings.php: 3901405 #: includes/class-settings.php:408 1386 1406 msgid "Behaviour" 1387 1407 msgstr "" 1388 1408 1389 #: includes/class-settings.php: 3911409 #: includes/class-settings.php:409 1390 1410 msgid "Your own Amazon link" 1391 1411 msgstr "" 1392 1412 1393 #: includes/class-settings.php: 3921413 #: includes/class-settings.php:410 1394 1414 msgid "Amazon Creators API" 1395 1415 msgstr "" 1396 1416 1397 #: includes/class-settings.php: 3931417 #: includes/class-settings.php:411 1398 1418 msgid "Where the product data comes from" 1399 1419 msgstr "" 1400 1420 1401 #: includes/class-settings.php: 3941421 #: includes/class-settings.php:412 1402 1422 msgid "Click counting" 1403 1423 msgstr "" 1404 1424 1405 #: includes/class-settings.php: 3951425 #: includes/class-settings.php:413 1406 1426 msgid "Data" 1407 1427 msgstr "" 1408 1428 1409 #: includes/class-settings.php:4 151429 #: includes/class-settings.php:433 1410 1430 msgid "Credential ID" 1411 1431 msgstr "" 1412 1432 1413 #: includes/class-settings.php:4 161433 #: includes/class-settings.php:434 1414 1434 msgid "Credential secret" 1415 1435 msgstr "" 1416 1436 1417 #: includes/class-settings.php:4 171437 #: includes/class-settings.php:435 1418 1438 msgid "Credential version" 1419 1439 msgstr "" 1420 1440 1421 #: includes/class-settings.php:5 121441 #: includes/class-settings.php:530 1422 1442 msgid "Enabled" 1423 1443 msgstr "" 1424 1444 1425 #: includes/class-settings.php:5 771445 #: includes/class-settings.php:595 1426 1446 msgid "Only needed if you are an Amazon associate with access to the Creators API. You find the credentials in Associates Central under Tools → Creators API. The partner tag above under “Your own Amazon link” must belong to the same store." 1427 1447 msgstr "" 1428 1448 1429 #: includes/class-settings.php:5 791449 #: includes/class-settings.php:597 1430 1450 msgid "Amazon only grants access to associates with 10 qualified sales through the API in the last 30 days. Prices from Amazon are kept for one hour at most, product details for one day — those are Amazon’s rules, and the plugin sticks to them." 1431 1451 msgstr "" 1432 1452 1433 #: includes/class-settings.php:6 131453 #: includes/class-settings.php:631 1434 1454 msgid "Stored — leave empty to keep" 1435 1455 msgstr "" 1436 1456 1437 #: includes/class-settings.php:6 181457 #: includes/class-settings.php:636 1438 1458 msgid "Stored encrypted with the salts from wp-config.php and never shown again. After moving the site to new salts it has to be entered once more." 1439 1459 msgstr "" 1440 1460 1441 #: includes/class-settings.php:6 251461 #: includes/class-settings.php:643 1442 1462 msgid "Remove the stored credentials" 1443 1463 msgstr "" 1444 1464 1445 #: includes/class-settings.php:6 331465 #: includes/class-settings.php:651 1446 1466 msgid "3.2 — Europe (usual for amazon.de)" 1447 1467 msgstr "" 1448 1468 1449 #: includes/class-settings.php:6 341469 #: includes/class-settings.php:652 1450 1470 msgid "3.1 — North America" 1451 1471 msgstr "" 1452 1472 1453 #: includes/class-settings.php:6 351473 #: includes/class-settings.php:653 1454 1474 msgid "3.3 — Far East" 1455 1475 msgstr "" 1456 1476 1457 #: includes/class-settings.php:6 531477 #: includes/class-settings.php:671 1458 1478 msgid "Shown next to the credentials in Associates Central. It only decides where the access token is fetched; prices always come from amazon.de." 1459 1479 msgstr "" 1460 1480 1461 #: includes/class-settings.php:6 641481 #: includes/class-settings.php:682 1462 1482 msgid "You are not allowed to do this." 1463 1483 msgstr "" 1464 1484 1465 #: includes/class-settings.php: 6931485 #: includes/class-settings.php:711 1466 1486 msgid "Amazon answered in %1$d ms with: %2$s — %3$s" 1467 1487 msgstr "" 1468 1488 1469 #: includes/class-settings.php:7 021489 #: includes/class-settings.php:720 1470 1490 msgid "Connection to Amazon works." 1471 1491 msgstr "" 1472 1492 1473 #: includes/class-settings.php:7 101493 #: includes/class-settings.php:728 1474 1494 msgid "Setup" 1475 1495 msgstr "" 1476 1496 1477 #: includes/class-settings.php:7 111497 #: includes/class-settings.php:729 1478 1498 msgid "Access token" 1479 1499 msgstr "" 1480 1500 1481 #: includes/class-settings.php:7 121501 #: includes/class-settings.php:730 1482 1502 msgid "Product request" 1483 1503 msgstr "" 1484 1504 1485 #: includes/class-settings.php:7 171505 #: includes/class-settings.php:735 1486 1506 msgid "Connection to Amazon failed." 1487 1507 msgstr "" 1488 1508 1489 #: includes/class-settings.php:7 771509 #: includes/class-settings.php:795 1490 1510 msgid "Connection works." 1491 1511 msgstr "" 1492 1512 1493 #: includes/class-settings.php:7 811513 #: includes/class-settings.php:799 1494 1514 msgid "The API answered in %1$d ms with: %2$s" 1495 1515 msgstr "" 1496 1516 1497 #: includes/class-settings.php: 7931517 #: includes/class-settings.php:811 1498 1518 msgid "Connection failed." 1499 1519 msgstr "" 1500 1520 1501 #: includes/class-settings.php: 7991521 #: includes/class-settings.php:817 1502 1522 msgid "Requested: %1$s — as: %2$s" 1503 1523 msgstr "" 1504 1524 1505 #: includes/class-settings.php:8 581525 #: includes/class-settings.php:876 1506 1526 msgid "Everything here is a default — every single block and shortcode can override it." 1507 1527 msgstr "" 1508 1528 1509 #: includes/class-settings.php:8 641529 #: includes/class-settings.php:882 1510 1530 msgid "Amazon is selected, but credential ID, secret or partner tag are missing." 1511 1531 msgstr "" 1512 1532 1513 #: includes/class-settings.php: 8831533 #: includes/class-settings.php:901 1514 1534 msgid "Test connection to Amazon" 1515 1535 msgstr "" 1516 1536 1517 #: includes/class-settings.php:9 011537 #: includes/class-settings.php:919 1518 1538 msgid "Which data leaves your site" 1519 1539 msgstr "" 1520 1540 1521 #: includes/class-settings.php:9 051541 #: includes/class-settings.php:923 1522 1542 msgid "The badges are rendered on your server. Your visitors’ browsers never contact amzly.de — only when someone actually clicks a badge. Sent to amzly.de are: the ASIN, your web server’s IP address and your site address in the user agent. No visitor data at all." 1523 1543 msgstr "" 1524 1544 1525 #: includes/class-settings.php:9 141545 #: includes/class-settings.php:932 1526 1546 msgid "Terms of use and privacy information" 1527 1547 msgstr "" 1528 1548 1529 #: includes/class-settings.php:9 401549 #: includes/class-settings.php:958 1530 1550 msgid "Cache cleared. Prices are fetched again on the next page view." 1531 1551 msgstr "" 1532 1552 1533 #: includes/class-settings.php:9 511553 #: includes/class-settings.php:969 1534 1554 msgid "Data source in effect: %s" 1535 1555 msgstr "" 1536 1556 1537 #: includes/class-settings.php:9 641557 #: includes/class-settings.php:982 1538 1558 msgid "Both sources are asked separately and kept separately, because Amazon allows its data to be stored for one day at most while amzly.de does not limit that. A page view uses whatever is already cached and only asks the source that is missing something; what a badge finally shows is put together from both." 1539 1559 msgstr "" 1540 1560 1541 #: includes/class-settings.php:9 781561 #: includes/class-settings.php:996 1542 1562 msgid "Connection" 1543 1563 msgstr "" 1544 1564 1545 #: includes/class-settings.php: 9831565 #: includes/class-settings.php:1001 1546 1566 msgid "paused after repeated errors — retrying automatically" 1547 1567 msgstr "" 1548 1568 1549 #: includes/class-settings.php: 9861569 #: includes/class-settings.php:1004 1550 1570 msgid "ready" 1551 1571 msgstr "" 1552 1572 1553 #: includes/class-settings.php: 9921573 #: includes/class-settings.php:1010 1554 1574 msgid "Requests today" 1555 1575 msgstr "" 1556 1576 1557 #: includes/class-settings.php:10 011577 #: includes/class-settings.php:1019 1558 1578 msgid "%s of them failed" 1559 1579 msgstr "" 1560 1580 1561 #: includes/class-settings.php:10 101581 #: includes/class-settings.php:1028 1562 1582 msgid "Products in the cache" 1563 1583 msgstr "" 1564 1584 1565 #: includes/class-settings.php:10 141585 #: includes/class-settings.php:1032 1566 1586 msgid "Of those, not found on Amazon" 1567 1587 msgstr "" 1568 1588 1569 #: includes/class-settings.php:10 181589 #: includes/class-settings.php:1036 1570 1590 msgid "Oldest entry" 1571 1591 msgstr "" 1572 1592 1573 #: includes/class-settings.php:10 251593 #: includes/class-settings.php:1043 1574 1594 msgid "%s ago" 1575 1595 msgstr "" 1576 1596 1577 #: includes/class-settings.php:10 341597 #: includes/class-settings.php:1052 1578 1598 msgid "Next background refresh" 1579 1599 msgstr "" 1580 1600 1581 #: includes/class-settings.php:10 401601 #: includes/class-settings.php:1058 1582 1602 msgid "nothing pending" 1583 1603 msgstr "" 1584 1604 1585 #: includes/class-settings.php:10 501605 #: includes/class-settings.php:1068 1586 1606 msgid "Test connection to amzly.de" 1587 1607 msgstr "" 1588 1608 1589 #: includes/class-settings.php:10 751609 #: includes/class-settings.php:1093 1590 1610 msgid "not set up" 1591 1611 msgstr "" 1592 1612 1593 #: includes/class-settings.php:10 771613 #: includes/class-settings.php:1095 1594 1614 msgid "partner tag missing" 1595 1615 msgstr "" 1596 1616 1597 #: includes/class-settings.php:10 791617 #: includes/class-settings.php:1097 1598 1618 msgid "credential ID or secret missing" 1599 1619 msgstr "" 1600 1620 1601 #: includes/class-settings.php:1 0831621 #: includes/class-settings.php:1101 1602 1622 msgid "Amazon settings" 1603 1623 msgstr "" 1604 1624 1605 #: includes/class-settings.php:1 0941625 #: includes/class-settings.php:1112 1606 1626 msgid "paused — retrying automatically" 1607 1627 msgstr "" 1608 1628 1609 #: includes/class-settings.php:1 0961629 #: includes/class-settings.php:1114 1610 1630 msgid "not used yet" 1611 1631 msgstr "" 1612 1632 1613 #: includes/class-settings.php:11 001633 #: includes/class-settings.php:1118 1614 1634 msgid "last request failed" 1615 1635 msgstr "" 1616 1636 1617 #: includes/class-settings.php:11 161637 #: includes/class-settings.php:1134 1618 1638 msgid "%1$s of %2$s" 1619 1639 msgstr "" 1620 1640 1621 #: includes/class-settings.php:11 291641 #: includes/class-settings.php:1147 1622 1642 msgid "Kept for" 1623 1643 msgstr "" 1624 1644 1625 #: includes/class-settings.php:11 301645 #: includes/class-settings.php:1148 1626 1646 msgid "prices one hour, product details one day — Amazon’s rules" 1627 1647 msgstr "" 1628 1648 1629 #: includes/class-settings.php:11 331649 #: includes/class-settings.php:1151 1630 1650 msgid "Marketplace" 1631 1651 msgstr "" 1632 1652 1633 #: includes/class-settings.php:11 541653 #: includes/class-settings.php:1172 1634 1654 msgid "Clear cache" 1635 1655 msgstr "" 1636 1656 1637 #: includes/class-settings.php:11 581657 #: includes/class-settings.php:1176 1638 1658 msgid "A connection test bypasses the cache and any pause, and reports verbatim what went wrong. “Clear cache” empties both caches at once and lifts a pause after repeated errors." 1639 1659 msgstr "" -
amzly-price-badge/trunk/readme.txt
r3698089 r3702054 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 35 35 * **Never a broken post.** If the API is unreachable, badges keep showing the last known price instead of disappearing. 36 36 37 = Where the badge links to = 38 39 To the product page on amzly.de, which shows the full price history. The plugin never places someone else's affiliate tag into your posts. 40 41 With your own Amazon Creators API access (see below), anything that shows a price from Amazon links to Amazon instead — through the link Amazon itself returns, carrying your partner tag. Amazon requires that. The price rating, the price alert and the price history keep linking to amzly.de, because that is where they come from. 37 = Where the links go = 38 39 * **The badge, the price alert and the price history** link to the product page on amzly.de, which shows the full price history. Always — also when the price inside the badge comes from Amazon. 40 * **The Amazon button** links to the product on amazon.de, with your partner tag if you entered one. 41 * **Product names and images** link to amzly.de as well. Once you enter your own partner tag, they link to Amazon with your tag instead, so those clicks earn you commission. 42 43 With your own Amazon Creators API access, every link to Amazon is the unchanged link Amazon returns, carrying your partner tag. A price column that shows Amazon's price links there too. The plugin never places someone else's affiliate tag into your posts. 44 45 Whether a link opens in a new tab or the same one can be set separately for links to amzly.de and links to Amazon, under **Amzly → Settings → Display**. 42 46 43 47 = Prices straight from Amazon (optional) = … … 57 61 = Found by search engines = 58 62 59 Price lists, comparison tables and two-product comparisons carry `ItemList` markup as JSON-LD: position, product name, link and image per product. Deliberately **no `Product` and no prices** — price markup in a blog post tells Google the page sells the product, which belongs on a shop page and is reported as an error otherwise. The links in the markup never carry a partner tag or a tracking parameter; the visible links keep themand stay marked `rel="sponsored"`.63 Price lists, comparison tables and two-product comparisons carry `ItemList` markup as JSON-LD: position, product name, link and image per product. Deliberately **no `Product` and no prices** — price markup in a blog post tells Google the page sells the product, which belongs on a shop page and is reported as an error otherwise. The links in the markup never carry a partner tag or a tracking parameter; visible links with your partner tag keep it and stay marked `rel="sponsored"`. 60 64 61 65 Switch it off under **Amzly → Settings → Display** if your SEO plugin already outputs `ItemList` data for the same page. 66 67 = Campaign tracking on amzly.de = 68 69 Optional and off by default. Switch it on under **Amzly → Settings → Clicks & data**, and links to amzly.de also carry your website and the element that was clicked — badge, name, image, price alert or chart. amzly.de uses this to show which websites send visitors. Nothing is stored or sent by your site; the parameters only travel in the link a visitor clicks, and links to Amazon never carry them. 62 70 63 71 = Click statistics = … … 92 100 93 101 * When you insert a badge in the editor, and when a page containing a badge is rendered with an expired cache, your web server requests `https://amzly.de/api/v1/asins` or `https://amzly.de/api/v1/asin/{asin}`. 94 * Sent are: the **ASIN** of the product, the **IP address of your web server** (unavoidable in any HTTP request) and your **site address** in the user agent, in the form `AmzlyPriceBadge/1. 0.1; https://example.com`.102 * Sent are: the **ASIN** of the product, the **IP address of your web server** (unavoidable in any HTTP request) and your **site address** in the user agent, in the form `AmzlyPriceBadge/1.1.1; https://example.com`. 95 103 * **No visitor data is sent.** Badges are rendered on your server; your visitors' browsers never contact amzly.de. Only when a visitor actually clicks a badge does their browser follow the link, exactly like any other outgoing link. 96 104 * Responses are cached, by default for six hours, so a page with badges normally causes no request at all. … … 99 107 100 108 If you enable "Report clicks to amzly.de" in the settings, the plugin sends once a day to `https://amzly.de/api/v1/badge/report`: your domain, the date, and a click count per ASIN. Never anything about individual visitors. 109 110 If you enable "Campaign tracking on amzly.de", links to amzly.de carry two parameters: `ad_network` (your domain, with dots turned into hyphens, at most 20 characters) and `ad_id` (the element clicked). Your server sends nothing for this; amzly.de only receives the parameters when a visitor follows such a link. 101 111 102 112 **Terms and privacy** … … 157 167 = Why does the badge not link straight to Amazon? = 158 168 159 Because a plugin must not put someone else's affiliate tag into your posts. The badge links to the product page on amzly.de, which shows the full price history. Where a price comes from your own Creators API access, it links to Amazon with your tag.169 Because the badge shows amzly.de's price rating, and the full price history behind it is on amzly.de. The way to Amazon is the Amazon button — and, once you enter your partner tag, the product name and image. A plugin must never put someone else's affiliate tag into your posts, so all of these carry your tag or none. 160 170 161 171 = Can I use my own Amazon affiliate tag? = 162 172 163 Yes, in two ways. Enter it under **Amzly → Settings → Amazon** and switch on the Amazon button: it then links to the product on amazon.de with your tag . If you also have access to the Amazon Creators API, you can let the plugin fetch prices straight from Amazon with your own credentials — then Amazon's price display rules apply to data that really comes from your account.173 Yes, in two ways. Enter it under **Amzly → Settings → Amazon** and switch on the Amazon button: it then links to the product on amazon.de with your tag, and product names and images link there too. If you also have access to the Amazon Creators API, you can let the plugin fetch prices straight from Amazon with your own credentials — then Amazon's price display rules apply to data that really comes from your account. 164 174 165 175 = Why does Amazon reject my credentials? = … … 193 203 == Upgrade Notice == 194 204 205 = 1.1.1 = 206 The badge now always links to amzly.de; only the Amazon button — and, with your partner tag, names and images — lead to Amazon. New optional campaign tracking. 207 195 208 = 1.1.0 = 196 209 New admin menu with click statistics and an optional connection to the Amazon Creators API. Existing posts and settings are taken over unchanged. 197 210 198 211 == Changelog == 212 213 = 1.1.1 = 214 215 **New** 216 217 * Optional campaign tracking on amzly.de, off by default: links to amzly.de carry your website and the clicked element, so amzly.de can show which websites send visitors. Links to Amazon never carry it. 218 * Separate setting for how links to Amazon open — new tab or same tab — independent of links to amzly.de. 219 220 **Changed** 221 222 * The badge always links to amzly.de — also when it shows a price from Amazon, and also for products amzly.de has not delivered data for (via the amzly.de search, which forwards a known ASIN to its product page). 223 * Product names and images link to amzly.de, or to Amazon with your tag once you have entered a partner tag. This applies to the badge, the price list, the comparison and the comparison table. 224 * The Amazon button is unchanged: it always links to Amazon. 225 * Links to amzly.de are clean: no more `ref` and `src` parameters. Only campaign tracking, if you switch it on, adds anything. 199 226 200 227 = 1.1.0 =
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)