PluginProbe
Full Screen Background / 1.0.5
Full Screen Background v1.0.5
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 1.0.5, at fullscreen-background.php

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