Support » Plugins and Hacks » Shorten2Ping 1.4.4: have shorter selfdomain typo in code

  • Thank you for this plugin. I have two suggestions for you to consider in your code for 1.4.4.

    On line 194:
    $s2p_blog_url = get_bloginfo(url);
    should be
    $s2p_blog_url = get_bloginfo('url');

    On line 196, you assume the blogurl doesn’t end in a slash. This may not be true. You could therefore creating a short url with two slashes //. In addition, you don’t have to have a slash after the domain name and can instead leverage the ? as the delimiter. This will same you one character (and every character helps in systems like twitter).

    $short_url = $s2p_blog_url . '/?p=' . $post_id;
    could be:
    $short_url = ((substr( $s2p_blog_url, -1 ) == '/') ? substr( $s2p_blog_url, 0, -1 ) : $s2p_blog_url) . '?p=' . $post_id;

    http://wordpress.org/extend/plugins/shorten2ping/

  • The topic ‘Shorten2Ping 1.4.4: have shorter selfdomain typo in code’ is closed to new replies.