Completed
Pull Request — master (#133)
by Sébastien
01:51
created
includes/admin/views/html-notice-no-theme-selectors.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 auto-load-next-post-message">
18
-	<p><?php echo sprintf( __( 'It seems that not all of the required theme selectors have been set. These theme selectors are required in order for %1$s to work. %2$sHow to find my theme selectors?%3$s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), '<a href="https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-theme-selectors" target="_blank">', '</a>' ); ?></p>
18
+	<p><?php echo sprintf(__('It seems that not all of the required theme selectors have been set. These theme selectors are required in order for %1$s to work. %2$sHow to find my theme selectors?%3$s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), '<a href="https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-theme-selectors" target="_blank">', '</a>'); ?></p>
19 19
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-is-supported.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-info auto-load-next-post-message">
18
-	<p><?php echo sprintf( __( 'This theme supports %s. No need to change the theme selectors as they have already been set by the theme.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></p>
18
+	<p><?php echo sprintf(__('This theme supports %s. No need to change the theme selectors as they have already been set by the theme.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></p>
19 19
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-theme-ready.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 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
 
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 <div class="notice notice-success auto-load-next-post-notice is-dismissible">
20 20
 	<div class="auto-load-next-post-notice-inner">
21 21
 		<div class="auto-load-next-post-notice-icon">
22
-			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" />
22
+			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" />
23 23
 		</div>
24 24
 
25 25
 		<div class="auto-load-next-post-notice-content">
26
-			<h3><?php echo esc_html__( 'Congratulations!', 'auto-load-next-post' ); ?></h3>
27
-			<p><?php echo sprintf( __( 'Your current theme <strong>%1$s</strong> is supported. %2$s is ready to increase your pageviews. There is nothing else to setup so your good to go.', 'auto-load-next-post' ), $active_theme->name, esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></p>
26
+			<h3><?php echo esc_html__('Congratulations!', 'auto-load-next-post'); ?></h3>
27
+			<p><?php echo sprintf(__('Your current theme <strong>%1$s</strong> is supported. %2$s is ready to increase your pageviews. There is nothing else to setup so your good to go.', 'auto-load-next-post'), $active_theme->name, esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></p>
28 28
 		</div>
29 29
 	</div>
30 30
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-trying-beta.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,24 +11,24 @@
 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 18
 <div class="notice notice-info auto-load-next-post-notice">
19 19
 	<div class="auto-load-next-post-notice-inner">
20 20
 		<div class="auto-load-next-post-notice-icon">
21
-			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" />
21
+			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" />
22 22
 		</div>
23 23
 
24 24
 		<div class="auto-load-next-post-notice-content">
25
-			<h3><?php echo esc_html__( 'Thanks for trying out this beta!', 'auto-load-next-post' ); ?></h3>
26
-			<p><?php printf( esc_html__( 'If you have any questions about the beta or if you have any feedback at all, let me know. Any little bit you\'re willing to share helps. You can %1$sjoin the Slack channel%2$s to provide feedback, discuss features to be added and integrations to support. Or you can just give feedback the old fashion way pressing the big button on the side.', 'auto-load-next-post' ), '<a href="' . esc_url( 'https://launchpass.com/autoloadnextpost' ) . '" target="_blank">', '</a>' ); ?></p>
25
+			<h3><?php echo esc_html__('Thanks for trying out this beta!', 'auto-load-next-post'); ?></h3>
26
+			<p><?php printf(esc_html__('If you have any questions about the beta or if you have any feedback at all, let me know. Any little bit you\'re willing to share helps. You can %1$sjoin the Slack channel%2$s to provide feedback, discuss features to be added and integrations to support. Or you can just give feedback the old fashion way pressing the big button on the side.', 'auto-load-next-post'), '<a href="'.esc_url('https://launchpass.com/autoloadnextpost').'" target="_blank">', '</a>'); ?></p>
27 27
 		</div>
28 28
 
29 29
 		<div class="auto-load-next-post-send-feedback">
30
-			<?php printf( '<a href="%1$s" class="button button-primary auto-load-next-post-feedback-button" target="_blank">%2$s</a>', esc_url( 'https://autoloadnextpost.com/contact/' ), esc_html__( 'Give Feedback', 'auto-load-next-post' ) ); ?>
31
-			<a href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_beta_notice', 'true' ) ); ?>" class="no-thanks"><?php echo esc_html__( 'Ask me again in 7 days', 'auto-load-next-post' ); ?></a>
30
+			<?php printf('<a href="%1$s" class="button button-primary auto-load-next-post-feedback-button" target="_blank">%2$s</a>', esc_url('https://autoloadnextpost.com/contact/'), esc_html__('Give Feedback', 'auto-load-next-post')); ?>
31
+			<a href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_beta_notice', 'true')); ?>" class="no-thanks"><?php echo esc_html__('Ask me again in 7 days', 'auto-load-next-post'); ?></a>
32 32
 		</div>
33 33
 	</div>
34 34
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-no-comment-selector.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 auto-load-next-post-message">
18
-	<p><?php echo sprintf( __( 'In order to remove comments we need to know what the comments container is. Please identify the comments container under <strong>Theme Selectors</strong>. %1$sHow to find my theme selectors?%2$s', 'auto-load-next-post' ), '<a href="https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-misc" target="_blank">', '</a>' ); ?></p>
18
+	<p><?php echo sprintf(__('In order to remove comments we need to know what the comments container is. Please identify the comments container under <strong>Theme Selectors</strong>. %1$sHow to find my theme selectors?%2$s', 'auto-load-next-post'), '<a href="https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-misc" target="_blank">', '</a>'); ?></p>
19 19
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-please-review.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 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 18
 $current_user = wp_get_current_user();
19 19
 
20
-$time = auto_load_next_post_seconds_to_words( time() - $install_date );
20
+$time = auto_load_next_post_seconds_to_words(time() - $install_date);
21 21
 ?>
22 22
 <div class="notice notice-info auto-load-next-post-notice">
23 23
 	<div class="auto-load-next-post-notice-inner">
24 24
 		<div class="auto-load-next-post-notice-icon">
25
-			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" />
25
+			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" />
26 26
 		</div>
27 27
 
28 28
 		<div class="auto-load-next-post-notice-content">
29
-			<h3><?php echo esc_html__( 'Are you enjoying Auto Load Next Post?', 'auto-load-next-post' ); ?></h3>
30
-			<p><?php printf( esc_html__( 'You have been using %1$s for %2$s now! Mind leaving a quick review and let me know know what you think of the plugin? I\'d really appreciate it!', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), esc_html( $time ) ); ?></p>
29
+			<h3><?php echo esc_html__('Are you enjoying Auto Load Next Post?', 'auto-load-next-post'); ?></h3>
30
+			<p><?php printf(esc_html__('You have been using %1$s for %2$s now! Mind leaving a quick review and let me know know what you think of the plugin? I\'d really appreciate it!', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), esc_html($time)); ?></p>
31 31
 		</div>
32 32
 
33 33
 		<div class="auto-load-next-post-review-now">
34
-			<?php printf( '<a href="%1$s" class="button button-primary auto-load-next-post-review-button" target="_blank">%2$s</a>', esc_url( 'https://wordpress.org/support/plugin/auto-load-next-post/reviews?rate=5#new-post' ), esc_html__( 'Leave a Review', 'auto-load-next-post' ) ); ?>
35
-			<a href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_review_notice', 'true' ) ); ?>" class="no-thanks"><?php echo esc_html__( 'No thank you / I already have', 'auto-load-next-post' ); ?></a>
34
+			<?php printf('<a href="%1$s" class="button button-primary auto-load-next-post-review-button" target="_blank">%2$s</a>', esc_url('https://wordpress.org/support/plugin/auto-load-next-post/reviews?rate=5#new-post'), esc_html__('Leave a Review', 'auto-load-next-post')); ?>
35
+			<a href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_review_notice', 'true')); ?>" class="no-thanks"><?php echo esc_html__('No thank you / I already have', 'auto-load-next-post'); ?></a>
36 36
 		</div>
37 37
 	</div>
38 38
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-welcome.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,31 +10,31 @@  discard block
 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-success auto-load-next-post-notice">
18 18
 	<div class="auto-load-next-post-notice-inner">
19 19
 		<div class="auto-load-next-post-notice-icon">
20
-			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" />
20
+			<img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" />
21 21
 		</div>
22 22
 
23 23
 		<div class="auto-load-next-post-notice-content">
24
-			<h3><?php echo esc_html__( 'Welcome!', 'auto-load-next-post' ); ?></h3>
24
+			<h3><?php echo esc_html__('Welcome!', 'auto-load-next-post'); ?></h3>
25 25
 			<p>
26
-				<?php echo sprintf( __( 'Thank you for activating %1$s! If you\'re a first time user, welcome! You\'re well on your way to increasing your pageviews.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?>
26
+				<?php echo sprintf(__('Thank you for activating %1$s! If you\'re a first time user, welcome! You\'re well on your way to increasing your pageviews.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?>
27 27
 				<?php
28 28
 				// If the theme has not added support then encourage the user to see the documentation.
29
-				if ( !is_alnp_supported() ) {
29
+				if ( ! is_alnp_supported()) {
30 30
 					$query = array(
31 31
 						'autofocus[panel]'   => 'alnp',
32 32
 						'autofocus[section]' => 'auto_load_next_post_theme_selectors',
33 33
 						'url'                => ALNP_Customizer::alnp_get_random_page_permalink(),
34
-						'return'             => admin_url( 'options-general.php?page=auto-load-next-post-settings' ),
34
+						'return'             => admin_url('options-general.php?page=auto-load-next-post-settings'),
35 35
 					);
36
-					$customizer_link = add_query_arg( $query, admin_url( 'customize.php' ) );
37
-					echo sprintf( __( 'I encourage you to check out the plugin documentation and getting started with %1$ssetting up your theme selectors%2$s.', 'auto-load-next-post' ), '<a href="' . esc_url( $customizer_link ) . '">', '</a>' );
36
+					$customizer_link = add_query_arg($query, admin_url('customize.php'));
37
+					echo sprintf(__('I encourage you to check out the plugin documentation and getting started with %1$ssetting up your theme selectors%2$s.', 'auto-load-next-post'), '<a href="'.esc_url($customizer_link).'">', '</a>');
38 38
 				}
39 39
 				?>
40 40
 			</p>
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 		<div class="auto-load-next-post-documentation">
44 44
 			<?php
45 45
 			// If the theme has not added support then display button to documentation.
46
-			if ( !is_alnp_supported() ) {
47
-				printf( '<a href="%1$s" class="button button-primary auto-load-next-post-documentation-button" target="_blank">%2$s</a>', esc_url( 'https://autoloadnextpost.com/documentation/?utm_source=plugin&utm_medium=link&utm_campaign=welcome-notice' ), esc_html__( 'Documentation', 'auto-load-next-post' ) );
46
+			if ( ! is_alnp_supported()) {
47
+				printf('<a href="%1$s" class="button button-primary auto-load-next-post-documentation-button" target="_blank">%2$s</a>', esc_url('https://autoloadnextpost.com/documentation/?utm_source=plugin&utm_medium=link&utm_campaign=welcome-notice'), esc_html__('Documentation', 'auto-load-next-post'));
48 48
 			}
49 49
 			?>
50
-			<a href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_welcome_notice', 'true' ) ); ?>" class="no-thanks"><?php echo esc_html__( 'Dismiss Notice', 'auto-load-next-post' ); ?></a>
50
+			<a href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_welcome_notice', 'true')); ?>" class="no-thanks"><?php echo esc_html__('Dismiss Notice', 'auto-load-next-post'); ?></a>
51 51
 		</div>
52 52
 	</div>
53 53
 </div>
Please login to merge, or discard this patch.
includes/admin/class-alnp-admin-notices.php 2 patches
Spacing   +36 added lines, -36 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,16 +37,16 @@  discard block
 block discarded – undo
37 37
 		 * @version 1.5.0
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 42
 			// Check WordPress enviroment.
43
-			add_action( 'admin_init', array( $this, 'check_wp' ), 12 );
43
+			add_action('admin_init', array($this, 'check_wp'), 12);
44 44
 
45 45
 			// Don't bug the user if they don't want to see any notices.
46
-			add_action( 'admin_init', array( $this, 'dont_bug_me' ), 15 );
46
+			add_action('admin_init', array($this, 'dont_bug_me'), 15);
47 47
 
48 48
 			// Display other admin notices when required. All are dismissable.
49
-			add_action( 'admin_notices', array( $this, 'add_notices' ), 0 );
49
+			add_action('admin_notices', array($this, 'add_notices'), 0);
50 50
 		} // END __construct()
51 51
 
52 52
 		/**
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 		public function check_wp() {
61 61
 			global $wp_version;
62 62
 
63
-			if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) {
64
-				add_action( 'admin_notices', array( $this, 'requirement_wp_notice' ) );
63
+			if ( ! version_compare($wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=')) {
64
+				add_action('admin_notices', array($this, 'requirement_wp_notice'));
65 65
 				return false;
66 66
 			}
67 67
 
@@ -81,25 +81,25 @@  discard block
 block discarded – undo
81 81
 			$user_hidden_notice = false;
82 82
 
83 83
 			// If the user is allowed to install plugins and requested to hide the review notice then hide it for that user.
84
-			if ( ! empty( $_GET['hide_auto_load_next_post_review_notice'] ) && current_user_can( 'install_plugins' ) ) {
85
-				add_user_meta( $current_user->ID, 'auto_load_next_post_hide_review_notice', '1', true );
84
+			if ( ! empty($_GET['hide_auto_load_next_post_review_notice']) && current_user_can('install_plugins')) {
85
+				add_user_meta($current_user->ID, 'auto_load_next_post_hide_review_notice', '1', true);
86 86
 				$user_hidden_notice = true;
87 87
 			}
88 88
 
89 89
 			// If the user is allowed to install plugins and requested to hide the welcome notice then hide it for that user.
90
-			if ( ! empty( $_GET['hide_auto_load_next_post_welcome_notice'] ) && current_user_can( 'install_plugins' ) ) {
91
-				add_user_meta( $current_user->ID, 'auto_load_next_post_hide_welcome_notice', '1', true );
90
+			if ( ! empty($_GET['hide_auto_load_next_post_welcome_notice']) && current_user_can('install_plugins')) {
91
+				add_user_meta($current_user->ID, 'auto_load_next_post_hide_welcome_notice', '1', true);
92 92
 				$user_hidden_notice = true;
93 93
 			}
94 94
 
95
-			if ( ! empty( $_GET['hide_auto_load_next_post_beta_notice'] ) && current_user_can( 'install_plugins' ) ) {
96
-				set_transient( 'alnp_beta_notice_hidden', 'hidden', WEEK_IN_SECONDS );
95
+			if ( ! empty($_GET['hide_auto_load_next_post_beta_notice']) && current_user_can('install_plugins')) {
96
+				set_transient('alnp_beta_notice_hidden', 'hidden', WEEK_IN_SECONDS);
97 97
 				$user_hidden_notice = true;
98 98
 			}
99 99
 
100
-			if ( $user_hidden_notice ) {
100
+			if ($user_hidden_notice) {
101 101
 				// Redirect to the plugins page.
102
-				wp_safe_redirect( admin_url( 'plugins.php' ) ); exit;
102
+				wp_safe_redirect(admin_url('plugins.php')); exit;
103 103
 			}
104 104
 		} // END dont_bug_me()
105 105
 
@@ -118,43 +118,43 @@  discard block
 block discarded – undo
118 118
 			$template = get_option('template');
119 119
 
120 120
 			// Checks if the theme supports Auto Load Next Post.
121
-			if ( is_alnp_supported() ) {
121
+			if (is_alnp_supported()) {
122 122
 				// If supported theme does not match active theme then show notice.
123
-				if ( get_option( 'auto_load_next_post_theme_supported' ) !== $template ) {
124
-					add_action( 'admin_notices', array( $this, 'theme_ready_notice' ) );
125
-					update_option( 'auto_load_next_post_theme_supported', $template );
123
+				if (get_option('auto_load_next_post_theme_supported') !== $template) {
124
+					add_action('admin_notices', array($this, 'theme_ready_notice'));
125
+					update_option('auto_load_next_post_theme_supported', $template);
126 126
 				}
127 127
 			}
128 128
 			else {
129 129
 				// If theme not supported then delete option.
130
-				delete_option( 'auto_load_next_post_theme_supported' );
130
+				delete_option('auto_load_next_post_theme_supported');
131 131
 			}
132 132
 
133 133
 			// Is admin review notice hidden?
134
-			$hide_review_notice = get_user_meta( $current_user->ID, 'auto_load_next_post_hide_review_notice', true );
134
+			$hide_review_notice = get_user_meta($current_user->ID, 'auto_load_next_post_hide_review_notice', true);
135 135
 
136 136
 			// Check if we need to display the review plugin notice.
137
-			if ( current_user_can( 'install_plugins' ) && empty( $hide_review_notice ) ) {
137
+			if (current_user_can('install_plugins') && empty($hide_review_notice)) {
138 138
 				// If it has been a week or more since activating the plugin then display the review notice.
139
-				if ( ( intval( time() - self::$install_date ) ) > WEEK_IN_SECONDS ) {
140
-					add_action( 'admin_notices', array( $this, 'plugin_review_notice' ) );
139
+				if ((intval(time() - self::$install_date)) > WEEK_IN_SECONDS) {
140
+					add_action('admin_notices', array($this, 'plugin_review_notice'));
141 141
 				}
142 142
 			}
143 143
 
144 144
 			// Is admin welcome notice hidden?
145
-			$hide_welcome_notice = get_user_meta( $current_user->ID, 'auto_load_next_post_hide_welcome_notice', true );
145
+			$hide_welcome_notice = get_user_meta($current_user->ID, 'auto_load_next_post_hide_welcome_notice', true);
146 146
 
147 147
 			// Check if we need to display the welcome notice.
148
-			if ( current_user_can( 'install_plugins' ) && empty( $hide_welcome_notice ) ) {
148
+			if (current_user_can('install_plugins') && empty($hide_welcome_notice)) {
149 149
 				// If the user has just installed the plugin for the first time then welcome the user.
150
-				if ( ( intval( time() - strtotime( self::$install_date ) ) / WEEK_IN_SECONDS ) % 52 <= 2 ) {
151
-					add_action( 'admin_notices', array( $this, 'welcome_notice' ) );
150
+				if ((intval(time() - strtotime(self::$install_date)) / WEEK_IN_SECONDS) % 52 <= 2) {
151
+					add_action('admin_notices', array($this, 'welcome_notice'));
152 152
 				}
153 153
 			}
154 154
 
155 155
 			// Is this version of Auto Load Next Post a beta release?
156
-			if ( is_alnp_beta() && empty( get_transient( 'alnp_beta_notice_hidden' ) ) ) {
157
-				add_action( 'admin_notices', array( $this, 'beta_notice' ) );
156
+			if (is_alnp_beta() && empty(get_transient('alnp_beta_notice_hidden'))) {
157
+				add_action('admin_notices', array($this, 'beta_notice'));
158 158
 			}
159 159
 		} // END add_notices()
160 160
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		 * @since  1.4.3
166 166
 		 */
167 167
 		public function requirement_wp_notice() {
168
-			include( dirname( __FILE__ ) . '/views/html-notice-requirement-wp.php' );
168
+			include(dirname(__FILE__).'/views/html-notice-requirement-wp.php');
169 169
 		} // END requirement_wp_notice()
170 170
 
171 171
 		/**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		 * @since  1.5.0
176 176
 		 */
177 177
 		public function theme_ready_notice() {
178
-			include( dirname( __FILE__ ) . '/views/html-notice-theme-ready.php' );
178
+			include(dirname(__FILE__).'/views/html-notice-theme-ready.php');
179 179
 		} // END theme_ready_notice()
180 180
 
181 181
 		/**
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		 * @since  1.5.0
186 186
 		 */
187 187
 		public function welcome_notice() {
188
-			include( dirname( __FILE__ ) . '/views/html-notice-welcome.php' );
188
+			include(dirname(__FILE__).'/views/html-notice-welcome.php');
189 189
 		} // END welcome_notice()
190 190
 
191 191
 		/**
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		 * @since  1.5.0
196 196
 		 */
197 197
 		public function beta_notice() {
198
-			include( dirname( __FILE__ ) . '/views/html-notice-trying-beta.php' );
198
+			include(dirname(__FILE__).'/views/html-notice-trying-beta.php');
199 199
 		} // END beta_notice()
200 200
 
201 201
 		/**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		public function plugin_review_notice() {
209 209
 			$install_date = self::$install_date;
210 210
 
211
-			include( dirname( __FILE__ ) . '/views/html-notice-please-review.php' );
211
+			include(dirname(__FILE__).'/views/html-notice-please-review.php');
212 212
 		} // END plugin_review_notice()
213 213
 
214 214
 	} // END class.
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,7 @@
 block discarded – undo
124 124
 					add_action( 'admin_notices', array( $this, 'theme_ready_notice' ) );
125 125
 					update_option( 'auto_load_next_post_theme_supported', $template );
126 126
 				}
127
-			}
128
-			else {
127
+			} else {
129 128
 				// If theme not supported then delete option.
130 129
 				delete_option( 'auto_load_next_post_theme_supported' );
131 130
 			}
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-misc.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 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
-if ( ! class_exists( 'Auto_Load_Next_Post_Settings_Misc_Tab' ) ) {
17
+if ( ! class_exists('Auto_Load_Next_Post_Settings_Misc_Tab')) {
18 18
 
19 19
 	class Auto_Load_Next_Post_Settings_Misc_Tab extends Auto_Load_Next_Post_Settings_Page {
20 20
 
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 		 */
29 29
 		public function __construct() {
30 30
 			$this->id    = 'misc';
31
-			$this->label = __( 'Misc', 'auto-load-next-post' );
31
+			$this->label = __('Misc', 'auto-load-next-post');
32 32
 
33 33
 			parent::__construct();
34 34
 
35
-			add_action( 'auto_load_next_post_sections_misc', array( __CLASS__, 'no_comment_selector_set' ), 10 );
35
+			add_action('auto_load_next_post_sections_misc', array(__CLASS__, 'no_comment_selector_set'), 10);
36 36
 		} // END __construct()
37 37
 
38 38
 		/**
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 		 * @since  1.5.0
44 44
 		 */
45 45
 		public static function no_comment_selector_set() {
46
-			$comments_container = get_option( 'auto_load_next_post_comments_container' );
47
-			$remove_comments    = get_option( 'auto_load_next_post_remove_comments' );
46
+			$comments_container = get_option('auto_load_next_post_comments_container');
47
+			$remove_comments    = get_option('auto_load_next_post_remove_comments');
48 48
 
49
-			if ( empty( $comments_container ) && ! empty( $remove_comments ) ) {
50
-				include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-no-comment-selector.php' );
49
+			if (empty($comments_container) && ! empty($remove_comments)) {
50
+				include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-no-comment-selector.php');
51 51
 			}
52 52
 		} // END no_comment_selector_set()
53 53
 
@@ -63,47 +63,47 @@  discard block
 block discarded – undo
63 63
 				'auto_load_next_post_misc_settings', array(
64 64
 
65 65
 					array(
66
-						'title' => __( 'Misc', 'auto-load-next-post' ),
66
+						'title' => __('Misc', 'auto-load-next-post'),
67 67
 						'type'  => 'title',
68
-						'desc'  => sprintf( __( 'Here you set if you want to track pageviews, remove comments and load %s javascript in the footer.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ),
68
+						'desc'  => sprintf(__('Here you set if you want to track pageviews, remove comments and load %s javascript in the footer.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')),
69 69
 						'id'    => 'misc_options'
70 70
 					),
71 71
 
72 72
 					array(
73
-						'title'   => __( 'Remove Comments', 'auto-load-next-post' ),
74
-						'desc'    => __( 'Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post' ),
73
+						'title'   => __('Remove Comments', 'auto-load-next-post'),
74
+						'desc'    => __('Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post'),
75 75
 						'id'      => 'auto_load_next_post_remove_comments',
76 76
 						'default' => 'yes',
77 77
 						'type'    => 'checkbox'
78 78
 					),
79 79
 
80 80
 					array(
81
-						'title'   => __( 'Update Google Analytics', 'auto-load-next-post' ),
82
-						'desc'    => __( 'Enable to track each post the visitor is reading. This will count as a pageview. You must already have Google Analytics setup.', 'auto-load-next-post' ),
81
+						'title'   => __('Update Google Analytics', 'auto-load-next-post'),
82
+						'desc'    => __('Enable to track each post the visitor is reading. This will count as a pageview. You must already have Google Analytics setup.', 'auto-load-next-post'),
83 83
 						'id'      => 'auto_load_next_post_google_analytics',
84 84
 						'default' => 'no',
85 85
 						'type'    => 'checkbox'
86 86
 					),
87 87
 
88 88
 					array(
89
-						'title'   => __( 'JavaScript in Footer?', 'auto-load-next-post' ),
90
-						'desc'    => __( 'Enable to load Auto Load Next Post in the footer instead of the header. Can be useful to optimize your site.', 'auto-load-next-post' ),
89
+						'title'   => __('JavaScript in Footer?', 'auto-load-next-post'),
90
+						'desc'    => __('Enable to load Auto Load Next Post in the footer instead of the header. Can be useful to optimize your site.', 'auto-load-next-post'),
91 91
 						'id'      => 'auto_load_next_post_js_footer',
92 92
 						'default' => 'no',
93 93
 						'type'    => 'checkbox'
94 94
 					),
95 95
 
96 96
 					array(
97
-						'title'   => __( 'Reset all data?', 'auto-load-next-post' ),
98
-						'desc'    => __( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ),
97
+						'title'   => __('Reset all data?', 'auto-load-next-post'),
98
+						'desc'    => __('Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post'),
99 99
 						'id'      => 'auto_load_next_post_reset_data',
100 100
 						'default' => 'no',
101 101
 						'type'    => 'reset_data'
102 102
 					),
103 103
 
104 104
 					array(
105
-						'title'   => __( 'Remove all data on uninstall?', 'auto-load-next-post' ),
106
-						'desc'    => __( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ),
105
+						'title'   => __('Remove all data on uninstall?', 'auto-load-next-post'),
106
+						'desc'    => __('If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post'),
107 107
 						'id'      => 'auto_load_next_post_uninstall_data',
108 108
 						'default' => 'no',
109 109
 						'type'    => 'checkbox'
@@ -123,15 +123,15 @@  discard block
 block discarded – undo
123 123
 		 * @since 1.5.0
124 124
 		 * @param mixed $settings
125 125
 		 */
126
-		public function customize_button( $settings ) {
126
+		public function customize_button($settings) {
127 127
 			?>
128 128
 			<tr valign="top">
129
-				<th scope="row" class="titledesc"><?php echo $settings['title'];?></th>
130
-				<td class="forminp forminp-<?php echo sanitize_title( $settings['type'] ) ?>">
131
-					<a href="<?php echo $settings['link']; ?>" class="button-secondary <?php echo esc_attr( $settings['class'] ); ?>">
129
+				<th scope="row" class="titledesc"><?php echo $settings['title']; ?></th>
130
+				<td class="forminp forminp-<?php echo sanitize_title($settings['type']) ?>">
131
+					<a href="<?php echo $settings['link']; ?>" class="button-secondary <?php echo esc_attr($settings['class']); ?>">
132 132
 						<?php echo $settings['button_text']; ?>
133 133
 					</a>
134
-					<span class="description"><?php echo $settings['desc'];?></span>
134
+					<span class="description"><?php echo $settings['desc']; ?></span>
135 135
 				</td>
136 136
 			</tr>
137 137
 			<?php
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		public function output() {
149 149
 			$settings = $this->get_settings();
150 150
 
151
-			Auto_Load_Next_Post_Admin_Settings::output_fields( $settings );
151
+			Auto_Load_Next_Post_Admin_Settings::output_fields($settings);
152 152
 		} // END output()
153 153
 
154 154
 		/**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		public function save() {
161 161
 			$settings = $this->get_settings();
162 162
 
163
-			Auto_Load_Next_Post_Admin_Settings::save_fields( $settings );
163
+			Auto_Load_Next_Post_Admin_Settings::save_fields($settings);
164 164
 		} // END save()
165 165
 
166 166
 	} // END class
Please login to merge, or discard this patch.