Changeset 3206719
- Timestamp:
- 12/12/2024 06:04:04 AM (13 months ago)
- Location:
- easy-twitter-feeds
- Files:
-
- 10 added
- 5 deleted
- 3 edited
-
assets/banner-772x250.png (modified) (previous)
-
tags/1.2.7 (added)
-
tags/1.2.7/easy-twitter-feeds.php (added)
-
tags/1.2.7/languages (added)
-
tags/1.2.7/public (added)
-
tags/1.2.7/public/js (added)
-
tags/1.2.7/public/js/widget.js (added)
-
tags/1.2.7/readme.txt (added)
-
trunk/assets (deleted)
-
trunk/dist (deleted)
-
trunk/easy-twitter-feeds.php (modified) (1 diff)
-
trunk/freemius (deleted)
-
trunk/inc (deleted)
-
trunk/languages/easy-twitter.pot (deleted)
-
trunk/public (added)
-
trunk/public/js (added)
-
trunk/public/js/widget.js (added)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-twitter-feeds/trunk/easy-twitter-feeds.php
r3086830 r3206719 1 <?php 2 1 <?php 3 2 /* 4 * Plugin Name: Easy Twitter Feeds 5 * Plugin URI: https://twitter-feed.bplugins.com/ 3 * Plugin Name: Feeds For Twitter 6 4 * Description: You can Embed your Twitter timeline feed, Follow widget anywhere in WordPress using Shortcode. 7 * Version: 1.2. 65 * Version: 1.2.7 8 6 * Author: bPlugins 9 7 * Author URI: https://bplugins.com/ 10 * Text Domain: easy-twitter 8 * Text Domain: easy-twitter-feeds 11 9 * Domain Path: /languages 12 10 * License: GPLv3 13 11 */ 14 // ABS PATH 15 if (!defined('ABSPATH')) 16 { 17 exit; 18 } 12 13 19 14 /*Some Set-up*/ 20 define('ETF_VERSION', '1.2.6'); 21 define('ETF_DIR_URL', plugin_dir_url(__FILE__)); 22 define('ETF_DIR_PATH', plugin_dir_path(__FILE__)); 23 // freemius integration 15 define('ETF_PLUGIN_DIR', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' ); 16 define('ETF_PLUGIN_VERSION', '1.2.7' ); 24 17 25 if (!function_exists('etf_fs')) 26 { 27 // Create a helper function for easy SDK access. 28 function etf_fs() 29 { 30 global $etf_fs; 18 add_action('plugin_loaded','etf_load_textdomain'); 19 function etf_load_textdomain(){ 20 load_textdomain('easy-twitter-feeds', ETF_PLUGIN_DIR.'languages'); 31 21 32 if (!isset($etf_fs))33 {34 require_once dirname(__FILE__) . '/freemius/start.php';35 $etf_fs = fs_dynamic_init(36 array(37 'id' => '14839',38 'slug' => 'easy-twitter-feeds',39 'premium_slug' => 'easy-twitter-feeds-pro',40 'type' => 'plugin',41 'public_key' => 'pk_ba9a28a91e7b8f97d024123dad59c',42 'is_premium' => false,43 'premium_suffix' => 'Pro',44 'has_addons' => false,45 'has_paid_plans' => true,46 'trial' => array(47 'days' => 7,48 'is_require_payment' => false,49 ),50 'menu' => array(51 'slug' => 'edit.php?post_type=easy-twitter-feeds',52 'contact' => false,53 'support' => false,54 ),55 'is_live' => true,56 )57 );58 }59 60 return $etf_fs;61 }62 63 etf_fs();64 do_action('etf_fs_loaded');65 22 } 66 23 67 require_once ETF_DIR_PATH . 'inc/block.php'; 68 require_once ETF_DIR_PATH . 'inc/CustomPost.php'; 69 require_once ETF_DIR_PATH . 'inc/ShortCode.php'; 70 function etfIsPremium() 71 { 72 return etf_fs()->is__premium_only() && etf_fs()->can_use_premium_code(); 24 //Script and style 25 function etf_style_and_scripts() { 26 // wp_enqueue_style( 'h5ap-style', plugin_dir_url( __FILE__ ) . 'public/style/plyr.css', array(), ETF_PLUGIN_VERSION , 'all' ); 27 wp_enqueue_script( 'widget-js', plugin_dir_url( __FILE__ ). 'public/js/widget.js' , array(), ETF_PLUGIN_VERSION , false ); 73 28 } 29 add_action( 'wp_enqueue_scripts', 'etf_style_and_scripts' ); 74 30 75 class ETFPlugin76 {77 public function __construct()78 {79 add_action('init', [$this, 'onInit']);80 add_action('wp_ajax_etfPipeChecker', [$this, 'etfPipeChecker']);81 add_action('wp_ajax_nopriv_etfPipeChecker', [$this, 'etfPipeChecker']);82 add_action('admin_init', [$this, 'registerSettings']);83 add_action('rest_api_init', [$this, 'registerSettings']);84 }85 31 86 function onInit() 87 { 88 load_plugin_textdomain('easy-twitter', false, dirname(plugin_basename(__FILE__)) . '/languages'); 89 } 32 // Shortcode for Timeline 33 function etf_shortcode_func($atts){ 34 extract( shortcode_atts( array( 90 35 91 function etfPipeChecker() 92 { 93 $nonce = $_POST['_wpnonce'] ?? null; 94 if (!wp_verify_nonce($nonce, 'wp_ajax')) 95 { 96 wp_send_json_error('Invalid Request'); 97 } 98 wp_send_json_success([ 99 'isPipe' => etfIsPremium(), 100 ]); 101 } 36 'username' => null, 37 'width' => null, 38 'height' => null, 39 'theme' => 'dark', 40 'title' => 'Tweets by', 102 41 103 function registerSettings() 104 { 105 register_setting('etfUtils', 'etfUtils', [ 106 'show_in_rest' => [ 107 'name' => 'etfUtils', 108 'schema' => [ 109 'type' => 'string', 110 ], 111 ], 112 'type' => 'string', 113 'default' => wp_json_encode([ 114 'nonce' => wp_create_nonce('wp_ajax'), 115 ]), 116 'sanitize_callback' => 'sanitize_text_field', 117 ]); 118 } 42 ), $atts ) ); 43 ?> 44 <?php if (!empty($username)){ ?> 45 <a class="twitter-timeline" 46 data-width="<?php echo esc_attr($width); ?>" 47 data-height="<?php echo esc_attr($height); ?>" 48 data-theme="<?php echo esc_attr($theme); ?>" 49 href="https://twitter.com/<?php echo esc_attr($username); ?>"> 50 <?php echo esc_html($title); ?> <?php echo esc_html($username); ?> 51 </a> 52 53 <?php }else{ echo '<h2>You must enter your Twitter handle in the username attribute of the shortcode. </h2>';} 119 54 120 55 } 121 new ETFPlugin(); 56 add_shortcode('timeline','etf_shortcode_func'); 57 58 59 // Shortcode for Follow button 60 function etf_shortcode_follow_func($atts) { 61 $atts = shortcode_atts( 62 array( 63 'username' => null, 64 'size' => null, 65 'count' => null, 66 ), 67 $atts 68 ); 69 70 if (!empty($atts['username'])) { 71 $username = sanitize_text_field($atts['username']); 72 $size = esc_attr($atts['size']); 73 $count = esc_attr($atts['count']); 74 75 return sprintf( 76 '<a href="https://twitter.com/%s" class="twitter-follow-button" data-size="%s" data-show-count="%s">Follow @%s</a>', 77 $username, $size, $count, esc_html($username) 78 ); 79 } else { 80 return '<h2>' . esc_html__('You must enter your Twitter handle in the username attribute of the shortcode.', 'easy-twitter-feeds') . '</h2>'; 81 } 82 } 83 add_shortcode('follow_button', 'etf_shortcode_follow_func'); -
easy-twitter-feeds/trunk/readme.txt
r3171811 r3206719 1 === Easy Twitter Feed - Twitter feeds plugin for WP===2 Contributors: bplugins, abuhayat, charlescormier, shehabulislam , shehab24, freemius1 === Feeds For Twitter === 2 Contributors: bplugins, abuhayat, charlescormier, shehabulislam, btechnologies, freemius 3 3 Tags: Twitter Feed, Embed Twitter , X Post, follow button, X 4 4 Requires at least: 4.0 5 Tested up to: 6. 5.36 Stable tag: 1.2. 65 Tested up to: 6.7.1 6 Stable tag: 1.2.7 7 7 Requires PHP: 7.1 8 8 Donate link: https://www.buymeacoffee.com/abuhayat 9 License: GPLv 2or later10 License URI: http://www.gnu.org/licenses/gpl- 2.0.html9 License: GPLv3 or later 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html 11 11 12 12 Embed Twitter Timeline/Feed, Post, Video, Hashtag, Follow Button, Tweet Button easily. This plugin is lightweight but super powerful. … … 182 182 183 183 == Upgrade Notice == 184 185 = 1.2.7 - 12 Dec, 24 = 186 * TradeMark Issues solved. 184 187 185 188 = 1.2.6 = … … 211 214 == Changelog == 212 215 216 = 1.2.7 - 12 Dec, 24 = 217 * TradeMark Issues solved. 218 213 219 = 1.2.5 = 214 220 * Performance and code improvement
Note: See TracChangeset
for help on using the changeset viewer.