Completed
Branch master (58689d)
by
unknown
02:25
created
includes/admin/views/html-notice-upgrade-warning.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 ?>
17 17
 <div class="notice notice-error is-dismissible">
18
-	<p><?php echo sprintf( __( 'Warning! Version 1.5.0 of %1$s is coming soon and is a major update. Before updating, please test on a staging site. %2$sLearn more about the changes in version 1.5.0 &raquo;%3$s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), '<a href="https://autoloadnextpost.com/2018/05/28/whats-coming-in-v1-5-0-of-auto-load-next-post/" target="_blank">', '</a>' ); ?></p>
18
+	<p><?php echo sprintf(__('Warning! Version 1.5.0 of %1$s is coming soon and is a major update. Before updating, please test on a staging site. %2$sLearn more about the changes in version 1.5.0 &raquo;%3$s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), '<a href="https://autoloadnextpost.com/2018/05/28/whats-coming-in-v1-5-0-of-auto-load-next-post/" target="_blank">', '</a>'); ?></p>
19 19
 </div>
Please login to merge, or discard this patch.
includes/admin/class-auto-load-next-post-admin-notices.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-if ( ! class_exists( 'Auto_Load_Next_Post_Admin_Notices' ) ) {
18
+if ( ! class_exists('Auto_Load_Next_Post_Admin_Notices')) {
19 19
 
20 20
 	class Auto_Load_Next_Post_Admin_Notices {
21 21
 
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 		 * @version 1.4.10
38 38
 		 */
39 39
 		public function __construct() {
40
-			self::$install_date = get_site_option( 'auto_load_next_post_install_date', time() );
40
+			self::$install_date = get_site_option('auto_load_next_post_install_date', time());
41 41
 
42
-			add_action( 'admin_init', array( $this, 'check_wp' ), 12 );
43
-			add_action( 'admin_init', array( $this, 'dont_bug_me' ), 15 );
42
+			add_action('admin_init', array($this, 'check_wp'), 12);
43
+			add_action('admin_init', array($this, 'dont_bug_me'), 15);
44 44
 
45
-			add_action( 'admin_notices', array( $this, 'add_notices' ), 0 );
45
+			add_action('admin_notices', array($this, 'add_notices'), 0);
46 46
 		} // END __construct()
47 47
 
48 48
 		/**
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 		public function check_wp() {
57 57
 			global $wp_version;
58 58
 
59
-			if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) {
60
-				add_action( 'admin_notices', array( $this, 'requirement_wp_notice' ) );
59
+			if ( ! version_compare($wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=')) {
60
+				add_action('admin_notices', array($this, 'requirement_wp_notice'));
61 61
 				return false;
62 62
 			}
63 63
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 			global $current_user;
76 76
 
77 77
 			// If the user is allowed to install plugins and requested to hide the notice then hide it for that user.
78
-			if ( ! empty( $_GET['hide_auto_load_next_post_review_notice'] ) && current_user_can( 'install_plugins' ) ) {
79
-				add_user_meta( $current_user->ID, 'auto_load_next_post_hide_review_notice', '1', true );
78
+			if ( ! empty($_GET['hide_auto_load_next_post_review_notice']) && current_user_can('install_plugins')) {
79
+				add_user_meta($current_user->ID, 'auto_load_next_post_hide_review_notice', '1', true);
80 80
 				// Redirect to the plugins page.
81
-				wp_safe_redirect( admin_url( 'plugins.php' ) ); exit;
81
+				wp_safe_redirect(admin_url('plugins.php')); exit;
82 82
 			}
83 83
 		} // END dont_bug_me()
84 84
 
@@ -96,26 +96,26 @@  discard block
 block discarded – undo
96 96
 
97 97
 			$template = get_option('template');
98 98
 
99
-			if ( ! supports_alnp() ) {
99
+			if ( ! supports_alnp()) {
100 100
 				// If user hides theme support notice then set active theme.
101
-				if ( ! empty( $_GET['hide_auto_load_next_post_theme_support_check'] ) ) {
102
-					update_option( 'auto_load_next_post_theme_support_check', $template );
101
+				if ( ! empty($_GET['hide_auto_load_next_post_theme_support_check'])) {
102
+					update_option('auto_load_next_post_theme_support_check', $template);
103 103
 					return;
104 104
 				}
105 105
 
106
-				if ( get_option( 'auto_load_next_post_theme_support_check' ) !== $template ) {
107
-					add_action( 'admin_notices', array( $this, 'theme_check_notice' ) );
106
+				if (get_option('auto_load_next_post_theme_support_check') !== $template) {
107
+					add_action('admin_notices', array($this, 'theme_check_notice'));
108 108
 				}
109 109
 			}
110 110
 
111 111
 			// Is admin notice hidden?
112
-			$hide_notice = get_user_meta( $current_user->ID, 'auto_load_next_post_hide_review_notice', true );
112
+			$hide_notice = get_user_meta($current_user->ID, 'auto_load_next_post_hide_review_notice', true);
113 113
 
114 114
 			// Check if we need to display the review plugin notice.
115
-			if ( current_user_can( 'install_plugins' ) && empty( $hide_notice ) ) {
115
+			if (current_user_can('install_plugins') && empty($hide_notice)) {
116 116
 				// If it has been a week or more since activating the plugin then display the review notice.
117
-				if ( ( time() - self::$install_date ) > WEEK_IN_SECONDS ) {
118
-					add_action( 'admin_notices', array( $this, 'plugin_review_notice' ) );
117
+				if ((time() - self::$install_date) > WEEK_IN_SECONDS) {
118
+					add_action('admin_notices', array($this, 'plugin_review_notice'));
119 119
 				}
120 120
 			}
121 121
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 		public function upgrade_warning() {
134 134
 			$upgrade_version = '1.5.0';
135 135
 
136
-			if ( version_compare( AUTO_LOAD_NEXT_POST_VERSION, $upgrade_version, '<' ) ) {
137
-				include_once( dirname( __FILE__ ) . '/views/html-notice-upgrade-warning.php' );
136
+			if (version_compare(AUTO_LOAD_NEXT_POST_VERSION, $upgrade_version, '<')) {
137
+				include_once(dirname(__FILE__).'/views/html-notice-upgrade-warning.php');
138 138
 			}
139 139
 		} // END upgrade_warning()
140 140
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		 * @since  1.4.3
146 146
 		 */
147 147
 		public function requirement_wp_notice() {
148
-			include( dirname( __FILE__ ) . '/views/html-notice-requirement-wp.php' );
148
+			include(dirname(__FILE__).'/views/html-notice-requirement-wp.php');
149 149
 		} // END requirement_wp_notice()
150 150
 
151 151
 		/**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		 * @since  1.3.2
156 156
 		 */
157 157
 		public function theme_check_notice() {
158
-			include( dirname( __FILE__ ) . '/views/html-notice-theme-support.php' );
158
+			include(dirname(__FILE__).'/views/html-notice-theme-support.php');
159 159
 		} // END theme_check_notice()
160 160
 
161 161
 		/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		public function plugin_review_notice() {
169 169
 			$install_date = self::$install_date;
170 170
 
171
-			include( dirname( __FILE__ ) . '/views/html-notice-please-review.php' );
171
+			include(dirname(__FILE__).'/views/html-notice-please-review.php');
172 172
 		} // END plugin_review_notice()
173 173
 
174 174
 	} // END class.
Please login to merge, or discard this patch.