AdSense revenue sharing plugin for WordPress-MU

This is an updated version of the AdSense revenue sharing widget for WordPress-MU (in beta).

Two things before we start:

  1. To stay updated please subscribe to my RSS feed.
  2. If you use this plugin it can make you a lot of money. Please consider a donation using the PayPal button on the right – thanks 🙂

The AdSense revenue sharing plugin for WordPress-MU will allow you, the owner of a WPMU site, to share Adsense revenue with your users. You can set the percentage of your share (default is 20%) and enter your AdSense publisher code via the ‘Site Admin‘ backend panel.

adsense-share-1.PNG

The user can enter his Adsense publisher code in the ‘Options‘ menu:

adsense-share-4.PNG

Download: adsense-share-mu-123.zip

Current version: 1.2.3 (view change log below)

Installation: extract the adsense-share-mu.php file and upload it to the mu-plugins directory.

How to use?

Go to ‘Site Admin‘ -> ‘Adsense share‘ and set your Adsense share and your Adsense publisher code.

There are two option to insert Google Adsense ads and they can be used together:

  1. allow users to insert an Adsense widget to their sidebar (that is the easy and simple way). All your users will have to do is drag the ‘Google Adsense‘ widget to the sidebar, click the configuration icon and enter their google_ad_client ID.
  2. hard code ads into the themes.

The second method needs some explanations. Since Google is constantly changing the structure of the ads script and adding new features, I decided that I will not deal with the ad code except for the google_ad_client which is the Adsense publisher code.

To insert ads to your themes you should log into your Google Adsense account and select the product, ad type, ad format and colors, corners style, channels and whatever Google allows you to select. Once you are done you will get a code looking something like this:

<script type="text/javascript"><!--
google_ad_client = "pub-01234567890";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-10-07: Demo
google_ad_channel = "1234567890";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Simply copy this code and paste it wherever you want in your theme files. Note the second line starting with google_ad_client and ending with “pub-01234567890”;. The second part is your Adsense publisher code. If we don’t change that code you will get all the revenue from the ads and your user will not be happy. So we want to enter a piece of code that will iterate between the publishers codes. This is done by replacing the “pub-01234567890”; part with a simple line of code:


<?php get_adsense_code(); ?>;

if we want to be on the safe side we can add a check for the function:


<?php if (function_exists('get_adsense_code')) {get_adsense_code();} ?>;

So now the Adsense code looks like this:


<script type="text/javascript"><!--
google_ad_client = <?php if (function_exists('get_adsense_code')) {get_adsense_code();} ?>;
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-10-07: Demo
google_ad_channel = "1234567890";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

If you want to ad the ads only to your themes and not allow the users to ad the widget, there is a little hack which involves editing the plugin file. Open the adsense-share-mu.php file and look at line 14. If you change the no_widgettruetrue parameter to ‘true‘ the widget will not be available.

Change log

1.2.3
Fix security issue (everybody upgrade). Thanks NK5.

1.2.2
Fix a minor php bug.

1.2.1
Added an “;” at the end of the php code.

Please report and issues in the comments below.

Zuggu – is it digg for bloggers?

Ariel, from Today is not over yet, sent me a link to his new tool – Zuggu. According to Ariel, Zuggu.com is a ‘Digg alike’ site created specifically for content related to blogging, making money online, productivity, motivation, entrepreneurship, and related subjects. Zuggu runs on Pligg.

zuggu.PNG

In an interview with Michael Martine Ariel said he “realized that there is a massive amount of great content out there that doesn’t get the credit it deserves or remains almost unknown”. In his opinion the well known bloggers get most of the traffic even when they don’t have the best content. The idea behind Zuggu is to allow less known bloggers in the field of making money online, productivity and alike to get exposed.

Since this is a new tool only time will tell us what it is worth.

I have been plagiarized

I have been plagiarized!

This morning I found a back-link from a new WprdPress-MU site that just copied a few of my plugins including their entire posts. Does this look familiar?

pla-80.PNG

Well, it should. It is an exact copy of my AdSense revenue sharing widget for WordPress-MU post.

Check the rest of this site, you might have been plagiarized too! My BlogRush plugin had also been copied 🙁

Browser tests and compatibility

Smashing Magazine posted today an article about Browser Tests, Services and Compatibility Test:

Cross-browser compatibility is still one of the most complex issues when it comes to web-development. Web standards usually guarantee a (relatively) high degree of consistency, however no browser is perfect and particularly older browsers have always been quite good at surprising web-developers with their creative understanding of (X)HTML/CSS-code. Still you need to make sure that (at least) most visitors of your web-site can use it, navigate through it and find what they’re looking for as quickly as possible.

The post is packed with information and different off-line and online tools to help you check your site compatibility to different browsers and user settings. I have tested the RingOfBlogs blog on a few browsers using BrowserShots. It actually looked nice running on Safari 3.0.2 and Windows 2000.

