Upgrades Plugin Usage

As noted in another thread, I just installed the Upgrades plugin for the first time. Everything seems to be working as it it should and it's a great plugin!

However, I do have one basic question on it's usage. I am under the impression that in addition to the ad_removal.php and quota.php files that I will be able to add any plugin that I want to offer as an upgraded service?

I was expecting that when configuring a "New Package", the plugin dropdown list would list all of the plugins in my main plugins directory. This was wrong. Once I learned that only the plugins residing in the /mu-plugins/upgrade-plugins/ directory were the plugins that would show in the dropdowns when creating a package, I thought I understood. So, then I dropped a plugin in there (the Feedsmith plugin), and went back to create a package and I didn't see it listed in the dropdown. So I tried a couple more with the same result.

Is this not the intended process?

  • drmike

    You have to edit the plugin to make it into a premium plugin.

    1) You have to tell the system that it exists as a premium plugin. Take a look at the samples provided and you should see the following:

    //register premium features
    upgrades_register_feature('c87704c8391e2ed74e1a9c3830e986c0', 'Ad Removal', 'Removes advertising.');

    upgrades_register_feature is the function call. (I'd put it near the top of the plugin after the description) The code appears to be a random md5 hash. Plugin name. Plugin description.

    The second part is to wrap the add_action calls or what ever the plugin uses to run within a check to see if the plugin should be run.

    For example, let's say the plugin is called via:

    add_action('wp_head', 'run_my_plugin');

    You need to wrap that with a check to see if it should be run.

    Example:

    if (upgrades_active_feature('c87704c8391e2ed74e1a9c3830e986c0') == 'active'){
         add_action('wp_head', 'run_my_plugin');
    }

    Does that make sense?

  • James Kirk

    While understanding the general concepts discussed in this old thread, I am wondering how elaborate plugins are "converted to premium upgrade" plugins? For instance, I have a plugin that I'd like to convert. It has several files in addition to the main-plugin.php file. Do all of those files get placed in the "/mu-plugins/upgrade-plugins/" directory?

    Also, when adding drmike's code to the main-plugin.php file, how to know which "add_action" to include. This particular plugin had several.

    Have been searching diligently throughout these forums for clear, concise instructions or tutorials about how we can use this premium Upgrades plugin with more than the four included "upgrade-plugins". Would be humbled if there is something with more knowledge to impart than what is included in this thread.

    Oh, and as an added aside, albeit related, am I crazy, or is there no "upgrades_badge.png" to be found in the download? I've gotten the Upgrades package to work on a test install site, http://test7.inverdevalley.com, but when adding the "Upgrades Badge Widget" I noticed the image was not showing. So, just wondering why this would be such an "upgrade" plugin. I'm sure I'm just missing something and willing to be schooled.

    Thanks,
    James.

  • Andrew

    Hiya,

    Do all of those files get placed in the "/mu-plugins/upgrade-plugins/" directory?

    Yep. Also if there are any hardcoded file paths in the php files then be sure to update them to match the new location (upgrade-plugins).

    how to know which "add_action" to include.

    I'm afraid the answer is "it depends". You need to place the check around hooks that initiate the plugin.

    If you're not comfortable making these changes then you might want to consider hiring a developer to modify you plugin. It really shouldn't take more than a few minutes so it shouldn't cost much.

    am I crazy, or is there no "upgrades_badge.png" to be found in the download?

    You have to make your own. Users typically feel more "special" if the image is custom made for the particular site.

    Thanks,
    Andrew

  • Mason

    I'm revisiting this as well, and I mostly understand what I need to do with a regular plugin and will be testing this, I was wondering about Doncha's awesome domain mapping plugin.

    Besides the function call and add_action, would I just need to update the paths to the new relative location for sunrise.php? Is there anything else I'm missing? I don't believe I'd need to edit anything in the sunrise.php file. Any tips, thoughts, suggestions, reprimands?

    Thanks,

    -james

  • Mason

    Andrew,

    First off, thanks! I was using the supporter plugin, but recently have been thinking about switching to upgrades because I'd like to have multiple "levels" on the site.

    The upgrades plugin does this, but now I'm not sure how to add things like premium themes to this (I found this available for supporter). Do you know of any way to setup "premium" themes with upgrades? Are there any plans to combine the functionality of the upgrades plugin with the supporter?

    Thanks again and again.

    -james

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.