Skip to content

Commit

Permalink
v2.0 Fallback feature Introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
josevarghese committed Jun 24, 2022
1 parent 7be3547 commit db19189
Show file tree
Hide file tree
Showing 9 changed files with 399 additions and 70 deletions.
41 changes: 28 additions & 13 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: superwebshare
Donate link: https://www.superwebshare.com
Tags: share button, web share, native share, Share API, share
Requires at least: 3.0.1
Tested up to: 5.7
Tested up to: 5.9
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -12,25 +12,30 @@ Super Web Share helps to easily add native share prompt to your website for easy

== Description ==

Super Web Share is a WordPress-based native share plugin that helps users to easily share the page/post with others by prompting the native share action. As SuperWebShare only shows the apps installed within the device upon the share prompt, the rate of sharing of post/page will be higher. Due to that reason, website developers can skip the usage of other social media icons upon their website and keep the share more prominent. Super Web Share plugin for WordPress helps to increase your traffic and engagement by a single quick click to share the website with your friends and social media. Super Web Share works on all supported browsers like Chrome for Android, Edge for Android, Brave for Android, and also on Opera for Android. It will show the native apps which are installed upon the device once you share the article with others; due to that, users can easily share the page/post with others super easily in just a click. Upon the native share, which prompts up, if the users need, they can easily copy the website's link.
Super Web Share is a WordPress-based native share plugin that helps users easily share the page/post with others by prompting the native share action. As SuperWebShare only shows the apps installed within the device upon the share prompt, the rate of sharing of post/page will be higher. Due to that reason, website developers can skip the usage of other social media icons upon their website and keep the share more prominent.

It takes less than a minute to setup Super Web Share, and we provide a clean uninstall by removing the entire data entry it creates. We also won't save any settings to your database until you manually save the settings.
The Super Web Share plugin for WordPress helps increase your traffic and engagement by a single quick click to share the website with your friends and social media. Super Web Share works on all supported browsers like Chrome for Android, Edge for Android, Brave for Android, and Opera for Android. It will show the native apps installed upon the device once you share the article with others; due to that, users can easily share the page/post with others super easily in just a click. Upon the native share, which prompts up, they can easily copy the website page link if the users need it.

Currently, the Super Web Share plugin provides a share button before and after the post/page and a floating share button where you can set the color, the text of the share buttons, the position of the floating button, and can also set the pages or posts which you would like to show the share buttons via our Settings page, to easily add the share feature to your websites.
It takes less than a minute to set up Super Web Share, and we provide a clean uninstall by removing the entire data entry it creates. We also won't save any settings to your database until you manually save the settings. We also provide a fallback native popup if the Native Web Share is not supported within the browser.

Currently, the Super Web Share plugin provides a share button before and after the post/page content and a floating share button where you can set the color, the text of the share buttons, the position of the floating button, and can also set the pages or posts which you would like to show the share buttons via our Settings page, to easily add the share feature to your websites. As an addon, we are fully compatible with the AMP plugin, which means you can add the native share to your AMP pages provided by the AMP plugin.

### Advantages of using Super Web Share
* Increase the rate of sharing of pages and posts by users
* Developers / Bloggers can easily skip the number of social icons to be used on the page or post
* Lightweight and super fast loading share plugin
* Fully AMP supported native share plugin

#### Want to test to know how SuperWebShare works on a website?

