Note that there are some explanatory texts on larger screens.

plurals
  1. POThe plugin generated xxx characters of unexpected output during activation
    primarykey
    data
    text
    <p>I am creating WordPress plugin to display Total Twitter counter &amp; Feed Subscriber. You can manage it via widget.</p> <p>I am getting this error.</p> <p><strong>The plugin generated 123 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.</strong></p> <pre><code>&lt;?php /* * Plugin Name: Twitter &amp; RSS Stats * Version: 1.0 * Plugin URI: http://sss.com/ * Description: Facebook, Twitter &amp; RSS Social Stats widget &lt;a href="http://jessealtman.com/2009/06/08/tutorial-wordpress-28-widget-api/"&gt;tutorial&lt;/a&gt;. * Author: Ajay Patel * Author URI: http://sss.com/ */ addHeaderCode(); function addHeaderCode() { echo '&lt;link type="text/css" rel="stylesheet" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/TRR_Stats/css/style.css" /&gt;' . "\n"; } /*******************************/ /* Create table */ /********************************/ function my_plugin_create_table() { // do NOT forget this global global $wpdb; // this if statement makes sure that the table doe not exist already if($wpdb-&gt;get_var("show tables like TRR_Stats") != 'TRR_Stats') { $sql = "CREATE TABLE TRR_Stats ( id mediumint(9) NOT NULL, rss_email tinytext NOT NULL, twitter tinytext NOT NULL, rss tinytext NOT NULL, UNIQUE KEY id (id) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } } // this hook will cause our creation function to run when the plugin is activated register_activation_hook( __FILE__, 'my_plugin_create_table' ); class FTRWidget extends WP_Widget { /** * Declares the FTRWidget class. * */ function FTRWidget(){ $widget_ops = array('classname' =&gt; 'widget_hello_world', 'description' =&gt; __( "Example widget demoing WordPress 2.8 widget API") ); $control_ops = array('width' =&gt; 300, 'height' =&gt; 300); $this-&gt;WP_Widget('helloworld', __('Twitter &amp; RSS Social Stats'), $widget_ops, $control_ops); } /** * Displays the Widget * */ function widget($args, $instance){ extract($args); $rss_email = empty($instance['rss_email']) ? 'webdesignergeeks' : $instance['rss_email']; $twitter = empty($instance['twitter']) ? 'webdesignergeek' : $instance['twitter']; $rss = empty($instance['rss']) ? 'webdesignergeeks' : $instance['rss']; # Featch Data from table global $wpdb; $item_info = $wpdb-&gt;get_row("SELECT * FROM TRR_Stats WHERE id=1;"); $rss_email_f = $item_info-&gt;rss_email; $url = file_get_contents('https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=24thfloor'); preg_match( '/circulation="(\d+)"/', $url, $matches ); if ( $matches[1] ) $rss_f = $matches[1] . " Subscribers"; else echo "0"; $twit = file_get_contents('http://twitter.com/users/show/'.$twitter.'.xml'); preg_match( '/\&lt;followers_count\&gt;(\d+)\&lt;\/followers_count\&gt;/', $twit, $matches ); if ( $matches[1] ) $twitter_f = $matches[1] . " Followers"; else $twitter_f = "0"; echo ' &lt;div class="sidebarContainer" id="sidebarSubscribe"&gt; &lt;a target="_blank" href="http://twitter.com/'.$twitter.'" class="subscribeSidebarBox" id="followTwitter"&gt; &lt;span class="icon"&gt;&lt;img src="'.get_bloginfo('url').'/wp-content/plugins/TRR_Stats/img/twitter.png" alt="Twitter" /&gt;&lt;/span&gt; &lt;span class="title"&gt;Follow Us on Twitter&lt;/span&gt; &lt;span class="count"&gt;'.$twitter_f.'+&lt;/span&gt; &lt;/a&gt; &lt;a target="_blank" href="http://feeds.feedburner.com/'.$rss.'" class="subscribeSidebarBox" id="subscribeRSS"&gt; &lt;span class="icon"&gt;&lt;img src="'.get_bloginfo('url').'/wp-content/plugins/TRR_Stats/img/rss_feed.png" alt="RSS"/&gt;&lt;/span&gt; &lt;span class="title"&gt;Subscribe to our RSS feed&lt;/span&gt; &lt;span class="count"&gt;'.$rss_f.'+&lt;/span&gt; &lt;/a&gt; &lt;a target="_blank" href="http://feedburner.google.com/fb/a/mailverify?uri='.$rss_email_f.'" class="subscribeSidebarBox" id="subscribeEmail"&gt; &lt;span class="icon"&gt;&lt;img src="'.get_bloginfo('url').'/wp-content/plugins/TRR_Stats/img/rss_email.png" alt="rss_email" /&gt;&lt;/span&gt; &lt;span class="title"&gt;Subscribe for updates via&lt;/span&gt; &lt;span class="count"&gt;EMAIL&lt;/span&gt; &lt;/a&gt; &lt;/div&gt;'; # After the widget echo $after_widget; } /** * Saves the widgets settings. * */ function update($new_instance, $old_instance){ $instance = $old_instance; $instance['rss_email'] = strip_tags(stripslashes($new_instance['rss_email'])); $instance['twitter'] = strip_tags(stripslashes($new_instance['twitter'])); $instance['rss'] = strip_tags(stripslashes($new_instance['rss'])); global $wpdb; //Insert First time $wpdb-&gt;insert( 'TRR_Stats', array( 'id' =&gt; 1, 'rss_email' =&gt; $instance['rss_email'], 'twitter' =&gt; $instance['twitter'], 'rss' =&gt; $instance['rss'] ) ); //Rest Update Data global $wpdb; $wpdb-&gt;update( 'TRR_Stats', array( 'rss_email' =&gt; $instance['rss_email'], 'twitter' =&gt; $instance['twitter'], 'rss' =&gt; $instance['rss'] ), array( 'id' =&gt; 1 ) ); return $instance; } /** * Creates the edit form for the widget. * */ function form($instance){ //Defaults $instance = wp_parse_args( (array) $instance, array('rss_email'=&gt;'', 'twitter'=&gt;'engiguide', 'rss'=&gt;'www.rss_email.com/engiguide') ); $rss_email = htmlspecialchars($instance['rss_email']); $twitter = htmlspecialchars($instance['twitter']); $rss = htmlspecialchars($instance['rss']); # Output the options # Twitter echo '&lt;p style="text-align:right;"&gt;&lt;label for="' . $this-&gt;get_field_name('twitter') . '"&gt;' . ('Twitter:') . ' &lt;input style="width: 200px;" id="' . $this-&gt;get_field_id('twitter') . '" name="' . $this-&gt;get_field_name('twitter') . '" type="text" value="' . $twitter . '" /&gt;&lt;/label&gt;&lt;/p&gt;'; echo '&lt;p style="padding-left: 110;"&gt;i.e: webdesignergeeks&lt;/p&gt;'; # Rss echo '&lt;p style="text-align:right;"&gt;&lt;label for="' . $this-&gt;get_field_name('rss') . '"&gt;' . __('Rss:') . ' &lt;input style="width: 200px;" id="' . $this-&gt;get_field_id('rss') . '" name="' . $this-&gt;get_field_name('rss') . '" type="text" value="' . $rss . '" /&gt;&lt;/label&gt;&lt;/p&gt;'; echo '&lt;p style="padding-left: 110;"&gt;i.e: webdesignergeeks&lt;/p&gt;'; # Rss Email echo '&lt;p style="text-align:right;"&gt;&lt;label for="' . $this-&gt;get_field_name('rss_email') . '"&gt;' . ('Rss Email:') . ' &lt;input style="width: 200px;" id="' . $this-&gt;get_field_id('rss_email') . '" name="' . $this-&gt;get_field_name('rss_email') . '" type="text" value="' . $rss_email . '" /&gt;&lt;/label&gt;&lt;/p&gt;'; echo '&lt;p style="padding-left: 110;"&gt;i.e: webdesignergeeks&lt;/p&gt;'; } }// END class /** * * Calls 'widgets_init' action after the Hello World widget has been registered. */ function TTRInit() { register_widget('FTRWidget'); } add_action('widgets_init', 'TTRInit'); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload