Plugin Directory

Changeset 3702054


Ignore:
Timestamp:
09/18/2026 01:24:32 PM (6 weeks ago)
Author:
x64gmbh
Message:

Release 1.1.1

Location:
amzly-price-badge
Files:
45 added
12 edited

Legend:

Unmodified
Added
Removed
  • amzly-price-badge/trunk/amzly-price-badge.php

    r3698089 r3702054  
    44 * Plugin URI:        https://amzly.de/wordpress-plugin
    55 * 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.0
     6 * Version:           1.1.1
    77 * Requires at least: 6.5
    88 * Requires PHP:      7.4
    … …  
    2525defined( 'ABSPATH' ) || exit;
    2626
    27 define( 'AMZLY_PB_VERSION', '1.1.0' );
     27define( 'AMZLY_PB_VERSION', '1.1.1' );
    2828define( 'AMZLY_PB_FILE', __FILE__ );
    2929define( 'AMZLY_PB_DIR', plugin_dir_path( __FILE__ ) );
  • amzly-price-badge/trunk/blocks/price/block.json

    r3698089 r3702054  
    33        "apiVersion": 3,
    44        "name": "amzly/price",
    5         "version": "1.1.0",
     5        "version": "1.1.1",
    66        "title": "Amzly",
    77        "category": "widgets",
  • amzly-price-badge/trunk/blocks/price/index.js

    r3698089 r3702054  
    728728        function targetControl( attributes, setAttributes ) {
    729729                return el( SelectControl, {
    730                         label: __( 'Open link', 'amzly-price-badge' ),
     730                        label: __( 'Open links to amzly.de', 'amzly-price-badge' ),
    731731                        value: attributes.linkTarget || INHERIT,
    732732                        options: inheritFirst( [
  • amzly-price-badge/trunk/includes/class-chart.php

    r3698089 r3702054  
    122122                        . '<span class="amzly-chart">';
    123123
    124                 $html .= $large ? self::head( $history, $product ) : self::small_title( $history );
     124                $html .= $large ? self::head( $history, $product, $atts ) : self::small_title( $history );
    125125                $html .= '<span class="amzly-chart-inner">' . $svg . '</span>';
    126126
    … …  
    184184         * @param array $history Verlaufsdaten.
    185185         * @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() ) {
    189190                $out = '<span class="amzly-chart-head">'
    190191                        . '<span class="amzly-chart-head__left">'
    … …  
    195196
    196197                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"'
    198200                                . Amzly_PB_Renderer::track_attrs( isset( $product['asin'] ) ? (string) $product['asin'] : '', 'chart' ) . '>'
    199201                                . esc_html__( '(full history on amzly.de)', 'amzly-price-badge' )
    … …  
    300302
    301303        /**
    302          * Link zur Produktseite auf amzly.de, mit Herkunftskennzeichnung.
     304         * Link zur Produktseite auf amzly.de.
    303305         *
    304306         * Der Verlauf stammt immer von amzly.de, also führen seine Links auch
    … …  
    310312         */
    311313        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' );
    313315        }
    314316
  • amzly-price-badge/trunk/includes/class-list.php

    r3698089 r3702054  
    149149         * Die Adresse eines Produkts in den strukturierten Daten.
    150150         *
    151          * Hier steht nie eine Herkunfts- oder Partnerkennung: Für Suchmaschinen
     151         * Hier steht nie ein Kampagnen-Parameter oder Partner-Tag: Für Suchmaschinen
    152152         * zählt die kanonische Adresse. Ein bezahlter Link ließe sich in JSON-LD
    153153         * auch gar nicht als solcher kennzeichnen — `rel="sponsored"` gibt es nur
    … …  
    159159         */
    160160        public static function schema_url( $asin, array $data ) {
    161                 // Die amzly.de-Seite ist die Produktseite dieses Plugins — und sie trägt
    162                 // hier keine Herkunftskennzeichnung.
     161                // Die amzly.de-Seite ist die Produktseite dieses Plugins — hier ohne
     162                // Kampagnen-Parameter.
    163163                if ( ! empty( $data['amzly_url'] ) ) {
    164164                        return $data['amzly_url'];
    … …  
    272272         */
    273273        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();
    276277
    277278                $out = '<span class="amzly-list__row">';
    … …  
    282283
    283284                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"'
    286287                                . Amzly_PB_Renderer::track_attrs( $asin, 'image' ) . '>'
    287288                                . self::thumb_img( $data, $asin )
    … …  
    294295                $cells['name'] = '<span class="amzly-list__main">'
    295296                        . '<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 ) ) . '"'
    297298                        . ( $short !== $name ? ' title="' . esc_attr( $name ) . '"' : '' )
    298299                        . Amzly_PB_Renderer::track_attrs( $asin, 'name' ) . '>'
    … …  
    580581         */
    581582        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' );
    583585
    584586                $out = '<span class="amzly-compare__card">';
    … …  
    594596
    595597                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"'
    598600                                . Amzly_PB_Renderer::track_attrs( $asin, 'image' ) . '>'
    599601                                . self::thumb_img( $data, $asin )
    … …  
    602604
    603605                $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 ) ) . '"'
    605607                        . Amzly_PB_Renderer::track_attrs( $asin, 'name' ) . '>'
    606608                        . esc_html( '' !== $data['title'] ? $data['title'] : $asin )
    … …  
    887889
    888890                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="'
    890892                        . esc_attr( Amzly_PB_Renderer::rel_for( $data['amazon_url'] ) ) . '"'
    891893                        . Amzly_PB_Renderer::track_attrs( isset( $data['asin'] ) ? (string) $data['asin'] : '', 'price' ) . '>'
  • amzly-price-badge/trunk/includes/class-matrix.php

    r3698089 r3702054  
    170170
    171171                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 );
    174175
    175176                        $out .= '<th scope="col" class="amzly-matrix__product'
    … …  
    192193
    193194                        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"'
    196197                                        . Amzly_PB_Renderer::track_attrs( $asin, 'image' ) . '>'
    197198                                        . '<img src="' . esc_url( $data['image_url'] ) . '" alt="'
    … …  
    201202
    202203                        $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 ) ) . '"'
    204205                                . Amzly_PB_Renderer::track_attrs( $asin, 'name' ) . '>'
    205206                                . esc_html( isset( $names[ $column ] ) ? $names[ $column ] : $asin )
  • amzly-price-badge/trunk/includes/class-options.php

    r3698089 r3702054  
    3333                        'pulse'   => array( 'all', 'deals', 'off' ),
    3434                        'target'  => array( '_blank', '_self' ),
     35                        'amazon_target' => array( '_blank', '_self' ),
    3536                        'data_source' => array( 'amzly', 'hybrid', 'amazon' ),
    3637                );
    … …  
    123124                        'pulse'       => 'all',
    124125                        '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',
    125130                        'cache_ttl'   => 6 * HOUR_IN_SECONDS,
    126131                        'attribution' => true,
    … …  
    137142                         */
    138143                        '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,
    139151                );
    140152        }
  • amzly-price-badge/trunk/includes/class-renderer.php

    r3698089 r3702054  
    2525        private static $mark_printed = false;
    2626
     27        /** Suche auf amzly.de. Eine bekannte ASIN leitet sie auf ihre Produktseite weiter. */
     28        const AMZLY_SEARCH = 'https://amzly.de/suche';
     29
    2730        /**
    2831         * Badge für eine ASIN.
    … …  
    130133
    131134                /*
    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).
    136138                 */
    137139                $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' );
    142143
    143144                $html = sprintf(
    … …  
    280281                        $label = ! empty( $data['price_hidden'] )
    281282                                ? __( 'Price on Amazon', 'amzly-price-badge' )
    282                                 : __( 'View on Amazon', 'amzly-price-badge' );
     283                                : __( 'View on amzly.de', 'amzly-price-badge' );
    283284                } else {
    284285                        $label = '';
    … …  
    322323                $tooltip = implode( ' · ', $parts );
    323324                $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' );
    325331
    326332                $html = sprintf(
    … …  
    378384
    379385        /**
    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.
    381405         *
    382406         * @param array $data  Produktdaten.
    … …  
    384408         * @return string '' wenn amzly.de das Produkt nicht kennt.
    385409         */
    386         public static function amzly_link( array $data, array $extra = array() ) {
     410        public static function amzly_link( array $data, array $extra = array(), $element = '' ) {
    387411                if ( ! empty( $data['amzly_url'] ) ) {
    388                         return self::link( $data['amzly_url'], $extra );
     412                        return self::link( $data['amzly_url'], $extra, $element );
    389413                }
    390414
    391415                // Datensätze ohne das neue Feld: `url` ist dann die amzly-Seite.
    392416                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 );
    394418                }
    395419
    396420                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;
    397467        }
    398468
    … …  
    454524                $post_id = $post_id ? $post_id : self::countable_post_id();
    455525
    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' );
    463527
    464528                return sprintf(
    465529                        '<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>',
    466530                        esc_url( $href ),
    467                         esc_attr( $atts['target'] ),
     531                        esc_attr( self::target_for( $href, $atts ) ),
    468532                        esc_attr( $data['asin'] ),
    469533                        self::track( $post_id, 'name' ),
    … …  
    556620                }
    557621
    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 );
    586633
    587634                $classes = array(
    … …  
    603650                        esc_attr( implode( ' ', $classes ) ),
    604651                        esc_url( $url ),
    605                         esc_attr( $atts['target'] ),
     652                        esc_attr( self::target_for( $url, $atts ) ),
    606653                        esc_attr__( 'Buy on Amazon (affiliate link)', 'amzly-price-badge' ),
    607654                        esc_attr( $asin ),
    … …  
    625672
    626673                // 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' );
    628675
    629676                if ( '' === $href ) {
    … …  
    725772
    726773        /**
    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.
    749809                 */
    750810                if ( self::is_amazon_url( $url ) ) {
    … …  
    755815                $host = preg_replace( '/^www\./', '', $host );
    756816
    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 ) );
    765818
    766819                if ( empty( $args ) ) {
    … …  
    769822
    770823                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 : '';
    771874        }
    772875
  • amzly-price-badge/trunk/includes/class-settings.php

    r3698089 r3702054  
    253253                                'label'   => __( 'Amazon partner tag', 'amzly-price-badge' ),
    254254                                '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' ),
    256256                        ),
    257257                        'show_chart'  => array(
    … …  
    295295                        'target'      => array(
    296296                                'section' => 'behaviour',
    297                                 'label'   => __( 'Open link', 'amzly-price-badge' ),
     297                                'label'   => __( 'Open links to amzly.de', 'amzly-price-badge' ),
    298298                                'type'    => 'select',
    299299                                'choices' => array(
    … …  
    301301                                        '_self'  => __( 'In the same tab', 'amzly-price-badge' ),
    302302                                ),
     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' ),
    303314                        ),
    304315                        'schema'      => array(
    … …  
    328339                                'checkbox_label' => __( 'Send a daily total', 'amzly-price-badge' ),
    329340                                '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' ),
    330348                        ),
    331349                        'cache_ttl'   => array(
  • amzly-price-badge/trunk/includes/class-shortcode.php

    r3693467 r3702054  
    119119                        'pulse'       => $options['pulse'],
    120120                        'target'      => $options['target'],
     121                        'amazon_target' => $options['amazon_target'],
    121122                        'show_logo'   => $options['show_logo'],
    122123                        'show_label'  => $options['show_label'],
  • amzly-price-badge/trunk/languages/amzly-price-badge.pot

    r3698089 r3702054  
    172172
    173173#: blocks/price/index.js:730
    174 msgid "Open link"
     174msgid "Open links to amzly.de"
    175175msgstr ""
    176176
    … …  
    10791079msgstr ""
    10801080
    1081 #: includes/class-list.php:554
     1081#: includes/class-list.php:555
    10821082msgid "VS"
    10831083msgstr ""
    10841084
    1085 #: includes/class-list.php:841
     1085#: includes/class-list.php:843
    10861086msgid "%s measurements"
    10871087msgstr ""
    10881088
    1089 #: includes/class-list.php:855
     1089#: includes/class-list.php:857
    10901090msgid "In stock"
    10911091msgstr ""
    10921092
    1093 #: includes/class-list.php:856
     1093#: includes/class-list.php:858
    10941094msgid "Out of stock"
    10951095msgstr ""
    10961096
    1097 #: includes/class-list.php:857
     1097#: includes/class-list.php:859
    10981098msgid "Unknown"
    10991099msgstr ""
    11001100
    1101 #: includes/class-list.php:913
     1101#: includes/class-list.php:915
    11021102msgid "(instead of %s)"
    11031103msgstr ""
    11041104
    1105 #: includes/class-list.php:918
     1105#: includes/class-list.php:920
    11061106msgid "Saving on Amazon"
    11071107msgstr ""
    11081108
    1109 #: includes/class-list.php:937
     1109#: includes/class-list.php:939
    11101110msgid "No. %1$s in %2$s"
    11111111msgstr ""
    11121112
    1113 #: includes/class-list.php:943
     1113#: includes/class-list.php:945
    11141114msgid "No. %s"
    11151115msgstr ""
    11161116
    1117 #: includes/class-list.php:947
     1117#: includes/class-list.php:949
    11181118msgid "Bestseller rank"
    11191119msgstr ""
    11201120
    1121 #: includes/class-list.php:978
     1121#: includes/class-list.php:980
    11221122msgid "%s out of 5"
    11231123msgstr ""
    11241124
    1125 #: includes/class-list.php:987
     1125#: includes/class-list.php:989
    11261126msgid "(%s reviews)"
    11271127msgstr ""
    11281128
    1129 #: includes/class-matrix.php:283
     1129#: includes/class-matrix.php:284
    11301130msgid "To Amazon"
    11311131msgstr ""
    11321132
    1133 #: includes/class-renderer.php:103
     1133#: includes/class-renderer.php:106
    11341134msgid "Currently unavailable"
    11351135msgstr ""
    11361136
    1137 #: includes/class-renderer.php:169
     1137#: includes/class-renderer.php:170
    11381138msgid "Price rating by amzly.de"
    11391139msgstr ""
    11401140
    1141 #: includes/class-renderer.php:281
     1141#: includes/class-renderer.php:282
    11421142msgid "Price on Amazon"
    11431143msgstr ""
    11441144
    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
    11501146msgid "Price on Amazon as of %s"
    11511147msgstr ""
    11521148
    1153 #: includes/class-renderer.php:606
     1149#: includes/class-renderer.php:653
    11541150msgid "Buy on Amazon (affiliate link)"
    11551151msgstr ""
    11561152
    1157 #: includes/class-renderer.php:610
     1153#: includes/class-renderer.php:657
    11581154msgid "Amazon"
    11591155msgstr ""
    11601156
    1161 #: includes/class-renderer.php:633
     1157#: includes/class-renderer.php:680
    11621158msgid "Price alert"
    11631159msgstr ""
    11641160
    1165 #: includes/class-renderer.php:638
     1161#: includes/class-renderer.php:685
    11661162msgid "Set a price alert for %s"
    11671163msgstr ""
    11681164
    1169 #: includes/class-renderer.php:811
     1165#: includes/class-renderer.php:922
    11701166msgid "%s compared with the 90-day average"
    11711167msgstr ""
    11721168
    1173 #: includes/class-renderer.php:827
     1169#: includes/class-renderer.php:938
    11741170msgid "As of %s"
    11751171msgstr ""
    11761172
    1177 #: includes/class-renderer.php:929
     1173#: includes/class-renderer.php:1040
    11781174msgid "View price"
    11791175msgstr ""
    11801176
    1181 #: includes/class-renderer.php:963
     1177#: includes/class-renderer.php:1074
    11821178msgid "Amzly: no data for %s"
    11831179msgstr ""
    11841180
    1185 #: includes/class-renderer.php:996
     1181#: includes/class-renderer.php:1107
    11861182msgid "No price data"
    11871183msgstr ""
    … …  
    13001296
    13011297#: 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\"."
     1298msgid "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\"."
    13031299msgstr ""
    13041300
    … …  
    13151311msgstr ""
    13161312
    1317 #: includes/class-settings.php:306
     1313#: includes/class-settings.php:303
     1314msgid "Badge, price alert and price history. A block can set its own value."
     1315msgstr ""
     1316
     1317#: includes/class-settings.php:307
     1318msgid "Open links to Amazon"
     1319msgstr ""
     1320
     1321#: includes/class-settings.php:313
     1322msgid "The Amazon button, and product names and images once you have entered a partner tag."
     1323msgstr ""
     1324
     1325#: includes/class-settings.php:317
    13181326msgid "Structured data"
    13191327msgstr ""
    13201328
    1321 #: includes/class-settings.php:308
     1329#: includes/class-settings.php:319
    13221330msgid "Mark up price lists as ItemList"
    13231331msgstr ""
    13241332
    1325 #: includes/class-settings.php:309
     1333#: includes/class-settings.php:320
    13261334msgid "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."
    13271335msgstr ""
    13281336
    1329 #: includes/class-settings.php:315
     1337#: includes/class-settings.php:326
    13301338msgid "Only below badges that sit on their own line. Inline badges carry the logo instead."
    13311339msgstr ""
    13321340
    1333 #: includes/class-settings.php:319
     1341#: includes/class-settings.php:330
    13341342msgid "Count badge clicks"
    13351343msgstr ""
    13361344
    1337 #: includes/class-settings.php:321
     1345#: includes/class-settings.php:332
    13381346msgid "Count clicks on this site"
    13391347msgstr ""
    13401348
    1341 #: includes/class-settings.php:322
     1349#: includes/class-settings.php:333
    13421350msgid "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."
    13431351msgstr ""
    13441352
    1345 #: includes/class-settings.php:326
     1353#: includes/class-settings.php:337
    13461354msgid "Report clicks to amzly.de"
    13471355msgstr ""
    13481356
    1349 #: includes/class-settings.php:328
     1357#: includes/class-settings.php:339
    13501358msgid "Send a daily total"
    13511359msgstr ""
    13521360
    1353 #: includes/class-settings.php:329
     1361#: includes/class-settings.php:340
    13541362msgid "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."
    13551363msgstr ""
    13561364
    1357 #: includes/class-settings.php:333
     1365#: includes/class-settings.php:344
     1366msgid "Campaign tracking on amzly.de"
     1367msgstr ""
     1368
     1369#: includes/class-settings.php:346
     1370msgid "Mark links to amzly.de with campaign parameters"
     1371msgstr ""
     1372
     1373#: includes/class-settings.php:347
     1374msgid "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."
     1375msgstr ""
     1376
     1377#: includes/class-settings.php:351
    13581378msgid "Refresh prices every"
    13591379msgstr ""
    13601380
    1361 #: includes/class-settings.php:336
     1381#: includes/class-settings.php:354
    13621382msgid "1 hour"
    13631383msgstr ""
    13641384
    1365 #: includes/class-settings.php:337
     1385#: includes/class-settings.php:355
    13661386msgid "3 hours"
    13671387msgstr ""
    13681388
    1369 #: includes/class-settings.php:338
     1389#: includes/class-settings.php:356
    13701390msgid "6 hours"
    13711391msgstr ""
    13721392
    1373 #: includes/class-settings.php:339
     1393#: includes/class-settings.php:357
    13741394msgid "12 hours"
    13751395msgstr ""
    13761396
    1377 #: includes/class-settings.php:340
     1397#: includes/class-settings.php:358
    13781398msgid "24 hours"
    13791399msgstr ""
    13801400
    1381 #: includes/class-settings.php:342
     1401#: includes/class-settings.php:360
    13821402msgid "Prices on amzly.de are updated hourly. Shorter intervals mean more requests without fresher data."
    13831403msgstr ""
    13841404
    1385 #: includes/class-settings.php:390
     1405#: includes/class-settings.php:408
    13861406msgid "Behaviour"
    13871407msgstr ""
    13881408
    1389 #: includes/class-settings.php:391
     1409#: includes/class-settings.php:409
    13901410msgid "Your own Amazon link"
    13911411msgstr ""
    13921412
    1393 #: includes/class-settings.php:392
     1413#: includes/class-settings.php:410
    13941414msgid "Amazon Creators API"
    13951415msgstr ""
    13961416
    1397 #: includes/class-settings.php:393
     1417#: includes/class-settings.php:411
    13981418msgid "Where the product data comes from"
    13991419msgstr ""
    14001420
    1401 #: includes/class-settings.php:394
     1421#: includes/class-settings.php:412
    14021422msgid "Click counting"
    14031423msgstr ""
    14041424
    1405 #: includes/class-settings.php:395
     1425#: includes/class-settings.php:413
    14061426msgid "Data"
    14071427msgstr ""
    14081428
    1409 #: includes/class-settings.php:415
     1429#: includes/class-settings.php:433
    14101430msgid "Credential ID"
    14111431msgstr ""
    14121432
    1413 #: includes/class-settings.php:416
     1433#: includes/class-settings.php:434
    14141434msgid "Credential secret"
    14151435msgstr ""
    14161436
    1417 #: includes/class-settings.php:417
     1437#: includes/class-settings.php:435
    14181438msgid "Credential version"
    14191439msgstr ""
    14201440
    1421 #: includes/class-settings.php:512
     1441#: includes/class-settings.php:530
    14221442msgid "Enabled"
    14231443msgstr ""
    14241444
    1425 #: includes/class-settings.php:577
     1445#: includes/class-settings.php:595
    14261446msgid "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."
    14271447msgstr ""
    14281448
    1429 #: includes/class-settings.php:579
     1449#: includes/class-settings.php:597
    14301450msgid "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."
    14311451msgstr ""
    14321452
    1433 #: includes/class-settings.php:613
     1453#: includes/class-settings.php:631
    14341454msgid "Stored — leave empty to keep"
    14351455msgstr ""
    14361456
    1437 #: includes/class-settings.php:618
     1457#: includes/class-settings.php:636
    14381458msgid "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."
    14391459msgstr ""
    14401460
    1441 #: includes/class-settings.php:625
     1461#: includes/class-settings.php:643
    14421462msgid "Remove the stored credentials"
    14431463msgstr ""
    14441464
    1445 #: includes/class-settings.php:633
     1465#: includes/class-settings.php:651
    14461466msgid "3.2 — Europe (usual for amazon.de)"
    14471467msgstr ""
    14481468
    1449 #: includes/class-settings.php:634
     1469#: includes/class-settings.php:652
    14501470msgid "3.1 — North America"
    14511471msgstr ""
    14521472
    1453 #: includes/class-settings.php:635
     1473#: includes/class-settings.php:653
    14541474msgid "3.3 — Far East"
    14551475msgstr ""
    14561476
    1457 #: includes/class-settings.php:653
     1477#: includes/class-settings.php:671
    14581478msgid "Shown next to the credentials in Associates Central. It only decides where the access token is fetched; prices always come from amazon.de."
    14591479msgstr ""
    14601480
    1461 #: includes/class-settings.php:664
     1481#: includes/class-settings.php:682
    14621482msgid "You are not allowed to do this."
    14631483msgstr ""
    14641484
    1465 #: includes/class-settings.php:693
     1485#: includes/class-settings.php:711
    14661486msgid "Amazon answered in %1$d ms with: %2$s — %3$s"
    14671487msgstr ""
    14681488
    1469 #: includes/class-settings.php:702
     1489#: includes/class-settings.php:720
    14701490msgid "Connection to Amazon works."
    14711491msgstr ""
    14721492
    1473 #: includes/class-settings.php:710
     1493#: includes/class-settings.php:728
    14741494msgid "Setup"
    14751495msgstr ""
    14761496
    1477 #: includes/class-settings.php:711
     1497#: includes/class-settings.php:729
    14781498msgid "Access token"
    14791499msgstr ""
    14801500
    1481 #: includes/class-settings.php:712
     1501#: includes/class-settings.php:730
    14821502msgid "Product request"
    14831503msgstr ""
    14841504
    1485 #: includes/class-settings.php:717
     1505#: includes/class-settings.php:735
    14861506msgid "Connection to Amazon failed."
    14871507msgstr ""
    14881508
    1489 #: includes/class-settings.php:777
     1509#: includes/class-settings.php:795
    14901510msgid "Connection works."
    14911511msgstr ""
    14921512
    1493 #: includes/class-settings.php:781
     1513#: includes/class-settings.php:799
    14941514msgid "The API answered in %1$d ms with: %2$s"
    14951515msgstr ""
    14961516
    1497 #: includes/class-settings.php:793
     1517#: includes/class-settings.php:811
    14981518msgid "Connection failed."
    14991519msgstr ""
    15001520
    1501 #: includes/class-settings.php:799
     1521#: includes/class-settings.php:817
    15021522msgid "Requested: %1$s — as: %2$s"
    15031523msgstr ""
    15041524
    1505 #: includes/class-settings.php:858
     1525#: includes/class-settings.php:876
    15061526msgid "Everything here is a default — every single block and shortcode can override it."
    15071527msgstr ""
    15081528
    1509 #: includes/class-settings.php:864
     1529#: includes/class-settings.php:882
    15101530msgid "Amazon is selected, but credential ID, secret or partner tag are missing."
    15111531msgstr ""
    15121532
    1513 #: includes/class-settings.php:883
     1533#: includes/class-settings.php:901
    15141534msgid "Test connection to Amazon"
    15151535msgstr ""
    15161536
    1517 #: includes/class-settings.php:901
     1537#: includes/class-settings.php:919
    15181538msgid "Which data leaves your site"
    15191539msgstr ""
    15201540
    1521 #: includes/class-settings.php:905
     1541#: includes/class-settings.php:923
    15221542msgid "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."
    15231543msgstr ""
    15241544
    1525 #: includes/class-settings.php:914
     1545#: includes/class-settings.php:932
    15261546msgid "Terms of use and privacy information"
    15271547msgstr ""
    15281548
    1529 #: includes/class-settings.php:940
     1549#: includes/class-settings.php:958
    15301550msgid "Cache cleared. Prices are fetched again on the next page view."
    15311551msgstr ""
    15321552
    1533 #: includes/class-settings.php:951
     1553#: includes/class-settings.php:969
    15341554msgid "Data source in effect: %s"
    15351555msgstr ""
    15361556
    1537 #: includes/class-settings.php:964
     1557#: includes/class-settings.php:982
    15381558msgid "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."
    15391559msgstr ""
    15401560
    1541 #: includes/class-settings.php:978
     1561#: includes/class-settings.php:996
    15421562msgid "Connection"
    15431563msgstr ""
    15441564
    1545 #: includes/class-settings.php:983
     1565#: includes/class-settings.php:1001
    15461566msgid "paused after repeated errors — retrying automatically"
    15471567msgstr ""
    15481568
    1549 #: includes/class-settings.php:986
     1569#: includes/class-settings.php:1004
    15501570msgid "ready"
    15511571msgstr ""
    15521572
    1553 #: includes/class-settings.php:992
     1573#: includes/class-settings.php:1010
    15541574msgid "Requests today"
    15551575msgstr ""
    15561576
    1557 #: includes/class-settings.php:1001
     1577#: includes/class-settings.php:1019
    15581578msgid "%s of them failed"
    15591579msgstr ""
    15601580
    1561 #: includes/class-settings.php:1010
     1581#: includes/class-settings.php:1028
    15621582msgid "Products in the cache"
    15631583msgstr ""
    15641584
    1565 #: includes/class-settings.php:1014
     1585#: includes/class-settings.php:1032
    15661586msgid "Of those, not found on Amazon"
    15671587msgstr ""
    15681588
    1569 #: includes/class-settings.php:1018
     1589#: includes/class-settings.php:1036
    15701590msgid "Oldest entry"
    15711591msgstr ""
    15721592
    1573 #: includes/class-settings.php:1025
     1593#: includes/class-settings.php:1043
    15741594msgid "%s ago"
    15751595msgstr ""
    15761596
    1577 #: includes/class-settings.php:1034
     1597#: includes/class-settings.php:1052
    15781598msgid "Next background refresh"
    15791599msgstr ""
    15801600
    1581 #: includes/class-settings.php:1040
     1601#: includes/class-settings.php:1058
    15821602msgid "nothing pending"
    15831603msgstr ""
    15841604
    1585 #: includes/class-settings.php:1050
     1605#: includes/class-settings.php:1068
    15861606msgid "Test connection to amzly.de"
    15871607msgstr ""
    15881608
    1589 #: includes/class-settings.php:1075
     1609#: includes/class-settings.php:1093
    15901610msgid "not set up"
    15911611msgstr ""
    15921612
    1593 #: includes/class-settings.php:1077
     1613#: includes/class-settings.php:1095
    15941614msgid "partner tag missing"
    15951615msgstr ""
    15961616
    1597 #: includes/class-settings.php:1079
     1617#: includes/class-settings.php:1097
    15981618msgid "credential ID or secret missing"
    15991619msgstr ""
    16001620
    1601 #: includes/class-settings.php:1083
     1621#: includes/class-settings.php:1101
    16021622msgid "Amazon settings"
    16031623msgstr ""
    16041624
    1605 #: includes/class-settings.php:1094
     1625#: includes/class-settings.php:1112
    16061626msgid "paused — retrying automatically"
    16071627msgstr ""
    16081628
    1609 #: includes/class-settings.php:1096
     1629#: includes/class-settings.php:1114
    16101630msgid "not used yet"
    16111631msgstr ""
    16121632
    1613 #: includes/class-settings.php:1100
     1633#: includes/class-settings.php:1118
    16141634msgid "last request failed"
    16151635msgstr ""
    16161636
    1617 #: includes/class-settings.php:1116
     1637#: includes/class-settings.php:1134
    16181638msgid "%1$s of %2$s"
    16191639msgstr ""
    16201640
    1621 #: includes/class-settings.php:1129
     1641#: includes/class-settings.php:1147
    16221642msgid "Kept for"
    16231643msgstr ""
    16241644
    1625 #: includes/class-settings.php:1130
     1645#: includes/class-settings.php:1148
    16261646msgid "prices one hour, product details one day — Amazon’s rules"
    16271647msgstr ""
    16281648
    1629 #: includes/class-settings.php:1133
     1649#: includes/class-settings.php:1151
    16301650msgid "Marketplace"
    16311651msgstr ""
    16321652
    1633 #: includes/class-settings.php:1154
     1653#: includes/class-settings.php:1172
    16341654msgid "Clear cache"
    16351655msgstr ""
    16361656
    1637 #: includes/class-settings.php:1158
     1657#: includes/class-settings.php:1176
    16381658msgid "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."
    16391659msgstr ""
  • amzly-price-badge/trunk/readme.txt

    r3698089 r3702054  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.1.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    3535* **Never a broken post.** If the API is unreachable, badges keep showing the last known price instead of disappearing.
    3636
    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
     43With 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
     45Whether 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**.
    4246
    4347= Prices straight from Amazon (optional) =
    … …  
    5761= Found by search engines =
    5862
    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 them and stay marked `rel="sponsored"`.
     63Price 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"`.
    6064
    6165Switch 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
     69Optional 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.
    6270
    6371= Click statistics =
    … …  
    92100
    93101* 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`.
    95103* **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.
    96104* Responses are cached, by default for six hours, so a page with badges normally causes no request at all.
    … …  
    99107
    100108If 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
     110If 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.
    101111
    102112**Terms and privacy**
    … …  
    157167= Why does the badge not link straight to Amazon? =
    158168
    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.
     169Because 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.
    160170
    161171= Can I use my own Amazon affiliate tag? =
    162172
    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.
     173Yes, 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.
    164174
    165175= Why does Amazon reject my credentials? =
    … …  
    193203== Upgrade Notice ==
    194204
     205= 1.1.1 =
     206The 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
    195208= 1.1.0 =
    196209New admin menu with click statistics and an optional connection to the Amazon Creators API. Existing posts and settings are taken over unchanged.
    197210
    198211== 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.
    199226
    200227= 1.1.0 =
Note: See TracChangeset for help on using the changeset viewer.