* Open [SuperWebShare.com](https://www.superwebshare.com) in a supported device. See [FAQ to know the supported browsers](https://wordpress.org/plugins/super-web-share/#upon%20which%20all%20browsers%20does%20the%20super%20web%20share%20plugin%20works)
* Open [SuperWebShare.com](https://superwebshare.com/?utm_source=wordpress-plugin&utm_medium=wordpress-readme) in a supported device. See [FAQ to know the supported browsers](https://wordpress.org/plugins/super-web-share/#faq)
* You can see a floating button at the right bottom corner
* Tap on it, instantly you can see the native Web Share prompt with the applications, which you can share the page.
* Tap on the icon of application from the prompt, and send.
* Tap on the icon of application from the prompt, and send.
* If the website is not supporting Native share option, you will notice the fallback popup which we created to make a all in one Share plugin for your website

#### Requirments for working SuperWebShare?
* The Website should be served fully via a secured origin, i.e., the green padlock should be there on the address for working Super Web Share
* The Website should be served fully via a secured origin, i.e., the green padlock should be there on the address for working Super Web Share. Else by default, our fallback popup will show on those browsers.

== Installation ==

Expand Down Expand Up @@ -58,11 +63,11 @@ No, the floating share button and normal share button on pages and posts will be

= How do I report bugs and new feature suggestions? =

You can report the bugs and features you need at our [GitHub repository](https://github.com/superwebshare/super-web-share-wordpress-plugin/issues/new)
You can report the bugs and features you need at our [GitHub repository](https://github.com/superwebshare/featurerequests/issues)

= How can I contribute to this awesome plugin? =

You can contribute to this Web Share plugin via our [GitHub repository](https://github.com/superwebshare/super-web-share-wordpress-plugin/)
You can contribute to this Web Share plugin via our [GitHub repository](https://github.com/superwebshare/featurerequests/issues)

= Did I need to register or signup anywhere to use Super Web Share plugin? =

Expand All @@ -79,6 +84,17 @@ Yes, SuperWebShare is fully GDPR Compliant. Unlike other social sharing tools, t

== Changelog ==

= 2.0 =
Release Date: January 8th, 2022

Enhancements:

* Introducing the Fallback feature so that the fallback prompt with the copy link option will be shown if the Share API does not support the browser. You can find out the settings within Super Web Share > Fallback page.

Bugfixes:

* Fixed floating button not showing as round shape within the AMP pages
* Made the plugin lightweight

= 1.4.5 =
Release Date: March 16th, 2021
Expand Down Expand Up @@ -108,7 +124,7 @@ Release Date: December 28th, 2019
Bugfixes:

* Fixed a compatibility issue over PHP versions - 5.3, 5.4, 5.5 and 5.6
(Thanks to [Gijo Varghese](https://profiles.wordpress.org/gijo/))
(Thanks to Gijo)


= 1.4.2 =
Expand All @@ -131,8 +147,7 @@ Release Date: December 1st, 2019
Enhancements:

* Settings page improved
* SVG icon for share both share buttons
(Thanks to [Ajith R.N](https://profiles.wordpress.org/ajithrn))
* SVG icon for share both share buttons - Thanks to Ajith
* Floating share button style changed
* General share button style changed for good user experience

Expand Down Expand Up @@ -176,7 +191,7 @@ Enhancements:
* Option to select the color, text on the share button added
* Adds option's to select the pages to display the normal share button
* Minor performance improvements to render SuperWebShare faster.
Thanks to [Jyothis Joy](https://profiles.wordpress.org/joe007/) for reporting the bug.
Thanks to Jyothis for reporting the bug.

= 1.1 =
Release Date: December 15th, 2018
Expand Down
84 changes: 76 additions & 8 deletions admin/class-super-web-share-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function superwebshare_add_menu_links() {
// General Settings page - Same as main menu page
add_submenu_page( 'superwebshare', __( 'Super Web Share', 'super-web-share' ), __( ' General Settings', 'super-web-share' ), 'manage_options', 'superwebshare', 'superwebshare_admin_interface_render' );
// Floating button Settings page - since 1.4.2
add_submenu_page( 'superwebshare', __( 'Super Web Share', 'super-web-share' ), __( 'Floating Button', 'super-web-share' ), 'manage_options', 'superwebshare&tab=floating', 'superwebshare_admin_interface_render' );
add_submenu_page( 'superwebshare', __( 'Super Web Share', 'super-web-share' ), __( 'Floating Button', 'super-web-share' ), 'manage_options', 'superwebshare-floating', 'superwebshare_admin_interface_render' );
// Fallback Settings page - since 2.0
add_submenu_page( 'superwebshare', __( 'Super Web Share', 'super-web-share' ), __( 'Fallback', 'super-web-share' ), 'manage_options', 'superwebshare-fallback', 'superwebshare_admin_interface_render' );
add_submenu_page( 'superwebshare', __( 'Super Web Share', 'super-web-share' ), __( 'Status', 'super-web-share' ), 'manage_options', 'superwebshare-status', 'superwebshare_status_interface_render' );
}
add_action( 'admin_menu', 'superwebshare_add_menu_links' );
Expand Down Expand Up @@ -100,7 +102,7 @@ function superwebshare_plugin_row_meta( $links, $file ) {

if ( strpos( $file, 'super-web-share.php' ) !== false ) {
$new_links = array(
'demo' => '<a href="https://www.superwebshare.com/?utm_source=WordPress-Demo" target="_blank">' . __( 'Demo', 'super-web-share' ) . '</a>',
'demo' => '<a href="https://superwebshare.com/?utm_source=wordpress-plugin&utm_medium=wordpress-demo" target="_blank">' . __( 'Demo', 'super-web-share' ) . '</a>',
);
$links = array_merge( $links, $new_links );
}
Expand Down Expand Up @@ -222,10 +224,10 @@ function superwebshare_status_interface_render() {
printf( '<h5>Status</h5>' );
if ( is_ssl() ) {

printf( '<p><span class="dashicons dashicons-yes" style="color: #46b460;"></span> ' . __( 'Awesome!!! Your website is served over HTTPS. SuperWebShare will work perfectly upon your website, if you test it over <code>Chrome for Android</code>, <code>Edge for Android</code>, <code>Samsung Internet for Android</code>, <code>Safari for iOS</code> and <code>Brave for Android</code> as those are browsers which currently supports native web share. Please test out over these browsers + devices once after activating the button you would like to feature.', 'super-web-share' ) . '</p>' );
printf( '<p><span class="dashicons dashicons-yes" style="color: #46b460;"></span> ' . __( 'Awesome! The website uses HTTPS. SuperWebShare will work perfectly upon your website if you test it over Chrome for Android, Edge for Android, Samsung Internet for Android, Safari for iOS, and Brave for Android, as those are browsers that currently support native web share. Please test out over these browsers and devices once after activating the button you would like to feature.', 'super-web-share' ) . '</p>' );
} else {

printf( '<p><span class="dashicons dashicons-no-alt" style="color: #dc3235;"></span> ' . __( 'Looks like the website is not served fully via HTTPS. As for supporting SuperWebShare, your website should be served fully over HTTPS and green padlock should be there upon the address bar. ', 'super-web-share' ) . '</p>' );
printf( '<p><span class="dashicons dashicons-no-alt" style="color: #dc3235;"></span> ' . __( 'It looks like the website is not served fully via HTTPS. As for supporting the SuperWebShare native share button, your website should be served fully over HTTPS and needs a green padlock upon the address bar. By default, our fallback share buttons will help to show share buttons on the browsers which are not yet supported', 'super-web-share' ) . '</p>' );
}
?>
</div>
Expand Down Expand Up @@ -302,7 +304,7 @@ function superwebshare_register_settings_normal() {
// Enable/Disable Share Button - AMP (1.4.4)
add_settings_field(
'superwebshare_enable_amp_share', // ID
__('Enable/Disable the share button over AMP Pages', 'super-web-share'), // Title
__('Show the inline share button over AMP Pages', 'super-web-share'), // Title
'superwebshare_normal_amp_enable_cb', // CB
'superwebshare_basic_settings_section', // Page slug
'superwebshare_basic_settings_section' // Settings Section ID
Expand Down Expand Up @@ -335,7 +337,7 @@ function superwebshare_register_settings_floating() {
// Enable/Disable the floating share button
add_settings_field(
'superwebshare_floating_enable_share', // ID
__('Enable/Disable the floating share button', 'super-web-share'), // Title
__('Show the floating share button on website', 'super-web-share'), // Title
'superwebshare_floating_enable_cb', // CB
'superwebshare_floating_settings_section', // Page slug
'superwebshare_floating_settings_section' // Settings Section ID
Expand Down Expand Up @@ -375,14 +377,56 @@ function superwebshare_register_settings_floating() {
// Enable/Disable Share Button - AMP (1.4.4)
add_settings_field(
'superwebshare_floating_enable_amp_share', // ID
__('Enable/Disable the floating share button over AMP Pages', 'super-web-share'), // Title
__('Show floating share button over AMP Pages', 'super-web-share'), // Title
'superwebshare_floating_amp_enable_cb', // CB
'superwebshare_floating_settings_section', // Page slug
'superwebshare_floating_settings_section' // Settings Section ID
);
}
add_action( 'admin_init', 'superwebshare_register_settings_floating' );

/**
* Fallback Settings Register
*
* @since 2.0
*/
function superwebshare_register_settings_fallback(){
// Register Setting
register_setting(
'superwebshare_settings_fallback_group', // Group name
'superwebshare_fallback_settings', // Setting name = html form <input> name on settings form
'superwebshare_validater_and_sanitizer_fallback' // Input sanitizer
);

// Floating Button Settings
add_settings_section(
'superwebshare_fallback_settings_section', // ID
__('<br>Fallback Settings', 'super-web-share'), // Title
'__return_false', // Callback Function
'superwebshare_fallback_settings_section' // Page slug
);

// Description
add_settings_field(
'superwebshare_description_share', // ID
__('', 'super-web-share'), // Title
'superwebshare_fallback_description_cb', // CB
'superwebshare_fallback_settings_section', // Page slug
'superwebshare_fallback_settings_section' // Settings Section ID
);

add_settings_field(
'superwebshare_fallback_enable', // ID
__('Show the fallback share buttons for browsers that wont support native web share', 'super-web-share'), // Title
'superwebshare_fallback_enable_cb', // CB
'superwebshare_fallback_settings_section', // Page slug
'superwebshare_fallback_settings_section' // Settings Section ID
);


}
add_action( 'admin_init', 'superwebshare_register_settings_fallback' );

/**
* Validate and sanitize user input before its saved to database
*
Expand All @@ -405,7 +449,18 @@ function superwebshare_validater_and_sanitizer_floating( $settings_floating ) {
$settings_floating['floating_position_button'] = preg_match( '/^[0-9]$/i', isset($settings_floating['floating_position_button']) ) ? sanitize_text_field( $settings_floating['floating_position_button'] ) : '30';
return $settings_floating;
}


/**
* Fallback - Validate and sanitize user input before its saved to database
*
* @since 2.0
*/
function superwebshare_validater_and_sanitizer_fallback( $settings_fallback ) {
// Sanitize hex color input for fallback theme_color
return $settings_fallback;
}


/**
* Get settings from database
*
Expand Down Expand Up @@ -451,4 +506,17 @@ function superwebshare_get_settings_floating() {
$settings_floating = get_option( 'superwebshare_floatingsettings', $defaults );

return $settings_floating;
}
/**
* Get Fallback settings from database
*
* @since 1.3
* @return Array A merged array of default and settings saved in database.
*/
function superwebshare_get_settings_fallback() {
$defaults = array(
'superwebshare_fallback_enable' => 'enable', // default value
);
return get_option( 'superwebshare_fallback_settings', $defaults );

}
Loading

0 comments on commit db19189

Please sign in to comment.