Tag ‘upgrade’ » Archiv


0

Taming the Upgrades plugin from http://premium.wpmudev.org

February
2

If you’re lucky enough to have a subscription to Premium WPMU Dev account then you’ll have access to great monetization plugins like the Upgrades or Supporter which take all the pain out of providing a ‘pay for’ service that can handle payments through Paypal, Google or even Amazon gateways.

I downloaded and installed the upgrades plugin a while ago and I’ve used it to monetize certain parts of my ComLuv site. There’s the usual way of adding plugins to the Upgrades directory and configuring them to be used which I’ll go into in a future post but I wanted to use the system slightly differently, and that was to charge users for adding new URLs to an account or to add default links to their returned list of posts.

The advantage of premium

Some of the advantages to using wpmupremium plugins is the support you receive, knowledge that the plugin will be updated to keep it compatible with new changes and my favourite is, the quality of the code.

When you’re getting premium, you’re getting premium code which for me personally, has taught me a LOT about how wordpress works. Particularly custom hooks and actions and filters. That was always a mystery to me until I dissected the plugins I downloaded from their site so it was a breeze to modify the upgrades plugin to work for users who don’t have blogs and start using the internal functions in a daughter template to do what I wanted.

Modifying the upgrades plugin


I needed to allow the upgrades menu to show for regular users because not everyone who joins the Comluv site starts a blog. This was just a simple case of changing the user level so that everyone, not just blog owners can see the menu and buy credits.

There are two places to modify:

/mu-plugins/upgrades-framework.php
line ~ 197-200 (upgrades plug pages framework function)
change add menu and submenu calls to

add_menu_page($upgrades_branding_plural, $upgrades_branding_plural, 0, 'upgrades.php');
add_submenu_page('upgrades.php', __('Credits'), __('Credits'), 0, 'credits', 'upgrades_credits_output' );
add_submenu_page('upgrades.php', __('History'), __('History'), 0, 'history', 'upgrades_log_output' );

line ~ 1919 (upgrades_credits_output function)
change user check to

