PluginProbe
Full Screen Background / trunk
Full Screen Background vtrunk
2.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6
fullscreen-background / fullscreen-background.php

fullscreen-background.php in Full Screen Background trunk, at fullscreen-background.php

166 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The plugin bootstrap file
5 *
6 * This file is read by WordPress to generate the plugin information in the plugin
7 * admin area. This file also includes all of the dependencies used by the plugin,
8 * registers the activation and deactivation functions, and defines a function
9 * that starts the plugin.
10 *
11 * @link https://www.enweby.com/
12 * @since 1.0.0
13 * @package Fullscreen_Background
14 *
15 * @wordpress-plugin
16 * Plugin Name: Fullscreen Background
17 * Plugin URI: https://www.enweby.com/product/fullscreen-background/
18 * Description: Lightweight plugin to add Fullscreen Background image or video on your WordPress site by Enweby.
19 * Version: 2.0.8
20 * Author: Enweby
21 * Author URI: https://www.enweby.com/
22 * License: GPL-2.0+
23 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24 * Text Domain: fullscreen-background
25 * Domain Path: /languages
26 */
27 // If this file is called directly, abort.
28 if ( !defined( 'WPINC' ) ) {
29 die;
30 }
31 if ( !defined( 'ABSPATH' ) ) {
32 exit;
33 }
34 if ( function_exists( 'enwbfb_fs' ) ) {
35 enwbfb_fs()->set_basename( false, __FILE__ );
36 } else {
37 if ( !function_exists( 'enwbfb_fs' ) ) {
38 // Create a helper function for easy SDK access.
39 function enwbfb_fs() {
40 global $enwbfb_fs;
41 if ( !isset( $enwbfb_fs ) ) {
42 // Include Freemius SDK.
43 require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
44 $enwbfb_fs = fs_dynamic_init( array(
45 'id' => '12796',
46 'slug' => 'fullscreen-background',
47 'type' => 'plugin',
48 'public_key' => 'pk_ca8aa1c35ac32fc7d44933d812781',
49 'is_premium' => false,
50 'premium_suffix' => 'premium',
51 'has_addons' => false,
52 'has_paid_plans' => true,
53 'menu' => array(
54 'slug' => 'enweby-fullscreen-background-settings',
55 'support' => false,
56 ),
57 'anonymous_mode' => true,
58 'is_live' => true,
59 'is_org_compliant' => true,
60 ) );
61 }
62 return $enwbfb_fs;
63 }
64
65 // Init Freemius.
66 enwbfb_fs();
67 // remove a permission from persmission list from optin screen
68 enwbfb_fs()->add_filter( 'permission_list', 'enwbfb_remove_extensions_permission' );
69 // Not like register_uninstall_hook(), you do NOT have to use a static function.
70 enwbfb_fs()->add_action( 'after_uninstall', 'enwbfb_fs_uninstall_cleanup' );
71 // Signal that SDK was initiated.
72 do_action( 'enwbfb_fs_loaded' );
73 }
74 /***.. Your plugin's main file logic starts here...*/
75 if ( !function_exists( 'enwbfb_fs_uninstall_cleanup' ) ) {
76 /**
77 * Uninstall Cleanup
78 */
79 function enwbfb_fs_uninstall_cleanup() {
80 }
81
82 }
83 /**
84 * Removing extension info permission from optin screen
85 *
86 * @since 1.0.2
87 */
88 function enwbfb_remove_extensions_permission( $permissions ) {
89 foreach ( $permissions as $key => $val ) {
90 if ( $val['id'] !== 'extensions' ) {
91 continue;
92 }
93 unset($permissions[$key]);
94 break;
95 }
96 return $permissions;
97 }
98
99 /**
100 * Currently plugin version.
101 * Start at version 1.0.0 and use SemVer - https://semver.org
102 * Rename this for your plugin and update it as you release new versions.
103 */
104 define( 'FULLSCREEN_BACKGROUND_VERSION', '2.0.8' );
105 /**
106 * Plugin base name.
107 * used to locate plugin resources primarily code files
108 * Start at version 1.0.0
109 */
110 define( 'FULLSCREEN_BACKGROUND_BASE_NAME', plugin_basename( __FILE__ ) );
111 /**
112 * Plugin name.
113 * used to get plugin dashed name.
114 */
115 define( 'FULLSCREEN_BACKGROUND_PLUGIN_NAME', 'fullscreen-background' );
116 /**
117 * Plugin base dir path.
118 * used to locate plugin resources primarily code files
119 * Start at version 1.0.0
120 */
121 defined( 'FULLSCREEN_BACKGROUND_DIR' ) || define( 'FULLSCREEN_BACKGROUND_DIR', plugin_dir_path( __FILE__ ) );
122 /**
123 * To add admin settings in the admmin and to fetch in the frontend later
124 */
125 define( 'ENWEBY_FB_FWAS', 'enweby_fullscreen_background' );
126 /**
127 * The code that runs during plugin activation.
128 * This action is documented in includes/class-fullscreen-background-activator.php
129 */
130 function activate_fullscreen_background() {
131 require_once plugin_dir_path( __FILE__ ) . 'includes/class-fullscreen-background-activator.php';
132 Fullscreen_Background_Activator::activate();
133 }
134
135 /**
136 * The code that runs during plugin deactivation.
137 * This action is documented in includes/class-fullscreen-background-deactivator.php
138 */
139 function deactivate_fullscreen_background() {
140 require_once plugin_dir_path( __FILE__ ) . 'includes/class-fullscreen-background-deactivator.php';
141 Fullscreen_Background_Deactivator::deactivate();
142 }
143
144 register_activation_hook( __FILE__, 'activate_fullscreen_background' );
145 register_deactivation_hook( __FILE__, 'deactivate_fullscreen_background' );
146 /**
147 * The core plugin class that is used to define internationalization,
148 * admin-specific hooks, and public-facing site hooks.
149 */
150 require plugin_dir_path( __FILE__ ) . 'includes/class-fullscreen-background.php';
151 /**
152 * Begins execution of the plugin.
153 *
154 * Since everything within the plugin is registered via hooks,
155 * then kicking off the plugin from this point in the file does
156 * not affect the page life cycle.
157 *
158 * @since 1.0.0
159 */
160 function run_fullscreen_background() {
161 $plugin = new Fullscreen_Background();
162 $plugin->run();
163 }
164
165 run_fullscreen_background();
166 }