| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: Easy Twitter Feeds – Embed Social Media Posts with Live Updates |
| 4 |
* Plugin URI: https://twitter-feed.bplugins.com/ |
| 5 |
* Description: You can Embed your Twitter timeline feed, Follow widget anywhere in WordPress using Shortcode. |
| 6 |
* Version: 1.2.14 |
| 7 |
* Author: bPlugins LLC |
| 8 |
* Author URI: https://bplugins.com/ |
| 9 |
* Text Domain: easy-twitter-feeds |
| 10 |
* Domain Path: /languages |
| 11 |
* License: GPLv2 or later |
| 12 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 13 |
*/ |
| 14 |
|
| 15 |
// ABS PATH |
| 16 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 17 |
// Constants |
| 18 |
if (defined('WP_DEBUG') && WP_DEBUG === true) { |
| 19 |
define('EASY_TF_VERSION', time()); |
| 20 |
} else { |
| 21 |
define('EASY_TF_VERSION', '1.2.14'); |
| 22 |
} |
| 23 |
define( 'EASY_TF_DIR_URL', plugin_dir_url( __FILE__ ) ); |
| 24 |
define( 'EASY_TF_DIR_PATH', plugin_dir_path( __FILE__ ) ); |
| 25 |
|
| 26 |
|
| 27 |
if ( ! function_exists( 'easy_tf_fs' ) ) { |
| 28 |
// Create a helper function for easy SDK access. |
| 29 |
function easy_tf_fs() |
| 30 |
{ |
| 31 |
global $easy_tf_fs; |
| 32 |
|
| 33 |
if (!isset($easy_tf_fs)) { |
| 34 |
// Include Freemius SDK. |
| 35 |
require_once dirname(__FILE__) . '/vendor/freemius-lite/start.php'; |
| 36 |
|
| 37 |
|
| 38 |
$etfConfig = array( |
| 39 |
'id' => '14839', |
| 40 |
'slug' => 'easy-twitter-feeds', |
| 41 |
'type' => 'plugin', |
| 42 |
'public_key' => 'pk_ba9a28a91e7b8f97d024123dad59c', |
| 43 |
'is_premium' => false, |
| 44 |
'menu' => array( |
| 45 |
'slug' => 'edit.php?post_type=easy-twitter-feeds', |
| 46 |
'first-path' => 'edit.php?post_type=easy-twitter-feeds&page=easy-twitter-feeds#/pricing', |
| 47 |
'support' => false, |
| 48 |
) |
| 49 |
); |
| 50 |
$easy_tf_fs = fs_lite_dynamic_init( $etfConfig ); |
| 51 |
} |
| 52 |
return $easy_tf_fs; |
| 53 |
} |
| 54 |
// // Init Freemius. |
| 55 |
easy_tf_fs(); |
| 56 |
// Signal that SDK was initiated. |
| 57 |
do_action('easy_tf_fs_loaded'); |
| 58 |
} |
| 59 |
|
| 60 |
require_once EASY_TF_DIR_PATH . 'inc/CustomPost.php'; |
| 61 |
require_once EASY_TF_DIR_PATH . 'inc/ShortCode.php'; |
| 62 |
|
| 63 |
class EASY_TF_EASY_TWITTER_FEEDS |
| 64 |
{ |
| 65 |
public function __construct(){ |
| 66 |
$this->load_classes(); |
| 67 |
add_action( 'init', [$this, 'onInit'] ); |
| 68 |
add_action('admin_enqueue_scripts', [$this, 'adminEnqueueScripts']); |
| 69 |
} |
| 70 |
|
| 71 |
function onInit(){ |
| 72 |
register_block_type( __DIR__ . '/build' ); |
| 73 |
} |
| 74 |
|
| 75 |
public function load_classes(){ |
| 76 |
require_once plugin_dir_path(__FILE__) . '/inc/admin-menu.php'; |
| 77 |
} |
| 78 |
|
| 79 |
public function adminEnqueueScripts($hook) |
| 80 |
{ |
| 81 |
global $post_type; |
| 82 |
|
| 83 |
if ( $post_type === 'easy-twitter-feeds' ) { |
| 84 |
wp_enqueue_style( 'easy-tf-admin', EASY_TF_DIR_URL . 'assets/css/admin.css', [], EASY_TF_VERSION ); |
| 85 |
wp_enqueue_script( 'easy-tf-admin', EASY_TF_DIR_URL . 'assets/js/admin.js', ['wp-i18n'], EASY_TF_VERSION, true ); |
| 86 |
} |
| 87 |
} |
| 88 |
} |
| 89 |
new EASY_TF_EASY_TWITTER_FEEDS(); |