Skip to content

Commit

Permalink
Merge branch 'master' of github.com:valeriosouza/jetpack-whatsapp int…
Browse files Browse the repository at this point in the history
…o dev
  • Loading branch information
valeriosouza committed Sep 30, 2015
2 parents e9ba231 + 9f58fca commit 5cc3e35
Show file tree
Hide file tree
Showing 17 changed files with 525 additions and 170 deletions.
39 changes: 39 additions & 0 deletions Dockunit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"containers": [
{
"prettyName": "PHP-FPM 5.2 WordPress Latest",
"image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-5.2-fpm",
"beforeScripts": [
"service mysql start",
"wp-install latest"
],
"testCommand": "wp-activate-plugin jetpack-whatsapp.php"
},
{
"prettyName": "PHP-FPM 5.6 WordPress Latest",
"image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-5.6-fpm",
"beforeScripts": [
"service mysql start",
"wp core download --path=/temp/wp --allow-root",
"wp core config --path=/temp/wp --dbname=test --dbuser=root --allow-root",
"wp core install --url=http://localhost --title=Test --admin_user=admin --admin_password=12345 [email protected] --path=/temp/wp --allow-root",
"mkdir /temp/wp/wp-content/plugins/test",
"cp -r . /temp/wp/wp-content/plugins/test"
],
"testCommand": "wp plugin activate test --allow-root --path=/temp/wp"
},
{
"prettyName": "PHP-FPM 7.0 WordPress Latest",
"image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-7.0-rc-1-fpm",
"beforeScripts": [
"service mysql start",
"wp core download --path=/temp/wp --allow-root",
"wp core config --path=/temp/wp --dbname=test --dbuser=root --allow-root",
"wp core install --url=http://localhost --title=Test --admin_user=admin --admin_password=12345 [email protected] --path=/temp/wp --allow-root",
"mkdir /temp/wp/wp-content/plugins/test",
"cp -r . /temp/wp/wp-content/plugins/test"
],
"testCommand": "wp plugin activate test --allow-root --path=/temp/wp"
}
]
}
222 changes: 130 additions & 92 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,92 +1,130 @@
=== WhatsApp Sharing Button for Jetpack ===
Contributors: valeriosza
Donate link: http://valeriosouza.com.br/en/donate/
Tags: Jetpack, social, sharing, share, SNS, whatsapp, WHATSAPP, Jetpack Sharing, Button WhatsApp, WhatsApp Button for Jetpack Sharing, WhatsApp Sharing Button for Jetpack
Requires at least: 3.8
Tested up to: 4.2
Stable tag: 1.0.2
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.txt

Add WhatsApp button to Jetpack Sharing

== Description ==

### Notice

Don't forget to install Jetpack, and read [FAQ](https://wordpress.org/plugins/whatsapp-jetpack-button/faq/)!

