Changeset 3482460
- Timestamp:
- 03/14/2026 10:04:04 AM (2 weeks ago)
- Location:
- socialfeeds/trunk
- Files:
-
- 8 edited
-
assets/css/admin.css (modified) (1 diff)
-
assets/js/admin.js (modified) (4 diffs)
-
assets/js/frontend.js (modified) (1 diff)
-
main/ajax.php (modified) (10 diffs)
-
main/settings/ui.php (modified) (2 diffs)
-
main/shortcodes.php (modified) (6 diffs)
-
readme.txt (modified) (6 diffs)
-
socialfeeds.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
socialfeeds/trunk/assets/css/admin.css
r3481087 r3482460 3621 3621 .socialfeeds-edit-name-btn .dashicons, 3622 3622 .socialfeeds-save-name-btn .dashicons { 3623 font-size: 20px;3624 } 3623 font-size: 18px; 3624 } -
socialfeeds/trunk/assets/js/admin.js
r3481087 r3482460 465 465 function re_initialize_form_handlers() { 466 466 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 467 480 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';471 481 472 482 let existing_client = $form.find('input[name="client_feed_id"]'); … … 520 530 show_toast('Feed saved successfully!'); 521 531 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 523 536 if (saved_id) { 524 537 if (socialfeedsData.existing_ids && !socialfeedsData.existing_ids.includes(saved_id)) { … … 540 553 541 554 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 542 571 } 543 572 … … 1616 1645 processData: false, 1617 1646 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); 1628 1652 } 1653 wrapper.find('.socialfeeds-feed-name-text').html('<strong>' + newName + '</strong>'); 1629 1654 }, 1630 error: function (){1655 error: function () { 1631 1656 show_toast('Error saving feed name. Please try again.', 'error'); 1632 1657 }, 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); 1635 1663 } 1636 1664 }); -
socialfeeds/trunk/assets/js/frontend.js
r3481087 r3482460 2 2 3 3 // ===== 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'); 6 6 if (!$link.length) $link = $(this); 7 7 -
socialfeeds/trunk/main/ajax.php
r3481087 r3482460 97 97 } 98 98 99 if( $input_val){99 if(!empty($input_val)){ 100 100 $preview = isset($_POST['preview_url']) ? rawurldecode(sanitize_text_field(wp_unslash($_POST['preview_url']))) : ''; 101 101 $edit_id = isset($_POST['edit_id']) ? sanitize_text_field(wp_unslash($_POST['edit_id'])) : ''; … … 211 211 update_option('socialfeeds_youtube_option', $youtube_opts); 212 212 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 ]; 215 218 216 219 wp_send_json_success($response); … … 245 248 $input = isset($_POST['channel_id']) ? sanitize_text_field(wp_unslash($_POST['channel_id'])) : ''; 246 249 247 if( $input){250 if(!empty($input)){ 248 251 if(strpos($input, 'UC') === 0){ 249 252 $channel_id = $input; … … 264 267 } 265 268 266 if( $channel_id){269 if(!empty($channel_id)){ 267 270 $query_args = [ 268 271 'key' => $api_key, … … 274 277 ]; 275 278 276 if( $page_token){279 if(!empty($page_token)){ 277 280 $query_args['pageToken'] = $page_token; 278 281 } … … 316 319 /* ---------------- VIDEO DETAILS ---------------- */ 317 320 $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')){ 319 322 $items = \SocialFeedsPro\YouTube::fetch_video_details($items, $api_key, $per_page); 320 323 } … … 324 327 $channel_info = null; 325 328 326 if( $preview_channel_id){329 if(!empty($preview_channel_id)){ 327 330 $body = self::fetch_url(add_query_arg([ 328 331 'key' => $api_key, … … 332 335 333 336 $snippet = isset($body['items'][0]['snippet']) ? $body['items'][0]['snippet'] : null; 334 if($snippet){ 337 338 if(!empty($snippet)){ 335 339 $subscriber_count = isset($body['items'][0]['statistics']['subscriberCount']) ? $body['items'][0]['statistics']['subscriberCount'] : 0; 336 340 $channel_info = array( … … 477 481 478 482 $response_data = ['items' => $items]; 479 if( $nextPageToken){483 if(!empty($nextPageToken)){ 480 484 $response_data['nextPageToken'] = $nextPageToken; 481 485 } … … 550 554 } 551 555 552 if( !$vid){556 if(empty($vid)){ 553 557 continue; 554 558 } -
socialfeeds/trunk/main/settings/ui.php
r3481087 r3482460 378 378 379 379 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"> 382 422 <input type="hidden" id="socialfeeds_stage" name="stage" value=""> 383 423 <input type="hidden" name="feed_type" id="socialfeeds-feed-type" value="'.esc_attr($feed_type).'"> … … 402 442 // TAB 2: CUSTOMIZE & SETTINGS 403 443 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>'; 408 460 } 409 461 -
socialfeeds/trunk/main/shortcodes.php
r3481087 r3482460 462 462 -------------------------------------------*/ 463 463 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){ 465 465 466 466 $feed_id = isset($feed['id']) ? $feed['id'] : ''; … … 503 503 $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>"; 504 504 // 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 ){ 506 506 507 507 $load_more_hover = isset( $opts['youtube_load_more_hover_color']) ? $opts['youtube_load_more_hover_color'] : 'rgb(24, 3, 85)'; … … 677 677 $duration = isset($item['contentDetails']['duration']) ? $item['contentDetails']['duration'] : (isset($item['duration']) ? $item['duration'] : ''); 678 678 679 if( $show_duration&& !empty($duration)){679 if(!empty($show_duration) && !empty($duration)){ 680 680 $dur = self::format_iso_duration($duration); 681 681 $inner_content .= "<div class='socialfeeds-video-duration'>".esc_html($dur)."</div>"; … … 687 687 $inner_content .= "</a>"; 688 688 689 if( $show_title){689 if(!empty($show_title)){ 690 690 $title_tag = ('list' === $display) ? 'h3' : 'h5'; 691 691 … … 737 737 $html .= "</div>"; 738 738 } 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) . "'"; 740 740 if(!empty($item_style)){ 741 741 $html .= " style='".esc_attr($item_style)."'"; … … 745 745 $html .= "</div>"; 746 746 } 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) . "'"; 748 748 if(!empty($item_style)){ 749 749 $html .= " style='".esc_attr($item_style)."'"; -
socialfeeds/trunk/readme.txt
r3481087 r3482460 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 15 15 SocialFeeds 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. 16 16 17 You 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 17 21 == SocialFeeds YouTube Free Features == 18 22 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. 28 32 29 33 == Upgrade to SocialFeeds PRO for More Power == … … 31 35 Unlock advanced capabilities with **SocialFeeds PRO**, such as: 32 36 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. 49 52 50 53 == Why Use SocialFeeds? == … … 53 56 - Promote your YouTube and Instagram profiles directly on your website 54 57 - Improve website appearance with modern and responsive feed layouts 55 - Easy integration with shortcodes and page builders58 - Easy integration with shortcodes 56 59 57 60 = Third Party API usage = … … 99 102 100 103 = Is SocialFeeds compatible with all themes? = 101 Yes. SocialFeeds works with all standard WordPress themes and page builders.104 Yes. SocialFeeds works with all standard WordPress themes. 102 105 103 106 == Screenshots == 104 1. SocialFeeds dashboard 107 108 1. SocialFeeds Dashboard 105 109 2. YouTube Feeds Type 106 3. You tube Customize110 3. YouTube Customize 107 111 4. Instagram Accounts 108 5. All Feeds 112 5. Instagram Customize 113 6. All Feeds 109 114 110 115 == Start Using SocialFeeds == … … 114 119 115 120 == 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. 116 127 117 128 = 1.0.3 = -
socialfeeds/trunk/socialfeeds.php
r3481087 r3482460 4 4 Plugin URI: https://socialfeeds.org 5 5 Description: YouTube feeds for WordPress with simple Setup and Settings options. 6 Version: 1.0. 36 Version: 1.0.4 7 7 Author: Softaculous Team 8 8 Author URI: https://softaculous.com/ … … 21 21 22 22 //SOCIALFEEDS 23 define('SOCIALFEEDS_VERSION', '1.0. 3');23 define('SOCIALFEEDS_VERSION', '1.0.4'); 24 24 define('SOCIALFEEDS_FILE', __FILE__); 25 25 define('SOCIALFEEDS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset
for help on using the changeset viewer.