Forums

Mini twitter feed
[resolved] Error Handling (4 posts)

  1. Dani-Girl
    Member
    Posted 10 months ago #

    Is there a error message or detection that appears if Twitter feeds go down and won't display?

    Is it possible to add this into the existing code, so visitors will not be met with a blank area?

    http://wordpress.org/extend/plugins/mini-twitter-feed/

  2. hectopod
    Member
    Plugin Author

    Posted 10 months ago #

    No, there is no message. It is possible to add it, maybe it will be added in the next update.

  3. avioli
    Member
    Posted 10 months ago #

    By enabling WP_DEBUG inside your wp-config.php you'll notice several errors within your plugin code:

    Function form inside the MinitwitterWidget class doesn't initialise the variables of the $instance:

    function form($instance) {
    $instance = array_merge( array(
     'username' => ''
     ,'limit' => ''
     ,'list' => ''
     ,'query' => ''
    ), (array)$instance );
    ?>

    Same thing with the widget function within the same class. This won't even show as an error, since as soon as you instantiate the widget into a sidebar it's default values are saved. At least check for empty(). BTW if you have WP_DEBUG turned on the default values are the error notices!

    Thank god that shortcode_atts() deals with this on its own.

    And the last one - this line: add_shortcode('minitwitter', mtf_create_shortcode); should have quotes:add_shortcode('minitwitter', 'mtf_create_shortcode');, otherwise the second argument is considered an undefined constant, and yields an error notice. It's a notice, since undefined constants default to their names as strings.

    Cheers.

  4. hectopod
    Member
    Plugin Author

    Posted 10 months ago #

    Thank you for your messages I will take a look and update it.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.