custom-facebook-feed
Last commit date
admin
4 years ago
assets
4 years ago
inc
4 years ago
languages
5 years ago
templates
4 years ago
vendor
5 years ago
README.txt
4 years ago
changelog.txt
5 years ago
composer.json
5 years ago
custom-facebook-feed.php
4 years ago
email.php
5 years ago
gpl-2.0.txt
5 years ago
custom-facebook-feed.php
137 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: Smash Balloon Custom Facebook Feed |
| 4 | Plugin URI: https://smashballoon.com/custom-facebook-feed |
| 5 | Description: Add completely customizable Facebook feeds to your WordPress site |
| 6 | Version: 4.1.1 |
| 7 | Author: Smash Balloon |
| 8 | Author URI: http://smashballoon.com/ |
| 9 | License: GPLv2 or later |
| 10 | Text Domain: custom-facebook-feed |
| 11 | */ |
| 12 | /* |
| 13 | Copyright 2021 Smash Balloon LLC (email : hey@smashballoon.com) |
| 14 | This program is free software; you can redistribute it and/or modify |
| 15 | it under the terms of the GNU General Public License as published by |
| 16 | the Free Software Foundation; either version 2 of the License, or |
| 17 | (at your option) any later version. |
| 18 | This program is distributed in the hope that it will be useful, |
| 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | GNU General Public License for more details. |
| 22 | You should have received a copy of the GNU General Public License |
| 23 | along with this program; if not, write to the Free Software |
| 24 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 25 | */ |
| 26 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 27 | |
| 28 | define('CFFVER', '4.1.1'); |
| 29 | define( 'WPW_SL_STORE_URL', 'https://smashballoon.com/' ); |
| 30 | define( 'WPW_SL_ITEM_NAME', 'Custom Facebook Feed WordPress Plugin Personal' ); //*!*Update Plugin Name at top of file*!* |
| 31 | |
| 32 | // Db version. |
| 33 | if ( ! defined( 'CFF_DBVERSION' ) ) { |
| 34 | define( 'CFF_DBVERSION', '2.4' ); |
| 35 | } |
| 36 | |
| 37 | |
| 38 | // Plugin Folder Path. |
| 39 | if ( ! defined( 'CFF_PLUGIN_DIR' ) ) { |
| 40 | define( 'CFF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 41 | } |
| 42 | |
| 43 | // Plugin Folder URL. |
| 44 | if ( ! defined( 'CFF_PLUGIN_URL' ) ) { |
| 45 | define( 'CFF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 46 | } |
| 47 | |
| 48 | if ( ! defined( 'CFF_UPLOADS_NAME' ) ) { |
| 49 | define( 'CFF_UPLOADS_NAME', 'sb-facebook-feed-images' ); |
| 50 | } |
| 51 | |
| 52 | // Name of the database table that contains instagram posts |
| 53 | if ( ! defined( 'CFF_POSTS_TABLE' ) ) { |
| 54 | define( 'CFF_POSTS_TABLE', 'cff_posts' ); |
| 55 | } |
| 56 | |
| 57 | // Name of the database table that contains feed ids and the ids of posts |
| 58 | if ( ! defined( 'CFF_FEEDS_POSTS_TABLE' ) ) { |
| 59 | define( 'CFF_FEEDS_POSTS_TABLE', 'cff_feeds_posts' ); |
| 60 | } |
| 61 | |
| 62 | // Plugin File. |
| 63 | if ( ! defined( 'CFF_FILE' ) ) { |
| 64 | define( 'CFF_FILE', __FILE__ ); |
| 65 | } |
| 66 | |
| 67 | if ( ! defined( 'CFF_PLUGIN_BASE' ) ) { |
| 68 | define( 'CFF_PLUGIN_BASE', plugin_basename( CFF_FILE ) ); |
| 69 | } |
| 70 | if ( ! defined( 'CFF_FEED_LOCATOR' ) ) { |
| 71 | define( 'CFF_FEED_LOCATOR', 'cff_facebook_feed_locator' ); |
| 72 | } |
| 73 | |
| 74 | if ( ! defined( 'CFF_BUILDER_DIR' ) ) { |
| 75 | define( 'CFF_BUILDER_DIR', CFF_PLUGIN_DIR . 'admin/builder/' ); |
| 76 | } |
| 77 | |
| 78 | if ( ! defined( 'CFF_BUILDER_URL' ) ) { |
| 79 | define( 'CFF_BUILDER_URL', CFF_PLUGIN_URL . 'admin/builder/' ); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Check PHP version |
| 84 | * |
| 85 | * Check for minimum PHP 5.6 version |
| 86 | * |
| 87 | * @since 2.19 |
| 88 | */ |
| 89 | if ( version_compare( phpversion(), '5.6', '<' ) ) { |
| 90 | if( !function_exists( 'cff_check_php_notice' ) ){ |
| 91 | include CFF_PLUGIN_DIR . 'admin/enqueu-script.php'; |
| 92 | function cff_check_php_notice(){ |
| 93 | $include_revert = ( version_compare( phpversion(), '5.6', '<' ) && version_compare( phpversion(), '5.3', '>' ) ); |
| 94 | ?> |
| 95 | <div class="notice notice-error"> |
| 96 | <div> |
| 97 | <p><strong><?php echo esc_html__('Important:','custom-facebook-feed') ?> </strong><?php echo esc_html__('Your website is using an outdated version of PHP. The Custom Facebook Feed plugin requires PHP version 5.6 or higher and so has been temporarily deactivated.','custom-facebook-feed') ?></p> |
| 98 | |
| 99 | <p> |
| 100 | <?php |
| 101 | echo esc_html__('To continue using the plugin','custom-facebook-feed') . ', '; |
| 102 | |
| 103 | if($include_revert): |
| 104 | echo esc_html__('either use the button below to revert back to the previous version','custom-facebook-feed') . ', '; |
| 105 | else: |
| 106 | echo sprintf( __('you can either manually reinstall the previous version of the plugin (%s) ','custom-facebook-feed' ), '<a href="https://downloads.wordpress.org/plugin/custom-facebook-feed.2.17.1.zip">'. __( 'download', 'custom-facebook-feed' ).'</a>' ); |
| 107 | endif; |
| 108 | |
| 109 | echo esc_html__('or contact your host to request that they upgrade your PHP version to 5.6 or higher.','custom-facebook-feed'); |
| 110 | ?> |
| 111 | </p> |
| 112 | |
| 113 | <?php if($include_revert): ?> |
| 114 | <p><button data-plugin="https://downloads.wordpress.org/plugin/custom-facebook-feed.2.17.1.zip" data-type="plugin" class="cff-notice-admin-btn status-download button button-primary"><?php echo esc_html__('Revert Back to Previous Version','custom-facebook-feed') ?></button></p> |
| 115 | <?php endif; ?> |
| 116 | </div> |
| 117 | </div> |
| 118 | <?php |
| 119 | } |
| 120 | } |
| 121 | add_action( 'admin_notices', 'cff_check_php_notice' ); |
| 122 | return; //Stop until PHP version is fixed |
| 123 | } |
| 124 | |
| 125 | include CFF_PLUGIN_DIR . 'admin/admin-functions.php'; |
| 126 | include CFF_PLUGIN_DIR . 'inc/Custom_Facebook_Feed.php'; |
| 127 | |
| 128 | if ( function_exists('cff_main_pro') ){ |
| 129 | wp_die( "Please deactivate the Pro version of the Custom Facebook Feed plugin before activating this version.<br /><br />Back to the WordPress <a href='".get_admin_url(null, 'plugins.php')."'>Plugins page</a>." ); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | function cff_main() { |
| 134 | return CustomFacebookFeed\Custom_Facebook_Feed::instance(); |
| 135 | } |
| 136 | cff_main(); |
| 137 |