New unofficial plugin: Gravity Forms integration with WPMUdev Pro Site's

Hi there everyone!

I'm proudly announcing an extension to the previous Gravity Forms registration plugin: Gravity Forms to WPMUdev Pro Sites Upgrade/Extend/Downgrade extension!

Here's what you need to know:
1. This isn't for everyone, you will need to take the time to read through the PHP file and edit where needed (2 to 4 edits to get started, 9 more for pricing and a few more to your own liking)
2. Take a few hours to process this. Thank me later for saving you a few dozen more.

Here's what you need:
1. You need a Developer's license of Gravity Forms
2. You need Pro Sites by WPMUdev
3. Registration extension (link below)
4. Upgrade/Extend/Downgrade extension (link below)
5. Fresh water.

Both modules can run side by side or as standalone.

A lot of consideration has been put into this for every function and action - many of those weren't needed for myself but have been put in for you :slight_smile:. Like currencies, prices and even the ability for users that just want to try out Gravity Forms.

The Registration Extension doesn't have a tutorial. Follow the notes on https://premium.wpmudev.org/forums/topic/gravity-forms-and-pro-sites-integration#post-751434 if you want to get started.

The Upgrade extension does have an extended tutorial, the (mandatory) form import file containing 40 pre-defined blocks and included CSS to get started.

THE DOWNLOADS:
Registration (updated): https://hostmijnpagina.nl/hmp/plugins/prositesregistration-updated.zip
Upgrade/Extend/Downgrade (new): https://hostmijnpagina.nl/hmp/plugins/prositesupgrade-new.zip

A little preview of what it should look like on a super-admin account (lol @ massive discount):
https://hostmijnpagina.nl/hmp/images/downgradepreview.jpg

Any questions, bug reports, etc. regarding this plugin can be posted here.