[Jetpack](http://jetpack.me) is awesome! It's used globally. But they can't cover WhatsApp.
This supplies additional Jetpack sharing WhatsApp Button for your website.

= Want to help? =

If you can translate, help in https://www.transifex.com/projects/p/jetpack-whatsapp/ in Transifex.

Known to develop, help in https://github.com/valeriosouza/jetpack-whatsapp

Have suggestions for new features? https://github.com/valeriosouza/jetpack-whatsapp/issues/new

Want to keep up with the latest news from this plugin? Follow Twitter [@valeriosza](https://twitter.com/valeriosza)

== Installation ==

1. Upload the `jetpack-whatsapp` folder to the `/wp-content/plugins/` directory.
1. Activate the plugin through the 'Plugins' menu in WordPress

== Frequently Asked Questions ==

= This plugin is broken! Thanks for nothing! =
First of all, we supports PHP 5.4+, MySQL 5.5+, WordPress 3.8+. Old software(vulnerable!) is not supported.
If you're in supported environment, please create [pull request](https://github.com/valeriosouza/jetpack-whatsapp/compare/) or [issue](https://github.com/valeriosouza/jetpack-whatsapp/issues/new).

= Don't show option in my admin =
Verify that the Jetpack is enabled and activated Sharing module.

= I do not see the button on my page, though I see other social networks. =
The icon of WhatsApp only appears on smartphones and tablets devices.

= It is not working on Windows Phone. =
For some reason, we do not know or WhatsApp application, or Windows Phone, the button does not work and remove these devices.

== Screenshots ==

1. Option in admin.

2. Show in your page.

== Changelog ==

= 1.0.2 =
* Fixed bug share
* Add news translations

= 1.0.1 =
* Due to a problem in WhatsApp or Windows Phone, the button does not work on these devices. Removed button on these devices

= 1.0.0 =
* Initial Beta Release

== Upgrade Notice ==

= 1.0.2 =
* Fixed bug share
* Add news translations

= 1.0.1 =
* Due to a problem in WhatsApp or Windows Phone, the button does not work on these devices. Removed button on these devices

= 1.0.0 =
* Initial Beta Release

== License ==

WhatsApp Sharing Button for Jetpack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

WhatsApp Sharing Button for Jetpack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Post Notification by Email. If not, see <http://www.gnu.org/licenses/>.


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/valeriosouza/jetpack-whatsapp/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

# WhatsApp Sharing Button for Jetpack [![Dockunit Status](https://dockunit.io/svg/valeriosouza/jetpack-whatsapp?master)](https://dockunit.io/projects/valeriosouza/jetpack-whatsapp#master)
**Contributors:** valeriosza, wordlab

**Donate link:** http://wordlab.com.br/donate/

**Tags:** Jetpack, social, sharing, share, SNS,WhatsApp, whatsapp, WHATSAPP, Jetpack Sharing, Button WhatsApp, WhatsApp Button for Jetpack Sharing, WhatsApp Sharing Button for Jetpack

**Requires at least:** 3.8

**Tested up to:** 4.3.1

**Stable tag:** 1.1

**License:** GPLv3 or later

**License URI:** http://www.gnu.org/licenses/gpl.txt


Add WhatsApp button to Jetpack Sharing

## Description ##

### Notice

Don't forget to install Jetpack, and read [FAQ](https://wordpress.org/plugins/whatsapp-jetpack-button/faq/)!

[Jetpack](http://jetpack.me) is awesome! It's used globally. But they can't cover WhatsApp.
This supplies additional Jetpack sharing WhatsApp Button for your website.

### Heads up: ###

Read the [FAQ](https://wordpress.org/plugins/whatsapp-jetpack-button/faq/) before use.

Want to help? Use the [support](https://wordpress.org/support/plugin/whatsapp-jetpack-button)

### Want to help? ###

If you can translate, help in https://www.transifex.com/projects/p/jetpack-whatsapp/ in Transifex.

Known to develop, help in https://github.com/valeriosouza/jetpack-whatsapp

Have suggestions for new features? https://github.com/valeriosouza/jetpack-whatsapp/issues/new

Want to be a beta tester of the new versions? https://www.facebook.com/groups/jetpackaddonsbetagroup/

Want to keep up with the latest news from this plugin? Like Facebook [https://www.facebook.com/JetpackAddons](https://www.facebook.com/JetpackAddons)

## Installation ##

1. Upload the `jetpack-whatsapp` folder to the `/wp-content/plugins/` directory.
1. Activate the plugin through the 'Plugins' menu in WordPress

## Frequently Asked Questions ##

### This plugin is broken! Thanks for nothing! ###
First of all, we supports PHP 5.4+, MySQL 5.5+, WordPress 3.8+. Old software(vulnerable!) is not supported.
If you're in supported environment, please create [pull request](https://github.com/valeriosouza/jetpack-whatsapp/compare/) or [issue](https://github.com/valeriosouza/jetpack-whatsapp/issues/new).

### Don't show option in my admin ###
Verify that the Jetpack is enabled and activated Sharing module.

### I do not see the button on my page, though I see other social networks. ###
The icon of WhatsApp only appears on smartphones and tablets devices.

### It is not working on Windows Phone. ###
For some reason, we do not know or WhatsApp application, or Windows Phone, the button does not work these devices.

## Screenshots ##

###1. Option in admin.
###
[missing image]


###2. Show in your page.
###
[missing image]


## Changelog ##

### 1.1 ###

* Fixed errors in URL
* Add url Google Analytics
* Add news translations

### 1.0.3 ###
* Fixed bug show in one post
* Add news translations

### 1.0.2 ###
* Fixed bug share
* Add news translations

### 1.0.1 ###
* Due to a problem in WhatsApp or Windows Phone, the button does not work on these devices. Removed button on these devices

### 1.0.0 ###
* Initial Beta Release

## Upgrade Notice ##

### 1.1 - 18/09/2015 ###

* Fixed errors in URL
* Add url Google Analytics
* Add news translations

### 1.0.3 ###
* Fixed bug show in one post
* Add news translations

### 1.0.2 ###
* Fixed bug share
* Add news translations

### 1.0.1 ###
* Due to a problem in WhatsApp or Windows Phone, the button does not work on these devices. Removed button on these devices

### 1.0.0 ###
* Initial Beta Release

## License ##

WhatsApp Sharing Button for Jetpack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

WhatsApp Sharing Button for Jetpack is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Post Notification by Email. If not, see <http://www.gnu.org/licenses/>.
Binary file modified extras/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extras/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 25 additions & 13 deletions includes/class.whatsapp-source.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ private function guess_locale_from_lang( $lang ) {
function get_display( $post ) {
include_once jetwhats__PLUGIN_DIR . 'includes/class.mobile.php';
$locale = $this->guess_locale_from_lang( get_locale() );
if ( wp_is_mobile() and $iOS or $Android ) {
if( $this->smart )
return sprintf(
'<div class="whatsapp_button"><a href="whatsapp://send?text=%s: %s - %s" class="share-whatsapp %s" title="%s"></a></div>',
__('Read this text','jetpack-whatsapp'),
rawurlencode( $this->get_share_title( $post->ID ) ),
rawurlencode( $this->get_share_url( $post->ID ) ),
esc_attr( $locale ),
esc_attr__( 'WhatsApp it!', 'jetpack-whatsapp' )
);
else
return $this->get_link( get_permalink( $post->ID ), _x( 'WhatsApp', 'share to', 'jetpack-whatsapp' ), __( 'Click to share on WhatsApp', 'jetpack-whatsapp' ), 'share=whatsapp' );
if ( wp_is_mobile()) {
//if ($iOS || $Android ) {
if( $this->smart )
return sprintf(
'<div class="whatsapp_button"><a href="whatsapp://send?text=%s: %s - %s%3Futm_source=jetpack-sharing%26utm_medium=whatsapp%26utm_campaign=mobile" class="share-whatsapp %s" title="%s"></a></div>',
__('Look this','jetpack-whatsapp'),
rawurlencode( $this->get_share_title( $post->ID ) ),
rawurlencode( $this->get_share_url( $post->ID ) ),
esc_attr( $locale ),
esc_attr__( 'WhatsApp it!', 'jetpack-whatsapp' )
);
else
return $this->get_link( get_permalink( $post->ID ), _x( 'WhatsApp', 'share to', 'jetpack-whatsapp' ), __( 'Click to share on WhatsApp', 'jetpack-whatsapp' ), 'share=whatsapp' );
//}
}
}

Expand All @@ -60,8 +62,18 @@ function display_footer() {
}

function process_request( $post, array $post_data ) {
$whatsapp_url = 'whatsapp://send?text='.rawurlencode(__('Read this','jetpack-whatsapp').': '.$this->get_share_title( $post->ID ).' - '.$this->get_share_url( $post->ID ) ).'';

$url = add_query_arg( array(
'utm_source' => 'jetpack-sharing',
'utm_medium' => 'whatsapp',
'utm_campaign' => 'mobile'
), $this->get_share_url( $post->ID ) );

$params = array(
'text' => __( 'Look this', 'jetpack-whatsapp' ) . ': ' . $this->get_share_title( $post->ID ).' - '.$url,
);

$whatsapp_url = 'whatsapp://send?' . http_build_query( $params );
// Record stats
parent::process_request( $post, $post_data );

Expand Down
Loading

0 comments on commit 5cc3e35

Please sign in to comment.