| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | namespace SimpleWall; |
|---|
| 4 | /** |
|---|
| 5 | * Plugin Name: Simple Wall |
|---|
| 6 | * Plugin URI: https://thivinfo.com/en |
|---|
| 7 | * Description: Display your FB page timeline with a shortcode or a block |
|---|
| 8 | * Author: Sébastien SERRE |
|---|
| 9 | * Author URI: https://thivinfo.com/en |
|---|
| 10 | * Text Domain: simple-wall |
|---|
| 11 | * Requires at least: 6.3 |
|---|
| 12 | * Requires PHP: 8.0 |
|---|
| 13 | * Tested up to: 6.9 |
|---|
| 14 | * Version: 1.1.5 |
|---|
| 15 | * License: GPL v2 or later |
|---|
| 16 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
|---|
| 17 | **/ |
|---|
| 18 | |
|---|
| 19 | /** |
|---|
| 20 | * Plugin developed by a third party developer not in contact with Facebook company |
|---|
| 21 | */ |
|---|
| 22 | |
|---|
| 23 | add_action( 'plugins_loaded', 'SimpleWall\define_constant' ); |
|---|
| 24 | function define_constant() { |
|---|
| 25 | define( 'SIMPLE_VERSION', '1.1.5' ); |
|---|
| 26 | define( 'SIMPLE_FB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|---|
| 27 | define( 'SIMPLE_FB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
|---|
| 28 | define( 'SIMPLE_FB_PLUGIN_DIR', untrailingslashit( SIMPLE_FB_PLUGIN_PATH ) ); |
|---|
| 29 | define( 'SIMPLE_FB_CUST_INC', SIMPLE_FB_PLUGIN_PATH . 'inc/' ); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | add_action( 'plugins_loaded', 'SimpleWall\load_files' ); |
|---|
| 33 | function load_files() { |
|---|
| 34 | $files = scandir( SIMPLE_FB_CUST_INC ); |
|---|
| 35 | foreach ( $files as $file ) { |
|---|
| 36 | if ( is_file( SIMPLE_FB_CUST_INC . $file ) ) { |
|---|
| 37 | require SIMPLE_FB_CUST_INC . $file; |
|---|
| 38 | } |
|---|
| 39 | } |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | add_action( 'wp_enqueue_scripts', 'SimpleWall\register_scripts'); |
|---|
| 43 | function register_scripts() { |
|---|
| 44 | $locale = simplewall_get_fb_locale(); |
|---|
| 45 | wp_register_script( |
|---|
| 46 | 'facebook-jssdk', |
|---|
| 47 | 'https://connect.facebook.net/' . esc_attr( $locale ) . '/sdk.js#xfbml=1&version=v13.0', |
|---|
| 48 | array(), |
|---|
| 49 | null, |
|---|
| 50 | array( |
|---|
| 51 | // 'in_footer' => true, |
|---|
| 52 | 'strategy' => 'defer', |
|---|
| 53 | ) |
|---|
| 54 | ); |
|---|
| 55 | } |
|---|