Plugin Directory

Changeset 3021420


Ignore:
Timestamp:
01/13/2024 08:10:24 PM (2 years ago)
Author:
Milap
Message:

Added WordPress support 6.4.2 and PHP 8

Location:
facebook-pagelike-widget
Files:
28 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • facebook-pagelike-widget/trunk/facebook_widget.php

    r2863723 r3021420  
    22/**
    33 * @package Widget for Social Page Feeds
    4  * @version 6.2
     4 * @version 6.3
    55 */
    66/*
     
    99Description: This widget adds a Simple Facebook Page Like Widget into your WordPress website sidebar within few minutes.
    1010Author: Milap Patel
    11 Version: 6.2
     11Version: 6.3
    1212Author URI: https://patelmilap.wordpress.com/
    1313Text Domain: facebook-pagelike-widget
     
    5151            require FB_WIDGET_PLUGIN_BASE_URL . '/fb_class.php';
    5252            require FB_WIDGET_PLUGIN_BASE_URL . '/short_code.php';
    53             include FB_WIDGET_PLUGIN_BASE_URL . '/includes/add-review.php';
     53            include FB_WIDGET_PLUGIN_BASE_URL . '/admin/includes/add-review.php';
    5454
    5555        }
  • facebook-pagelike-widget/trunk/fb.js

    r2324530 r3021420  
    22    jQuery('.fb_loader').hide();
    33});
    4 jQuery(document).ready(function() {
    5     appid = milapfbwidgetvars.app_id;
    6     select_lng = milapfbwidgetvars.select_lng;
    7     if (select_lng == '') {
    8         select_lng = 'en_US';
    9     }
    10     (function(d, s, id) {
    11         var js, fjs = d.getElementsByTagName(s)[0];
    12         if (d.getElementById(id))
    13             return;
    14         js = d.createElement(s);
    15         js.id = id;
    16         js.src = "//connect.facebook.net/" + select_lng + "/sdk.js#xfbml=1&version=v2.5&appId=" + appid;
    17         fjs.parentNode.insertBefore(js, fjs);
    18     }(document, 'script', 'facebook-jssdk'));
    19 });
  • facebook-pagelike-widget/trunk/fb_class.php

    r2899469 r3021420  
    2424    function widget( $args , $instance ) {
    2525       
    26         global $app_id, $select_lng;
     26        global $select_lng;
    2727        extract( $args );
    2828       
    2929        $title                          =   apply_filters( 'widget_title' , $instance['title'] );
    30         $app_id                         =   $instance['app_id'];
    3130        $fb_url                         =   $instance['fb_url'];
    3231        $width                          =   $instance['width'];
     
    4847        if ( $title ) echo $before_title . $title . $after_title;
    4948
    50         wp_register_script( 'milapfbwidgetscript' , FB_WIDGET_PLUGIN_URL . 'fb.js', array( 'jquery' ), '1.0' );
    51         wp_enqueue_script( 'milapfbwidgetscript' );
    52        
    53         $local_variables = array( 'app_id' => $app_id, 'select_lng' => $select_lng );
    54         wp_localize_script( 'milapfbwidgetscript', 'milapfbwidgetvars', $local_variables );
     49        wp_register_script( 'scfbwidgetscript' , FB_WIDGET_PLUGIN_URL . 'fb.js', array( 'jquery' ), '1.0' );
     50        wp_enqueue_script( 'scfbwidgetscript' );
     51
     52        wp_register_script( 'scfbexternalscript', 'https://connect.facebook.net/'.$select_lng.'/sdk.js#xfbml=1&version=v18.0', "", '2.0', true );
     53        wp_enqueue_script( 'scfbexternalscript' );
    5554       
    5655        echo '<div class="fb_loader" style="text-align: center !important;"><img src="' . plugins_url() . '/facebook-pagelike-widget/loader.gif" alt="Facebook Pagelike Widget" /></div>';
    5756        echo '<div id="fb-root"></div>
    58         <div class="fb-page" data-href="' . $fb_url . ' " data-width="' . $width . '" data-height="' . $height . '" data-small-header="' . $data_small_header . '" data-adapt-container-width="' . $data_adapt_container_width . '" data-hide-cover="' . $data_hide_cover . '" data-show-facepile="' . $data_show_facepile . '" style="' . $custom_css . '" hide_cta="false" data-tabs="'. $data_tabs .'" data-lazy="'.$data_lazy.'"></div>';
     57        <div class="fb-page" data-href="' . $fb_url . '" data-width="' . $width . '" data-height="' . $height . '" data-small-header="' . $data_small_header . '" data-adapt-container-width="' . $data_adapt_container_width . '" data-hide-cover="' . $data_hide_cover . '" data-show-facepile="' . $data_show_facepile . '" style="' . $custom_css . '" hide_cta="false" data-tabs="'. $data_tabs .'" data-lazy="'.$data_lazy.'"></div>';
    5958        echo $after_widget; ?>
    6059        <!-- A WordPress plugin developed by Milap Patel -->
     
    7372       
    7473        $instance['title']                          =   strip_tags( $new_instance['title'] );
    75         $instance['app_id']                         =   strip_tags( $new_instance['app_id'] );
    7674        $instance['fb_url']                         =   strip_tags( $new_instance['fb_url'] );
    7775        $instance['width']                          =   strip_tags( $new_instance['width'] );
     
    9694         * Set Default Value for widget form
    9795         */
    98         $defaults       =   array( 'title' => 'Like Us On Facebook', 'app_id' => '503595753002055', 'fb_url' => 'https://www.facebook.com/programming.info', 'width' => '300', 'height' => '500', 'data_small_header' => 'false', 'select_lng' => 'en_US', 'data_adapt_container_width' => 'on', 'data_hide_cover' => 'false', 'data_show_facepile' => 'on', 'custom_css' => '', 'data_tabs' => 'timeline', 'data_lazy'=> 'false');
     96        $defaults       =   array( 'title' => 'Like Us On Facebook', 'fb_url' => 'https://www.facebook.com/WordPress', 'width' => '300', 'height' => '500', 'data_small_header' => 'false', 'select_lng' => 'en_US', 'data_adapt_container_width' => 'on', 'data_hide_cover' => 'false', 'data_show_facepile' => 'on', 'custom_css' => '', 'data_tabs' => 'timeline', 'data_lazy'=> 'false');
    9997       
    10098        $instance       =   wp_parse_args( ( array ) $instance, $defaults );
    10199        $title          =   esc_attr( $instance['title'] );
    102         $app_id         =   isset( $instance['app_id'] ) ? esc_attr( $instance['app_id'] ) : "503595753002055";
    103         $fb_url         =   isset( $instance['fb_url'] ) ? esc_attr( $instance['fb_url'] ) : "http://www.facebook.com/wordpress";
     100        $fb_url         =   isset( $instance['fb_url'] ) ? esc_attr( $instance['fb_url'] ) : "http://www.facebook.com/WordPress";
    104101        $width          =   esc_attr( $instance['width'] );
    105102        $height         =   esc_attr( $instance['height'] );
     
    111108            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'facebook-pagelike-widget' ); ?></label>
    112109            <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
    113         </p>
    114         <p>
    115             <label for="<?php echo $this->get_field_id( 'app_id' ); ?>"><?php _e( 'Facebook Application Id:', 'facebook-pagelike-widget' ); ?></label>
    116             <input class="widefat" id="<?php echo $this->get_field_id( 'app_id' ); ?>" name="<?php echo $this->get_field_name( 'app_id' ); ?>" type="text" value="<?php echo $app_id ?>" />
    117110        </p>
    118111        <p>
  • facebook-pagelike-widget/trunk/readme.txt

    r2899469 r3021420  
    44Donate link: https://www.paypal.me/MilapPatel
    55Requires at least: 3.0.1
    6 Tested up to: 6.2
     6Tested up to: 6.4.2
    77Stable tag: trunk
    88License: GPLv2 or later
     
    108108== Changelog ==
    109109
     110= Version 6.3 =
     111* Major code updates.
     112* Removed application id from code and configuration.
     113* Optimized code.
     114* Added support up to WordPress version 6.4.2.
     115* Added support up to PHP version 8.1.12.
     116
    110117= Version 6.2 =
    111118* Removed deprecated data-show-posts parameter.
  • facebook-pagelike-widget/trunk/short_code.php

    r2863723 r3021420  
    11<?php
    2 function fb_plugin_shortcode($atts, $content = null) {
     2function fb_plugin_shortcode($atts) {
    33
    4     $atts = shortcode_atts(array('title' => 'Like Us On Facebook', 'app_id' => '503595753002055', 'fb_url' => 'http://facebook.com/WordPress', 'width' => '400', 'height' => '500', 'data_small_header' => 'false', 'select_lng' => 'en_US', 'data_small_header' => 'false', 'data_adapt_container_width' => 'true', 'data_hide_cover' => 'false', 'data_show_facepile' => 'true', 'custom_css' => '', 'data_tabs' => 'timeline', 'data_lazy'=> 'false'), $atts, 'fb_widget');
     4    $atts = shortcode_atts(array('fb_url' => 'http://facebook.com/WordPress', 'width' => '400', 'height' => '500', 'data_small_header' => 'false', 'data_small_header' => 'false', 'data_adapt_container_width' => 'true', 'data_hide_cover' => 'false', 'data_show_facepile' => 'true', 'custom_css' => '', 'data_tabs' => 'timeline', 'data_lazy'=> 'false'), $atts, 'fb_widget');
    55   
    6     wp_register_script('milapfbwidgetscriptsc', FB_WIDGET_PLUGIN_URL . 'fb_sc.js', array('jquery'));
    7     wp_enqueue_script('milapfbwidgetscriptsc');
    8    
    9     $local_variables = array('app_id' => esc_html($atts['app_id']), 'select_lng' => esc_html($atts['select_lng']));
    10    
    11     wp_localize_script('milapfbwidgetscriptsc', 'milapfbwidgetvarssc', $local_variables);
    12    
    13     $feeds = '<div class="fb_loader" style="text-align: center !important;"><img src="' . plugins_url() . '/facebook-pagelike-widget/loader.gif" /></div><div id="fb-root"></div><div style="display:inherit;" class="fb-page" data-href="' . esc_html($atts['fb_url']) . '" data-width="' . esc_html($atts['width']) . '" data-height="' . esc_html($atts['height']) . '" data-small-header="' . esc_html($atts['data_small_header']) . '" data-adapt-container-width="' . esc_html($atts['data_adapt_container_width']) . '" data-hide-cover="' . esc_html($atts['data_hide_cover']) . '" data-show-facepile="' . esc_html($atts['data_show_facepile']) . '" style="' . esc_html($atts['custom_css']) . '" data-tabs="'. esc_html($atts['data_tabs']) .'" data-lazy="'.esc_html($atts['data_lazy']).'"></div>';
     6    $feeds = '<iframe src="https://www.facebook.com/plugins/page.php?href='.esc_html($atts['fb_url']).'&tabs='.esc_html($atts['data_tabs']).'&width='.esc_html($atts['width']).'&height='.esc_html($atts['height']).'&small_header='.esc_html($atts['data_small_header']).'&adapt_container_width='.esc_html($atts['data_adapt_container_width']).'&hide_cover='.esc_html($atts['data_hide_cover']).'&show_facepile='.esc_html($atts['data_show_facepile']).'&data_lazy='.esc_html($atts['data_lazy']).'" width="'.esc_html($atts['width']).'" height="'.esc_html($atts['height']).'" style="' . esc_html($atts['custom_css']) . '" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>';
    147
    158    return $feeds;
    169}
     10
    1711add_shortcode('fb_widget', 'fb_plugin_shortcode');
     12
     13
    1814?>
Note: See TracChangeset for help on using the changeset viewer.