Pay with a Like

Go viral by 'charging' a social share for content using Facebook, Twitter, Google+ or LinkedIn.

Version 2.0.1.5

  • Security Update: Fixes possible WordPress XSS bug.

Changelog

Version 2.0.1.5
  • Security Update: Fixes possible WordPress XSS bug.

Version 2.0.1.4
  • Fixed: SQL query for random like

Version 2.0.1.3
  • Added logic to support storing likes into usermeta table for WordPress authenticated users. Thanks @Dave for the suggestion.

Version 2.0.1.2
  • Correct conflict between Pay With a Like and Affiliate graphs. Both use the same plot JavaScript.

Version 2.0.1.1
  • Reworked and combined logic to test if buttons need to be displayed. Prior versions parts where within different logic.
  • Added many more debug output message. Mainly helpful for support team when member reporting issues.
  • Added new shortcode parameter 'post_url' to pass an alternate URL to be used for the like. Default is the current permalink. This is handy when using the shortcode from a theme template or widget where the URL is not derived from the post loop.
  • Corrected issue where the default settings were not being set at the individual post during processing.

Version 2.0.1
  • Added logic to support 'URL to like' for individual post. This allows a custom URL other than the default post URL.
  • Added logic to store shortcode hidden content via transient. This is when the button handler tries to load the hidden content via AJAX it has something to display.
  • Corrected reported issue to the bot logic. Thanks @Chris.
  • Corrected reported issue where site-wide like was not correctly working when using shortcode.
  • Modified button handler AJAX logic to allow empty hidden content to be used.
  • Modified/Added filter 'pwal_display_buttons' to allow override of processing flag to show/hide PWAL buttons. Added third filter argument to pass content_id. Filter now used for normal excerpt as well as shortcodes.

Version 2.0.0.9
  • Corrected loading of Facebook PHP SDK. Seems other plugins are loading other classes named Facebook which confuses PWAL. Made Facebook class unique to PWAL.

Version 2.0.0.8
  • Corrected reported issue of an extra closing div left orphaned under google plus button section.
  • Added logic to use the theme content_width global if defined for the default width of the buttons container.

Version 2.0.0.7
  • Reworked the buttons container structure from unordered list to just divs wrapped in an outer container. This was to make the Facebook comment popup easier to display without scrollbars.

Version 2.0.0.6
  • Removed Facebook PHP SDK references as these were only used for testing. All Facebook functionality is made via JavaScript

Version 2.0.0.5
  • Changes to resolve issue with nested shortcodes rendering after like button action.

Version 2.0.0.4
  • More changes to try and resolve multiple Facebook elements loading independant libraries and parsing content.

Version 2.0.0.3
  • Corrected reported issue where the like URL on Twitter was not properly set.
  • Refactor some of the related Facebook JavaScript code to get around an issue where other plugins are also loading the Facebook all.js file Asynchronously.

Version 2.0.0.2
  • Refine logic for determining when to show buttons.
  • Removed unused Facebook PHP SDK library
  • Added filter 'pwal_display_buttons' in content function to allow override of settings.

Version 2.0.0.1
  • Corrected output of DEBUG messages.
  • Corrected a report of undefined variable.

Version 2
  • Refresh Settings UI. Now has own menu section
  • Added deeper support for Facebook API and FQL to check for previous likes.
  • Added support for Facebook fan page support. Now if a visitor has liked some defined Facebook page, you can grant them automatic access to your hidden content.
  • Many options added to support social button style and layout.
  • Added option to set/select language used for buttons if not in the default site lanauge.
  • Added support for loading hidden content via AJAX. Should help for WPE and caching plugin issues.
  • Added customization options to the post metabox to override defaults.
  • Added cool new charts to show statistics for social buttons uages.
  • Added cool new chat for single post showing social button usages.
  • Added Top 10 Liked statistics table showing most liked posts.
  • Added Top 10 IP Addressses statistics table
  • Added support for real shortcode via WordPress do_shortcode(). See customization page. No more need to call custom template functions.

Version 1.1.5
  • Fixed issue with Facebook API change.
  • Added logic to determine if Facebook like was from other like button and not PWAL. Will be ignored.
  • Added better support for multi post home and archive pages when using 'URL to be like' setting.
  • Added some CSS for list item margins/paddings on PWAL buttons to have more consistent layout.
  • Moved all inline JavaScript to external file. Less repeating code as well as IDs.
  • Added new global setting to allow wait on Facebook comment popup before reloading page.
  • Added URL parameter PWAL_DEBUG to allow debug via JS console log of click actions without setting final cookie.
  • Cleanup some of the settings label to make the option details clearer.
  • Updated language pwal.pot

Version 1.1.4
  • Added filter 'pwal_is_authorized' to allow external override

