1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

WordPress Domain Checker Plugin

Discussion in 'PHP' started by Vick.Kumar, Mar 26, 2013.

  1. #1
    Hi,

    I recently started my portfolio site, and started to develop some scripts to put on there. The first script I decided to put on there was a WP Plugin, as WP is major, I though why not try and learn WP Plugin Development.

    I developed this simple PHP based Domain Checker which lets you use the short code to put on any page or post to check the availability of a domain, this can be perfect if you run a web hosting service or a web tools service which uses WordPress.

    Feel free to modify, etc 'cause you may have to re-design it so it blends into your website. THE REASON I'M SHARING THIS HERE IS BECAUSE, I would like to gain recognition as a PHP Developer. I'm not interested in "likes" (inb4 Sarah decides to put me down). I just felt this plugin might help developers, users out there.

    http://vickkumar.com.au/wordpress-domain-checker-plugin-2/
    ^ Live Demo, also includes download link
     
    Vick.Kumar, Mar 26, 2013 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    Whats the deal with you putting your name to other peoples scripts and then you say...
    ereg
    PHP:
    ..at least update them and give the original author some credit.
     
    MyVodaFone, Mar 26, 2013 IP
  3. Vick.Kumar

    Vick.Kumar Active Member

    Messages:
    138
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    90
    #3
    What's the deal with you posting replies to put people down?
    At least post something constructive rather than assuming the whole code is stolen or "other peoples scripts", is that how you got over 1000 posts?

    So searching php.net manuals for guides on how to do specific tasks and writing it from scratch while using snippets is "using other peoples scripts"?

    So technically every developer in the whole world is using someone elses script? because for example a "function" is a part of a script, and if someone uses that same function they're using parts of someone elses script? wow you're smart !
     
    Vick.Kumar, Mar 26, 2013 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    ereg is a function an outdated one at that, what you've done is copied a script (not a function) and claim to be the author... that's my query and nothing else...
    If you were serious about been a developer, as said above... at least study the code you copied, improve upon it and post the original source url... so there's no repercussions.

    Contributing to the forum is all well and good... but on this occasion.. its just bull, keep trying though.

    One of the original codes from 2007
    if ($_POST['domain']) {
        $domain = $_POST['domain'];
        if (ereg("[A-Za-z0-9]+[A-Za-z0-9-]*[A-Za-z0-9]+\.[a-z]{2,10}", $domain)) {
            $query_array = dns_get_record($domain, DNS_NS);
            if ($query_array) {
     
                print "<DIV CLASS='lookupresults'><P><FONT CLASS='taken'>Sorry.</FONT> The domain <B>$domain</B> is already registered and is pointing to the following DNS servers:<BR><UL>";
    PHP:
    ..and yours reads in 2013
    if ($_POST['domain']) {
        $domain = $_POST['domain'];
        if (ereg("[A-Za-z0-9]+[A-Za-z0-9-]*[A-Za-z0-9]+\.[a-z]{2,10}", $domain)) {
            $query_array = dns_get_record($domain, DNS_NS);
            if ($query_array) {
     
                echo "$domain is not available!";
    PHP:
     
    Last edited: Mar 26, 2013
    MyVodaFone, Mar 26, 2013 IP
  5. Vick.Kumar

    Vick.Kumar Active Member

    Messages:
    138
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Hey,

    Thank's. I've started to write a custom one from scratch, it supports the top 5 tld's instead. It seems to be much quicker too. I'll post it up soon, just fixing up validations.
     
    Vick.Kumar, Mar 26, 2013 IP
    MyVodaFone likes this.
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #6
    really? I'm that awful? Or is there another Sarah on here whose thunder I'm stealing?

    My main recommendation is to use a unique namespace for your functions. If you search up plugin writing tutorials you should find a fair number that recommend not calling your functions wp_domainchecker but to go for something like vk_domainchecker or even vickkumar_domainchecker. This prevents possible clashes with other functions. You might think that's unlikely but it's still "best practice".


    If I was to use your plugin (and I won't be) the first thing I'd do is take off the blatant plug below the form - the place to do that is within the plugin documentation and on the plugin info page in the admin section. Don't use plugins as a way to link build.
     
    sarahk, Mar 26, 2013 IP
  7. Vick.Kumar

    Vick.Kumar Active Member

    Messages:
    138
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    90
    #7
    Hi,

    Thank's Sarah, (I was referring to the time when I posted source and you gave me a mini lecture). Everything you just wrote makes sense, and is useful thanks.

    I wasn't thinking about the namespace at the time of turning base code into a plugin, and you're right I guess the link building does look a bit dodgy (lol). Thank's though. I really appreciate long responses.
     
    Vick.Kumar, Mar 26, 2013 IP