Completed
Branch master (048980)
by
unknown
01:54
created
includes/admin/views/html-admin-settings.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  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
-$tab_exists        = isset( $tabs[ $current_tab ] ) || has_action( 'auto_load_next_post_sections_' . $current_tab ) || has_action( 'auto_load_next_post_settings_' . $current_tab ) || has_action( 'auto_load_next_post_settings_tabs_' . $current_tab );
19
-$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
18
+$tab_exists        = isset($tabs[$current_tab]) || has_action('auto_load_next_post_sections_'.$current_tab) || has_action('auto_load_next_post_settings_'.$current_tab) || has_action('auto_load_next_post_settings_tabs_'.$current_tab);
19
+$current_tab_label = isset($tabs[$current_tab]) ? $tabs[$current_tab] : '';
20 20
 
21
-if ( ! $tab_exists ) {
22
-	wp_safe_redirect( admin_url( 'options-general.php?page=auto-load-next-post-settings' ) );
21
+if ( ! $tab_exists) {
22
+	wp_safe_redirect(admin_url('options-general.php?page=auto-load-next-post-settings'));
23 23
 	exit;
24 24
 }
25 25
 ?>
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 		<h2 class="nav-tab-wrapper">
29 29
 			<span>Auto Load Next Post v<?php echo AUTO_LOAD_NEXT_POST_VERSION; ?></span>
30 30
 			<?php
31
-				foreach ( $tabs as $slug => $label ) {
32
-					echo '<a href="' . esc_html( admin_url( 'options-general.php?page=auto-load-next-post-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
31
+				foreach ($tabs as $slug => $label) {
32
+					echo '<a href="'.esc_html(admin_url('options-general.php?page=auto-load-next-post-settings&tab='.esc_attr($slug))).'" class="nav-tab '.($current_tab === $slug ? 'nav-tab-active' : '').'">'.esc_html($label).'</a>';
33 33
 				}
34 34
 
35
-				do_action( 'auto_load_next_post_settings_tabs' );
35
+				do_action('auto_load_next_post_settings_tabs');
36 36
 			?>
37 37
 		</h2>
38 38
 		<?php
39
-		do_action( 'auto_load_next_post_sections_' . $current_tab );
39
+		do_action('auto_load_next_post_sections_'.$current_tab);
40 40
 
41 41
 		self::show_messages();
42 42
 
43
-		do_action( 'auto_load_next_post_settings_' . $current_tab );
43
+		do_action('auto_load_next_post_settings_'.$current_tab);
44 44
 		?>
45 45
 		<p class="submit">
46
-			<input name="save" class="button-primary" type="submit" value="<?php esc_attr_e( 'Save Changes', 'auto-load-next-post' ); ?>" />
47
-			<?php wp_nonce_field( 'auto-load-next-post-settings' ); ?>
46
+			<input name="save" class="button-primary" type="submit" value="<?php esc_attr_e('Save Changes', 'auto-load-next-post'); ?>" />
47
+			<?php wp_nonce_field('auto-load-next-post-settings'); ?>
48 48
 		</p>
49 49
 	</form>
50 50
 </div>
Please login to merge, or discard this patch.
includes/admin/views/html-notice-theme-support.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 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-warning auto-load-next-post-message">
19
-	<p><?php printf( esc_html__( 'The theme you are using has not declared support for %s &#8211; please see documentation or the F.A.Q. to find out how to support your theme.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></p>
20
-	<p><a href="<?php echo esc_url( 'https://autoloadnextpost.com/documentation/' ); ?>" target="_blank" class="button-primary"><?php esc_html_e( 'Documentation', 'auto-load-next-post' ); ?></a> <a href="<?php echo esc_url( 'https://autoloadnextpost.com/f-a-q/' ); ?>" target="_blank" class="button-secondary"><?php esc_html_e( 'Frequently Asked Questions', 'auto-load-next-post' ); ?></a> <a class="skip button-secondary" href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_theme_support_check', 'true' ) ); ?>"><?php esc_html_e( 'Hide this notice', 'auto-load-next-post' ); ?></a></p>
19
+	<p><?php printf(esc_html__('The theme you are using has not declared support for %s &#8211; please see documentation or the F.A.Q. to find out how to support your theme.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></p>
20
+	<p><a href="<?php echo esc_url('https://autoloadnextpost.com/documentation/'); ?>" target="_blank" class="button-primary"><?php esc_html_e('Documentation', 'auto-load-next-post'); ?></a> <a href="<?php echo esc_url('https://autoloadnextpost.com/f-a-q/'); ?>" target="_blank" class="button-secondary"><?php esc_html_e('Frequently Asked Questions', 'auto-load-next-post'); ?></a> <a class="skip button-secondary" href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_theme_support_check', 'true')); ?>"><?php esc_html_e('Hide this notice', 'auto-load-next-post'); ?></a></p>
21 21
 </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,13 +11,13 @@  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 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
 <style type="text/css">
23 23
 .notice.auto-load-next-post-notice {
@@ -103,17 +103,17 @@  discard block
 block discarded – undo
103 103
 <div class="notice notice-info auto-load-next-post-notice">
104 104
 	<div class="auto-load-next-post-notice-inner">
105 105
 		<div class="auto-load-next-post-notice-icon">
106
-			<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' ); ?>" />
106
+			<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'); ?>" />
107 107
 		</div>
108 108
 
109 109
 		<div class="auto-load-next-post-notice-content">
110
-			<h3><?php echo esc_html__( 'Are you enjoying Auto Load Next Post?', 'auto-load-next-post' ); ?></h3>
111
-			<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>
110
+			<h3><?php echo esc_html__('Are you enjoying Auto Load Next Post?', 'auto-load-next-post'); ?></h3>
111
+			<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>
112 112
 		</div>
113 113
 
114 114
 		<div class="auto-load-next-post-review-now">
115
-			<?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' ) ); ?>
116
-			<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>
115
+			<?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')); ?>
116
+			<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>
117 117
 		</div>
118 118
 	</div>
119 119
 </div>
Please login to merge, or discard this patch.
includes/admin/class-auto-load-next-post-admin-help.php 1 patch
Spacing   +41 added lines, -41 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_Help' ) ) {
18
+if ( ! class_exists('Auto_Load_Next_Post_Admin_Help')) {
19 19
 
20 20
 	class Auto_Load_Next_Post_Admin_Help {
21 21
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		 * @since  1.0.0
27 27
 		 */
28 28
 		public function __construct() {
29
-			add_action( 'current_screen', array( $this, 'add_help_tabs' ), 50 );
29
+			add_action('current_screen', array($this, 'add_help_tabs'), 50);
30 30
 		} // END __construct()
31 31
 
32 32
 		/**
@@ -38,62 +38,62 @@  discard block
 block discarded – undo
38 38
 		public function add_help_tabs() {
39 39
 			$screen = get_current_screen();
40 40
 
41
-			if (	$screen->id != 'settings_page_auto-load-next-post-settings') {
41
+			if ($screen->id != 'settings_page_auto-load-next-post-settings') {
42 42
 				return;
43 43
 			}
44 44
 
45
-			$screen->add_help_tab( array(
45
+			$screen->add_help_tab(array(
46 46
 				'id'      => 'auto_load_next_post_docs_tab',
47
-				'title'   => __( 'General Settings', 'auto-load-next-post' ),
47
+				'title'   => __('General Settings', 'auto-load-next-post'),
48 48
 				'content' =>
49
-					'<h2>' . __( 'General Settings', 'auto-load-next-post' ) . '</h2>' .
50
-					'<p>' . sprintf( __( '%s requires theme selectors to match the active theme in order to detect the elements and let the magic happen.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . '</p>' .
51
-					'<p>' . __( 'When the plugin was activated, the theme selectors are set to WordPress theme standard. If you are experiencing any problems, it is most likely that at least one of these selectors need to be changed however it could also be related with the theme template structure.', 'auto-load-next-post' ) . '</p>' .
52
-					'<p>' . __( 'These are the default theme selectors when Auto Load Next Post is installed.', 'auto-load-next-post' ) . '</p>' .
53
-					'<h5>' . __( 'Default Theme Selectors', 'auto-load-next-post' ) . '</h5>' .
54
-					'<ul>' .
55
-					'<li><strong>' . __( 'Content Container', 'auto-load-next-post' ) . '</strong>' . '<br>main.site-main</li>' .
56
-					'<li><strong>' . __( 'Post Title', 'auto-load-next-post' ) . '</strong>' . '<br>h1.entry-title</li>' .
57
-					'<li><strong>' . __( 'Post Navigation', 'auto-load-next-post' ) . '</strong>' . '<br>nav.post-navigation</li>' .
58
-					'<li><strong>' . __( 'Comments Container', 'auto-load-next-post' ) . '</strong>' . '<br>div#comments</li>' .
49
+					'<h2>'.__('General Settings', 'auto-load-next-post').'</h2>'.
50
+					'<p>'.sprintf(__('%s requires theme selectors to match the active theme in order to detect the elements and let the magic happen.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')).'</p>'.
51
+					'<p>'.__('When the plugin was activated, the theme selectors are set to WordPress theme standard. If you are experiencing any problems, it is most likely that at least one of these selectors need to be changed however it could also be related with the theme template structure.', 'auto-load-next-post').'</p>'.
52
+					'<p>'.__('These are the default theme selectors when Auto Load Next Post is installed.', 'auto-load-next-post').'</p>'.
53
+					'<h5>'.__('Default Theme Selectors', 'auto-load-next-post').'</h5>'.
54
+					'<ul>'.
55
+					'<li><strong>'.__('Content Container', 'auto-load-next-post').'</strong>'.'<br>main.site-main</li>'.
56
+					'<li><strong>'.__('Post Title', 'auto-load-next-post').'</strong>'.'<br>h1.entry-title</li>'.
57
+					'<li><strong>'.__('Post Navigation', 'auto-load-next-post').'</strong>'.'<br>nav.post-navigation</li>'.
58
+					'<li><strong>'.__('Comments Container', 'auto-load-next-post').'</strong>'.'<br>div#comments</li>'.
59 59
 					'</ul>'
60
-			) );
60
+			));
61 61
 
62
-			$screen->add_help_tab( array(
62
+			$screen->add_help_tab(array(
63 63
 				'id'      => 'auto_load_next_post_support_tab',
64
-				'title'   => __( 'Help & Support', 'auto-load-next-post' ),
64
+				'title'   => __('Help & Support', 'auto-load-next-post'),
65 65
 				'content' =>
66
-					'<h2>' . __( 'Help & Support', 'auto-load-next-post' ) . '</h2>' .
67
-					'<p>' . sprintf( __( 'Should you need help understanding, using, or extending Auto Load Next Post, please <a href="https://autoloadnextpost.com/documentation/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" target="_blank">read the documentation</a>. You will find snippets, tutorials and much more.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . '</p>' .
68
-					'<p>' . sprintf( __( 'For further assistance with %s you can use the <a href="%s" target="_blank">community forum</a>.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), 'https://wordpress.org/support/plugin/auto-load-next-post' ) . '</p> ' .
69
-					'<p>' . sprintf( __( '%1$s is in need of translations. Is the plugin not translated in your language or do you spot errors with the current translations? Helping out is easy! Head over to the project on WordPress.org and click <a href="https://translate.wordpress.org/projects/wp-plugins/auto-load-next-post" target="_blank">Translate %1$s</a>.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . '</p>' .
70
-					'<p><a href="https://autoloadnextpost.com/documentation/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" class="button button-primary" target="_blank">' . __( 'Documentation', 'auto-load-next-post' ) . '</a> <a href="https://wordpress.org/support/plugin/auto-load-next-post" class="button button-secondary" target="_blank">' . __( 'Community Forum', 'auto-load-next-post' ) . '</a> <a href="https://autoloadnextpost.com/f-a-q/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" class="button" target="_blank">' . __( 'Frequently Asked Questions', 'auto-load-next-post' ) . '</a></p>'
71
-			) );
66
+					'<h2>'.__('Help & Support', 'auto-load-next-post').'</h2>'.
67
+					'<p>'.sprintf(__('Should you need help understanding, using, or extending Auto Load Next Post, please <a href="https://autoloadnextpost.com/documentation/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" target="_blank">read the documentation</a>. You will find snippets, tutorials and much more.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')).'</p>'.
68
+					'<p>'.sprintf(__('For further assistance with %s you can use the <a href="%s" target="_blank">community forum</a>.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), 'https://wordpress.org/support/plugin/auto-load-next-post').'</p> '.
69
+					'<p>'.sprintf(__('%1$s is in need of translations. Is the plugin not translated in your language or do you spot errors with the current translations? Helping out is easy! Head over to the project on WordPress.org and click <a href="https://translate.wordpress.org/projects/wp-plugins/auto-load-next-post" target="_blank">Translate %1$s</a>.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')).'</p>'.
70
+					'<p><a href="https://autoloadnextpost.com/documentation/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" class="button button-primary" target="_blank">'.__('Documentation', 'auto-load-next-post').'</a> <a href="https://wordpress.org/support/plugin/auto-load-next-post" class="button button-secondary" target="_blank">'.__('Community Forum', 'auto-load-next-post').'</a> <a href="https://autoloadnextpost.com/f-a-q/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" class="button" target="_blank">'.__('Frequently Asked Questions', 'auto-load-next-post').'</a></p>'
71
+			));
72 72
 
73
-			$screen->add_help_tab( array(
73
+			$screen->add_help_tab(array(
74 74
 				'id'      => 'auto_load_next_post_bugs_tab',
75
-				'title'   => __( 'Found a bug?', 'auto-load-next-post' ),
75
+				'title'   => __('Found a bug?', 'auto-load-next-post'),
76 76
 				'content' =>
77
-					'<h2>' . __( 'Found a bug?', 'auto-load-next-post' ) . '</h2>' .
78
-					'<p>' . sprintf( __( 'If you find a bug within %s, please <a href="%s" target="_blank">report the issue</a> by creating a ticket on the GitHub repository where I can deal with it more appropriately. Please ensure that you have read the <a href="%s" target="_blank">guidelines to contributing</a> prior to submitting your report. To help me solve the issue, please be as descriptive as possible.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), 'https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/issues?state=open', 'https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md') . '</p>' .
79
-					'<p><a href="https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/issues?state=open" class="button button-primary" target="_blank">' . __( 'Report an Issue', 'auto-load-next-post' ) . '</a></p>'
80
-			) );
77
+					'<h2>'.__('Found a bug?', 'auto-load-next-post').'</h2>'.
78
+					'<p>'.sprintf(__('If you find a bug within %s, please <a href="%s" target="_blank">report the issue</a> by creating a ticket on the GitHub repository where I can deal with it more appropriately. Please ensure that you have read the <a href="%s" target="_blank">guidelines to contributing</a> prior to submitting your report. To help me solve the issue, please be as descriptive as possible.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), 'https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/issues?state=open', 'https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md').'</p>'.
79
+					'<p><a href="https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/issues?state=open" class="button button-primary" target="_blank">'.__('Report an Issue', 'auto-load-next-post').'</a></p>'
80
+			));
81 81
 
82 82
 			$screen->add_help_tab(array(
83 83
 				'id'      => 'auto_load_next_post_feedback_tab',
84
-				'title'   => __( 'Feedback', 'auto-load-next-post' ),
84
+				'title'   => __('Feedback', 'auto-load-next-post'),
85 85
 				'content' =>
86
-					'<h2>' . __( 'Feedback', 'auto-load-next-post' ) . '</h2>' .
87
-					'<p>' . __( 'Your feedback is very important to me. Please consider leaving a review on WordPress.org or complete a simple survey.', 'auto-load-next-post' ) . '</p>' .
88
-					'<p>' . sprintf( __( 'If %1$s has worked out for you well and you like it, please consider <a href="%2$s" target="_blank">making a donation</a>.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), 'https://autoloadnextpost.com/donate/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab').'</p>'.
89
-					'<p><a href="https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform" class="button button-primary" target="_blank">' . __( 'Submit a Review', 'auto-load-next-post' ) . '</a> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdzxlvnXRBIw8gqI7Z2O-HzYtncpGjDkLjlaeZLVsfrR61FNA/viewform?usp=sf_link" class="button button-secondary" target="_blank">' . __( 'Complete a Simple Survey', 'auto-load-next-post' ) . '</a> <a href="https://autoloadnextpost.com/donate/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" class="button button-secondary" target="_blank">' . __( 'Make a Donation', 'auto-load-next-post' ) . '</a></p>'
90
-			) );
86
+					'<h2>'.__('Feedback', 'auto-load-next-post').'</h2>'.
87
+					'<p>'.__('Your feedback is very important to me. Please consider leaving a review on WordPress.org or complete a simple survey.', 'auto-load-next-post').'</p>'.
88
+					'<p>'.sprintf(__('If %1$s has worked out for you well and you like it, please consider <a href="%2$s" target="_blank">making a donation</a>.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), 'https://autoloadnextpost.com/donate/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab').'</p>'.
89
+					'<p><a href="https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform" class="button button-primary" target="_blank">'.__('Submit a Review', 'auto-load-next-post').'</a> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdzxlvnXRBIw8gqI7Z2O-HzYtncpGjDkLjlaeZLVsfrR61FNA/viewform?usp=sf_link" class="button button-secondary" target="_blank">'.__('Complete a Simple Survey', 'auto-load-next-post').'</a> <a href="https://autoloadnextpost.com/donate/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" class="button button-secondary" target="_blank">'.__('Make a Donation', 'auto-load-next-post').'</a></p>'
90
+			));
91 91
 
92 92
 			$screen->set_help_sidebar(
93
-				'<p><strong>' . __( 'For more information:', 'auto-load-next-post' ) . '</strong></p>' .
94
-				'<p><a href="https://autoloadnextpost.com/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" target="_blank">' . sprintf( __( 'About %s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . '</a></p>' .
95
-				'<p><a href="https://wordpress.org/plugins/auto-load-next-post" target="_blank">' . __( 'WordPress.org Project', 'auto-load-next-post' ) . '</a></p>' .
96
-				'<p><a href="https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/" target="_blank">' . __( 'Github Project', 'auto-load-next-post' ) . '</a></p>'
93
+				'<p><strong>'.__('For more information:', 'auto-load-next-post').'</strong></p>'.
94
+				'<p><a href="https://autoloadnextpost.com/?utm_source=wpadmin&utm_campaign=plugin-settings-help-tab" target="_blank">'.sprintf(__('About %s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')).'</a></p>'.
95
+				'<p><a href="https://wordpress.org/plugins/auto-load-next-post" target="_blank">'.__('WordPress.org Project', 'auto-load-next-post').'</a></p>'.
96
+				'<p><a href="https://github.com/AutoLoadNextPost/Auto-Load-Next-Post/" target="_blank">'.__('Github Project', 'auto-load-next-post').'</a></p>'
97 97
 			);
98 98
 
99 99
 		} // END add_help_tabs()
Please login to merge, or discard this patch.
includes/class-auto-load-next-post-install.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
19
-if ( ! class_exists( 'Auto_Load_Next_Post_Install' ) ) {
19
+if ( ! class_exists('Auto_Load_Next_Post_Install')) {
20 20
 
21 21
 	class Auto_Load_Next_Post_Install {
22 22
 
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 		 * @access public
38 38
 		 */
39 39
 		public function __construct() {
40
-			add_action( 'init', array( __CLASS__, 'add_rewrite_endpoint' ), 0 );
41
-			add_action( 'init', array( __CLASS__, 'check_version' ), 5 );
40
+			add_action('init', array(__CLASS__, 'add_rewrite_endpoint'), 0);
41
+			add_action('init', array(__CLASS__, 'check_version'), 5);
42 42
 
43 43
 			// Get plugin version.
44
-			self::$current_version = get_option( 'auto_load_next_post_version', null );
44
+			self::$current_version = get_option('auto_load_next_post_version', null);
45 45
 		} // END __construct()
46 46
 
47 47
 		/**
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 		 * @since  1.4.10
55 55
 		 */
56 56
 		public static function check_version() {
57
-			if ( ! defined( 'IFRAME_REQUEST' ) && version_compare( self::$current_version, AUTO_LOAD_NEXT_POST_VERSION, '<' ) ) {
57
+			if ( ! defined('IFRAME_REQUEST') && version_compare(self::$current_version, AUTO_LOAD_NEXT_POST_VERSION, '<')) {
58 58
 				self::install();
59
-				do_action( 'auto_load_next_post_updated' );
59
+				do_action('auto_load_next_post_updated');
60 60
 			}
61 61
 		} // END check_version()
62 62
 
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 		 * @version 1.4.10
70 70
 		 */
71 71
 		public static function install() {
72
-			if ( ! is_blog_installed() ) {
72
+			if ( ! is_blog_installed()) {
73 73
 				return;
74 74
 			}
75 75
 
76 76
 			// Check if we are not already running this routine.
77
-			if ( 'yes' === get_transient( 'alnp_installing' ) ) {
77
+			if ('yes' === get_transient('alnp_installing')) {
78 78
 				return;
79 79
 			}
80 80
 
81 81
 			// If we made it till here nothing is running yet, lets set the transient now for five minutes.
82
-			set_transient( 'alnp_installing', 'yes', MINUTE_IN_SECONDS * 5 );
83
-			if ( ! defined( 'AUTO_LOAD_NEXT_POST_INSTALLING' ) ) {
84
-				define( 'AUTO_LOAD_NEXT_POST_INSTALLING', true );
82
+			set_transient('alnp_installing', 'yes', MINUTE_IN_SECONDS * 5);
83
+			if ( ! defined('AUTO_LOAD_NEXT_POST_INSTALLING')) {
84
+				define('AUTO_LOAD_NEXT_POST_INSTALLING', true);
85 85
 			}
86 86
 
87 87
 			// Add default options.
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 			// Set activation date.
94 94
 			self::set_install_date();
95 95
 
96
-			delete_transient( 'alnp_installing' );
96
+			delete_transient('alnp_installing');
97 97
 
98
-			do_action( 'alnp_installed' );
98
+			do_action('alnp_installed');
99 99
 		} // END install()
100 100
 
101 101
 		/**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		 * @static
106 106
 		 */
107 107
 		private static function update_version() {
108
-			update_option( 'auto_load_next_post_version', AUTO_LOAD_NEXT_POST_VERSION );
108
+			update_option('auto_load_next_post_version', AUTO_LOAD_NEXT_POST_VERSION);
109 109
 		} // END update_version()
110 110
 
111 111
 		/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		 * @version 1.4.10
118 118
 		 */
119 119
 		public static function set_install_date() {
120
-			add_site_option( 'auto_load_next_post_install_date', time() );
120
+			add_site_option('auto_load_next_post_install_date', time());
121 121
 		} // END set_install_date()
122 122
 
123 123
 		/**
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
 		 */
132 132
 		public static function create_options() {
133 133
 			// Include settings so that we can run through defaults
134
-			include_once( dirname( __FILE__ ) . '/admin/class-auto-load-next-post-admin-settings.php' );
134
+			include_once(dirname(__FILE__).'/admin/class-auto-load-next-post-admin-settings.php');
135 135
 
136 136
 			$settings = Auto_Load_Next_Post_Admin_Settings::get_settings_pages();
137 137
 
138
-			foreach ( $settings as $section ) {
139
-				foreach ( $section->get_settings() as $value ) {
140
-					if ( isset( $value['default'] ) && isset( $value['id'] ) ) {
141
-						$autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true;
142
-						add_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) );
138
+			foreach ($settings as $section) {
139
+				foreach ($section->get_settings() as $value) {
140
+					if (isset($value['default']) && isset($value['id'])) {
141
+						$autoload = isset($value['autoload']) ? (bool) $value['autoload'] : true;
142
+						add_option($value['id'], $value['default'], '', ($autoload ? 'yes' : 'no'));
143 143
 					}
144 144
 				}
145 145
 			}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		 * @since  1.0.0
153 153
 		 */
154 154
 		public static function add_rewrite_endpoint() {
155
-			add_rewrite_endpoint( 'partial', EP_PERMALINK );
155
+			add_rewrite_endpoint('partial', EP_PERMALINK);
156 156
 
157 157
 			// Refresh permalinks
158 158
 			flush_rewrite_rules();
Please login to merge, or discard this patch.
includes/auto-load-next-post-formatting-functions.php 1 patch
Spacing   +32 added lines, -32 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
 
@@ -33,58 +33,58 @@  discard block
 block discarded – undo
33 33
  *
34 34
  * @param string $seconds Seconds in time.
35 35
  */
36
-function auto_load_next_post_seconds_to_words( $seconds ) {
36
+function auto_load_next_post_seconds_to_words($seconds) {
37 37
 	// Get the years.
38
-	$years = ( intval( $seconds ) / YEAR_IN_SECONDS ) % 100;
39
-	if ( $years > 1 ) {
38
+	$years = (intval($seconds) / YEAR_IN_SECONDS) % 100;
39
+	if ($years > 1) {
40 40
 		/* translators: Number of years */
41
-		return sprintf( __( '%s years', 'auto-load-next-post' ), $years );
42
-	} elseif ( $years > 0 ) {
43
-		return __( 'a year', 'auto-load-next-post' );
41
+		return sprintf(__('%s years', 'auto-load-next-post'), $years);
42
+	} elseif ($years > 0) {
43
+		return __('a year', 'auto-load-next-post');
44 44
 	}
45 45
 
46 46
 	// Get the weeks.
47
-	$weeks = ( intval( $seconds ) / WEEK_IN_SECONDS ) % 52;
48
-	if ( $weeks > 1 ) {
47
+	$weeks = (intval($seconds) / WEEK_IN_SECONDS) % 52;
48
+	if ($weeks > 1) {
49 49
 		/* translators: Number of weeks */
50
-		return sprintf( __( '%s weeks', 'auto-load-next-post' ), $weeks );
51
-	} elseif ( $weeks > 0 ) {
52
-		return __( 'a week', 'auto-load-next-post' );
50
+		return sprintf(__('%s weeks', 'auto-load-next-post'), $weeks);
51
+	} elseif ($weeks > 0) {
52
+		return __('a week', 'auto-load-next-post');
53 53
 	}
54 54
 
55 55
 	// Get the days.
56
-	$days = ( intval( $seconds ) / DAY_IN_SECONDS ) % 7;
57
-	if ( $days > 1 ) {
56
+	$days = (intval($seconds) / DAY_IN_SECONDS) % 7;
57
+	if ($days > 1) {
58 58
 		/* translators: Number of days */
59
-		return sprintf( __( '%s days', 'auto-load-next-post' ), $days );
60
-	} elseif ( $days > 0 ) {
61
-		return __( 'a day', 'auto-load-next-post' );
59
+		return sprintf(__('%s days', 'auto-load-next-post'), $days);
60
+	} elseif ($days > 0) {
61
+		return __('a day', 'auto-load-next-post');
62 62
 	}
63 63
 
64 64
 	// Get the hours.
65
-	$hours = ( intval( $seconds ) / HOUR_IN_SECONDS ) % 24;
66
-	if ( $hours > 1 ) {
65
+	$hours = (intval($seconds) / HOUR_IN_SECONDS) % 24;
66
+	if ($hours > 1) {
67 67
 		/* translators: Number of hours */
68
-		return sprintf( __( '%s hours', 'auto-load-next-post' ), $hours );
69
-	} elseif ( $hours > 0 ) {
70
-		return __( 'an hour', 'auto-load-next-post' );
68
+		return sprintf(__('%s hours', 'auto-load-next-post'), $hours);
69
+	} elseif ($hours > 0) {
70
+		return __('an hour', 'auto-load-next-post');
71 71
 	}
72 72
 
73 73
 	// Get the minutes.
74
-	$minutes = ( intval( $seconds ) / MINUTE_IN_SECONDS ) % 60;
75
-	if ( $minutes > 1 ) {
74
+	$minutes = (intval($seconds) / MINUTE_IN_SECONDS) % 60;
75
+	if ($minutes > 1) {
76 76
 		/* translators: Number of minutes */
77
-		return sprintf( __( '%s minutes', 'auto-load-next-post' ), $minutes );
78
-	} elseif ( $minutes > 0 ) {
79
-		return __( 'a minute', 'auto-load-next-post' );
77
+		return sprintf(__('%s minutes', 'auto-load-next-post'), $minutes);
78
+	} elseif ($minutes > 0) {
79
+		return __('a minute', 'auto-load-next-post');
80 80
 	}
81 81
 
82 82
 	// Get the seconds.
83
-	$seconds = intval( $seconds ) % 60;
84
-	if ( $seconds > 1 ) {
83
+	$seconds = intval($seconds) % 60;
84
+	if ($seconds > 1) {
85 85
 		/* translators: Number of seconds */
86
-		return sprintf( __( '%s seconds', 'auto-load-next-post' ), $seconds );
87
-	} elseif ( $seconds > 0 ) {
88
-		return __( 'a second', 'auto-load-next-post' );
86
+		return sprintf(__('%s seconds', 'auto-load-next-post'), $seconds);
87
+	} elseif ($seconds > 0) {
88
+		return __('a second', 'auto-load-next-post');
89 89
 	}
90 90
 }
Please login to merge, or discard this patch.
template/content-partial.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,71 +16,71 @@
 block discarded – undo
16 16
  * @version 1.4.10
17 17
 */
18 18
 
19
-$template_location = apply_filters( 'alnp_template_location', '' ); // e.g. "template-parts/post/"
19
+$template_location = apply_filters('alnp_template_location', ''); // e.g. "template-parts/post/"
20 20
 
21
-if ( have_posts() ) :
21
+if (have_posts()) :
22 22
 
23 23
 	// Load content before the loop.
24
-	do_action( 'alnp_load_before_loop' );
24
+	do_action('alnp_load_before_loop');
25 25
 
26 26
 	// Check that there are posts to load.
27
-	while ( have_posts() ) : the_post();
27
+	while (have_posts()) : the_post();
28 28
 
29 29
 		$post_format = get_post_format(); // Post Format e.g. video
30 30
 
31 31
 		$post_type = get_post_type(); // Post Type e.g. post
32 32
 
33 33
 		// Load content before the post content.
34
-		do_action( 'alnp_load_before_content' );
34
+		do_action('alnp_load_before_content');
35 35
 
36 36
 		// Load content before the post content for a specific post format.
37
-		do_action( 'alnp_load_before_content_post_format_' . $post_format );
37
+		do_action('alnp_load_before_content_post_format_'.$post_format);
38 38
 
39 39
 		// Load content before the post content for a specific post type.
40
-		do_action( 'alnp_load_before_content_post_type_' . $post_type );
40
+		do_action('alnp_load_before_content_post_type_'.$post_type);
41 41
 
42
-		if ( false === $post_format ) {
42
+		if (false === $post_format) {
43 43
 			/*
44 44
 			 * Include the Post-Type-specific template for the content.
45 45
 			 * content-___.php (where ___ is the Post Type name).
46 46
 			 */
47
-			if ( locate_template( $template_location . 'content-' . $post_type . '.php') != '' ) {
48
-				get_template_part( $template_location . 'content', $post_type );
47
+			if (locate_template($template_location.'content-'.$post_type.'.php') != '') {
48
+				get_template_part($template_location.'content', $post_type);
49 49
 			} else {
50 50
 				// If no specific post type found then fallback to standard content.php file.
51
-				get_template_part( $template_location . 'content' );
51
+				get_template_part($template_location.'content');
52 52
 			}
53 53
 		} else {
54 54
 			/*
55 55
 			 * Include the Post-Format-specific template for the content.
56 56
 			 * called format-___.php (where ___ is the Post Format name).
57 57
 			 */
58
-			if ( locate_template( $template_location . 'format-' . $post_format . '.php' ) != '' ) {
59
-				get_template_part( $template_location . 'format', $post_format );
58
+			if (locate_template($template_location.'format-'.$post_format.'.php') != '') {
59
+				get_template_part($template_location.'format', $post_format);
60 60
 			} else {
61 61
 				// If no format-{post-format}.php file found then fallback to content-{post-format}.php
62
-				get_template_part( $template_location . 'content', $post_format );
62
+				get_template_part($template_location.'content', $post_format);
63 63
 			}
64 64
 		}
65 65
 
66 66
 		// Load content after the post content for a specific post type.
67
-		do_action( 'alnp_load_after_content_post_type_' . $post_type );
67
+		do_action('alnp_load_after_content_post_type_'.$post_type);
68 68
 
69 69
 		// Load content after the post content for a specific post format.
70
-		do_action( 'alnp_load_after_content_post_format_' . $post_format );
70
+		do_action('alnp_load_after_content_post_format_'.$post_format);
71 71
 
72 72
 		// Load content after the post content.
73
-		do_action( 'alnp_load_after_content' );
73
+		do_action('alnp_load_after_content');
74 74
 
75 75
 	// End the loop.
76 76
 	endwhile;
77 77
 
78 78
 		// Load content after the loop.
79
-		do_action( 'alnp_load_after_loop' );
79
+		do_action('alnp_load_after_loop');
80 80
 
81 81
 else :
82 82
 
83 83
 	// Load content if there are no more posts.
84
-	do_action( 'alnp_no_more_posts' );
84
+	do_action('alnp_no_more_posts');
85 85
 
86 86
 endif; // END if have_posts()
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,9 +78,11 @@
 block discarded – undo
78 78
 		// Load content after the loop.
79 79
 		do_action( 'alnp_load_after_loop' );
80 80
 
81
-else :
81
+else {
82
+	:
82 83
 
83 84
 	// Load content if there are no more posts.
84 85
 	do_action( 'alnp_no_more_posts' );
86
+}
85 87
 
86 88
 endif; // END if have_posts()
Please login to merge, or discard this patch.
includes/auto-load-next-post-conditional-functions.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
20
-if ( ! function_exists( 'auto_load_next_post_is_ajax' ) ) {
20
+if ( ! function_exists('auto_load_next_post_is_ajax')) {
21 21
 	/**
22 22
 	 * Returns true when the page is loaded via ajax.
23 23
 	 *
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 	 * @return bool
27 27
 	 */
28 28
 	function auto_load_next_post_is_ajax() {
29
-		if ( defined( 'DOING_AJAX' ) ) {
29
+		if (defined('DOING_AJAX')) {
30 30
 			return true;
31 31
 		}
32 32
 
33
-		return( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) ? true : false;
33
+		return(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false;
34 34
 	} // END auto_load_next_post_is_ajax
35 35
 }
36 36
 
37
-if ( ! function_exists( 'supports_alnp' ) ) {
37
+if ( ! function_exists('supports_alnp')) {
38 38
 	/**
39 39
 	 * Returns true or false if Auto Load Next Post supports the theme.
40 40
 	 *
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 			'storefront'
54 54
 		);
55 55
 
56
-		$supported_themes = array_merge( $core_themes, $other_themes );
56
+		$supported_themes = array_merge($core_themes, $other_themes);
57 57
 
58
-		if ( in_array( get_option('template'), $supported_themes ) ) {
58
+		if (in_array(get_option('template'), $supported_themes)) {
59 59
 			return true;
60
-		} else if ( current_theme_supports( 'auto-load-next-post' ) ) {
60
+		} else if (current_theme_supports('auto-load-next-post')) {
61 61
 			return true;
62 62
 		}
63 63
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	} // END supports_alnp()
66 66
 }
67 67
 
68
-if ( ! function_exists( 'alnp_template_location' ) ) {
68
+if ( ! function_exists('alnp_template_location')) {
69 69
 	/**
70 70
 	 * Filters the template location for get_template_part().
71 71
 	 *
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	function alnp_template_location() {
78 78
 		$current_theme = get_option('template');
79 79
 
80
-		switch( $current_theme ) {
80
+		switch ($current_theme) {
81 81
 			case 'twentyseventeen':
82 82
 				$path = 'template-parts/post/';
83 83
 				break;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	add_filter('alnp_template_location', 'alnp_template_location');
98 98
 }
99 99
 
100
-if ( ! function_exists( 'is_alnp_pro_version_installed' ) ) {
100
+if ( ! function_exists('is_alnp_pro_version_installed')) {
101 101
 	/**
102 102
 	 * Detects if Auto Load Next Post Pro is installed.
103 103
 	 *
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
 	 * @return boolen
107 107
 	 */
108 108
 	function is_alnp_pro_version_installed() {
109
-		$active_plugins = (array) get_option( 'active_plugins', array() );
109
+		$active_plugins = (array) get_option('active_plugins', array());
110 110
 
111
-		if ( is_multisite() ) {
112
-			$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
111
+		if (is_multisite()) {
112
+			$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
113 113
 		}
114 114
 
115
-		return in_array( 'auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins ) || array_key_exists( 'auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins );
115
+		return in_array('auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins) || array_key_exists('auto-load-next-post-pro/auto-load-next-post-pro.php', $active_plugins);
116 116
 	}
117 117
 }
Please login to merge, or discard this patch.