Version 1.1.3
  • Added CSS to hide Facebook Like Comment form on click
  • Added standard WPMU DEV Dashboard update include

Version 1.1.2
  • wpmudev_wpal_html function to protect any html code added
  • Translation base file is now presented as pwal.pot
  • New hooks added

Version 1.1.1
  • Added admin warning if plugin is being used in localhost
  • Added admin warning if WPLANG is wrong
  • Changed priority of the_content filter as 8
  • Broken tags in Automatic mode are now automatically repaired
  • Possibility to have a custom css file outside the plugin directory added
  • css and javascript files are now loaded when required
  • Fix for xx_XX-YY type locales
  • Google +1 popup is now hidden by css as default

Version 1.1
  • Support for unlimited protected content on a single page
  • Basic statistics added
  • Possibility to have a custom css file outside the plugin directory added
  • wpmudev_wpal function to be used for custom post type templates added
  • Deprecated message for PHP5.3 fixed
  • Embedded scripts are moved to the footer for W3C and better performance and problems with some themes
  • Improvement of UI in post editor and settings page
  • Fixed setcookie issue when zero or empty value is entered

Version 1
  • V1.0.0: Initial release -
  • - PID

Downloads 35,826

Compatibility WordPress 4.2.2 Multisite 4.2.2 BuddyPress 2.3.2

Pay with a Like lets your visitors exchange a Like, +1, Tweet or share for access to articles, videos, ebooks, coupons – pretty much anything you can dream up.

Offer users special rewards for sharing your content.
Offer users special rewards for sharing your content.

Social Share Wall

It’s like a paywall, except you get users to share your website instead of asking for cash.

Create a social media buzz that increases sales, builds your client base and boosts search engine rankings. Reward users that share your site.

A Creative Marketing Solution

Pay with a Like even covers custom post types for creative flexible marketing.

Give fans a free music download when they promote your tour schedule or embed a coupon on a MarketPress product page that reveals when the product is shared.

Toggle button style to best fit your site layout.
Toggle button style to best fit your site layout.

Integrate with Any Site

Works beautifully with any theme and provides a guide for custom CSS to create a perfect fit.

Toggle share buttons, pick the best  layout, arrange the order and set a container width that makes your like buttons pop.

For help with installing plugins please see our Plugin installation guide

This plugin can be installed on a per site basis or Network Activated but currently does not offer any network wide settings (Each site within the network still controls its own settings).

So now you have the plugin and you are raring to go eh!

Lets crack on and get it Activated.

When you first activate it there will be a notice in the top area of the plugins admin:

Its just a friendly reminder to get the plugin settings sorted first. :)

Click on the Settings link there or go through:

Admin → Settings → Pay With A Like

Global Settings

This is where you get everything set up, some of the options here can be overridden on individual article pages albeit posts, pages, products, or other.

Activation For Posts:

Disabled For All Posts – This will disable Pay With A Like on all posts allowing for you to select which articles are protected on the article editor screen. In other words you can set how each post will work as you create or edit it.

Enabled For All Posts – By default all posts have Pay With A Like enabled, depending on the criteria set in the following options it would mean every post will require a like.

(If Selection Tool is selected for the option to Revealed Content Selection Method then only content protected with our shortcode will be protected)

Activation For Pages:

Disabled For All Pages – This will disable Pay With A Like on all pages allowing for you to select which articles are protected on the article editor screen in other words you can set how each page will work as you create or edit it.

Enabled For All Pages – By default all pages have Pay With A Like enabled, depending on the criteria set in the following options it would mean every page will require a like.

 (If Selection Tool is selected for the option to Revealed Content Selection Method then only content protected with our shortcode will be protected)

Activation For Custom Post Types:

Disabled For All Custom Post Types – This will disable Pay With A Like on all Custom Post Types allowing for you to select which articles are protected on the article editor screen in other words you can set how each Custom Post Type will work as you create or edit it.

Enabled For All Custom Post Types – By default all Custom Post Types have Pay With A Like enabled, depending on the criteria set in the following options it would mean every Custom Post Types will require a like.

(If Selection Tool is selected for the option to Revealed Content Selection Method then only content protected with our shortcode will be protected)

Revealed Content Selection Method:

This is a rather important part and its crucial you understand what is happening here otherwise you might have issues in seeing why something does or does not work.

Automatic Excerpt From ContentWhen this option is enabled you will see a box Except Length (Words) This will default to 20 words, you can set that as you please.

Keep in mind that if you have an article which is less than 20 words then it will not be protected by Pay With A Like and so it will be visible to all. (This does not count when protecting content through shortcodes)

Manual Excerpt From ContentIf you want greater control over what is shown then this is the better option (unless you use the Selection Tool). Rather than potentially cutting off that vital word or sentence you can use the WordPress in built Excerpt on each article.

