PluginProbe
Full Screen Background / 2.0.2
Full Screen Background v2.0.2
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 2.0.2, at fullscreen-background.php

165 lines 6.1 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.2
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 // Manually include the Freemius SDK (not needed if using Composer).
44 require_once dirname( __FILE__ ) . '/freemius/start.php';
45 $enwbfb_fs = fs_dynamic_init( array(
46 'id' => '12796',
47 'slug' => 'fullscreen-background',
48 'type' => 'plugin',
49 'public_key' => 'pk_ca8aa1c35ac32fc7d44933d812781',
50 'is_premium' => false,
51 'premium_suffix' => 'premium',
52 'has_addons' => false,
53 'has_paid_plans' => true,
54 'menu' => array(
55 'slug' => 'enweby-fullscreen-background-settings',
56 ),
57 'anonymous_mode' => true,
58 'is_live' => true,
59 ) );
60 }
61 return $enwbfb_fs;
62 }
63
64 // Init Freemius.
65 enwbfb_fs();
66 // remove a permission from persmission list from optin screen
67 enwbfb_fs()->add_filter( 'permission_list', 'enwbfb_remove_extensions_permission' );
68 // Not like register_uninstall_hook(), you do NOT have to use a static function.
69 enwbfb_fs()->add_action( 'after_uninstall', 'enwbfb_fs_uninstall_cleanup' );
70 // Signal that SDK was initiated.
71 do_action( 'enwbfb_fs_loaded' );
72 }
73 /***.. Your plugin's main file logic starts here...*/
74 if ( !function_exists( 'enwbfb_fs_uninstall_cleanup' ) ) {
75 /**
76 * Uninstall Cleanup
77 */
78 function enwbfb_fs_uninstall_cleanup() {
79 }
80
81 }
82 /**
83 * Removing extension info permission from optin screen
84 *
85 * @since 1.0.2
86 */
87 function enwbfb_remove_extensions_permission( $permissions ) {
88 foreach ( $permissions as $key => $val ) {
89 if ( $val['id'] !== 'extensions' ) {
90 continue;
91 }
92 unset($permissions[$key]);
93 break;
94 }
95 return $permissions;
96 }
97
98 /**
99 * Currently plugin version.
100 * Start at version 1.0.0 and use SemVer - https://semver.org
101 * Rename this for your plugin and update it as you release new versions.
102 */
103 define( 'FULLSCREEN_BACKGROUND_VERSION', '2.0.2' );
104 /**
105 * Plugin base name.
106 * used to locate plugin resources primarily code files
107 * Start at version 1.0.0
108 */
109 define( 'FULLSCREEN_BACKGROUND_BASE_NAME', plugin_basename( __FILE__ ) );
110 /**
111 * Plugin name.
112 * used to get plugin dashed name.
113 */
114 define( 'FULLSCREEN_BACKGROUND_PLUGIN_NAME', 'fullscreen-background' );
115 /**
116 * Plugin base dir path.
117 * used to locate plugin resources primarily code files
118 * Start at version 1.0.0
119 */
120 defined( 'FULLSCREEN_BACKGROUND_DIR' ) || define( 'FULLSCREEN_BACKGROUND_DIR', plugin_dir_path( __FILE__ ) );
121 /**
122 * To add admin settings in the admmin and to fetch in the frontend later
123 */
124 define( 'ENWEBY_FB_FWAS', 'enweby_fullscreen_background' );
125 /**
126 * The code that runs during plugin activation.
127 * This action is documented in includes/class-fullscreen-background-activator.php
128 */
129 function activate_fullscreen_background() {
130 require_once plugin_dir_path( __FILE__ ) . 'includes/class-fullscreen-background-activator.php';
131 Fullscreen_Background_Activator::activate();
132 }
133
134 /**
135 * The code that runs during plugin deactivation.
136 * This action is documented in includes/class-fullscreen-background-deactivator.php
137 */
138 function deactivate_fullscreen_background() {
139 require_once plugin_dir_path( __FILE__ ) . 'includes/class-fullscreen-background-deactivator.php';
140 Fullscreen_Background_Deactivator::deactivate();
141 }
142
143 register_activation_hook( __FILE__, 'activate_fullscreen_background' );
144 register_deactivation_hook( __FILE__, 'deactivate_fullscreen_background' );
145 /**
146 * The core plugin class that is used to define internationalization,
147 * admin-specific hooks, and public-facing site hooks.
148 */
149 require plugin_dir_path( __FILE__ ) . 'includes/class-fullscreen-background.php';
150 /**
151 * Begins execution of the plugin.
152 *
153 * Since everything within the plugin is registered via hooks,
154 * then kicking off the plugin from this point in the file does
155 * not affect the page life cycle.
156 *
157 * @since 1.0.0
158 */
159 function run_fullscreen_background() {
160 $plugin = new Fullscreen_Background();
161 $plugin->run();
162 }
163
164 run_fullscreen_background();
165 }