Plugin Directory

Changeset 3482460


Ignore:
Timestamp:
03/14/2026 10:04:04 AM (2 weeks ago)
Author:
softaculous
Message:

New version 1.0.4

Location:
socialfeeds/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • socialfeeds/trunk/assets/css/admin.css

    r3481087 r3482460  
    36213621.socialfeeds-edit-name-btn .dashicons,
    36223622.socialfeeds-save-name-btn .dashicons {
    3623 font-size: 20px;
    3624 }
     3623font-size: 18px;
     3624}
  • socialfeeds/trunk/assets/js/admin.js

    r3481087 r3482460  
    465465    function re_initialize_form_handlers() {
    466466        let $form = $('#socialfeeds-wizard-form, #socialfeeds-instagram-wizard-form');
     467        let action_val = $form.find('input[name="action"]').val() || '',
     468        is_instagram = action_val.indexOf('instagram') !== -1 || window.location.hash.indexOf('instagram') !== -1,
     469        platform = is_instagram ? 'instagram' : 'youtube';
     470       
     471        // handle edit icon visibility based on edit mode vs new feed
     472        if ($form.length) {
     473            if (!$('#socialfeeds-edit-id').length && !$form.find('input[name="edit_id"]').val()) {
     474                $('#socialfeeds-wizard-form').find('.socialfeeds-edit-name-btn').hide();
     475            } else {
     476                $('#socialfeeds-wizard-form').find('.socialfeeds-edit-name-btn').show();
     477            }
     478        }
     479       
    467480        if ($form.length && !$('#socialfeeds-edit-id').length && !$form.find('input[name="edit_id"]').val()) {
    468             let action_val = $form.find('input[name="action"]').val() || '',
    469             is_instagram = action_val.indexOf('instagram') !== -1 || window.location.hash.indexOf('instagram') !== -1,
    470             platform = is_instagram ? 'instagram' : 'youtube';
    471481
    472482            let existing_client = $form.find('input[name="client_feed_id"]');
     
    520530                        show_toast('Feed saved successfully!');
    521531
    522                         let saved_id = form_data.get('client_feed_id') || form_data.get('edit_id');
     532                        // Use feed_id from server response (most accurate), then fall back to form data
     533                        let saved_id = response.data?.feed_id || form_data.get('client_feed_id') || form_data.get('edit_id');
     534                        let saved_name = response.data?.feed_name || null;
     535                       
    523536                        if (saved_id) {
    524537                            if (socialfeedsData.existing_ids && !socialfeedsData.existing_ids.includes(saved_id)) {
     
    540553
    541554                            window.history.replaceState({}, '', url.toString());
     555
     556                                form.find('.socialfeeds-save-name-btn').attr('data-feed-id', saved_id);
     557                                form.find('.socialfeeds-edit-name-btn').show();
     558                                let $text = $('.socialfeeds-feed-name-text');
     559                                let $input = $('.socialfeeds-feed-name-input');
     560                               
     561                                if(saved_name){
     562                                    $text.text(saved_name);
     563                                    $input.val(saved_name);
     564                                } else if ($text.length && $text.text().trim() === ''){
     565                                    let platform = is_instagram ? 'instagram' : 'youtube';
     566                                    let defaultName = 'Feed - ' + (platform === 'instagram' ? (form.find('input[name="feed_type"]').val() || 'username') : (form.find('select[name="feed_type"]').val() || 'channel')) + ' ' + saved_id;
     567                                    $text.text(defaultName);
     568                                    $input.val(defaultName);
     569                                }
     570
    542571                        }
    543572
     
    16161645                processData: false,
    16171646                contentType: false,
    1618                 success: function(response){
    1619                     if(response.success){
    1620                         wrapper.find('.socialfeeds-feed-name-text strong').text(newName);
    1621                         wrapper.find('.socialfeeds-feed-name-input').hide();
    1622                         wrapper.find('.socialfeeds-feed-name-text').show();
    1623                         wrapper.find('.socialfeeds-edit-name-btn').show();
    1624                         btn.hide();
    1625                         show_toast('Feed name updated successfully!');
    1626                     } else {
    1627                         show_toast(response.data?.message || 'Failed to save name.', 'error');
     1647                success: function (response) {
     1648                    if (response.success && response.data.feed_id) {
     1649                        feedId = response.data.feed_id;
     1650                        row.attr('data-feed-id', feedId);
     1651                        btn.attr('data-feed-id', feedId);
    16281652                    }
     1653                    wrapper.find('.socialfeeds-feed-name-text').html('<strong>' + newName + '</strong>');
    16291654                },
    1630                 error: function(){
     1655                error: function () {
    16311656                    show_toast('Error saving feed name. Please try again.', 'error');
    16321657                },
    1633                 complete: function(){
    1634                     btn.prop('disabled', false).html(original_text);
     1658                complete: function () {
     1659                    wrapper.find('.socialfeeds-feed-name-input').hide();
     1660                    wrapper.find('.socialfeeds-feed-name-text').show();
     1661                    wrapper.find('.socialfeeds-edit-name-btn').show();
     1662                    btn.hide().prop('disabled', false).html(original_text);
    16351663                }
    16361664            });
  • socialfeeds/trunk/assets/js/frontend.js

    r3481087 r3482460  
    22
    33    // ===== Video play mode: LIGHTBOX, INLINE, NEWTAB =====
    4     $('.socialfeeds-video-item a, .socialfeeds-media-link, .socialfeeds-carousel-item a, .socialfeeds-list-item iframe').on('click', function(e){
    5         let $link = $(this).closest('a');
     4    $('.socialfeeds-youtube-feed').on('click','.socialfeeds-video-item a, .socialfeeds-media-link, .socialfeeds-carousel-item a, .socialfeeds-list-item iframe',function(e){
     5    let $link = $(this).closest('a');
    66        if (!$link.length) $link = $(this);
    77
  • socialfeeds/trunk/main/ajax.php

    r3481087 r3482460  
    9797            }
    9898
    99             if($input_val){
     99            if(!empty($input_val)){
    100100                $preview = isset($_POST['preview_url']) ? rawurldecode(sanitize_text_field(wp_unslash($_POST['preview_url']))) : '';
    101101                $edit_id = isset($_POST['edit_id']) ? sanitize_text_field(wp_unslash($_POST['edit_id'])) : '';
     
    211211        update_option('socialfeeds_youtube_option', $youtube_opts);
    212212
    213         $response = ['message' => esc_html__('Settings saved successfully.', 'socialfeeds')];
    214 
     213        $response = [
     214            'message' => esc_html__('Settings saved successfully.', 'socialfeeds'),
     215            'feed_id' => !empty($feed_id) ? $feed_id : '',
     216            'feed_name' => !empty($name) ? $name : '',
     217        ];
    215218
    216219        wp_send_json_success($response);
     
    245248            $input = isset($_POST['channel_id']) ? sanitize_text_field(wp_unslash($_POST['channel_id'])) : '';
    246249
    247             if($input){
     250            if(!empty($input)){
    248251                if(strpos($input, 'UC') === 0){
    249252                    $channel_id = $input;
     
    264267            }
    265268
    266             if($channel_id){
     269            if(!empty($channel_id)){
    267270                $query_args = [
    268271                    'key' => $api_key,
     
    274277                ];
    275278               
    276                 if($page_token){
     279                if(!empty($page_token)){
    277280                    $query_args['pageToken'] = $page_token;
    278281                }
     
    316319        /* ---------------- VIDEO DETAILS ---------------- */
    317320        $video_ids = array_slice(array_column($items, 'videoId'), 0, $per_page);
    318         if($video_ids && class_exists('\SocialFeedsPro\YouTube') && method_exists('\SocialFeedsPro\YouTube', 'fetch_video_details')){
     321        if(!empty($video_ids) && class_exists('\SocialFeedsPro\YouTube') && method_exists('\SocialFeedsPro\YouTube', 'fetch_video_details')){
    319322            $items = \SocialFeedsPro\YouTube::fetch_video_details($items, $api_key, $per_page);
    320323        }
     
    324327        $channel_info = null;
    325328
    326         if($preview_channel_id){
     329        if(!empty($preview_channel_id)){
    327330            $body = self::fetch_url(add_query_arg([
    328331                'key'  => $api_key,
     
    332335
    333336            $snippet = isset($body['items'][0]['snippet']) ? $body['items'][0]['snippet'] : null;
    334             if($snippet){
     337
     338            if(!empty($snippet)){
    335339                $subscriber_count = isset($body['items'][0]['statistics']['subscriberCount']) ?  $body['items'][0]['statistics']['subscriberCount'] : 0;
    336340                $channel_info = array(
     
    477481
    478482            $response_data = ['items' => $items];
    479             if($nextPageToken){
     483            if(!empty($nextPageToken)){
    480484                $response_data['nextPageToken'] = $nextPageToken;
    481485            }
     
    550554            }
    551555
    552             if(!$vid){
     556            if(empty($vid)){
    553557                continue;
    554558            }
  • socialfeeds/trunk/main/settings/ui.php

    r3481087 r3482460  
    378378
    379379    static function render_wizard_form($feed_type, $preview_url, $edit_id, $settings, $opts, $edit_input = ''){
    380         echo'<form id="socialfeeds-wizard-form">';
    381             echo'<input type="hidden" name="action" id="socialfeeds-form-action" value="socialfeeds_save_settings" class="socialfeeds-wizard-form">
     380        $feed_name   = '';
     381        $input_value = '';
     382        $is_edit_mode = false;
     383        $highest_number = 0;
     384
     385        if(!empty($opts['youtube_feeds']) && is_array($opts['youtube_feeds'])){
     386
     387            foreach($opts['youtube_feeds'] as $f){
     388
     389                if(!is_array($f)){
     390                    continue;
     391                }
     392
     393                if(!empty($edit_id) && isset($f['id']) && $f['id'] == $edit_id){
     394                    $feed_name   = isset($f['name']) ? $f['name'] : '';
     395                    $input_value = isset($f['input']) ? $f['input'] : '';
     396                    $is_edit_mode = true;
     397                }
     398
     399                if(empty($is_edit_mode) && isset($f['type'], $f['name']) && $f['type'] === $feed_type && preg_match('/(\d+)$/', $f['name'], $m)){
     400                    $highest_number = max($highest_number, (int) $m[1]);
     401                }
     402            }
     403        }
     404
     405        if(empty($is_edit_mode)){
     406            $next_number = $highest_number + 1;
     407
     408            $types = [
     409                'channel' => 'Channel',
     410                'playlist' => 'Playlist',
     411                'search' => 'Search',
     412                'single-videos' => 'Single Videos',
     413            ];
     414
     415            $label = isset($types[$feed_type]) ? $types[$feed_type] : '';
     416
     417            $feed_name = 'YouTube Feed - ' . ($label ? $label . ' ' : '') . $next_number;
     418        }
     419       
     420        echo '<form id="socialfeeds-wizard-form">
     421        <input type="hidden" name="action" id="socialfeeds-form-action" value="socialfeeds_save_settings" class="socialfeeds-wizard-form">
    382422            <input type="hidden" id="socialfeeds_stage" name="stage" value="">
    383423            <input type="hidden" name="feed_type" id="socialfeeds-feed-type" value="'.esc_attr($feed_type).'">
     
    402442        // TAB 2: CUSTOMIZE & SETTINGS
    403443        echo '<div class="socialfeeds-wizard-tab-content" id="socialfeeds-content-customize">';
    404         self::render_customize_tab($settings, $preview_url, $edit_id, $feed_type, []);
    405         echo '</div>';
    406        
    407         echo '</div></form>';
     444       
     445        // Centered editable feed name
     446        echo'<div class="socialfeeds-customize-header" style="text-align:center;margin-bottom:30px;">
     447        <div class="socialfeeds-inline-name-wrapper" style="display:inline-flex;align-items:center;gap:10px;">
     448        <span class="socialfeeds-feed-name-text" style="font-size:15px;font-weight:600;">'.esc_html($feed_name).'</span>
     449        <input type="text" class="socialfeeds-feed-name-input" value="'.esc_attr($feed_name).'" style="display:none;font-size:15px;padding:4px 8px;" />
     450        <button type="button" class="socialfeeds-edit-name-btn" title="Edit" style="display:none;"> <span class="dashicons dashicons-edit"></span></button>
     451        <button type="button" class="socialfeeds-save-name-btn" data-feed-id="'.esc_attr($edit_id).'" data-platform="youtube" style="display:none;" title="Save"> <span class="dashicons dashicons-yes"></span></button>';
     452
     453        echo'</div></div>';
     454
     455        self::render_customize_tab($settings, $preview_url, $edit_id, $feed_type, [], $feed_name);
     456
     457        echo'</div>
     458        </div>
     459        </form>';
    408460    }
    409461
  • socialfeeds/trunk/main/shortcodes.php

    r3481087 r3482460  
    462462        -------------------------------------------*/
    463463
    464         if($load_more_enabled && $rendered_count > 0 && (!isset($feed['type']) || $feed['type'] !== 'single-videos') && $rendered_count >= $limit){
     464        if(!empty($load_more_enabled) && $rendered_count > 0 && (!isset($feed['type']) || $feed['type'] !== 'single-videos') && $rendered_count >= $limit){
    465465
    466466            $feed_id = isset($feed['id']) ? $feed['id'] : '';
     
    503503                $html .= "<a href='".esc_url($sub_href)."' target='_blank' rel='noopener' class='socialfeeds-btn-subscribe' style='background: ".esc_attr($subscribe_bg)."; color:".esc_attr($subscribe_text_color)." !important;'>" . esc_html($subscribe_text) . "</a>";
    504504                // load more button hover
    505                 if($load_more_enabled && $rendered_count > 0 && ( ! isset( $feed['type'] ) || $feed['type'] !== 'single-videos' ) && $rendered_count >= $limit ){
     505                if(!empty($load_more_enabled) && $rendered_count > 0 && ( ! isset( $feed['type'] ) || $feed['type'] !== 'single-videos' ) && $rendered_count >= $limit ){
    506506
    507507                    $load_more_hover = isset( $opts['youtube_load_more_hover_color']) ? $opts['youtube_load_more_hover_color'] : 'rgb(24, 3, 85)';
     
    677677            $duration = isset($item['contentDetails']['duration']) ? $item['contentDetails']['duration'] : (isset($item['duration']) ? $item['duration'] : '');
    678678
    679             if($show_duration && !empty($duration)){
     679            if(!empty($show_duration) && !empty($duration)){
    680680                $dur = self::format_iso_duration($duration);
    681681                $inner_content .= "<div class='socialfeeds-video-duration'>".esc_html($dur)."</div>";
     
    687687            $inner_content .= "</a>";
    688688
    689             if($show_title){
     689            if(!empty($show_title)){
    690690                $title_tag = ('list' === $display) ? 'h3' : 'h5';
    691691
     
    737737                $html .= "</div>";
    738738            } elseif('list' === $display && defined('SOCIALFEEDS_PRO_VERSION')){
    739                 $html .= "<div class='socialfeeds-video-item socialfeeds-list-item'";
     739                $html .= "<div class='socialfeeds-video-item socialfeeds-list-item hover-effect-" . esc_attr($hover_effect) . "'";
    740740                if(!empty($item_style)){
    741741                    $html .= " style='".esc_attr($item_style)."'";
     
    745745                $html .= "</div>";
    746746            } elseif('carousel' === $display && defined('SOCIALFEEDS_PRO_VERSION')){
    747                 $html .= "<div class='socialfeeds-video-item socialfeeds-carousel-item'";
     747                $html .= "<div class='socialfeeds-video-item socialfeeds-carousel-item hover-effect-" . esc_attr($hover_effect) . "'";
    748748                if(!empty($item_style)){
    749749                    $html .= " style='".esc_attr($item_style)."'";
  • socialfeeds/trunk/readme.txt

    r3481087 r3482460  
    55Tested up to: 6.9
    66Requires PHP: 7.2
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1515SocialFeeds is a lightweight and easy-to-use WordPress plugin designed to showcase Instagram and YouTube content directly on your website. With quick setup and shortcode support, you can display social media feeds anywhere on your site and keep your content fresh and engaging.
    1616
     17You can find our official documentation at [https://socialfeeds.org/docs](https://socialfeeds.org/docs). We are also active in our community support forums on wordpress.org if you are one of our free users. Our Premium Support Ticket System is at [https://softaculous.deskuss.com](https://softaculous.deskuss.com)
     18
     19[Home Page](https://socialfeeds.org "SocialFeeds Homepage") | [Support](https://softaculous.deskuss.com "SocialFeeds Support") | [Documents](http://socialfeeds.org/docs "Documents")
     20
    1721== SocialFeeds YouTube Free Features ==
    1822
    19 - Display YouTube channel videos
    20 - Quick and easy feed setup from the dashboard
    21 - Show video title, description, play icon, lazy loading, and click-to-play action
    22 - Apply hover effects on video items
    23 - Display feed header with channel name, logo, description, custom logo, and banner
    24 - Show YouTube subscribe button in the header
    25 - Load more videos using the Load More button
    26 - Basic layout and style customization
    27 - Fully responsive and theme compatible
     23* **Display YouTube Channel Videos** – Show videos directly from your YouTube channel on your website.
     24* **Quick and Easy Feed Setup** – Easily create and manage your YouTube feed from the WordPress dashboard.
     25* **Video Information Display** – Display video title, description, play icon, lazy loading, and click-to-play functionality.
     26* **Hover Effects** – Apply hover animation and visual effects to video items for better user interaction.
     27* **Custom Feed Header** – Display a header with channel name, logo, description, custom logo, and banner image.
     28* **YouTube Subscribe Button** – Add a YouTube subscribe button in the feed header to increase channel subscribers.
     29* **Load More Videos** – Allow users to load additional videos using a convenient Load More button.
     30* **Basic Layout and Style Customization** – Customize basic layout and styling options to match your website design.
     31* **Fully Responsive Design** – Feeds automatically adjust to desktop, tablet, and mobile devices and work with most WordPress themes.
    2832
    2933== Upgrade to SocialFeeds PRO for More Power ==
     
    3135Unlock advanced capabilities with **SocialFeeds PRO**, such as:
    3236
    33 - Connect multiple YouTube channels and Instagram accounts
    34 - Display YouTube video duration, publish date, view count, like count, and comment count
    35 - Show YouTube single videos, playlist feeds, and live stream videos
    36 - Enable YouTube video search and advanced filtering options
    37 - Apply advanced design customization for YouTube feeds including colors, fonts, spacing, and styling
    38 - Display Instagram feeds using Grid, Carousel, and Masonry layouts
    39 - Control Instagram feed columns for desktop, tablet, and mobile devices
    40 - Set Instagram content limits and post loading options
    41 - Customize Instagram feed header position, size, profile avatar, bio, follower count, and media count
    42 - Enhance Instagram post experience with captions, likes, comments, posts, reels, icons, and play modes
    43 - Enable Instagram hover states and interaction effects
    44 - Add and customize Instagram follow button
    45 - Customize Instagram Load More button behavior and design
    46 - Sort Instagram posts by newest, most liked, or random order
    47 - Filter Instagram posts by post type, content, and media format
    48 - Control Instagram post spacing, alignment, and aspect ratio
     37* **Multiple Account Support** – Connect and manage multiple YouTube channels and Instagram accounts.
     38* **Advanced Video Details** – Display video duration, publish date, view count, like count, and comment count.
     39* **Multiple YouTube Feed Types** – Show Channel Feeds, Playlist Feeds, Search Feeds, Single Videos, and Live Stream Videos.
     40* **Advanced Feed Design Customization** – Customize colors, fonts, spacing, layouts, and styling for YouTube feeds.
     41* **Instagram Feed Layouts** – Display Instagram feeds using Grid, Carousel, and Masonry layouts.
     42* **Responsive Instagram Columns** – Control the number of columns for desktop, tablet, and mobile devices.
     43* **Post Limits and Loading Control** – Set limits on the number of Instagram posts displayed and configure loading behavior.
     44* **Customizable Instagram Header** – Customize header position, profile avatar, bio, follower count, and media count.
     45* **Enhanced Instagram Post Display** – Show captions, likes, comments, reels, icons, and play modes.
     46* **Instagram Hover Effects** – Enable hover states and interaction effects for Instagram posts.
     47* **Instagram Follow Button** – Add and customize a follow button to grow your Instagram audience.
     48* **Load More Button Customization** – Control the behavior and design of the Instagram Load More button.
     49* **Post Sorting Options** – Sort Instagram posts by newest, most liked, or random order.
     50* **Layout Spacing and Aspect Ratio Control** – Adjust spacing between posts and control the media aspect ratio.
     51* **Live Shortcode Preview** – Display a live preview of the feed using the Preview Block inside the editor.
    4952
    5053== Why Use SocialFeeds? ==
     
    5356- Promote your YouTube and Instagram profiles directly on your website
    5457- Improve website appearance with modern and responsive feed layouts
    55 - Easy integration with shortcodes and page builders
     58- Easy integration with shortcodes
    5659
    5760= Third Party API usage =
     
    99102
    100103= Is SocialFeeds compatible with all themes? =
    101 Yes. SocialFeeds works with all standard WordPress themes and page builders.
     104Yes. SocialFeeds works with all standard WordPress themes.
    102105
    103106== Screenshots ==
    104 1. SocialFeeds dashboard
     107
     1081. SocialFeeds Dashboard
    1051092. YouTube Feeds Type
    106 3. Youtube Customize
     1103. YouTube Customize
    1071114. Instagram Accounts
    108 5. All Feeds
     1125. Instagram Customize
     1136. All Feeds
    109114
    110115== Start Using SocialFeeds ==
     
    114119
    115120== Changelog ==
     121
     122= 1.0.4 =
     123
     124* [Improvement] You can now modify the feed name from the Customize tab.
     125* [Bug-Fix] Fixed an issue where YouTube hover effects were not working in the List and Carousel layouts.
     126* [Bug-Fix] Fixed an issue where the video play mode was not applied to newly loaded videos after clicking Load More.
    116127
    117128= 1.0.3 =
  • socialfeeds/trunk/socialfeeds.php

    r3481087 r3482460  
    44Plugin URI: https://socialfeeds.org
    55Description: YouTube feeds for WordPress with simple Setup and Settings options.
    6 Version: 1.0.3
     6Version: 1.0.4
    77Author: Softaculous Team
    88Author URI: https://softaculous.com/
     
    2121
    2222//SOCIALFEEDS
    23 define('SOCIALFEEDS_VERSION', '1.0.3');
     23define('SOCIALFEEDS_VERSION', '1.0.4');
    2424define('SOCIALFEEDS_FILE', __FILE__);
    2525define('SOCIALFEEDS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.