Simple Share Buttons Adder - Version 7.6.20

Version Description

  • Add: Added new block for Gutenberg users.
Download this release

Release Info

Developer DavidoffNeal
Plugin Icon 128x128 Simple Share Buttons Adder
Version 7.6.20
Comparing to
See all releases

Code changes from version 7.6.19 to 7.6.20

css/admin-theme.css CHANGED
@@ -603,4 +603,4 @@
603
  right: 100%;
604
  margin-right: -12px;
605
  margin-left: 0;
606
- }
603
  right: 100%;
604
  margin-right: -12px;
605
  margin-left: 0;
606
+ }
css/admin.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Block styles */
2
+ .simpleshare-button-block img {
3
+ max-width: 42px;
4
+ margin-right: 10px;
5
+ display: inline-block;
6
+ vertical-align: middle;
7
+ background-color: #fff;
8
+ padding: 10px;
9
+ }
10
+
11
+ .simpleshare-button-block {
12
+ font-size: 20px;
13
+ font-family: sans-serif;
14
+ border-bottom: 2px solid #000;
15
+ border-top: 2px solid #000;
16
+ padding: 10px;
17
+ color: #000;
18
+ text-align: center;
19
+ max-width: 400px;
20
+ margin: auto;
21
+ }
instance.php CHANGED
@@ -9,7 +9,7 @@ namespace SimpleShareButtonsAdder;
9
 
10
  define( 'SSBA_FILE', __FILE__ );
11
  define( 'SSBA_ROOT', dirname( __FILE__ ) );
