Plugin Directory

Changeset 2110263


Ignore:
Timestamp:
06/21/2019 04:34:33 PM (7 years ago)
Author:
jcrr
Message:

Social Sharing Buttons 1.2.3. Added new features (see the changelog in the readme.txt file)

Location:
social-sharing-buttons-and-counters/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • social-sharing-buttons-and-counters/trunk/assets/css/jc-social-sharing.css

    r2103525 r2110263  
    1010    margin: 2px;
    1111    padding: 5px 10px;
    12     min-width: 40px;
    1312    border-radius: 3px;
    1413    box-shadow: none; 
     
    1716#jcss-buttons-container .jcss-button:hover { opacity: 0.9; }
    1817
    19 #jcss-buttons-container a .fab { font-size: 15px; }
     18#jcss-buttons-container a i { font-size: 16px; }
    2019
    2120#jcss-buffer { background: #231F20; }
     
    3130#jcss-social-buttons .jcss-social-name { color: #fff; font-weight: 700; margin-left: 5px; }
    3231
    33 @media (max-width: 768px) {
    34     .jcss-social-name { display: none; }
     32@media (max-width: 767px) {
     33    .jcss-social-name.jcss-hide { display: none; }
    3534}
  • social-sharing-buttons-and-counters/trunk/inc/admin-page.php

    r2103525 r2110263  
    7575                                <label><input type="radio" name="jcss_buttons_options[display_names]" value="1" <?php checked($options['display_names'], 1); ?> > <?php _e('Yes', 'social-sharing-buttons-jc'); ?></label>
    7676                                <label><input type="radio" name="jcss_buttons_options[display_names]" value="0" <?php checked($options['display_names'], 0); ?> > <?php _e('No'); ?></label>
    77                                 <p class="description"> <?php _e('Display social network names? You can hide them if you don\'t have enough room for the buttons', 'social-sharing-buttons-jc') ?></p>               
     77                                <p class="description"> <?php _e('Display social network names? You can hide them if you don\'t have enough room for the buttons', 'social-sharing-buttons-jc') ?></p>
     78                                <p>
     79                                    <label>
     80                                        <input type="checkbox" name="jcss_buttons_options[hide_on_mobile]" <?php checked( $options['hide_on_mobile'] === 'on' ) ?>>
     81                                        <?php _e("Always hide the social networks names on mobile screen sizes.", 'social-sharing-buttons-jc') ?>
     82                                    </label>
     83                                </p>               
    7884                            </td>                           
    7985                        </tr>
     
    8793                                    <option value="before" <?php selected($options['placement'], 'before') ?> ><?php _e('Before content', 'social-sharing-buttons-jc') ?></option>
    8894                                    <option value="after" <?php selected($options['placement'], 'after'); ?> ><?php _e('After content', 'social-sharing-buttons-jc') ?></option>
     95                                    <option value="both" <?php selected($options['placement'], 'both'); ?> ><?php _e('Both', 'social-sharing-buttons-jc') ?></option>
    8996                                </select>
    9097                            </td>       
  • social-sharing-buttons-and-counters/trunk/inc/functions.php

    r2103525 r2110263  
    66}
    77
    8 define( 'JCSS_VERSION', '1.1.5' );
    9 
    10 function jcss_get_default_buttons_options() {
    11    
    12     $default_options = array();
    13    
    14     try {               
    15         $default_options = array(
    16             'social_options' => 'Facebook,Twitter',
    17             'post_types' => array ( 'post' ),
    18             'placement' => 'after',
    19             'display_names' => 1, 
    20             'display_shares' => 1,
    21             'twitter_username' => '',                     
    22             'sharing_text' => '',
    23             'sharing_text_position' => 'left',
    24             'sharing_text_weight' => 500
    25         );
    26    
    27     } catch( Exception $e) {               
    28     }   
    29     return $default_options;       
    30 }
    31 
    328function jcss_get_buttons_options() {
    339    $options = array();
    3410   
    3511    try {
    36         $options = get_option('jcss_buttons_options') ? get_option('jcss_buttons_options') : jcss_get_default_buttons_options();
    37    
     12        $db_options = get_option('jcss_buttons_options');
     13        $options = array( 
     14            'social_options'        => isset($db_options['social_options']) ? $db_options['social_options'] : 'Facebook,Twitter',
     15            'post_types'            => isset($db_options['post_types']) ? $db_options['post_types'] : array ( 'post' ),
     16            'placement'             => isset($db_options['placement']) ? $db_options['placement'] : 'after',
     17            'display_names'         => isset($db_options['display_names']) ? $db_options['display_names'] : 1,
     18            'hide_on_mobile'        => isset($db_options['hide_on_mobile']) ? $db_options['hide_on_mobile'] : '0',
     19            'twitter_username'      => isset($db_options['twitter_username']) ? $db_options['twitter_username'] : '',
     20            'sharing_text'          => isset($db_options['sharing_text']) ? $db_options['sharing_text'] : '',
     21            'sharing_text_position' => isset($db_options['sharing_text_position']) ? $db_options['sharing_text_position'] : 'left',
     22            'sharing_text_weight'   => isset($db_options['sharing_text_weight']) ? $db_options['sharing_text_weight'] : 500,
     23        );
    3824    } catch( Exception $e ) {}
    3925   
     
    8773
    8874function jcss_get_social_name($options, $name) {
    89     if (!empty($options['display_names'])) { ?> <span class="jcss-social-name"><?php echo $name; ?></span><?php }
     75    if (!empty($options['display_names']))
     76        return printf('<span class="jcss-social-name%2$s">%1$s</span>', $name, empty($options['hide_on_mobile']) ? '' : ' jcss-hide'); 
    9077}
    9178
     
    118105    if( isset( $input['placement'] ) ) $options['placement'] = sanitize_text_field( $input['placement'] );     
    119106    if( isset( $input['display_names'] ) ) $options['display_names'] = sanitize_text_field( $input['display_names'] );
    120     if( isset( $input['display_shares'] ) ) $options['display_shares'] = sanitize_text_field( $input['display_shares'] );     
     107    if( isset( $input['hide_on_mobile'] ) ) $options['hide_on_mobile'] = sanitize_text_field( $input['hide_on_mobile'] );
     108    else $options['hide_on_mobile'] = '0';
    121109    if( isset( $input['twitter_username'] ) ) $options['twitter_username'] = sanitize_text_field( $input['twitter_username'] );
    122110    if( isset( $input['sharing_text'] ) ) $options['sharing_text'] = sanitize_text_field( $input['sharing_text'] );     
  • social-sharing-buttons-and-counters/trunk/inc/plugin.php

    r2103525 r2110263  
    1111    foreach( $wp_styles->queue as $style ) {
    1212        foreach ($array_css as $css) {
    13             if (false !== strpos( $wp_styles->registered[$style]->src, $css )) {
     13            if (false !== strpos( $style, $css ) || false !== strpos( $wp_styles->registered[$style]->src, $css )) {
    1414                return 1;
    1515            }
     
    2525       
    2626        /* enqueue styles to head, font-awesome only if wasn't enqueued before */
    27         $font_awesome = array('font-awesome', 'fontawesome');       
     27        $font_awesome = array('font-awesome', 'fontawesome', 'font_awesome');       
    2828        if (stylesheet_installed($font_awesome) === 0) {
    2929            wp_enqueue_style('jcss-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css');
     
    4848
    4949
    50 function jcss_add_social_buttons($content)
    51 {   
     50function jcss_add_social_buttons($content) {   
    5251    $options = jcss_get_buttons_options();   
    5352    $jcss_content = $content;
    5453   
    55     if( !empty( $options['post_types'] ) && in_array( get_post_type(), $options['post_types'] ) && is_singular( $options['post_types'] ) )
    56     {
    57         if ( !empty( $options['placement']) && $options['placement'] === "before")
     54    if( !empty( $options['post_types'] ) && in_array( get_post_type(), $options['post_types'] ) && is_singular( $options['post_types'] ) ) {
     55        if ( $options['placement'] === "before" )
    5856            $jcss_content = jcss_social_buttons() . $content;
    59         else
    60             $jcss_content .= jcss_social_buttons();             
     57        else if ( $options['placement'] === "after" )
     58            $jcss_content .= jcss_social_buttons();
     59        else             
     60            $jcss_content = jcss_social_buttons() . $content . jcss_social_buttons();
    6161    }
    6262    return $jcss_content;
     
    6565
    6666
    67 function jcss_load_plugin_textdomain()
    68 {
     67function jcss_load_plugin_textdomain() {
    6968    load_plugin_textdomain( 'social-sharing-buttons-jc', false, 'social-sharing-buttons-and-counters/languages/' );
    7069}
  • social-sharing-buttons-and-counters/trunk/languages/social-sharing-buttons-jc-es_ES.po

    r2103525 r2110263  
    33msgstr ""
    44"Project-Id-Version: Social sharing buttons and counters v1.0.0\n"
    5 "Report-Msgid-Bugs-To: Translator Name <translations@example.com>\n"
    6 "POT-Creation-Date: 2019-06-10 21:41+0200\n"
     5"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/social-sharing-"
     6"buttons-and-counters\n"
     7"POT-Creation-Date: 2019-06-21 16:06:15+00:00\n"
    78"PO-Revision-Date: \n"
    89"Last-Translator: JC <info@josecarlosroman.com>\n"
     
    5960msgstr "Textos en los botones "
    6061
    61 #: inc/admin-page.php:75 inc/admin-page.php:185
     62#: inc/admin-page.php:75 inc/admin-page.php:192
    6263msgid "Yes"
    6364msgstr "Sí"
    6465
    65 #: inc/admin-page.php:76 inc/admin-page.php:186
     66#: inc/admin-page.php:76 inc/admin-page.php:193
    6667msgid "No"
    6768msgstr "No"
     
    7576"espacio para los botones"
    7677
    77 #: inc/admin-page.php:83
     78#: inc/admin-page.php:81
     79msgid "Always hide the social networks names on mobile screen sizes."
     80msgstr "Ocultar siempre los nombres de las redes sociales en móviles."
     81
     82#: inc/admin-page.php:89
    7883msgid "Buttons location"
    7984msgstr "Ubicación de los botones"
    8085
    81 #: inc/admin-page.php:87
     86#: inc/admin-page.php:93
    8287msgid "Before content"
    8388msgstr "Antes del contenido"
    8489
    85 #: inc/admin-page.php:88
     90#: inc/admin-page.php:94
    8691msgid "After content"
    8792msgstr "Después del contenido"
    8893
    8994#: inc/admin-page.php:95
     95msgid "Both"
     96msgstr "Antes y después del contenido"
     97
     98#: inc/admin-page.php:102
    9099msgid "Add buttons to"
    91100msgstr "Añadir los botones a"
    92101
    93 #: inc/admin-page.php:114
     102#: inc/admin-page.php:121
    94103msgid "Sharing text"
    95104msgstr "Texto junto a los botones"
    96105
    97 #: inc/admin-page.php:118
     106#: inc/admin-page.php:125
    98107msgid "Share this!"
    99108msgstr "¡Compártelo!"
    100109
    101 #: inc/admin-page.php:119
     110#: inc/admin-page.php:126
    102111msgid ""
    103112"Left the field empty if you don't want to display a text before the sharing "
    104113"buttons"
    105114msgstr ""
    106 "Deja este campo vacío si no quieres mostrar ningín texto delante de los "
     115"Deja este campo vacío si no quieres mostrar ningún texto delante de los "
    107116"botones"
    108117
    109 #: inc/admin-page.php:126
     118#: inc/admin-page.php:133
    110119msgid "Sharing text position"
    111120msgstr "Posición del texto"
    112121
    113 #: inc/admin-page.php:130
     122#: inc/admin-page.php:137
    114123msgid "Left"
    115124msgstr "A la izquierda"
    116125
    117 #: inc/admin-page.php:131
     126#: inc/admin-page.php:138
    118127msgid "Above"
    119128msgstr "Arriba"
    120129
    121 #: inc/admin-page.php:137
     130#: inc/admin-page.php:144
    122131msgid "Sharing text weight"
    123 msgstr "Espesor del texto"
    124 
    125 #: inc/admin-page.php:161
     132msgstr "Grosor del texto"
     133
     134#: inc/admin-page.php:168
    126135msgid "Font Awesome 4 compatibility"
    127136msgstr "Compatibilidad con Font Awesome 4"
    128137
    129 #: inc/admin-page.php:166
     138#: inc/admin-page.php:173
    130139msgid ""
    131140"Check ONLY if your theme still uses Font Awesome 4, take into account that "
     
    135144"cuenta que algunos iconos pueden que no se muestren."
    136145
    137 #: inc/admin-page.php:183
     146#: inc/admin-page.php:190
    138147msgid "Play animations?"
    139148msgstr "¿Usar animaciones?"
    140149
    141 #: inc/admin-page.php:189
     150#: inc/admin-page.php:196
    142151msgid ""
    143152"Here you can decide whether or not to play animations when hovering over the "
    144153"sharing buttons."
    145154msgstr ""
    146 "Aquí puedes decidir si quieres que iconos sociales se animen al hacer hover "
    147 "sobre los botones."
    148 
    149 #: inc/admin-page.php:194
     155"Aquí puedes decidir si quieres que los iconos sociales se animen al hacer "
     156"hover sobre los botones."
     157
     158#: inc/admin-page.php:201
    150159msgid "Animation Style"
    151160msgstr "Estilo de la animación"
    152161
    153 #: inc/admin-page.php:198
     162#: inc/admin-page.php:205
    154163msgid "Fade"
    155164msgstr ""
    156165
    157 #: inc/admin-page.php:199
     166#: inc/admin-page.php:206
    158167msgid "Slide"
    159168msgstr ""
    160169
    161 #: inc/admin-page.php:200
     170#: inc/admin-page.php:207
    162171msgid "Bounce"
    163172msgstr ""
    164173
    165 #: inc/admin-page.php:201
     174#: inc/admin-page.php:208
    166175msgid "Spin"
    167176msgstr ""
    168177
    169 #: inc/admin-page.php:207
     178#: inc/admin-page.php:214
    170179msgid "Animation Duration"
    171180msgstr "Duración de la animación"
    172181
    173 #: inc/admin-page.php:211
     182#: inc/admin-page.php:218
    174183msgid "300 miliseconds"
    175184msgstr "300 milisegundos"
    176185
    177 #: inc/admin-page.php:212
     186#: inc/admin-page.php:219
    178187msgid "500 miliseconds"
    179188msgstr "500 milisegundos"
    180189
    181 #: inc/admin-page.php:213
     190#: inc/admin-page.php:220
    182191msgid "700 miliseconds"
    183192msgstr "700 milisegundos"
    184193
    185 #: inc/admin-page.php:214
     194#: inc/admin-page.php:221
    186195msgid "1 second"
    187196msgstr "1 segundo"
    188197
    189 #: inc/admin-page.php:215
     198#: inc/admin-page.php:222
    190199msgid "2 seconds"
    191200msgstr "2 segundos"
    192201
    193 #: inc/admin-page.php:216
     202#: inc/admin-page.php:223
    194203msgid "3 seconds"
    195204msgstr "3 segundos"
    196205
    197 #: inc/admin-page.php:226
     206#: inc/admin-page.php:233
    198207msgid ""
    199208"The shortcode <strong>[jc_buttons]</strong> will render the sharing buttons "
     
    204213"los has configurado en esta página, ¡lo que te permitirá colocarlos "
    205214"practicamente en cualquier parte!"
     215
     216#. Plugin Name of the plugin/theme
     217msgid "Social Sharing Buttons"
     218msgstr ""
     219
     220#. Description of the plugin/theme
     221msgid ""
     222"A lightweight SEO-friendly plugin that allows you to share your posts and "
     223"get more traffic"
     224msgstr ""
     225"Un plugin simple, ligero y SEO-friendly que te permite compartir tus posts y "
     226"conseguir más trafico"
     227
     228#. Author of the plugin/theme
     229msgid "JC"
     230msgstr ""
     231
     232#. Author URI of the plugin/theme
     233msgid "https://josecarlosroman.com/"
     234msgstr ""
    206235
    207236#~ msgid ""
  • social-sharing-buttons-and-counters/trunk/readme.txt

    r2103525 r2110263  
    55Requires at least: 4.0
    66Tested up to: 5.2
    7 Stable tag: 1.2.2
     7Stable tag: 1.2.3
    88License: GPL3
    99License URI: https://www.gnu.org/licenses/gpl.html
     
    1212
    1313== Description ==
     14
    1415Add buttons to share on Buffer, Facebook, LinkedIn, Twitter and WhatsApp.
    1516
     
    2122- Sharing support for Buffer, Facebook, LinkedIn, Twitter and WhatsApp.
    2223- Allows you to drag and drop the buttons you want to display.
    23 - Allows you to add the buttons to public post types.
     24- Allows you to reorder the buttons.
    2425- Allows you to display the buttons after/before the text content.
    2526- Allows you to display a text before/above the buttons
    2627- Allows you to hide the social media names.
    2728- Allows you to play animations on hover.
    28 - Fully responsive
     29- Fully responsive.
    2930- Fully translated into Spanish (es_ES). You can contribute to translate this plugin by contacting the author.
    3031- This plugin has a small file size and uses the necessary (just a few lines) JavaScript and CSS.
    3132- This plugin doesn't use external libraries, only installs font-awesome if hasn't been installed yet.
    32 - This plugin DOESN'T create any TABLES on the WordPress database.
    33 - You can place the social buttons everywhere using the shortcodes this plugin provides.
     33- This plugin doesn't create any tables on the WordPress database.
    3434
    3535== Support ==
     
    5252
    5353== Changelog ==
     54
     55= 1.2.3, date 2019-06-21 =
     56- Added the possibility to add the buttons both after and before the post content.
     57- Added the possibility to choose whether or not to hide the social names on mobile.
    5458
    5559= 1.2.2, date 2019-06-10 =
     
    105109
    106110- Initial release.
    107 
    108 == Upgrade Notice ==
    109  
    110 = 1.2.1 =
    111 This plugin needs Font Awesome 5. If your theme is using a previous version please upgrade in order for the icons to be rendered. If not, just ignore this notice (Font Awesome will be installed by this plugin if needed).
    112 
    113 
    114 
    115 
    116 
    117 
  • social-sharing-buttons-and-counters/trunk/social-sharing-buttons-and-counters.php

    r2103525 r2110263  
    33Plugin Name: Social Sharing Buttons
    44Description: A lightweight SEO-friendly plugin that allows you to share your posts and get more traffic
    5 Version:     1.2.2
     5Version:     1.2.3
    66Author:      JC
    77Author URI:  https://josecarlosroman.com/
     
    1717}
    1818
    19 define('JCSS_PLUGIN_DIR', plugin_dir_path(__FILE__));
    20 define('JCSS_PLUGIN_URL', plugin_dir_url(__FILE__));
     19define( 'JCSS_PLUGIN_DIR', plugin_dir_path(__FILE__) );
     20define( 'JCSS_PLUGIN_URL', plugin_dir_url(__FILE__) );
     21define( 'JCSS_VERSION', '1.2.3' );
    2122
    2223require_once JCSS_PLUGIN_DIR . 'inc/functions.php';
Note: See TracChangeset for help on using the changeset viewer.