Changeset 2103525
- Timestamp:
- 06/10/2019 07:51:50 PM (7 years ago)
- Location:
- social-sharing-buttons-and-counters/trunk
- Files:
-
- 13 edited
-
assets/css/jc-social-sharing-admin.css (modified) (1 diff)
-
assets/css/jc-social-sharing.css (modified) (1 diff)
-
assets/js/jc-social-sharing.js (modified) (1 diff)
-
inc/admin-page.php (modified) (3 diffs)
-
inc/admin.php (modified) (1 diff)
-
inc/functions.php (modified) (4 diffs)
-
inc/plugin.php (modified) (3 diffs)
-
inc/template-functions.php (modified) (8 diffs)
-
languages/social-sharing-buttons-jc-es_ES.mo (modified) (previous)
-
languages/social-sharing-buttons-jc-es_ES.po (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
social-sharing-buttons-and-counters.php (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
social-sharing-buttons-and-counters/trunk/assets/css/jc-social-sharing-admin.css
r1632461 r2103525 1 #social-list ul, #social-selected ul 2 { 1 #social-list ul, #social-selected ul { 3 2 background-color: white; 4 3 box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); -
social-sharing-buttons-and-counters/trunk/assets/css/jc-social-sharing.css
r2102981 r2103525 31 31 #jcss-social-buttons .jcss-social-name { color: #fff; font-weight: 700; margin-left: 5px; } 32 32 33 @media (max-width: 768px) {33 @media (max-width: 768px) { 34 34 .jcss-social-name { display: none; } 35 35 } -
social-sharing-buttons-and-counters/trunk/assets/js/jc-social-sharing.js
r2098504 r2103525 23 23 24 24 var buttons = document.getElementsByClassName("jcss-button"); 25 for (var i = 0; i< buttons.length; i++) 26 { 25 for (var i = 0; i< buttons.length; i++) { 27 26 buttons[i].addEventListener("click", function(e) { 28 27 e.preventDefault(); 29 if (this.id == "jcss-whatsapp" && !isMobile.any()) 30 { 28 if (this.id == "jcss-whatsapp" && !isMobile.any()) { 31 29 return false; 32 30 } -
social-sharing-buttons-and-counters/trunk/inc/admin-page.php
r2102981 r2103525 17 17 <a href="?page=social-sharing-buttons-jc&tab=buttons" class="nav-tab <?php echo $active_tab == 'buttons' ? 'nav-tab-active' : ''; ?>"> 18 18 <?php _e('Buttons', 'social-sharing-buttons-jc'); ?> 19 </a> 20 <a href="?page=social-sharing-buttons-jc&tab=advanced" class="nav-tab <?php echo $active_tab == 'advanced' ? 'nav-tab-active' : ''; ?>"> 21 <?php _e('Advanced', 'social-sharing-buttons-jc'); ?> 19 22 </a> 20 23 <a href="?page=social-sharing-buttons-jc&tab=animation" class="nav-tab <?php echo $active_tab == 'animation' ? 'nav-tab-active' : ''; ?>"> … … 145 148 </table> 146 149 <?php submit_button(); ?> 150 </form> <?php 151 } else if ( $active_tab === 'advanced' ) { 152 $options = jcss_get_advanced_options(); ?> 153 <form action="options.php" method="post"> 154 <?php 155 settings_fields( 'jcss_plugin_options' ); 156 ?> 157 <table class="form-table"> 158 <tbody> 159 <tr> 160 <th scope="row"> 161 <label for="use-fa4"><?php _e('Font Awesome 4 compatibility', 'social-sharing-buttons-jc') ?></label> 162 </th> 163 <td id="use-fa4"> 164 <label> 165 <input type="checkbox" name="jcss_advanced_options[fa4]" <?php checked( $options['fa4'] === 'on' ) ?>> 166 <?php _e("Check ONLY if your theme still uses Font Awesome 4, take into account that some icons might not be rendered.", 'social-sharing-buttons-jc') ?> 167 </label> 168 </td> 169 </tr> 170 </tbody> 171 </table> 172 <?php submit_button(); ?> 147 173 </form> <?php 148 174 } else if ( $active_tab === 'animation' ) { … … 150 176 <form action="options.php" method="post"> 151 177 <?php 152 settings_fields( 'jcss_plugin_options' ); 178 settings_fields( 'jcss_plugin_options' ); 153 179 ?> 154 180 <table class="form-table"> -
social-sharing-buttons-and-counters/trunk/inc/admin.php
r2102981 r2103525 29 29 function jcss_register_options() { 30 30 register_setting('jcss_plugin_options', 'jcss_buttons_options', 'jcss_sanitize_buttons'); 31 register_setting('jcss_plugin_options', 'jcss_advanced_options', 'jcss_sanitize_advanced'); 31 32 register_setting('jcss_plugin_options', 'jcss_animation_options', 'jcss_sanitize_animations'); 32 33 } -
social-sharing-buttons-and-counters/trunk/inc/functions.php
r2102981 r2103525 41 41 } 42 42 43 function jcss_get_advanced_options() { 44 $options = array(); 45 try { 46 $db_options = get_option('jcss_advanced_options'); 47 $options = array( 48 'fa4' => isset($db_options['fa4']) ? $db_options['fa4'] : '0' 49 ); 50 } catch( Exception $e ) {} 51 return $options; 52 } 53 43 54 function jcss_get_animation_options() { 44 55 $options = array(); … … 53 64 } catch( Exception $e ) {} 54 65 return $options; 66 } 67 68 function jcss_get_fa_classnames($advanced, $social) { 69 $fa_classname = $advanced['fa4'] === 'on' ? 'fa ' : 'fab '; 70 switch ($social) { 71 case 'facebook' : return $fa_classname . ($advanced['fa4'] === 'on' ? 'fa-facebook' : 'fa-facebook-f'); 72 case 'linkedin' : return $fa_classname . ($advanced['fa4'] === 'on' ? 'fa-linkedin' : 'fa-linkedin-in'); 73 default: return $fa_classname . "fa-$social"; 74 } 55 75 } 56 76 … … 75 95 76 96 $html = ''; 77 if ($include_values) 78 { 79 foreach ($values_array as &$value) 80 { 97 if ($include_values) { 98 foreach ($values_array as &$value) { 81 99 if (in_array($value, $socials)) 82 100 $html .= '<div id="'.$value.'" class="social-list-item"><li><span class="jcss-card">'.$value.'</span></li></div>'; 83 101 } 84 102 } 85 else 86 { 87 foreach ($socials as &$social) 88 { 103 else { 104 foreach ($socials as &$social) { 89 105 if (!in_array($social, $values_array) ) 90 106 $html .= '<div id="'.$social.'" class="social-list-item"><li><span class="jcss-card">'.$social.'</span></li></div>'; … … 111 127 } 112 128 129 function jcss_sanitize_advanced($input) { 130 $options = jcss_get_advanced_options(); 131 if( isset( $input['fa4'] ) ) $options['fa4'] = sanitize_text_field( $input['fa4'] ); 132 else $options['fa4'] = '0'; 133 return $options; 134 } 135 113 136 function jcss_sanitize_animations($input) { 114 137 $options = jcss_get_animation_options(); -
social-sharing-buttons-and-counters/trunk/inc/plugin.php
r2102981 r2103525 6 6 } 7 7 8 function stylesheet_installed($array_css) 9 { 8 function stylesheet_installed($array_css) { 10 9 global $wp_styles; 11 10 12 foreach( $wp_styles->queue as $style ) 13 { 14 foreach ($array_css as $css) 15 { 16 if (false !== strpos( $wp_styles->registered[$style]->src, $css )) 17 { 11 foreach( $wp_styles->queue as $style ) { 12 foreach ($array_css as $css) { 13 if (false !== strpos( $wp_styles->registered[$style]->src, $css )) { 18 14 return 1; 19 15 } … … 23 19 } 24 20 25 function jcss_scripts() 26 { 21 function jcss_scripts() { 27 22 $options = jcss_get_buttons_options(); 28 23 … … 31 26 /* enqueue styles to head, font-awesome only if wasn't enqueued before */ 32 27 $font_awesome = array('font-awesome', 'fontawesome'); 33 if (stylesheet_installed($font_awesome) === 0) 34 { 28 if (stylesheet_installed($font_awesome) === 0) { 35 29 wp_enqueue_style('jcss-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css'); 36 30 } -
social-sharing-buttons-and-counters/trunk/inc/template-functions.php
r2102981 r2103525 9 9 10 10 $options = jcss_get_buttons_options(); 11 $advanced = jcss_get_advanced_options(); 11 12 12 13 $title = urlencode(html_entity_decode(get_the_title())); … … 34 35 case "Facebook": ?> 35 36 <a id="jcss-facebook" rel="external nofollow" class="jcss-button" href="http://www.facebook.com/sharer.php?u=<?php echo $url; ?>" target="_blank" > 36 <i class="fab fa-facebook-f"></i>37 <i class="<?php echo jcss_get_fa_classnames($advanced, 'facebook'); ?>"></i> 37 38 <?php jcss_get_social_name($options, $social); ?> 38 39 </a> <?php … … 40 41 case "Twitter": ?> 41 42 <a id="jcss-twitter" rel="external nofollow" class="jcss-button" href="http://twitter.com/intent/tweet/?text=<?php echo $title; ?>&url=<?php echo $url; if(!empty($twitter_username)) { echo '&via=' . $twitter_username; } ?>" target="_blank" > 42 <i class=" fab fa-twitter"></i>43 <i class="<?php echo jcss_get_fa_classnames($advanced, 'twitter'); ?>"></i> 43 44 <?php jcss_get_social_name($options, $social); ?> 44 45 </a> <?php … … 46 47 case "LinkedIn": ?> 47 48 <a id="jcss-linkedin" rel="external nofollow" class="jcss-button" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $url; ?>&title=<?php echo $title; ?>" target="_blank" > 48 <i class=" fab fa-linkedin-in"></i>49 <i class="<?php echo jcss_get_fa_classnames($advanced, 'linkedin'); ?>"></i> 49 50 <?php jcss_get_social_name($options, $social); ?> 50 51 </a> <?php … … 52 53 case "Buffer": ?> 53 54 <a id="jcss-buffer" rel="external nofollow" class="jcss-button" href="https://bufferapp.com/add?text=<?php echo $title; ?>&url=<?php echo $url; ?>" target="_blank" > 54 <i class=" fab fa-buffer"></i>55 <i class="<?php echo jcss_get_fa_classnames($advanced, 'buffer'); ?>"></i> 55 56 <?php jcss_get_social_name($options, $social); ?> 56 57 </a> <?php … … 58 59 case "WhatsApp": ?> 59 60 <a id="jcss-whatsapp" rel="external nofollow" class="jcss-button" href="whatsapp://send?text=<?php echo $title.' – '.$url ?>" data-action = "share/whatsapp/share" target="_blank" > 60 <i class=" fab fa-whatsapp"></i>61 <i class="<?php echo jcss_get_fa_classnames($advanced, 'whatsapp'); ?>"></i> 61 62 <?php jcss_get_social_name($options, $social); ?> 62 63 </a> <?php … … 65 66 } ?> 66 67 </div> 67 <?php echo jcss_set_animation( ); ?>68 <?php echo jcss_set_animation($advanced); ?> 68 69 </div> 69 70 <?php … … 74 75 } 75 76 76 function jcss_set_animation( ) {77 function jcss_set_animation($advanced) { 77 78 $animation = jcss_get_animation_options(); 78 $style_icon = sprintf('#jcss-buttons-container a:hover .fab {animation: %1$s %2$s linear; }', $animation['animation'], $animation['duration']);79 $style_icon = sprintf('#jcss-buttons-container a:hover %3$s {animation: %1$s %2$s linear; }', $animation['animation'], $animation['duration'], $advanced['fa4'] === 'on' ? '.fa' : '.fab'); 79 80 $style = sprintf('<style> 80 81 %1$s -
social-sharing-buttons-and-counters/trunk/languages/social-sharing-buttons-jc-es_ES.po
r2102981 r2103525 4 4 "Project-Id-Version: Social sharing buttons and counters v1.0.0\n" 5 5 "Report-Msgid-Bugs-To: Translator Name <[email protected]>\n" 6 "POT-Creation-Date: 2019-06- 09 19:11+0200\n"6 "POT-Creation-Date: 2019-06-10 21:41+0200\n" 7 7 "PO-Revision-Date: \n" 8 8 "Last-Translator: JC <[email protected]>\n" … … 28 28 29 29 #: inc/admin-page.php:21 30 msgid "Advanced" 31 msgstr "Avanzado" 32 33 #: inc/admin-page.php:24 30 34 msgid "Animation" 31 35 msgstr "Animación" 32 36 33 #: inc/admin-page.php: 3937 #: inc/admin-page.php:42 34 38 msgid "Social buttons" 35 39 msgstr "Redes sociales" 36 40 37 #: inc/admin-page.php: 4741 #: inc/admin-page.php:50 38 42 msgid "Drop below the sharing buttons you want to add" 39 43 msgstr "Arrastra abajo las redes sociales que quieres añadir" 40 44 41 #: inc/admin-page.php:5 645 #: inc/admin-page.php:59 42 46 msgid "Twitter username" 43 47 msgstr "Usuario de Twitter" 44 48 45 #: inc/admin-page.php: 5849 #: inc/admin-page.php:61 46 50 msgid "username without @" 47 51 msgstr "usuario sin la @" 48 52 49 #: inc/admin-page.php: 5953 #: inc/admin-page.php:62 50 54 msgid "Enter your username if you wanted it to be appended to the tweets" 51 55 msgstr "Introduce tu nombre si quieres que sea añadido a los tweets" 52 56 53 #: inc/admin-page.php: 6957 #: inc/admin-page.php:72 54 58 msgid "Buttons text " 55 59 msgstr "Textos en los botones " 56 60 57 #: inc/admin-page.php:7 2 inc/admin-page.php:15961 #: inc/admin-page.php:75 inc/admin-page.php:185 58 62 msgid "Yes" 59 63 msgstr "Sí" 60 64 61 #: inc/admin-page.php:7 3 inc/admin-page.php:16065 #: inc/admin-page.php:76 inc/admin-page.php:186 62 66 msgid "No" 63 67 msgstr "No" 64 68 65 #: inc/admin-page.php:7 469 #: inc/admin-page.php:77 66 70 msgid "" 67 71 "Display social network names? You can hide them if you don't have enough " … … 71 75 "espacio para los botones" 72 76 73 #: inc/admin-page.php:8 077 #: inc/admin-page.php:83 74 78 msgid "Buttons location" 75 79 msgstr "Ubicación de los botones" 76 80 77 #: inc/admin-page.php:8 481 #: inc/admin-page.php:87 78 82 msgid "Before content" 79 83 msgstr "Antes del contenido" 80 84 81 #: inc/admin-page.php:8 585 #: inc/admin-page.php:88 82 86 msgid "After content" 83 87 msgstr "Después del contenido" 84 88 85 #: inc/admin-page.php:9 289 #: inc/admin-page.php:95 86 90 msgid "Add buttons to" 87 91 msgstr "Añadir los botones a" 88 92 89 #: inc/admin-page.php:11 193 #: inc/admin-page.php:114 90 94 msgid "Sharing text" 91 95 msgstr "Texto junto a los botones" 92 96 93 #: inc/admin-page.php:11 597 #: inc/admin-page.php:118 94 98 msgid "Share this!" 95 99 msgstr "¡Compártelo!" 96 100 97 #: inc/admin-page.php:11 6101 #: inc/admin-page.php:119 98 102 msgid "" 99 103 "Left the field empty if you don't want to display a text before the sharing " … … 103 107 "botones" 104 108 105 #: inc/admin-page.php:12 3109 #: inc/admin-page.php:126 106 110 msgid "Sharing text position" 107 111 msgstr "Posición del texto" 108 112 109 #: inc/admin-page.php:1 27113 #: inc/admin-page.php:130 110 114 msgid "Left" 111 115 msgstr "A la izquierda" 112 116 113 #: inc/admin-page.php:1 28117 #: inc/admin-page.php:131 114 118 msgid "Above" 115 119 msgstr "Arriba" 116 120 117 #: inc/admin-page.php:13 4121 #: inc/admin-page.php:137 118 122 msgid "Sharing text weight" 119 123 msgstr "Espesor del texto" 120 124 121 #: inc/admin-page.php:157 125 #: inc/admin-page.php:161 126 msgid "Font Awesome 4 compatibility" 127 msgstr "Compatibilidad con Font Awesome 4" 128 129 #: inc/admin-page.php:166 130 msgid "" 131 "Check ONLY if your theme still uses Font Awesome 4, take into account that " 132 "some icons might not be rendered." 133 msgstr "" 134 "Marca esta casilla SOLO si tu tema tiene instalado Font Awesome 4, ten en " 135 "cuenta que algunos iconos pueden que no se muestren." 136 137 #: inc/admin-page.php:183 122 138 msgid "Play animations?" 123 139 msgstr "¿Usar animaciones?" 124 140 125 #: inc/admin-page.php:1 63141 #: inc/admin-page.php:189 126 142 msgid "" 127 143 "Here you can decide whether or not to play animations when hovering over the " … … 131 147 "sobre los botones." 132 148 133 #: inc/admin-page.php:1 68149 #: inc/admin-page.php:194 134 150 msgid "Animation Style" 135 151 msgstr "Estilo de la animación" 136 152 137 #: inc/admin-page.php:1 72153 #: inc/admin-page.php:198 138 154 msgid "Fade" 139 155 msgstr "" 140 156 141 #: inc/admin-page.php:1 73157 #: inc/admin-page.php:199 142 158 msgid "Slide" 143 159 msgstr "" 144 160 145 #: inc/admin-page.php: 174161 #: inc/admin-page.php:200 146 162 msgid "Bounce" 147 163 msgstr "" 148 164 149 #: inc/admin-page.php: 175165 #: inc/admin-page.php:201 150 166 msgid "Spin" 151 167 msgstr "" 152 168 153 #: inc/admin-page.php: 181169 #: inc/admin-page.php:207 154 170 msgid "Animation Duration" 155 171 msgstr "Duración de la animación" 156 172 157 #: inc/admin-page.php: 185173 #: inc/admin-page.php:211 158 174 msgid "300 miliseconds" 159 175 msgstr "300 milisegundos" 160 176 161 #: inc/admin-page.php: 186177 #: inc/admin-page.php:212 162 178 msgid "500 miliseconds" 163 179 msgstr "500 milisegundos" 164 180 165 #: inc/admin-page.php: 187181 #: inc/admin-page.php:213 166 182 msgid "700 miliseconds" 167 183 msgstr "700 milisegundos" 168 184 169 #: inc/admin-page.php: 188185 #: inc/admin-page.php:214 170 186 msgid "1 second" 171 187 msgstr "1 segundo" 172 188 173 #: inc/admin-page.php: 189189 #: inc/admin-page.php:215 174 190 msgid "2 seconds" 175 191 msgstr "2 segundos" 176 192 177 #: inc/admin-page.php: 190193 #: inc/admin-page.php:216 178 194 msgid "3 seconds" 179 195 msgstr "3 segundos" 180 196 181 #: inc/admin-page.php:2 00197 #: inc/admin-page.php:226 182 198 msgid "" 183 199 "The shortcode <strong>[jc_buttons]</strong> will render the sharing buttons " -
social-sharing-buttons-and-counters/trunk/readme.txt
r2102996 r2103525 5 5 Requires at least: 4.0 6 6 Tested up to: 5.2 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPL3 9 9 License URI: https://www.gnu.org/licenses/gpl.html … … 52 52 53 53 == Changelog == 54 55 = 1.2.2, date 2019-06-10 = 56 - Added compatibility with themes that still use Font Awesome 4. 54 57 55 58 = 1.2.1, date 2019-06-09 = -
social-sharing-buttons-and-counters/trunk/social-sharing-buttons-and-counters.php
r2102981 r2103525 3 3 Plugin Name: Social Sharing Buttons 4 4 Description: A lightweight SEO-friendly plugin that allows you to share your posts and get more traffic 5 Version: 1.2. 15 Version: 1.2.2 6 6 Author: JC 7 Author URI: https://josecarlosroman.com/ wordpress7 Author URI: https://josecarlosroman.com/ 8 8 License: GPL3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
social-sharing-buttons-and-counters/trunk/uninstall.php
r2098504 r2103525 6 6 7 7 delete_option('jcss_buttons_options'); 8 delete_option('jcss_advanced_options'); 8 9 delete_option('jcss_animation_options');
Note: See TracChangeset
for help on using the changeset viewer.