Plugin Directory

Changeset 774384


Ignore:
Timestamp:
09/18/2013 03:19:20 AM (12 years ago)
Author:
viglink
Message:

New readme. Fixing some PHP issues. Adding RSS feed rewriting.

Location:
viglink/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • viglink/trunk/readme.txt

    r494330 r774384  
    33Tags: affiliate, marketing, links, monetization, javascript, easy
    44Requires at least: 2.7
    5 Tested up to: 3.3.1
    6 Stable tag: 1.0.2
     5Tested up to: 3.6.1
     6Stable tag: 1.0.3
    77
    8 The easiest way to monetize your content.  VigLink automatically affiliates your links (even on pages you've already written) and provides stats.
     8The easiest way to monetize your content, VigLink pays you when visitors buy the brands and products you write about.
    99
    1010== Description ==
    11 VigLink is a tool to make participation in affiliate programs easier. We handle the work of link affiliation and maintenance so that you can focus on creating great content.
     11We believe making money from blogging shouldn't take more time than, well, blogging.  VigLink automatically pays you when people buy the brands and products you write about.
    1212
    13 By installing VigLink on your site, you instantly participate in the affiliate programs of thousands of cooperating merchants. Links are neither added nor removed from the page, VigLink affiliates existing links. We also provide outbound link reports (data Google Analytics does not offer) giving you insight into where your readers are going and what they do when they get there.
     13You’ve put time, creativity, and money into building your own brand and cultivating loyal followers who share your viewpoints, trust your recommendations, and find inspiration in your writing. As your audience visits your site in a shopping frame of mind, you deserve to earn revenue from the purchases you drive. VigLink makes this possible.
    1414
    15 VigLink takes a cut only of new revenue you earn so there is no risk. Existing affiliate links are not touched and you benefit from collective bargaining, ensuring maximum compensation for your traffic.  For links we affiliate, VigLink takes 25% of the commissions you earn.
     15By [signing up for VigLink](http://www.viglink.com/sign-up) and installing this plugin, you can automatically monetize links to over 30,000 cooperating merchants. [VigLink Convert](http://www.viglink.com/products/convert), our product that converts ordinary links into monetized links, works on existing links across all of your pages. It even works for links distributed in your RSS feeds.
    1616
    17 When clicks leave your site, you are creating value.  VigLink is the easiest and most complete way to measure and capture that value.
     17After you’ve signed up, sign in to [viglink.com](http://www.viglink.com/) to check your dashboard where we provide reports for all the clicks leaving your site (data Google Analytics does not offer), giving you insight into where your readers are going, what links are most lucrative, what pages or posts earn the most, and what products people are buying.
     18
     19VigLink keeps a percentage of the revenue we earn for you, so there is no risk. For VigLink Convert, we keep 25% and pay you 75%. Existing affiliate links are not touched and you benefit from the maximum compensation possible for your traffic. After all, with tens of thousands of sites like yours in our network, we can negotiate directly with the retailers to secure the very best payouts.
     20
     21When clicks leave your site, you are creating value. VigLink is the easiest and most complete way to measure and capture that value.
    1822
    1923== Installation ==
     
    2832= What is VigLink? =
    2933
    30 VigLink enables you to get paid for doing what you normally do on your blog or site. Whenever you link to a product, website, or promotion, VigLink turns that link into an affiliate link so that you receive a commission for any purchases made.
     34VigLink technology instantly and automatically captures the value of content that drives commerce. We monetize ordinary links to over 30,000 retailers, whether they're created by you or us. Our technology works across sites, apps, and social networks so you can focus on your business, earn more, and avoid the hassle of managing countless affiliate programs.
    3135
    3236= How do I get started? =
    3337
    34 As part of the installation you do need to create and account at [viglink.com](http://www.viglink.com/users/signup). Then follow the instructions on the installation tab.
    35 
    36 = What's the difference between a link and an affiliate link? =
    37 
    38 On your webpage you probably already link to a number of recommended products or companies, but only affiliate links allow you to get paid if one of your visitors makes a purchase at the linked site. Specifically, an affiliate link tells a site that its customer has come from your site, so you can receive a commission on the sale.
    39 
    40 = Can't I just create an affiliate link myself? =
    41 
    42 Of course--but it's time-consuming to enroll in a program, ensure that you have the correct affiliate links, and then manage that program. By contrast, one quick install of the VigLink library on your page enrolls you in all relevant affiliate programs quickly and easily. Plus, we'll administer everything so that you don't have to!
    43 
    44 = How does VigLink make money? =
    45 
    46 You earn a commission for every sale made on a linked site. VigLink takes a small fee from that commission and then passes on the rest to you.
    47 
    48 = So what's happening underneath? =
    49 
    50 After you embed the VigLink library on your page, it monitors when visitors click on a link pointing to a different site. The library checks to see if the URL of that link can be affiliated; if so, the link is automatically affiliated.
    51 
    52 = Will my users notice? =
    53 
    54 Likely not. VigLink does not change the user experience one bit. No links are inserted or removed on the page, there are no double-underlines or pop-ups, and mousing over a link looks "clean."
    55 
    56 = How does payment work? =
    57 
    58 VigLink will pay by check in the United States and PayPal anywhere it is available. We are expanding our payment options over time. VigLink will ask for payment information and pay publishers as soon as their balance reaches $25.
    59 
    60 = What happens if VigLink goes down? =
    61 
    62 VigLink has been designed for high reliability. In case it is unreachable for some reason, your page will be not be affected. All that will happen is that, temporarily, your links will not be affiliated.
     38Just sign up for an account at [viglink.com](http://www.viglink.com/) and then follow the simple instructions on the installation tab. It only takes a few minutes.
    6339
    6440= I have more questions, where do I go? =
    6541
    66 Find a detailed FAQ and more info at [viglink.com](http://www.viglink.com/)
     42Our [how-it-works](http://www.viglink.com/how-it-works) page is a helpful overview, plus we’ve got a detailed FAQ at [viglink.com/faq](http://www.viglink.com/faq). We also have pages to check out more information about [VigLink Convert](http://www.viglink.com/products/convert), [VigLink Insert](http://www.viglink.com/products/insert), and [VigLink Anywhere](http://www.viglink.com/products/anywhere).
    6743
    6844== Screenshots ==
  • viglink/trunk/viglink.js

    r274894 r774384  
    5151        }, load_timeout );
    5252
    53         $.get( 'http://www.viglink.com/service/json/getKey', {}, function( data ) {
     53        $.get( 'http://www.viglink.com/users/getKey', {}, function( data ) {
    5454          if( ! timeout ) { return; }
    5555          clearTimeout( timeout );
  • viglink/trunk/viglink.php

    r492811 r774384  
    2222/*
    2323Plugin Name: VigLink
    24 Version: 1.0.2
     24Version: 1.0.3
    2525Description: The easiest way to monetize the links on your site.  Link directly to other sites, just like you do today.  VigLink automatically affiliates those links -- even links on posts you've already written -- with no extra editing!  Get stats on which links are making you the most money, which are most clicked, and more.
    2626
     
    100100          </td>
    101101        </tr>
     102
     103    <?php
     104    if(viglink_validate_option( "key" )) {
     105    ?>
     106      <tr>
     107        <th style="width: auto;">
     108          Enable RSS link rewriting
     109        </th>
     110        <td>
     111            <input id="viglink-enable-rss-rewrites" type="checkbox" name="enable-rss-rewrites"
     112              <?php echo get_option( "enable-rss-rewrites" ) ? ' checked="checked" ' : '' ?> />
     113        </td>
     114      </tr>
     115
     116    <?php
     117    }
     118    ?>
     119
    102120      </table>
    103121      <p class="submit">
     
    106124      </p>
    107125    </form>
     126
    108127  </div>
    109128<?php } ?>
     
    139158  // register settings for the options page
    140159  register_setting( "viglink", "key", "viglink_sanitize_option" );
     160  register_setting( "viglink", "enable-rss-rewrites");
    141161}
    142162
     
    154174function viglink_options_menu() {
    155175  // add the options page to the settings menu
    156   $page = add_options_page( "VigLink Options", "VigLink", 8, __FILE__, "viglink_options" );
     176  $page = add_options_page( "VigLink Options", "VigLink", "edit_plugins", __FILE__, "viglink_options" );
    157177
    158178  // include plugin-specific includes on the options page
     
    172192}
    173193
     194function viglink_rss_rewrites_enabled() {
     195  if (viglink_validate_option('key')) {
     196    return (bool) get_option( 'enable-rss-rewrites' );
     197  } else {
     198    return false;
     199  }
     200}
     201
    174202// options
    175203
    176204add_option( "is-not-first-load" );
    177205add_option( "key" );
     206add_option( "enable-rss-rewrites" );
     207
     208function viglink_get_click_url($url) {
     209  $scheme = "http" . ( strtolower( $_SERVER["HTTPS"] ) == "on" ? "s" : "" ) . "://";
     210
     211  $loc = ( $_SERVER["HTTP_HOST"] && $_SERVER["REQUEST_URI"] ) ?
     212    ( $scheme . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ) :
     213    null;
     214
     215  $params = array(
     216    "format" => "go",
     217    "key" => get_option('key'),
     218    "loc" => $loc,
     219    "out" => $url,
     220    "ref" => $_SERVER["HTTP_REFERER"] ? $_SERVER["HTTP_REFERER"] : null,
     221    "title" => null,
     222    "txt" => null
     223  ); 
     224   
     225  return "http://apicdn.viglink.com/api/click?" . http_build_query( $params );
     226}
     227
     228function viglink_is_external_link($url) {
     229  $parts = parse_url( $url );
     230  $link_host = strtolower( $parts['host'] );
     231  $server_host = strtolower( $_SERVER['HTTP_HOST'] );
     232  return $link_host && ( !$server_host || $server_host !== $link_host );
     233}
     234
     235function viglink_rewrite_link($matches) {
     236  if (preg_match('/norewrite/i', $matches[0])) {
     237    return $matches[0];
     238  }
     239
     240  $url = html_entity_decode($matches[2]);
     241  $url = viglink_is_external_link($url) ? viglink_get_click_url($url) : $url;
     242
     243  return $matches[1] . $url;
     244}
     245
     246function viglink_rewrite_links($html) {
     247  return preg_replace_callback( '/(<a[^>]*href=")([^"]+)/i', "viglink_rewrite_link", $html );
     248}
    178249
    179250// hooks
     251
     252function viglink_add_debug_info() {
     253
     254?>
     255<!--
     256  VL Debug info:
     257
     258  <?php print viglink_rss_rewrites_enabled() ?>
     259
     260-->
     261
     262<?php
     263
     264}
     265
     266add_action( 'template_redirect', 'viglink_rss_rewrite_hooks' );
     267function viglink_rss_rewrite_hooks() {
     268  if (viglink_rss_rewrites_enabled() ) {
     269    global $wp_version;
     270
     271    if (version_compare($wp_version, '2.9', '<')) {
     272      if(is_feed()) {
     273        add_filter('the_content', 'vigink_rewrite_links');
     274      }
     275    } else {
     276      add_filter('the_content_rss', 'viglink_rewrite_links');
     277      add_filter('the_content_feed', 'viglink_rewrite_links');
     278    }
     279  }
     280}
     281
     282//add_action('wp_footer', 'viglink_add_debug_info');
    180283
    181284// register settings for the admin options page
Note: See TracChangeset for help on using the changeset viewer.