Plugin Directory

Changeset 1572193


Ignore:
Timestamp:
01/11/2017 12:09:31 AM (9 years ago)
Author:
nathanwebb
Message:

0.1.2 - fixed readme.txt shortcode typo and unescaped quotes. Added array checking

Location:
db-share-count
Files:
2 added
2 edited
6 copied

Legend:

Unmodified
Added
Removed
  • db-share-count/trunk/db_share_count.php

    r1572176 r1572193  
    44Plugin URI: https://github.com/Crasily/db_share_count
    55Description: Social share buttons with count
    6 Version: 0.1.1
     6Version: 0.1.2
    77Author: Nathan Webb
    88License: GPLv2 or later
     
    9999  $rawdata = file_get_contents($countUrl);
    100100  $data = json_decode($rawdata, true);
    101   if(array_key_exists("share", $data)) {
     101  if(is_array($data) && array_key_exists("share", $data)) {
    102102    $newCount = $data["share"]["share_count"];
    103103  } else {
     
    114114  $dTwitter = file_get_contents($urlTwitter);
    115115  $data = json_decode($dTwitter, true);
    116   if(array_key_exists("count", $data)) {
     116  if(is_array($data) && array_key_exists("count", $data)) {
    117117    $newCount = $data["count"];
    118118  } else {
     
    142142  $dStumble = file_get_contents($urlStumble);
    143143  $data = json_decode($dStumble, true);
    144   if(array_key_exists("count", $data) and
    145        array_key_exists("views", $data["count"])) {
     144  if(is_array($data) && array_key_exists("count", $data) &&
     145       is_array($data["count"]) && array_key_exists("views", $data["count"])) {
    146146    $newCount = $data["count"]["views"];
    147147  } else {
     
    157157  $dPinterest = preg_replace("/receiveCount\(({.*})\)$/", "$1", $dPinterest);
    158158  $data = json_decode($dPinterest, true);
    159   if(array_key_exists("count", $data)) {
     159  if(is_array($data) && array_key_exists("count", $data)) {
    160160    $newCount = $data["count"];
    161161  } else {
  • db-share-count/trunk/readme.txt

    r1572168 r1572193  
    1111
    1212== Description ==
    13 DB Social Share count has been designed to be a simple and effective social share counter. We needed a solution when migrating to https, as the old share counts weren\'t visible anymore. DB Social Share count solved this problem.
     13DB Social Share count has been designed to be a simple and effective social share counter. We needed a solution when migrating to https, as the old share counts weren't visible anymore. DB Social Share count solved this problem.
    1414
    1515[See it in action at Go Science Girls](https://gosciencegirls.com/dirt-backyard-science-experiment/)
     
    1919* add share buttons to your site
    2020* display your social share count on each post
    21 * only show share counts above some amount - so small shares don\'t look so bad!
     21* only show share counts above some amount - so small shares don't look so bad!
    2222
    2323= Features =
     
    3535Via the Wordpress Admin page:
    3636
    37 1. Navigate to \"Plugins\",
    38 1. Click on \"Add New\"
    39 1. Search for \"db share count\"
    40 1. Click on \"Install Now\"
    41 1. Click on \"Activate Plugin\"
     371. Navigate to "Plugins",
     381. Click on "Add New"
     391. Search for "db share count"
     401. Click on "Install Now"
     411. Click on "Activate Plugin"
    4242
    4343To install manually:
    4444
    45451. Download the db_share_count.zip from [github](https://github.com/Crasily/db_share_count/archive/master.zip).
    46 1. Extract the archive and upload the whole directory to your \"/wp-content/plugins/\" directory
     461. Extract the archive and upload the whole directory to your "/wp-content/plugins/" directory
    47471. Go to the Wordpress admin page
    48 1. Go to \"Plugins\" and scroll down until you can see DB Share Count
     481. Go to "Plugins" and scroll down until you can see DB Share Count
    4949
    5050Note for Twitter:
     
    6868
    6969== Changelog ==
     70= 0.1.2 =
     71* Fixed readme.txt incorrect shortcode
     72* Added extra error checking for bad responses
     73
    7074= 0.1.1 =
    7175* Fixed facebook API
    72 
    73 = 0.1.0 =
    74 * Initial release.
Note: See TracChangeset for help on using the changeset viewer.