How to add plugins to upgrade

I have tried adding multiple plugins into the upgrade-plugins folder, but how do i get them to show up in the package editors plugin drop down?

is there some kind of hook i need to add to the plugin?

  • brettlewis
    • Site Builder, Child of Zeus

    this entire piece?

    //register premium features
    upgrades_register_feature('c87704c8391e2ed74e1a9c3830e986c0', 'Ad Removal', 'Removes advertising.');
    
    //load premium features
    if (upgrades_active_feature('c87704c8391e2ed74e1a9c3830e986c0') == 'active'){
    $upgrades_show_ads = '0';
    } else {
    $upgrades_show_ads = '1';
    }

    that snippet?
    if so do i need to change the jumbo of randomness? (c87704c8391e2ed74e1a9c3830e986c0)

  • Andrew
    • Champion of Loops

    I'm afraid we only provide support for the plugins we offer here. If you're having problems with a different premium plugins please open a new thread.

    As for the upgrades plugin, you need to change the md5 hash to a unique key. It can be anything you want as long as it's complex enough not to be used by another plugin. You then need to change the plugin title ("Ad Removal") and the same goes for the description ("Removes advertising").

    Then you need to wrap any code that triggers to plugin (usually add_action('something', 'something') ) with this:
    if (upgrades_active_feature('c87704c8391e2ed74e1a9c3830e986c0') == 'active'){

    Thanks,
    Andrew

  • drmike
    • DEV MAN’s Mascot

    Take a look at the quota plugin that comes with the upgrades download. You should see since they're line by line how each one is done and made different.

    Aside: I thought the domain mapping plugin was for admins? Still haven't looked at it...

  • mborin
    • Site Builder, Child of Zeus

    FAQ #1: What is the purpose of having 15 plugin options when creating a Package?
    FAQ #2: When I install the quota plugin I see a ton of Quota Increase sizes all under each of the 15 plugin choises, what's the point?

    Would you please give us all a detailed how-to use the Upgrades plugin!

  • mborin
    • Site Builder, Child of Zeus

    FAQ #3: I downloaded your Forums plugin. It says that it's compatible with Upgrades but gives no instructions on how to do this. If I put it in the mu-plugins directory I do not see any way to control it with the Upgrades plugin. If I put it in the upgrades-plugins directory I do not see it at all. If I put it in both directories then I get an can not redeclare error. Andrew, we're not psychics. Please give detailed instructions in your plugins' install.txt files.

  • brettlewis
    • Site Builder, Child of Zeus

    ok, I messed arouse with things for a while last night to get most of my plugins working.
    However, how do i use the ad removal plugin included in the upgrades package. do i need to wrap the ad in some kind of code, or do i need to edit the plugin somehow. I agree with mborin on adding better usage instructions in your plugins. guessing where and how certain functions in the plugins are used is time consuming when it could just be in a txt file. Other than that I love the plugins when i get them working.

  • Andrew
    • Champion of Loops

    Andrew, do the plugins that you made (the ones compatible with Upgrades plugin) need to be in both the /plugins/ and /upgrade-plugins/ directories or...?

    put the php files in /upgrade-plugins/.

    FAQ #1: What is the purpose of having 15 plugin options when creating a Package?

    So you can have up to 15 plugins per package.

    FAQ #2: When I install the quota plugin I see a ton of Quota Increase sizes all under each of the 15 plugin choises, what's the point?

    This should be self-explanatory. If you set plugin 1 to something other than a quote increase you can set one of the others to a quote increase.

    FAQ #3: I downloaded your Forums plugin. It says that it's compatible with Upgrades but gives no instructions on how to do this.

    This was just covered recently here on the forums. You need to put forums.php in /upgrade-plugins/ and configure the options at the top of the file.

    However, how do i use the ad removal plugin included in the upgrades package.

    <?php
    if ($upgrades_show_ads == '1'){
    ?>
    AD CODE GOES HERE
    <?php
    }
    ?>

    Thanks,
    Andrew

  • temi
    • New Recruit

    just like you have quota_active(50); as a function call to set the blog quota for an upgrade to 50MB, what statement in the domain mapper do I use to activate domain mapping? can i create a function that will add the wp hooks? (add_action('admin_menu', 'dm_add_pages') ...etc) will that work?

  • Andrew
    • Champion of Loops

    Andrew, how do we add big plugins, the ones that have lots of files?

    You have to create script that loads the plugin files. Basically:
    mu-plugins/upgrade-plugins/plugin_loader_script.php <-- this has the upgrade code we discussed above
    mu-plugins/upgrade-plugins/PLUGIN_DIR/
    mu-plugins/upgrade-plugins/PLUGIN_DIR/*.php <-- the loader script has to load all of the necessary files.

    Note that you will probably need to go through the plugin and make path adjustments since it will not be running directly in /mu-plugins/. For the loader plugin you can just use the same code used to load mu-plugins.

    just like you have quota_active(50); as a function call to set the blog quota for an upgrade to 50MB, what statement in the domain mapper do I use to activate domain mapping? can i create a function that will add the wp hooks? (add_action('admin_menu', 'dm_add_pages') ...etc) will that work?

    I'm not really familiar with that plugin but adding a function that will add the hooks usually works.

    @Andrew: I don't know why, but that code (for the ad-removal) doesn't work for me.. It just never shows the ads..
    Any idea of what I could be doing wrong?

    Are you calling it inside of a function?

    Only works sometimes on some pages. Why?

    See above.

    Thanks,
    Andrew

  • brettlewis
    • Site Builder, Child of Zeus

    It worked for me if I did this

    if ($upgrades_show_ads == '1'){
    CODE WANTED TO BE ALLOWED
    }else{DENIAL TO USE MESSAGE};

    It never worked when i did this
    `if ($upgrades_show_ads == '1'){CODE}
    if ($upgrades_show_ads == '0'){DENIAL}'

  • Hiranthi
    • Recruit

    Well, as I said: before the if/else (and as I already stated I made a function in functions.php for it).

    So, my function looks like this:
    function showAds()
    {
    global $upgrades_show_ads;
    if ( $upgrades_show_ads == '1' )
    {
    return true;
    }
    return false;
    }

    And I use it in the sidebar like this:
    if ( showAds() )
    {
    SHOW BANNER
    }

    As you can see I don't actually use an else, that's because I don't need it :wink:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.