@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
19 | -if ( ! class_exists( 'Auto_Load_Next_Post_Integrations' ) ) { |
|
19 | +if ( ! class_exists('Auto_Load_Next_Post_Integrations')) { |
|
20 | 20 | |
21 | 21 | class Auto_Load_Next_Post_Integrations { |
22 | 22 | |
@@ -34,15 +34,15 @@ discard block |
||
34 | 34 | * @access public |
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | - do_action( 'auto_load_next_post_integrations_init' ); |
|
37 | + do_action('auto_load_next_post_integrations_init'); |
|
38 | 38 | |
39 | - $load_integrations = apply_filters( 'auto_load_next_post_integrations', array() ); |
|
39 | + $load_integrations = apply_filters('auto_load_next_post_integrations', array()); |
|
40 | 40 | |
41 | 41 | // Load integration classes. |
42 | - foreach ( $load_integrations as $integration ) { |
|
42 | + foreach ($load_integrations as $integration) { |
|
43 | 43 | $load_integration = new $integration(); |
44 | 44 | |
45 | - $this->integrations[ $load_integration->id ] = $load_integration; |
|
45 | + $this->integrations[$load_integration->id] = $load_integration; |
|
46 | 46 | } |
47 | 47 | } // END __construct() |
48 | 48 |
@@ -10,12 +10,12 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | ?> |
17 | 17 | <div class="block credits"> |
18 | - <h4><?php esc_html_e( 'Created & maintained by', 'auto-load-next-post' ); ?></h4> |
|
18 | + <h4><?php esc_html_e('Created & maintained by', 'auto-load-next-post'); ?></h4> |
|
19 | 19 | <ul> |
20 | 20 | <li> |
21 | 21 | <a href="https://profiles.wordpress.org/sebd86" target="_blank"> |
@@ -10,7 +10,7 @@ |
||
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 | ?> |
@@ -11,15 +11,15 @@ 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 | -$tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'auto_load_next_post_sections_' . $current_tab ) || has_action( 'auto_load_next_post_settings_' . $current_tab ) || has_action( 'auto_load_next_post_settings_tabs_' . $current_tab ); |
|
19 | -$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : ''; |
|
18 | +$tab_exists = isset($tabs[$current_tab]) || has_action('auto_load_next_post_sections_'.$current_tab) || has_action('auto_load_next_post_settings_'.$current_tab) || has_action('auto_load_next_post_settings_tabs_'.$current_tab); |
|
19 | +$current_tab_label = isset($tabs[$current_tab]) ? $tabs[$current_tab] : ''; |
|
20 | 20 | |
21 | -if ( ! $tab_exists ) { |
|
22 | - wp_safe_redirect( admin_url( 'options-general.php?page=auto-load-next-post-settings' ) ); |
|
21 | +if ( ! $tab_exists) { |
|
22 | + wp_safe_redirect(admin_url('options-general.php?page=auto-load-next-post-settings')); |
|
23 | 23 | exit; |
24 | 24 | } |
25 | 25 | ?> |
@@ -27,30 +27,30 @@ discard block |
||
27 | 27 | <form method="post" id="mainform" action="" enctype="multipart/form-data"> |
28 | 28 | <nav class="nav-tab-wrapper"> |
29 | 29 | <?php |
30 | - foreach ( $tabs as $slug => $label ) { |
|
31 | - echo '<a href="' . esc_html( admin_url( 'options-general.php?page=auto-load-next-post-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>'; |
|
30 | + foreach ($tabs as $slug => $label) { |
|
31 | + echo '<a href="'.esc_html(admin_url('options-general.php?page=auto-load-next-post-settings&tab='.esc_attr($slug))).'" class="nav-tab '.($current_tab === $slug ? 'nav-tab-active' : '').'">'.esc_html($label).'</a>'; |
|
32 | 32 | } |
33 | 33 | |
34 | - do_action( 'auto_load_next_post_settings_tabs' ); |
|
34 | + do_action('auto_load_next_post_settings_tabs'); |
|
35 | 35 | ?> |
36 | 36 | </nav> |
37 | - <h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1> |
|
37 | + <h1 class="screen-reader-text"><?php echo esc_html($current_tab_label); ?></h1> |
|
38 | 38 | <?php |
39 | - do_action( 'auto_load_next_post_sections_' . $current_tab ); |
|
39 | + do_action('auto_load_next_post_sections_'.$current_tab); |
|
40 | 40 | |
41 | 41 | self::show_messages(); |
42 | 42 | |
43 | - do_action( 'auto_load_next_post_settings_' . $current_tab ); |
|
43 | + do_action('auto_load_next_post_settings_'.$current_tab); |
|
44 | 44 | ?> |
45 | 45 | <p class="submit"> |
46 | - <?php submit_button( esc_attr__( 'Save Changes', 'auto-load-next-post' ), 'button-primary', esc_attr__( 'Save Changes', 'auto-load-next-post' ), false, array( 'id' => 'save' ) ); ?> |
|
47 | - <?php wp_nonce_field( 'auto-load-next-post-settings' ); ?> |
|
46 | + <?php submit_button(esc_attr__('Save Changes', 'auto-load-next-post'), 'button-primary', esc_attr__('Save Changes', 'auto-load-next-post'), false, array('id' => 'save')); ?> |
|
47 | + <?php wp_nonce_field('auto-load-next-post-settings'); ?> |
|
48 | 48 | </p> |
49 | 49 | </form> |
50 | 50 | |
51 | 51 | <div class="alnp-sidebar"> |
52 | 52 | <?php |
53 | - do_action( 'auto_load_next_post_sidebar', $current_tab ); |
|
53 | + do_action('auto_load_next_post_sidebar', $current_tab); |
|
54 | 54 | ?> |
55 | 55 | </div> |
56 | 56 | </div> |
@@ -11,61 +11,61 @@ |
||
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="alnp-upgrade-details"> |
19 | - <h1><?php esc_html_e( 'Pro Coming Soon', 'auto-load-next-post' ); ?></h1> |
|
19 | + <h1><?php esc_html_e('Pro Coming Soon', 'auto-load-next-post'); ?></h1> |
|
20 | 20 | |
21 | 21 | <ul> |
22 | - <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> |
|
23 | - <li><?php echo wptexturize( esc_html__( 'Page and Media Attachment Support', 'auto-load-next-post' ) ); ?></li> |
|
24 | - <li><?php echo wptexturize( esc_html__( 'Custom Post Type Support', 'auto-load-next-post' ) ); ?></li> |
|
25 | - <li><?php echo wptexturize( esc_html__( 'Paginated Posts Supported', 'auto-load-next-post' ) ); ?></li> |
|
26 | - <li><?php echo wptexturize( esc_html__( 'Exclude Post Formats', 'auto-load-next-post' ) ); ?></li> |
|
27 | - <li><?php echo wptexturize( esc_html__( 'Limit Posts per Session', 'auto-load-next-post' ) ); ?></li> |
|
28 | - <li><?php echo wptexturize( esc_html__( 'Query Posts by Category and Tag', 'auto-load-next-post' ) ); ?></li> |
|
29 | - <li><?php echo wptexturize( esc_html__( 'Exclude User Roles and Specific Users', 'auto-load-next-post' ) ); ?></li> |
|
30 | - <li><?php echo wptexturize( esc_html__( 'Pre-Query Posts Ready to Load', 'auto-load-next-post' ) ); ?></li> |
|
31 | - <li><?php echo wptexturize( esc_html__( 'Hide Comments and Show by Toggle Button', 'auto-load-next-post' ) ); ?></li> |
|
32 | - <li><?php echo wptexturize( sprintf( esc_html__( 'Multilingual Support for %1$s and %2$s', 'auto-load-next-post' ), 'WPML', 'Polylang' ) ); ?></li> |
|
33 | - <li><?php echo wptexturize( esc_html__( 'Email Support', 'auto-load-next-post' ) ); ?></li> |
|
22 | + <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> |
|
23 | + <li><?php echo wptexturize(esc_html__('Page and Media Attachment Support', 'auto-load-next-post')); ?></li> |
|
24 | + <li><?php echo wptexturize(esc_html__('Custom Post Type Support', 'auto-load-next-post')); ?></li> |
|
25 | + <li><?php echo wptexturize(esc_html__('Paginated Posts Supported', 'auto-load-next-post')); ?></li> |
|
26 | + <li><?php echo wptexturize(esc_html__('Exclude Post Formats', 'auto-load-next-post')); ?></li> |
|
27 | + <li><?php echo wptexturize(esc_html__('Limit Posts per Session', 'auto-load-next-post')); ?></li> |
|
28 | + <li><?php echo wptexturize(esc_html__('Query Posts by Category and Tag', 'auto-load-next-post')); ?></li> |
|
29 | + <li><?php echo wptexturize(esc_html__('Exclude User Roles and Specific Users', 'auto-load-next-post')); ?></li> |
|
30 | + <li><?php echo wptexturize(esc_html__('Pre-Query Posts Ready to Load', 'auto-load-next-post')); ?></li> |
|
31 | + <li><?php echo wptexturize(esc_html__('Hide Comments and Show by Toggle Button', 'auto-load-next-post')); ?></li> |
|
32 | + <li><?php echo wptexturize(sprintf(esc_html__('Multilingual Support for %1$s and %2$s', 'auto-load-next-post'), 'WPML', 'Polylang')); ?></li> |
|
33 | + <li><?php echo wptexturize(esc_html__('Email Support', 'auto-load-next-post')); ?></li> |
|
34 | 34 | </ul> |
35 | 35 | |
36 | 36 | <p> |
37 | - <a href="https://autoloadnextpost.com/pro/?utm_source=plugin&utm_medium=link&utm_campaign=alnp-settings-page"><?php esc_html_e( 'Visit autoloadnextpost.com →', 'auto-load-next-post' ); ?></a> |
|
37 | + <a href="https://autoloadnextpost.com/pro/?utm_source=plugin&utm_medium=link&utm_campaign=alnp-settings-page"><?php esc_html_e('Visit autoloadnextpost.com →', 'auto-load-next-post'); ?></a> |
|
38 | 38 | </p> |
39 | 39 | |
40 | 40 | </div> |
41 | 41 | |
42 | 42 | <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"> |
43 | - <h2><?php esc_html_e( 'Sign up to pre-order first', 'auto-load-next-post' ); ?></h2> |
|
43 | + <h2><?php esc_html_e('Sign up to pre-order first', 'auto-load-next-post'); ?></h2> |
|
44 | 44 | |
45 | 45 | <p class="intro"> |
46 | - <?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' ) ); ?> |
|
46 | + <?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')); ?> |
|
47 | 47 | </p> |
48 | 48 | |
49 | 49 | <div class="field"> |
50 | - <input type="email" name="EMAIL" value="" placeholder="<?php esc_html_e( 'Your Email Address', 'auto-load-next-post' ); ?>"/> |
|
50 | + <input type="email" name="EMAIL" value="" placeholder="<?php esc_html_e('Your Email Address', 'auto-load-next-post'); ?>"/> |
|
51 | 51 | </div> |
52 | 52 | |
53 | 53 | <div class="field"> |
54 | - <input type="text" name="FNAME" value="" placeholder="<?php esc_html_e( 'First Name', 'auto-load-next-post' ); ?>"/> |
|
54 | + <input type="text" name="FNAME" value="" placeholder="<?php esc_html_e('First Name', 'auto-load-next-post'); ?>"/> |
|
55 | 55 | </div> |
56 | 56 | |
57 | 57 | <div class="field"> |
58 | - <input type="text" name="LNAME" value="" placeholder="<?php esc_html_e( 'Last Name', 'auto-load-next-post' ); ?>"/> |
|
58 | + <input type="text" name="LNAME" value="" placeholder="<?php esc_html_e('Last Name', 'auto-load-next-post'); ?>"/> |
|
59 | 59 | </div> |
60 | 60 | |
61 | 61 | <input type="hidden" name="group[35169][1]" value="1"> |
62 | 62 | |
63 | 63 | <div class="field submit-button"> |
64 | 64 | <div style="position: absolute; left: -9999px;" aria-hidden="true"><input type="text" name="b_48ead612ad85b23fe2239c6e3_79e97b5275" tabindex="-1" value=""></div> |
65 | - <input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button" value="<?php esc_html_e( 'Sign me up', 'auto-load-next-post' ); ?>"/> |
|
65 | + <input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button" value="<?php esc_html_e('Sign me up', 'auto-load-next-post'); ?>"/> |
|
66 | 66 | </div> |
67 | 67 | |
68 | 68 | <p class="promise"> |
69 | - <?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' ); ?> |
|
69 | + <?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'); ?> |
|
70 | 70 | </p> |
71 | 71 | </form> |
@@ -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_Settings_Misc_Tab' ) ) { |
|
18 | +if ( ! class_exists('Auto_Load_Next_Post_Settings_Misc_Tab')) { |
|
19 | 19 | |
20 | 20 | class Auto_Load_Next_Post_Settings_Misc_Tab extends Auto_Load_Next_Post_Settings_Page { |
21 | 21 | |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function __construct() { |
32 | 32 | $this->id = 'misc'; |
33 | - $this->label = esc_html__( 'Misc', 'auto-load-next-post' ); |
|
33 | + $this->label = esc_html__('Misc', 'auto-load-next-post'); |
|
34 | 34 | |
35 | 35 | parent::__construct(); |
36 | 36 | |
37 | - add_filter( 'auto_load_next_post_misc_settings', array( __CLASS__, 'lock_js_in_footer' ), 0, 1 ); |
|
38 | - add_action( 'auto_load_next_post_sections_misc', array( __CLASS__, 'no_comment_selector_set' ), 10 ); |
|
37 | + add_filter('auto_load_next_post_misc_settings', array(__CLASS__, 'lock_js_in_footer'), 0, 1); |
|
38 | + add_action('auto_load_next_post_sections_misc', array(__CLASS__, 'no_comment_selector_set'), 10); |
|
39 | 39 | } // END __construct() |
40 | 40 | |
41 | 41 | /** |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | * @since 1.5.0 |
47 | 47 | */ |
48 | 48 | public static function no_comment_selector_set() { |
49 | - $comments_container = get_option( 'auto_load_next_post_comments_container' ); |
|
50 | - $remove_comments = get_option( 'auto_load_next_post_remove_comments' ); |
|
49 | + $comments_container = get_option('auto_load_next_post_comments_container'); |
|
50 | + $remove_comments = get_option('auto_load_next_post_remove_comments'); |
|
51 | 51 | |
52 | - if ( empty( $comments_container ) && ! empty( $remove_comments ) ) { |
|
53 | - include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-no-comment-selector.php' ); |
|
52 | + if (empty($comments_container) && ! empty($remove_comments)) { |
|
53 | + include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-no-comment-selector.php'); |
|
54 | 54 | } |
55 | 55 | } // END no_comment_selector_set() |
56 | 56 | |
@@ -66,19 +66,19 @@ discard block |
||
66 | 66 | * @param array $settings |
67 | 67 | * @return array $settings |
68 | 68 | */ |
69 | - public static function lock_js_in_footer( $settings ) { |
|
70 | - $js_locked_in_footer = get_option( 'auto_load_next_post_lock_js_in_footer' ); |
|
69 | + public static function lock_js_in_footer($settings) { |
|
70 | + $js_locked_in_footer = get_option('auto_load_next_post_lock_js_in_footer'); |
|
71 | 71 | |
72 | - if ( !empty( $js_locked_in_footer ) && $js_locked_in_footer == 'yes' ) { |
|
72 | + if ( ! empty($js_locked_in_footer) && $js_locked_in_footer == 'yes') { |
|
73 | 73 | // Setting key to look for. |
74 | 74 | $key = 'load_js_in_footer'; |
75 | 75 | |
76 | 76 | // Find the setting. |
77 | - $find_setting = array_search( $key, $settings ); |
|
77 | + $find_setting = array_search($key, $settings); |
|
78 | 78 | |
79 | 79 | // Does the setting exist? |
80 | - if ( is_bool( $find_setting ) === true ) { |
|
81 | - unset( $settings[$key] ); |
|
80 | + if (is_bool($find_setting) === true) { |
|
81 | + unset($settings[$key]); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -99,45 +99,45 @@ discard block |
||
99 | 99 | 'title' => array( |
100 | 100 | 'title' => $this->label, |
101 | 101 | 'type' => 'title', |
102 | - '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' ) ), |
|
102 | + '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')), |
|
103 | 103 | 'id' => 'misc_options' |
104 | 104 | ), |
105 | 105 | |
106 | 106 | 'remove_comments' => array( |
107 | - 'title' => esc_html__( 'Remove Comments', 'auto-load-next-post' ), |
|
108 | - 'desc' => esc_html__( 'Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post' ), |
|
107 | + 'title' => esc_html__('Remove Comments', 'auto-load-next-post'), |
|
108 | + 'desc' => esc_html__('Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post'), |
|
109 | 109 | 'id' => 'auto_load_next_post_remove_comments', |
110 | 110 | 'default' => 'yes', |
111 | 111 | 'type' => 'checkbox' |
112 | 112 | ), |
113 | 113 | |
114 | 114 | 'google_analytics' => array( |
115 | - 'title' => esc_html__( 'Update Google Analytics', 'auto-load-next-post' ), |
|
116 | - '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' ), |
|
115 | + 'title' => esc_html__('Update Google Analytics', 'auto-load-next-post'), |
|
116 | + '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'), |
|
117 | 117 | 'id' => 'auto_load_next_post_google_analytics', |
118 | 118 | 'default' => 'no', |
119 | 119 | 'type' => 'checkbox' |
120 | 120 | ), |
121 | 121 | |
122 | 122 | 'load_js_in_footer' => array( |
123 | - 'title' => esc_html__( 'JavaScript in Footer?', 'auto-load-next-post' ), |
|
124 | - 'desc' => esc_html__( 'Enable to load Auto Load Next Post in the footer instead of the header. Can be useful to optimize your site or if the current theme requires it.', 'auto-load-next-post' ), |
|
123 | + 'title' => esc_html__('JavaScript in Footer?', 'auto-load-next-post'), |
|
124 | + 'desc' => esc_html__('Enable to load Auto Load Next Post in the footer instead of the header. Can be useful to optimize your site or if the current theme requires it.', 'auto-load-next-post'), |
|
125 | 125 | 'id' => 'auto_load_next_post_load_js_in_footer', |
126 | 126 | 'default' => 'no', |
127 | 127 | 'type' => 'checkbox' |
128 | 128 | ), |
129 | 129 | |
130 | 130 | 'reset_data' => array( |
131 | - 'title' => esc_html__( 'Reset all data?', 'auto-load-next-post' ), |
|
132 | - 'desc' => esc_html__( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ), |
|
131 | + 'title' => esc_html__('Reset all data?', 'auto-load-next-post'), |
|
132 | + 'desc' => esc_html__('Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post'), |
|
133 | 133 | 'id' => 'auto_load_next_post_reset_data', |
134 | 134 | 'default' => 'no', |
135 | 135 | 'type' => 'reset_data' |
136 | 136 | ), |
137 | 137 | |
138 | 138 | 'uninstall' => array( |
139 | - 'title' => esc_html__( 'Remove all data on uninstall?', 'auto-load-next-post' ), |
|
140 | - 'desc' => esc_html__( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ), |
|
139 | + 'title' => esc_html__('Remove all data on uninstall?', 'auto-load-next-post'), |
|
140 | + 'desc' => esc_html__('If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post'), |
|
141 | 141 | 'id' => 'auto_load_next_post_uninstall_data', |
142 | 142 | 'default' => 'no', |
143 | 143 | 'type' => 'checkbox' |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | * @since 1.5.0 |
158 | 158 | * @param mixed $settings |
159 | 159 | */ |
160 | - public function customize_button( $settings ) { |
|
160 | + public function customize_button($settings) { |
|
161 | 161 | ?> |
162 | 162 | <tr valign="top"> |
163 | - <th scope="row" class="titledesc"><?php echo $settings['title'];?></th> |
|
164 | - <td class="forminp forminp-<?php echo sanitize_title( $settings['type'] ) ?>"> |
|
165 | - <a href="<?php echo $settings['link']; ?>" class="button-secondary <?php echo esc_attr( $settings['class'] ); ?>"> |
|
163 | + <th scope="row" class="titledesc"><?php echo $settings['title']; ?></th> |
|
164 | + <td class="forminp forminp-<?php echo sanitize_title($settings['type']) ?>"> |
|
165 | + <a href="<?php echo $settings['link']; ?>" class="button-secondary <?php echo esc_attr($settings['class']); ?>"> |
|
166 | 166 | <?php echo $settings['button_text']; ?> |
167 | 167 | </a> |
168 | - <span class="description"><?php echo $settings['desc'];?></span> |
|
168 | + <span class="description"><?php echo $settings['desc']; ?></span> |
|
169 | 169 | </td> |
170 | 170 | </tr> |
171 | 171 | <?php |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function output() { |
183 | 183 | $settings = $this->get_settings(); |
184 | 184 | |
185 | - Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); |
|
185 | + Auto_Load_Next_Post_Admin_Settings::output_fields($settings); |
|
186 | 186 | } // END output() |
187 | 187 | |
188 | 188 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | public function save() { |
195 | 195 | $settings = $this->get_settings(); |
196 | 196 | |
197 | - Auto_Load_Next_Post_Admin_Settings::save_fields( $settings ); |
|
197 | + Auto_Load_Next_Post_Admin_Settings::save_fields($settings); |
|
198 | 198 | } // END save() |
199 | 199 | |
200 | 200 | } // END class |
@@ -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 | |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | * @version 1.6.0 |
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
46 | - add_action( 'auto_load_next_post_settings_' . $this->id, array( $this, 'need_help' ), 0 ); |
|
47 | - add_action( 'auto_load_next_post_sections_' . $this->id, array( $this, 'output_sections' ) ); |
|
48 | - add_action( 'auto_load_next_post_settings_' . $this->id, array( $this, 'output' ), 10 ); |
|
49 | - add_action( 'auto_load_next_post_settings_save_' . $this->id, array( $this, 'save' ) ); |
|
45 | + add_filter('auto_load_next_post_settings_tabs_array', array($this, 'add_settings_page'), 20); |
|
46 | + add_action('auto_load_next_post_settings_'.$this->id, array($this, 'need_help'), 0); |
|
47 | + add_action('auto_load_next_post_sections_'.$this->id, array($this, 'output_sections')); |
|
48 | + add_action('auto_load_next_post_settings_'.$this->id, array($this, 'output'), 10); |
|
49 | + add_action('auto_load_next_post_settings_save_'.$this->id, array($this, 'save')); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @param array $pages |
80 | 80 | * @return array $pages |
81 | 81 | */ |
82 | - public function add_settings_page( $pages ) { |
|
82 | + public function add_settings_page($pages) { |
|
83 | 83 | $pages[$this->id] = $this->label; |
84 | 84 | |
85 | 85 | return $pages; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param array $pages |
94 | 94 | * @return array $pages |
95 | 95 | */ |
96 | - public function add_menu_page( $pages ) { |
|
96 | + public function add_menu_page($pages) { |
|
97 | 97 | $pages[$this->id] = $this->label; |
98 | 98 | |
99 | 99 | return $pages; |
@@ -133,16 +133,16 @@ discard block |
||
133 | 133 | |
134 | 134 | $sections = $this->get_sections(); |
135 | 135 | |
136 | - if ( empty( $sections ) || 1 === sizeof( $sections ) ) { |
|
136 | + if (empty($sections) || 1 === sizeof($sections)) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
140 | 140 | echo '<ul class="subsubsub">'; |
141 | 141 | |
142 | - $array_keys = array_keys( $sections ); |
|
142 | + $array_keys = array_keys($sections); |
|
143 | 143 | |
144 | - foreach ( $sections as $id => $label ) { |
|
145 | - echo '<li><a href="' . admin_url( 'options-general.php?page=auto-load-next-post-settings&tab=' . $this->id . '§ion=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>'; |
|
144 | + foreach ($sections as $id => $label) { |
|
145 | + echo '<li><a href="'.admin_url('options-general.php?page=auto-load-next-post-settings&tab='.$this->id.'§ion='.sanitize_title($id)).'" class="'.($current_section == $id ? 'current' : '').'">'.$label.'</a> '.(end($array_keys) == $id ? '' : '|').' </li>'; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | echo '</ul><br class="clear" />'; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function output() { |
158 | 158 | $settings = $this->get_settings(); |
159 | 159 | |
160 | - Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); |
|
160 | + Auto_Load_Next_Post_Admin_Settings::output_fields($settings); |
|
161 | 161 | } // END output() |
162 | 162 | |
163 | 163 | /** |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | |
174 | 174 | $settings = $this->get_settings(); |
175 | 175 | |
176 | - Auto_Load_Next_Post_Admin_Settings::save_fields( $settings ); |
|
176 | + Auto_Load_Next_Post_Admin_Settings::save_fields($settings); |
|
177 | 177 | |
178 | - if ( $current_section ) { |
|
179 | - do_action( 'auto_load_next_post_update_options_' . $this->id . '_' . $current_section ); |
|
178 | + if ($current_section) { |
|
179 | + do_action('auto_load_next_post_update_options_'.$this->id.'_'.$current_section); |
|
180 | 180 | } |
181 | 181 | } // END save() |
182 | 182 | |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | global $current_tab; |
195 | 195 | |
196 | 196 | // If theme is already supported then don't show help button for theme selectors. |
197 | - if ( is_alnp_supported() && $current_tab == 'theme-selectors' ) { |
|
197 | + if (is_alnp_supported() && $current_tab == 'theme-selectors') { |
|
198 | 198 | return; |
199 | 199 | } |
200 | 200 | |
201 | - echo '<a href="#" class="need-help trigger-help" data-tab="' . $current_tab . '"><span class="sonar-dot"></span> ' . esc_html( 'Need Help?', 'auto-load-next-post' ) . '</a>'; |
|
201 | + echo '<a href="#" class="need-help trigger-help" data-tab="'.$current_tab.'"><span class="sonar-dot"></span> '.esc_html('Need Help?', 'auto-load-next-post').'</a>'; |
|
202 | 202 | } // END need_help() |
203 | 203 | |
204 | 204 | } // END class |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
19 | -if ( ! class_exists( 'Auto_Load_Next_Post_Extensions' ) ) { |
|
19 | +if ( ! class_exists('Auto_Load_Next_Post_Extensions')) { |
|
20 | 20 | |
21 | 21 | class Auto_Load_Next_Post_Extensions { |
22 | 22 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | 37 | $this->id = 'extensions'; |
38 | - $this->label = esc_html__( 'Extensions', 'auto-load-next-post' ); |
|
38 | + $this->label = esc_html__('Extensions', 'auto-load-next-post'); |
|
39 | 39 | |
40 | 40 | // Below are extensions hosted on WordPress.org |
41 | 41 | self::$extensions = array( |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | ), |
45 | 45 | ); |
46 | 46 | |
47 | - include_once( AUTO_LOAD_NEXT_POST_FILE_PATH . '/vendor/connekt-plugin-installer/class-connekt-plugin-installer.php'); // Plugin Installer |
|
47 | + include_once(AUTO_LOAD_NEXT_POST_FILE_PATH.'/vendor/connekt-plugin-installer/class-connekt-plugin-installer.php'); // Plugin Installer |
|
48 | 48 | |
49 | - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_extensions_page' ), 99 ); |
|
50 | - add_action( 'auto_load_next_post_settings_end', array( $this, 'output' ), 10, 2 ); |
|
49 | + add_filter('auto_load_next_post_settings_tabs_array', array($this, 'add_extensions_page'), 99); |
|
50 | + add_action('auto_load_next_post_settings_end', array($this, 'output'), 10, 2); |
|
51 | 51 | } // END __construct() |
52 | 52 | |
53 | 53 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param array $pages |
58 | 58 | * @return array $pages |
59 | 59 | */ |
60 | - public function add_extensions_page( $pages ) { |
|
60 | + public function add_extensions_page($pages) { |
|
61 | 61 | $pages[$this->id] = $this->label; |
62 | 62 | |
63 | 63 | return $pages; |
@@ -70,30 +70,30 @@ discard block |
||
70 | 70 | * @param string $current_tab |
71 | 71 | * @param array $tabs |
72 | 72 | */ |
73 | - public function output( $current_tab, $tabs ) { |
|
74 | - if ( $current_tab !== 'extensions' ) { |
|
73 | + public function output($current_tab, $tabs) { |
|
74 | + if ($current_tab !== 'extensions') { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
78 | - $tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'auto_load_next_post_sections_' . $current_tab ) || has_action( 'auto_load_next_post_settings_' . $current_tab ) || has_action( 'auto_load_next_post_settings_tabs_' . $current_tab ); |
|
79 | - $current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : ''; |
|
78 | + $tab_exists = isset($tabs[$current_tab]) || has_action('auto_load_next_post_sections_'.$current_tab) || has_action('auto_load_next_post_settings_'.$current_tab) || has_action('auto_load_next_post_settings_tabs_'.$current_tab); |
|
79 | + $current_tab_label = isset($tabs[$current_tab]) ? $tabs[$current_tab] : ''; |
|
80 | 80 | ?> |
81 | 81 | <div class="wrap auto-load-next-post"> |
82 | 82 | <nav class="nav-tab-wrapper"> |
83 | 83 | <?php |
84 | - foreach ( $tabs as $slug => $label ) { |
|
85 | - echo '<a href="' . esc_html( admin_url( 'options-general.php?page=auto-load-next-post-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>'; |
|
84 | + foreach ($tabs as $slug => $label) { |
|
85 | + echo '<a href="'.esc_html(admin_url('options-general.php?page=auto-load-next-post-settings&tab='.esc_attr($slug))).'" class="nav-tab '.($current_tab === $slug ? 'nav-tab-active' : '').'">'.esc_html($label).'</a>'; |
|
86 | 86 | } |
87 | 87 | |
88 | - do_action( 'auto_load_next_post_settings_tabs' ); |
|
88 | + do_action('auto_load_next_post_settings_tabs'); |
|
89 | 89 | ?> |
90 | 90 | </nav> |
91 | - <h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1> |
|
91 | + <h1 class="screen-reader-text"><?php echo esc_html($current_tab_label); ?></h1> |
|
92 | 92 | </div> |
93 | 93 | |
94 | 94 | <?php |
95 | - if ( class_exists( 'Connekt_Plugin_Installer' ) ) { |
|
96 | - Connekt_Plugin_Installer::init( self::$extensions ); |
|
95 | + if (class_exists('Connekt_Plugin_Installer')) { |
|
96 | + Connekt_Plugin_Installer::init(self::$extensions); |
|
97 | 97 | } |
98 | 98 | } // END output() |
99 | 99 |
@@ -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,28 +28,28 @@ 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 | |
49 | 49 | // Add sidebar |
50 | - add_action( 'auto_load_next_post_sidebar', array( $this, 'sidebar_top' ), 0 ); |
|
51 | - add_action( 'auto_load_next_post_sidebar', array( $this, 'upgrade_details' ), 1 ); |
|
52 | - add_action( 'auto_load_next_post_sidebar', array( $this, 'sidebar_bottom' ), 999 ); |
|
50 | + add_action('auto_load_next_post_sidebar', array($this, 'sidebar_top'), 0); |
|
51 | + add_action('auto_load_next_post_sidebar', array($this, 'upgrade_details'), 1); |
|
52 | + add_action('auto_load_next_post_sidebar', array($this, 'sidebar_bottom'), 999); |
|
53 | 53 | } // END __construct() |
54 | 54 | |
55 | 55 | /** |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function includes() { |
62 | 62 | // Classes we only need if the ajax is not-ajax |
63 | - if ( ! auto_load_next_post_is_ajax() ) { |
|
64 | - include( dirname( __FILE__ ) . '/class-alnp-admin-notices.php' ); // Plugin Notices |
|
65 | - include( dirname( __FILE__ ) . '/class-alnp-admin-help.php' ); // Plugin Help Tab |
|
63 | + if ( ! auto_load_next_post_is_ajax()) { |
|
64 | + include(dirname(__FILE__).'/class-alnp-admin-notices.php'); // Plugin Notices |
|
65 | + include(dirname(__FILE__).'/class-alnp-admin-help.php'); // Plugin Help Tab |
|
66 | 66 | } |
67 | 67 | |
68 | - include_once( dirname( __FILE__ ) . '/class-alnp-extensions.php'); // Extensions. |
|
68 | + include_once(dirname(__FILE__).'/class-alnp-extensions.php'); // Extensions. |
|
69 | 69 | } // END includes() |
70 | 70 | |
71 | 71 | /** |
@@ -81,16 +81,16 @@ discard block |
||
81 | 81 | $screen = get_current_screen(); |
82 | 82 | $screen_id = $screen ? $screen->id : ''; |
83 | 83 | |
84 | - 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' ); |
|
84 | + 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'); |
|
85 | 85 | |
86 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
86 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
87 | 87 | // Select2 - Make sure that we remove other registered Select2 to prevent styling issues. |
88 | - if ( wp_script_is( 'select2', 'registered' ) ) { |
|
89 | - wp_dequeue_style( 'select2' ); |
|
90 | - wp_deregister_style( 'select2' ); |
|
88 | + if (wp_script_is('select2', 'registered')) { |
|
89 | + wp_dequeue_style('select2'); |
|
90 | + wp_deregister_style('select2'); |
|
91 | 91 | } |
92 | 92 | |
93 | - Auto_Load_Next_Post::load_file( 'select2', '/assets/css/libs/select2' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' ); |
|
93 | + Auto_Load_Next_Post::load_file('select2', '/assets/css/libs/select2'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css'); |
|
94 | 94 | } |
95 | 95 | } // END admin_styles() |
96 | 96 | |
@@ -105,24 +105,24 @@ discard block |
||
105 | 105 | $screen = get_current_screen(); |
106 | 106 | $screen_id = $screen ? $screen->id : ''; |
107 | 107 | |
108 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
108 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
109 | 109 | // Select2 - Make sure that we remove other registered Select2 to prevent plugin conflict issues. |
110 | - if ( wp_script_is( 'select2', 'registered' ) ) { |
|
111 | - wp_dequeue_script( 'select2' ); |
|
112 | - wp_deregister_script( 'select2' ); |
|
110 | + if (wp_script_is('select2', 'registered')) { |
|
111 | + wp_dequeue_script('select2'); |
|
112 | + wp_deregister_script('select2'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // Load Select2 |
116 | - 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 ); |
|
116 | + 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); |
|
117 | 117 | |
118 | 118 | // Load plugin settings. |
119 | - 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 ); |
|
119 | + 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); |
|
120 | 120 | |
121 | 121 | // Variables for Admin JavaScripts |
122 | - wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG . '_admin', 'alnp_settings_params', array( |
|
122 | + wp_localize_script(AUTO_LOAD_NEXT_POST_SLUG.'_admin', 'alnp_settings_params', array( |
|
123 | 123 | 'is_rtl' => is_rtl() ? 'rtl' : 'ltr', |
124 | - 'i18n_nav_warning' => esc_html__( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), |
|
125 | - ) ); |
|
124 | + 'i18n_nav_warning' => esc_html__('The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post'), |
|
125 | + )); |
|
126 | 126 | } |
127 | 127 | } // END admin_scripts() |
128 | 128 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | * @static |
135 | 135 | */ |
136 | 136 | public static function add_privacy_policy_guide_content() { |
137 | - if ( function_exists( 'wp_add_privacy_policy_content' ) ) { |
|
138 | - wp_add_privacy_policy_content( esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), self::get_privacy_policy_guide_message() ); |
|
137 | + if (function_exists('wp_add_privacy_policy_content')) { |
|
138 | + wp_add_privacy_policy_content(esc_html__('Auto Load Next Post', 'auto-load-next-post'), self::get_privacy_policy_guide_message()); |
|
139 | 139 | } |
140 | 140 | } // END add_privacy_policy_guide_content() |
141 | 141 | |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | protected static function get_privacy_policy_guide_message() { |
151 | 151 | $content = ' |
152 | 152 | <div contenteditable="false">' . |
153 | - '<p class="wp-policy-help">' . |
|
154 | - 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' ) ) . |
|
155 | - '</p>' . |
|
153 | + '<p class="wp-policy-help">'. |
|
154 | + 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')). |
|
155 | + '</p>'. |
|
156 | 156 | '</div>'; |
157 | 157 | |
158 | 158 | return $content; |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function admin_menu() { |
169 | 169 | $settings_page = add_options_page( |
170 | - sprintf( __( '%s Settings', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ), |
|
171 | - esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ), |
|
170 | + sprintf(__('%s Settings', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')), |
|
171 | + esc_html__('Auto Load Next Post', 'auto-load-next-post'), |
|
172 | 172 | 'manage_options', |
173 | 173 | 'auto-load-next-post-settings', |
174 | - array( $this, 'settings_page' ) |
|
174 | + array($this, 'settings_page') |
|
175 | 175 | ); |
176 | 176 | |
177 | - add_action( 'load-' . $settings_page, array( $this, 'settings_page_init' ) ); |
|
177 | + add_action('load-'.$settings_page, array($this, 'settings_page_init')); |
|
178 | 178 | } // END admin_menu() |
179 | 179 | |
180 | 180 | /** |
@@ -189,29 +189,29 @@ discard block |
||
189 | 189 | global $current_tab, $current_section; |
190 | 190 | |
191 | 191 | // Include settings pages. |
192 | - include_once( dirname( __FILE__ ) . '/class-alnp-admin-settings.php' ); |
|
192 | + include_once(dirname(__FILE__).'/class-alnp-admin-settings.php'); |
|
193 | 193 | |
194 | 194 | Auto_Load_Next_Post_Admin_Settings::get_settings_pages(); |
195 | 195 | |
196 | 196 | // Get current tab/section. |
197 | - $current_tab = empty( $_GET['tab'] ) ? 'theme-selectors' : sanitize_title( wp_unslash( $_GET['tab'] ) ); |
|
198 | - $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( wp_unslash( $_REQUEST['section'] ) ); |
|
197 | + $current_tab = empty($_GET['tab']) ? 'theme-selectors' : sanitize_title(wp_unslash($_GET['tab'])); |
|
198 | + $current_section = empty($_REQUEST['section']) ? '' : sanitize_title(wp_unslash($_REQUEST['section'])); |
|
199 | 199 | |
200 | 200 | // Save settings if data has been posted. |
201 | - 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 ) ) ) { |
|
201 | + 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))) { |
|
202 | 202 | Auto_Load_Next_Post_Admin_Settings::save(); |
203 | 203 | } |
204 | 204 | |
205 | 205 | // Add any posted messages. |
206 | - if ( ! empty( $_GET['auto_load_next_post_error'] ) ) { |
|
207 | - Auto_Load_Next_Post_Admin_Settings::add_error( wp_kses_post( wp_unslash( $_GET['auto_load_next_post_error'] ) ) ); |
|
206 | + if ( ! empty($_GET['auto_load_next_post_error'])) { |
|
207 | + Auto_Load_Next_Post_Admin_Settings::add_error(wp_kses_post(wp_unslash($_GET['auto_load_next_post_error']))); |
|
208 | 208 | } |
209 | 209 | |
210 | - if ( ! empty( $_GET['auto_load_next_post_message'] ) ) { |
|
211 | - Auto_Load_Next_Post_Admin_Settings::add_message( wp_kses_post( wp_unslash( $_GET['auto_load_next_post_message'] ) ) ); |
|
210 | + if ( ! empty($_GET['auto_load_next_post_message'])) { |
|
211 | + Auto_Load_Next_Post_Admin_Settings::add_message(wp_kses_post(wp_unslash($_GET['auto_load_next_post_message']))); |
|
212 | 212 | } |
213 | 213 | |
214 | - do_action( 'auto_load_next_post_settings_page_init' ); |
|
214 | + do_action('auto_load_next_post_settings_page_init'); |
|
215 | 215 | } // END settings_page_init() |
216 | 216 | |
217 | 217 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @since 1.0.0 |
222 | 222 | */ |
223 | 223 | public function settings_page() { |
224 | - include_once( dirname( __FILE__ ) . '/class-alnp-admin-settings.php' ); |
|
224 | + include_once(dirname(__FILE__).'/class-alnp-admin-settings.php'); |
|
225 | 225 | |
226 | 226 | Auto_Load_Next_Post_Admin_Settings::output(); |
227 | 227 | } // END settings_page() |
@@ -235,18 +235,18 @@ discard block |
||
235 | 235 | * @param array $links |
236 | 236 | * @return array $links |
237 | 237 | */ |
238 | - public function plugin_action_links( $links ) { |
|
238 | + public function plugin_action_links($links) { |
|
239 | 239 | $plugin_action_links = array(); |
240 | 240 | |
241 | - if ( current_user_can( 'manage_options' ) ) { |
|
241 | + if (current_user_can('manage_options')) { |
|
242 | 242 | // Checks if Auto Load Next Post Pro has been installed. |
243 | - if ( ! is_alnp_pro_version_installed() ) { |
|
244 | - $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' ) . '" aria-label="' . esc_attr__( 'Sign up for Auto Load Next Post Pro', 'auto-load-next-post' ) . '" target="_blank" style="color:green; font-weight:bold;">' . __( 'Sign up for Pro', 'auto-load-next-post' ) . '</a>'; |
|
243 | + if ( ! is_alnp_pro_version_installed()) { |
|
244 | + $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').'" aria-label="'.esc_attr__('Sign up for Auto Load Next Post Pro', 'auto-load-next-post').'" target="_blank" style="color:green; font-weight:bold;">'.__('Sign up for Pro', 'auto-load-next-post').'</a>'; |
|
245 | 245 | } |
246 | 246 | |
247 | - $plugin_action_links['settings'] = '<a href="' . admin_url( 'options-general.php?page=auto-load-next-post-settings' ) . '" aria-label="' . esc_attr__( 'View Auto Load Next Post settings', 'auto-load-next-post' ) . '">' . __( 'Settings', 'auto-load-next-post' ) . '</a>'; |
|
247 | + $plugin_action_links['settings'] = '<a href="'.admin_url('options-general.php?page=auto-load-next-post-settings').'" aria-label="'.esc_attr__('View Auto Load Next Post settings', 'auto-load-next-post').'">'.__('Settings', 'auto-load-next-post').'</a>'; |
|
248 | 248 | |
249 | - return array_merge( $plugin_action_links, $links ); |
|
249 | + return array_merge($plugin_action_links, $links); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | return $links; |
@@ -263,17 +263,17 @@ discard block |
||
263 | 263 | * @param array $data Plugin Information |
264 | 264 | * @return array $links |
265 | 265 | */ |
266 | - public function plugin_row_meta( $links, $file, $data ) { |
|
267 | - if ( $file == plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ) { |
|
268 | - $links[ 1 ] = sprintf( __( 'Developed By %s', 'auto-load-next-post' ), '<a href="' . $data[ 'AuthorURI' ] . '" aria-label="' . esc_attr__( 'View the developers site', 'auto-load-next-post' ) . '">' . $data[ 'Author' ] . '</a>' ); |
|
266 | + public function plugin_row_meta($links, $file, $data) { |
|
267 | + if ($file == plugin_basename(AUTO_LOAD_NEXT_POST_FILE)) { |
|
268 | + $links[1] = sprintf(__('Developed By %s', 'auto-load-next-post'), '<a href="'.$data['AuthorURI'].'" aria-label="'.esc_attr__('View the developers site', 'auto-load-next-post').'">'.$data['Author'].'</a>'); |
|
269 | 269 | |
270 | 270 | $row_meta = array( |
271 | - '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>', |
|
272 | - '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>', |
|
273 | - '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>', |
|
271 | + '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>', |
|
272 | + '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>', |
|
273 | + '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>', |
|
274 | 274 | ); |
275 | 275 | |
276 | - $links = array_merge( $links, $row_meta ); |
|
276 | + $links = array_merge($links, $row_meta); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | return $links; |
@@ -289,16 +289,16 @@ discard block |
||
289 | 289 | * @param string $text |
290 | 290 | * @return string $text |
291 | 291 | */ |
292 | - public function admin_footer_text( $text ) { |
|
292 | + public function admin_footer_text($text) { |
|
293 | 293 | $current_screen = get_current_screen(); |
294 | 294 | |
295 | - if ( isset( $current_screen->id ) && $current_screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
295 | + if (isset($current_screen->id) && $current_screen->id == 'settings_page_auto-load-next-post-settings') { |
|
296 | 296 | // Rating and Review |
297 | 297 | return sprintf( |
298 | 298 | /* translators: 1: Auto Load Next Post 2:: five stars */ |
299 | - __( 'If you like %1$s, please leave a %2$s rating. A huge thank you in advance!', 'auto-load-next-post' ), |
|
300 | - sprintf( '<strong>%1$s</strong>', esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ), |
|
301 | - '<a href="' . AUTO_LOAD_NEXT_POST_REVIEW_URL . '?rate=5#new-post" target="_blank" data-rated="' . esc_attr__( 'Thanks :)', 'auto-load-next-post' ) . '">★★★★★</a>' |
|
299 | + __('If you like %1$s, please leave a %2$s rating. A huge thank you in advance!', 'auto-load-next-post'), |
|
300 | + sprintf('<strong>%1$s</strong>', esc_html__('Auto Load Next Post', 'auto-load-next-post')), |
|
301 | + '<a href="'.AUTO_LOAD_NEXT_POST_REVIEW_URL.'?rate=5#new-post" target="_blank" data-rated="'.esc_attr__('Thanks :)', 'auto-load-next-post').'">★★★★★</a>' |
|
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
@@ -315,11 +315,11 @@ discard block |
||
315 | 315 | * @param string $text |
316 | 316 | * @return string $text |
317 | 317 | */ |
318 | - public function update_footer( $text ) { |
|
318 | + public function update_footer($text) { |
|
319 | 319 | $screen = get_current_screen(); |
320 | 320 | |
321 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
322 | - 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>'; |
|
321 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
322 | + 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>'; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | return $text; |
@@ -332,9 +332,9 @@ discard block |
||
332 | 332 | * @since 1.6.0 |
333 | 333 | */ |
334 | 334 | public function sidebar_top() { |
335 | - include_once( dirname( __FILE__ ) . '/views/html-admin-sidebar-logo.php' ); |
|
335 | + include_once(dirname(__FILE__).'/views/html-admin-sidebar-logo.php'); |
|
336 | 336 | |
337 | - do_action( 'auto_load_next_post_sidebar_top' ); |
|
337 | + do_action('auto_load_next_post_sidebar_top'); |
|
338 | 338 | } // END sidebar_top() |
339 | 339 | |
340 | 340 | /** |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | * @since 1.6.0 |
346 | 346 | */ |
347 | 347 | public function upgrade_details() { |
348 | - if ( ! is_alnp_pro_version_installed() ) { |
|
349 | - include_once( dirname( __FILE__ ) . '/views/html-admin-sidebar.php' ); |
|
348 | + if ( ! is_alnp_pro_version_installed()) { |
|
349 | + include_once(dirname(__FILE__).'/views/html-admin-sidebar.php'); |
|
350 | 350 | } |
351 | 351 | } // END upgrade_details() |
352 | 352 | |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | * @since 1.6.0 |
358 | 358 | */ |
359 | 359 | public function sidebar_bottom() { |
360 | - do_action( 'auto_load_next_post_sidebar_bottom' ); |
|
360 | + do_action('auto_load_next_post_sidebar_bottom'); |
|
361 | 361 | |
362 | - include_once( dirname( __FILE__ ) . '/views/html-admin-sidebar-credits.php' ); |
|
362 | + include_once(dirname(__FILE__).'/views/html-admin-sidebar-credits.php'); |
|
363 | 363 | } // END sidebar_bottom() |
364 | 364 | |
365 | 365 | } // END class |