Completed
Branch master (bf7767)
by
unknown
02:38
created
includes/admin/views/html-notice-requirement-wp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 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-error">
19
-	<p><?php echo sprintf( __( 'Sorry, <strong>%s</strong> requires WordPress %s or higher. Please upgrade your WordPress setup.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE ); ?></p>
19
+	<p><?php echo sprintf(__('Sorry, <strong>%s</strong> requires WordPress %s or higher. Please upgrade your WordPress setup.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE); ?></p>
20 20
 </div>
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-theme-selectors.php 1 patch
Spacing   +28 added lines, -28 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_Settings_Theme_Selectors_Tab' ) ) {
18
+if ( ! class_exists('Auto_Load_Next_Post_Settings_Theme_Selectors_Tab')) {
19 19
 
20 20
 	class Auto_Load_Next_Post_Settings_Theme_Selectors_Tab extends Auto_Load_Next_Post_Settings_Page {
21 21
 
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 		 */
29 29
 		public function __construct() {
30 30
 			$this->id    = 'theme-selectors';
31
-			$this->label = esc_html__( 'Theme Selectors', 'auto-load-next-post' );
31
+			$this->label = esc_html__('Theme Selectors', 'auto-load-next-post');
32 32
 
33 33
 			parent::__construct();
34 34
 
35
-			add_action( 'auto_load_next_post_sections_theme-selectors', array( __CLASS__, 'is_theme_supported' ), 10 );
36
-			add_action( 'auto_load_next_post_sections_theme-selectors', array( __CLASS__, 'no_theme_selectors_set' ), 10 );
35
+			add_action('auto_load_next_post_sections_theme-selectors', array(__CLASS__, 'is_theme_supported'), 10);
36
+			add_action('auto_load_next_post_sections_theme-selectors', array(__CLASS__, 'no_theme_selectors_set'), 10);
37 37
 		} // END __construct()
38 38
 
39 39
 		/**
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 		 * @since  1.5.0
45 45
 		 */
46 46
 		public static function is_theme_supported() {
47
-			if ( is_alnp_supported() ) {
48
-				include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-is-supported.php' );
47
+			if (is_alnp_supported()) {
48
+				include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-is-supported.php');
49 49
 			}
50 50
 		} // END is_theme_supported()
51 51
 
@@ -59,24 +59,24 @@  discard block
 block discarded – undo
59 59
 		public static function no_theme_selectors_set() {
60 60
 			$set_selectors = array();
61 61
 
62
-			$content_container    = get_option( 'auto_load_next_post_content_container' );
63
-			$title_selector       = get_option( 'auto_load_next_post_title_selector' );
64
-			$navigation_container = get_option( 'auto_load_next_post_navigation_container' );
62
+			$content_container    = get_option('auto_load_next_post_content_container');
63
+			$title_selector       = get_option('auto_load_next_post_title_selector');
64
+			$navigation_container = get_option('auto_load_next_post_navigation_container');
65 65
 
66
-			if ( ! empty( $content_container ) ) {
66
+			if ( ! empty($content_container)) {
67 67
 				$set_selectors[] = $content_container;
68 68
 			}
69 69
 
70
-			if ( ! empty( $title_selector ) ) {
70
+			if ( ! empty($title_selector)) {
71 71
 				$set_selectors[] = $title_selector;
72 72
 			}
73 73
 
74
-			if ( ! empty( $navigation_container ) ) {
74
+			if ( ! empty($navigation_container)) {
75 75
 				$set_selectors[] = $navigation_container;
76 76
 			}
77 77
 
78
-			if ( empty( $set_selectors ) || is_array( $set_selectors ) && count( $set_selectors ) < 3 ) {
79
-				include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-no-theme-selectors.php' );
78
+			if (empty($set_selectors) || is_array($set_selectors) && count($set_selectors) < 3) {
79
+				include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-no-theme-selectors.php');
80 80
 			}
81 81
 		} // END no_theme_selectors_set()
82 82
 
@@ -95,26 +95,26 @@  discard block
 block discarded – undo
95 95
 				'auto_load_next_post_theme_selectors_settings', array(
96 96
 
97 97
 					array(
98
-						'title' => esc_html__( 'Theme Selectors', 'auto-load-next-post' ),
98
+						'title' => esc_html__('Theme Selectors', 'auto-load-next-post'),
99 99
 						'type'  => 'title',
100
-						'desc'  => sprintf( esc_html__( 'Here you set the theme selectors below according to your active theme. All are required for %s to work.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ),
100
+						'desc'  => sprintf(esc_html__('Here you set the theme selectors below according to your active theme. All are required for %s to work.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')),
101 101
 						'id'    => 'theme_selectors_options'
102 102
 					),
103 103
 
104 104
 					array(
105
-						'title'       => esc_html__( 'Content Container', 'auto-load-next-post' ),
106
-						'desc'        => sprintf( __( 'The primary container where the post content is loaded in. Default: %s', 'auto-load-next-post' ), '<code>main.site-main</code>' ),
105
+						'title'       => esc_html__('Content Container', 'auto-load-next-post'),
106
+						'desc'        => sprintf(__('The primary container where the post content is loaded in. Default: %s', 'auto-load-next-post'), '<code>main.site-main</code>'),
107 107
 						'id'          => 'auto_load_next_post_content_container',
108 108
 						'default'     => 'main.site-main',
109
-						'placeholder' => esc_html__( 'Required', 'auto-load-next-post' ),
109
+						'placeholder' => esc_html__('Required', 'auto-load-next-post'),
110 110
 						'type'        => 'text',
111 111
 						'css'         => 'min-width:300px;',
112 112
 						'autoload'    => false
113 113
 					),
114 114
 
115 115
 					array(
116
-						'title'    => esc_html__( 'Post Title', 'auto-load-next-post' ),
117
-						'desc'     => sprintf( __( 'Used to identify which article the user is reading and track should Google Analytics or other analytics be enabled. Default: %s', 'auto-load-next-post' ), '<code>h1.entry-title</code>' ),
116
+						'title'    => esc_html__('Post Title', 'auto-load-next-post'),
117
+						'desc'     => sprintf(__('Used to identify which article the user is reading and track should Google Analytics or other analytics be enabled. Default: %s', 'auto-load-next-post'), '<code>h1.entry-title</code>'),
118 118
 						'id'       => 'auto_load_next_post_title_selector',
119 119
 						'default'  => 'h1.entry-title',
120 120
 						'type'     => 'text',
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 					),
124 124
 
125 125
 					array(
126
-						'title'    => esc_html__( 'Post Navigation', 'auto-load-next-post' ),
127
-						'desc'     => sprintf( __( 'Used to identify which post to load next if any. Default: %s', 'auto-load-next-post' ), '<code>nav.post-navigation</code>' ),
126
+						'title'    => esc_html__('Post Navigation', 'auto-load-next-post'),
127
+						'desc'     => sprintf(__('Used to identify which post to load next if any. Default: %s', 'auto-load-next-post'), '<code>nav.post-navigation</code>'),
128 128
 						'id'       => 'auto_load_next_post_navigation_container',
129 129
 						'default'  => 'nav.post-navigation',
130 130
 						'type'     => 'text',
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 					),
134 134
 
135 135
 					array(
136
-						'title'    => esc_html__( 'Comments Container', 'auto-load-next-post' ),
137
-						'desc'     => sprintf( __( 'Used to remove comments if enabled under %1$sMisc%2$s settings. Default: %3$s', 'auto-load-next-post' ), '<strong><a href="' . get_admin_url( $blog_id, 'options-general.php?page=auto-load-next-post-settings&tab=misc' ) . '">', '</a></strong>', '<code>div#comments</code>' ),
136
+						'title'    => esc_html__('Comments Container', 'auto-load-next-post'),
137
+						'desc'     => sprintf(__('Used to remove comments if enabled under %1$sMisc%2$s settings. Default: %3$s', 'auto-load-next-post'), '<strong><a href="'.get_admin_url($blog_id, 'options-general.php?page=auto-load-next-post-settings&tab=misc').'">', '</a></strong>', '<code>div#comments</code>'),
138 138
 						'id'       => 'auto_load_next_post_comments_container',
139 139
 						'default'  => 'div#comments',
140 140
 						'type'     => 'text',
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		public function output() {
159 159
 			$settings = $this->get_settings();
160 160
 
161
-			Auto_Load_Next_Post_Admin_Settings::output_fields( $settings );
161
+			Auto_Load_Next_Post_Admin_Settings::output_fields($settings);
162 162
 		} // END output()
163 163
 
164 164
 		/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		public function save() {
172 172
 			$settings = $this->get_settings();
173 173
 
174
-			Auto_Load_Next_Post_Admin_Settings::save_fields( $settings );
174
+			Auto_Load_Next_Post_Admin_Settings::save_fields($settings);
175 175
 		} // END save()
176 176
 
177 177
 	} // END class
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-events.php 1 patch
Spacing   +14 added lines, -14 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_Events_Tab' ) ) {
17
+if ( ! class_exists('Auto_Load_Next_Post_Settings_Events_Tab')) {
18 18
 
19 19
 	class Auto_Load_Next_Post_Settings_Events_Tab extends Auto_Load_Next_Post_Settings_Page {
20 20
 
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 		 */
26 26
 		public function __construct() {
27 27
 			$this->id    = 'events';
28
-			$this->label = esc_html__( 'Events', 'auto-load-next-post' );
28
+			$this->label = esc_html__('Events', 'auto-load-next-post');
29 29
 
30 30
 			parent::__construct();
31 31
 
32
-			add_action( 'auto_load_next_post_settings_' . $this->id, array( __CLASS__, 'is_jetpack_lazy_images_active' ), 10 );
32
+			add_action('auto_load_next_post_settings_'.$this->id, array(__CLASS__, 'is_jetpack_lazy_images_active'), 10);
33 33
 		} // END __construct()
34 34
 
35 35
 		/**
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 		 * @static
41 41
 		 */
42 42
 		public static function is_jetpack_lazy_images_active() {
43
-			if ( alnp_check_jetpack() == 'yes' ) {
44
-				if ( Jetpack::is_module_active( 'lazy-images' ) ) {
45
-					include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-jetpack-lazy-images-module.php' );
43
+			if (alnp_check_jetpack() == 'yes') {
44
+				if (Jetpack::is_module_active('lazy-images')) {
45
+					include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-jetpack-lazy-images-module.php');
46 46
 				}
47 47
 			}
48 48
 		} // END is_jetpack_lazy_images_active()
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 					array(
61 61
 						'title' => $this->label,
62 62
 						'type'  => 'title',
63
-						'desc'  => sprintf( __( 'Below you can enter external JavaScript events to be triggered alongside %1$s native events. Separate each event like so: %2$s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), '<code>event1, event2,</code>' ),
63
+						'desc'  => sprintf(__('Below you can enter external JavaScript events to be triggered alongside %1$s native events. Separate each event like so: %2$s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), '<code>event1, event2,</code>'),
64 64
 						'id'    => 'events_options'
65 65
 					),
66 66
 
67 67
 					array(
68
-						'title'    => esc_html__( 'Post loaded', 'auto-load-next-post' ),
69
-						'desc'     => __( 'Events listed here will be triggered after a new post has loaded.', 'auto-load-next-post' ),
68
+						'title'    => esc_html__('Post loaded', 'auto-load-next-post'),
69
+						'desc'     => __('Events listed here will be triggered after a new post has loaded.', 'auto-load-next-post'),
70 70
 						'id'       => 'auto_load_next_post_on_load_event',
71 71
 						'default'  => '',
72 72
 						'type'     => 'textarea',
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 					),
76 76
 
77 77
 					array(
78
-						'title'    => esc_html__( 'Entering a Post', 'auto-load-next-post' ),
79
-						'desc'     => esc_html__( 'Events listed here will be triggered when entering a post.', 'auto-load-next-post' ),
78
+						'title'    => esc_html__('Entering a Post', 'auto-load-next-post'),
79
+						'desc'     => esc_html__('Events listed here will be triggered when entering a post.', 'auto-load-next-post'),
80 80
 						'id'       => 'auto_load_next_post_on_entering_event',
81 81
 						'default'  => '',
82 82
 						'type'     => 'textarea',
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		public function output() {
100 100
 			$settings = $this->get_settings();
101 101
 
102
-			Auto_Load_Next_Post_Admin_Settings::output_fields( $settings );
102
+			Auto_Load_Next_Post_Admin_Settings::output_fields($settings);
103 103
 		} // END output()
104 104
 
105 105
 		/**
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		public function save() {
111 111
 			$settings = $this->get_settings();
112 112
 
113
-			Auto_Load_Next_Post_Admin_Settings::save_fields( $settings );
113
+			Auto_Load_Next_Post_Admin_Settings::save_fields($settings);
114 114
 		} // END save()
115 115
 
116 116
 	} // END class
Please login to merge, or discard this patch.
includes/admin/settings/class-alnp-settings-misc.php 1 patch
Spacing   +26 added lines, -26 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 = esc_html__( 'Misc', 'auto-load-next-post' );
31
+			$this->label = esc_html__('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
 
@@ -65,45 +65,45 @@  discard block
 block discarded – undo
65 65
 					array(
66 66
 						'title' => $this->label,
67 67
 						'type'  => 'title',
68
-						'desc'  => sprintf( esc_html__( '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(esc_html__('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'   => esc_html__( 'Remove Comments', 'auto-load-next-post' ),
74
-						'desc'    => esc_html__( 'Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post' ),
73
+						'title'   => esc_html__('Remove Comments', 'auto-load-next-post'),
74
+						'desc'    => esc_html__('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'   => esc_html__( 'Update Google Analytics', 'auto-load-next-post' ),
82
-						'desc'    => esc_html__( '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'   => esc_html__('Update Google Analytics', 'auto-load-next-post'),
82
+						'desc'    => esc_html__('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'   => esc_html__( 'JavaScript in Footer?', 'auto-load-next-post' ),
90
-						'desc'    => esc_html__( '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'   => esc_html__('JavaScript in Footer?', 'auto-load-next-post'),
90
+						'desc'    => esc_html__('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'   => esc_html__( 'Reset all data?', 'auto-load-next-post' ),
98
-						'desc'    => esc_html__( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ),
97
+						'title'   => esc_html__('Reset all data?', 'auto-load-next-post'),
98
+						'desc'    => esc_html__('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'   => esc_html__( 'Remove all data on uninstall?', 'auto-load-next-post' ),
106
-						'desc'    => esc_html__( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ),
105
+						'title'   => esc_html__('Remove all data on uninstall?', 'auto-load-next-post'),
106
+						'desc'    => esc_html__('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.
includes/auto-load-next-post-conditional-functions.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
  */
15 15
 
16 16
 // Exit if accessed directly.
17
-if ( ! defined( 'ABSPATH' ) ) {
17
+if ( ! defined('ABSPATH')) {
18 18
 	exit;
19 19
 }
20 20
 
21
-if ( ! function_exists( 'auto_load_next_post_is_ajax' ) ) {
21
+if ( ! function_exists('auto_load_next_post_is_ajax')) {
22 22
 	/**
23 23
 	 * Returns true when the page is loaded via ajax.
24 24
 	 *
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 	 * @return bool
28 28
 	 */
29 29
 	function auto_load_next_post_is_ajax() {
30
-		if ( defined( 'DOING_AJAX' ) ) {
30
+		if (defined('DOING_AJAX')) {
31 31
 			return true;
32 32
 		}
33 33
 
34
-		return( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) ? true : false;
34
+		return(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false;
35 35
 	} // END auto_load_next_post_is_ajax
36 36
 }
37 37
 
38
-if ( ! function_exists( 'alnp_template_location' ) ) {
38
+if ( ! function_exists('alnp_template_location')) {
39 39
 	/**
40 40
 	 * Filters the template location for get_template_part().
41 41
 	 *
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	function alnp_template_location() {
48 48
 		$current_theme = get_option('template');
49 49
 
50
-		switch( $current_theme ) {
50
+		switch ($current_theme) {
51 51
 			case 'twentyseventeen':
52 52
 				$path = 'template-parts/post/';
53 53
 				break;
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 				break;
62 62
 		}
63 63
 
64
-		return apply_filters( 'alnp_template_location', $path );
64
+		return apply_filters('alnp_template_location', $path);
65 65
 	} // END alnp_template_location()
66 66
 }
67 67
 
68
-if ( ! function_exists( 'is_alnp_pro_version_installed' ) ) {
68
+if ( ! function_exists('is_alnp_pro_version_installed')) {
69 69
 	/**
70 70
 	 * Detects if Auto Load Next Post Pro is installed.
71 71
 	 *
@@ -74,17 +74,17 @@  discard block
 block discarded – undo
74 74
 	 * @return boolean
75 75
 	 */
76 76
 	function is_alnp_pro_version_installed() {
77
-		$active_plugins = (array) get_option( 'active_plugins', array() );
77
+		$active_plugins = (array) get_option('active_plugins', array());
78 78
 
79
-		if ( is_multisite() ) {
80
-			$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
79
+		if (is_multisite()) {
80
+			$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
81 81
 		}
82 82
 
83
-		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 );
83
+		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);
84 84
 	}
85 85
 }
86 86
 
87
-if ( ! function_exists( 'is_alnp_beta' ) ) {
87
+if ( ! function_exists('is_alnp_beta')) {
88 88
 	/**
89 89
 	 * Returns true if Auto Load Next Post is a beta release.
90 90
 	 *
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 * @return boolean
93 93
 	 */
94 94
 	function is_alnp_beta() {
95
-		if ( strpos( AUTO_LOAD_NEXT_POST_VERSION, 'beta' ) ) {
95
+		if (strpos(AUTO_LOAD_NEXT_POST_VERSION, 'beta')) {
96 96
 			return true;
97 97
 		}
98 98
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	}
101 101
 }
102 102
 
103
-if ( ! function_exists( 'is_alnp_active_theme' ) ) {
103
+if ( ! function_exists('is_alnp_active_theme')) {
104 104
 	/**
105 105
 	 * See if theme/s is activate or not.
106 106
 	 *
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 	 * @param string|array $theme Theme name or array of theme names to check.
109 109
 	 * @return boolean
110 110
 	 */
111
-	function is_alnp_active_theme( $theme ) {
112
-		return is_array( $theme ) ? in_array( get_template(), $theme, true ) : get_template() === $theme;
111
+	function is_alnp_active_theme($theme) {
112
+		return is_array($theme) ? in_array(get_template(), $theme, true) : get_template() === $theme;
113 113
 	}
114 114
 }
115 115
 
116
-if ( ! function_exists( 'is_alnp_supported' ) ) {
116
+if ( ! function_exists('is_alnp_supported')) {
117 117
 	/**
118 118
 	 * Returns true if Auto Load Next Post is supported in the theme.
119 119
 	 *
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 	 * @return boolean
122 122
 	 */
123 123
 	function is_alnp_supported() {
124
-		$theme_support = current_theme_supports( 'auto-load-next-post' );
124
+		$theme_support = current_theme_supports('auto-load-next-post');
125 125
 
126
-		if ( ! $theme_support ) {
126
+		if ( ! $theme_support) {
127 127
 			return false;
128 128
 		}
129 129
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	}
132 132
 }
133 133
 
134
-if ( ! function_exists( 'alnp_get_theme_support' ) ) {
134
+if ( ! function_exists('alnp_get_theme_support')) {
135 135
 	/**
136 136
 	 * Return "theme support" values from the current theme, if set.
137 137
 	 *
@@ -140,25 +140,25 @@  discard block
 block discarded – undo
140 140
 	 * @param  mixed  $default Optional value to return if the theme does not declare support for a prop.
141 141
 	 * @return mixed  Value of prop(s).
142 142
 	 */
143
-	function alnp_get_theme_support( $prop = '', $default = null ) {
144
-		$theme_support = get_theme_support( 'auto-load-next-post' );
145
-		$theme_support = is_array( $theme_support ) ? $theme_support[0] : false;
143
+	function alnp_get_theme_support($prop = '', $default = null) {
144
+		$theme_support = get_theme_support('auto-load-next-post');
145
+		$theme_support = is_array($theme_support) ? $theme_support[0] : false;
146 146
 
147
-		if ( ! $theme_support ) {
147
+		if ( ! $theme_support) {
148 148
 			return $default;
149 149
 		}
150 150
 
151
-		if ( ! empty( $prop ) ) {
152
-			$prop_stack = explode( '::', $prop );
153
-			$prop_key   = array_shift( $prop_stack );
151
+		if ( ! empty($prop)) {
152
+			$prop_stack = explode('::', $prop);
153
+			$prop_key   = array_shift($prop_stack);
154 154
 
155
-			if ( isset( $theme_support[ $prop_key ] ) ) {
156
-				$value = $theme_support[ $prop_key ];
155
+			if (isset($theme_support[$prop_key])) {
156
+				$value = $theme_support[$prop_key];
157 157
 
158
-				if ( count( $prop_stack ) ) {
159
-					foreach ( $prop_stack as $prop_key ) {
160
-						if ( is_array( $value ) && isset( $value[ $prop_key ] ) ) {
161
-							$value = $value[ $prop_key ];
158
+				if (count($prop_stack)) {
159
+					foreach ($prop_stack as $prop_key) {
160
+						if (is_array($value) && isset($value[$prop_key])) {
161
+							$value = $value[$prop_key];
162 162
 						} else {
163 163
 							$value = $default;
164 164
 							break;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	}
177 177
 }
178 178
 
179
-if ( ! function_exists( 'alnp_is_bot' ) ) {
179
+if ( ! function_exists('alnp_is_bot')) {
180 180
 	/**
181 181
 	 * Was the current request made by a known bot?
182 182
 	 *
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
 	 * @return boolean
185 185
 	 */
186 186
 	function alnp_is_bot() {
187
-		$is_bot = alnp_is_bot_user_agent( $_SERVER['HTTP_USER_AGENT'] );
187
+		$is_bot = alnp_is_bot_user_agent($_SERVER['HTTP_USER_AGENT']);
188 188
 
189 189
 		return $is_bot;
190 190
 	}
191 191
 }
192 192
 
193
-if ( ! function_exists( 'alnp_is_bot_user_agent' ) ) {
193
+if ( ! function_exists('alnp_is_bot_user_agent')) {
194 194
 	/**
195 195
 	 * Is the given user-agent a known bot?
196 196
 	 *
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
 	 * @param  string A user-agent string
199 199
 	 * @return boolean
200 200
 	 */
201
-	function alnp_is_bot_user_agent( $ua = null ) {
202
-		if ( empty( $ua ) ) {
201
+	function alnp_is_bot_user_agent($ua = null) {
202
+		if (empty($ua)) {
203 203
 			return false;
204 204
 		}
205 205
 
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
 			'livelapbot', 'germcrawler', 'domaintunocrawler', 'grapeshotcrawler', 'cloudflare-alwaysonline',
214 214
 		);
215 215
 
216
-		foreach ( $bot_agents as $bot_agent ) {
217
-			if ( false !== stripos( $ua, $bot_agent ) ) {
216
+		foreach ($bot_agents as $bot_agent) {
217
+			if (false !== stripos($ua, $bot_agent)) {
218 218
 				return true;
219 219
 			}
220 220
 		}
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	}
224 224
 }
225 225
 
226
-if ( ! function_exists( 'alnp_get_post_type' ) ) {
226
+if ( ! function_exists('alnp_get_post_type')) {
227 227
 	/**
228 228
 	 * Returns the post type.
229 229
 	 *
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$post_type = get_post_type();
236 236
 
237 237
 		// If the post type is a post then return single instead.
238
-		if ( $post_type == 'post' ) {
238
+		if ($post_type == 'post') {
239 239
 			return 'single';
240 240
 		}
241 241
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	}
244 244
 }
245 245
 
246
-if ( ! function_exists( 'alnp_check_jetpack' ) ) {
246
+if ( ! function_exists('alnp_check_jetpack')) {
247 247
 	/**
248 248
 	 * Check if Jetpack is installed.
249 249
 	 *
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	 * @return string
253 253
 	 */
254 254
 	function alnp_check_jetpack() {
255
-		$jetpack_active = class_exists( 'Jetpack' );
255
+		$jetpack_active = class_exists('Jetpack');
256 256
 
257 257
 		$is_active = $jetpack_active ? 'yes' : 'no';
258 258
 
Please login to merge, or discard this patch.
includes/customizer/class-alnp-pro-preview-controller.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@  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 19
 // Exit if WP_Customize_Control does not exsist.
20
-if ( ! class_exists( 'WP_Customize_Control' ) ) {
20
+if ( ! class_exists('WP_Customize_Control')) {
21 21
 	return null;
22 22
 }
23 23
 
24
-if ( !class_exists( 'Auto_Load_Next_Post_Pro_Preview_Controller' ) ) {
24
+if ( ! class_exists('Auto_Load_Next_Post_Pro_Preview_Controller')) {
25 25
 
26 26
 	/**
27 27
 	 * The 'alnp_pro_preview' for Auto Load Next Post Pro control class.
@@ -45,39 +45,39 @@  discard block
 block discarded – undo
45 45
 			<span class="customize-control-title"><?php echo $this->label; ?></span>
46 46
 
47 47
 			<p>
48
-				<?php printf( esc_html__( '%1$s is coming soon and will come with more powerful features. Here are just a few of them you can look forward to.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post Pro', 'auto-load-next-post' ) ); ?>
48
+				<?php printf(esc_html__('%1$s is coming soon and will come with more powerful features. Here are just a few of them you can look forward to.', 'auto-load-next-post'), esc_html__('Auto Load Next Post Pro', 'auto-load-next-post')); ?>
49 49
 			</p>
50 50
 
51 51
 			<ul style="list-style: disc; margin-left: 1em;">
52
-				<li><?php echo wptexturize( esc_html__( 'Load the Next Post or Next Post with same Category or New Posts or Related Posts or by Custom Query', 'auto-load-next-post' ) ); ?></li>
53
-				<li><?php echo wptexturize( esc_html__( 'Page and Media Attachment Support', 'auto-load-next-post' ) ); ?></li>
54
-				<li><?php echo wptexturize( esc_html__( 'Custom Post Type Support', 'auto-load-next-post' ) ); ?></li>
55
-				<li><?php echo wptexturize( esc_html__( 'Paginated Posts Supported', 'auto-load-next-post' ) ); ?></li>
56
-				<li><?php echo wptexturize( esc_html__( 'Exclude Post Formats', 'auto-load-next-post' ) ); ?></li>
57
-				<li><?php echo wptexturize( esc_html__( 'Limit Posts per Session', 'auto-load-next-post' ) ); ?></li>
58
-				<li><?php echo wptexturize( esc_html__( 'Query Posts by Category and Tag', 'auto-load-next-post' ) ); ?></li>
59
-				<li><?php echo wptexturize( esc_html__( 'Exclude User Roles and Specific Users', 'auto-load-next-post' ) ); ?></li>
60
-				<li><?php echo wptexturize( esc_html__( 'Pre-Query Posts Ready to Load', 'auto-load-next-post' ) ); ?></li>
61
-				<li><?php echo wptexturize( esc_html__( 'Hide Comments and Show by Toggle Button', 'auto-load-next-post' ) ); ?></li>
62
-				<li><?php echo wptexturize( sprintf( esc_html__( 'Multilingual Support for %1$s and %2$s', 'auto-load-next-post' ), 'WPML', 'Polylang' ) ); ?></li>
63
-				<li><?php echo wptexturize( esc_html__( 'Email Support', 'auto-load-next-post' ) ); ?></li>
52
+				<li><?php echo wptexturize(esc_html__('Load the Next Post or Next Post with same Category or New Posts or Related Posts or by Custom Query', 'auto-load-next-post')); ?></li>
53
+				<li><?php echo wptexturize(esc_html__('Page and Media Attachment Support', 'auto-load-next-post')); ?></li>
54
+				<li><?php echo wptexturize(esc_html__('Custom Post Type Support', 'auto-load-next-post')); ?></li>
55
+				<li><?php echo wptexturize(esc_html__('Paginated Posts Supported', 'auto-load-next-post')); ?></li>
56
+				<li><?php echo wptexturize(esc_html__('Exclude Post Formats', 'auto-load-next-post')); ?></li>
57
+				<li><?php echo wptexturize(esc_html__('Limit Posts per Session', 'auto-load-next-post')); ?></li>
58
+				<li><?php echo wptexturize(esc_html__('Query Posts by Category and Tag', 'auto-load-next-post')); ?></li>
59
+				<li><?php echo wptexturize(esc_html__('Exclude User Roles and Specific Users', 'auto-load-next-post')); ?></li>
60
+				<li><?php echo wptexturize(esc_html__('Pre-Query Posts Ready to Load', 'auto-load-next-post')); ?></li>
61
+				<li><?php echo wptexturize(esc_html__('Hide Comments and Show by Toggle Button', 'auto-load-next-post')); ?></li>
62
+				<li><?php echo wptexturize(sprintf(esc_html__('Multilingual Support for %1$s and %2$s', 'auto-load-next-post'), 'WPML', 'Polylang')); ?></li>
63
+				<li><?php echo wptexturize(esc_html__('Email Support', 'auto-load-next-post')); ?></li>
64 64
 			</ul>
65 65
 
66 66
 			<p>
67
-				<?php printf( esc_html__( 'Find out more about %1$s%2$s%3$s.', 'auto-load-next-post'), '<a target="_blank" href="' . esc_url( 'https://autoloadnextpost.com/pro/?utm_source=wpcustomizer&utm_campaign=plugin-settings-pro-preview' ) . '">', esc_html__( 'Auto Load Next Post Pro', 'auto-load-next-post' ), '</a>' ); ?>
67
+				<?php printf(esc_html__('Find out more about %1$s%2$s%3$s.', 'auto-load-next-post'), '<a target="_blank" href="'.esc_url('https://autoloadnextpost.com/pro/?utm_source=wpcustomizer&utm_campaign=plugin-settings-pro-preview').'">', esc_html__('Auto Load Next Post Pro', 'auto-load-next-post'), '</a>'); ?>
68 68
 			</p>
69 69
 
70
-			<span class="customize-control-title"><?php printf( esc_html__( 'Add-ons for %s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></span>
70
+			<span class="customize-control-title"><?php printf(esc_html__('Add-ons for %s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></span>
71 71
 
72 72
 			<p>
73
-				<?php printf( esc_html__( 'Add-ons available provide additional support or options for %1$s. %2$sCheck out the add-ons%3$s to see what is available.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), '<a target="_blank" href="' . esc_url( 'https://autoloadnextpost.com/add-ons/?utm_source=wpcustomizer&utm_campaign=plugin-settings-pro-preview' ) . '">', '</a>' ); ?>
73
+				<?php printf(esc_html__('Add-ons available provide additional support or options for %1$s. %2$sCheck out the add-ons%3$s to see what is available.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), '<a target="_blank" href="'.esc_url('https://autoloadnextpost.com/add-ons/?utm_source=wpcustomizer&utm_campaign=plugin-settings-pro-preview').'">', '</a>'); ?>
74 74
 			</p>
75 75
 
76
-			<span class="customize-control-title"><?php printf( esc_html__( 'Enjoying %s?', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?></span>
76
+			<span class="customize-control-title"><?php printf(esc_html__('Enjoying %s?', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?></span>
77 77
 
78 78
 			<div class="notice inline notice-info">
79 79
 				<p>
80
-					<?php printf( esc_html__( 'Why not leave me a review on %1$sWordPress.org%2$s?  I\'d really appreciate it!', 'auto-load-next-post' ), '<a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform">', '</a>' ); ?>
80
+					<?php printf(esc_html__('Why not leave me a review on %1$sWordPress.org%2$s?  I\'d really appreciate it!', 'auto-load-next-post'), '<a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform">', '</a>'); ?>
81 81
 				</p>
82 82
 			</div>
83 83
 			<?php
Please login to merge, or discard this patch.
includes/customizer/class-alnp-customizer.php 1 patch
Spacing   +92 added lines, -92 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_Customizer' ) ) {
17
+if ( ! class_exists('Auto_Load_Next_Post_Customizer')) {
18 18
 
19 19
 	class Auto_Load_Next_Post_Customizer {
20 20
 
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 		 * @access public
26 26
 		 */
27 27
 		public function __construct() {
28
-			add_action( 'customize_register', array( $this, 'alnp_init_customizer' ), 50 );
29
-			add_filter( 'customize_loaded_components', array( $this, 'alnp_remove_widgets_panel' ) );
28
+			add_action('customize_register', array($this, 'alnp_init_customizer'), 50);
29
+			add_filter('customize_loaded_components', array($this, 'alnp_remove_widgets_panel'));
30 30
 		}
31 31
 
32 32
 		/**
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
 		 * @since  1.5.0
37 37
 		 * @param  WP_Customize_Manager $wp_customize The Customizer object.
38 38
 		 */
39
-		public function alnp_init_customizer( $wp_customize ) {
39
+		public function alnp_init_customizer($wp_customize) {
40 40
 			/**
41 41
 			 * Dont add settings to the customizer if the user does
42 42
 			 * not have permission to make changes to the theme.
43 43
 			 */
44
-			if ( ! current_user_can( 'edit_theme_options' ) ) {
44
+			if ( ! current_user_can('edit_theme_options')) {
45 45
 				return;
46 46
 			}
47 47
 
48 48
 			// Auto Load Next Post Panel.
49
-			$panel = array( 'panel' => 'alnp' );
49
+			$panel = array('panel' => 'alnp');
50 50
 
51 51
 			/**
52 52
 			 * Add the main panel and sections.
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 			 */
56 56
 			$wp_customize->add_panel(
57 57
 				'alnp', array(
58
-					'title'           => esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ),
58
+					'title'           => esc_html__('Auto Load Next Post', 'auto-load-next-post'),
59 59
 					'capability'      => 'edit_theme_options',
60
-					'description'     => esc_html__( 'Auto Load Next Post increases your pageviews by engaging the site viewers to keep reading your content rather than increasing your bounce rate.', 'auto-load-next-post' ),
60
+					'description'     => esc_html__('Auto Load Next Post increases your pageviews by engaging the site viewers to keep reading your content rather than increasing your bounce rate.', 'auto-load-next-post'),
61 61
 					'priority'        => 160,
62
-					'active_callback' => array( $this, 'is_page_alnp_ready' )
62
+					'active_callback' => array($this, 'is_page_alnp_ready')
63 63
 				)
64 64
 			);
65 65
 
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
 			$sections = $this->alnp_get_customizer_sections();
68 68
 
69 69
 			// Add each section.
70
-			foreach ( $sections as $section => $args ) {
70
+			foreach ($sections as $section => $args) {
71 71
 				/**
72 72
 				 * If we are not only viewing Auto Load Next Post customizer sections
73 73
 				 * then move them under our own panel.
74 74
 				 */
75
-				if ( ! $this->alnp_is_customizer() ) {
76
-					$args = array_merge( $args, $panel );
75
+				if ( ! $this->alnp_is_customizer()) {
76
+					$args = array_merge($args, $panel);
77 77
 				}
78 78
 
79
-				$wp_customize->add_section( $section, $args );
79
+				$wp_customize->add_section($section, $args);
80 80
 			}
81 81
 
82 82
 			// Get plugin settings.
83 83
 			$settings = $this->alnp_get_customizer_settings();
84 84
 
85 85
 			// Add each setting.
86
-			foreach ( $settings as $setting => $args ) {
87
-				$wp_customize->add_setting( $setting, $args );
86
+			foreach ($settings as $setting => $args) {
87
+				$wp_customize->add_setting($setting, $args);
88 88
 			}
89 89
 
90 90
 			/**
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
 			 * @since 1.5.0
94 94
 			 * @param WP_Customize_Manager $wp_customize The Customizer object.
95 95
 			 */
96
-			do_action( 'alnp_customizer_register', $wp_customize );
96
+			do_action('alnp_customizer_register', $wp_customize);
97 97
 
98 98
 			$controls = $this->alnp_get_customizer_controls();
99 99
 
100
-			foreach ( $controls as $control => $args ) {
101
-				$wp_customize->add_control( new $args['class']( $wp_customize, $control, $args ) );
100
+			foreach ($controls as $control => $args) {
101
+				$wp_customize->add_control(new $args['class']($wp_customize, $control, $args));
102 102
 			}
103 103
 
104
-			if ( $this->alnp_is_customizer() ) {
105
-				$this->alnp_remove_default_customizer_panels( $wp_customize ); // Remove controls from the customizer.
104
+			if ($this->alnp_is_customizer()) {
105
+				$this->alnp_remove_default_customizer_panels($wp_customize); // Remove controls from the customizer.
106 106
 			}
107 107
 
108 108
 			// Load custom controllers.
@@ -127,30 +127,30 @@  discard block
 block discarded – undo
127 127
 			 * to tell users about the pro version, what comes with it
128 128
 			 * and link to product page.
129 129
 			 */
130
-			if ( ! is_alnp_pro_version_installed() ) {
131
-				include_once( dirname( __FILE__ ) . '/class-alnp-pro-preview-controller.php' );
130
+			if ( ! is_alnp_pro_version_installed()) {
131
+				include_once(dirname(__FILE__).'/class-alnp-pro-preview-controller.php');
132 132
 
133 133
 				$preview_args = array(
134
-					'title'    => esc_html__( 'More?', 'auto-load-next-post' ),
134
+					'title'    => esc_html__('More?', 'auto-load-next-post'),
135 135
 					'priority' => 999,
136 136
 				);
137 137
 
138
-				if ( ! $this->alnp_is_customizer() ) {
139
-					$preview_args = array_merge( $preview_args, $panel );
138
+				if ( ! $this->alnp_is_customizer()) {
139
+					$preview_args = array_merge($preview_args, $panel);
140 140
 				}
141 141
 
142
-				$wp_customize->add_section( 'alnp_pro_preview', $preview_args );
142
+				$wp_customize->add_section('alnp_pro_preview', $preview_args);
143 143
 
144
-				$wp_customize->add_setting( 'alnp_pro_preview', array(
144
+				$wp_customize->add_setting('alnp_pro_preview', array(
145 145
 					'default' => null,
146
-				) );
146
+				));
147 147
 
148
-				$wp_customize->add_control( new Auto_Load_Next_Post_Pro_Preview_Controller( $wp_customize, 'alnp_pro_preview', array(
149
-					'label'    => __( 'Looking for more options?', 'auto-load-next-post' ),
148
+				$wp_customize->add_control(new Auto_Load_Next_Post_Pro_Preview_Controller($wp_customize, 'alnp_pro_preview', array(
149
+					'label'    => __('Looking for more options?', 'auto-load-next-post'),
150 150
 					'section'  => 'alnp_pro_preview',
151 151
 					'settings' => 'alnp_pro_preview',
152 152
 					'priority' => 1,
153
-				) ) );
153
+				)));
154 154
 			}
155 155
 		} // END alnp_init_customizer()
156 156
 
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
 		 * @param  array $components Core Customizer components list.
162 162
 		 * @return array (Maybe) modified components list.
163 163
 		 */
164
-		public function alnp_remove_widgets_panel( $components ) {
165
-			if ( $this->alnp_is_customizer() ) {
166
-				foreach( $components as $key => $component ) {
167
-					if ( $component == 'widgets' ) unset( $components[ 'widgets' ] );
168
-					if ( $component == 'nav_menus' ) unset( $components[ 'nav_menus' ] );
164
+		public function alnp_remove_widgets_panel($components) {
165
+			if ($this->alnp_is_customizer()) {
166
+				foreach ($components as $key => $component) {
167
+					if ($component == 'widgets') unset($components['widgets']);
168
+					if ($component == 'nav_menus') unset($components['nav_menus']);
169 169
 				}
170 170
 			}
171 171
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		 * @param  object $wp_customize
181 181
 		 * @return boolean
182 182
 		 */
183
-		public function alnp_remove_default_customizer_panels( $wp_customize ) {
183
+		public function alnp_remove_default_customizer_panels($wp_customize) {
184 184
 			global $wp_customize;
185 185
 
186 186
 			$wp_customize->remove_section("themes");
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		 * @return boolean
203 203
 		 */
204 204
 		public function alnp_is_customizer() {
205
-			return isset( $_GET['alnp-customizer'] ) && $_GET['alnp-customizer'] === 'yes';
205
+			return isset($_GET['alnp-customizer']) && $_GET['alnp-customizer'] === 'yes';
206 206
 		} // END alnp_is_customizer()
207 207
 
208 208
 		/**
@@ -217,18 +217,18 @@  discard block
 block discarded – undo
217 217
 			 *
218 218
 			 * @param array $sections Customizer sections to add.
219 219
 			 */
220
-			return apply_filters( 'auto_load_next_post_get_customizer_sections', array(
220
+			return apply_filters('auto_load_next_post_get_customizer_sections', array(
221 221
 				'auto_load_next_post_theme_selectors' => array(
222 222
 					'capability'  => 'edit_theme_options',
223
-					'title'       => esc_html__( 'Theme Selectors', 'auto-load-next-post' ),
224
-					'description' => sprintf( __( 'Set the theme selectors below according to the theme. %1$sHow to find my theme selectors?%2$s', 'auto-load-next-post' ), '<a href="' . esc_url( 'https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wpcustomizer&utm_campaign=plugin-settings-theme-selectors' ) . '" target="_blank">', '</a>' ),
223
+					'title'       => esc_html__('Theme Selectors', 'auto-load-next-post'),
224
+					'description' => sprintf(__('Set the theme selectors below according to the theme. %1$sHow to find my theme selectors?%2$s', 'auto-load-next-post'), '<a href="'.esc_url('https://autoloadnextpost.com/documentation/find-theme-selectors/?utm_source=wpcustomizer&utm_campaign=plugin-settings-theme-selectors').'" target="_blank">', '</a>'),
225 225
 				),
226 226
 				'auto_load_next_post_misc' => array(
227 227
 					'capability'  => 'edit_theme_options',
228
-					'title'       => esc_html__( 'Misc Settings', 'auto-load-next-post' ),
229
-					'description' => sprintf( __( 'Here you can 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' ) ),
228
+					'title'       => esc_html__('Misc Settings', 'auto-load-next-post'),
229
+					'description' => sprintf(__('Here you can 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')),
230 230
 				),
231
-			) );
231
+			));
232 232
 		} // END alnp_get_customizer_sections()
233 233
 
234 234
 		/**
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
 			 *
246 246
 			 * @param array $settings Customizer settings to add.
247 247
 			 */
248
-			return apply_filters( 'auto_load_next_post_get_customizer_settings', array(
248
+			return apply_filters('auto_load_next_post_get_customizer_settings', array(
249 249
 				'auto_load_next_post_content_container' => array(
250 250
 					'capability'        => 'edit_theme_options',
251 251
 					'default'           => $settings['alnp_content_container'],
252 252
 					'sanitize_callback' => 'wp_filter_post_kses',
253
-					'validate_callback' => array( $this, 'alnp_validate_content_container_selector' ),
253
+					'validate_callback' => array($this, 'alnp_validate_content_container_selector'),
254 254
 					'transport'         => 'postMessage',
255 255
 					'type'              => 'option',
256 256
 				),
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 					'capability'        => 'edit_theme_options',
259 259
 					'default'           => $settings['alnp_title_selector'],
260 260
 					'sanitize_callback' => 'wp_filter_post_kses',
261
-					'validate_callback' => array( $this, 'alnp_validate_post_title_selector' ),
261
+					'validate_callback' => array($this, 'alnp_validate_post_title_selector'),
262 262
 					'transport'         => 'postMessage',
263 263
 					'type'              => 'option',
264 264
 				),
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 					'capability'        => 'edit_theme_options',
267 267
 					'default'           => $settings['alnp_navigation_container'],
268 268
 					'sanitize_callback' => 'wp_filter_post_kses',
269
-					'validate_callback' => array( $this, 'alnp_validate_post_navigation_selector' ),
269
+					'validate_callback' => array($this, 'alnp_validate_post_navigation_selector'),
270 270
 					'transport'         => 'postMessage',
271 271
 					'type'              => 'option',
272 272
 				),
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 					'transport'         => 'postMessage',
303 303
 					'type'              => 'option',
304 304
 				),
305
-			) );
305
+			));
306 306
 		} // END alnp_get_customizer_settings()
307 307
 
308 308
 		/**
@@ -320,64 +320,64 @@  discard block
 block discarded – undo
320 320
 			 *
321 321
 			 * @param array $controls Customizer controls to add.
322 322
 			 */
323
-			return apply_filters( 'auto_load_next_post_get_customizer_controls', array(
323
+			return apply_filters('auto_load_next_post_get_customizer_controls', array(
324 324
 				'alnp_content_container' => array(
325 325
 					'class'       => 'WP_Customize_Control',
326
-					'description' => sprintf( __( 'The primary container where the post content is loaded in. Default: %s', 'auto-load-next-post' ), '<code>main.site-main</code>' ),
327
-					'label'       => esc_html__( 'Content Container', 'auto-load-next-post' ),
326
+					'description' => sprintf(__('The primary container where the post content is loaded in. Default: %s', 'auto-load-next-post'), '<code>main.site-main</code>'),
327
+					'label'       => esc_html__('Content Container', 'auto-load-next-post'),
328 328
 					'section'     => 'auto_load_next_post_theme_selectors',
329 329
 					'settings'    => 'auto_load_next_post_content_container',
330 330
 					'type'        => 'text',
331 331
 				),
332 332
 				'alnp_title_selector' => array(
333 333
 					'class'       => 'WP_Customize_Control',
334
-					'description' => sprintf( __( 'Used to identify which article the user is reading and track should Google Analytics or other analytics be enabled. Default: %s', 'auto-load-next-post' ), '<code>h1.entry-title</code>' ),
335
-					'label'       => esc_html__( 'Post Title Selector', 'auto-load-next-post' ),
334
+					'description' => sprintf(__('Used to identify which article the user is reading and track should Google Analytics or other analytics be enabled. Default: %s', 'auto-load-next-post'), '<code>h1.entry-title</code>'),
335
+					'label'       => esc_html__('Post Title Selector', 'auto-load-next-post'),
336 336
 					'section'     => 'auto_load_next_post_theme_selectors',
337 337
 					'settings'    => 'auto_load_next_post_title_selector',
338 338
 					'type'        => 'text',
339 339
 				),
340 340
 				'alnp_navigation_container' => array(
341 341
 					'class'       => 'WP_Customize_Control',
342
-					'description' => sprintf( __( 'Used to identify which post to load next if any. Default: %s', 'auto-load-next-post' ), '<code>nav.post-navigation</code>' ),
343
-					'label'       => esc_html__( 'Post Navigation Container', 'auto-load-next-post' ),
342
+					'description' => sprintf(__('Used to identify which post to load next if any. Default: %s', 'auto-load-next-post'), '<code>nav.post-navigation</code>'),
343
+					'label'       => esc_html__('Post Navigation Container', 'auto-load-next-post'),
344 344
 					'section'     => 'auto_load_next_post_theme_selectors',
345 345
 					'settings'    => 'auto_load_next_post_navigation_container',
346 346
 					'type'        => 'text',
347 347
 				),
348 348
 				'alnp_comments_container' => array(
349 349
 					'class'       => 'WP_Customize_Control',
350
-					'description' => sprintf( __( 'Used to remove comments if enabled under <strong>%1$sMisc%2$s</strong> settings. Default: %3$s', 'auto-load-next-post' ), '<a href="javascript:wp.customize.section( \'auto_load_next_post_misc\' ).focus();">', '</a>', '<code>div#comments</code>' ),
351
-					'label'       => esc_html__( 'Comments Container', 'auto-load-next-post' ),
350
+					'description' => sprintf(__('Used to remove comments if enabled under <strong>%1$sMisc%2$s</strong> settings. Default: %3$s', 'auto-load-next-post'), '<a href="javascript:wp.customize.section( \'auto_load_next_post_misc\' ).focus();">', '</a>', '<code>div#comments</code>'),
351
+					'label'       => esc_html__('Comments Container', 'auto-load-next-post'),
352 352
 					'section'     => 'auto_load_next_post_theme_selectors',
353 353
 					'settings'    => 'auto_load_next_post_comments_container',
354 354
 					'type'        => 'text',
355 355
 				),
356 356
 				'alnp_remove_comments' => array(
357 357
 					'class'       => 'WP_Customize_Control',
358
-					'description' => esc_html__( 'Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post' ),
359
-					'label'       => esc_html__( 'Remove Comments', 'auto-load-next-post' ),
358
+					'description' => esc_html__('Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post'),
359
+					'label'       => esc_html__('Remove Comments', 'auto-load-next-post'),
360 360
 					'section'     => 'auto_load_next_post_misc',
361 361
 					'settings'    => 'auto_load_next_post_remove_comments',
362 362
 					'type'        => 'checkbox',
363 363
 				),
364 364
 				'alnp_google_analytics' => array(
365 365
 					'class'       => 'WP_Customize_Control',
366
-					'description' => esc_html__( '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' ),
367
-					'label'       => esc_html__( 'Update Google Analytics', 'auto-load-next-post' ),
366
+					'description' => esc_html__('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'),
367
+					'label'       => esc_html__('Update Google Analytics', 'auto-load-next-post'),
368 368
 					'section'     => 'auto_load_next_post_misc',
369 369
 					'settings'    => 'auto_load_next_post_google_analytics',
370 370
 					'type'        => 'checkbox',
371 371
 				),
372 372
 				'alnp_js_footer' => array(
373 373
 					'class'       => 'WP_Customize_Control',
374
-					'description' => esc_html__( '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' ),
375
-					'label'       => esc_html__( 'JavaScript in Footer?', 'auto-load-next-post' ),
374
+					'description' => esc_html__('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'),
375
+					'label'       => esc_html__('JavaScript in Footer?', 'auto-load-next-post'),
376 376
 					'section'     => 'auto_load_next_post_misc',
377 377
 					'settings'    => 'auto_load_next_post_google_analytics',
378 378
 					'type'        => 'checkbox',
379 379
 				),
380
-			) );
380
+			));
381 381
 		} // END alnp_get_customizer_controls()
382 382
 
383 383
 		/**
@@ -388,9 +388,9 @@  discard block
 block discarded – undo
388 388
 		 * @param  string   $value    Value, normally pre-sanitized.
389 389
 		 * @return WP_Error $validity
390 390
 		 */
391
-		public function alnp_validate_content_container_selector( $validity, $value ) {
392
-			if ( empty( $value ) ) {
393
-				$validity->add( 'required', esc_html__( 'The content container selector is empty. Will not know where to load posts without it.', 'auto-load-next-post' ) );
391
+		public function alnp_validate_content_container_selector($validity, $value) {
392
+			if (empty($value)) {
393
+				$validity->add('required', esc_html__('The content container selector is empty. Will not know where to load posts without it.', 'auto-load-next-post'));
394 394
 			}
395 395
 
396 396
 			return $validity;
@@ -404,9 +404,9 @@  discard block
 block discarded – undo
404 404
 		 * @param  string   $value    Value, normally pre-sanitized.
405 405
 		 * @return WP_Error $validity
406 406
 		 */
407
-		public function alnp_validate_post_title_selector( $validity, $value ) {
408
-			if ( empty( $value ) ) {
409
-				$validity->add( 'required', esc_html__( 'The post title selector is empty. Will not be able to identify which article the user is reading.', 'auto-load-next-post' ) );
407
+		public function alnp_validate_post_title_selector($validity, $value) {
408
+			if (empty($value)) {
409
+				$validity->add('required', esc_html__('The post title selector is empty. Will not be able to identify which article the user is reading.', 'auto-load-next-post'));
410 410
 			}
411 411
 
412 412
 			return $validity;
@@ -420,9 +420,9 @@  discard block
 block discarded – undo
420 420
 		 * @param  string   $value    Value, normally pre-sanitized.
421 421
 		 * @return WP_Error $validity
422 422
 		 */
423
-		public function alnp_validate_post_navigation_selector( $validity, $value ) {
424
-			if ( empty( $value ) ) {
425
-				$validity->add( 'required', esc_html__( 'The post navigation container selector is empty. Required so ALNP can look up the next post to load.', 'auto-load-next-post' ) );
423
+		public function alnp_validate_post_navigation_selector($validity, $value) {
424
+			if (empty($value)) {
425
+				$validity->add('required', esc_html__('The post navigation container selector is empty. Required so ALNP can look up the next post to load.', 'auto-load-next-post'));
426 426
 			}
427 427
 
428 428
 			return $validity;
@@ -436,14 +436,14 @@  discard block
 block discarded – undo
436 436
 		 */
437 437
 		public function alnp_get_settings() {
438 438
 			$args = array(
439
-				'alnp_content_container'      => get_option( 'auto_load_next_post_content_container' ),
440
-				'alnp_title_selector'         => get_option( 'auto_load_next_post_title_selector' ),
441
-				'alnp_navigation_container'   => get_option( 'auto_load_next_post_navigation_container' ),
442
-				'alnp_previous_post_selector' => get_option( 'auto_load_next_post_previous_post_selector' ),
443
-				'alnp_comments_container'     => get_option( 'auto_load_next_post_comments_container' ),
444
-				'alnp_remove_comments'        => get_option( 'auto_load_next_post_remove_comments' ),
445
-				'alnp_google_analytics'       => get_option( 'auto_load_next_post_google_analytics' ),
446
-				'alnp_js_footer'              => get_option( 'auto_load_next_post_js_footer' )
439
+				'alnp_content_container'      => get_option('auto_load_next_post_content_container'),
440
+				'alnp_title_selector'         => get_option('auto_load_next_post_title_selector'),
441
+				'alnp_navigation_container'   => get_option('auto_load_next_post_navigation_container'),
442
+				'alnp_previous_post_selector' => get_option('auto_load_next_post_previous_post_selector'),
443
+				'alnp_comments_container'     => get_option('auto_load_next_post_comments_container'),
444
+				'alnp_remove_comments'        => get_option('auto_load_next_post_remove_comments'),
445
+				'alnp_google_analytics'       => get_option('auto_load_next_post_google_analytics'),
446
+				'alnp_js_footer'              => get_option('auto_load_next_post_js_footer')
447 447
 			);
448 448
 
449 449
 			return $args;
@@ -457,14 +457,14 @@  discard block
 block discarded – undo
457 457
 		 * @return boolean
458 458
 		 */
459 459
 		public function is_page_alnp_ready() {
460
-			if ( is_front_page() && is_home() ) {
460
+			if (is_front_page() && is_home()) {
461 461
 				return false;
462
-			} elseif ( is_front_page() ) {
462
+			} elseif (is_front_page()) {
463 463
 				return false;
464
-			} elseif ( is_home() ) {
464
+			} elseif (is_home()) {
465 465
 				return true;
466 466
 			}
467
-			elseif ( is_singular( apply_filters( 'alnp_customizer_posts_ready', array( 'post' ) ) ) ) {
467
+			elseif (is_singular(apply_filters('alnp_customizer_posts_ready', array('post')))) {
468 468
 				return true;
469 469
 			}
470 470
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 		 * @param  string $post_type - Default is post.
480 480
 		 * @return int|boolean
481 481
 		 */
482
-		public static function alnp_get_random_page_permalink( $post_type = 'post' ) {
482
+		public static function alnp_get_random_page_permalink($post_type = 'post') {
483 483
 			$args = array(
484 484
 				'post_type'      => $post_type,
485 485
 				'post_status'    => 'publish',
@@ -487,13 +487,13 @@  discard block
 block discarded – undo
487 487
 				'posts_per_page' => 1
488 488
 			);
489 489
 
490
-			$query = new WP_Query( $args );
490
+			$query = new WP_Query($args);
491 491
 
492
-			if ( $query->have_posts() ) {
493
-				while ( $query->have_posts() ) : $query->the_post();
492
+			if ($query->have_posts()) {
493
+				while ($query->have_posts()) : $query->the_post();
494 494
 					$id = get_the_ID();
495 495
 
496
-					return get_permalink( $id );
496
+					return get_permalink($id);
497 497
 				endwhile;
498 498
 			}
499 499
 			else {
Please login to merge, or discard this patch.