WordPress.org

Forums

Shorten2Ping 1.4.4: have shorter selfdomain + typo in code (1 post)

  1. diablodale
    Member
    Posted 5 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 5 years ago by diablodale
  • This topic is not a support question
  • WordPress version: 2.9.2