Changeset 2675763
- Timestamp:
- 02/09/2022 03:17:35 PM (4 years ago)
- Location:
- n360-splash-screen/trunk
- Files:
-
- 4 edited
-
includes/splash-screen.php (modified) (3 diffs)
-
n360-splash-screen.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
templates/default-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
n360-splash-screen/trunk/includes/splash-screen.php
r2488676 r2675763 14 14 $this->version_cookie = get_option( 'n360_version_cookie' ); 15 15 $this->cookie_name = $this->version_cookie['cookie_name']; 16 $this->cookie_expiration = 0;16 $this->cookie_expiration = time() + (60*60*24*30); // cookie expires in 30 days 17 17 $this->run = false; 18 18 $this->n360_check_run(); … … 24 24 setCookie( $this->cookie_name, "n360_splash_screen", $this->cookie_expiration, "/", $domain, $_SERVER['HTTPS'] ); 25 25 require_once ( N360_SPLASH_PAGE_ROOT_PATH . 'templates/default-template.php' ); 26 exit;26 exit; 27 27 } 28 28 } … … 33 33 34 34 public function n360_check_run() { 35 if ( ! isset ( $_COOKIE[$this->cookie_name] ) ) {35 if ( ! isset($_COOKIE[$this->cookie_name]) ) { // first time here, never ran 36 36 $this->run = true; 37 } 37 } elseif ( ! isset($_SESSION['splash']) ) { // we have a cookie but it's a new session 38 $this->run = isset(get_option('n360_config')['run_always']) ? true : false; 39 } elseif ( isset(get_option('n360_config')['run_always']) ) { // we have a cookie and a session 40 if ( $_SESSION['splash'] == false ) { 41 $this->run = true; 42 } else { 43 $_SESSION['splash'] = false; 44 } 45 } 38 46 } 39 47 -
n360-splash-screen/trunk/n360-splash-screen.php
r2493532 r2675763 5 5 Plugin URI: https://notion360.com/SplashScreen/ 6 6 Description: Creates a fading splash screen as a landing page for your Wordpress website 7 Version: 1.0. 37 Version: 1.0.4 8 8 Author: bistromatic 9 9 Author URI: https://notion360.com/ … … 11 11 License URI: https://www.gnu.org/licenses/gpl-3.0.html License: GPLv2 or later 12 12 Text Domain: n360splashscreen 13 Requires at least: 4. 014 Tested up to: 5. 713 Requires at least: 4.7 14 Tested up to: 5.9 15 15 */ 16 16 … … 18 18 if ( ! defined( 'ABSPATH' ) ) exit; 19 19 20 define ( 'N360_SPLASH_PAGE_VERSION', '1.0. 0' );20 define ( 'N360_SPLASH_PAGE_VERSION', '1.0.4' ); 21 21 define ( 'N360_VERSION_COOKIE', 'n360_version_cookie' ); 22 22 define ( 'N360_SPLASH_PAGE_ROOT_PATH', plugin_dir_path( __FILE__ ) ); … … 30 30 require_once ( N360_SPLASH_PAGE_ROOT_PATH . 'includes/settings-fields.php' ); 31 31 require_once ( N360_SPLASH_PAGE_ROOT_PATH . 'includes/admin.php' ); 32 } 33 34 $home_url_rel = wp_make_link_relative(get_home_url()) . '/';35 36 if ( !is_admin() && !isset($_GET["r"]) && ( $_SERVER['REQUEST_URI'] == $home_url_rel ) ) { 37 require_once ( N360_SPLASH_PAGE_ROOT_PATH . 'includes/splash-screen.php');38 $splash_screen = new n360_SplashScreen(); 39 if ( $splash_screen->run || isset(get_option('n360_config')['run_always']) ) { 40 $splash_screen->n360_splash_page(); 41 }42 }32 } else { 33 session_start(); 34 $home_url_rel = wp_make_link_relative(get_home_url()) . '/'; 35 if ( $_SERVER['REQUEST_URI'] == $home_url_rel ) { 36 require_once ( N360_SPLASH_PAGE_ROOT_PATH . 'includes/splash-screen.php' ); 37 $splash_screen = new n360_SplashScreen(); 38 if ( $splash_screen->run ) { 39 $splash_screen->n360_splash_page(); 40 } 41 } 42 } 43 43 } 44 45 44 add_action ( 'init', 'n360_plugin_init' ); -
n360-splash-screen/trunk/readme.txt
r2493532 r2675763 4 4 Tags: splash page, splash screen, splash landing page, responsive design, background image, full screen page, fade-in, fade-out 5 5 Requires at least: 4.7 6 Tested up to: 5. 77 Stable tag: 1.0. 36 Tested up to: 5.9 7 Stable tag: 1.0.4 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 58 58 * tested and released for Wordpress 5.7 59 59 * improved splash screen performance 60 = 1.0.4 = 61 * tested and released for Wordpress 5.9 62 * improved the logic for "always run on home screen" -
n360-splash-screen/trunk/templates/default-template.php
r2493532 r2675763 1 <?php 2 $_SESSION['splash'] = true; 3 ?> 4 1 5 <!DOCTYPE html> 2 6 … … 113 117 114 118 function n360animationEnd () { 115 window.location.replace(window.location.href + '?r'); 116 } 119 // window.location.replace(window.location.href); 120 window.location.reload(true); 121 } 117 122 118 123 function n360docReady(fn) {
Note: See TracChangeset
for help on using the changeset viewer.