PredictAd – navigation, monetization and search

PredictAd is a pre-search engine. That means that by pasting a short code to your website, you get an Auto-Complete feature, Live Search on your RSS feeds, and a search monetization option.

 

This new service by SimplyGen (still in beta) is set to enrich your users searches on your blog (or site). Let us keep the tech stuff for later but by adding a short Java Script to your blog you can add the following cool things:

  • Search Auto-Complete feature – once the user starts to enter a search term into the search box, an auto-complete drop down box will appear. The words in the drop down box can be general, by category or custom. A cool feature is the option for PredictAd to learn previous searches on your site and offer them to new users.

  • Search within your RSS feed – another cool search option is to allow your users to search over your RSS feed. You can see the RSS tab in the image below. Once the user clicks it the search is made within your feed and showing the titles of your posts.

predictads-3.PNG

  • Search monetization – so far we have talked about what PredictAd can do for your readers. But what about you? Well, the service can place, non-intrusive text ads related to the users search terms. It is PPC (pay-per-click).

  • Search analytics – ever wanted to know what are people searcing on your site? Well PredictAd will tell you. The advanced reporting tool will show you what were the top search queries, how many searches and clicks you had and what was your revenue share.
  • Sign up advertisers – if you can sign up new advertisers to the service you can earn extra cash. Each referred advertiser that signs up to the program will be registered as your advertiser and you will get 80% of the profit made from his ads on your site. You can also sign up new publishers and earn 5% of their income.

How to implement?

First you will need to place a search box on your blog. You can use any search widget you like. Even Goolge search. Next you will need to log into your PredictAd account and click “PredictAd Setup“:

predictads-4.PNG

Beside the several options you will see, the most important one is the “Text Input ID“. The text input id is a unique identifier of the search input box. You can use the “auto-detect” tool which works perfectly if you have only one input box on your blog. When done click the “Generate Code” button and copy-paste the code in the specified areas.

My two cents

This blog does not get to many searches with the in-site search box so I’m just playing around with the service here (you can see it in action on the right sidebar). Other sites I run have more search traffic and this option can help my users and get me some extra income at the same time. I think that PredictAd would be great with faq sections and mini-portals.

Sign up (aff) for a test drive – why not?

WordCamp Israel 2007 announced

Following my previous post about WordCamp Israel 2007 I’m happy to let you know that the event had been officially announced.

The camp is set for October 25th and will take place at AFEKA – Tel-Aviv Academic Collage of Engineering. It is planed to be a full day of WordPress blogging, business blogs, themes, plugins, WordPress optimization, SEO and much more.

Loerlle VanFossen is planed to be a guest speaker so many of the Israeli bloggers are excited to meet her in person.

Everybody is welcome!

Spam at wpmudev.org

One of the best collection of WordPress-MU resources is wpmudev.org. It is built on a WordPress system so the spamers will try to get in. Today is the first time I have seen a Spam message on the site:

spam-at-wpmudev.PNG

Syntax Highlighter plugin for WordPress-MU

For some time now I was looking for a Syntax Highlighter plugin that will work good with WordPress-MU out of the mu-plugins directory. Since I could not find one I decided to modify an existing plugin. I chose the SyntaxHighlighter plugin by Erik Range. This plugin is actually based on code provided by Alex Gorbatchev.

I had to change it quite a bit since I removed the user backend, changed a few hooks and most important made sure that the Java Scripts required by the plugin will be loaded only when there is some code in the post and not for every page loaded. This issue is very important for high volume WPMU sites.

The Syntax Highlighter plugin for WordPress-MU supports the following programming languages:

  • Cpp
  • CSharp
  • Css
  • Delphi
  • Java
  • JScript
  • Php
  • Python
  • Ruby
  • Sql
  • Vb
  • Xml

Known issue: for some reason the plugin works on post view only and not on the home page. will try to fix it soon.

Download: wpmu-syntax-highlighter.zip (beta)

Installation: extract and place in the mu-plugins directory.

Usage: [ source:language] source code comes here [/source]

language is one of the programming languages listed above.

Important: Please note to NOT use a whitespace in the [ source:language] command like shown in Usage and Example below. If you copy & paste it, don’t forget to remove the space.

Example: entering the following code

[ source:php]
// Re-insert source as (formatted) textarea
foreach( $theSources[2] as $sourceID => $sourceBlock ) {
$theBrush =
$theSources[1][$sourceID].$optionString;
$thePost = str_replace(
”{sourceID:{$sourceID}}”,
);
}
[/source]

Will result with this code:

// Re-insert source as (formatted) textarea
foreach( $theSources[2] as $sourceID => $sourceBlock ) {
$theBrush =
$theSources[1][$sourceID].$optionString;
$thePost = str_replace(
”{sourceID:{$sourceID}}”,
);
}