Use Selection Tool – With this is selected content will not be protected automatically. The Selection Tool refers to our shortcode button. All content within that shortcode will be protected.

You will be able to use a custom description which will display above the social networking buttons.

Accessibility Settings

Enable On The Home Page – When set to yes all items on the home page will also be protected based on the your global or specific article settings.

Enable For Multiple Post Pages – Enables the plugin for pages (except the home page) which contain content for more than one post/page, e.g. archive, category pages. Some themes use excerpts here so enabling our plugin for these pages may cause strange output.

Admin Sees Full Content – Sometimes you just want to test if content is protected or not. Of course being an admin you would see content by default. This setting will turn that off, so you see what everyone else will see. Default is Yes so admins can see all the content unless this is changed.

Authorized Users See Content – This will allow you to give access to users so they can see the content which is protected by our Paying With A Like. This one is handy when you want your registered users to have access by default but still have regular users share your site in order to get that special access.

Another potential use is when you want your staff to have access but still require your members and readers to Pay With A Like.

User Level Where Authorization Starts – This will only become available if Authorized Users See Content is set to yes.

You will be able to select which level gets access.

Note: The selected level and all above will get access.

Search Bots See Full Content – If you are wanting search engines to index your protected content you can mark this to Yes. Keep in mind that means your content can potentially be seen publicly through search engines.

Cookie Validity Time (Hours) – Restrict the access time allowed once they like your article. Setting this to zero ‘0‘ will result in the session ending upon the browser being closed thus forcing them to like again if they want further access later when their visit your site next.

Social Button Settings

Buttons To Use – You might not want all the social networks we offer in this plugin so we built in a nifty little feature where you can disable the ones you don’t like. Just uncheck them.

Load Scripts For – Occasionally you might find issues when running other plugins or themes with social networking abilities. This is often because they include conflicting javascript. For this reason we built in the option so you can easily disable the javascript for a specific social network.

Description Above The Buttons – Set your default message here to appear above all of the social networking buttons. This can be overridden when using shortcodes to protect content.

Site Wide Like – If you wish for all content throughout your whole site to be revealed upon Paying With A Like on one single article then set this to Yes.

URL To Be Liked – By default when articles are liked throughout your site the page they are being liked from will be used to link back to. In some instances you might like to have all backlinks being sent to a specific page on your site, well you can set that link here. Just enter the url.

Like Random Page – When an article is liked, you can send those backlinks to random pages through your website.

Easy peasy eh!

In the Editor

The Pay With A Like plugin will work with all Post Types. This includes Posts and Pages in addition to our MarketPress, Directory, Q&A and all other Custom Post Types.

Once the settings are done that is pretty much it for blanket cover of your articles so now lets make a new post and take a look at the editor. You will notice two new additional items here, a button and a Pay With A Like area.

So for this example it was just a post:

Admin –> Posts –> Add New

When using the selection tool aka shortcode it will generate the following for you:

[pwal id=”5206505″ description=”Custom Description”][/pwal]

The PWAL ID is uniquely set by the plugin. Click on the button and it will ask you for a description, this is the text which will show above all the social networking buttons. (This will mean the option you set within your settings area will not be relevant here)

Pay With A Like Meta Box

On post pages you will have a new option, if you don’t see it then pull down the screen options and ensure it is selected.

Enabled:

Follow Global Settings – This will force the article to follow the options you setup within the settings panel earlier.

Always Enabled – This forces Pay With A Like within the article. (Overriding the global settings)

Always Disabled – This will disable Pay With A Like on within the article. (Overriding the global settings)

Method:

The Method is how your content is protected, you can choose to use the global options set earlier or do something custom.

Follow Global Settings – Select this option if you wish to use the global options you created in the settings panel

Automatic Excerpt – When selected you will be given an option to enter how many words to show for the excerpt. (Overriding the global settings) This will take the first X amount of words and then display them for the article requiring a Like to see the content.

Manual Excerpt – This will take the manual excerpt entered in the WordPress excerpt box. (Overriding the global settings)

Selection Tool – With this option you will be able to use the shortcode button to cover specific items within the article body. (Overriding the global settings)

Here is how it looks from the admin:

And then on the front end:

Notice the custom description is set there? :)

And thats all there is to it, all that awesome power under the hood with an easy to use and straight forward interface. Simples! :

A Smart Marketing Tool

Reach a more people with a viral marketing strategy.

  • Facebook Like
  • Tweet
  • LinkedIn share
  • Google +1
  • Specific post type
  • Specific page type
  • Automate excerpt
  • Create excerpt manually
  • Custom description
  • Trigger reload when liked
  • Define width
  • Home Page share
  • Protect specific content
  • Set length of validation
  • External page like
  • Vertical button styling
  • Horizontal button styling
  • 'No Count' buttons
  • Built-in statistics graph
  • Shortcode generator
  • CSS guide