Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

= 0.4.2 =

* Forever alone - fix for bug when no one has the google+ account in a circle.
  • Loading branch information...
commit 23fa9f774efb6d1939bed9eb73fbd9159954def5 1 parent 78b8f50
@mabujo authored
Showing with 20 additions and 12 deletions.
  1. +7 −3 googleCardClass.php
  2. +5 −5 googleCards.php
  3. +8 −4 readme.txt
View
10 googleCardClass.php
@@ -122,12 +122,16 @@ protected function parseHtml()
{
// parse the html to look for the h4 'have X in circles' element
preg_match('/<h4 class="a-c-ka-Sf">(.*?)<\/h4>/s', $this->html, $matches);
- $count = $matches[1];
- $circles = preg_replace('/[^0-9_]/', '', $count);
+
+ if (isset($matches) && !empty($matches))
+ {
+ $count = $matches[1];
+ $circles = preg_replace('/[^0-9_]/', '', $count);
+ }
if (empty($circles))
{
$circles = 0;
- }
+ }
// parse the html for the user's name
preg_match('/<span class="fn">(.*?)<\/span>/s', $this->html, $matches);
View
10 googleCards.php
@@ -3,8 +3,8 @@
Plugin Name: googleCards
Plugin URI: http://plusdevs.com/google-wordpress-plugin/
Description: Adds google+ contact card widget to your blog
-Version: 0.4.1
-Author: Mabujo, john@mabujo.com
+Version: 0.4.2
+Author: Mabujo
Author URI: http://plusdevs.com
License: GPL3
*/
@@ -30,7 +30,7 @@
define( 'GOOGLECARD_PLUGIN_NAME', 'googleCards');
define( 'GOOGLECARD_PLUGIN_DIRECTORY', 'googlecards');
-define( 'GOOGLECARD_CURRENT_VERSION', '0.4.1' );
+define( 'GOOGLECARD_CURRENT_VERSION', '0.4.2' );
define( 'GOOGLECARD_DEBUG', false);
function googleCards($plus_id)
@@ -51,7 +51,7 @@ function googleCards($plus_id)
// do the scrape
$data = $plus->googleCard();
- if (isset($data) && !empty($data['name']) && !empty($data['count']) && !empty($data['img']))
+ if (isset($data) && !empty($data['name']) && !empty($data['img']))
{
?>
<div id="plus_card">
@@ -67,7 +67,7 @@ function googleCards($plus_id)
<a href="<?php echo $data['url']; ?>">Add to circles</a>
</span>
<div id="plusCardCount">
- <p>In <?php echo $data['count']; ?> people's circles</p>
+ <p>In <?php if (isset($data['count'])) { echo $data['count']; } else { echo 0; } ?> people's circles</p>
</div>
<div id="plusCardCredit">
<p>Google+ card by <a href="http://plusdevs.com">plusdevs</a></p>
View
12 readme.txt
@@ -1,7 +1,7 @@
=== Plugin Name ===
Contributors: mabujo
Donate link: http://plusdevs.com/donate
-Tags: google+, widget, sidebar, google, social
+Tags: google+, widget, sidebar, google, social, google plus, +1, google +, google +1, stats
Requires at least: 3
Tested up to: 3.2
Stable tag: trunk,
@@ -10,12 +10,13 @@ A simple plugin that adds a google+ widget for linking to your google+ profile a
== Description ==
-Adds a widget to your blog that will display a link to your google+ profile so people can add you to a circle (follow you). It also displays your name, profile picture and the number of people who have you in circles.
+googleCards is a google+ wordpress plugin.
+It adds a widget to your blog that will display a link to your google+ profile so people can add you to a circle (follow you). It also displays your name, profile picture and the number of people who have you in circles.
-
-The plugin uses caching to store your google+ profile data to eliminate checking google+ on every page load.
+The plugin uses caching to store your google plus profile data to eliminate checking google+ on every page load.
For the caching to work, your web-server needs to be able to write to wp-content. (a lot of plugins require this so it should be fine).
If the plugin cannot cache it will still work, but will store the data in the database instead. If caching is working you should see a file called plus_card.txt in /wp-content/cache/.
+As of version 0.4, caching will also failback to using transients to store your scraped google plus data.
== Installation ==
@@ -32,6 +33,9 @@ If the plugin cannot cache it will still work, but will store the data in the da
1. googleCards widget in the sidebar
== Changelog ==
+= 0.4.2 =
+* Forever alone - fix for bug when no one has the google+ account in a circle.
+
= 0.4.1 =
* Test for safe_mode and open_basedir. Fixes curl_setopt() bug.
Please sign in to comment.
Something went wrong with that request. Please try again.