Sync plugins from current page
Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
71
wp-content/plugins/shariff/services/shariff-addthis.php
Normal file
71
wp-content/plugins/shariff/services/shariff-addthis.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when AddThis is selected as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevents direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'http://api.addthis.com/oexchange/0.8/offer' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#f8694d';
|
||||
$secondary_color = '#f75b44';
|
||||
$wcag_color = '#AC2207';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M28.2 12.8h-8.9v-8.9c0-0.4-0.4-0.8-0.8-0.8h-4.9c-0.4 0-0.8 0.4-0.8 0.8v8.9h-8.9c-0.4 0-0.8 0.4-0.8 0.8v4.9c0 0.4 0.4 0.8 0.8 0.8h8.9v8.9c0 0.4 0.4 0.8 0.8 0.8h4.9c0.4 0 0.8-0.4 0.8-0.8v-8.9h8.9c0.4 0 0.8-0.4 0.8-0.8v-4.9c0-0.4-0.4-0.8-0.8-0.8z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в AddThis',
|
||||
'cs' => 'Sdílet na AddThis',
|
||||
'da' => 'Del på AddThis',
|
||||
'de' => 'Bei AddThis teilen',
|
||||
'en' => 'Share on AddThis',
|
||||
'es' => 'Compartir en AddThis',
|
||||
'fi' => 'Jaa AddThisissä',
|
||||
'fr' => 'Partager sur AddThis',
|
||||
'hr' => 'Podijelite na AddThis',
|
||||
'hu' => 'Megosztás AddThisen',
|
||||
'it' => 'Condividi su AddThis',
|
||||
'ja' => 'AddThis上で共有',
|
||||
'ko' => 'AddThis에서 공유하기',
|
||||
'nl' => 'Delen op AddThis',
|
||||
'no' => 'Del på AddThis',
|
||||
'pl' => 'Udostępnij przez AddThis',
|
||||
'pt' => 'Compartilhar no AddThis',
|
||||
'ro' => 'Partajează pe AddThis',
|
||||
'ru' => 'Поделиться на AddThis',
|
||||
'sk' => 'Zdieľať na AddThis',
|
||||
'sl' => 'Deli na AddThis',
|
||||
'sr' => 'Podeli na AddThis',
|
||||
'sv' => 'Dela på AddThis',
|
||||
'tr' => 'AddThis\'ta paylaş',
|
||||
'zh' => '在AddThis上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch share counts.
|
||||
$addthis = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://api-public.addthis.com/url/shares.json?url=' . $post_url ) ) );
|
||||
$addthis_json = json_decode( $addthis, true );
|
||||
|
||||
// Store results, if we have some, else record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $addthis_json['shares'] ) ) {
|
||||
$share_counts['addthis'] = intval( $addthis_json['shares'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['addthis'] = $addthis;
|
||||
}
|
||||
} // End if Frontend or Backend.
|
||||
51
wp-content/plugins/shariff/services/shariff-bitcoin.php
Normal file
51
wp-content/plugins/shariff/services/shariff-bitcoin.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Bitcoin is selected as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevents direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( plugins_url( '../', __FILE__ ) . 'bitcoin.php' );
|
||||
|
||||
// Bitcoin address.
|
||||
if ( array_key_exists( 'bitcoinaddress', $atts ) ) {
|
||||
$bitcoinaddress = esc_html( $atts['bitcoinaddress'] );
|
||||
} else {
|
||||
$bitcoinaddress = '';
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?bitcoinaddress=' . $bitcoinaddress;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#f7931a';
|
||||
$secondary_color = '#191919';
|
||||
$wcag_color = '#824808';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23 32"><path fill="' . $main_color . '" d="M20.8 11.4q0.3 3.3-2.3 4.6 2.1 0.5 3.1 1.8t0.8 3.8q-0.1 1.3-0.6 2.2t-1.2 1.6-1.7 1-2.2 0.6-2.6 0.3v4.6h-2.7v-4.5q-1.4 0-2.2 0v4.5h-2.7v-4.6q-0.3 0-1 0t-1 0h-3.6l0.6-3.3h2q0.9 0 1-0.9v-7.2h0.3q-0.1 0-0.3 0v-5.1q-0.2-1.2-1.6-1.2h-2v-2.9l3.8 0q1.1 0 1.7 0v-4.5h2.8v4.4q1.5 0 2.2 0v-4.4h2.8v4.5q1.4 0.1 2.5 0.4t2 0.8 1.5 1.4 0.7 2zM17 21.2q0-0.6-0.3-1.1t-0.7-0.8-1-0.5-1.2-0.3-1.3-0.2-1.2-0.1-1.2 0-0.8 0v6q0.1 0 0.7 0t0.9 0 0.9 0 1-0.1 1-0.2 1-0.2 0.8-0.4 0.7-0.5 0.4-0.7 0.2-0.9zM15.7 12.7q0-0.6-0.2-1t-0.5-0.7-0.9-0.5-1-0.3-1.1-0.1-1 0-1 0-0.7 0v5.5q0.1 0 0.6 0t0.8 0 0.9 0 1-0.1 0.9-0.2 0.9-0.3 0.7-0.5 0.5-0.7 0.2-0.9z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'spenden',
|
||||
'en' => 'donate',
|
||||
'fr' => 'faire un don',
|
||||
'es' => 'donar',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'Spenden mit Bitcoin',
|
||||
'en' => 'Donate with Bitcoin',
|
||||
'fr' => 'Faire un don via Bitcoin',
|
||||
'es' => 'Donar via Bitcoin',
|
||||
);
|
||||
}
|
||||
75
wp-content/plugins/shariff/services/shariff-buffer.php
Normal file
75
wp-content/plugins/shariff/services/shariff-buffer.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Buffer is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://buffer.com/add' );
|
||||
|
||||
// Build the button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&text=' . $share_title;
|
||||
|
||||
// Set the Colors (Hexadecimal including the #).
|
||||
$main_color = '#168eea';
|
||||
$secondary_color = '#329ced';
|
||||
$wcag_color = '#0C5B97';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="' . $main_color . '" d="M91-37.4V-52l1.8 1 24 11.2c1.7.8 3.3.7 4.9 0l24-11.2 1-.4c.9-.6 1-1.3 0-1.8l-3.5-1.7a6.2 6.2 0 0 0-6.2 0l-15.1 7.1c-1.7.8-3.4.9-5.1 0-4.7-2.3-9.5-4.3-14.2-6.7-2.7-1.4-5.3-1.7-8-.1-1.1.7-2.3 1.2-3.5 1.7v-14.3l25 11.6c2.2 1.1 4.2 1 6.3 0l23.5-11c.6-.3 1.5-.4 1.4-1.3 0-.8-.8-1-1.3-1.2l-24.5-11.5a5.2 5.2 0 0 0-4.4-.1L91-68.5v-16.2c0-1.1.2-1.3 1.3-1.3h88.9l-.1 2.3v59.6c-.1 1.1.5 1.5 1.6 1.5h9.4c1 0 1.5-.4 1.5-1.5v-4l1.3 1.2c7.9 7.7 21 6.9 27.8-1.8s7-24.2.5-33.3c-6.7-9.3-20.8-10.6-28.4-2.4-.3.3-.4.8-1.2.6V-86H422c1.2 0 1.5.3 1.5 1.5-.1 5.4 0 10.7 0 16.1-5.8-.3-10 2.7-14.2 6.6v-3.8c0-1.4-.4-2-1.8-1.9h-6.2c-4 0-4 0-4 4.1v39.1c0 1.3.4 1.8 1.6 1.8h8c2.3 0 2.3 0 2.3-2.3 0-7.8.3-15.6-.1-23.3-.2-4.1 1.6-6.1 4.9-7.5l2.6-.9c2.2-.7 4.5-.2 6.8-.4v34.6c0 1-.2 1.2-1.2 1.2h-330c-1 0-1.2-.2-1.2-1.2v-13.8l1.4.9 24.2 11.3c1.7.8 3.4.8 5-.1l13-6 11.4-5.4c.5-.2 1-.4 1-1.1 0-.7-.5-1-1-1.2l-3.4-1.6c-2-1-3.7-.9-5.6 0l-15.3 7.2c-2 .9-3.6.9-5.6 0L101-39.2c-2-.9-3.7-1.1-5.6-.1-1.2.4-2.7 1.2-4.3 1.9zm281.5-3.8h14.8c1.3 0 1.8-.5 1.8-1.8-.1-2-.1-4-.4-6A22.1 22.1 0 0 0 362-68.3a23 23 0 0 0-18.6 21.5c-.4 9.6 2.9 17.4 11.7 22.2a27.6 27.6 0 0 0 20.3 1.9c3.3-.8 6.5-2.1 9.2-4.3.6-.5 1.2-1 .5-1.9l-4.1-6c-.4-.7-1-.7-1.5-.2a17.4 17.4 0 0 1-9.7 3.7c-6.4.6-11-1.9-13.4-7.7-.7-1.8-.4-2.1 1.5-2.1zm-108 13.1c0 1.5.2 2.6 0 3.7 0 1.3.5 1.8 1.8 1.7h8.6c1.3 0 1.8-.5 1.8-1.8v-41.4c0-1.2-.5-1.7-1.7-1.7h-8c-2.3 0-2.3 0-2.3 2.4v26.1c0 .9 0 1.7-.6 2.4-2.4 2.3-5 4-8.5 4.1-6.4.2-8.8-2.1-8.8-8.5v-24.3c0-2.2 0-2.2-2.3-2.2h-7.8c-1.6-.1-2.1.6-2 2.1v10.2c0 7.2-.2 14.5.2 21.7.3 5.3 3.5 9.7 8.3 11.1s9.5 1.2 14.2-.6c2.5-1.1 4.8-2.8 7.2-5zm68-11.7v-15.1c0-2.2 0-2.2 2.4-2.2h5.4c1 0 1.5-.4 1.5-1.4v-7.6c0-1.2-.6-1.5-1.6-1.5h-6c-.6 0-1.2.1-1.4-.7a5.9 5.9 0 0 1 6.9-7.4c.7.2 1.5.4 2 .8 1.2.8 1.8.4 2.4-.6.9-1.4 1.7-2.9 2.7-4.2.9-1.2.5-1.9-.5-2.7a17.4 17.4 0 0 0-8.3-3 14.6 14.6 0 0 0-17 11.7c-.3 1.5-.4 3-.4 4.5 0 1.1-.4 1.6-1.5 1.5h-4.2c-1 0-1.5.3-1.5 1.4v7.8c0 1 .4 1.4 1.4 1.3h3.4c2.4 0 2.4 0 2.4 2.4v30c0 1.5.5 2 2 2h8.3c1.5 0 1.9-.5 1.9-2-.2-4.9-.2-10-.2-15zm-42-.3v15.4c0 1.5.6 2 2 2h7.4c2.9 0 2.9 0 2.9-2.8V-55c0-1.6.5-2.1 2-2h5.3c1 0 1.5-.4 1.5-1.5V-66c0-1.1-.4-1.6-1.5-1.5h-5.8c-.6 0-1.2.1-1.4-.7a5.7 5.7 0 0 1 5.4-7.6c1.3 0 2.5.4 3.5 1.1s1.5.4 2-.5l2.7-4.1c1-1.8 1-2-.7-3.2a17.7 17.7 0 0 0-8.1-2.7 15 15 0 0 0-15.2 7.2c-1.6 2.8-2 5.8-2 8.9.2 1.3-.3 1.8-1.6 1.7h-4.4c-1 0-1.4.4-1.4 1.3v7.8c0 1.1.5 1.4 1.5 1.4h4.2c1.4-.1 1.7.5 1.7 1.8v15zM.3 14.1L29.3.5a6 6 0 0 1 4.9.1C43.3 5 52.5 9.1 61.5 13.5c.7.3 1.4.5 1.4 1.3 0 1-.9 1.1-1.5 1.4-8.7 4.2-17.5 8.2-26.2 12.3a7.8 7.8 0 0 1-7 0L.3 15.5v-1.4zm0 34.7l5.1-2.6a7 7 0 0 1 6.3.1l16.8 8c2.1 1 4.1 1 6.2 0l17.1-8c2.1-1 4.1-1 6.2 0l3.8 1.7c.6.3 1.4.6 1.3 1.3 0 .7-.7 1-1.3 1.3l-12.7 6-14.4 6.7c-1.8.9-3.7 1-5.6 0L2 50.9c-.6-.2-1-.7-1.6-1-.2-.2-.2-.6-.2-1z"/><path fill="' . $main_color . '" d="M.3 31.5l4-1.9c3-1.8 5.7-1.4 8.8.1 5.3 2.7 10.6 5 15.9 7.5 2 .9 3.7.9 5.6 0 5.6-2.7 11.3-5.2 16.9-8a7.2 7.2 0 0 1 6.9 0c1.2.8 2.6 1.3 3.9 2 1 .6 1 1.3 0 2l-1 .4-26.9 12.5c-1.8.9-3.6.9-5.3 0L2.2 33.6c-.7-.3-1.2-.8-1.9-1v-1z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в buffer',
|
||||
'cs' => 'Sdílet na buffer',
|
||||
'da' => 'Del på buffer',
|
||||
'de' => 'Bei buffer teilen',
|
||||
'en' => 'Share on buffer',
|
||||
'es' => 'Compartir en buffer',
|
||||
'fi' => 'Jaa bufferissä',
|
||||
'fr' => 'Partager sur buffer',
|
||||
'hr' => 'Podijelite na buffer',
|
||||
'hu' => 'Megosztás bufferen',
|
||||
'it' => 'Condividi su buffer',
|
||||
'ja' => 'buffer上で共有',
|
||||
'ko' => 'buffer에서 공유하기',
|
||||
'nl' => 'Delen op buffer',
|
||||
'no' => 'Del på buffer',
|
||||
'pl' => 'Udostępnij przez buffer',
|
||||
'pt' => 'Compartilhar no buffer',
|
||||
'ro' => 'Partajează pe buffer',
|
||||
'ru' => 'Поделиться на buffer',
|
||||
'sk' => 'Zdieľať na buffer',
|
||||
'sl' => 'Deli na buffer',
|
||||
'sr' => 'Podeli na buffer',
|
||||
'sv' => 'Dela på buffer',
|
||||
'tr' => 'buffer\'ta paylaş',
|
||||
'zh' => '在buffer上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Get share counts.
|
||||
$buffer = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://api.bufferapp.com/1/links/shares.json?url=' . $post_url ) ) );
|
||||
// Decode the json response.
|
||||
$buffer_json = json_decode( $buffer, true );
|
||||
|
||||
/**
|
||||
* Stores results.
|
||||
* Records errors, if enabled (e.g. request from the status tab).
|
||||
*/
|
||||
if ( isset( $buffer_json['shares'] ) ) {
|
||||
$share_counts['buffer'] = intval( $buffer_json['shares'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['buffer'] = $buffer;
|
||||
}
|
||||
}; // End if backend.
|
||||
57
wp-content/plugins/shariff/services/shariff-diaspora.php
Normal file
57
wp-content/plugins/shariff/services/shariff-diaspora.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when diaspora is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://share.diasporafoundation.org/' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#999';
|
||||
$secondary_color = '#b3b3b3';
|
||||
$wcag_color = '#595959';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 32"><path fill="' . $main_color . '" d="M20.6 28.2c-0.8-1.2-2.1-2.9-2.9-4-0.8-1.1-1.4-1.9-1.4-1.9s-1.2 1.6-2.8 3.8c-1.5 2.1-2.8 3.8-2.8 3.8 0 0-5.5-3.9-5.5-3.9 0 0 1.2-1.8 2.8-4s2.8-4 2.8-4.1c0-0.1-0.5-0.2-4.4-1.5-2.4-0.8-4.4-1.5-4.4-1.5 0 0 0.2-0.8 1-3.2 0.6-1.8 1-3.2 1.1-3.3s2.1 0.6 4.6 1.5c2.5 0.8 4.6 1.5 4.6 1.5s0.1 0 0.1-0.1c0 0 0-2.2 0-4.8s0-4.7 0.1-4.7c0 0 0.7 0 3.3 0 1.8 0 3.3 0 3.4 0 0 0 0.1 1.4 0.2 4.6 0.1 5.2 0.1 5.3 0.2 5.3 0 0 2-0.7 4.5-1.5s4.4-1.5 4.4-1.5c0 0.1 2 6.5 2 6.5 0 0-2 0.7-4.5 1.5-3.4 1.1-4.5 1.5-4.5 1.6 0 0 1.2 1.8 2.6 3.9 1.5 2.1 2.6 3.9 2.6 3.9 0 0-5.4 4-5.5 4 0 0-0.7-0.9-1.5-2.1z"/></svg>';
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в diaspora*',
|
||||
'cs' => 'Sdílet na diaspora*',
|
||||
'da' => 'Del på diaspora*',
|
||||
'de' => 'Bei diaspora* teilen',
|
||||
'en' => 'Share on diaspora*',
|
||||
'es' => 'Compartir en diaspora*',
|
||||
'fi' => 'Jaa diaspora*issä',
|
||||
'fr' => 'Partager sur diaspora*',
|
||||
'hr' => 'Podijelite na diaspora*',
|
||||
'hu' => 'Megosztás diaspora*',
|
||||
'it' => 'Condividi su diaspora*',
|
||||
'ja' => 'diaspora*上で共有',
|
||||
'ko' => 'diaspora*에서 공유하기',
|
||||
'nl' => 'Delen op diaspora*',
|
||||
'no' => 'Del på diaspora*',
|
||||
'pl' => 'Udostępnij przez diaspora*',
|
||||
'pt' => 'Compartilhar no diaspora*',
|
||||
'ro' => 'Partajează pe diaspora*',
|
||||
'ru' => 'Поделиться на diaspora*',
|
||||
'sk' => 'Zdieľať na diaspora*',
|
||||
'sl' => 'Deli na diaspora*',
|
||||
'sr' => 'Podeli na diaspora*-u',
|
||||
'sv' => 'Dela på diaspora*',
|
||||
'tr' => 'diaspora*\'ta paylaş',
|
||||
'zh' => '分享至diaspora*',
|
||||
);
|
||||
}
|
||||
97
wp-content/plugins/shariff/services/shariff-facebook.php
Normal file
97
wp-content/plugins/shariff/services/shariff-facebook.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Facebook is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.facebook.com/sharer/sharer.php' );
|
||||
|
||||
// Build the button URL.
|
||||
$button_url = $service_url . '?u=' . $share_url;
|
||||
|
||||
// Set the Colors (Hexadecimal including the #).
|
||||
$main_color = '#3b5998';
|
||||
$secondary_color = '#4273c8';
|
||||
$wcag_color = '#38548F';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 32"><path fill="' . $main_color . '" d="M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели във Facebook',
|
||||
'cs' => 'Sdílet na Facebooku',
|
||||
'da' => 'Del på Facebook',
|
||||
'de' => 'Bei Facebook teilen',
|
||||
'en' => 'Share on Facebook',
|
||||
'es' => 'Compartir en Facebook',
|
||||
'fi' => 'Jaa Facebookissa',
|
||||
'fr' => 'Partager sur Facebook',
|
||||
'hr' => 'Podijelite na Facebooku',
|
||||
'hu' => 'Megosztás Facebookon',
|
||||
'it' => 'Condividi su Facebook',
|
||||
'ja' => 'フェイスブック上で共有',
|
||||
'ko' => '페이스북에서 공유하기',
|
||||
'nl' => 'Delen op Facebook',
|
||||
'no' => 'Del på Facebook',
|
||||
'pl' => 'Udostępnij na Facebooku',
|
||||
'pt' => 'Compartilhar no Facebook',
|
||||
'ro' => 'Partajează pe Facebook',
|
||||
'ru' => 'Поделиться на Facebook',
|
||||
'sk' => 'Zdieľať na Facebooku',
|
||||
'sl' => 'Deli na Facebooku',
|
||||
'sr' => 'Podeli na Facebook-u',
|
||||
'sv' => 'Dela på Facebook',
|
||||
'tr' => 'Facebook\'ta paylaş',
|
||||
'zh' => '在Facebook上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Use the FB ID and Secret, if available.
|
||||
if ( isset( $shariff3uu['fb_id'] ) && isset( $shariff3uu['fb_secret'] ) ) {
|
||||
// On 32-bit PHP installations the constant is 4 and we have to disable the check because the id is too long.
|
||||
if ( ( defined( PHP_INT_SIZE ) && PHP_INT_SIZE === '4' ) || ! defined( PHP_INT_SIZE ) ) {
|
||||
$fb_app_id = $shariff3uu['fb_id'];
|
||||
} else {
|
||||
$fb_app_id = absint( $shariff3uu['fb_id'] );
|
||||
}
|
||||
$fb_app_secret = sanitize_text_field( $shariff3uu['fb_secret'] );
|
||||
// Create the FB access token.
|
||||
$fb_token = $fb_app_id . '|' . $fb_app_secret;
|
||||
// Use the token to get the share counts.
|
||||
$facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/v3.3/?access_token=' . $fb_token . '&fields=engagement&id=' . $post_url ) ) );
|
||||
// Decode the json response.
|
||||
$facebook_json = json_decode( $facebook, true );
|
||||
// Set nofbid in case the page has not yet been crawled by Facebook and no ID is provided.
|
||||
$nofbid = '0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores results - uses engagement (Graph API > 2.12) if it exists, otherwise uses share_count - ordered based on proximity of occurrence.
|
||||
* Records errors, if enabled (e.g. request from the status tab).
|
||||
*/
|
||||
if ( isset( $facebook_json['engagement'] ) && isset( $facebook_json['engagement']['share_count'] ) ) {
|
||||
$share_counts['facebook'] = intval( $facebook_json['engagement']['reaction_count'] ) + intval( $facebook_json['engagement']['comment_count'] ) + intval( $facebook_json['engagement']['share_count'] ) + intval( $facebook_json['engagement']['comment_plugin_count'] );
|
||||
} elseif ( isset( $facebook_json['share'] ) && isset( $facebook_json['share']['share_count'] ) ) {
|
||||
$share_counts['facebook'] = intval( $facebook_json['share']['share_count'] );
|
||||
} elseif ( isset( $facebook_json['data'] ) && isset( $facebook_json['data'][0] ) && isset( $facebook_json['data'][0]['total_count'] ) ) {
|
||||
$share_counts['facebook'] = intval( $facebook_json['data'][0]['total_count'] );
|
||||
} elseif ( isset( $facebook_json['data'] ) && isset( $facebook_json['data'][0] ) && isset( $facebook_json['data'][0]['share_count'] ) ) {
|
||||
$share_counts['facebook'] = intval( $facebook_json['data'][0]['share_count'] );
|
||||
} elseif ( isset( $facebook_json['id'] ) && ! isset( $facebook_json['error'] ) && 1 === $nofbid ) {
|
||||
$share_counts['facebook'] = '0';
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['facebook'] = $facebook;
|
||||
}
|
||||
}; // End if backend.
|
||||
48
wp-content/plugins/shariff/services/shariff-flattr.php
Normal file
48
wp-content/plugins/shariff/services/shariff-flattr.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Flattr is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://flattr.com/domain/' );
|
||||
|
||||
// Get WP URL.
|
||||
$wp_url = wp_parse_url( get_bloginfo( 'url' ) );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . preg_replace('#^www\.(.+\.)#i', '$1', $wp_url['host'] );
|
||||
|
||||
// Colors.
|
||||
$main_color = '#7ea352';
|
||||
$secondary_color = '#F67C1A';
|
||||
$wcag_color = '#415728';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 32"><path fill="' . $main_color . '" d="M0 28.4v-16.4q0-5.7 2.7-8.9t8.3-3.2h17.5q-0.2 0.2-1.7 1.7t-3.2 3.2-3.5 3.5-3 3-1.3 1.2q-0.5 0-0.5-0.5v-5h-1.5q-1.9 0-3 0.2t-2 0.8-1.2 1.8-0.4 3.1v8.4zM2.1 32.1q0.2-0.2 1.7-1.7t3.2-3.2 3.5-3.5 3-3 1.3-1.2q0.5 0 0.5 0.5v5h1.5q3.7 0 5.2-1.2t1.4-4.8v-8.4l7.2-7.1v16.4q0 5.7-2.7 8.9t-8.3 3.2h-17.5z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'flattr',
|
||||
'en' => 'flattr',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'Beitrag flattrn!',
|
||||
'en' => 'Flattr this!',
|
||||
'fr' => 'Flattré!',
|
||||
'es' => 'Flattr!',
|
||||
);
|
||||
}
|
||||
60
wp-content/plugins/shariff/services/shariff-flipboard.php
Normal file
60
wp-content/plugins/shariff/services/shariff-flipboard.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Flipboard is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://share.flipboard.com/bookmarklet/popout' );
|
||||
|
||||
// Build the button URL.
|
||||
$button_url = $service_url . '?v=2&title=' . $share_title . '&url=' . $share_url;
|
||||
|
||||
// Set the Colors (Hexadecimal including the #).
|
||||
$main_color = '#f52828';
|
||||
$secondary_color = '#373737';
|
||||
$wcag_color = '#B30A0A';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="24px" height="24px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="' . $main_color . '" d="M0 0h8v24H0V0zm9 9h7v7H9V9zm0-9h15v8H9V0z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 0;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Flipboard',
|
||||
'cs' => 'Sdílet na Flipboardu',
|
||||
'da' => 'Del på Flipboard',
|
||||
'de' => 'Bei Flipboard teilen',
|
||||
'en' => 'Share on Flipboard',
|
||||
'es' => 'Compartir en Flipboard',
|
||||
'fi' => 'Jaa Flipboardissä',
|
||||
'fr' => 'Partager sur Flipboard',
|
||||
'hr' => 'Podijelite na Flipboardu',
|
||||
'hu' => 'Megosztás Flipboardon',
|
||||
'it' => 'Condividi su Flipboard',
|
||||
'ja' => 'Flipboard上で共有',
|
||||
'ko' => 'Flipboard에서 공유하기',
|
||||
'nl' => 'Delen op Flipboard',
|
||||
'no' => 'Del på Flipboard',
|
||||
'pl' => 'Udostępnij na Flipboardu',
|
||||
'pt' => 'Compartilhar no Flipboard',
|
||||
'ro' => 'Partajează pe Flipboard',
|
||||
'ru' => 'Поделиться на Flipboard',
|
||||
'sk' => 'Zdieľať na Flipboardu',
|
||||
'sl' => 'Deli na Flipboardu',
|
||||
'sr' => 'Podeli na Flipboard-u',
|
||||
'sv' => 'Dela på Flipboard',
|
||||
'tr' => 'Flipboard\'ta paylaş',
|
||||
'zh' => '在Flipboard上分享',
|
||||
);
|
||||
}
|
||||
77
wp-content/plugins/shariff/services/shariff-info.php
Normal file
77
wp-content/plugins/shariff/services/shariff-info.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Info is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Set custom info url or default one.
|
||||
if ( array_key_exists( 'info_url', $atts ) ) {
|
||||
$service_url = esc_url( $atts['info_url'] );
|
||||
} else {
|
||||
$service_url = esc_url( 'http://ct.de/-2467514' );
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#999';
|
||||
$secondary_color = '#a8a8a8';
|
||||
$wcag_color = '#595959';
|
||||
|
||||
// Replace $main_color with $wcag_color and $secondary_color with #000, if $wacg_theme is selected.
|
||||
if ( isset( $atts['theme'] ) && 'wcag' === $atts['theme'] && isset( $wcag_color ) && '' !== $wcag_color ) {
|
||||
$main_color = $wcag_color;
|
||||
$secondary_color = '#000';
|
||||
}
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 32"><path fill="' . $main_color . '" d="M11.4 24v2.3q0 0.5-0.3 0.8t-0.8 0.4h-9.1q-0.5 0-0.8-0.4t-0.4-0.8v-2.3q0-0.5 0.4-0.8t0.8-0.4h1.1v-6.8h-1.1q-0.5 0-0.8-0.4t-0.4-0.8v-2.3q0-0.5 0.4-0.8t0.8-0.4h6.8q0.5 0 0.8 0.4t0.4 0.8v10.3h1.1q0.5 0 0.8 0.4t0.3 0.8zM9.2 3.4v3.4q0 0.5-0.4 0.8t-0.8 0.4h-4.6q-0.4 0-0.8-0.4t-0.4-0.8v-3.4q0-0.4 0.4-0.8t0.8-0.4h4.6q0.5 0 0.8 0.4t0.4 0.8z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'info',
|
||||
'en' => 'info',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
if ( array_key_exists( 'info_text', $atts ) ) {
|
||||
$button_title_array = array( 'en' => $atts['info_text'] );
|
||||
} else {
|
||||
$button_title_array = array(
|
||||
'bg' => 'Повече информация',
|
||||
'cs' => 'Více informací',
|
||||
'da' => 'Flere oplysninger',
|
||||
'de' => 'Weitere Informationen',
|
||||
'en' => 'More information',
|
||||
'es' => 'Más informaciones',
|
||||
'fi' => 'Lisätietoja',
|
||||
'fr' => 'Plus d\'informations',
|
||||
'hr' => 'Više informacija',
|
||||
'hu' => 'Több információ',
|
||||
'it' => 'Maggiori informazioni',
|
||||
'ja' => '詳しい情報',
|
||||
'ko' => '추가 정보',
|
||||
'nl' => 'Verdere informatie',
|
||||
'no' => 'Mer informasjon',
|
||||
'pl' => 'Więcej informacji',
|
||||
'pt' => 'Mais informações',
|
||||
'ro' => 'Mai multe informatii',
|
||||
'ru' => 'Больше информации',
|
||||
'sk' => 'Viac informácií',
|
||||
'sl' => 'Več informacij',
|
||||
'sr' => 'Više informacija',
|
||||
'sv' => 'Mer information',
|
||||
'tr' => 'Daha fazla bilgi',
|
||||
'zh' => '更多信息',
|
||||
);
|
||||
}
|
||||
}
|
||||
88
wp-content/plugins/shariff/services/shariff-linkedin.php
Normal file
88
wp-content/plugins/shariff/services/shariff-linkedin.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when LinedIn is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.linkedin.com/shareArticle?mini=true' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '&url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#0077b5';
|
||||
$secondary_color = '#1488bf';
|
||||
$wcag_color = '#005B8A';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 32"><path fill="' . $main_color . '" d="M6.2 11.2v17.7h-5.9v-17.7h5.9zM6.6 5.7q0 1.3-0.9 2.2t-2.4 0.9h0q-1.5 0-2.4-0.9t-0.9-2.2 0.9-2.2 2.4-0.9 2.4 0.9 0.9 2.2zM27.4 18.7v10.1h-5.9v-9.5q0-1.9-0.7-2.9t-2.3-1.1q-1.1 0-1.9 0.6t-1.2 1.5q-0.2 0.5-0.2 1.4v9.9h-5.9q0-7.1 0-11.6t0-5.3l0-0.9h5.9v2.6h0q0.4-0.6 0.7-1t1-0.9 1.6-0.8 2-0.3q3 0 4.9 2t1.9 6z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 0;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'bg' => 'cподеляне',
|
||||
'cs' => 'sdílet',
|
||||
'da' => 'del',
|
||||
'de' => 'mitteilen',
|
||||
'en' => 'share',
|
||||
'es' => 'compartir',
|
||||
'fi' => 'Jaa',
|
||||
'fr' => 'partager',
|
||||
'hr' => 'podijelite',
|
||||
'hu' => 'megosztás',
|
||||
'it' => 'condividi',
|
||||
'ja' => 'シェア',
|
||||
'ko' => '공유하기',
|
||||
'nl' => 'delen',
|
||||
'no' => 'del',
|
||||
'pl' => 'udostępnij',
|
||||
'pt' => 'compartilhar',
|
||||
'ro' => 'distribuiți',
|
||||
'ru' => 'поделиться',
|
||||
'sk' => 'zdieľať',
|
||||
'sl' => 'deli',
|
||||
'sr' => 'podeli',
|
||||
'sv' => 'dela',
|
||||
'tr' => 'paylaş',
|
||||
'zh' => '分享',
|
||||
);
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в LinkedIn',
|
||||
'cs' => 'Sdílet na LinkedIn',
|
||||
'da' => 'Del på LinkedIn',
|
||||
'de' => 'Bei LinkedIn teilen',
|
||||
'en' => 'Share on LinkedIn',
|
||||
'es' => 'Compartir en LinkedIn',
|
||||
'fi' => 'Jaa LinkedInissä',
|
||||
'fr' => 'Partager sur LinkedIn',
|
||||
'hr' => 'Podijelite na LinkedIn',
|
||||
'hu' => 'Megosztás LinkedInen',
|
||||
'it' => 'Condividi su LinkedIn',
|
||||
'ja' => 'LinkedIn上で共有',
|
||||
'ko' => 'LinkedIn에서 공유하기',
|
||||
'nl' => 'Delen op LinkedIn',
|
||||
'no' => 'Del på LinkedIn',
|
||||
'pl' => 'Udostępnij przez LinkedIn',
|
||||
'pt' => 'Compartilhar no LinkedIn',
|
||||
'ro' => 'Partajează pe LinkedIn',
|
||||
'ru' => 'Поделиться на LinkedIn',
|
||||
'sk' => 'Zdieľať na LinkedIn',
|
||||
'sl' => 'Deli na LinkedIn',
|
||||
'sr' => 'Podeli na LinkedIn-u',
|
||||
'sv' => 'Dela på LinkedIn',
|
||||
'tr' => 'LinkedIn\'ta paylaş',
|
||||
'zh' => '在LinkedIn上分享',
|
||||
);
|
||||
}
|
||||
86
wp-content/plugins/shariff/services/shariff-mailto.php
Normal file
86
wp-content/plugins/shariff/services/shariff-mailto.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Mailto is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
|
||||
// Build button URL.
|
||||
$button_url = 'mailto:?body=' . $share_url . '&subject=' . rawurlencode( urldecode( $share_title ) );
|
||||
|
||||
// Colors.
|
||||
$main_color = '#999';
|
||||
$secondary_color = '#a8a8a8';
|
||||
$wcag_color = '#595959';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M32 12.7v14.2q0 1.2-0.8 2t-2 0.9h-26.3q-1.2 0-2-0.9t-0.8-2v-14.2q0.8 0.9 1.8 1.6 6.5 4.4 8.9 6.1 1 0.8 1.6 1.2t1.7 0.9 2 0.4h0.1q0.9 0 2-0.4t1.7-0.9 1.6-1.2q3-2.2 8.9-6.1 1-0.7 1.8-1.6zM32 7.4q0 1.4-0.9 2.7t-2.2 2.2q-6.7 4.7-8.4 5.8-0.2 0.1-0.7 0.5t-1 0.7-0.9 0.6-1.1 0.5-0.9 0.2h-0.1q-0.4 0-0.9-0.2t-1.1-0.5-0.9-0.6-1-0.7-0.7-0.5q-1.6-1.1-4.7-3.2t-3.6-2.6q-1.1-0.7-2.1-2t-1-2.5q0-1.4 0.7-2.3t2.1-0.9h26.3q1.2 0 2 0.8t0.9 2z"/></svg>';
|
||||
|
||||
// Same window?
|
||||
$same_window = 1;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'bg' => 'имейл',
|
||||
'da' => 'e-mail',
|
||||
'de' => 'E-Mail',
|
||||
'en' => 'email',
|
||||
'es' => 'correo',
|
||||
'fi' => 'sähköpostitse',
|
||||
'fr' => 'courriel',
|
||||
'hr' => 'e-pošta',
|
||||
'hu' => 'e-mail',
|
||||
'it' => 'e-mail',
|
||||
'ja' => 'e-mail',
|
||||
'ko' => 'e-mail',
|
||||
'nl' => 'e-mail',
|
||||
'no' => 'e-post',
|
||||
'pl' => 'e-mail',
|
||||
'pt' => 'e-mail',
|
||||
'ro' => 'e-mail',
|
||||
'ru' => 'e-mail',
|
||||
'sk' => 'e-mail',
|
||||
'sl' => 'e-mail',
|
||||
'sr' => 'e-mail',
|
||||
'sv' => 'e-post',
|
||||
'tr' => 'e-posta',
|
||||
'zh' => '分享',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Изпрати по имейл',
|
||||
'cs' => 'Poslat mailem',
|
||||
'da' => 'Sende via e-mail',
|
||||
'de' => 'Per E-Mail versenden',
|
||||
'en' => 'Send by email',
|
||||
'es' => 'Enviar por correo electrónico',
|
||||
'fi' => 'Lähetä sähköpostitse',
|
||||
'fr' => 'Envoyer par courriel',
|
||||
'hr' => 'Pošaljite emailom',
|
||||
'hu' => 'Elküldés e-mailben',
|
||||
'it' => 'Inviare via email',
|
||||
'ja' => '電子メールで送信',
|
||||
'ko' => '이메일로 보내기',
|
||||
'nl' => 'Sturen via e-mail',
|
||||
'no' => 'Send via epost',
|
||||
'pl' => 'Wyślij e-mailem',
|
||||
'pt' => 'Enviar por e-mail',
|
||||
'ro' => 'Trimite prin e-mail',
|
||||
'ru' => 'Отправить по эл. почте',
|
||||
'sk' => 'Poslať e-mailom',
|
||||
'sl' => 'Pošlji po elektronski pošti',
|
||||
'sr' => 'Pošalji putem email-a',
|
||||
'sv' => 'Skicka via e-post',
|
||||
'tr' => 'E-posta ile gönder',
|
||||
'zh' => '通过电子邮件传送',
|
||||
);
|
||||
}
|
||||
59
wp-content/plugins/shariff/services/shariff-mewe.php
Normal file
59
wp-content/plugins/shariff/services/shariff-mewe.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when MeWe is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://mewe.com/share' );
|
||||
|
||||
// Build the button URL.
|
||||
$button_url = $service_url . '?link=' . $share_url;
|
||||
|
||||
// Set the Colors (Hexadecimal including the #).
|
||||
$main_color = '#16387D';
|
||||
$secondary_color = '#187ca5';
|
||||
$wcag_color = '#16387D';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="32px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M7.48,9.21a1.46,1.46,0,1,1-2.92,0h0a1.46,1.46,0,1,1,2.92,0Zm7.3,0a1.52,1.52,0,1,1-1.52-1.52A1.52,1.52,0,0,1,14.78,9.21Zm8.52,0a1.52,1.52,0,1,1-1.52-1.52A1.52,1.52,0,0,1,23.3,9.21Zm8.53,0a1.47,1.47,0,0,1-2.93,0h0a1.47,1.47,0,0,1,2.93,0ZM.17,13.35a1.09,1.09,0,0,1,1.1-1.09h.12a1,1,0,0,1,1,.61L6,18.46l3.65-5.59a.8.8,0,0,1,.85-.61h.25a1,1,0,0,1,1,1.09v9.74a1,1,0,0,1-.7,1.19,1.24,1.24,0,0,1-.27,0,1.11,1.11,0,0,1-1.11-1.09s0-.09,0-.13V16.15l-2.8,4.26a1.08,1.08,0,0,1-1,.61c-.37,0-.61-.24-.86-.61l-2.8-4.26v7.06a1,1,0,0,1-1.09,1,1,1,0,0,1-1-1Zm13.15.37a1.35,1.35,0,0,1,0-.49,1,1,0,0,1,1-1,1.05,1.05,0,0,1,1,.73l2.8,8.15L20.75,13a.92.92,0,0,1,1-.73h.12c.61,0,1,.24,1.1.73l2.68,8.15L28.3,13a1,1,0,0,1,1-.73,1.06,1.06,0,0,1,1.09,1,1,1,0,0,1,0,.49l-3.65,9.74a1,1,0,0,1-1,.85H25.5a1.31,1.31,0,0,1-1.1-.85l-2.56-7.67-2.67,7.67a1.32,1.32,0,0,1-1.1.85h-.24a1,1,0,0,1-1-.85Z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 0;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели във MeWe',
|
||||
'cs' => 'Sdílet na MeWeu',
|
||||
'da' => 'Del på MeWe',
|
||||
'de' => 'Bei MeWe teilen',
|
||||
'en' => 'Share on MeWe',
|
||||
'es' => 'Compartir en MeWe',
|
||||
'fi' => 'Jaa MeWeissa',
|
||||
'fr' => 'Partager sur MeWe',
|
||||
'hr' => 'Podijelite na MeWeu',
|
||||
'hu' => 'Megosztás MeWeon',
|
||||
'it' => 'Condividi su MeWe',
|
||||
'ja' => 'フェイスブック上で共有',
|
||||
'ko' => '페이스북에서 공유하기',
|
||||
'nl' => 'Delen op MeWe',
|
||||
'no' => 'Del på MeWe',
|
||||
'pl' => 'Udostępnij na MeWeu',
|
||||
'pt' => 'Compartilhar no MeWe',
|
||||
'ro' => 'Partajează pe MeWe',
|
||||
'ru' => 'Поделиться на MeWe',
|
||||
'sk' => 'Zdieľať na MeWeu',
|
||||
'sl' => 'Deli na MeWeu',
|
||||
'sr' => 'Podeli na MeWe-u',
|
||||
'sv' => 'Dela på MeWe',
|
||||
'tr' => 'MeWe\'ta paylaş',
|
||||
);
|
||||
}
|
||||
56
wp-content/plugins/shariff/services/shariff-mix.php
Normal file
56
wp-content/plugins/shariff/services/shariff-mix.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Mix is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://mix.com/add' );
|
||||
|
||||
// Build the button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url;
|
||||
|
||||
// Set the Colors (Hexadecimal including the #).
|
||||
$main_color = '#ff8226';
|
||||
$secondary_color = '#FFB27A';
|
||||
$wcag_color = '#8F3C00';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="' . $main_color . '" d="M0 64v348.9c0 56.2 88 58.1 88 0V174.3c7.9-52.9 88-50.4 88 6.5v175.3c0 57.9 96 58 96 0V240c5.3-54.7 88-52.5 88 4.3v23.8c0 59.9 88 56.6 88 0V64H0z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 0;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели във Mix',
|
||||
'cs' => 'Sdílet na Mix',
|
||||
'da' => 'Del på Mix',
|
||||
'de' => 'Bei Mix teilen',
|
||||
'en' => 'Share on Mix',
|
||||
'es' => 'Compartir en Mix',
|
||||
'fi' => 'Jaa Mixissa',
|
||||
'fr' => 'Partager sur Mix',
|
||||
'hr' => 'Podijelite na Mix',
|
||||
'hu' => 'Megosztás Mix',
|
||||
'it' => 'Condividi su Mix',
|
||||
'nl' => 'Delen op Mix',
|
||||
'no' => 'Del på Mix',
|
||||
'pl' => 'Udostępnij na Mix',
|
||||
'pt' => 'Compartilhar no Mix',
|
||||
'ro' => 'Partajează pe Mix',
|
||||
'ru' => 'Поделиться на Mix',
|
||||
'sk' => 'Zdieľať na Mix',
|
||||
'sl' => 'Deli na Mix',
|
||||
'sr' => 'Podeli na Mix',
|
||||
'sv' => 'Dela på Mix',
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Odnoklassniki is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://connect.ok.ru/offer' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#ee8208';
|
||||
$secondary_color = '#f3a752';
|
||||
$wcag_color = '#874508';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="20" viewBox="0 0 14 20"><path fill="' . $main_color . '" d="M7.1 10.1q-2.1 0-3.6-1.5t-1.5-3.6q0-2.1 1.5-3.6t3.6-1.5 3.6 1.5 1.5 3.6q0 2.1-1.5 3.6t-3.6 1.5zM7.1 2.6q-1 0-1.8 0.7t-0.7 1.8q0 1 0.7 1.8t1.8 0.7 1.8-0.7 0.7-1.8q0-1-0.7-1.8t-1.8-0.7zM13 10.7q0.1 0.3 0.2 0.6t0 0.5-0.3 0.4-0.5 0.4-0.7 0.5q-1.3 0.8-3.5 1l0.8 0.8 3 3q0.3 0.3 0.3 0.8t-0.3 0.8l-0.1 0.1q-0.3 0.3-0.8 0.3t-0.8-0.3q-0.7-0.8-3-3l-3 3q-0.3 0.3-0.8 0.3t-0.8-0.3l-0.1-0.1q-0.3-0.3-0.3-0.8t0.3-0.8l3.8-3.8q-2.3-0.2-3.5-1-0.4-0.3-0.7-0.5t-0.5-0.4-0.3-0.4 0-0.5 0.2-0.6q0.1-0.2 0.3-0.4t0.5-0.2 0.6 0 0.7 0.4q0.1 0 0.2 0.1t0.5 0.3 0.8 0.3 1 0.3 1.3 0.1q1 0 1.9-0.3t1.3-0.6l0.4-0.3q0.4-0.3 0.7-0.4t0.6 0 0.5 0.2 0.3 0.4z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button text label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели във Odnoklassniki',
|
||||
'da' => 'Del på Odnoklassniki',
|
||||
'de' => 'Bei Odnoklassniki teilen',
|
||||
'en' => 'Share on Odnoklassniki',
|
||||
'es' => 'Compartir en Odnoklassniki',
|
||||
'fi' => 'Jaa Odnoklassniki',
|
||||
'fr' => 'Partager sur Odnoklassniki',
|
||||
'hr' => 'Podijelite na Odnoklassniki',
|
||||
'hu' => 'Megosztás Odnoklassniki',
|
||||
'it' => 'Condividi su Odnoklassniki',
|
||||
'ja' => 'Odnoklassnikiでシェア',
|
||||
'ko' => '오드 노 클라스 니키 공유',
|
||||
'nl' => 'Delen op Odnoklassniki',
|
||||
'no' => 'Del på Odnoklassniki',
|
||||
'pl' => 'Udostępnij na Odnoklassniki',
|
||||
'pt' => 'Compartilhar no Odnoklassniki',
|
||||
'ro' => 'Partajează pe Odnoklassniki',
|
||||
'ru' => 'Поделиться на Odnoklassniki',
|
||||
'sk' => 'Zdieľať na Odnoklassniki',
|
||||
'sl' => 'Deli na Odnoklassniki',
|
||||
'sr' => 'Podeli na Odnoklassniki',
|
||||
'sv' => 'Dela på Odnoklassniki',
|
||||
'tr' => 'Odnoklassniki\'ta paylaş',
|
||||
'zh' => '在Odnoklassniki上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch share counts.
|
||||
$odnoklassniki = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://connect.ok.ru/dk?st.cmd=extLike&tp=json&ref=' . $post_url ) ) );
|
||||
|
||||
// Decode the json response.
|
||||
$odnoklassniki_json = json_decode( $odnoklassniki, true );
|
||||
|
||||
// Store results and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $odnoklassniki_json ) && ! empty( $odnoklassniki_json ) ) {
|
||||
$share_counts['odnoklassniki'] = intval( $odnoklassniki_json['count'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['odnoklassniki'] = $odnoklassniki;
|
||||
}
|
||||
}
|
||||
49
wp-content/plugins/shariff/services/shariff-patreon.php
Normal file
49
wp-content/plugins/shariff/services/shariff-patreon.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Patreon is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.patreon.com/' );
|
||||
|
||||
// Patreon ID.
|
||||
if ( array_key_exists( 'patreonid', $atts ) ) {
|
||||
$patreonid = esc_html( $atts['patreonid'] );
|
||||
} else {
|
||||
$patreonid = '';
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . $patreonid;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#e6461a';
|
||||
$secondary_color = '#FF794D';
|
||||
$wcag_color = '#A23210';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M10.4 1.5c-4.4 1.8-6.8 4.1-8.7 8.4-0.9 2-1 2.9-1.2 11.9l-0.2 9.7h3.2l0.1-9.6c0.1-8.8 0.2-9.6 1.1-11.3 1.6-2.9 3.1-4.4 5.9-5.8 3.7-1.9 7.1-1.9 10.8 0 3.1 1.5 4.6 3.1 6.1 6.5 0.9 2 1.1 2.8 0.9 5.3-0.4 4.7-2.5 8.1-6.6 10.3-2.1 1.1-2.8 1.3-5.9 1.3-2 0-3.7-0.1-3.9-0.3-0.2-0.1-0.3-1.5-0.4-3.1 0-2.5 0-2.8 0.8-2.6 3.2 0.6 5.7 0.5 7.1-0.4 4.3-2.6 4.3-9.2 0-11.8-3.1-1.9-7.7-0.8-9.6 2.3-0.8 1.3-0.9 2.2-0.9 10.3v8.9l5.4-0.2c4.7-0.1 5.7-0.3 7.8-1.3 3.5-1.6 5.8-3.9 7.5-7.3 1.3-2.6 1.4-3.3 1.4-6.9 0-3.3-0.2-4.3-1.1-6.4-1.6-3.5-3.9-5.8-7.3-7.5-4-2-8.7-2.2-12.5-0.6z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'patreon',
|
||||
'en' => 'patreon',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'Werde ein patron!',
|
||||
'en' => 'Become a patron!',
|
||||
'es' => 'Conviértete en un patron!',
|
||||
'fr' => 'Devenez un patron!',
|
||||
);
|
||||
}
|
||||
51
wp-content/plugins/shariff/services/shariff-paypal.php
Normal file
51
wp-content/plugins/shariff/services/shariff-paypal.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when PayPal is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=' );
|
||||
|
||||
// PayPal button ID.
|
||||
if ( array_key_exists( 'paypalbuttonid', $atts ) ) {
|
||||
$paypalbuttonid = esc_html( $atts['paypalbuttonid'] );
|
||||
} else {
|
||||
$paypalbuttonid = '';
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . $paypalbuttonid;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#009cde';
|
||||
$secondary_color = '#0285d2';
|
||||
$wcag_color = '#005C8A';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M19.9 8q0-2.8-4.2-2.8h-1.2q-0.6 0-1.1 0.4t-0.6 0.9l-1.1 4.9q0 0.1 0 0.3 0 0.4 0.3 0.7t0.7 0.3h0.9q1.2 0 2.3-0.2t2-0.7 1.5-1.5 0.5-2.3zM30.6 10.7q0 4.7-3.9 7.6-3.9 2.9-10.9 2.9h-1.1q-0.6 0-1.1 0.4t-0.6 0.9l-1.3 5.6q-0.1 0.6-0.7 1.1t-1.2 0.5h-3.8q-0.6 0-0.9-0.4t-0.4-0.9q0-0.2 0.2-1.2h2.7q0.6 0 1.1-0.4t0.7-1l1.3-5.6q0.1-0.6 0.7-1t1.1-0.4h1.1q7 0 10.8-2.9t3.9-7.5q0-2.3-0.9-3.7 3.3 1.6 3.3 6zM27.4 7.4q0 4.7-3.9 7.6-3.9 2.9-10.9 2.9h-1.1q-0.6 0-1.1 0.4t-0.6 0.9l-1.3 5.6q-0.1 0.6-0.7 1.1t-1.2 0.5h-3.8q-0.6 0-0.9-0.3t-0.4-0.9q0-0.1 0-0.4l5.4-23.2q0.1-0.6 0.7-1.1t1.2-0.5h7.9q1.2 0 2.2 0.1t2.2 0.3 2 0.5 1.7 0.9 1.4 1.3 0.9 1.8 0.3 2.4z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'spenden',
|
||||
'en' => 'donate',
|
||||
'fr' => 'faire un don',
|
||||
'es' => 'donar',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'Spenden mit PayPal',
|
||||
'en' => 'Donate with PayPal',
|
||||
'fr' => 'Faire un don via PayPal',
|
||||
'es' => 'Donar via PayPal',
|
||||
);
|
||||
}
|
||||
51
wp-content/plugins/shariff/services/shariff-paypalme.php
Normal file
51
wp-content/plugins/shariff/services/shariff-paypalme.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when PayPal.me is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.paypal.me/' );
|
||||
|
||||
// PayPal.me ID.
|
||||
if ( array_key_exists( 'paypalmeid', $atts ) ) {
|
||||
$paypalmeid = esc_html( $atts['paypalmeid'] );
|
||||
} else {
|
||||
$paypalmeid = '';
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . $paypalmeid;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#009cde';
|
||||
$secondary_color = '#0285d2';
|
||||
$wcag_color = '#005C8A';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M19.9 8q0-2.8-4.2-2.8h-1.2q-0.6 0-1.1 0.4t-0.6 0.9l-1.1 4.9q0 0.1 0 0.3 0 0.4 0.3 0.7t0.7 0.3h0.9q1.2 0 2.3-0.2t2-0.7 1.5-1.5 0.5-2.3zM30.6 10.7q0 4.7-3.9 7.6-3.9 2.9-10.9 2.9h-1.1q-0.6 0-1.1 0.4t-0.6 0.9l-1.3 5.6q-0.1 0.6-0.7 1.1t-1.2 0.5h-3.8q-0.6 0-0.9-0.4t-0.4-0.9q0-0.2 0.2-1.2h2.7q0.6 0 1.1-0.4t0.7-1l1.3-5.6q0.1-0.6 0.7-1t1.1-0.4h1.1q7 0 10.8-2.9t3.9-7.5q0-2.3-0.9-3.7 3.3 1.6 3.3 6zM27.4 7.4q0 4.7-3.9 7.6-3.9 2.9-10.9 2.9h-1.1q-0.6 0-1.1 0.4t-0.6 0.9l-1.3 5.6q-0.1 0.6-0.7 1.1t-1.2 0.5h-3.8q-0.6 0-0.9-0.3t-0.4-0.9q0-0.1 0-0.4l5.4-23.2q0.1-0.6 0.7-1.1t1.2-0.5h7.9q1.2 0 2.2 0.1t2.2 0.3 2 0.5 1.7 0.9 1.4 1.3 0.9 1.8 0.3 2.4z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'spenden',
|
||||
'en' => 'donate',
|
||||
'fr' => 'faire un don',
|
||||
'es' => 'donar',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'Spenden mit PayPal',
|
||||
'en' => 'Donate with PayPal',
|
||||
'fr' => 'Faire un don via PayPal',
|
||||
'es' => 'Donar via PayPal',
|
||||
);
|
||||
}
|
||||
121
wp-content/plugins/shariff/services/shariff-pinterest.php
Normal file
121
wp-content/plugins/shariff/services/shariff-pinterest.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Pinterest is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if function catch_image exists.
|
||||
if ( ! function_exists( 'shariff3uu_catch_image' ) ) {
|
||||
/**
|
||||
* Helper function to get the first image of a post.
|
||||
*/
|
||||
function shariff3uu_catch_image() {
|
||||
$result = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );
|
||||
if ( array_key_exists( 0, $matches[1] ) ) {
|
||||
return $matches[1][0];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.pinterest.com/pin/create/link/' );
|
||||
|
||||
// Get an image for pinterest (attribute -> featured image -> first image -> default image -> shariff hint).
|
||||
if ( array_key_exists( 'services', $atts ) ) {
|
||||
if ( strstr( $atts['services'], 'pinterest' ) ) {
|
||||
if ( array_key_exists( 'media', $atts ) ) {
|
||||
$share_media = esc_html( $atts['media'] );
|
||||
} else {
|
||||
$feat_image = wp_get_attachment_url( get_post_thumbnail_id() );
|
||||
if ( ! empty( $feat_image ) ) {
|
||||
$share_media = esc_html( $feat_image );
|
||||
} else {
|
||||
$first_image = shariff3uu_catch_image();
|
||||
if ( ! empty( $first_image ) ) {
|
||||
$share_media = esc_html( $first_image );
|
||||
} else {
|
||||
if ( isset( $shariff3uu['default_pinterest'] ) ) {
|
||||
$share_media = $shariff3uu['default_pinterest'];
|
||||
} else {
|
||||
$share_media = plugins_url( '/images/defaultHint.png', dirname( __FILE__ ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&media=' . rawurlencode( $share_media ) . '&description=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#cb2027';
|
||||
$secondary_color = '#e70f18';
|
||||
$wcag_color = '#AE1920';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 32"><path fill="' . $main_color . '" d="M27.4 16q0 3.7-1.8 6.9t-5 5-6.9 1.9q-2 0-3.9-0.6 1.1-1.7 1.4-2.9 0.2-0.6 1-3.8 0.4 0.7 1.3 1.2t2 0.5q2.1 0 3.8-1.2t2.7-3.4 0.9-4.8q0-2-1.1-3.8t-3.1-2.9-4.5-1.2q-1.9 0-3.5 0.5t-2.8 1.4-2 2-1.2 2.3-0.4 2.4q0 1.9 0.7 3.3t2.1 2q0.5 0.2 0.7-0.4 0-0.1 0.1-0.5t0.2-0.5q0.1-0.4-0.2-0.8-0.9-1.1-0.9-2.7 0-2.7 1.9-4.6t4.9-2q2.7 0 4.2 1.5t1.5 3.8q0 3-1.2 5.2t-3.1 2.1q-1.1 0-1.7-0.8t-0.4-1.9q0.1-0.6 0.5-1.7t0.5-1.8 0.2-1.4q0-0.9-0.5-1.5t-1.4-0.6q-1.1 0-1.9 1t-0.8 2.6q0 1.3 0.4 2.2l-1.8 7.5q-0.3 1.2-0.2 3.2-3.7-1.6-6-5t-2.3-7.6q0-3.7 1.9-6.9t5-5 6.9-1.9 6.9 1.9 5 5 1.8 6.9z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'merken',
|
||||
'en' => 'save',
|
||||
'es' => 'ahorrar',
|
||||
'fr' => 'enregistrer',
|
||||
'it' => 'salva',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Pinterest',
|
||||
'cs' => 'Přidat na Pinterest',
|
||||
'da' => 'Del på Pinterest',
|
||||
'de' => 'Bei Pinterest pinnen',
|
||||
'en' => 'Pin it on Pinterest',
|
||||
'es' => 'Ahorrar en Pinterest',
|
||||
'fi' => 'Jaa Pinterestissä',
|
||||
'fr' => 'Partager sur Pinterest',
|
||||
'hr' => 'Podijelite na Pinterest',
|
||||
'hu' => 'Megosztás Pinteresten',
|
||||
'it' => 'Condividi su Pinterest',
|
||||
'ja' => 'Pinterest上で共有',
|
||||
'ko' => 'Pinterest에서 공유하기',
|
||||
'nl' => 'Delen op Pinterest',
|
||||
'no' => 'Del på Pinterest',
|
||||
'pl' => 'Udostępnij przez Pinterest',
|
||||
'pt' => 'Compartilhar no Pinterest',
|
||||
'ro' => 'Partajează pe Pinterest',
|
||||
'ru' => 'Поделиться на Pinterest',
|
||||
'sk' => 'Zdieľať na Pinterest',
|
||||
'sl' => 'Deli na Pinterest',
|
||||
'sr' => 'Podeli na Pinterest-u',
|
||||
'sv' => 'Dela på Pinterest',
|
||||
'tr' => 'Pinterest\'ta paylaş',
|
||||
'zh' => '分享至Pinterest',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch counts.
|
||||
$pinterest = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://api.pinterest.com/v1/urls/count.json?callback=x&url=' . $post_url ) ) );
|
||||
$pinterest_json = rtrim( substr( $pinterest, 2 ), ')' );
|
||||
$pinterest_json = json_decode( $pinterest_json, true );
|
||||
|
||||
// Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $pinterest_json['count'] ) ) {
|
||||
$share_counts['pinterest'] = intval( $pinterest_json['count'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['pinterest'] = $pinterest;
|
||||
}
|
||||
}
|
||||
66
wp-content/plugins/shariff/services/shariff-pocket.php
Normal file
66
wp-content/plugins/shariff/services/shariff-pocket.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Pocket is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://getpocket.com/save' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#ff0000';
|
||||
$secondary_color = '#444';
|
||||
$wcag_color = '#B30000';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 28"><path fill="' . $main_color . '" d="M24.5 2q1 0 1.7 0.7t0.7 1.7v8.1q0 2.8-1.1 5.3t-2.9 4.3-4.3 2.9-5.2 1.1q-2.7 0-5.2-1.1t-4.3-2.9-2.9-4.3-1.1-5.2v-8.1q0-1 0.7-1.7t1.7-0.7h22zM13.5 18.6q0.7 0 1.3-0.5l6.3-6.1q0.6-0.5 0.6-1.3 0-0.8-0.5-1.3t-1.3-0.5q-0.7 0-1.3 0.5l-5 4.8-5-4.8q-0.5-0.5-1.3-0.5-0.8 0-1.3 0.5t-0.5 1.3q0 0.8 0.6 1.3l6.3 6.1q0.5 0.5 1.3 0.5z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 0;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'Pocket',
|
||||
'en' => 'pocket',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Запазване в Pocket',
|
||||
'cs' => 'Uložit do Pocket',
|
||||
'da' => 'Gem i Pocket',
|
||||
'de' => 'Bei Pocket speichern',
|
||||
'en' => 'Save to Pocket',
|
||||
'es' => 'Guardar en Pocket',
|
||||
'fi' => 'Tallenna kohtaan Pocket',
|
||||
'fr' => 'Enregistrer dans Pocket',
|
||||
'hr' => 'Spremi u Pocket',
|
||||
'hu' => 'Mentés "Pocket"-be',
|
||||
'it' => 'Salva in Pocket',
|
||||
'ja' => '「ポケット」に保存',
|
||||
'ko' => 'Pocket에 저장',
|
||||
'nl' => 'Opslaan in Pocket',
|
||||
'no' => 'Lagre i Pocket',
|
||||
'pl' => 'Zapisz w Pocket',
|
||||
'pt' => 'Salvar em Pocket',
|
||||
'ro' => 'Salvați în Pocket',
|
||||
'ru' => 'Сохранить в Pocket',
|
||||
'sk' => 'Uložiť do priečinka Pocket',
|
||||
'sl' => 'Shrani v Pocket',
|
||||
'sr' => 'Sačuvaj u Pocket',
|
||||
'sv' => 'Spara till Pocket',
|
||||
'tr' => 'Pocket e kaydet',
|
||||
'zh' => '保存到Pocket',
|
||||
);
|
||||
}
|
||||
53
wp-content/plugins/shariff/services/shariff-printer.php
Normal file
53
wp-content/plugins/shariff/services/shariff-printer.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Printer is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
|
||||
// Build button URL.
|
||||
$button_url = 'javascript:window.print()';
|
||||
|
||||
// Colors.
|
||||
$main_color = '#999';
|
||||
$secondary_color = '#a8a8a8';
|
||||
$wcag_color = '#595959';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 32"><path fill="' . $main_color . '" d="M6.8 27.4h16v-4.6h-16v4.6zM6.8 16h16v-6.8h-2.8q-0.7 0-1.2-0.5t-0.5-1.2v-2.8h-11.4v11.4zM27.4 17.2q0-0.5-0.3-0.8t-0.8-0.4-0.8 0.4-0.3 0.8 0.3 0.8 0.8 0.3 0.8-0.3 0.3-0.8zM29.7 17.2v7.4q0 0.2-0.2 0.4t-0.4 0.2h-4v2.8q0 0.7-0.5 1.2t-1.2 0.5h-17.2q-0.7 0-1.2-0.5t-0.5-1.2v-2.8h-4q-0.2 0-0.4-0.2t-0.2-0.4v-7.4q0-1.4 1-2.4t2.4-1h1.2v-9.7q0-0.7 0.5-1.2t1.2-0.5h12q0.7 0 1.6 0.4t1.3 0.8l2.7 2.7q0.5 0.5 0.9 1.4t0.4 1.6v4.6h1.1q1.4 0 2.4 1t1 2.4z"/></svg>';
|
||||
|
||||
// Same window?
|
||||
$same_window = 1;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'cs' => 'tlačit',
|
||||
'de' => 'drucken',
|
||||
'en' => 'print',
|
||||
'fr' => 'imprimer',
|
||||
'es' => 'imprimir',
|
||||
'it' => 'imprimere',
|
||||
'da' => 'dat trykke',
|
||||
'nl' => 'drukken',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'drucken',
|
||||
'cs' => 'tlačit',
|
||||
'en' => 'print',
|
||||
'fr' => 'imprimer',
|
||||
'es' => 'imprimir',
|
||||
'it' => 'imprimere',
|
||||
'da' => 'dat trykke',
|
||||
'nl' => 'drukken',
|
||||
);
|
||||
}
|
||||
57
wp-content/plugins/shariff/services/shariff-qzone.php
Normal file
57
wp-content/plugins/shariff/services/shariff-qzone.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Qzone is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#ffce00';
|
||||
$secondary_color = '#71C5F2';
|
||||
$wcag_color = '#6B5700';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="98" height="98" viewBox="0 0 97.7 97.7"><path fill="' . $main_color . '" d="M97.6 37.8c-0.2-0.8-0.9-1.3-1.7-1.4l-31.4-2.9L50.8 3.5c-0.3-0.7-1.1-1.2-1.9-1.2 -0.8 0-1.6 0.5-1.9 1.2L33 32.8 1.8 36.4c-0.8 0.1-1.5 0.6-1.7 1.4 -0.2 0.8 0 1.6 0.6 2.1l23 21.1L18.1 93c-0.2 0.8 0.1 1.6 0.8 2.1 0.4 0.3 0.8 0.4 1.2 0.4 0.4 0 0.7-0.1 1-0.3l28.1-16.1 27.6 16.3c0.7 0.2 1.6 0.2 2.2-0.3 0.7-0.5 1-1.2 0.8-2l-4.2-23.6c1.1-0.5 4.3-1.9 6.1-3.9 -2.8 1.1-3.8 1.4-6.6 1.9v0c-18.6 3.6-47 0.5-48 0.5L58.3 45c-10.6-1.9-35.1-2.7-36.6-2.8 -0.2 0-0.2 0-0.1 0 0 0 0 0 0.1 0 1.3-0.2 33.3-5.5 51.9-0.2L42.1 64.1c0 0 24.3 2.4 32.8 1.4l-0.6-4.4 22.8-21.2C97.6 39.3 97.8 38.5 97.6 37.8z"/></svg>';
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Qzone',
|
||||
'cs' => 'Sdílet na Qzone',
|
||||
'da' => 'Del på Qzone',
|
||||
'de' => 'Bei Qzone teilen',
|
||||
'en' => 'Share on Qzone',
|
||||
'es' => 'Compartir en Qzone',
|
||||
'fi' => 'Jaa Qzoneissä',
|
||||
'fr' => 'Partager sur Qzone',
|
||||
'hr' => 'Podijelite na Qzone',
|
||||
'hu' => 'Megosztás Qzone',
|
||||
'it' => 'Condividi su Qzone',
|
||||
'ja' => 'Qzone上で共有',
|
||||
'ko' => 'Qzone에서 공유하기',
|
||||
'nl' => 'Delen op Qzone',
|
||||
'no' => 'Del på Qzone',
|
||||
'pl' => 'Udostępnij przez Qzone',
|
||||
'pt' => 'Compartilhar no Qzone',
|
||||
'ro' => 'Partajează pe Qzone',
|
||||
'ru' => 'Поделиться на Qzone',
|
||||
'sk' => 'Zdieľať na Qzone',
|
||||
'sl' => 'Deli na Qzone',
|
||||
'sr' => 'Podeli na Qzone-u',
|
||||
'sv' => 'Dela på Qzone',
|
||||
'tr' => 'Qzone\'ta paylaş',
|
||||
'zh' => '分享至QQ空间',
|
||||
);
|
||||
}
|
||||
75
wp-content/plugins/shariff/services/shariff-reddit.php
Normal file
75
wp-content/plugins/shariff/services/shariff-reddit.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Reddit is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.reddit.com/submit' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#ff4500';
|
||||
$secondary_color = '#ff5700';
|
||||
$wcag_color = '#A32D00';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="' . $main_color . '" d="M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Reddit',
|
||||
'cs' => 'Sdílet na Redditu',
|
||||
'da' => 'Del på Reddit',
|
||||
'de' => 'Bei Reddit teilen',
|
||||
'en' => 'Share on Reddit',
|
||||
'es' => 'Compartir en Reddit',
|
||||
'fi' => 'Jaa Redditissä',
|
||||
'fr' => 'Partager sur Reddit',
|
||||
'hr' => 'Podijelite na Reddit',
|
||||
'hu' => 'Megosztás Redditen',
|
||||
'it' => 'Condividi su Reddit',
|
||||
'ja' => 'Reddit上で共有',
|
||||
'ko' => 'Reddit에서 공유하기',
|
||||
'nl' => 'Delen op Reddit',
|
||||
'no' => 'Del på Reddit',
|
||||
'pl' => 'Udostępnij przez Reddit',
|
||||
'pt' => 'Compartilhar no Reddit',
|
||||
'ro' => 'Partajează pe Reddit',
|
||||
'ru' => 'Поделиться на Reddit',
|
||||
'sk' => 'Zdieľať na Reddit',
|
||||
'sl' => 'Deli na Reddit',
|
||||
'sr' => 'Podeli na Reddit-u',
|
||||
'sv' => 'Dela på Reddit',
|
||||
'tr' => 'Reddit\'ta paylaş',
|
||||
'zh' => '分享至Reddit',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch counts.
|
||||
$reddit = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://www.reddit.com/api/info.json?url=' . $post_url ) ) );
|
||||
$reddit_json = json_decode( $reddit, true );
|
||||
|
||||
// Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $reddit_json['data']['children'] ) ) {
|
||||
$count = 0;
|
||||
foreach ( $reddit_json['data']['children'] as $child ) {
|
||||
$count += intval( $child['data']['score'] );
|
||||
}
|
||||
$share_counts['reddit'] = $count;
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['reddit'] = $reddit;
|
||||
}
|
||||
}
|
||||
46
wp-content/plugins/shariff/services/shariff-rss.php
Normal file
46
wp-content/plugins/shariff/services/shariff-rss.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when RSS is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
if ( array_key_exists( 'rssfeed', $atts ) ) {
|
||||
$service_url = esc_url( $atts['rssfeed'] );
|
||||
} else {
|
||||
$service_url = esc_url( get_bloginfo( 'rss_url' ) );
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#fe9312';
|
||||
$secondary_color = '#ff8c00';
|
||||
$wcag_color = '#aa2e00';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M4.3 23.5c-2.3 0-4.3 1.9-4.3 4.3 0 2.3 1.9 4.2 4.3 4.2 2.4 0 4.3-1.9 4.3-4.2 0-2.3-1.9-4.3-4.3-4.3zM0 10.9v6.1c4 0 7.7 1.6 10.6 4.4 2.8 2.8 4.4 6.6 4.4 10.6h6.2c0-11.7-9.5-21.1-21.1-21.1zM0 0v6.1c14.2 0 25.8 11.6 25.8 25.9h6.2c0-17.6-14.4-32-32-32z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'RSS-feed',
|
||||
'en' => 'RSS feed',
|
||||
'fr' => 'flux RSS',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'RSS-feed',
|
||||
'en' => 'RSS feed',
|
||||
'fr' => "S'abonner au flux RSS",
|
||||
);
|
||||
}
|
||||
60
wp-content/plugins/shariff/services/shariff-sms.php
Normal file
60
wp-content/plugins/shariff/services/shariff-sms.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when SMS is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = 'sms:';
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?&body=' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#a1e877';
|
||||
$secondary_color = '#d7d9d8';
|
||||
$wcag_color = '#31640C';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="510" height="510" viewBox="0 0 510 510"><path fill="' . $main_color . '" d="M459 0H51C23 0 0 23 0 51v459l102-102h357c28.1 0 51-22.9 51-51V51C510 23 487.1 0 459 0zM178.5 229.5h-51v-51h51V229.5zM280.5 229.5h-51v-51h51V229.5zM382.5 229.5h-51v-51h51V229.5z"/></svg>';
|
||||
|
||||
// Mobile only?
|
||||
$mobile_only = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в SMS',
|
||||
'cs' => 'Sdílet na SMS',
|
||||
'da' => 'Del på SMS',
|
||||
'de' => 'Per SMS teilen',
|
||||
'en' => 'Share on SMS',
|
||||
'es' => 'Compartir en SMS',
|
||||
'fi' => 'Jaa SMS',
|
||||
'fr' => 'Partager sur SMS',
|
||||
'hr' => 'Podijelite na SMS',
|
||||
'hu' => 'Megosztás SMS',
|
||||
'it' => 'Condividi su SMS',
|
||||
'ja' => 'SMS上で共有',
|
||||
'ko' => 'SMS에서 공유하기',
|
||||
'nl' => 'Delen op SMS',
|
||||
'no' => 'Del på SMS',
|
||||
'pl' => 'Udostępnij przez SMS',
|
||||
'pt' => 'Compartilhar no SMS',
|
||||
'ro' => 'Partajează pe SMS',
|
||||
'ru' => 'Поделиться на SMS',
|
||||
'sk' => 'Zdieľať na SMS',
|
||||
'sl' => 'Deli na SMS',
|
||||
'sr' => 'Podeli na SMS-u',
|
||||
'sv' => 'Dela på SMS',
|
||||
'tr' => 'SMS\'ta paylaş',
|
||||
'zh' => '在WSMS上分享',
|
||||
);
|
||||
}
|
||||
61
wp-content/plugins/shariff/services/shariff-telegram.php
Normal file
61
wp-content/plugins/shariff/services/shariff-telegram.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Telegram is requested as a service.
|
||||
* Thanks to Daniel Sturm (@dcsturm).
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = 'https://telegram.me/share/url';
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&text=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#0088cc';
|
||||
$secondary_color = '#4084A6';
|
||||
$wcag_color = '#005E8F';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M30.8 6.5l-4.5 21.4c-.3 1.5-1.2 1.9-2.5 1.2L16.9 24l-3.3 3.2c-.4.4-.7.7-1.4.7l.5-7L25.5 9.2c.6-.5-.1-.8-.9-.3l-15.8 10L2 16.7c-1.5-.5-1.5-1.5.3-2.2L28.9 4.3c1.3-.5 2.3.3 1.9 2.2z"/></svg>';
|
||||
|
||||
// Mobile only?
|
||||
$mobile_only = 0;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Telegram',
|
||||
'cs' => 'Sdílet na Telegramu',
|
||||
'da' => 'Del på Telegram',
|
||||
'de' => 'Bei Telegram teilen',
|
||||
'en' => 'Share on Telegram',
|
||||
'es' => 'Compartir en Telegram',
|
||||
'fi' => 'Jaa Telegramissä',
|
||||
'fr' => 'Partager sur Telegram',
|
||||
'hr' => 'Podijelite na Telegram',
|
||||
'hu' => 'Megosztás Telegramen',
|
||||
'it' => 'Condividi su Telegram',
|
||||
'ja' => 'Telegram上で共有',
|
||||
'ko' => 'Telegram에서 공유하기',
|
||||
'nl' => 'Delen op Telegram',
|
||||
'no' => 'Del på Telegram',
|
||||
'pl' => 'Udostępnij przez Telegram',
|
||||
'pt' => 'Compartilhar no Telegram',
|
||||
'ro' => 'Partajează pe Telegram',
|
||||
'ru' => 'Поделиться на Telegram',
|
||||
'sk' => 'Zdieľať na Telegram',
|
||||
'sl' => 'Deli na Telegram',
|
||||
'sr' => 'Podeli na Telegram-u',
|
||||
'sv' => 'Dela på Telegram',
|
||||
'tr' => 'Telegram\'ta paylaş',
|
||||
'zh' => '在Telegram上分享',
|
||||
);
|
||||
}
|
||||
57
wp-content/plugins/shariff/services/shariff-tencentweibo.php
Normal file
57
wp-content/plugins/shariff/services/shariff-tencentweibo.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when TencentWeibo is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'http://v.t.qq.com/share/share.php' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#02a8f3';
|
||||
$secondary_color = '#8ac249';
|
||||
$wcag_color = '#025C88';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="94" height="94" viewBox="0 0 94.1 94.1"><path fill="' . $main_color . '" d="M25.9 9.4C11.6 9.4 0 21 0 35.3c0 4.8 1.3 9.4 3.8 13.5l0.9 1.4 4.6-3.4L8.5 45.3c-1.7-3-2.7-6.5-2.7-10 0-11 9-20 20-20 11 0 20 9 20 20 0 11-9 20-20 20 -2 0-4-0.3-5.9-0.9l-1.7 5.6c2.5 0.8 5 1.1 7.6 1.1 14.3 0 25.9-11.6 25.9-25.9C51.8 21 40.2 9.4 25.9 9.4z"/><path d="M22.2 43.4l0.6-0.5c1 0.5 2.2 0.8 3.4 0.8 4.6 0 8.3-3.7 8.3-8.3 0-4.6-3.7-8.3-8.3-8.3s-8.3 3.7-8.3 8.3c0 1.2 0.3 2.3 0.7 3.4 0 0 0.1 0.6 0.8 1.2C4.2 53.1 3.1 69.4 3.1 70.2v18h5.9V70.2C8.9 70.1 9.3 54.1 22.2 43.4z"/><path d="M72.9 31.3c-1.9 0.1-3.8-0.3-5.6-1.2 -5.4-2.8-7.6-9.4-4.9-14.9 2.8-5.4 9.4-7.6 14.9-4.9 5.4 2.8 7.6 9.4 4.9 14.9 -0.5 1-1.1 1.9-1.9 2.7l2.3 2.2c1-1 1.8-2.2 2.5-3.5 3.6-7 0.7-15.7-6.3-19.2 -7-3.6-15.7-0.7-19.2 6.3 -3.6 7-0.7 15.7 6.3 19.2 2.4 1.2 5 1.7 7.6 1.5l0.9-0.1 -0.5-3.1L72.9 31.3z"/><path fill="' . $main_color . '" d="M85.3 37.4c-0.1 0-7.9-4.2-9.9-13.2l-0.1-0.5c0.5-0.4 0.9-0.9 1.2-1.5 1.1-2.3 0.2-5-2-6.2 -2.3-1.1-5-0.2-6.2 2 -1.1 2.3-0.2 5 2 6.2 0.6 0.3 1.2 0.5 1.8 0.5 0 0 0.3 0.1 0.8-0.1 2.7 10.8 10.4 15.4 10.8 15.6l8.8 4.5 1.5-2.9L85.3 37.4z"/></svg>';
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в tencent weibo',
|
||||
'cs' => 'Sdílet na tencent weibo',
|
||||
'da' => 'Del på tencent weibo',
|
||||
'de' => 'Bei tencent weibo teilen',
|
||||
'en' => 'Share on tencent weibo',
|
||||
'es' => 'Compartir en tencent weibo',
|
||||
'fi' => 'Jaa tencent weiboissä',
|
||||
'fr' => 'Partager sur tencent weibo',
|
||||
'hr' => 'Podijelite na tencent weibo',
|
||||
'hu' => 'Megosztás tencent weiboen',
|
||||
'it' => 'Condividi su tencent weibo',
|
||||
'ja' => 'Tencent weibo上で共有',
|
||||
'ko' => 'Tencent weibo에서 공유하기',
|
||||
'nl' => 'Delen op tencent weibo',
|
||||
'no' => 'Del på tencent weibo',
|
||||
'pl' => 'Udostępnij przez tencent weibo',
|
||||
'pt' => 'Compartilhar no tencent weibo',
|
||||
'ro' => 'Partajează pe tencent weibo',
|
||||
'ru' => 'Поделиться на tencent weibo',
|
||||
'sk' => 'Zdieľať na tencent weibo',
|
||||
'sl' => 'Deli na tencent weibo',
|
||||
'sr' => 'Podeli na tencent weibo-u',
|
||||
'sv' => 'Dela på tencent weibo',
|
||||
'tr' => 'Tencent weibo\'ta paylaş',
|
||||
'zh' => '分享至腾讯微博',
|
||||
);
|
||||
}
|
||||
60
wp-content/plugins/shariff/services/shariff-threema.php
Normal file
60
wp-content/plugins/shariff/services/shariff-threema.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Threema is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = 'threema://compose';
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?text=' . $share_title . '%20' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#1f1f1f';
|
||||
$secondary_color = '#4fbc24';
|
||||
$wcag_color = '#1f1f1f';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M30.8 10.9c-0.3-1.4-0.9-2.6-1.8-3.8-2-2.6-5.5-4.5-9.4-5.2-1.3-0.2-1.9-0.3-3.5-0.3s-2.2 0-3.5 0.3c-4 0.7-7.4 2.6-9.4 5.2-0.9 1.2-1.5 2.4-1.8 3.8-0.1 0.5-0.2 1.2-0.2 1.6 0 0.4 0.1 1.1 0.2 1.6 0.4 1.9 1.3 3.4 2.9 5 0.8 0.8 0.8 0.8 0.7 1.3 0 0.6-0.5 1.6-1.7 3.6-0.3 0.5-0.5 0.9-0.5 0.9 0 0.1 0.1 0.1 0.5 0 0.8-0.2 2.3-0.6 5.6-1.6 1.1-0.3 1.3-0.4 2.3-0.4 0.8 0 1.1 0 2.3 0.2 1.5 0.2 3.5 0.2 4.9 0 5.1-0.6 9.3-2.9 11.4-6.3 0.5-0.9 0.9-1.8 1.1-2.8 0.1-0.5 0.2-1.1 0.2-1.6 0-0.7-0.1-1.1-0.2-1.6-0.3-1.4 0.1 0.5 0 0zM20.6 17.3c0 0.4-0.4 0.8-0.8 0.8h-7.7c-0.4 0-0.8-0.4-0.8-0.8v-4.6c0-0.4 0.4-0.8 0.8-0.8h0.2l0-1.6c0-0.9 0-1.8 0.1-2 0.1-0.6 0.6-1.2 1.1-1.7s1.1-0.7 1.9-0.8c1.8-0.3 3.7 0.7 4.2 2.2 0.1 0.3 0.1 0.7 0.1 2.1v0 1.7h0.1c0.4 0 0.8 0.4 0.8 0.8v4.6zM15.6 7.3c-0.5 0.1-0.8 0.3-1.2 0.6s-0.6 0.8-0.7 1.3c0 0.2 0 0.8 0 1.5l0 1.2h4.6v-1.3c0-1 0-1.4-0.1-1.6-0.3-1.1-1.5-1.9-2.6-1.7zM25.8 28.2c0 1.2-1 2.2-2.1 2.2s-2.1-1-2.1-2.1c0-1.2 1-2.1 2.2-2.1s2.2 1 2.2 2.2zM18.1 28.2c0 1.2-1 2.2-2.1 2.2s-2.1-1-2.1-2.1c0-1.2 1-2.1 2.2-2.1s2.2 1 2.2 2.2zM10.4 28.2c0 1.2-1 2.2-2.1 2.2s-2.1-1-2.1-2.1c0-1.2 1-2.1 2.2-2.1s2.2 1 2.2 2.2z"/></svg>';
|
||||
|
||||
// Mobile only?
|
||||
$mobile_only = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Threema',
|
||||
'cs' => 'Sdílet na Threema',
|
||||
'da' => 'Del på Threema',
|
||||
'de' => 'Bei Threema teilen',
|
||||
'en' => 'Share on Threema',
|
||||
'es' => 'Compartir en Threema',
|
||||
'fi' => 'Jaa Threemaissä',
|
||||
'fr' => 'Partager sur Threema',
|
||||
'hr' => 'Podijelite na Threema',
|
||||
'hu' => 'Megosztás Threemaen',
|
||||
'it' => 'Condividi su Threema',
|
||||
'ja' => 'Threema上で共有',
|
||||
'ko' => 'Threema에서 공유하기',
|
||||
'nl' => 'Delen op Threema',
|
||||
'no' => 'Del på Threema',
|
||||
'pl' => 'Udostępnij przez Threema',
|
||||
'pt' => 'Compartilhar no Threema',
|
||||
'ro' => 'Partajează pe Threema',
|
||||
'ru' => 'Поделиться на Threema',
|
||||
'sk' => 'Zdieľať na Threema',
|
||||
'sl' => 'Deli na Threema',
|
||||
'sr' => 'Podeli na Threema-u',
|
||||
'sv' => 'Dela på Threema',
|
||||
'tr' => 'Threema\'ta paylaş',
|
||||
'zh' => '在Threema上分享',
|
||||
);
|
||||
}
|
||||
80
wp-content/plugins/shariff/services/shariff-tumblr.php
Normal file
80
wp-content/plugins/shariff/services/shariff-tumblr.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Tumblr is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.tumblr.com/widgets/share/tool' );
|
||||
|
||||
// Domain.
|
||||
$wpurl = get_bloginfo( 'wpurl' );
|
||||
$domainname = trim( $wpurl, '/' );
|
||||
if ( ! preg_match( '#^http(s)?://#', $domainname ) ) {
|
||||
$domainname = 'http://' . $domainname;
|
||||
}
|
||||
$url_parts = wp_parse_url( $domainname );
|
||||
$domainname = preg_replace( '/^www\./', '', $url_parts['host'] );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?posttype=link&canonicalUrl=' . $share_url . '&tags=' . rawurlencode( $domainname );
|
||||
|
||||
// Colors.
|
||||
$main_color = '#36465d';
|
||||
$secondary_color = '#529ecc';
|
||||
$wcag_color = '#36465d';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M18 14l0 7.3c0 1.9 0 2.9 0.2 3.5 0.2 0.5 0.7 1.1 1.2 1.4 0.7 0.4 1.5 0.6 2.4 0.6 1.6 0 2.6-0.2 4.2-1.3v4.8c-1.4 0.6-2.6 1-3.7 1.3-1.1 0.3-2.3 0.4-3.6 0.4-1.5 0-2.3-0.2-3.4-0.6-1.1-0.4-2.1-0.9-2.9-1.6-0.8-0.7-1.3-1.4-1.7-2.2s-0.5-1.9-0.5-3.4v-11.2h-4.3v-4.5c1.3-0.4 2.7-1 3.6-1.8 0.9-0.8 1.6-1.7 2.2-2.7 0.5-1.1 0.9-2.4 1.1-4.1h5.2l0 8h8v6h-8z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в tumblr',
|
||||
'cs' => 'Sdílet na tumblru',
|
||||
'da' => 'Del på tumblr',
|
||||
'de' => 'Bei tumblr teilen',
|
||||
'en' => 'Share on tumblr',
|
||||
'es' => 'Compartir en tumblr',
|
||||
'fi' => 'Jaa tumblrissä',
|
||||
'fr' => 'Partager sur tumblr',
|
||||
'hr' => 'Podijelite na tumblr',
|
||||
'hu' => 'Megosztás tumblren',
|
||||
'it' => 'Condividi su tumblr',
|
||||
'ja' => 'tumblr上で共有',
|
||||
'ko' => 'tumblr에서 공유하기',
|
||||
'nl' => 'Delen op tumblr',
|
||||
'no' => 'Del på tumblr',
|
||||
'pl' => 'Udostępnij przez tumblr',
|
||||
'pt' => 'Compartilhar no tumblr',
|
||||
'ro' => 'Partajează pe tumblr',
|
||||
'ru' => 'Поделиться на tumblr',
|
||||
'sk' => 'Zdieľať na tumblr',
|
||||
'sl' => 'Deli na tumblr',
|
||||
'sr' => 'Podeli na tumblr-u',
|
||||
'sv' => 'Dela på tumblr',
|
||||
'tr' => 'tumblr\'ta paylaş',
|
||||
'zh' => '在tumblr上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch counts.
|
||||
$tumblr = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://api.tumblr.com/v2/share/stats?url=' . $post_url ) ) );
|
||||
$tumblr_json = json_decode( $tumblr, true );
|
||||
|
||||
// Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $tumblr_json['response']['note_count'] ) ) {
|
||||
$share_counts['tumblr'] = intval( $tumblr_json['response']['note_count'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['tumblr'] = $tumblr;
|
||||
}
|
||||
}
|
||||
91
wp-content/plugins/shariff/services/shariff-twitter.php
Normal file
91
wp-content/plugins/shariff/services/shariff-twitter.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Twitter is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://twitter.com/share' );
|
||||
|
||||
// Via tag.
|
||||
if ( array_key_exists( 'twitter_via', $atts ) ) {
|
||||
$twitter_via = '&via=' . esc_html( $atts['twitter_via'] );
|
||||
} else {
|
||||
$twitter_via = '';
|
||||
}
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&text=' . $share_title . $twitter_via;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#55acee';
|
||||
$secondary_color = '#32bbf5';
|
||||
$wcag_color = '#115A92';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 32"><path fill="' . $main_color . '" d="M29.7 6.8q-1.2 1.8-3 3.1 0 0.3 0 0.8 0 2.5-0.7 4.9t-2.2 4.7-3.5 4-4.9 2.8-6.1 1q-5.1 0-9.3-2.7 0.6 0.1 1.5 0.1 4.3 0 7.6-2.6-2-0.1-3.5-1.2t-2.2-3q0.6 0.1 1.1 0.1 0.8 0 1.6-0.2-2.1-0.4-3.5-2.1t-1.4-3.9v-0.1q1.3 0.7 2.8 0.8-1.2-0.8-2-2.2t-0.7-2.9q0-1.7 0.8-3.1 2.3 2.8 5.5 4.5t7 1.9q-0.2-0.7-0.2-1.4 0-2.5 1.8-4.3t4.3-1.8q2.7 0 4.5 1.9 2.1-0.4 3.9-1.5-0.7 2.2-2.7 3.4 1.8-0.2 3.5-0.9z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'twittern',
|
||||
'en' => 'tweet',
|
||||
'fr' => 'tweeter',
|
||||
'it' => 'twitta',
|
||||
'ja' => 'のつぶやき',
|
||||
'ko' => '짹짹',
|
||||
'ru' => 'твит',
|
||||
'sr' => 'твеет',
|
||||
'zh' => '鸣叫',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Twitter',
|
||||
'cs' => 'Sdílet na Twiiteru',
|
||||
'da' => 'Del på Twitter',
|
||||
'de' => 'Bei Twitter teilen',
|
||||
'en' => 'Share on Twitter',
|
||||
'es' => 'Compartir en Twitter',
|
||||
'fi' => 'Jaa Twitterissä',
|
||||
'fr' => 'Partager sur Twitter',
|
||||
'hr' => 'Podijelite na Twitteru',
|
||||
'hu' => 'Megosztás Twitteren',
|
||||
'it' => 'Condividi su Twitter',
|
||||
'ja' => 'ツイッター上で共有',
|
||||
'ko' => '트위터에서 공유하기',
|
||||
'nl' => 'Delen op Twitter',
|
||||
'no' => 'Del på Twitter',
|
||||
'pl' => 'Udostępnij na Twitterze',
|
||||
'pt' => 'Compartilhar no Twitter',
|
||||
'ro' => 'Partajează pe Twitter',
|
||||
'ru' => 'Поделиться на Twitter',
|
||||
'sk' => 'Zdieľať na Twitteri',
|
||||
'sl' => 'Deli na Twitterju',
|
||||
'sr' => 'Podeli na Twitter-u',
|
||||
'sv' => 'Dela på Twitter',
|
||||
'tr' => 'Twitter\'da paylaş',
|
||||
'zh' => '在Twitter上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch counts.
|
||||
$twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://counts.twitcount.com/counts.php?url=' . $post_url ) ) );
|
||||
$twitter_json = json_decode( $twitter, true );
|
||||
|
||||
// Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $twitter_json['count'] ) && ! isset( $twitter_json['error'] ) ) {
|
||||
$share_counts['twitter'] = intval( $twitter_json['count'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['twitter'] = $twitter;
|
||||
}
|
||||
}
|
||||
73
wp-content/plugins/shariff/services/shariff-vk.php
Normal file
73
wp-content/plugins/shariff/services/shariff-vk.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when VK is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://vk.com/share.php' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#527498';
|
||||
$secondary_color = '#4273c8';
|
||||
$wcag_color = '#3A5773';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 32"><path fill="' . $main_color . '" d="M34.2 9.3q0.4 1.1-2.7 5.3-0.4 0.6-1.2 1.5-1.4 1.8-1.6 2.3-0.3 0.7 0.3 1.4 0.3 0.4 1.4 1.5h0l0.1 0.1q2.5 2.3 3.4 3.9 0.1 0.1 0.1 0.2t0.1 0.5 0 0.6-0.4 0.5-1.1 0.2l-4.6 0.1q-0.4 0.1-1-0.1t-0.9-0.4l-0.4-0.2q-0.5-0.4-1.2-1.1t-1.2-1.4-1.1-1-1-0.3q-0.1 0-0.1 0.1t-0.3 0.3-0.4 0.5-0.3 0.9-0.1 1.4q0 0.3-0.1 0.5t-0.1 0.3l-0.1 0.1q-0.3 0.3-0.9 0.4h-2.1q-1.3 0.1-2.6-0.3t-2.3-0.9-1.8-1.2-1.3-1l-0.4-0.4q-0.2-0.2-0.5-0.5t-1.3-1.6-1.9-2.7-2.2-3.8-2.3-4.9q-0.1-0.3-0.1-0.5t0.1-0.3l0.1-0.1q0.3-0.3 1-0.3l4.9 0q0.2 0 0.4 0.1t0.3 0.2l0.1 0.1q0.3 0.2 0.4 0.6 0.4 0.9 0.8 1.8t0.7 1.5l0.3 0.5q0.5 1.1 1 1.9t0.9 1.2 0.7 0.7 0.6 0.3 0.5-0.1q0 0 0.1-0.1t0.2-0.4 0.2-0.8 0.2-1.4 0-2.2q0-0.7-0.2-1.3t-0.2-0.8l-0.1-0.2q-0.4-0.6-1.5-0.8-0.2 0 0.1-0.4 0.3-0.3 0.7-0.5 0.9-0.5 4.3-0.4 1.5 0 2.4 0.2 0.4 0.1 0.6 0.2t0.4 0.4 0.2 0.6 0.1 0.8 0 1 0 1.3 0 1.5q0 0.2 0 0.8t0 0.9 0.1 0.7 0.2 0.7 0.4 0.4q0.1 0 0.3 0.1t0.5-0.2 0.7-0.6 0.9-1.2 1.2-1.9q1.1-1.9 1.9-4 0.1-0.2 0.2-0.3t0.2-0.2l0.1-0.1 0.1 0t0.2-0.1 0.4 0l5.1 0q0.7-0.1 1.1 0t0.6 0.3z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели във VK',
|
||||
'cs' => 'Sdílet na VKu',
|
||||
'da' => 'Del på VK',
|
||||
'de' => 'Bei VK teilen',
|
||||
'en' => 'Share on VK',
|
||||
'es' => 'Compartir en VK',
|
||||
'fi' => 'Jaa VKissa',
|
||||
'fr' => 'Partager sur VK',
|
||||
'hr' => 'Podijelite na VKu',
|
||||
'hu' => 'Megosztás VKon',
|
||||
'it' => 'Condividi su VK',
|
||||
'ja' => 'フェイスブック上で共有',
|
||||
'ko' => '페이스북에서 공유하기',
|
||||
'nl' => 'Delen op VK',
|
||||
'no' => 'Del på VK',
|
||||
'pl' => 'Udostępnij na VKu',
|
||||
'pt' => 'Compartilhar no VK',
|
||||
'ro' => 'Partajează pe VK',
|
||||
'ru' => 'Поделиться на ВКонтакте',
|
||||
'sk' => 'Zdieľať na VKu',
|
||||
'sl' => 'Deli na VKu',
|
||||
'sr' => 'Podeli na VK-u',
|
||||
'sv' => 'Dela på VK',
|
||||
'tr' => 'VK\'ta paylaş',
|
||||
'zh' => '在VK上分享',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Fetch counts.
|
||||
$vk = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://vk.com/share.php?act=count&url=' . $post_url ) ) );
|
||||
if ( isset( $vk ) ) {
|
||||
preg_match( '/^VK.Share.count\((\d+),\s+(\d+)\);$/i', $vk, $matches );
|
||||
$vk_count = intval( $matches[2] );
|
||||
}
|
||||
// Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $vk_count ) ) {
|
||||
$share_counts['vk'] = $vk_count;
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['vk'] = $vk;
|
||||
}
|
||||
}
|
||||
40
wp-content/plugins/shariff/services/shariff-wallabag.php
Normal file
40
wp-content/plugins/shariff/services/shariff-wallabag.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Wallabag is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://app.wallabag.it/bookmarklet' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#26a69a';
|
||||
$secondary_color = '#2bbbad';
|
||||
$wcag_color = '#156058';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 500"><path fill="' . $main_color . '" d="M381 474l-5 7c-15 19-29 20-45 2-14-15-30-28-47-38a75 75 0 0 1-15-12c-8-8-10-19-8-30 2-8-2-12-8-16l-3 12c-8 33-31 51-64 57-36 6-73 7-109 5l-57-4c-9-1-9-1-7-9h46c28 0 55-1 82-9 45-14 67-49 62-96l-4-25 43 13q101 24 197-11c6-2 10-2 14 5l-49 53-15 15c-8 8-8 15 1 23l24 18 50 34c-8 20-26 26-43 14l-43-34c-14-10-23-25-31-39-3-4-6-6-10-5h-36c-5-1-8 1-9 6zM409 4l-6 49c-2 19-9 35-28 45l40 50c-13 9-26 11-40 12-19 0-36-6-54-11-16-4-34-9-51-11-10-2-20 0-31 1l30-38c-16-9-25-23-28-41l-1-15-3-41c21 5 38 16 51 33l11 16 22 29c10-9 19-18 24-29 12-26 32-42 60-48l4-1zm-19 187c12 9 17 20 16 35l-2 47c-3 31-26 48-57 40a114 114 0 0 1-11-3 44 44 0 0 0-28-1 110 110 0 0 1-28 5c-16 0-28-8-33-24-6-16-6-33-6-50v-14c-2-15 2-28 17-35 10 6 19 13 17 27v32c-1 14 5 25 16 33 15-12 16-28 15-45v-30c0-11 4-15 12-16 8-2 11 0 15 10 6 13 10 27 8 41-2 17 4 30 16 40 11-10 16-23 14-38v-16c0-21 1-24 19-38z"/></svg>';
|
||||
|
||||
// Button text label.
|
||||
$button_text_array = array(
|
||||
'de' => 'wallabag it',
|
||||
'en' => 'wallabag it',
|
||||
);
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'de' => 'Bei wallabag speichern',
|
||||
'en' => 'Save to wallabag',
|
||||
);
|
||||
}
|
||||
57
wp-content/plugins/shariff/services/shariff-weibo.php
Normal file
57
wp-content/plugins/shariff/services/shariff-weibo.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Weibo is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'http://service.weibo.com/share/share.php' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#e6162d';
|
||||
$secondary_color = '#ff9933';
|
||||
$wcag_color = '#AB1221';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96.7 96.7" width="97" height="97"><path fill="' . $main_color . '" d="M72.6 46.9c-1.4-0.4-2.3-0.7-1.6-2.5 1.5-3.9 1.7-7.2 0-9.6 -3.1-4.5-11.7-4.2-21.6-0.1 0 0-3.1 1.4-2.3-1.1 1.5-4.9 1.3-8.9-1.1-11.3 -5.3-5.3-19.5 0.2-31.7 12.4C5.3 43.8 0 53.4 0 61.8c0 16 20.5 25.7 40.6 25.7 26.3 0 43.8-15.3 43.8-27.4C84.4 52.8 78.2 48.6 72.6 46.9ZM40.6 81.8c-16 1.6-29.8-5.7-30.9-16.2 -1-10.5 11.1-20.3 27.1-21.9 16-1.6 29.8 5.7 30.9 16.2C68.8 70.4 56.6 80.2 40.6 81.8Z"/><path d="M90.1 17.6L90.1 17.6c-6.3-7-15.7-9.7-24.4-7.9h0c-2 0.4-3.3 2.4-2.8 4.4 0.4 2 2.4 3.3 4.4 2.8 6.2-1.3 12.8 0.6 17.3 5.6 4.5 5 5.7 11.8 3.8 17.8l0 0c-0.6 1.9 0.4 4 2.4 4.7 1.9 0.6 4-0.4 4.7-2.4 0 0 0 0 0 0C98.2 34.3 96.5 24.7 90.1 17.6Z"/><path d="M68.5 22.6c-1.7 0.4-2.8 2.1-2.4 3.8 0.4 1.7 2.1 2.8 3.8 2.4v0c2.1-0.4 4.3 0.2 5.8 1.9 1.5 1.7 1.9 4 1.3 6h0c-0.5 1.7 0.4 3.5 2.1 4 1.7 0.5 3.5-0.4 4-2.1 1.3-4.1 0.5-8.8-2.6-12.2C77.3 23 72.7 21.7 68.5 22.6Z"/><polygon points="80.4 26.4 80.4 26.4 80.4 26.4"/><path fill="' . $main_color . '" d="M42.2 51.8c-7.6-2-16.2 1.8-19.5 8.5 -3.4 6.8-0.1 14.4 7.6 16.9 8 2.6 17.4-1.4 20.6-8.8C54.1 61.3 50.1 53.9 42.2 51.8ZM36.4 69.3c-1.5 2.5-4.9 3.6-7.4 2.4 -2.5-1.1-3.2-4-1.6-6.4 1.5-2.4 4.7-3.5 7.2-2.4C37.1 64 37.9 66.8 36.4 69.3ZM41.5 62.8c-0.6 1-1.8 1.4-2.8 1 -1-0.4-1.3-1.5-0.7-2.4 0.6-0.9 1.7-1.4 2.7-1C41.7 60.7 42 61.8 41.5 62.8Z"/></svg>';
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в tencent weibo',
|
||||
'cs' => 'Sdílet na tencent weibo',
|
||||
'da' => 'Del på tencent weibo',
|
||||
'de' => 'Bei tencent weibo teilen',
|
||||
'en' => 'Share on tencent weibo',
|
||||
'es' => 'Compartir en tencent weibo',
|
||||
'fi' => 'Jaa tencent weiboissä',
|
||||
'fr' => 'Partager sur tencent weibo',
|
||||
'hr' => 'Podijelite na tencent weibo',
|
||||
'hu' => 'Megosztás tencent weiboen',
|
||||
'it' => 'Condividi su tencent weibo',
|
||||
'ja' => 'Tencent weibo上で共有',
|
||||
'ko' => 'Tencent weibo에서 공유하기',
|
||||
'nl' => 'Delen op tencent weibo',
|
||||
'no' => 'Del på tencent weibo',
|
||||
'pl' => 'Udostępnij przez tencent weibo',
|
||||
'pt' => 'Compartilhar no tencent weibo',
|
||||
'ro' => 'Partajează pe tencent weibo',
|
||||
'ru' => 'Поделиться на tencent weibo',
|
||||
'sk' => 'Zdieľať na tencent weibo',
|
||||
'sl' => 'Deli na tencent weibo',
|
||||
'sr' => 'Podeli na tencent weibo-u',
|
||||
'sv' => 'Dela på tencent weibo',
|
||||
'tr' => 'Tencent weibo\'ta paylaş',
|
||||
'zh' => '分享至腾讯微博',
|
||||
);
|
||||
}
|
||||
64
wp-content/plugins/shariff/services/shariff-whatsapp.php
Normal file
64
wp-content/plugins/shariff/services/shariff-whatsapp.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when WhatsApp is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = 'https://api.whatsapp.com/send';
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?text=' . $share_title . '%20' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#34af23';
|
||||
$secondary_color = '#5cbe4a';
|
||||
$wcag_color = '#226411';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M17.6 17.4q0.2 0 1.7 0.8t1.6 0.9q0 0.1 0 0.3 0 0.6-0.3 1.4-0.3 0.7-1.3 1.2t-1.8 0.5q-1 0-3.4-1.1-1.7-0.8-3-2.1t-2.6-3.3q-1.3-1.9-1.3-3.5v-0.1q0.1-1.6 1.3-2.8 0.4-0.4 0.9-0.4 0.1 0 0.3 0t0.3 0q0.3 0 0.5 0.1t0.3 0.5q0.1 0.4 0.6 1.6t0.4 1.3q0 0.4-0.6 1t-0.6 0.8q0 0.1 0.1 0.3 0.6 1.3 1.8 2.4 1 0.9 2.7 1.8 0.2 0.1 0.4 0.1 0.3 0 1-0.9t0.9-0.9zM14 26.9q2.3 0 4.3-0.9t3.6-2.4 2.4-3.6 0.9-4.3-0.9-4.3-2.4-3.6-3.6-2.4-4.3-0.9-4.3 0.9-3.6 2.4-2.4 3.6-0.9 4.3q0 3.6 2.1 6.6l-1.4 4.2 4.3-1.4q2.8 1.9 6.2 1.9zM14 2.2q2.7 0 5.2 1.1t4.3 2.9 2.9 4.3 1.1 5.2-1.1 5.2-2.9 4.3-4.3 2.9-5.2 1.1q-3.5 0-6.5-1.7l-7.4 2.4 2.4-7.2q-1.9-3.2-1.9-6.9 0-2.7 1.1-5.2t2.9-4.3 4.3-2.9 5.2-1.1z"/></svg>';
|
||||
|
||||
// Mobile only?
|
||||
if ( isset( $atts['hide_whatsapp'] ) && 1 === $atts['hide_whatsapp'] ) {
|
||||
$mobile_only = 1;
|
||||
} else {
|
||||
$mobile_only = 0;
|
||||
}
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в Whatsapp',
|
||||
'cs' => 'Sdílet na Whatsappu',
|
||||
'da' => 'Del på Whatsapp',
|
||||
'de' => 'Bei Whatsapp teilen',
|
||||
'en' => 'Share on Whatsapp',
|
||||
'es' => 'Compartir en Whatsapp',
|
||||
'fi' => 'Jaa WhatsAppissä',
|
||||
'fr' => 'Partager sur Whatsapp',
|
||||
'hr' => 'Podijelite na Whatsapp',
|
||||
'hu' => 'Megosztás WhatsAppen',
|
||||
'it' => 'Condividi su Whatsapp',
|
||||
'ja' => 'Whatsapp上で共有',
|
||||
'ko' => 'Whatsapp에서 공유하기',
|
||||
'nl' => 'Delen op Whatsapp',
|
||||
'no' => 'Del på Whatsapp',
|
||||
'pl' => 'Udostępnij przez WhatsApp',
|
||||
'pt' => 'Compartilhar no Whatsapp',
|
||||
'ro' => 'Partajează pe Whatsapp',
|
||||
'ru' => 'Поделиться на Whatsapp',
|
||||
'sk' => 'Zdieľať na Whatsapp',
|
||||
'sl' => 'Deli na Whatsapp',
|
||||
'sr' => 'Podeli na WhatsApp-u',
|
||||
'sv' => 'Dela på Whatsapp',
|
||||
'tr' => 'Whatsapp\'ta paylaş',
|
||||
'zh' => '在Whatsapp上分享',
|
||||
);
|
||||
}
|
||||
87
wp-content/plugins/shariff/services/shariff-xing.php
Normal file
87
wp-content/plugins/shariff/services/shariff-xing.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* Will be included in the shariff.php only, when Xing is requested as a service.
|
||||
*
|
||||
* @package Shariff Wrapper
|
||||
*/
|
||||
|
||||
// Prevent direct calls.
|
||||
if ( ! class_exists( 'WP' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
// Check if we need the frontend or the backend part.
|
||||
if ( isset( $frontend ) && 1 === $frontend ) {
|
||||
// Service URL.
|
||||
$service_url = esc_url( 'https://www.xing.com/spi/shares/new' );
|
||||
|
||||
// Build button URL.
|
||||
$button_url = $service_url . '?url=' . $share_url;
|
||||
|
||||
// Colors.
|
||||
$main_color = '#126567';
|
||||
$secondary_color = '#29888a';
|
||||
$wcag_color = '#0F595C';
|
||||
|
||||
// SVG icon.
|
||||
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path fill="' . $main_color . '" d="M10.7 11.9q-0.2 0.3-4.6 8.2-0.5 0.8-1.2 0.8h-4.3q-0.4 0-0.5-0.3t0-0.6l4.5-8q0 0 0 0l-2.9-5q-0.2-0.4 0-0.7 0.2-0.3 0.5-0.3h4.3q0.7 0 1.2 0.8zM25.1 0.4q0.2 0.3 0 0.7l-9.4 16.7 6 11q0.2 0.4 0 0.6-0.2 0.3-0.6 0.3h-4.3q-0.7 0-1.2-0.8l-6-11.1q0.3-0.6 9.5-16.8 0.4-0.8 1.2-0.8h4.3q0.4 0 0.5 0.3z"/></svg>';
|
||||
|
||||
// Backend available?
|
||||
$backend_available = 1;
|
||||
|
||||
// Button alt label.
|
||||
$button_title_array = array(
|
||||
'bg' => 'Сподели в XING',
|
||||
'cs' => 'Sdílet na XINGu',
|
||||
'da' => 'Del på XING',
|
||||
'de' => 'Bei XING teilen',
|
||||
'en' => 'Share on XING',
|
||||
'es' => 'Compartir en XING',
|
||||
'fi' => 'Jaa XINGissä',
|
||||
'fr' => 'Partager sur XING',
|
||||
'hr' => 'Podijelite na XING',
|
||||
'hu' => 'Megosztás XINGen',
|
||||
'it' => 'Condividi su XING',
|
||||
'ja' => 'XING上で共有',
|
||||
'ko' => 'XING에서 공유하기',
|
||||
'nl' => 'Delen op XING',
|
||||
'no' => 'Del på XING',
|
||||
'pl' => 'Udostępnij przez XING',
|
||||
'pt' => 'Compartilhar no XING',
|
||||
'ro' => 'Partajează pe XING',
|
||||
'ru' => 'Поделиться на XING',
|
||||
'sk' => 'Zdieľať na XING',
|
||||
'sl' => 'Deli na XING',
|
||||
'sr' => 'Podeli na XING-u',
|
||||
'sv' => 'Dela på XING',
|
||||
'tr' => 'XING\'ta paylaş',
|
||||
'zh' => '分享至XING',
|
||||
);
|
||||
} elseif ( isset( $backend ) && 1 === $backend ) {
|
||||
// Set xing options.
|
||||
$xing_json = array(
|
||||
'url' => $post_url_raw,
|
||||
);
|
||||
|
||||
// Set post options.
|
||||
$xing_post_options = array(
|
||||
'method' => 'POST',
|
||||
'timeout' => 5,
|
||||
'redirection' => 5,
|
||||
'httpversion' => '1.0',
|
||||
'blocking' => true,
|
||||
'headers' => array( 'content-type' => 'application/json' ),
|
||||
'body' => wp_json_encode( $xing_json ),
|
||||
);
|
||||
|
||||
// Fetch counts.
|
||||
$xing = sanitize_text_field( wp_remote_retrieve_body( wp_remote_post( 'https://www.xing.com/spi/shares/statistics', $xing_post_options ) ) );
|
||||
$xing_json = json_decode( $xing, true );
|
||||
|
||||
// Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
|
||||
if ( isset( $xing_json['share_counter'] ) ) {
|
||||
$share_counts['xing'] = intval( $xing_json['share_counter'] );
|
||||
} elseif ( isset( $record_errors ) && 1 === $record_errors ) {
|
||||
$service_errors['xing'] = $xing;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user