Simple Full Screen Background Image - Version 1.2.4

Version Description

  • Added automatic deactivation when the pro version of this plugin is installed as the two plugins should not be used together.
  • Automatic deactivation migrates Simple Full Screen Background Image to Pro's settings so the site's layout won't be changed by deactivating the Simple Full Screen Background Image plugin.
  • Added uninstall.php to clean up when the plugin is deleted.
Download this release

Release Info

Developer scott.deluzio
Plugin Icon 128x128 Simple Full Screen Background Image
Version 1.2.4
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.4

Files changed (3) hide show
  1. readme.txt +14 -6
  2. simple-full-screen-background.php +36 -3
  3. uninstall.php +9 -0
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === Simple Full Screen Background Image ===
2
  Contributors: scott.deluzio
3
  Author: scott.deluzio
4
- Author URI: http://scottdeluzio.com
5
  Plugin URI: https://fullscreenbackgroundimages.com
6
- Tags: background, fullscreen, image, bg image, full screen, background image
7
  Requires at least: 3.6
8
- Tested up to: 4.9.4
9
- Stable tag: 1.2.3
10
 
11
  This plugin provides a simple way to set an automatically scaled full screen background image.
12
 
@@ -41,6 +41,12 @@ Learn more about the Pro version [here](https://fullscreenbackgroundimages.com/d
41
 
42
  == Changelog ==
43
 
 
 
 
 
 
 
44
  = 1.2.3 =
45
 
46
  * Included support for [Instant Images](https://wordpress.org/plugins/instant-images/) plugin. This provides users with an easy way to search for and upload images from Unsplash.com locally to their WordPress site. The Instant Images button is now included on the Appearance > Fullscreen BG Image settings page. This requires that the Instant Images plugin be installed and active.
@@ -74,6 +80,8 @@ Learn more about the Pro version [here](https://fullscreenbackgroundimages.com/d
74
 
75
  == Upgrade Notice ==
76
 
77
- = 1.2.3 =
78
 
79
- * Included support for [Instant Images](https://wordpress.org/plugins/instant-images/) plugin. This provides users with an easy way to search for and upload images from Unsplash.com locally to their WordPress site. The Instant Images button is now included on the Appearance > Fullscreen BG Image settings page. This requires that the Instant Images plugin be installed and active.
 
 
1
  === Simple Full Screen Background Image ===
2
  Contributors: scott.deluzio
3
  Author: scott.deluzio
4
+ Author URI: https://scottdeluzio.com
5
  Plugin URI: https://fullscreenbackgroundimages.com
6
+ Tags: background, fullscreen, background image, full screen, image
7
  Requires at least: 3.6
8
+ Tested up to: 4.9.7
9
+ Stable tag: 1.2.4
10
 
11
  This plugin provides a simple way to set an automatically scaled full screen background image.
12
 
41
 
42
  == Changelog ==
43
 
44
+ = 1.2.4 =
45
+
46
+ * Added automatic deactivation when the pro version of this plugin is installed as the two plugins should not be used together.
47
+ * Automatic deactivation migrates Simple Full Screen Background Image to Pro's settings so the site's layout won't be changed by deactivating the Simple Full Screen Background Image plugin.
48
+ * Added uninstall.php to clean up when the plugin is deleted.
49
+
50
  = 1.2.3 =
51
 
52
  * Included support for [Instant Images](https://wordpress.org/plugins/instant-images/) plugin. This provides users with an easy way to search for and upload images from Unsplash.com locally to their WordPress site. The Instant Images button is now included on the Appearance > Fullscreen BG Image settings page. This requires that the Instant Images plugin be installed and active.
80
 
81
  == Upgrade Notice ==
82
 
83
+ = 1.2.4 =
84
 
85
+ * Added automatic deactivation when the pro version of this plugin is installed as the two plugins should not be used together.
86
+ * Automatic deactivation migrates Simple Full Screen Background Image to Pro's settings so the site's layout won't be changed by deactivating the Simple Full Screen Background Image plugin.
87
+ * Added uninstall.php to clean up when the plugin is deleted.
simple-full-screen-background.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Simple Full Screen Background Image
4
- Description: Easily set an automatically scaled full-screen background images
5
- Version: 1.2.3
 
6
  Author: Scott DeLuzio
7
  Author URI: http://scottdeluzio.com
8
  */
@@ -22,7 +23,7 @@ add_action( 'init', 'sfsb_textdomain' );
22
  * global
23
  *****************************************/
24
 
25
- $sfsb_options = get_option('fsb_settings');
26
 
27
  /*****************************************
28
  * includes
@@ -31,3 +32,35 @@ include('includes/admin-page.php');
31
  include('includes/display-image.php');
32
  include('includes/scripts.php');
33
  include('includes/meta-box.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  Plugin Name: Simple Full Screen Background Image
4
+ Plugin URI: https://fullscreenbackgroundimages.com/
5
+ Description: Easily set an automatically scaled full-screen background image
6
+ Version: 1.2.4
7
  Author: Scott DeLuzio
8
  Author URI: http://scottdeluzio.com
9
  */
23
  * global
24
  *****************************************/
25
 
26
+ $sfsb_options = get_option( 'fsb_settings' );
27
 
28
  /*****************************************
29
  * includes
32
  include('includes/display-image.php');
33
  include('includes/scripts.php');
34
  include('includes/meta-box.php');
35
+
36
+
37
+ add_action( 'admin_init', 'sfsb_check_for_pro' );
38
+ function sfsb_check_for_pro(){
39
+ // FSB_VERSION is defined in Pro, so this should be true if Pro is active.
40
+ if( defined( 'FSB_VERSION' ) && is_string( FSB_VERSION ) ){
41
+ global $wpdb;
42
+ global $sfsb_options;
43
+ $pro_table = $wpdb->prefix . "fsb_images";
44
+
45
+ // If pro is active, we want to add the existing image from Simple Full Screen Background Image to the Pro database. First need to check if the pro table exists.
46
+ if ( $wpdb->get_var( "show tables like '$pro_table'" ) == $pro_table ) {
47
+ // Pro table exists, so let's check to see if any images are in the pro table.
48
+ $rowcount = $wpdb->get_var( "SELECT COUNT(*) FROM $pro_table" );
49
+ if( $rowcount == 0 ){
50
+ // No images in the pro table, so we'll add the existing image from Simple Full Screen Background Image with a global context so the site does not lose it's appearance.
51
+ $new_image = $wpdb->insert( $pro_table,
52
+ array(
53
+ 'name' => $sfsb_options['image'],
54
+ 'url' => $sfsb_options['image'],
55
+ 'context' => 'global',
56
+ 'page_ids' => '',
57
+ 'needs_updated' => 0,
58
+ 'priority' => 1
59
+ )
60
+ );
61
+ }
62
+ }
63
+
64
+ deactivate_plugins( plugin_basename( __FILE__ ) );
65
+ }
66
+ }
uninstall.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // if uninstall.php is not called by WordPress, die
3
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
+ die;
5
+ }
6
+
7
+ $option_name = 'fsb_settings';
8
+
9
+ delete_option( $option_name );