@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * The main instance of the plugin. |
27 | 27 | */ |
28 | -if ( ! class_exists( 'Auto_Load_Next_Post' ) ) { |
|
28 | +if ( ! class_exists('Auto_Load_Next_Post')) { |
|
29 | 29 | |
30 | 30 | class Auto_Load_Next_Post { |
31 | 31 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return Auto_Load_Next_Post Single instance. |
60 | 60 | */ |
61 | 61 | public static function instance() { |
62 | - if ( is_null( self::$_instance ) ) { |
|
62 | + if (is_null(self::$_instance)) { |
|
63 | 63 | self::$_instance = new self(); |
64 | 64 | } |
65 | 65 | return self::$_instance; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __clone() { |
76 | 76 | // Cloning instances of the class is forbidden |
77 | - _doing_it_wrong( __FUNCTION__, __( 'Cloning this object is forbidden.', 'auto-load-next-post' ), self::$version ); |
|
77 | + _doing_it_wrong(__FUNCTION__, __('Cloning this object is forbidden.', 'auto-load-next-post'), self::$version); |
|
78 | 78 | } // END __clone() |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return void |
86 | 86 | */ |
87 | 87 | public function __wakeup() { |
88 | - _doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'auto-load-next-post' ), self::$version ); |
|
88 | + _doing_it_wrong(__FUNCTION__, __('Unserializing instances of this class is forbidden.', 'auto-load-next-post'), self::$version); |
|
89 | 89 | } // END __wakeup() |
90 | 90 | |
91 | 91 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * Auto Load Next Post is fully loaded. |
106 | 106 | */ |
107 | - do_action( 'auto_load_next_post_loaded' ); |
|
107 | + do_action('auto_load_next_post_loaded'); |
|
108 | 108 | } // END __construct() |
109 | 109 | |
110 | 110 | /** |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function init_hooks() { |
117 | 117 | // Load translation files. |
118 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
118 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
119 | 119 | |
120 | 120 | // Load Auto Load Next Post scripts on the frontend. |
121 | - add_action( 'wp_enqueue_scripts', array( $this, 'alnp_enqueue_scripts' ) ); |
|
121 | + add_action('wp_enqueue_scripts', array($this, 'alnp_enqueue_scripts')); |
|
122 | 122 | } // END init_hooks() |
123 | 123 | |
124 | 124 | /** |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | $this->define('AUTO_LOAD_NEXT_POST_FILE', __FILE__); |
134 | 134 | $this->define('AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post'); |
135 | 135 | |
136 | - $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url('/', __FILE__) ) ); |
|
137 | - $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); |
|
136 | + $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit(plugins_url('/', __FILE__))); |
|
137 | + $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit(plugin_dir_path(__FILE__))); |
|
138 | 138 | $this->define('AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/'); |
139 | 139 | |
140 | 140 | $this->define('AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.4'); |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | * @access private |
159 | 159 | * @since 1.4.3 |
160 | 160 | */ |
161 | - private function define( $name, $value ) { |
|
162 | - if ( ! defined( $name ) ) { |
|
163 | - define( $name, $value ); |
|
161 | + private function define($name, $value) { |
|
162 | + if ( ! defined($name)) { |
|
163 | + define($name, $value); |
|
164 | 164 | } |
165 | 165 | } // END define() |
166 | 166 | |
@@ -173,25 +173,25 @@ discard block |
||
173 | 173 | * @return void |
174 | 174 | */ |
175 | 175 | public function includes() { |
176 | - include_once( dirname( __FILE__ ) . '/includes/class-alnp-autoloader.php' ); // Autoloader. |
|
177 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-conditional-functions.php' ); // Conditional functions. |
|
178 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-formatting-functions.php' ); // Formatting functions. |
|
179 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. |
|
176 | + include_once(dirname(__FILE__).'/includes/class-alnp-autoloader.php'); // Autoloader. |
|
177 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-conditional-functions.php'); // Conditional functions. |
|
178 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-formatting-functions.php'); // Formatting functions. |
|
179 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end. |
|
180 | 180 | |
181 | 181 | // Include theme support. |
182 | 182 | $this->alnp_include_theme_support(); |
183 | 183 | |
184 | 184 | // Customizer. |
185 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer.php' ); |
|
186 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer-scripts.php' ); |
|
185 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer.php'); |
|
186 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer-scripts.php'); |
|
187 | 187 | |
188 | 188 | // Include admin class to handle all back-end functions. |
189 | - if ( is_admin() ) { |
|
190 | - include_once( dirname( __FILE__ ) . '/includes/admin/class-alnp-admin.php' ); // Admin section. |
|
189 | + if (is_admin()) { |
|
190 | + include_once(dirname(__FILE__).'/includes/admin/class-alnp-admin.php'); // Admin section. |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | // Install. |
194 | - require_once( dirname( __FILE__ ) . '/includes/class-alnp-install.php' ); |
|
194 | + require_once(dirname(__FILE__).'/includes/class-alnp-install.php'); |
|
195 | 195 | } // END includes() |
196 | 196 | |
197 | 197 | /** |
@@ -201,45 +201,45 @@ discard block |
||
201 | 201 | * @since 1.5.0 |
202 | 202 | */ |
203 | 203 | public function alnp_include_theme_support() { |
204 | - if ( is_alnp_active_theme( array( 'make', 'understrap', 'storefront', 'twentyseventeen', 'twentysixteen', 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentyeleven', 'twentyten' ) ) ) { |
|
204 | + if (is_alnp_active_theme(array('make', 'understrap', 'storefront', 'twentyseventeen', 'twentysixteen', 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentyeleven', 'twentyten'))) { |
|
205 | 205 | |
206 | - switch ( get_template() ) { |
|
206 | + switch (get_template()) { |
|
207 | 207 | case 'twentyten': |
208 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-ten.php' ); |
|
208 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-ten.php'); |
|
209 | 209 | break; |
210 | 210 | case 'twentyeleven': |
211 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-eleven.php' ); |
|
211 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-eleven.php'); |
|
212 | 212 | break; |
213 | 213 | case 'twentytwelve': |
214 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-twelve.php' ); |
|
214 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-twelve.php'); |
|
215 | 215 | break; |
216 | 216 | case 'twentythirteen': |
217 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-thirteen.php' ); |
|
217 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-thirteen.php'); |
|
218 | 218 | break; |
219 | 219 | case 'twentyfourteen': |
220 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-fourteen.php' ); |
|
220 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-fourteen.php'); |
|
221 | 221 | break; |
222 | 222 | case 'twentyfifteen': |
223 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-fifteen.php' ); |
|
223 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-fifteen.php'); |
|
224 | 224 | break; |
225 | 225 | case 'twentysixteen': |
226 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-sixteen.php' ); |
|
226 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-sixteen.php'); |
|
227 | 227 | break; |
228 | 228 | case 'twentyseventeen': |
229 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-twenty-seventeen.php' ); |
|
229 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-twenty-seventeen.php'); |
|
230 | 230 | break; |
231 | 231 | case 'storefront': |
232 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-storefront.php' ); |
|
232 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-storefront.php'); |
|
233 | 233 | break; |
234 | 234 | case 'understrap': |
235 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-understrap.php' ); |
|
235 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-understrap.php'); |
|
236 | 236 | break; |
237 | 237 | case 'make': |
238 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-make.php' ); |
|
238 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-make.php'); |
|
239 | 239 | break; |
240 | 240 | } // END switch() |
241 | 241 | |
242 | - include_once( dirname( __FILE__ ) . '/includes/theme-support/class-alnp-theme-support.php' ); |
|
242 | + include_once(dirname(__FILE__).'/includes/theme-support/class-alnp-theme-support.php'); |
|
243 | 243 | |
244 | 244 | } |
245 | 245 | } // END alnp_include_theme_support() |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | * @return void |
257 | 257 | */ |
258 | 258 | public function load_plugin_textdomain() { |
259 | - load_plugin_textdomain( 'auto-load-next-post', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
259 | + load_plugin_textdomain('auto-load-next-post', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
260 | 260 | } // END load_plugin_textdomain() |
261 | 261 | |
262 | 262 | /** |
@@ -268,32 +268,32 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function alnp_enqueue_scripts() { |
270 | 270 | // Load the Javascript if found as a singluar post and the user is not a bot. |
271 | - if ( !alnp_is_bot() && is_singular() && get_post_type() == 'post' ) { |
|
271 | + if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post') { |
|
272 | 272 | // This helps the plugin decide to load the JavaScript in the footer or not. |
273 | - $load_in_footer = get_option( 'auto_load_next_post_js_footer' ); |
|
273 | + $load_in_footer = get_option('auto_load_next_post_js_footer'); |
|
274 | 274 | |
275 | - $this->load_file( 'auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy.min.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer ); |
|
275 | + $this->load_file('auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy.min.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer); |
|
276 | 276 | |
277 | 277 | // Only load History.js when not in the customizer. |
278 | - if ( ! is_customize_preview() ) { |
|
279 | - $this->load_file( 'auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer ); |
|
278 | + if ( ! is_customize_preview()) { |
|
279 | + $this->load_file('auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer); |
|
280 | 280 | } |
281 | 281 | |
282 | - $this->load_file( 'auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post' . AUTO_LOAD_NEXT_POST_DEBUG_MODE.AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer ); |
|
282 | + $this->load_file('auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post'.AUTO_LOAD_NEXT_POST_DEBUG_MODE.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer); |
|
283 | 283 | |
284 | 284 | // Variables for the JavaScript |
285 | - wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
285 | + wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
286 | 286 | 'alnp_version' => AUTO_LOAD_NEXT_POST_VERSION, |
287 | - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), |
|
288 | - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), |
|
289 | - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), |
|
290 | - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), |
|
291 | - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), |
|
292 | - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), |
|
293 | - 'alnp_event_on_load' => get_option( 'auto_load_next_post_on_load_event' ), |
|
294 | - 'alnp_event_on_entering' => get_option( 'auto_load_next_post_on_entering_event' ), |
|
287 | + 'alnp_content_container' => get_option('auto_load_next_post_content_container'), |
|
288 | + 'alnp_title_selector' => get_option('auto_load_next_post_title_selector'), |
|
289 | + 'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'), |
|
290 | + 'alnp_comments_container' => get_option('auto_load_next_post_comments_container'), |
|
291 | + 'alnp_remove_comments' => get_option('auto_load_next_post_remove_comments'), |
|
292 | + 'alnp_google_analytics' => get_option('auto_load_next_post_google_analytics'), |
|
293 | + 'alnp_event_on_load' => get_option('auto_load_next_post_on_load_event'), |
|
294 | + 'alnp_event_on_entering' => get_option('auto_load_next_post_on_entering_event'), |
|
295 | 295 | 'alnp_is_customizer' => $this->is_alnp_using_customizer(), |
296 | - ) ); |
|
296 | + )); |
|
297 | 297 | } // END if is_singular() && get_post_type() |
298 | 298 | } // END alnp_enqueue_scripts() |
299 | 299 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @return string|boolean |
307 | 307 | */ |
308 | 308 | public static function is_alnp_using_customizer() { |
309 | - if ( is_customize_preview() ) { |
|
309 | + if (is_customize_preview()) { |
|
310 | 310 | return "yes"; |
311 | 311 | } |
312 | 312 | |
@@ -328,21 +328,21 @@ discard block |
||
328 | 328 | * @param bool $footer Optional, can set the JavaScript to load in the footer instead. |
329 | 329 | * @global string $wp_version |
330 | 330 | */ |
331 | - public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) { |
|
331 | + public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false) { |
|
332 | 332 | global $wp_version; |
333 | 333 | |
334 | - $url = AUTO_LOAD_NEXT_POST_URL_PATH . $file_path; // URL to the file. |
|
334 | + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. |
|
335 | 335 | |
336 | - if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH . $file_path ) ) { |
|
337 | - if ( $is_script ) { |
|
338 | - if ( !wp_script_is( $name, 'registered' ) ) { |
|
339 | - wp_register_script( $name, $url, $support, $version, $footer ); |
|
340 | - wp_enqueue_script( $name ); |
|
336 | + if (file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)) { |
|
337 | + if ($is_script) { |
|
338 | + if ( ! wp_script_is($name, 'registered')) { |
|
339 | + wp_register_script($name, $url, $support, $version, $footer); |
|
340 | + wp_enqueue_script($name); |
|
341 | 341 | } |
342 | 342 | } else { |
343 | - if ( !wp_style_is( $name, 'registered' ) ) { |
|
344 | - wp_register_style( $name, $url ); |
|
345 | - wp_enqueue_style( $name ); |
|
343 | + if ( ! wp_style_is($name, 'registered')) { |
|
344 | + wp_register_style($name, $url); |
|
345 | + wp_enqueue_style($name); |
|
346 | 346 | } |
347 | 347 | } // end if |
348 | 348 | } // end if |
@@ -11,11 +11,11 @@ discard block |
||
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' ) ) { |
|
18 | +if ( ! class_exists('Auto_Load_Next_Post_Admin')) { |
|
19 | 19 | |
20 | 20 | class Auto_Load_Next_Post_Admin { |
21 | 21 | |
@@ -28,23 +28,23 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | 30 | // Include classes. |
31 | - add_action( 'admin_init', array( $this, 'includes' ), 10 ); |
|
31 | + add_action('admin_init', array($this, 'includes'), 10); |
|
32 | 32 | |
33 | 33 | // Register scripts and styles for settings page. |
34 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_styles' ), 10 ); |
|
35 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 10 ); |
|
34 | + add_action('admin_enqueue_scripts', array($this, 'admin_styles'), 10); |
|
35 | + add_action('admin_enqueue_scripts', array($this, 'admin_scripts'), 10); |
|
36 | 36 | |
37 | 37 | // Add a message in the WP Privacy Policy Guide page. |
38 | - add_action( 'admin_init', array( $this, 'add_privacy_policy_guide_content' ) ); |
|
38 | + add_action('admin_init', array($this, 'add_privacy_policy_guide_content')); |
|
39 | 39 | |
40 | 40 | // Add settings page. |
41 | - add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 ); |
|
41 | + add_action('admin_menu', array($this, 'admin_menu'), 9); |
|
42 | 42 | |
43 | 43 | // Filters |
44 | - add_filter( 'plugin_action_links_' . plugin_basename( AUTO_LOAD_NEXT_POST_FILE ), array( $this, 'plugin_action_links' ) ); |
|
45 | - add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta'), 10, 3 ); |
|
46 | - add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) ); |
|
47 | - add_filter( 'update_footer', array( $this, 'update_footer'), 15 ); |
|
44 | + add_filter('plugin_action_links_'.plugin_basename(AUTO_LOAD_NEXT_POST_FILE), array($this, 'plugin_action_links')); |
|
45 | + add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 3); |
|
46 | + add_filter('admin_footer_text', array($this, 'admin_footer_text')); |
|
47 | + add_filter('update_footer', array($this, 'update_footer'), 15); |
|
48 | 48 | } // END __construct() |
49 | 49 | |
50 | 50 | /** |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function includes() { |
57 | 57 | // Classes we only need if the ajax is not-ajax |
58 | - if ( ! auto_load_next_post_is_ajax() ) { |
|
59 | - include( dirname( __FILE__ ) . '/class-alnp-admin-notices.php' ); // Plugin Notices |
|
60 | - include( dirname( __FILE__ ) . '/class-alnp-admin-help.php' ); // Plugin Help Tab |
|
58 | + if ( ! auto_load_next_post_is_ajax()) { |
|
59 | + include(dirname(__FILE__).'/class-alnp-admin-notices.php'); // Plugin Notices |
|
60 | + include(dirname(__FILE__).'/class-alnp-admin-help.php'); // Plugin Help Tab |
|
61 | 61 | } |
62 | 62 | } // END includes() |
63 | 63 | |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | $screen = get_current_screen(); |
75 | 75 | $screen_id = $screen ? $screen->id : ''; |
76 | 76 | |
77 | - Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG . '_admin', '/assets/css/admin/auto-load-next-post' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' ); |
|
77 | + Auto_Load_Next_Post::load_file(AUTO_LOAD_NEXT_POST_SLUG.'_admin', '/assets/css/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css'); |
|
78 | 78 | |
79 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
79 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
80 | 80 | // Select2 - Make sure that we remove other registered Select2 to prevent styling issues. |
81 | - if ( wp_script_is( 'select2', 'registered' ) ) { |
|
82 | - wp_dequeue_style( 'select2' ); |
|
83 | - wp_deregister_style( 'select2' ); |
|
81 | + if (wp_script_is('select2', 'registered')) { |
|
82 | + wp_dequeue_style('select2'); |
|
83 | + wp_deregister_style('select2'); |
|
84 | 84 | } |
85 | 85 | |
86 | - Auto_Load_Next_Post::load_file( 'select2', '/assets/css/libs/select2' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' ); |
|
86 | + Auto_Load_Next_Post::load_file('select2', '/assets/css/libs/select2'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css'); |
|
87 | 87 | } |
88 | 88 | } // END admin_styles() |
89 | 89 | |
@@ -98,24 +98,24 @@ discard block |
||
98 | 98 | $screen = get_current_screen(); |
99 | 99 | $screen_id = $screen ? $screen->id : ''; |
100 | 100 | |
101 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
101 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
102 | 102 | // Select2 - Make sure that we remove other registered Select2 to prevent plugin conflict issues. |
103 | - if ( wp_script_is( 'select2', 'registered' ) ) { |
|
104 | - wp_dequeue_script( 'select2' ); |
|
105 | - wp_deregister_script( 'select2' ); |
|
103 | + if (wp_script_is('select2', 'registered')) { |
|
104 | + wp_dequeue_script('select2'); |
|
105 | + wp_deregister_script('select2'); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // Load Select2 |
109 | - Auto_Load_Next_Post::load_file( 'select2', '/assets/js/libs/select2' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array( 'jquery' ), '4.0.5', true ); |
|
109 | + Auto_Load_Next_Post::load_file('select2', '/assets/js/libs/select2'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), '4.0.5', true); |
|
110 | 110 | |
111 | 111 | // Load plugin settings. |
112 | - Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG . '_admin', '/assets/js/admin/settings' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array( 'jquery' ), AUTO_LOAD_NEXT_POST_VERSION, true ); |
|
112 | + Auto_Load_Next_Post::load_file(AUTO_LOAD_NEXT_POST_SLUG.'_admin', '/assets/js/admin/settings'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, true); |
|
113 | 113 | |
114 | 114 | // Variables for Admin JavaScripts |
115 | - wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG . '_admin', 'alnp_settings_params', array( |
|
115 | + wp_localize_script(AUTO_LOAD_NEXT_POST_SLUG.'_admin', 'alnp_settings_params', array( |
|
116 | 116 | 'is_rtl' => is_rtl() ? 'rtl' : 'ltr', |
117 | - 'i18n_nav_warning' => esc_html__( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), |
|
118 | - ) ); |
|
117 | + 'i18n_nav_warning' => esc_html__('The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post'), |
|
118 | + )); |
|
119 | 119 | } |
120 | 120 | } // END admin_scripts() |
121 | 121 | |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | * @static |
128 | 128 | */ |
129 | 129 | public static function add_privacy_policy_guide_content() { |
130 | - if ( function_exists( 'wp_add_privacy_policy_content' ) ) { |
|
131 | - wp_add_privacy_policy_content( esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), self::get_privacy_policy_guide_message() ); |
|
130 | + if (function_exists('wp_add_privacy_policy_content')) { |
|
131 | + wp_add_privacy_policy_content(esc_html__('Auto Load Next Post', 'auto-load-next-post'), self::get_privacy_policy_guide_message()); |
|
132 | 132 | } |
133 | 133 | } // END add_privacy_policy_guide_content() |
134 | 134 | |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | protected static function get_privacy_policy_guide_message() { |
144 | 144 | $content = ' |
145 | 145 | <div contenteditable="false">' . |
146 | - '<p class="wp-policy-help">' . |
|
147 | - sprintf( __( '%s does not collect, store or share any personal data.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . |
|
148 | - '</p>' . |
|
146 | + '<p class="wp-policy-help">'. |
|
147 | + sprintf(__('%s does not collect, store or share any personal data.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')). |
|
148 | + '</p>'. |
|
149 | 149 | '</div>'; |
150 | 150 | |
151 | 151 | return $content; |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function admin_menu() { |
162 | 162 | $settings_page = add_options_page( |
163 | - sprintf( __( '%s Settings', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ), |
|
164 | - esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), |
|
163 | + sprintf(__('%s Settings', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')), |
|
164 | + esc_html__('Auto Load Next Post', 'auto-load-next-post'), |
|
165 | 165 | 'manage_options', |
166 | 166 | 'auto-load-next-post-settings', |
167 | - array( $this, 'settings_page' ) |
|
167 | + array($this, 'settings_page') |
|
168 | 168 | ); |
169 | 169 | |
170 | - add_action( 'load-' . $settings_page, array( $this, 'settings_page_init' ) ); |
|
170 | + add_action('load-'.$settings_page, array($this, 'settings_page_init')); |
|
171 | 171 | } // END admin_menu() |
172 | 172 | |
173 | 173 | /** |
@@ -182,29 +182,29 @@ discard block |
||
182 | 182 | global $current_tab, $current_section; |
183 | 183 | |
184 | 184 | // Include settings pages. |
185 | - include_once( dirname( __FILE__ ) . '/class-alnp-admin-settings.php' ); |
|
185 | + include_once(dirname(__FILE__).'/class-alnp-admin-settings.php'); |
|
186 | 186 | |
187 | 187 | Auto_Load_Next_Post_Admin_Settings::get_settings_pages(); |
188 | 188 | |
189 | 189 | // Get current tab/section. |
190 | - $current_tab = empty( $_GET['tab'] ) ? 'theme-selectors' : sanitize_title( wp_unslash( $_GET['tab'] ) ); |
|
191 | - $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( wp_unslash( $_REQUEST['section'] ) ); |
|
190 | + $current_tab = empty($_GET['tab']) ? 'theme-selectors' : sanitize_title(wp_unslash($_GET['tab'])); |
|
191 | + $current_section = empty($_REQUEST['section']) ? '' : sanitize_title(wp_unslash($_REQUEST['section'])); |
|
192 | 192 | |
193 | 193 | // Save settings if data has been posted. |
194 | - if ( apply_filters( '' !== $current_section ? "auto_load_next_post_save_settings_{$current_tab}_{$current_section}" : "auto_load_next_post_save_settings_{$current_tab}", ! empty( $_POST ) ) ) { |
|
194 | + if (apply_filters('' !== $current_section ? "auto_load_next_post_save_settings_{$current_tab}_{$current_section}" : "auto_load_next_post_save_settings_{$current_tab}", ! empty($_POST))) { |
|
195 | 195 | Auto_Load_Next_Post_Admin_Settings::save(); |
196 | 196 | } |
197 | 197 | |
198 | 198 | // Add any posted messages. |
199 | - if ( ! empty( $_GET['auto_load_next_post_error'] ) ) { |
|
200 | - Auto_Load_Next_Post_Admin_Settings::add_error( wp_kses_post( wp_unslash( $_GET['auto_load_next_post_error'] ) ) ); |
|
199 | + if ( ! empty($_GET['auto_load_next_post_error'])) { |
|
200 | + Auto_Load_Next_Post_Admin_Settings::add_error(wp_kses_post(wp_unslash($_GET['auto_load_next_post_error']))); |
|
201 | 201 | } |
202 | 202 | |
203 | - if ( ! empty( $_GET['auto_load_next_post_message'] ) ) { |
|
204 | - Auto_Load_Next_Post_Admin_Settings::add_message( wp_kses_post( wp_unslash( $_GET['auto_load_next_post_message'] ) ) ); |
|
203 | + if ( ! empty($_GET['auto_load_next_post_message'])) { |
|
204 | + Auto_Load_Next_Post_Admin_Settings::add_message(wp_kses_post(wp_unslash($_GET['auto_load_next_post_message']))); |
|
205 | 205 | } |
206 | 206 | |
207 | - do_action( 'auto_load_next_post_settings_page_init' ); |
|
207 | + do_action('auto_load_next_post_settings_page_init'); |
|
208 | 208 | } // END settings_page_init() |
209 | 209 | |
210 | 210 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @since 1.0.0 |
215 | 215 | */ |
216 | 216 | public function settings_page() { |
217 | - include_once( dirname( __FILE__ ) . '/class-alnp-admin-settings.php' ); |
|
217 | + include_once(dirname(__FILE__).'/class-alnp-admin-settings.php'); |
|
218 | 218 | |
219 | 219 | Auto_Load_Next_Post_Admin_Settings::output(); |
220 | 220 | } // END settings_page() |
@@ -228,18 +228,18 @@ discard block |
||
228 | 228 | * @param array $links |
229 | 229 | * @return array $links |
230 | 230 | */ |
231 | - public function plugin_action_links( $links ) { |
|
231 | + public function plugin_action_links($links) { |
|
232 | 232 | $plugin_action_links = array(); |
233 | 233 | |
234 | - if ( current_user_can( 'manage_options' ) ) { |
|
234 | + if (current_user_can('manage_options')) { |
|
235 | 235 | // Checks if Auto Load Next Post Pro has been installed. |
236 | - if ( ! is_alnp_pro_version_installed() ) { |
|
237 | - $plugin_action_links['go-pro'] = '<a href="' . esc_url( AUTO_LOAD_NEXT_POST_STORE_URL . 'pro/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page' ) . '" target="_blank" style="color:green; font-weight:bold;">' . __( 'Sign up for Pro', 'auto-load-next-post' ) . '</a>'; |
|
236 | + if ( ! is_alnp_pro_version_installed()) { |
|
237 | + $plugin_action_links['go-pro'] = '<a href="'.esc_url(AUTO_LOAD_NEXT_POST_STORE_URL.'pro/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page').'" target="_blank" style="color:green; font-weight:bold;">'.__('Sign up for Pro', 'auto-load-next-post').'</a>'; |
|
238 | 238 | } |
239 | 239 | |
240 | - $plugin_action_links['settings'] = '<a href="' . admin_url( 'options-general.php?page=auto-load-next-post-settings' ) . '">' . __( 'Settings', 'auto-load-next-post' ) . '</a>'; |
|
240 | + $plugin_action_links['settings'] = '<a href="'.admin_url('options-general.php?page=auto-load-next-post-settings').'">'.__('Settings', 'auto-load-next-post').'</a>'; |
|
241 | 241 | |
242 | - return array_merge( $plugin_action_links, $links ); |
|
242 | + return array_merge($plugin_action_links, $links); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | return $links; |
@@ -256,17 +256,17 @@ discard block |
||
256 | 256 | * @param array $data Plugin Information |
257 | 257 | * @return array $links |
258 | 258 | */ |
259 | - public function plugin_row_meta( $links, $file, $data ) { |
|
260 | - if ( $file == plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ) { |
|
261 | - $links[ 1 ] = sprintf( __( 'Developed By %s', 'auto-load-next-post' ), '<a href="' . $data[ 'AuthorURI' ] . '">' . $data[ 'Author' ] . '</a>' ); |
|
259 | + public function plugin_row_meta($links, $file, $data) { |
|
260 | + if ($file == plugin_basename(AUTO_LOAD_NEXT_POST_FILE)) { |
|
261 | + $links[1] = sprintf(__('Developed By %s', 'auto-load-next-post'), '<a href="'.$data['AuthorURI'].'">'.$data['Author'].'</a>'); |
|
262 | 262 | |
263 | 263 | $row_meta = array( |
264 | - 'docs' => '<a href="' . esc_url( AUTO_LOAD_NEXT_POST_STORE_URL . 'documentation/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page' ) . '" aria-label="' . esc_attr__( 'View Auto Load Next Post Documentation', 'auto-load-next-post' ) . '" target="_blank">' . esc_attr__( 'Documentation', 'auto-load-next-post' ) . '</a>', |
|
265 | - 'community' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/auto-load-next-post' ) . '" aria-label="' . esc_attr__( 'Get support from the community', 'auto-load-next-post' ). '" target="_blank">' . esc_attr__( 'Community Support', 'auto-load-next-post' ) . '</a>', |
|
266 | - 'theme-support' => '<a href="' . esc_url( AUTO_LOAD_NEXT_POST_STORE_URL . 'product/theme-support/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page' ) . '" attr-label="' . esc_attr__( 'Get Theme Support', 'auto-load-next-post' ) . '" target="_blank">' . esc_attr__( 'Theme Support', 'auto-load-next-post' ) . '</a>', |
|
264 | + 'docs' => '<a href="'.esc_url(AUTO_LOAD_NEXT_POST_STORE_URL.'documentation/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page').'" aria-label="'.esc_attr__('View Auto Load Next Post Documentation', 'auto-load-next-post').'" target="_blank">'.esc_attr__('Documentation', 'auto-load-next-post').'</a>', |
|
265 | + 'community' => '<a href="'.esc_url('https://wordpress.org/support/plugin/auto-load-next-post').'" aria-label="'.esc_attr__('Get support from the community', 'auto-load-next-post').'" target="_blank">'.esc_attr__('Community Support', 'auto-load-next-post').'</a>', |
|
266 | + 'theme-support' => '<a href="'.esc_url(AUTO_LOAD_NEXT_POST_STORE_URL.'product/theme-support/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page').'" attr-label="'.esc_attr__('Get Theme Support', 'auto-load-next-post').'" target="_blank">'.esc_attr__('Theme Support', 'auto-load-next-post').'</a>', |
|
267 | 267 | ); |
268 | 268 | |
269 | - $links = array_merge( $links, $row_meta ); |
|
269 | + $links = array_merge($links, $row_meta); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | return $links; |
@@ -282,16 +282,16 @@ discard block |
||
282 | 282 | * @param string $text |
283 | 283 | * @return string $text |
284 | 284 | */ |
285 | - public function admin_footer_text( $text ) { |
|
285 | + public function admin_footer_text($text) { |
|
286 | 286 | $current_screen = get_current_screen(); |
287 | 287 | |
288 | - if ( isset( $current_screen->id ) && $current_screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
288 | + if (isset($current_screen->id) && $current_screen->id == 'settings_page_auto-load-next-post-settings') { |
|
289 | 289 | // Rating and Review |
290 | 290 | return sprintf( |
291 | 291 | /* translators: 1: Auto Load Next Post 2:: five stars */ |
292 | - __( 'If you like %1$s, please leave a %2$s rating. A huge thank you in advance!', 'auto-load-next-post' ), |
|
293 | - sprintf( '<strong>%1$s</strong>', esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ), |
|
294 | - '<a href="' . AUTO_LOAD_NEXT_POST_REVIEW_URL . '?rate=5#new-post" target="_blank" data-rated="' . esc_attr__( 'Thanks :)', 'auto-load-next-post' ) . '">★★★★★</a>' |
|
292 | + __('If you like %1$s, please leave a %2$s rating. A huge thank you in advance!', 'auto-load-next-post'), |
|
293 | + sprintf('<strong>%1$s</strong>', esc_html__('Auto Load Next Post', 'auto-load-next-post')), |
|
294 | + '<a href="'.AUTO_LOAD_NEXT_POST_REVIEW_URL.'?rate=5#new-post" target="_blank" data-rated="'.esc_attr__('Thanks :)', 'auto-load-next-post').'">★★★★★</a>' |
|
295 | 295 | ); |
296 | 296 | } |
297 | 297 | |
@@ -308,11 +308,11 @@ discard block |
||
308 | 308 | * @param string $text |
309 | 309 | * @return string $text |
310 | 310 | */ |
311 | - public function update_footer( $text ) { |
|
311 | + public function update_footer($text) { |
|
312 | 312 | $screen = get_current_screen(); |
313 | 313 | |
314 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
315 | - return '<p class="alignright">' . sprintf( __( '%s Version', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . ' ' . esc_attr( AUTO_LOAD_NEXT_POST_VERSION ) . '</p>'; |
|
314 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
315 | + return '<p class="alignright">'.sprintf(__('%s Version', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')).' '.esc_attr(AUTO_LOAD_NEXT_POST_VERSION).'</p>'; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | return $text; |
@@ -11,10 +11,10 @@ |
||
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( __( 'In order to remove comments we need to know what the comments container is. Please identify the comments container under <strong>Theme Selectors</strong>. %1$sHow to find my theme selectors?%2$s', 'auto-load-next-post' ), '<a href="' . AUTO_LOAD_NEXT_POST_STORE_URL . 'documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-misc" target="_blank">', '</a>' ); ?></p> |
|
19 | + <p><?php echo sprintf(__('In order to remove comments we need to know what the comments container is. Please identify the comments container under <strong>Theme Selectors</strong>. %1$sHow to find my theme selectors?%2$s', 'auto-load-next-post'), '<a href="'.AUTO_LOAD_NEXT_POST_STORE_URL.'documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-misc" target="_blank">', '</a>'); ?></p> |
|
20 | 20 | </div> |
@@ -11,28 +11,28 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
18 | 18 | $current_user = wp_get_current_user(); |
19 | 19 | |
20 | -$time = auto_load_next_post_seconds_to_words( time() - $install_date ); |
|
20 | +$time = auto_load_next_post_seconds_to_words(time() - $install_date); |
|
21 | 21 | ?> |
22 | 22 | <div class="notice notice-info auto-load-next-post-notice"> |
23 | 23 | <div class="auto-load-next-post-notice-inner"> |
24 | 24 | <div class="auto-load-next-post-notice-icon"> |
25 | - <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" /> |
|
25 | + <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" /> |
|
26 | 26 | </div> |
27 | 27 | |
28 | 28 | <div class="auto-load-next-post-notice-content"> |
29 | - <h3><?php echo esc_html__( 'Are you enjoying Auto Load Next Post?', 'auto-load-next-post' ); ?></h3> |
|
30 | - <p><?php printf( esc_html__( 'You have been using %1$s for %2$s now! Mind leaving a quick review and let me know know what you think of the plugin? I\'d really appreciate it!', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), esc_html( $time ) ); ?></p> |
|
29 | + <h3><?php echo esc_html__('Are you enjoying Auto Load Next Post?', 'auto-load-next-post'); ?></h3> |
|
30 | + <p><?php printf(esc_html__('You have been using %1$s for %2$s now! Mind leaving a quick review and let me know know what you think of the plugin? I\'d really appreciate it!', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), esc_html($time)); ?></p> |
|
31 | 31 | </div> |
32 | 32 | |
33 | 33 | <div class="auto-load-next-post-review-now"> |
34 | - <?php printf( '<a href="%1$s" class="button button-primary auto-load-next-post-review-button" target="_blank">%2$s</a>', esc_url( AUTO_LOAD_NEXT_POST_REVIEW_URL . '?rate=5#new-post' ), esc_html__( 'Leave a Review', 'auto-load-next-post' ) ); ?> |
|
35 | - <a href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_review_notice', 'true' ) ); ?>" class="no-thanks"><?php echo esc_html__( 'No thank you / I already have', 'auto-load-next-post' ); ?></a> |
|
34 | + <?php printf('<a href="%1$s" class="button button-primary auto-load-next-post-review-button" target="_blank">%2$s</a>', esc_url(AUTO_LOAD_NEXT_POST_REVIEW_URL.'?rate=5#new-post'), esc_html__('Leave a Review', 'auto-load-next-post')); ?> |
|
35 | + <a href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_review_notice', 'true')); ?>" class="no-thanks"><?php echo esc_html__('No thank you / I already have', 'auto-load-next-post'); ?></a> |
|
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | </div> |
@@ -11,31 +11,31 @@ discard block |
||
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-success auto-load-next-post-notice"> |
19 | 19 | <div class="auto-load-next-post-notice-inner"> |
20 | 20 | <div class="auto-load-next-post-notice-icon"> |
21 | - <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" /> |
|
21 | + <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" /> |
|
22 | 22 | </div> |
23 | 23 | |
24 | 24 | <div class="auto-load-next-post-notice-content"> |
25 | - <h3><?php echo esc_html__( 'Welcome!', 'auto-load-next-post' ); ?></h3> |
|
25 | + <h3><?php echo esc_html__('Welcome!', 'auto-load-next-post'); ?></h3> |
|
26 | 26 | <p> |
27 | - <?php echo sprintf( __( 'Thank you for activating %1$s! If you\'re a first time user, welcome! You\'re well on your way to increasing your pageviews.', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ); ?> |
|
27 | + <?php echo sprintf(__('Thank you for activating %1$s! If you\'re a first time user, welcome! You\'re well on your way to increasing your pageviews.', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')); ?> |
|
28 | 28 | <?php |
29 | 29 | // If the theme has not added support then encourage the user to see the documentation. |
30 | - if ( ! is_alnp_supported() ) { |
|
30 | + if ( ! is_alnp_supported()) { |
|
31 | 31 | $query = array( |
32 | 32 | 'autofocus[panel]' => 'alnp', |
33 | 33 | 'autofocus[section]' => 'auto_load_next_post_theme_selectors', |
34 | 34 | 'url' => alnp_get_random_page_permalink(), |
35 | - 'return' => admin_url( 'options-general.php?page=auto-load-next-post-settings' ), |
|
35 | + 'return' => admin_url('options-general.php?page=auto-load-next-post-settings'), |
|
36 | 36 | ); |
37 | - $customizer_link = add_query_arg( $query, admin_url( 'customize.php' ) ); |
|
38 | - echo sprintf( __( 'I encourage you to check out the plugin documentation and getting started with %1$ssetting up your theme selectors%2$s.', 'auto-load-next-post' ), '<a href="' . esc_url( $customizer_link ) . '">', '</a>' ); |
|
37 | + $customizer_link = add_query_arg($query, admin_url('customize.php')); |
|
38 | + echo sprintf(__('I encourage you to check out the plugin documentation and getting started with %1$ssetting up your theme selectors%2$s.', 'auto-load-next-post'), '<a href="'.esc_url($customizer_link).'">', '</a>'); |
|
39 | 39 | } |
40 | 40 | ?> |
41 | 41 | </p> |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | <div class="auto-load-next-post-documentation"> |
45 | 45 | <?php |
46 | 46 | // If the theme has not added support then display button to documentation. |
47 | - if ( ! is_alnp_supported() ) { |
|
48 | - printf( '<a href="%1$s" class="button button-primary auto-load-next-post-documentation-button" target="_blank">%2$s</a>', esc_url( AUTO_LOAD_NEXT_POST_STORE_URL . 'documentation/?utm_source=plugin&utm_medium=link&utm_campaign=welcome-notice' ), esc_html__( 'Documentation', 'auto-load-next-post' ) ); |
|
47 | + if ( ! is_alnp_supported()) { |
|
48 | + printf('<a href="%1$s" class="button button-primary auto-load-next-post-documentation-button" target="_blank">%2$s</a>', esc_url(AUTO_LOAD_NEXT_POST_STORE_URL.'documentation/?utm_source=plugin&utm_medium=link&utm_campaign=welcome-notice'), esc_html__('Documentation', 'auto-load-next-post')); |
|
49 | 49 | } |
50 | 50 | ?> |
51 | - <a href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_welcome_notice', 'true' ) ); ?>" class="no-thanks"><?php echo esc_html__( 'Dismiss Notice', 'auto-load-next-post' ); ?></a> |
|
51 | + <a href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_welcome_notice', 'true')); ?>" class="no-thanks"><?php echo esc_html__('Dismiss Notice', 'auto-load-next-post'); ?></a> |
|
52 | 52 | </div> |
53 | 53 | </div> |
54 | 54 | </div> |
@@ -3,25 +3,25 @@ discard block |
||
3 | 3 | <a class="alnp-banner" href="<?php echo AUTO_LOAD_NEXT_POST_STORE_URL; ?>?utm_source=plugin&utm_medium=alnp-banner&utm_campaign=alnp-settings-page"></a> |
4 | 4 | |
5 | 5 | <div class="alnp-upgrade-details"> |
6 | - <h1><?php esc_html_e( 'Pro Coming Soon', 'auto-load-next-post' ); ?></h1> |
|
6 | + <h1><?php esc_html_e('Pro Coming Soon', 'auto-load-next-post'); ?></h1> |
|
7 | 7 | |
8 | 8 | <ul> |
9 | - <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> |
|
10 | - <li><?php echo wptexturize( esc_html__( 'Page and Media Attachment Support', 'auto-load-next-post' ) ); ?></li> |
|
11 | - <li><?php echo wptexturize( esc_html__( 'Custom Post Type Support', 'auto-load-next-post' ) ); ?></li> |
|
12 | - <li><?php echo wptexturize( esc_html__( 'Paginated Posts Supported', 'auto-load-next-post' ) ); ?></li> |
|
13 | - <li><?php echo wptexturize( esc_html__( 'Exclude Post Formats', 'auto-load-next-post' ) ); ?></li> |
|
14 | - <li><?php echo wptexturize( esc_html__( 'Limit Posts per Session', 'auto-load-next-post' ) ); ?></li> |
|
15 | - <li><?php echo wptexturize( esc_html__( 'Query Posts by Category and Tag', 'auto-load-next-post' ) ); ?></li> |
|
16 | - <li><?php echo wptexturize( esc_html__( 'Exclude User Roles and Specific Users', 'auto-load-next-post' ) ); ?></li> |
|
17 | - <li><?php echo wptexturize( esc_html__( 'Pre-Query Posts Ready to Load', 'auto-load-next-post' ) ); ?></li> |
|
18 | - <li><?php echo wptexturize( esc_html__( 'Hide Comments and Show by Toggle Button', 'auto-load-next-post' ) ); ?></li> |
|
19 | - <li><?php echo wptexturize( sprintf( esc_html__( 'Multilingual Support for %1$s and %2$s', 'auto-load-next-post' ), 'WPML', 'Polylang' ) ); ?></li> |
|
20 | - <li><?php echo wptexturize( esc_html__( 'Email Support', 'auto-load-next-post' ) ); ?></li> |
|
9 | + <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> |
|
10 | + <li><?php echo wptexturize(esc_html__('Page and Media Attachment Support', 'auto-load-next-post')); ?></li> |
|
11 | + <li><?php echo wptexturize(esc_html__('Custom Post Type Support', 'auto-load-next-post')); ?></li> |
|
12 | + <li><?php echo wptexturize(esc_html__('Paginated Posts Supported', 'auto-load-next-post')); ?></li> |
|
13 | + <li><?php echo wptexturize(esc_html__('Exclude Post Formats', 'auto-load-next-post')); ?></li> |
|
14 | + <li><?php echo wptexturize(esc_html__('Limit Posts per Session', 'auto-load-next-post')); ?></li> |
|
15 | + <li><?php echo wptexturize(esc_html__('Query Posts by Category and Tag', 'auto-load-next-post')); ?></li> |
|
16 | + <li><?php echo wptexturize(esc_html__('Exclude User Roles and Specific Users', 'auto-load-next-post')); ?></li> |
|
17 | + <li><?php echo wptexturize(esc_html__('Pre-Query Posts Ready to Load', 'auto-load-next-post')); ?></li> |
|
18 | + <li><?php echo wptexturize(esc_html__('Hide Comments and Show by Toggle Button', 'auto-load-next-post')); ?></li> |
|
19 | + <li><?php echo wptexturize(sprintf(esc_html__('Multilingual Support for %1$s and %2$s', 'auto-load-next-post'), 'WPML', 'Polylang')); ?></li> |
|
20 | + <li><?php echo wptexturize(esc_html__('Email Support', 'auto-load-next-post')); ?></li> |
|
21 | 21 | </ul> |
22 | 22 | |
23 | 23 | <p> |
24 | - <a href="<?php echo AUTO_LOAD_NEXT_POST_STORE_URL; ?>pro/?utm_source=plugin&utm_medium=link&utm_campaign=alnp-settings-page"><?php esc_html_e( 'Visit autoloadnextpost.com →', 'auto-load-next-post' ); ?></a> |
|
24 | + <a href="<?php echo AUTO_LOAD_NEXT_POST_STORE_URL; ?>pro/?utm_source=plugin&utm_medium=link&utm_campaign=alnp-settings-page"><?php esc_html_e('Visit autoloadnextpost.com →', 'auto-load-next-post'); ?></a> |
|
25 | 25 | </p> |
26 | 26 | |
27 | 27 | </div> |
@@ -29,33 +29,33 @@ discard block |
||
29 | 29 | <div class="block"> |
30 | 30 | <div class="inner-block"> |
31 | 31 | <form method="post" action="https://sebastiendumont.us1.list-manage.com/subscribe/post?u=48ead612ad85b23fe2239c6e3&id=79e97b5275" name="mc-embedded-subscribe-form" target="_blank" class="subscribe block"> |
32 | - <h2><?php esc_html_e( 'Sign up to pre-order first', 'auto-load-next-post' ); ?></h2> |
|
32 | + <h2><?php esc_html_e('Sign up to pre-order first', 'auto-load-next-post'); ?></h2> |
|
33 | 33 | |
34 | 34 | <p class="intro"> |
35 | - <?php echo wptexturize( esc_html__( 'Submit your name and email and be the first to know when you can pre-order Auto Load Next Post Pro and keep up to date with my developments plus a 10% discount.', 'auto-load-next-post' ) ); ?> |
|
35 | + <?php echo wptexturize(esc_html__('Submit your name and email and be the first to know when you can pre-order Auto Load Next Post Pro and keep up to date with my developments plus a 10% discount.', 'auto-load-next-post')); ?> |
|
36 | 36 | </p> |
37 | 37 | |
38 | 38 | <div class="field"> |
39 | - <input type="email" name="EMAIL" value="" placeholder="<?php esc_html_e( 'Your Email Address', 'auto-load-next-post' ); ?>"/> |
|
39 | + <input type="email" name="EMAIL" value="" placeholder="<?php esc_html_e('Your Email Address', 'auto-load-next-post'); ?>"/> |
|
40 | 40 | </div> |
41 | 41 | |
42 | 42 | <div class="field"> |
43 | - <input type="text" name="FNAME" value="" placeholder="<?php esc_html_e( 'First Name', 'auto-load-next-post' ); ?>"/> |
|
43 | + <input type="text" name="FNAME" value="" placeholder="<?php esc_html_e('First Name', 'auto-load-next-post'); ?>"/> |
|
44 | 44 | </div> |
45 | 45 | |
46 | 46 | <div class="field"> |
47 | - <input type="text" name="LNAME" value="" placeholder="<?php esc_html_e( 'Last Name', 'auto-load-next-post' ); ?>"/> |
|
47 | + <input type="text" name="LNAME" value="" placeholder="<?php esc_html_e('Last Name', 'auto-load-next-post'); ?>"/> |
|
48 | 48 | </div> |
49 | 49 | |
50 | 50 | <input type="hidden" name="group[35169][1]" value="1"> |
51 | 51 | |
52 | 52 | <div class="field submit-button"> |
53 | 53 | <div style="position: absolute; left: -9999px;" aria-hidden="true"><input type="text" name="b_48ead612ad85b23fe2239c6e3_79e97b5275" tabindex="-1" value=""></div> |
54 | - <input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button" value="<?php esc_html_e( 'Sign me up', 'auto-load-next-post' ); ?>"/> |
|
54 | + <input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button" value="<?php esc_html_e('Sign me up', 'auto-load-next-post'); ?>"/> |
|
55 | 55 | </div> |
56 | 56 | |
57 | 57 | <p class="promise"> |
58 | - <?php esc_html_e( 'I promise I will not use your email for anything else and you can unsubscribe with 1-click anytime.', 'auto-load-next-post' ); ?> |
|
58 | + <?php esc_html_e('I promise I will not use your email for anything else and you can unsubscribe with 1-click anytime.', 'auto-load-next-post'); ?> |
|
59 | 59 | </p> |
60 | 60 | |
61 | 61 | </form> |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | </div> |
64 | 64 | |
65 | 65 | <div class="block credits"> |
66 | - <h3><?php esc_html_e( 'Created & maintained by', 'auto-load-next-post' ); ?></h3> |
|
66 | + <h3><?php esc_html_e('Created & maintained by', 'auto-load-next-post'); ?></h3> |
|
67 | 67 | <div class="inner-block"> |
68 | 68 | <ul> |
69 | 69 | <li> |
@@ -11,24 +11,24 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | ?> |
18 | 18 | <div class="notice notice-info auto-load-next-post-notice"> |
19 | 19 | <div class="auto-load-next-post-notice-inner"> |
20 | 20 | <div class="auto-load-next-post-notice-icon"> |
21 | - <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__( 'Auto Load Next Post WordPress Plugin', 'auto-load-next-post' ); ?>" /> |
|
21 | + <img src="https://ps.w.org/auto-load-next-post/assets/icon-256x256.png" alt="<?php echo esc_attr__('Auto Load Next Post WordPress Plugin', 'auto-load-next-post'); ?>" /> |
|
22 | 22 | </div> |
23 | 23 | |
24 | 24 | <div class="auto-load-next-post-notice-content"> |
25 | - <h3><?php echo esc_html__( 'Thanks for trying out this beta!', 'auto-load-next-post' ); ?></h3> |
|
26 | - <p><?php printf( esc_html__( 'If you have any questions about the beta or if you have any feedback at all, let me know. Any little bit you\'re willing to share helps. You can %1$sjoin the Slack channel%2$s to provide feedback, discuss features to be added and integrations to support. Or you can just give feedback the old fashion way pressing the big button on the side.', 'auto-load-next-post' ), '<a href="' . esc_url( 'https://launchpass.com/autoloadnextpost' ) . '" target="_blank">', '</a>' ); ?></p> |
|
25 | + <h3><?php echo esc_html__('Thanks for trying out this beta!', 'auto-load-next-post'); ?></h3> |
|
26 | + <p><?php printf(esc_html__('If you have any questions about the beta or if you have any feedback at all, let me know. Any little bit you\'re willing to share helps. You can %1$sjoin the Slack channel%2$s to provide feedback, discuss features to be added and integrations to support. Or you can just give feedback the old fashion way pressing the big button on the side.', 'auto-load-next-post'), '<a href="'.esc_url('https://launchpass.com/autoloadnextpost').'" target="_blank">', '</a>'); ?></p> |
|
27 | 27 | </div> |
28 | 28 | |
29 | 29 | <div class="auto-load-next-post-send-feedback"> |
30 | - <?php printf( '<a href="%1$s" class="button button-primary auto-load-next-post-feedback-button" target="_blank">%2$s</a>', esc_url( AUTO_LOAD_NEXT_POST_STORE_URL . 'contact/' ), esc_html__( 'Give Feedback', 'auto-load-next-post' ) ); ?> |
|
31 | - <a href="<?php echo esc_url( add_query_arg( 'hide_auto_load_next_post_beta_notice', 'true' ) ); ?>" class="no-thanks"><?php echo esc_html__( 'Ask me again in 7 days', 'auto-load-next-post' ); ?></a> |
|
30 | + <?php printf('<a href="%1$s" class="button button-primary auto-load-next-post-feedback-button" target="_blank">%2$s</a>', esc_url(AUTO_LOAD_NEXT_POST_STORE_URL.'contact/'), esc_html__('Give Feedback', 'auto-load-next-post')); ?> |
|
31 | + <a href="<?php echo esc_url(add_query_arg('hide_auto_load_next_post_beta_notice', 'true')); ?>" class="no-thanks"><?php echo esc_html__('Ask me again in 7 days', 'auto-load-next-post'); ?></a> |
|
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | </div> |
@@ -11,10 +11,10 @@ |
||
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( __( 'It seems that not all of the required theme selectors have been set. These theme selectors are required in order for %1$s to work. %2$sHow to find my theme selectors?%3$s', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), '<a href="' . AUTO_LOAD_NEXT_POST_STORE_URL . 'documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-theme-selectors" target="_blank">', '</a>' ); ?></p> |
|
19 | + <p><?php echo sprintf(__('It seems that not all of the required theme selectors have been set. These theme selectors are required in order for %1$s to work. %2$sHow to find my theme selectors?%3$s', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post'), '<a href="'.AUTO_LOAD_NEXT_POST_STORE_URL.'documentation/find-theme-selectors/?utm_source=wpadmin&utm_campaign=plugin-settings-theme-selectors" target="_blank">', '</a>'); ?></p> |
|
20 | 20 | </div> |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | * @license GPL-2.0+ |
11 | 11 | */ |
12 | 12 | |
13 | -if ( ! defined('ABSPATH') ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; // Exit if accessed directly. |
15 | 15 | } |
16 | 16 | |
17 | -if ( ! class_exists( 'Auto_Load_Next_Post_Settings_Page' ) ) { |
|
17 | +if ( ! class_exists('Auto_Load_Next_Post_Settings_Page')) { |
|
18 | 18 | |
19 | 19 | abstract class Auto_Load_Next_Post_Settings_Page { |
20 | 20 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @access protected |
25 | 25 | * @var string $id |
26 | 26 | */ |
27 | - protected $id = ''; |
|
27 | + protected $id = ''; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Setting page label. |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | * @since 1.4.10 |
42 | 42 | */ |
43 | 43 | public function __construct() { |
44 | - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
45 | - add_action( 'auto_load_next_post_settings_' . $this->id, array( $this, 'output' ) ); |
|
46 | - add_action( 'auto_load_next_post_settings_save_' . $this->id, array( $this, 'save' ) ); |
|
44 | + add_filter('auto_load_next_post_settings_tabs_array', array($this, 'add_settings_page'), 20); |
|
45 | + add_action('auto_load_next_post_settings_'.$this->id, array($this, 'output')); |
|
46 | + add_action('auto_load_next_post_settings_save_'.$this->id, array($this, 'save')); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @param array $pages |
77 | 77 | * @return array $pages |
78 | 78 | */ |
79 | - public function add_settings_page( $pages ) { |
|
79 | + public function add_settings_page($pages) { |
|
80 | 80 | $pages[$this->id] = $this->label; |
81 | 81 | |
82 | 82 | return $pages; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param array $pages |
91 | 91 | * @return array $pages |
92 | 92 | */ |
93 | - public function add_menu_page( $pages ) { |
|
93 | + public function add_menu_page($pages) { |
|
94 | 94 | $pages[$this->id] = $this->label; |
95 | 95 | |
96 | 96 | return $pages; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | public function output() { |
117 | 117 | $settings = $this->get_settings(); |
118 | 118 | |
119 | - Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); |
|
119 | + Auto_Load_Next_Post_Admin_Settings::output_fields($settings); |
|
120 | 120 | } // END output() |
121 | 121 | |
122 | 122 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $settings = $this->get_settings(); |
133 | 133 | |
134 | - Auto_Load_Next_Post_Admin_Settings::save_fields( $settings, $current_tab ); |
|
134 | + Auto_Load_Next_Post_Admin_Settings::save_fields($settings, $current_tab); |
|
135 | 135 | } // END save() |
136 | 136 | |
137 | 137 | } // END class |