• code

    Object-Oriented JavaScript

    First a caveat: JavaScript is a prototype-based language, not an object-oriented language.  Now that we have an understanding of that very important fact, let’s learn how to use JavaScript as if it were object-oriented. A few weeks ago, I was asked to teach a couple of my colleagues how to code with JavaScript.  We’re building…
    Read More

    Dec
    21

    Apple Patents Multi-tasking

    The Apple-vs-Google-vs-EveryoneElseInTheWorld patent battle has gotten beyond ridiculous.

    I just read that Apple’s latest patent victory is for:

    A portable electronic device displays, on a touch screen display, a user interface for a phone application during a phone call. In response to detecting activation of a menu icon or menu button, the UI for the phone application is replaced with a menu of application icons, while maintaining the phone call. In response to detecting a finger gesture on a non-telephone service application icon, displaying a user interface for the non-telephone service application while continuing to maintain the phone call, the UI for the non-telephone service application including a switch application icon that is not displayed in the UI when there is no ongoing phone call. In response to detecting a finger gesture on the switch application icon, replacing display of the UI for the non-telephone service application with a respective UI for the phone application while continuing to maintain the phone call.

    In plain English – Apple has patented the feature where you can switch to another app on a device while maintaining a phone call.  Considering that the phone system on an iPhone is, itself, an app on the device this means that Apple has laid the foundation for patenting the ability to switch from one app to another without turning either one off.

    Haven’t we been doing this for years already?

    Does the fact that one of the apps is a phone app really make this a unique, non-obvious invention or innovation?

    I would argue no.  And even though I am not a lawyer, I stick by that argument.

    Nothing in Apple’s patent application seems to be anything more than an “ante-in” offering for any sophisticated electronic device.  The fact that they can now, legally, prevent other software developers from releasing a feature we already have, use, and expect from even entry-level offerings is, in a word, laughable.

    My prediction: Apple’s next patent attempt is for a handheld computer capable of also making phone calls.  Really, that patent would be no less legitimate than the one they were just awarded …

    Dec
    16

    Should Free Software Have Free Support?

    I do professional (paid) consulting for WordPress.  But I also write and distribute free plugins and themes for WordPress.  My paid business depends a lot on my reputation on the free side of things.

    And that’s where I face a dilemma.

    A lot of people use my free stuff.  And several of them come to me from time to time asking for new features, bug fixes, or just regular “I can’t figure this out” support.  Up ’til now, I’ve offered that support for free.

    And that’s proven to be a bad idea.

    So my question to you, how much is reasonable to charge for ongoing development and support?

    Please complete the following survey to share your thoughts on how much (if anything) is reasonable to charge for support, on-going development, and feature requests when it comes to open source software. 1

    Complete the survey through Google Docs

    To say “thank you” I’ll be giving away a handful of Amazon.com gift cards to those who complete the survey.  How many I give away and the exact amount on each card will depend on how many people complete the survey.

    Notes:

    1. For the record, I will not stop giving away free software.  I’m just considering a few different ways I can continue to earn a living while doing it.
    Dec
    15

    Finally! Microsoft Decides to Auto-Update IE

    I’ve always been a fan of the way Chrome automatically updates itself.  New features come on line as soon as they’re ready and much of the emerging HTML5 standard just works.

    Even Firefox has changed their release schedule to push out updates more frequently.  And for those of you who don’t know, when Firefox ships a new version, they cut off support for older versions.

    From a web development standpoint, this is fantastic.  It means you can use cutting-edge technologies as soon as they’re ready and you don’t need to worry about supporting clunky, legacy browsers.

    Unless you’re supporting Internet Explorer.

    Well, until now.

    Microsoft announced today that, starting next year, they will “automatically upgrade Windows customers to the latest version of Internet Explorer available for their PC.”

    My thoughts on this development?  It’s about ****ing time!

    IE to Start Automatic Upgrades across Windows XP, Windows Vista, and Windows 7

    Everyone benefits from an up-to-date browser.

    Today we are sharing our plan to automatically upgrade Windows customers to the latest version of Internet Explorer available for their PC. This is an important step in helping to move the Web forward. We will start in January for customers in Australia and Brazil who have turned on automatic updating via Windows Update. Similar to our release of IE9 earlier this year, we will take a measured approach, scaling up over time.

    As always, when upgrading from one version of Internet Explorer to the next through Windows Update, the user’s home page, search provider, and default browser remains unchanged.

    [Read the rest of Microsoft's announcement on the Windows Team Blog ...]

    Dec
    10

    I’ve Still Got It!

    Every now and then, someone asks me whether or not I still have quality WordPress development skills.  I think it’s a fair question.  After all, I spend the bulk of my time now working with closed-source ASP.Net projects and have little time for my favorite WordPress stuff.

    But really, much of what I do in the .Net arena is pretty transferable.  And – this is me bragging a bit – I’m a good developer no matter what language or paradigm I’m working with.

    There’s been a lot of talk about WordPress 3.3 coming out soon.  And a lot of that talk has been about the number of contributions and contributors to the project.  I’m proud to say that I’m in that group – I’ve had a patch in every major version of WordPress since version 2.8!

    And I want to show that off. [Read more...]

    Nov
    28

    WordPress Portland

    As promised, here is the code for my demo of adding feature pointers to WordPress in version 3.3

    And again, please do not use these in distributed plugins/themes.  They’re only slated for Core at the moment, but if you feel that they’ll help in your custom theme/plugin development with clients, feel free!

    <?php
    /*
    Plugin Name: WordPress Portland Meetup Pointer Demo
    Plugin URI:
    Description: Demonstrate feature pointers in WP 3.3
    Author: Eric Mann
    Version: 1.0
    Author URI: http://eamann.com
    */


    add_action( 'admin_enqueue_scripts', 'pdxwp_pointers_header' );
    function pdxwp_pointers_header() {
        $enqueue = false;
       
        $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
       
        if ( ! in_array( 'pdxwp_pointer', $dismissed ) ) {
            $enqueue = true;
            add_action( 'admin_print_footer_scripts', 'pdxwp_pointers_footer' );
        }
       
        if ( $enqueue ) {
            // Enqueue pointers
            wp_enqueue_script( 'wp-pointer' );
            wp_enqueue_style( 'wp-pointer' );
        }
    }

    function pdxwp_pointers_footer() {
        $pointer_content = '<h3>Welcome WordPress Portland!</h3>';
        $pointer_content .= '<p>This is an example of an admin pointer.</p>';
        $pointer_content .= '<p>You can use it in your <a href="http://wordpress.org/extend/themes">themes</a> ';
        $pointer_content .= 'and <a href="http://wordpress.org/extend/plugins">plugins</a>.</p>';
    ?>
    <script type="text/javascript">
    //<![CDATA[
    jQuery(document).ready(function($) {
        $('#menu-comments').pointer({
            content: '<?php echo $pointer_content; ?>',
            position: {
                edge: 'left',
                align: 'center'
            },
            close: function() {
                $.post( ajaxurl, {
                    pointer: 'pdxwp_pointer',
                    action: 'dismiss-wp-pointer'
                });
            }
        }).pointer('open');
    });
    //]]>
    </script>
    <?php
    }

    ?>
    Nov
    21

    Security Vulnerabilities

    Out of the blue today, a user of one of my plugins contacted me to ask why I was so slow in patching a security vulnerability in my system.

    The question came as a complete surprise.

    Apparently, back in January, someone discovered a potential security hole in one of my plugins, WP Publication Archive.  The frightening thing about the report, though, was the fact that he never bothered to report the vulnerability to me so I could fix it.  Instead, an open report sat there on his site, and was then picked up by a few other security sites and syndicated across the Internet.

    Had this user not contacted me, I would never had known about this issue.  And I can’t fix something if I don’t know it’s broken.

    The Hole

    WP Publication Archive uses a proxy file to load a remote file as an attachment so it can be downloaded by the browser.  Here’s the entire source of the “vulnerable” file: [Read more...]