12
- define( 'SSBA_VERSION', '7.6.19' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
9
 
10
  define( 'SSBA_FILE', __FILE__ );
11
  define( 'SSBA_ROOT', dirname( __FILE__ ) );
12
+ define( 'SSBA_VERSION', '7.6.20' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
js/blocks.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global wp:wp */
2
+
3
+ /**
4
+ * This section of code registers the sharethis share buttons blocks.
5
+ */
6
+
7
+ const simpleshareregisterBlockType = wp.blocks.registerBlockType;
8
+ const simplesharecreateElement = wp.element.createElement;
9
+ const simpleshareicon = simplesharecreateElement('div', { style: {
10
+ background: `url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMjcyLjAwMDAwMHB0IiBoZWlnaHQ9IjIzNi4wMDAwMDBwdCIgdmlld0JveD0iMCAwIDI3Mi4wMDAwMDAgMjM2LjAwMDAwMCIKIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPgoKPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMjM2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTk3NSAyMjkzIGMtMTQwIC0xNiAtMjQ2IC00OCAtMzY5IC0xMTEgLTI3NSAtMTQxIC00NjEgLTM5MCAtNTI3Ci03MDcgLTE2IC03NyAtMTYgLTI4MyAwIC0zNjAgODIgLTM5NCAzNTkgLTY5MSA3MzcgLTc5MCAxNjQgLTQzIDM1MSAtNDEgNTI2CjYgMTE0IDMxIDExNSAzMiA4NyAxMTAgLTEyIDM1IC0yMyA2NSAtMjQgNjYgLTEgMiAtMjUgLTYgLTUzIC0xNyAtMTE1IC00NAotMjkxIC02MCAtNDIyIC00MCAtMjg3IDQ2IC01MjUgMjI2IC02NDkgNDkyIC01MyAxMTEgLTc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wIDk1IDEwMCAxNDAgMTcwIDc4eiBtMzY5IDEzIGM1OCAtMzAgNjkgLTExOSAyMiAtMTY3IC0yMyAtMjMgLTM4Ci0yOSAtNzEgLTI5IC0zNSAwIC00OCA2IC03NyAzNSAtMzIgMzIgLTM1IDQwIC0zMCA3NiAxMSA4MSA4NSAxMjEgMTU2IDg1eiIvPgo8cGF0aCBkPSJNMTkxMiAxMjUwIGMtMTEwIC0yOSAtMTg3IC03NSAtMjczIC0xNjAgLTEyMiAtMTIwIC0xNzkgLTI1NiAtMTc5Ci00MjUgMCAtMTcwIDU3IC0zMDMgMTgxIC00MjYgMzQwIC0zNDAgOTA5IC0xNjggMTAxNCAzMDUgNjUgMjkyIC0xMDggNTkyCi0zOTcgNjkzIC0xMDIgMzUgLTI0NSA0MSAtMzQ2IDEzeiBtMTk4IC0zNjkgYzUgLTExIDEwIC00OSAxMCAtODUgbDAgLTY2IDc3CjAgYzg5IDAgMTEzIC0xNCAxMTMgLTY2IDAgLTQ4IC0yOCAtNjQgLTExNyAtNjQgbC03MyAwIDAgLTgyIGMwIC05MCAtMTQgLTExOAotNTcgLTExOCAtNTUgMCAtNjMgMTMgLTYzIDExMCBsMCA5MCAtNzMgMCBjLTg5IDAgLTExNyAxNSAtMTE3IDY1IDAgNTMgMjAgNjUKMTExIDY1IGw3OSAwIDAgNzMgYzAgNDMgNSA3OCAxMiA4NSAyMCAyMCA4NiAxNSA5OCAtN3oiLz4KPC9nPgo8L3N2Zz4K")`,
11
+ width: '24px',
12
+ height: '24px',
13
+ backgroundRepeat: 'no-repeat',
14
+ backgroundPosition: 'center',
15
+ backgroundColor: '#fff',
16
+ backgroundSize: '24px'
17
+ } } );
18
+ /**
19
+ * Share Buttons Block
20
+ */
21
+ simpleshareregisterBlockType('simpleshare/simplesharebuttons', {
22
+ title: 'Simple Share Buttons',
23
+ icon: simpleshareicon,
24
+ category: 'simpleshare-blocks',
25
+ edit() {
26
+ return (
27
+ simplesharecreateElement(
28
+ 'div',
29
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AgNjkgLTExOSAyMiAtMTY3IC0yMyAtMjMgLTM4Ci0yOSAtNzEgLTI5IC0zNSAwIC00OCA2IC03NyAzNSAtMzIgMzIgLTM1IDQwIC0zMCA3NiAxMSA4MSA4NSAxMjEgMTU2IDg1eiIvPgo8cGF0aCBkPSJNMTkxMiAxMjUwIGMtMTEwIC0yOSAtMTg3IC03NSAtMjczIC0xNjAgLTEyMiAtMTIwIC0xNzkgLTI1NiAtMTc5Ci00MjUgMCAtMTcwIDU3IC0zMDMgMTgxIC00MjYgMzQwIC0zNDAgOTA5IC0xNjggMTAxNCAzMDUgNjUgMjkyIC0xMDggNTkyCi0zOTcgNjkzIC0xMDIgMzUgLTI0NSA0MSAtMzQ2IDEzeiBtMTk4IC0zNjkgYzUgLTExIDEwIC00OSAxMCAtODUgbDAgLTY2IDc3CjAgYzg5IDAgMTEzIC0xNCAxMTMgLTY2IDAgLTQ4IC0yOCAtNjQgLTExNyAtNjQgbC03MyAwIDAgLTgyIGMwIC05MCAtMTQgLTExOAotNTcgLTExOCAtNTUgMCAtNjMgMTMgLTYzIDExMCBsMCA5MCAtNzMgMCBjLTg5IDAgLTExNyAxNSAtMTE3IDY1IDAgNTMgMjAgNjUKMTExIDY1IGw3OSAwIDAgNzMgYzAgNDMgNSA3OCAxMiA4NSAyMCAyMCA4NiAxNSA5OCAtN3oiLz4KPC9nPgo8L3N2Zz4K'}
33
+ ),
34
+ 'Share Buttons Display Here'
35
+ )
36
+ );
37
+ },
38
+ save() {
39
+ return (
40
+ '[ssba-buttons]'
41
+ );
42
+ }
43
+ });
php/class-admin-panel.php CHANGED
@@ -70,6 +70,35 @@ class Admin_Panel {
70
  include_once( "{$this->plugin->dir_path}/templates/admin-footer.php" );
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * Build the Admin Panel html variables and include template.
75
  *
70
  include_once( "{$this->plugin->dir_path}/templates/admin-footer.php" );
71
  }
72
 
73
+ /**
74
+ * Enqueue the custom gutenberg block script.
75
+ *
76
+ * @action enqueue_block_editor_assets
77
+ */
78
+ public function enqueue_custom_blocks() {
79
+ wp_enqueue_script( "{$this->plugin->assets_prefix}-blocks", "{$this->plugin->dir_url}js/blocks.js", array( 'wp-blocks', 'wp-editor', 'wp-element', 'wp-components' ), time(), true );
80
+ }
81
+
82
+ /**
83
+ * Register new block category for share buttons.
84
+ *
85
+ * @param array $categories The current block categories.
86
+ *
87
+ * @filter block_categories 999
88
+ */
89
+ public function simpleshare_block_category( $categories, $post ) {
90
+ return array_merge(
91
+ $categories,
92
+ [
93
+ [
94
+ 'slug' => 'simpleshare-blocks',
95
+ 'title' => __( 'SimpleShare Blocks', 'simple-share-buttons-adder' ),
96
+ ],
97
+ ]
98
+ );
99
+ }
100
+
101
+
102
  /**
103
  * Build the Admin Panel html variables and include template.
104
  *
php/class-plugin.php CHANGED
@@ -45,6 +45,10 @@ class Plugin extends Plugin_Base {
45
  foreach ( $classes as $instance ) {
46
  $this->add_doc_hooks( $instance );
47
  }
 
 
 
 
48
  }
49
 
50
  /**
@@ -70,7 +74,7 @@ class Plugin extends Plugin_Base {
70
  wp_register_script( "{$this->assets_prefix}-bootstrap-js", "{$this->dir_url}js/vendor/bootstrap.js" );
71
  wp_register_script( "{$this->assets_prefix}-colorpicker", "{$this->dir_url}js/vendor/colorpicker.js" );
72
  wp_register_script( "{$this->assets_prefix}-switch", "{$this->dir_url}js/vendor/switch.js" );
73
- wp_register_style( "{$this->assets_prefix}-admin", "{$this->dir_url}css/admin.css", false );
74
  wp_register_style( "{$this->assets_prefix}-readable", "{$this->dir_url}css/readable.css" );
75
  wp_register_style( "{$this->assets_prefix}-colorpicker", "{$this->dir_url}css/colorpicker.css" );
76
  wp_register_style( "{$this->assets_prefix}-switch","{$this->dir_url}css/switch.css" );
45
  foreach ( $classes as $instance ) {
46
  $this->add_doc_hooks( $instance );
47
  }
48
+
49
+ // Define some prefixes to use througout the plugin.
50
+ $this->assets_prefix = strtolower( preg_replace( '/\B([A-Z])/', '-$1', __NAMESPACE__ ) );
51
+ $this->meta_prefix = strtolower( preg_replace( '/\B([A-Z])/', '_$1', __NAMESPACE__ ) );
52
  }
53
 
54
  /**
74
  wp_register_script( "{$this->assets_prefix}-bootstrap-js", "{$this->dir_url}js/vendor/bootstrap.js" );
75
  wp_register_script( "{$this->assets_prefix}-colorpicker", "{$this->dir_url}js/vendor/colorpicker.js" );
76
  wp_register_script( "{$this->assets_prefix}-switch", "{$this->dir_url}js/vendor/switch.js" );
77
+ wp_enqueue_style( "{$this->assets_prefix}-admin", "{$this->dir_url}css/admin.css", false );
78
  wp_register_style( "{$this->assets_prefix}-readable", "{$this->dir_url}css/readable.css" );
79
  wp_register_style( "{$this->assets_prefix}-colorpicker", "{$this->dir_url}css/colorpicker.css" );
80
  wp_register_style( "{$this->assets_prefix}-switch","{$this->dir_url}css/switch.css" );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sharethis, scottstorebloom, surlyrightclick, DavidoffNeal
3
  Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk, flattr
4
  Requires at least: 4.5
5
  Tested up to: 5.2.2
6
- Stable tag: 7.6.19
7
  License: GPLv2 or later
8
 
9
  A simple plugin that enables you to add share buttons to all of your posts and/or pages.
@@ -67,6 +67,9 @@ Please visit the <a href="https://wordpress.org/support/plugin/simple-share-butt
67
  == Changelog ==
68
 
69
  = 7.6.20 =
 
 
 
70
  * Add: remove sharecount.com opions.
71
  * Add: Add page omit by title options for all buttons.
72
  * Fix: Flattr button.
3
  Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk, flattr
4
  Requires at least: 4.5
5
  Tested up to: 5.2.2
6
+ Stable tag: 7.6.20
7
  License: GPLv2 or later
8
 
9
  A simple plugin that enables you to add share buttons to all of your posts and/or pages.
67
  == Changelog ==
68
 
69
  = 7.6.20 =
70
+ * Add: Added new block for Gutenberg users.
71
+
72
+ = 7.6.19 =
73
  * Add: remove sharecount.com opions.
74
  * Add: Add page omit by title options for all buttons.
75
  * Fix: Flattr button.
simple-share-buttons-adder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Share Buttons Adder
4
  * Plugin URI: https://simplesharebuttons.com
5
  * Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
6
- * Version: 7.6.19
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2
3
  * Plugin Name: Simple Share Buttons Adder
4
  * Plugin URI: https://simplesharebuttons.com
5
  * Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
6
+ * Version: 7.6.20
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2