Plugin Directory

Changeset 700794


Ignore:
Timestamp:
04/20/2013 03:37:23 PM (13 years ago)
Author:
Bit51
Message:

Version 2.4.3

Location:
share-center-pro
Files:
33 added
3 edited

Legend:

Unmodified
Added
Removed
  • share-center-pro/trunk/lib/bit51/bit51.php

    r622232 r700794  
    1111    abstract class Bit51 {
    1212   
    13         var $feed = 'http://feeds.feedburner.com/Bit51'; //current address of Bit51.com feed
     13        var $feed = 'http://bit51.com/feed'; //current address of Bit51.com feed
    1414   
    1515        /**
     
    350350           
    351351            $feed = fetch_feed( $this->feed ); //get the feed
    352            
    353             $feeditems = $feed->get_items( 0, $feed->get_item_quantity( 5 ) ); //narrow feed to last 5 items
    354            
    355             $content = '<ul>'; //start list
    356            
    357             if ( ! $feeditems ) {
    358            
    359                 $content .= '<li class="bit51">' . __( 'No news items, feed might be broken...', $this->hook ) . '</li>';
     352
     353            if ( ! isset( $feed->errors ) ) {
     354
     355                $feeditems = $feed->get_items( 0, $feed->get_item_quantity( 5 ) ); //narrow feed to last 5 items
     356           
     357                $content = '<ul>'; //start list
     358           
     359                if ( ! $feeditems ) {
     360           
     361                    $content .= '<li class="bit51">' . __( 'No news items, feed might be broken...', $this->hook ) . '</li>';
    360362               
     363                } else {
     364           
     365                    foreach ( $feeditems as $item ) {
     366                       
     367                        $url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls = null, 'display' ) );
     368                       
     369                        $content .= '<li class="bit51"><a class="rsswidget" href="' . $url . '" target="_blank">'. esc_html( $item->get_title() ) .'</a></li>';
     370                       
     371                    }
     372                   
     373                }   
     374                                   
     375                $content .= '</ul>'; //end list
     376
    361377            } else {
    362            
    363                 foreach ( $feeditems as $item ) {
    364                    
    365                     $url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls = null, 'display' ) );
    366                    
    367                     $content .= '<li class="bit51"><a class="rsswidget" href="' . $url . '" target="_blank">'. esc_html( $item->get_title() ) .'</a></li>';
    368                    
    369                 }
    370                
    371             }   
    372                                
    373             $content .= '</ul>'; //end list
     378                $content = __( 'It appears as if the feed is currently down. Please try again later', $this->hook );
     379            }
    374380           
    375381            $this->postbox( 'bit51posts' , __( 'The Latest from Bit51', $this->hook ), $content ); //set up postbox
     
    385391        function donate() {
    386392       
    387             $content = __( 'Have you found this plugin useful? Please help support it\'s continued development with a donation of $20, $50, or $100!', $this->hook );
     393            $content = __( 'Have you found this plugin useful? Please help support it\'s continued development with a donation of $20, $50, or even $100.', $this->hook );
    388394           
    389395            $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="' . $this->paypalcode . '"><input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></form>';
  • share-center-pro/trunk/readme.txt

    r659753 r700794  
    66Requires at least: 3.0
    77Tested up to: 3.5.1
    8 Stable tag: 2.4.2
     8Stable tag: 2.4.3
    99
    1010Adds asynchronous (won't slow your site down) sharing buttons for Google plus, Facebook, Twitter, LinkedIn, Buffer, and Reddit.
    1111
    12 == License ==  
     12== License ==
    1313Released under the terms of the GNU General Public License.
    1414
     
    5858
    5959== Changelog ==
     60
     61= 2.4.3 =
     62* Fixed Bit51 feed with improved error handling
    6063
    6164= 2.4.2 =
  • share-center-pro/trunk/share-center-pro.php

    r664543 r700794  
    44    Plugin URI: http://bit51.com/software/share-center-pro/
    55    Description: Add common social sharing services in a widget to be used anywhere on your page or at the bottom of your posts or other content.
    6     Version: 2.4.2
     6    Version: 2.4.3
    77    Text Domain: share-center-pro
    88    Domain Path: /languages
    9     Author: Bit51.com
     9    Author: Bit51
    1010    Author URI: http://bit51.com
    1111    License: GPLv2
     
    2121    class bit51_scp extends Bit51 {
    2222   
    23         public $pluginversion   = '0014'; //current plugin version
     23        public $pluginversion   = '0015'; //current plugin version
    2424   
    2525        //important plugin information
     
    146146            global $scpoptions, $posts, $post;
    147147           
    148             if ( is_singular() || is_front_page() || is_home() ) {
    149 
    150 
    151                 $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
    152 
    153                 if ( is_array( $thumbnail ) && strlen( $thumbnail[0] ) > 1 ) {
    154 
    155                     $thumbnail = $thumbnail[0];
    156 
    157                 } else { //get a thumbnail from an image in the post
    158 
    159                     $content = $posts[0]->post_content;
     148
     149            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
     150
     151            if ( is_array( $thumbnail ) && strlen( $thumbnail[0] ) > 1 ) {
     152
     153                $thumbnail = $thumbnail[0];
     154
     155            } else { //get a thumbnail from an image in the post
     156
     157                $content = $posts[0]->post_content;
     158               
     159                $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches );
     160
     161                if ( $output > 0 ) {
     162                    $thumbnail = $matches[1][0];
     163                } else {
     164                    $thumbnail = '';
     165                }
     166
     167            }
     168               
     169            echo "<!--## Begin Share Center Pro Scripts ## -->\n";
     170
     171            //add FaceBook OpenGraph Data
     172            if ( $scpoptions['fbog'] == 1 ) {
    160173                   
    161                     $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches );
    162 
    163                     if ( $output > 0 ) {
    164                         $thumbnail = $matches[1][0];
    165                     } else {
    166                         $thumbnail = '';
    167                     }
    168 
    169                 }
    170 
    171                 echo '<!--## Begin Share Center Pro Scripts ## -->' . PHP_EOL;
    172 
    173                 //add FaceBook OpenGraph Data
    174                 if ( $scpoptions['fbog'] == 1 ) {
    175                        
    176                     if( is_singular() ) {
    177 
    178                         echo '<meta property="og:title" content="' . get_the_title( $post->ID ) . '" />' . PHP_EOL;
    179                         echo '<meta property="og:url" content="' . get_permalink( $post->ID ) . '" />' . PHP_EOL;
    180                         echo '<meta property="og:type" content="article"/>' . PHP_EOL;
    181                         echo '<meta property="og:description" content="' . strip_tags( the_description() ) . '" />' . PHP_EOL;
    182 
    183                     } else {
    184                        
    185                         echo '<meta property="og:url" content="' . get_site_url() . '" />' . PHP_EOL;
    186                         echo '<meta property="og:title" content="' . get_bloginfo() . '" />' . PHP_EOL;
    187                         echo '<meta property="og:type" content="website"/>' . PHP_EOL;
    188                         echo '<meta property="og:description" content="' . get_bloginfo( 'description' ) . '" />' . PHP_EOL;
    189 
    190                     }
    191 
    192                     echo '<meta property="og:locale" content="' . get_bloginfo( 'language' ) . '" />' . PHP_EOL;
    193                        
    194                     if ( strlen( $thumbnail ) > 1 ) { //only display thumbnail if an image is used
    195                         echo '<meta property="og:image" content="' . $thumbnail . '" />' . PHP_EOL;
    196                     }
    197 
    198                     echo '<meta property="og:site_name" content="' . get_bloginfo() . '" />' . PHP_EOL;
     174                echo "<meta property=\"og:title\" content=\"" . get_the_title( $post->ID ) . "\"/>\n" .
     175                    "<meta property=\"og:type\" content=\"article\"/>\n" .
     176                    "<meta property=\"og:url\" content=\"" . get_permalink( $post->ID ) . "\"/>\n" .
     177                    "<meta property=\"og:locale\" content=\"" . get_bloginfo( 'language' ) . "\"/>\n";
    199178                   
    200                     if ( strlen( get_the_author() > 1 ) ) { //only display author if needed
    201                         echo '<meta property="og:author" content="' . get_the_author() . '" />' . PHP_EOL;
    202                     }
    203                    
    204                     if ( strlen( $scpoptions['fbappid'] > 1 ) ) {
    205                         echo '<meta property="fb:app_id" content="' . $scpoptions['fbappid'] . '" />' . PHP_EOL;
    206                     }
    207 
    208                 }
    209 
    210                 //add Twitter card  Data
    211                 if ( $scpoptions['tcmd'] == 1 )  {
    212                
    213                     echo '<meta name="twitter:card" content="summary" />' . PHP_EOL;
    214 
    215                     if ( strlen( $scpoptions['twitteruser'] > 1 ) ) {
    216                         echo '<meta name="twitter:site" content="@' . $scpoptions['twitteruser'] . '" />' . PHP_EOL;
    217 
    218                         if( is_singular() ) {
    219 
    220                             echo '<meta property="twitter:title" content="' . get_the_title( $post->ID ) . '" />' . PHP_EOL;
    221                             echo '<meta property="twitter:url" content="' . get_permalink( $post->ID ) . '" />' . PHP_EOL;
    222                             echo '<meta property="twitter:description" content="' . strip_tags( the_description() ) . '" />' . PHP_EOL;
    223 
    224                         } else {
    225                            
    226                             echo '<meta property="twitter:url" content="' . get_site_url() . '" />' . PHP_EOL;
    227                             echo '<meta property="twitter:title" content="' . get_bloginfo() . '" />' . PHP_EOL;
    228                             echo '<meta property="twitter:description" content="' . get_bloginfo( 'description' ) . '" />' . PHP_EOL;
    229 
    230                         }
    231 
    232                     }
    233 
    234                 }
    235 
    236                 echo '<!--## End Share Center Pro Scripts ## -->' . PHP_EOL;
    237 
    238             }
     179                if ( strlen( $thumbnail ) > 1 ) { //only display thumbnail if an image is used
     180                    echo "<meta property=\"og:image\" content=\"" . $thumbnail . "\"/>\n";
     181                }
     182
     183                echo "<meta property=\"og:site_name\" content=\"" . get_bloginfo() . "\"/>\n";
     184               
     185                if ( strlen( get_the_author() > 1 ) ) { //only display author if needed
     186                    echo "<meta property=\"og:author\" content=\"" . get_the_author() . "\" />\n";
     187                }
     188               
     189                if ( is_home() || is_front_page() ) {
     190                    echo "<meta property=\"og:description\" content=\"" . get_bloginfo( 'description' ) . "\"/>\n";
     191                } else if ( is_singular() ) {
     192                    echo "<meta property=\"og:description\" content=\"" . strip_tags( get_the_excerpt() ) . "\"/>\n";
     193                }
     194               
     195                if ( strlen( $scpoptions['fbappid'] > 1 ) ) {
     196                    echo "<meta property=\"fb:app_id\" content=\"" . $scpoptions['fbappid'] . "\" />\n";
     197                }
     198
     199            }
     200
     201            //add Twitter card  Data
     202            if ( $scpoptions['tcmd'] == 1 ) {
     203           
     204                echo "<meta name=\"twitter:card\" content=\"summary\">\n";
     205
     206                if ( strlen( $scpoptions['twitteruser'] > 1 ) ) {
     207                    echo "<meta name=\"twitter:site\" content=\"@" . $scpoptions['twitteruser'] . "\">\n";
     208                }
     209
     210                if ( is_home() || is_front_page() ) {
     211                    echo "<meta property=\"twitter:description\" content=\"" . get_bloginfo( 'description' ) . "\"/>\n";
     212                } else if ( is_singular() ) {
     213                    echo "<meta property=\"twitter:description\" content=\"" . strip_tags( get_the_excerpt() ) . "\"/>\n";
     214                }
     215
     216                echo "<meta property=\"twitter:title\" content=\"" . get_the_title( $post->ID ) . "\"/>\n";
     217                echo "<meta property=\"twitter:url\" content=\"" . get_permalink( $post->ID ) . "\"/>\n";
     218
     219            }
     220
     221            echo "<!--## End Share Center Pro Scripts ## -->\n";
    239222
    240223        }
Note: See TracChangeset for help on using the changeset viewer.