if(!current_user_can('level_0')) {

Creating the daughter template

Adding another page you can use as a template is pretty easy, you just need to create a new php file in your theme directory and make sure it has the correct remarks at the top to identify it as a template page.


/*
Template Name: ComLuv purchase url
*/

Next just copy and paste the main calls from another template, you’ll be deleting most of it like the loop to display posts and replacing it with your own hard coded form and text. Be sure to keep the divs that surround the content intact.

I wrote a description of the item being sold and added a form.
(DON’T copy and paste from this page, I had to remove the beginning < characters from the code so it displays properly)

form action='/member/additional-urls/' method="POST">
input name="addurl" type="text" size="30"/>
input type="submit" name="submit1" value="Submit"/>

/form>

I also added a finish_page() function which just closes the /div tags so I could easily break out of what I was displaying without rendering the rest of the custom code below it.

You set the action to the page slug you’re publishing the page as and put a nonce field in there so you can check it with the next bit of code to prevent a naughty user from trying to call the purchase directly.

Handling the purchase

Next, you need to handle the data that gets submitted by your form and do the magic with the users credits.

if(isset($_POST['submit1'])){
$nonce=$_REQUEST['_wpnonce'];
if(!wp_verify_nonce($nonce,'addurl1')){
echo 'Page request deformed, please go back and try again. (b1s1)';
finish_page();
}
if(!$_POST['addurl']){
echo 'Please go back and enter a value';
finish_page();
}
// check if user has enough credits
global $user_ID;
$credits = upgrades_user_credits_available($user_ID);
if($credits < 3){
echo 'h2>Error - Insufficient Credits/h2>';
echo 'p>You will need to purchase some credits to register another URL, you currently have strong>'.$credits.'/strong>';
echo 'p>a href="/wp-admin/upgrades.php?page=credits">Click here to visit the purchase page/a>';
finish_page();
}
// if we're here then everything is ok to provide service and deduct credits
$credits = upgrades_user_credits_available($user_ID);
$credits -= 3;
upgrades_user_credits_update($credits);
upgrades_log_add_msg($user_ID,'You paid 3 credits for an additional URl - '.$url);
do_add_url($url,$user_ID);
echo 'h2>Site added, 3 credits used on your account/h2>';
echo 'p>You have '.$credits.' credits remaining';
echo 'p>a href="/member/additional-urls/">Click here to refresh the page/a>';

The first bit gets the nonce you created and checks it and displays an error message if it doesn’t match
Next, check the field you’re expecting and spit out an error if it is empty.
Next, check the user has enough credits and spit out an error if they don’t.
If everything is fine, continue.

use $credits = upgrades_user_credits_available($user_ID); to get the users current credits total
use upgrades_user_credits_update($credits); to set the users credits total to $credits (after you deduct what your item/upgrade costs)
use upgrades_log_add_msg($user_ID,’You paid 3 credits for an additional URl – ‘.$url); to add a message to the users Credits history page so they know they used some.

That’s it, easy peasy! Here’s an idea, use credits to sell digital downloads on another page, just check and deduct the users credits before allowing a dowload.

I’ll post a follow up to this soon on how to use the upgrades plugin to add a new package that enables the RSS widget for a blog (I’ll show you how to disable the rss widget too)

You can get over 100 plugins and themes of premium quality at http://premium.wpmudev.org and they all help to make your wpmu site better than the jones’s :)

Blog Tools, Making / Made Money, PHP, Wordpress


12

Probably the biggest personal project I have undertaken ever

May
17

It’s happening, it’s really going on right this minute. The new CommentLuv site and plugin are literally 2 weeks away (sooner for some).

I’ve made an announcement on the main CommentLuv site and suspended member registrations until all the existing subscribers and members have been imported to the new site. I will try and move everything else without causing any major disruption to normal use.

This is the culmination of 2 years worth of updates, improvements and masses of new learnings. I was able to bring commentluv up from a humble wordpress only plugin to a combined site and multi-platform utility that got used by thousands of blog owners and (literally) millions of people every month felt a little bit of luv.

Now, CommentLuv is used on Wordpress, Blogger, Jskit, Haloscan and more will come when I release details of the API . When that happens, there wont be a commenting system out there that I wont try to code a CommentLuv plugin for! I’m sure there are some geeks out there that’ll be able to use the API to create their own versions for whatever platform they can imagine too so the chances are that if you didn’t have CommentLuv before, you will be able to get it soon!

Some Fancy Features

Free Wordpress 2.7.1 Blog with plugins
Every single existing and future member of CommentLuv will be able to create their own Wordpress 2.7.1 blog with plugins like CommentLuv already installed. All will be hosted on the new server and all will be free for any member to use!

Multiple Sources
You will be able to register up to 5 sites with your account and retrieve posts from any and all of them when you comment on CommentLuv sites

Premium Features
As well as the whole host of blogging tools available for free, there will be some fantastic features such as a full newsletter/autoresponder package that can be integrated into your blog to provide feed subscriptions, newsletters, broadcasts and more. All with full open and click rate statistics, double and even triple opt-in. Live statistics on bounces, opens, clicks and forwards. Pie charts and graphs updated in real time. There’s even more to see here!

Please be patient

This has turned out to be the biggest personal project I have undertaken and it wouldn’t have been possible without the huge assistance from Ron and Andrea (http://ronandandrea.com) who took care of making the WPMU site and new CommentLuv API to my sometimes semi-coherent specifications!
The finishing touches are being done now so I will need your patience as I fill the site with the content that’ll be needed for instructions, tutorials, videos, faqs, support tickets, forums and all the other things that are bound to turn up over the next 2 weeks.

Get to be the first!

You will find out when I’m ready to start issuing invites and preliminary accounts if you’re already a commentluv user. If you’re not, you can enter your details here and as soon as you confirm your subscription, you will receive an email when I open up the site for pre-launch beta users. There will also be news of how you can download the very latest version of the plugin before anyone else so you can be the first on the new list of active sites. Oh the joy!!

Name / Username

Email Address

Blog News


26

Forcing the issue with CommentLuv

November
19

The new version of CommentLuv has been going since September 1st and has been written about on:

  1. My Forum
  2. The plugin page on my blog
  3. The CommentLuv site
  4. The wordpress codex
  5. The Wordpress MU Site
  6. Every registered member
  7. Through visiting every site I get notified about in Google Alerts that is using the old version.
  8. Running a massive contest encouraging people to upgrade to the latest version

The old version is responsible for about 50,000 unnecessary hits to my server every day from automated spam bots that post direct to the wordpress comment post file, sometimes the server would fold from a busy spam day (it once had 1 million spam hits in a few hours!) so I had to find another way to let the people know that their version needs updating (just in case they didn’t see any of the above places).

Not to mention all the people complaining that their latest post wasn’t shown on some blogs, this is down to Feedburner not passing back fresh feeds to scripts unless they have cache enabled. The new version does this but the old one doesn’t. (feedburners fault, not mine!)

So, I put in a small message to be sent back instead of the last blog post if it was requested in the first 10 minutes of each hour;

CommentLuv needs updating on this site. Please download the latest version and install it on your site. This message will apear during the first 10 minutes of each hour. This remote script will cease returning posts in 7 days.

Is that so bad?

The alternative is just delete the remote scripts and everyone using the old version will be left with nothing happening instead.

What do you think? should I keep with the message or just delete the remote scripts so nothing gets sent back to the people that don’t upgrade or view their plugins page?

I’ve only seen one site complain but it was an un-ranked, 0.4 average comments per post site written anonymously who posted to their site instead of contacting me direct via the squillion ways possible (my email, forum, site, phone, skype, yahoo, gmail……) but, ever the conscientious coder, I don’t want to offend anyone by daring to ask them to upgrade a plugin because their old one can affect the performance of my server and subsequently, the 100-200K last blog posts that get sent back to the users who DID upgrade. :-/

If you see the message above when someone comments, it means the blog being commented on needs to upgrade the plugin for the good of everyone who uses the proper version (in fact, for the good of the whole universe!) I have a support ticket function open at CommentLuv so if anyone needs help updating or even if you want to shout at me, you just need to click… (surely that is more efficient and quicker than writing a whole post about it?)

Blog News


14

Some absolute cracking good plugins and tools for WP site developers

June
4

I’ve been away from fiddyp for a while but not away from wordpress as I’ve been working really hard on some WP based sites that have turned out pretty well using WP as a CMS combined with some useful and custom plugins.

It’s pretty amazing what you can do with some customized templates and a bit of hacking the code here and there so I thought I’d list some of the useful tools I work with to make life a little bit easier.



Cforms II

This is a really easy plugin to use straight out of the box just by entering <!–cforms–> onto a post or page where you want the contact form to appear.

Select which fields you want in the options page and you can’t get a simpler contact form made on Wordpress!

It can be used in a more complex way too, it has options for AJAX, custom fields and even a file upload function. Get into the code some more and there are ways to generate custom contact forms within the wordpress template code so for example, you could generate a “request more information on this product” form on a product listing which has the product code automatically inserted as a hidden field which will be sent along with the contacts details and message.

You can read more about Cforms II and download the latest version at
http://www.deliciousdays.com/cforms-plugin

It works well and is constantly being updated with new features and options.
read more… »

Blog News, Blog Tools, Wordpress