Like this plugin? Share your love <3

    • Sybre Waaijer
      • The Incredible Code Injector

      Hehe it's okay :slight_smile:

      The aim of the plugin is basically to allow people to manage Pro Sites with Gravity Forms.

      This is done for many reasons:
      For me it was mainly done for the integration of the iDeal payment gateway (a Dutch online direct banking system).
      For others it might be a reason to collect extra data for invoices so they can for example integrate the customer's address on an invoice (I think this is mandatory in Europe).
      It is even possible to add extra services for customers with extra needs (like CSS customization). This can all be ordered within one form now - and thus one invoice.
      Now it's also easily possible to integrate extra API's within the form, for example domain ordering, managing, etc.

      Gravity forms has many modules for many needs - that's why it's so popular. The possibilities are virtually endless.

      See https://post.je/delta for an example take on the registration form, this one is integrated with Pro Sites too!

      Have a great day! :slight_smile:

  • Sybre Waaijer
    • The Incredible Code Injector

    Whoops, made a typo!

    Users whom have already downloaded and changed the file:
    On line 133 I explain that you should change 'comma' to 'dots', this should actually be 'dot'. So 'dots' won't do anything and therefor no discount will be calculated.
    Use 'dot' if your currency (like dollars) uses dots instead of commas.

    Users who download it for the first time, don't worry about this:
    I updated the download link in original post and the new file accepts 'comma', 'commas', 'dot' and 'dots'.

  • Sybre Waaijer
    • The Incredible Code Injector

    UPDATE 1.1.0
    Updated both plugins to accept real discounts based upon the latest purchase by adding new blog options.

    All new options have been tagged with /* new since 1.1.0 */

    The links in the first post will be updated within a few minutes. --DONE.

    I regret that I haven't made any easy "options" because this might be difficult for you guys to upgrade, however I think it's a good place for you to learn PHP :slight_smile:
    No upgrade instructions included. New users can get started right away :slight_smile:.

    I will consider a user interface for this plugin if there's enough zest/enthusiasm or demand from you guys.

    Have a great day!

  • Tyler Postle
    • CGO

    Hey Sybre, awesome stuff! :slight_smile:

    Sending some more points your way. Sharing a custom plugin with the community is one thing(an awesome thing!), but maintaining/updating it is taking it to the next level.

    Awesome contribution!

    Have a great rest of your day Sybre.

    All the best,
    Tyler

  • Jaime
    • Site Builder, Child of Zeus

    Hi,

    Thanks for your plugin. I'm facing an issue when I try to import the form I get the following message. "Forms could not be imported. Please make sure your XML export file is in the correct format."
    I'm a newbie trying to figure all this out.

    Thanks for your help!

    Edit: Just found out I need gravity forms 1.9 to import the json file
    Edit 2: Same error when trying to import using beta 1.9.5

    • Sybre Waaijer
      • The Incredible Code Injector

      Hi Jaime! Thanks for dropping by!

      -----
      EDIT: Whoops scrap this, I've over-read your edits D: I also get the same error :slight_smile: Which is a good thing.
      -----

      I've used the beta version of Gravity Forms to make the export file, so I'd recommend that you upgrade to that version. I've been using their Beta version for a month now on a live site without any problems :slight_smile:

      You can download the beta version from http://www.gravityhelp.com/downloads/

      To be exact I've used 1.9.beta4 to make the export file - But 1.9.beta5 should work flawlessly with the import.
      ----

      If you're still running into problems please let me know :slight_smile:

      Happy Holidays!

      ---
      EDIT: I've done some testing and removed the error from the code in Gravity Forms. Then it accepts the file but says "Gravity Forms imported 0 Forms successfully."

      There seems to be an issue with the uploading of .json files which is totally understandable for security reasons. I think I know where the problem lies and will add a small tutorial in a new post below.

  • Sybre Waaijer
    • The Incredible Code Injector

    Hi @Jaime!

    I've updated the download link with a working export/import file.

    The "Damaged" file is identical but doesn't seem to work. It's kept there to inform the Gravity Forms developers.

    You'll need to import the gravityforms-export-2014-12-24.json file in order to get a working form.

    Feel free to report any issues here if you were to run into them.

    Happy Holidays!

  • Tk
    • Design Lord, Child of Thor

    Hi Sybre, Thanks a lot for this.
    I have given you points from my limited point pool. Please continue to maintain it - or may I ask the WPMUDEV team to kindly incorprate this as an offical plugin and maintain it to give credit to the great work by sybre for the community.

  • Tyler Postle
    • CGO

    Hey WP Tech,

    Hope you're doing well today! It's my understanding that you will need both installed :slight_smile:

    GF's user registration and the custom one attached above.

    Hope that helps! Let us know how your site looks after you get it all setup.

    Another shoutout to Sybre for sharing it too :slight_smile: good stuff.

    Cheers,
    Tyler

  • Sybre Waaijer
    • The Incredible Code Injector

    Hi @WP Tech!

    I've updated the prosites-registration file which now contains a form import file (the plugin is left unchanged).
    Almost everything you need is in there including some basic instructions. It's a stripped down version of my registration page which has some basic translations.

    The form should work right away with one exception:
    You still need to bind it to the "User registration add-on".

    You can add as many fields as you like and remove the ones you don't (I've added a notification in the "descriptions" of the fields when it's possible)

    Once that is completed feel free to test and update the form to your liking. If you run into any problems please let me know :slight_smile:

    Have a great day!

    https://hostmijnpagina.nl/hmp/plugins/prositesregistration-updated.zip (same link as in the Original Post).

      • Sybre Waaijer
        • The Incredible Code Injector

        Hi @WP Tech

        I would like to redirect you to the following page:
        http://www.gravityhelp.com/documentation/page/User_Registration_Add-On

        In short, this page explains the following:

        1. Create an extra field for "First and Last name" in the form
        2. You need to activate the User Registration add-on plugin (requires a developer license of Gravity Forms)
        3. A new menu option has been added under "Forms" on the left side of your admin screen
        4. Click "Add New" on that page
        5. Select "Create User"
        6. Select the form
        7. Bind "Username" to "username"
        8. Bind First and Last name to the respective fields you've just created
        9. Select the "display-name", this will be the default name which can be seen on the post pages created by the users
        10. Select the e-mail address (E-mial)
        11. Select the password field (this one is automatically selected)
        12. Ignore the "Role" field
        13. Check the "Create website" checkbox
        14. Select the web-address (.yourdomain.com)
        15. Set the website title (I used web-address, you can create a new field for this)
        16. Website role has to be "admin" (the highest role)
        17. Current website role has to be empty (or anything you desire)
        18. Additional options are optional. I selected the activation by e-mail checkbox. I do not recommend the Registration Condition.

        When that's all set, you're good to go!

        For the upgrade/extend/downgrade extension you'll need to select the Update User option at 5). All of what is required for that plugin is explained in the readme located in the zip file.

        • WP Tech
          • The Incredible Code Injector

          @Sybre - First of all - thanks a million.

          Now on 7... I don't have a username on my form. Should I use the new Name Field I created? If so....full / first / last - does it matter?

          For 14 ... I see no such field... So I just added a text field and mapped it... but how will this be validated for availability?

          For 15... I just added a text field here. Assuming that is ok!

          P.S. I wound up working on this b/c prosites seems to have an odd quirk that it only allows registered users to 'upgrade/pay.' My goal with all of this is to offer a more traditional signup - like I see on your site. It's perfect. ...Am I on the right track here in moving toward that goal by getting these additional plugins configured? (Sorry for the basic questions!)

          Thanks!

          • Sybre Waaijer
            • The Incredible Code Injector

            Hi @WP Tech

            To start off, my whole site is in Dutch so I might be wrong with the translations :slight_smile:

            Before I continue I would like to note that you can add any fields you'd like to the form and you can re-order them to your liking. Just pay attention to the field ID's before removing them.
            The field ID's are matched to the ones in the add-on I've written. For the registration add-on these fields are 8, 9, 10 and 11

            About 7 ... For the first/last name I used the "Name field". The registration add-on finds this and splits them with a label "Name (First)", "Name (Last)". (I deleted this field without consideration, sorry :slight_frown: ) The Registration Add On accepts any single-lined field for this though.

            About 15 ... Yes sir Ryan! I think I already added that line there though, I named it "Site address" (field ID 4). That field may be replaced/deleted without a problem though. The Registration Add on also accepts any single-lined field for this one.

            About P.S. - Absolutely correct about the quirk and your goal, that was my main intend to create this plugin. It's a WordPress.com like registration form.

            Also, Gravity Forms supports many international payment systems supported by many other plugin authors - so that's another reason.
            This is because Gravity Forms is easily manipulated - I think that's its core design intend. This means you can easily bind the form inputs to invoice systems, Gravatar uploads, Pro Sites (pre) registration and more!

            P.S. you don't have to worry about people manipulating your forms either :smiley: It's protected and will check the fields to its properties you've selected throughout the whole installation.

  • Sybre Waaijer
    • The Incredible Code Injector

    So sorry everyone for that the export files don't translate well from Dutch to English.

    I'll be adding all the translations below in the near future for reference purposes (so you know what to bind in User Registration).

    I unfortunately do not have the time to rebind all values in an English setup because all conditional logic will have to be remapped.

  • Sybre Waaijer
    • The Incredible Code Injector

    About my previous post, here are the translations:

    Username = Gebruikersnaam
    First Name = Voornaam
    Last Name = Achternaam
    Password = Wachtwoord
    Fill in password = Voer wachtwoord in

    Street + homenumber = Straat + huisnummer
    Adres = Address
    Zip/Postal code = Postcode
    State/Province = Staat/Provincie
    City = Plaats
    Country = Land

    Subscription = Subscriptie
    Period/Term = Periode

    If I missed anything, let me know!

  • Sybre Waaijer
    • The Incredible Code Injector

    An explanation about how the discounts are calculated, this only counts for upgrade/downgrade. The extending feature just gives the regular price:

    Note: I used PayPal "subscription" as an example payment method here. However, this accounts for any payment method but the "keep paying for previous subscription" will be redundant as they have already paid the full price. Either way, they must pay the Full Price for the previous subscription, however they do so (be that in terms or direct).

    The user gets a deducted price for their new subscription. Their previous subscription will be overwritten by the new one, they keep paying for the previous one and the new subscription gets a new price.

    ==== Example ====

    I take a Basic subscription (5 usd/month for 12 months = 60 usd)
    This means I’m going to pay 60 USD.

    Now I want to upgrade after 6 months to Pro (19usd/month for 12 months = 228usd)
    This means I get 6 months discount (calculated to the day!) (5/months for 6 months = 30 usd)

    The final price I pay for the new subscription will be 228-30 = 198 USD
    This will be split over 12 months, so this will mean that I will pay 16.5 USD/month (198/12)

    What will happen is the following:
    I keep paying 5 USD a month for another 6 months (30 USD)
    I keep paying 16.5 USD for 12 months (198 USD)
    The total price is 198+30 USD = 228 USD (original price for Pro)

    ==== Another example ===

    I take a Pro subscription (19usd/month for 12 months = 228 usd)
    I want to downgrade to Basic after 9 months (60 usd)

    I get a discount of 3 months Pro (19usd/month for 3 months = 57 usd)
    The final price for the Basic subscription will be 60-57 = 3 USD

    This will be split over 12 months = 0.25 USD/month for 12 months.

    This will mean I keep paying 3 months for Pro (19 times 3 = 57)
    This will mean I keep paying 0.25 usd a month for 12 months Basic (3 usd)
    Total price: 60 usd (original for Basic).

    The site will automatically become free after their time expires. You will have to configure Pro Sites so that a free site will be deactivated if you wish to do so.

  • Sybre Waaijer
    • The Incredible Code Injector

    Found a "bug" in 1.1.0.

    This bug will cause a discount/subtract for the paid subscription before a manual upgrade.
    Only happens when you issue a manual upgrade which is quite unlikely for a customer.

    Will update to 1.2.1 with a fix. 1.2.1 will also include coupon support.
    You can expect this update at the end of next week.

    • Sybre Waaijer
      • The Incredible Code Injector

      Been super-busy with a lot of things. Learnt a lot in that process.
      So you guys can expect a user interface in the next update.

      I'm going to skip 1.2.1 for now, sorry :slight_frown:
      The next update has no ETA yet.

      To replicate the current bug:
      1. A user subscribes/upgrades and chooses a non-free subscription.
      2. You upgrade/downgrade his subscription manually (extending doesn't effect this bug as much)
      3. The user still gets the discount/subtract calculated from his previous purchase through GForms (payment_price / payment_period_in_days * time_left_in_days_flat).

      I know, it's not a big deal and as said before: quite unlikely. Just so you know :slight_smile:
      Most of the time I can image you guys manually upgrade or downgrade someone is because you know him/her. Especially for extending.
      So please don't throw rocks at me :'(

    • Sybre Waaijer
      • The Incredible Code Injector

      Hi @Jaime :slight_smile:

      Sure! The quarterly and yearly sections listen to "term3months" and "term1year" respectively as a value from Gravity Forms. They won't get processed if those variables aren't assigned and thus not send to the PHP file, so leaving them out in Gravity Forms will do the trick as well :slight_smile:

      If you have any other questions or uncertainties feel free to ask :slight_smile:

      Hope you have a great week!

  • Gudmundur
    • Site Builder, Child of Zeus

    Hi @Sybre and thank you for this awesome plugin.

    I just created my own form and everything is working perfectly but i just have one question about this, i use stripe and "termmonth". What happen after exactly one month? i know stripe will process the payment but will the users site also be extended for another month? is that working now like that?

    Hope you have a great week!

    • Sybre Waaijer
      • The Incredible Code Injector

      Hi @Gudmundur

      The plugin in this post doesn't talk to the payment plugins, so the user's blog will be set to free after one month while the payment still continues.
      The best thing would be to set the term for the user to as high as the user is (going to) pay for.

      I know the PayPal plugin has a feature that talks to the User Registration Plugin from Gravity Forms, this way you can deactivate the blog if no payment has been processed automatically.
      I'm not sure about Stripe.

      I hope this informs you well enough. Feel free to ask any (follow-up) questions :slight_smile:

      Have a great week :slight_smile:

  • Sybre Waaijer
    • The Incredible Code Injector

    Bug: I noticed that enabling the Trial function in /wp-admin/network/admin.php?page=psts-settings will make the Pro Sites registration form not work as intended.

    Please make sure that the Trial is disabled :slight_smile:
    This can't be easily fixed within the plugin without rewriting classes within Pro Sites (I think, that's the way WPMUdev writes code) so I'll leave it as is :slight_smile:
    I can however put a check for it to notify you but that's a different story. :smiley: Will put this into my to-maybe-do list.

  • Sybre Waaijer
    • The Incredible Code Injector

    Note in prositeupgrade.php (I already informed this in the file on line 88)
    If the user has extended their subscription past 2 years they'll be booted to the home page without seeing a confirmation.

    To avoid this bug (which is rare, why would anyone extend past 2 years? lol) set the Confirmation to a redirect or page (not text) in /wp-admin/admin.php?page=gf_edit_forms&view=settings&subview=confirmation&id=YOURFORMID

    :slight_smile:

    Another fix would be, not recommended:
    Change the time on line 88 in prositeupgrade.php
    $max_1_year = time() + 63115200
    time() = now
    63115200 = roughly 2 years in seconds with leap seconds calculated.

    I would also like to say that this is the first elaborate plugin I wrote, and now I'm working on it again I see that there are a few things overlooked. If you notice anything please let me know :slight_smile:

    EDIT

    I just came up with a better solution. Will keep you guys posted.

  • Sybre Waaijer
    • The Incredible Code Injector

    Hi @Linda

    It's been a long time ago since I made this plugin but I thought I initially made it for 1.8 indeed.

    Just note that it's always best to have the latest version installed (of any plugin), Gravity Forms 1.9.0 and upwards came with a lot of security updates.

    Hope you'll enjoy your day! :slight_smile:

  • antKat
    • HummingBird

    Hi Sybre,
    Thank you for the plugin. Before installing it, I have a couple of questions regarding functionality. I've read that your primary reason for creating it was because of the Pro Site gateway limitation. I will be using PayPal, so that is not the reason for my interest. I'm most interested in the form user interface customization and I really like how you have designed and styled the layout of your form! From reading through the thread I am not sure how your plugin integrates with Pro Sites and what functionality remains with Pro Sites and what is carried out with your plugin. I already have Gravity Forms Registration Form and Feed setup.

    As a second question, I am also trying to add custom User Meta fields that will save to profile. How do you handle custom user meta fields?

  • Sybre Waaijer
    • The Incredible Code Injector

    Hi antKat,

    Thanks! I really spent a good few weeks on getting the layout right (including mobile) :slight_smile:

    You're at the right place for custom form integration with Pro Sites.

    First question:
    All functionality within Pro Sites remains, this little plugin just injects the Pro Site registration and the timestamp (UNIX) in the database.

    The Pro Sites Upgrade form takes data from Pro Sites and manipulates it to form a very advanced form, which later, after all fields have been correctly filled in, it will inject a new expiration data and add used payment information for the upgrade form to later re-use and calculate.

    Second question:
    Custom Meta fields have been handled through a mu-plugin. This plugin is private, but you simply need to register the user meta once for Gravity Forms to recognize its existence. From there Gravity Forms can inject the fields into the user's meta.

    https://codex.wordpress.org/Function_Reference/add_user_meta

    Final Notes:
    Unfortunately, I'm currently swamped with projects so I'm unable to assist you in detail.
    Luckily the registration form is exactly what you're looking for and it's quite small. With a little PHP experience you will be able to integrate it.

    I hope this helps! Thanks and have a great day :slight_smile:

  • jetmac
    • Recruit

    Tyler Postle

    Sure would be nice to see this capability brought into the actual plugin -- perhaps as an Add-On of some kind?

    A lot of people use Gravity Forms for new members instead of the core wordpress registration -- easier to control and more secure.

    Blog Templates was integrated into Gravity Forms User Registration a little while ago and works great (we use it on our system) -- any chance this could be as well?

    Thanks,
    Rob

  • Sybre Waaijer
    • The Incredible Code Injector

    This plugin has been written right at the point of when I started to learn PHP.

    From there, I now have learned a lot more "trade secrets" which allows me to add and maintain options within WordPress. If I knew them back then, I would've certainly enjoyed to add such functionality.
    Unfortunately, I can't find the time to integrate this as I've moved on to other projects. Nevertheless, I'm very willing to cooperate with any other developer to make this happen, but I do need to cut my time.

    If anyone's in, feel free to contact me. We might even learn a thing or 10 from each other :slight_smile:.

  • Urbano
    • The Incredible Code Injector

    Hi there super heroes.

    There are a lot of people asking for this kind of integration for Pro Sites, please add this plugin as an official feature as soon as possible.

    I'm pretty sure this will be very well received by the community.

    Hope we can get positive feedback about this.

    Keep up the good work you've been doing with this awesome community! :beer:

  • SqueakyOx
    • The Incredible Code Injector

    i'm with Urbano on this!

    pro-site is great - but it need to be a little more customisable to be flexible enough to cater for a wider range of applications. There's no other plugin quite like this. I know you guys are busy with other plugins but don't forget this one!

    Cheers..

  • SqueakyOx
    • The Incredible Code Injector

    Hi all,

    Just want to update you guys, the plugin for registration will not work out of the box anymore because they the new version of gravity form has updated the user registration add on.

    Will let you know once i tinker more!

    Cheers

      • SqueakyOx
        • The Incredible Code Injector

        hi Urbano!

        I don't want to get into a "i say you say" kinda fight but i never said it didn't work. I said it doesn't work out of the box anymore.

        I had a fresh install of WP, Gravity forms and everything - the .json file did not properly populate the add-on tab at all. With a little tweaking (and populating the add-on tab) it did however work just fine!

        Have a good day!

          • SqueakyOx
            • The Incredible Code Injector

            Hi Sybre Waaijer ,

            Okay.. just a few notes from me, feel free to ask away if you need to. As of right now, i've just completed tinkering with the registration plugin only. I wanted to see (since the plugin hasn't been updated for a while) if everything still checked on the coding leel. Short answer = yes it did!

            Again big big thanks to Sybre for them excellent code (and the 1.2 update for the time period issue). Though i might had used a switch instead of a big if loop to get the $timeperiod - but hey if it works, i ain't going to touch it.

            Sorry for the long post already. BUT the problem from the fresh install is that the .json file was built i believe of a v1.9Beta? so on the new v.2.0.7.2 & rego addon v.3.4 - the json file is basically out of date.

            So a few things (to get the form in working order - not super flash):

            1. For the form to show the "submit" and the bottom: You need to get to Settings -> Form Settings -> Form Button. And under the conditional logic section change the value to english instead of dutch.

            2. Populating the User Registration Tab: Get to Settings -> User Registration -> Add New -> Action is: Create User -> FILL UP ALL INFO -> Save (Note: i was initially confused about 'Site Title' because the form does not have this field - so you can username or domain to substitute until custom the form)

            3. Resync Field IDs: Herein lies the biggest problem. You need to find out the field IDs for: prositelevel and 3 time periods. Originally its at 12, 17, 18, 19 but when i remapped i got 8,9,10,11 instead. So open up the .php file (in your plugin directory) and change those values and you should be good to go!

            Thanks for Sybre again for the great piece of code.

            Since playing around with this - ive come to a conclusion that i may not require this plugin after all - but since i've come this far - i might change it to only insert a 3 month period (to replace for trial).

            Happy hunting and i'm all ears to answer your any questions.

  • SqueakyOx
    • The Incredible Code Injector

    Hi all,

    I've taken Sybre registration plugin and basically created a trial registration plugin for 14 days. This is for users to signup clean and quickly for a trial so that you can capture customer quicker.

    Technotes: You can adjust the: 1, length of trial 2, which level trial all in code.

    MAJOR NOTICE: The trial plan plugin will not work parallel to the original registration plugin!

    I have forked Sybre project here: https://github.com/Squeakyox/gf-prosites . I have no idea how to use GitHub (so Sybre if ive done something wrong let me know!).

    I've included code and a very basic working JSON file. To my knowledge and testing, everything works (and yes, including with new blog templates plugin too).

    Cheers! And have a good one.

    P/s: Major thanks to Sybre again!!

  • SqueakyOx
    • The Incredible Code Injector

    Hi Sybre Waaijer

    ive finally found time to go through the other plugin now - however a few things:

    1. Won't work out of the box again - json problems (kinda expected because of version differences)

    2. Have a question:

    $user_mapped_url = !empty($mapped_domain) ? $mapped_domain : strstr(substr($user_blog_url, $striphttp), '/', true);

    I'm trying to figure out what the above does.

    I understand that:
    $mapped_domain = http://my_mapped_domain.com
    $user_blog_url = http://user_url.masterdomain.com

    but currently when i run the code, $user_mapped_url show a blank. A little help?

    PS: Does this work the same?

    if (is_ssl() == true) {
    	$striphttp = 7;
    } else {
    	$striphttp = 6;
    }
    
    if (!empty($mapped_domain) == true) {
    	$user_mapped_url = substr($user_blog_url, $striphttp;);
    } else {
    	$user_mapped_url = substr($mapped_domain, $striphttp;);
    }

    Thanks

    SqueakyOx

    • Sybre Waaijer
      • The Incredible Code Injector

      Hi SqueakyOx,

      I have no idea why I ever used "strstr", the way I used it is also incompatible with PHP5.2.99 or lower.

      You can test if your code works by dumping its contents. Through print_r(), var_export() or var_dump() (I prefer the latter).
      If the dumping occurs on navigation, be sure to use "exit;" or "die;" right after, so the navigation stops and the code output will be shown on the screen.

      My suggestion would be (in 2 lines and optimized with a few bugs fixed):

      $user_mapped_url = $mapped_domain ? $mapped_domain : $user_blog_url;
      $user_mapped_url = str_replace( array( 'http://', 'https://' ), '', $user_mapped_url );

      Cheers!

      P.S. "== true" can be omitted. It's not "type sensitive" and it's (from my memory) 2x slower than just doing "if ( is_ssl() ) { ..code.. } else { ..code.. }.
      In the comparison chart below you can see that "== true" checks for more than 6 types and it will go through them in a certain order (boolean is passed first).
      "=== true" will check for only one type (much much faster).
      <PHP comparison chart>
      <My benchmarks>.

      P.P.S. I think code evaluation is best discussed through a GitHub issue on the provided repository :slight_smile:.

      • SqueakyOx
        • The Incredible Code Injector

        hi Sybre Waaijer ,

        Thanks for the 2 two lines! was scratching my head for a few moments there! In short, your code work whilst my code is probably not the most elegant.

        I'm kinda slowly learning PHP - i originally only learned JAVA (and that was when the SDK was v5) - so some of the functions throw me off - and i have to contstantly refer to the php indexes.

        The one that throws me off is (example)
        ' $blah = is_ssl() ? 7 : 6;'

        Cause i don't think that applies in java (maybe cause java is stricter?). In summation that would be if, condition is true, =7, else =6...?

        Anyways thanks again!!

        Ps: the solution works for both mapped domains and subdomain URLS.

  • SqueakyOx
    • The Incredible Code Injector

    Hi all,

    I just wanted to share that i've taken Sybre's upgrade plugin and turned it into a manual upgrade form - which can replace the current manual purchase system for pro-site.

    If anyone wants it - i will be willing to share my complete undocumented code to anyone!

    Thanks again Sybre!!

    P/s: I'm working on my the next plugin for payment confirmation form (for prosite manual payment) let me know if anyone is interested in that too!

  • SqueakyOx
    • The Incredible Code Injector

    HI All,

    Just updating for the sake of completeness now - i've updated my plugin for v2.1.0.1 of gravity forms.

    We're at v.0.0.4 - for CSS layout issues - because of gravity form update.

    Code available on github!

    Cheers - have a good one.

  • antKat
    • HummingBird

    @SqueakyOx - thank you for your continued work on this plugin. I tried to get this to work for me last December but after spending substantial time on it without success, gave up.

    I do have a Gravity Forms registration set up and Pro Sites but they do not work together. In other words, I've had to set the Pro Sites to a trial so that the site gets created using Gravity Forms then afterwards, the account processing can take place.

    I do not want to provide a trial period so I need to re-visit this plugin. Would you be willing to help me accomplish this?

    Also, I would like to use an alternate affiliate program rather than WPMUdev Affiliates that integrates with Gravity Forms, I'm trying to understand if your GF integration plugin would require an Affiliate program that has integration with Pro Sites or Gravity Forms. Based on your knowledge of this, what are your thoughts?

    • SqueakyOx
      • The Incredible Code Injector

      hi antKat

      Sorry for the late reply, been in the epicentre in cold and flu season this last week - so i blame my tardy reply on medical grounds.

      In short it seems to me that you're trying to accomplish 2 things:

      1. Create a prosite based plugin for your user to create the website and charge for the set period at the same time?

      If so, my 2 plugin (1 for sign up, 1 for manual payment - 2 forms) only takes in manual payments at the moment, it wasn't designed for anything else. So what you can currently do is:

      a. Let the user create the site and choose their payment plan (for a limited time say, 24hrs)
      b. Spit them a manual bill (via email)
      c. Wait for them to pay - by cash, bank transfer, whatever_
      d. fix up the account after payment.

      We might be able to tag paypal into it (something which i'm exploring right now) - but this will be a duplication of function with pro-site (and it doesn't have recurring payments) but for aesthetic & customization sake it might be a better. Let me know if you're interested in that.

      2. Affilate program integration - how in depth do you require this? could you just replace this with couponing instead?

      Note: i havnt meddled with the affliate programs vs prosites before - not even a the wpmudev version. But what values are you trying to parse along?

      Sorry for being late!

      Cheers - have a good one.

  • Jason
    • The Incredible Code Injector

    Hi!

    I probably missed something somewhere but the shortcode, [redirect-to-gforms-upgrade], redirects to the homepage. I've defined the upgrade url on line 71. Has anyone else experienced this?

    Here's what I have:

    function add_prosite_redirect_shortcode() {
    if (!is_user_logged_in() ) {
    wp_redirect(home_url()); exit;
    } else if (!is_super_admin()) {
    wp_redirect(home_url('/upgrade/')); /* change to your gform upgrade page */
    /* wp_redirect(home_url('/examplepage/')); */
    exit;
    }
    }

    Thanks,

    Jason

  • Guido
    • Flash Drive

    Sybre Waaijer Hi Sybre, is there any chance that you are going to update the plugins? I still seems like the only option to use it with ideal. I am also from the netherlands and relying on it very much! It seems like wpmudev is not going to do anything about it.

    Would be great if you update it again! I am willing to pay for it!

    Regards, Guido

  • Urbano
    • The Incredible Code Injector

    Hi there guys,

    Does this plugin stopped sending the Activation E-mail in the last months?

    I'm having this problem, and I can see some errors on debug file. I'll post it here, sorry it's in Portuguese.

    [26-Nov-2017 18:28:40 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:28:40 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:28:56 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:28:56 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:29:13 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:29:13 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:29:28 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:29:28 UTC] PHP Notice: wpdb::prepare foi chamada incorrectamente. A consulta não contém o número correcto de placeholders (6) para o número de argumentos passados (7). Por favor veja Depuração no WordPress para mais informações. (Esta mensagem foi adicionada na versão 4.8.3.) in /home/cloudstore/public_html/wp-includes/functions.php on line 4145
    [26-Nov-2017 18:35:25 UTC] Erro na base de dados do WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2 na query SELECT * FROM clost_75_posts
    WHERE ID IN ( ) feita por do_action('toplevel_page_gf_edit_forms'), WP_Hook->do_action, WP_Hook->apply_filters, GFForms::forms, GFFormSettings::form_settings_page, do_action('gform_form_settings_page_gravityformsuserregistration_pending_activations'), WP_Hook->do_action, WP_Hook->apply_filters, GF_Pending_Activations->form_settings_page, GF_Pending_Activations::get_page_content, GF_Pending_Activations::handle_submission, GFUserSignups::activate_signup, GF_User_Registration->create_user, do_action('gform_user_registered'), WP_Hook->do_action, WP_Hook->apply_filters, GF_User_Registration->create_site, wpmu_create_blog, do_action('wpmu_new_blog'), WP_Hook->do_action, WP_Hook->apply_filters, blog_templates->set_blog_defaults, NBT_Template_copier->execute, NBT_Template_copier->copy_menus, NBT_Template_copier->copy_menu
    [26-Nov-2017 18:35:25 UTC] Erro na base de dados do WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2 na query SELECT * FROM clost_75_postmeta
    WHERE post_id IN ( ) feita por do_action('toplevel_page_gf_edit_forms'), WP_Hook->do_action, WP_Hook->apply_filters, GFForms::forms, GFFormSettings::form_settings_page, do_action('gform_form_settings_page_gravityformsuserregistration_pending_activations'), WP_Hook->do_action, WP_Hook->apply_filters, GF_Pending_Activations->form_settings_page, GF_Pending_Activations::get_page_content, GF_Pending_Activations::handle_submission, GFUserSignups::activate_signup, GF_User_Registration->create_user, do_action('gform_user_registered'), WP_Hook->do_action, WP_Hook->apply_filters, GF_User_Registration->create_site, wpmu_create_blog, do_action('wpmu_new_blog'), WP_Hook->do_action, WP_Hook->apply_filters, blog_templates->set_blog_defaults, NBT_Template_copier->execute, NBT_Template_copier->copy_menus, NBT_Template_copier->copy_menu
    [26-Nov-2017 18:35:25 UTC] Erro na base de dados do WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2 na query SELECT * FROM clost_75_posts
    WHERE ID IN ( ) feita por do_action('toplevel_page_gf_edit_forms'), WP_Hook->do_action, WP_Hook->apply_filters, GFForms::forms, GFFormSettings::form_settings_page, do_action('gform_form_settings_page_gravityformsuserregistration_pending_activations'), WP_Hook->do_action, WP_Hook->apply_filters, GF_Pending_Activations->form_settings_page, GF_Pending_Activations::get_page_content, GF_Pending_Activations::handle_submission, GFUserSignups::activate_signup, GF_User_Registration->create_user, do_action('gform_user_registered'), WP_Hook->do_action, WP_Hook->apply_filters, GF_User_Registration->create_site, wpmu_create_blog, do_action('wpmu_new_blog'), WP_Hook->do_action, WP_Hook->apply_filters, blog_templates->set_blog_defaults, NBT_Template_copier->execute, NBT_Template_copier->copy_menus, NBT_Template_copier->copy_menu
    [26-Nov-2017 18:35:25 UTC] Erro na base de dados do WordPress You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2 na query SELECT * FROM clost_75_postmeta
    WHERE post_id IN ( ) feita por do_action('toplevel_page_gf_edit_forms'), WP_Hook->do_action, WP_Hook->apply_filters, GFForms::forms, GFFormSettings::form_settings_page, do_action('gform_form_settings_page_gravityformsuserregistration_pending_activations'), WP_Hook->do_action, WP_Hook->apply_filters, GF_Pending_Activations->form_settings_page, GF_Pending_Activations::get_page_content, GF_Pending_Activations::handle_submission, GFUserSignups::activate_signup, GF_User_Registration->create_user, do_action('gform_user_registered'), WP_Hook->do_action, WP_Hook->apply_filters, GF_User_Registration->create_site, wpmu_create_blog, do_action('wpmu_new_blog'), WP_Hook->do_action, WP_Hook->apply_filters, blog_templates->set_blog_defaults, NBT_Template_copier->execute, NBT_Template_copier->copy_menus, NBT_Template_copier->copy_menu
    [26-Nov-2017 18:35:25 UTC] PHP Notice: Undefined offset: 10 in /home/cloudstore/public_html/wp-content/plugins/prositesregistration/prositesregistration.php on line 25

    Any feedback on how to solve this? Thank you!

  • SqueakyOx
    • The Incredible Code Injector

    Hi Urbano & Sybre Waaijer ,

    Sorry for not getting to this sooner (been uber busy). Long story short, i've not been maintaining the plugin because i no longer use it - but from the looks of it (and all the errors its spitting out from you), I kinda agree with Sybre on this. It looks like an incompatibility because of WP & GF updates. From the last few errors, I would go along trying to figure out if GF has updated their hooks first. I can't do it because i no longer have updated version of GF. From there, it looks like a cascading error list stemming from the fact that GF has probably updated the hooks (perhaps a few more/less variable req).

    Good Luck! And sorry i couldn't be of more help.

    Squeaky Ox

  • blue
    • Design Lord, Child of Thor

    Just double checking I've read everything right through this thread - this is no longer maintained and is no longer a viable solution for replacing the default Pro Sites registration process? If not does anyone know if any current products that are attempting to integrate a new form process (doesn't have to be gravity forms necessarily.)

    Thanks!

  • Kasia Swiderska
    • Support nomad

    Hello blue,

    Just double checking I've read everything right through this thread - this is no longer maintained and is no longer a viable solution for replacing the default Pro Sites registration process?

    Seems that this is correct (SqueakyOx is no longer active member on forum).

    If not does anyone know if any current products that are attempting to integrate a new form process (doesn't have to be gravity forms necessarily.)

    We are actually planning to add a registration form to our Forminator (and also and API so it will be easier to connect it with other plugins/services). But because it is still work in progress then I suggest also asking on Members forum if anyone has already made this integration https://premium.wpmudev.org/forums/forum/members

    kind regards,
    Kasia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.