@@ -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_Notices' ) ) { |
|
18 | +if ( ! class_exists('Auto_Load_Next_Post_Admin_Notices')) { |
|
19 | 19 | |
20 | 20 | class Auto_Load_Next_Post_Admin_Notices { |
21 | 21 | |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | * @version 1.5.11 |
38 | 38 | */ |
39 | 39 | public function __construct() { |
40 | - self::$install_date = get_site_option( 'auto_load_next_post_install_date', time() ); |
|
40 | + self::$install_date = get_site_option('auto_load_next_post_install_date', time()); |
|
41 | 41 | |
42 | 42 | // Check WordPress enviroment. |
43 | - add_action( 'admin_init', array( $this, 'check_wp' ), 12 ); |
|
43 | + add_action('admin_init', array($this, 'check_wp'), 12); |
|
44 | 44 | |
45 | 45 | // Don't bug the user if they don't want to see any notices. |
46 | - add_action( 'admin_init', array( $this, 'dont_bug_me' ), 15 ); |
|
46 | + add_action('admin_init', array($this, 'dont_bug_me'), 15); |
|
47 | 47 | |
48 | 48 | // Display other admin notices when required. All are dismissable. |
49 | - add_action( 'admin_print_styles', array( $this, 'add_notices' ), 0 ); |
|
49 | + add_action('admin_print_styles', array($this, 'add_notices'), 0); |
|
50 | 50 | } // END __construct() |
51 | 51 | |
52 | 52 | /** |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | global $wp_version; |
63 | 63 | |
64 | 64 | // If the current user can not install plugins then return nothing! |
65 | - if ( ! current_user_can( 'install_plugins' ) ) { |
|
65 | + if ( ! current_user_can('install_plugins')) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | - if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) { |
|
70 | - add_action( 'admin_notices', array( $this, 'requirement_wp_notice' ) ); |
|
69 | + if ( ! version_compare($wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=')) { |
|
70 | + add_action('admin_notices', array($this, 'requirement_wp_notice')); |
|
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | |
@@ -87,25 +87,25 @@ discard block |
||
87 | 87 | $user_hidden_notice = false; |
88 | 88 | |
89 | 89 | // If the user is allowed to install plugins and requested to hide the review notice then hide it for that user. |
90 | - if ( ! empty( $_GET['hide_auto_load_next_post_review_notice'] ) && current_user_can( 'install_plugins' ) ) { |
|
91 | - add_user_meta( $current_user->ID, 'auto_load_next_post_hide_review_notice', '1', true ); |
|
90 | + if ( ! empty($_GET['hide_auto_load_next_post_review_notice']) && current_user_can('install_plugins')) { |
|
91 | + add_user_meta($current_user->ID, 'auto_load_next_post_hide_review_notice', '1', true); |
|
92 | 92 | $user_hidden_notice = true; |
93 | 93 | } |
94 | 94 | |
95 | 95 | // If the user is allowed to install plugins and requested to hide the welcome notice then hide it for that user. |
96 | - if ( ! empty( $_GET['hide_auto_load_next_post_welcome_notice'] ) && current_user_can( 'install_plugins' ) ) { |
|
97 | - add_user_meta( $current_user->ID, 'auto_load_next_post_hide_welcome_notice', '1', true ); |
|
96 | + if ( ! empty($_GET['hide_auto_load_next_post_welcome_notice']) && current_user_can('install_plugins')) { |
|
97 | + add_user_meta($current_user->ID, 'auto_load_next_post_hide_welcome_notice', '1', true); |
|
98 | 98 | $user_hidden_notice = true; |
99 | 99 | } |
100 | 100 | |
101 | - if ( ! empty( $_GET['hide_auto_load_next_post_beta_notice'] ) && current_user_can( 'install_plugins' ) ) { |
|
102 | - set_transient( 'alnp_beta_notice_hidden', 'hidden', WEEK_IN_SECONDS ); |
|
101 | + if ( ! empty($_GET['hide_auto_load_next_post_beta_notice']) && current_user_can('install_plugins')) { |
|
102 | + set_transient('alnp_beta_notice_hidden', 'hidden', WEEK_IN_SECONDS); |
|
103 | 103 | $user_hidden_notice = true; |
104 | 104 | } |
105 | 105 | |
106 | - if ( $user_hidden_notice ) { |
|
106 | + if ($user_hidden_notice) { |
|
107 | 107 | // Redirect to the plugins page. |
108 | - wp_safe_redirect( admin_url( 'plugins.php' ) ); |
|
108 | + wp_safe_redirect(admin_url('plugins.php')); |
|
109 | 109 | exit; |
110 | 110 | } |
111 | 111 | } // END dont_bug_me() |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | global $current_user; |
125 | 125 | |
126 | 126 | // If the current user can not install plugins then return nothing! |
127 | - if ( ! current_user_can( 'install_plugins' ) ) { |
|
127 | + if ( ! current_user_can('install_plugins')) { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
@@ -132,58 +132,58 @@ discard block |
||
132 | 132 | $screen_id = $screen ? $screen->id : ''; |
133 | 133 | |
134 | 134 | // Notices should only show on the main dashboard and on the plugins screen. |
135 | - if ( ! in_array( $screen_id, alnp_get_admin_screens() ) ) { |
|
135 | + if ( ! in_array($screen_id, alnp_get_admin_screens())) { |
|
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | |
139 | 139 | // Is admin welcome notice hidden? |
140 | - $hide_welcome_notice = get_user_meta( $current_user->ID, 'auto_load_next_post_hide_welcome_notice', true ); |
|
140 | + $hide_welcome_notice = get_user_meta($current_user->ID, 'auto_load_next_post_hide_welcome_notice', true); |
|
141 | 141 | |
142 | 142 | // Check if we need to display the welcome notice. |
143 | - if ( empty( $hide_welcome_notice ) ) { |
|
143 | + if (empty($hide_welcome_notice)) { |
|
144 | 144 | // If the user has just installed the plugin for the first time then welcome the user. |
145 | - if ( ( intval( time() - self::$install_date ) / WEEK_IN_SECONDS ) % 52 <= 2 ) { |
|
146 | - add_action( 'admin_notices', array( $this, 'welcome_notice' ) ); |
|
145 | + if ((intval(time() - self::$install_date) / WEEK_IN_SECONDS) % 52 <= 2) { |
|
146 | + add_action('admin_notices', array($this, 'welcome_notice')); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | 150 | // Is admin review notice hidden? |
151 | - $hide_review_notice = get_user_meta( $current_user->ID, 'auto_load_next_post_hide_review_notice', true ); |
|
151 | + $hide_review_notice = get_user_meta($current_user->ID, 'auto_load_next_post_hide_review_notice', true); |
|
152 | 152 | |
153 | 153 | // Check if we need to display the review plugin notice. |
154 | - if ( empty( $hide_review_notice ) ) { |
|
154 | + if (empty($hide_review_notice)) { |
|
155 | 155 | // If it has been a week or more since activating the plugin then display the review notice. |
156 | - if ( ( intval( time() - self::$install_date ) ) > WEEK_IN_SECONDS ) { |
|
157 | - add_action( 'admin_notices', array( $this, 'plugin_review_notice' ) ); |
|
156 | + if ((intval(time() - self::$install_date)) > WEEK_IN_SECONDS) { |
|
157 | + add_action('admin_notices', array($this, 'plugin_review_notice')); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | 161 | // Is this version of Auto Load Next Post a beta release? |
162 | - if ( is_alnp_beta() && empty( get_transient( 'alnp_beta_notice_hidden' ) ) ) { |
|
163 | - add_action( 'admin_notices', array( $this, 'beta_notice' ) ); |
|
162 | + if (is_alnp_beta() && empty(get_transient('alnp_beta_notice_hidden'))) { |
|
163 | + add_action('admin_notices', array($this, 'beta_notice')); |
|
164 | 164 | } |
165 | 165 | |
166 | - $template = get_option( 'template' ); |
|
166 | + $template = get_option('template'); |
|
167 | 167 | |
168 | 168 | // Checks if the theme supports Auto Load Next Post and not provided via a plugin. |
169 | - if ( is_alnp_supported() ) { |
|
170 | - $plugin_supported = alnp_get_theme_support( 'plugin_support' ); |
|
169 | + if (is_alnp_supported()) { |
|
170 | + $plugin_supported = alnp_get_theme_support('plugin_support'); |
|
171 | 171 | |
172 | 172 | // Return if theme is supported via plugin. |
173 | - if ( ! empty( $plugin_supported ) && $plugin_supported == 'yes' ) { |
|
174 | - update_option( 'auto_load_next_post_theme_supported', $template ); |
|
173 | + if ( ! empty($plugin_supported) && $plugin_supported == 'yes') { |
|
174 | + update_option('auto_load_next_post_theme_supported', $template); |
|
175 | 175 | return false; |
176 | 176 | } |
177 | 177 | |
178 | 178 | // If supported theme does not match active theme then show notice. |
179 | - if ( get_option( 'auto_load_next_post_theme_supported' ) !== $template ) { |
|
180 | - add_action( 'admin_notices', array( $this, 'theme_ready_notice' ) ); |
|
181 | - update_option( 'auto_load_next_post_theme_supported', $template ); |
|
179 | + if (get_option('auto_load_next_post_theme_supported') !== $template) { |
|
180 | + add_action('admin_notices', array($this, 'theme_ready_notice')); |
|
181 | + update_option('auto_load_next_post_theme_supported', $template); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | else { |
185 | 185 | // If theme not supported then delete option. |
186 | - delete_option( 'auto_load_next_post_theme_supported' ); |
|
186 | + delete_option('auto_load_next_post_theme_supported'); |
|
187 | 187 | } |
188 | 188 | } // END add_notices() |
189 | 189 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @since 1.4.3 |
195 | 195 | */ |
196 | 196 | public function requirement_wp_notice() { |
197 | - include( dirname( __FILE__ ) . '/views/html-notice-requirement-wp.php' ); |
|
197 | + include(dirname(__FILE__).'/views/html-notice-requirement-wp.php'); |
|
198 | 198 | } // END requirement_wp_notice() |
199 | 199 | |
200 | 200 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @since 1.5.0 |
205 | 205 | */ |
206 | 206 | public function theme_ready_notice() { |
207 | - include( dirname( __FILE__ ) . '/views/html-notice-theme-ready.php' ); |
|
207 | + include(dirname(__FILE__).'/views/html-notice-theme-ready.php'); |
|
208 | 208 | } // END theme_ready_notice() |
209 | 209 | |
210 | 210 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @since 1.5.0 |
215 | 215 | */ |
216 | 216 | public function welcome_notice() { |
217 | - include( dirname( __FILE__ ) . '/views/html-notice-welcome.php' ); |
|
217 | + include(dirname(__FILE__).'/views/html-notice-welcome.php'); |
|
218 | 218 | } // END welcome_notice() |
219 | 219 | |
220 | 220 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * @since 1.5.0 |
225 | 225 | */ |
226 | 226 | public function beta_notice() { |
227 | - include( dirname( __FILE__ ) . '/views/html-notice-trying-beta.php' ); |
|
227 | + include(dirname(__FILE__).'/views/html-notice-trying-beta.php'); |
|
228 | 228 | } // END beta_notice() |
229 | 229 | |
230 | 230 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | public function plugin_review_notice() { |
238 | 238 | $install_date = self::$install_date; |
239 | 239 | |
240 | - include( dirname( __FILE__ ) . '/views/html-notice-please-review.php' ); |
|
240 | + include(dirname(__FILE__).'/views/html-notice-please-review.php'); |
|
241 | 241 | } // END plugin_review_notice() |
242 | 242 | |
243 | 243 | } // END class. |
@@ -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 | |
@@ -31,20 +31,20 @@ discard block |
||
31 | 31 | self::includes(); |
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 plugin row and admin footer. |
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' ), 15, 1 ); |
|
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'), 15, 1); |
|
47 | + add_filter('update_footer', array($this, 'update_footer'), 15); |
|
48 | 48 | } // END __construct() |
49 | 49 | |
50 | 50 | /** |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | * @version 1.5.11 |
56 | 56 | */ |
57 | 57 | public function includes() { |
58 | - include( dirname( __FILE__ ) . '/class-alnp-admin-notices.php' ); // Plugin Notices |
|
58 | + include(dirname(__FILE__).'/class-alnp-admin-notices.php'); // Plugin Notices |
|
59 | 59 | |
60 | 60 | // Classes we only need if the ajax is not-ajax |
61 | - if ( apply_filters( 'auto_load_next_post_enable_admin_help_tab', true ) ) { |
|
62 | - include( dirname( __FILE__ ) . '/class-alnp-admin-help.php' ); // Plugin Help Tab |
|
61 | + if (apply_filters('auto_load_next_post_enable_admin_help_tab', true)) { |
|
62 | + include(dirname(__FILE__).'/class-alnp-admin-help.php'); // Plugin Help Tab |
|
63 | 63 | } |
64 | 64 | } // END includes() |
65 | 65 | |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | $screen = get_current_screen(); |
74 | 74 | $screen_id = $screen ? $screen->id : ''; |
75 | 75 | |
76 | - 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' ); |
|
76 | + 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 | 77 | |
78 | - if ( $screen_id == 'settings_page_auto-load-next-post-settings' ) { |
|
78 | + if ($screen_id == 'settings_page_auto-load-next-post-settings') { |
|
79 | 79 | // Select2 - Make sure that we remove other registered Select2 to prevent styling issues. |
80 | - if ( wp_script_is( 'select2', 'registered' ) ) { |
|
81 | - wp_dequeue_style( 'select2' ); |
|
82 | - wp_deregister_style( 'select2' ); |
|
80 | + if (wp_script_is('select2', 'registered')) { |
|
81 | + wp_dequeue_style('select2'); |
|
82 | + wp_deregister_style('select2'); |
|
83 | 83 | } |
84 | 84 | |
85 | - Auto_Load_Next_Post::load_file( 'select2', '/assets/css/libs/select2' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' ); |
|
85 | + Auto_Load_Next_Post::load_file('select2', '/assets/css/libs/select2'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css'); |
|
86 | 86 | } |
87 | 87 | } // END admin_styles() |
88 | 88 | |
@@ -97,25 +97,25 @@ discard block |
||
97 | 97 | $screen = get_current_screen(); |
98 | 98 | $screen_id = $screen ? $screen->id : ''; |
99 | 99 | |
100 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
100 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
101 | 101 | // Select2 - Make sure that we remove other registered Select2 to prevent plugin conflict issues. |
102 | - if ( wp_script_is( 'select2', 'registered' ) ) { |
|
103 | - wp_dequeue_script( 'select2' ); |
|
104 | - wp_deregister_script( 'select2' ); |
|
102 | + if (wp_script_is('select2', 'registered')) { |
|
103 | + wp_dequeue_script('select2'); |
|
104 | + wp_deregister_script('select2'); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | // Load Select2 |
108 | - 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 ); |
|
108 | + 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 | 109 | |
110 | 110 | // Load plugin settings. |
111 | - 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 ); |
|
111 | + 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 | 112 | |
113 | 113 | // Variables for Admin JavaScript. |
114 | - wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG . '_admin', 'alnp_settings_params', array( |
|
114 | + wp_localize_script(AUTO_LOAD_NEXT_POST_SLUG.'_admin', 'alnp_settings_params', array( |
|
115 | 115 | 'is_rtl' => is_rtl() ? 'rtl' : 'ltr', |
116 | - 'i18n_nav_warning' => esc_html__( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), |
|
117 | - 'i18n_reset_warning' => sprintf( esc_html__( 'This will reset all settings back to default and re-initialize %s. Are you sure?', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ), |
|
118 | - ) ); |
|
116 | + 'i18n_nav_warning' => esc_html__('The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post'), |
|
117 | + 'i18n_reset_warning' => sprintf(esc_html__('This will reset all settings back to default and re-initialize %s. Are you sure?', 'auto-load-next-post'), esc_html__('Auto Load Next Post', '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' ) . '" 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>'; |
|
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').'" 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>'; |
|
238 | 238 | } |
239 | 239 | |
240 | - $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>'; |
|
240 | + $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>'; |
|
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,18 +256,18 @@ 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' ] . '" aria-label="' . esc_attr__( 'View the developers site', 'auto-load-next-post' ) . '">' . $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'].'" aria-label="'.esc_attr__('View the developers site', 'auto-load-next-post').'">'.$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>', |
|
267 | - 'review' => '<a href="' . esc_url( AUTO_LOAD_NEXT_POST_REVIEW_URL ) . '" aria-label="' . esc_attr( __( 'Review Auto Load Next Post on WordPress.org', 'auto-load-next-post' ) ) . '" target="_blank">' . __( 'Leave a Review', '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 | + 'review' => '<a href="'.esc_url(AUTO_LOAD_NEXT_POST_REVIEW_URL).'" aria-label="'.esc_attr(__('Review Auto Load Next Post on WordPress.org', 'auto-load-next-post')).'" target="_blank">'.__('Leave a Review', 'auto-load-next-post').'</a>', |
|
268 | 268 | ); |
269 | 269 | |
270 | - $links = array_merge( $links, $row_meta ); |
|
270 | + $links = array_merge($links, $row_meta); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | return $links; |
@@ -283,16 +283,16 @@ discard block |
||
283 | 283 | * @param string $text text to be rendered in the footer. |
284 | 284 | * @return string $text |
285 | 285 | */ |
286 | - public function admin_footer_text( $text ) { |
|
286 | + public function admin_footer_text($text) { |
|
287 | 287 | $current_screen = get_current_screen(); |
288 | 288 | |
289 | - if ( isset( $current_screen->id ) && $current_screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
289 | + if (isset($current_screen->id) && $current_screen->id == 'settings_page_auto-load-next-post-settings') { |
|
290 | 290 | // Rating and Review |
291 | 291 | $text = sprintf( |
292 | 292 | /* translators: 1: Auto Load Next Post 2:: five stars */ |
293 | - __( 'If you like %1$s, please leave a %2$s rating. A huge thank you in advance!', 'auto-load-next-post' ), |
|
294 | - sprintf( '<strong>%1$s</strong>', esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ), |
|
295 | - '<a href="' . AUTO_LOAD_NEXT_POST_REVIEW_URL . '?rate=5#new-post" target="_blank" aria-label="' . esc_attr__( 'five star', 'auto-load-next-post' ) . '" data-rated="' . esc_attr__( 'Thanks :)', 'auto-load-next-post' ) . '">★★★★★</a>' |
|
293 | + __('If you like %1$s, please leave a %2$s rating. A huge thank you in advance!', 'auto-load-next-post'), |
|
294 | + sprintf('<strong>%1$s</strong>', esc_html__('Auto Load Next Post', 'auto-load-next-post')), |
|
295 | + '<a href="'.AUTO_LOAD_NEXT_POST_REVIEW_URL.'?rate=5#new-post" target="_blank" aria-label="'.esc_attr__('five star', 'auto-load-next-post').'" data-rated="'.esc_attr__('Thanks :)', 'auto-load-next-post').'">★★★★★</a>' |
|
296 | 296 | ); |
297 | 297 | } |
298 | 298 | |
@@ -309,11 +309,11 @@ discard block |
||
309 | 309 | * @param string $text |
310 | 310 | * @return string $text |
311 | 311 | */ |
312 | - public function update_footer( $text ) { |
|
312 | + public function update_footer($text) { |
|
313 | 313 | $screen = get_current_screen(); |
314 | 314 | |
315 | - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { |
|
316 | - return sprintf( __( '%s Version', 'auto-load-next-post' ), esc_html__( 'Auto Load Next Post', 'auto-load-next-post' ) ) . ' ' . esc_attr( AUTO_LOAD_NEXT_POST_VERSION ); |
|
315 | + if ($screen->id == 'settings_page_auto-load-next-post-settings') { |
|
316 | + return sprintf(__('%s Version', 'auto-load-next-post'), esc_html__('Auto Load Next Post', 'auto-load-next-post')).' '.esc_attr(AUTO_LOAD_NEXT_POST_VERSION); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | return $text; |
@@ -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 echo esc_html__( 'If you have any questions about the beta or if you have any feedback at all including features to be added or integrations to support, please let me know. Any little bit you\'re willing to share helps.', 'auto-load-next-post' ); ?></p> |
|
25 | + <h3><?php echo esc_html__('Thanks for trying out this beta!', 'auto-load-next-post'); ?></h3> |
|
26 | + <p><?php echo esc_html__('If you have any questions about the beta or if you have any feedback at all including features to be added or integrations to support, please let me know. Any little bit you\'re willing to share helps.', 'auto-load-next-post'); ?></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,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 | |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | 30 | $this->id = 'misc'; |
31 | - $this->label = esc_html__( 'Misc', 'auto-load-next-post' ); |
|
31 | + $this->label = esc_html__('Misc', 'auto-load-next-post'); |
|
32 | 32 | |
33 | 33 | parent::__construct(); |
34 | 34 | |
35 | - add_filter( 'auto_load_next_post_misc_settings', array( __CLASS__, 'lock_js_in_footer' ), 0, 1 ); |
|
36 | - add_action( 'auto_load_next_post_sections_misc', array( __CLASS__, 'no_comment_selector_set' ), 10 ); |
|
35 | + add_filter('auto_load_next_post_misc_settings', array(__CLASS__, 'lock_js_in_footer'), 0, 1); |
|
36 | + add_action('auto_load_next_post_sections_misc', array(__CLASS__, 'no_comment_selector_set'), 10); |
|
37 | 37 | } // END __construct() |
38 | 38 | |
39 | 39 | /** |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | * @since 1.5.0 |
45 | 45 | */ |
46 | 46 | public static function no_comment_selector_set() { |
47 | - $comments_container = get_option( 'auto_load_next_post_comments_container' ); |
|
48 | - $remove_comments = get_option( 'auto_load_next_post_remove_comments' ); |
|
47 | + $comments_container = get_option('auto_load_next_post_comments_container'); |
|
48 | + $remove_comments = get_option('auto_load_next_post_remove_comments'); |
|
49 | 49 | |
50 | - if ( empty( $comments_container ) && ! empty( $remove_comments ) ) { |
|
51 | - include( dirname( AUTO_LOAD_NEXT_POST_FILE ) . '/includes/admin/views/html-notice-no-comment-selector.php' ); |
|
50 | + if (empty($comments_container) && ! empty($remove_comments)) { |
|
51 | + include(dirname(AUTO_LOAD_NEXT_POST_FILE).'/includes/admin/views/html-notice-no-comment-selector.php'); |
|
52 | 52 | } |
53 | 53 | } // END no_comment_selector_set() |
54 | 54 | |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | * @param array $settings |
65 | 65 | * @return array $settings |
66 | 66 | */ |
67 | - public static function lock_js_in_footer( $settings ) { |
|
68 | - $js_locked_in_footer = get_option( 'auto_load_next_post_lock_js_in_footer' ); |
|
67 | + public static function lock_js_in_footer($settings) { |
|
68 | + $js_locked_in_footer = get_option('auto_load_next_post_lock_js_in_footer'); |
|
69 | 69 | |
70 | - if ( ! empty( $js_locked_in_footer ) && $js_locked_in_footer == 'yes' ) { |
|
70 | + if ( ! empty($js_locked_in_footer) && $js_locked_in_footer == 'yes') { |
|
71 | 71 | // Setting key to look for. |
72 | 72 | $key = 'load_js_in_footer'; |
73 | 73 | |
74 | 74 | // Find the setting. |
75 | - $find_setting = array_search( $key, $settings ); |
|
75 | + $find_setting = array_search($key, $settings); |
|
76 | 76 | |
77 | 77 | // Does the setting exist? |
78 | - if ( is_bool( $find_setting ) === true ) { |
|
79 | - unset( $settings[$key] ); |
|
78 | + if (is_bool($find_setting) === true) { |
|
79 | + unset($settings[$key]); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
@@ -98,47 +98,47 @@ discard block |
||
98 | 98 | 'title' => array( |
99 | 99 | 'title' => $this->label, |
100 | 100 | 'type' => 'title', |
101 | - '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' ) ), |
|
101 | + '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 | 102 | 'id' => 'misc_options' |
103 | 103 | ), |
104 | 104 | |
105 | 105 | 'remove_comments' => array( |
106 | - 'title' => esc_html__( 'Remove Comments', 'auto-load-next-post' ), |
|
107 | - 'desc' => esc_html__( 'Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post' ), |
|
106 | + 'title' => esc_html__('Remove Comments', 'auto-load-next-post'), |
|
107 | + 'desc' => esc_html__('Enable to remove comments when each post loads including the initial post.', 'auto-load-next-post'), |
|
108 | 108 | 'id' => 'auto_load_next_post_remove_comments', |
109 | 109 | 'default' => 'yes', |
110 | 110 | 'type' => 'checkbox' |
111 | 111 | ), |
112 | 112 | |
113 | 113 | 'google_analytics' => array( |
114 | - 'title' => esc_html__( 'Update Google Analytics', 'auto-load-next-post' ), |
|
115 | - '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' ), |
|
114 | + 'title' => esc_html__('Update Google Analytics', 'auto-load-next-post'), |
|
115 | + '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'), |
|
116 | 116 | 'id' => 'auto_load_next_post_google_analytics', |
117 | 117 | 'default' => 'no', |
118 | 118 | 'type' => 'checkbox' |
119 | 119 | ), |
120 | 120 | |
121 | 121 | 'load_js_in_footer' => array( |
122 | - 'title' => esc_html__( 'JavaScript in Footer?', 'auto-load-next-post' ), |
|
123 | - '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' ), |
|
122 | + 'title' => esc_html__('JavaScript in Footer?', 'auto-load-next-post'), |
|
123 | + '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'), |
|
124 | 124 | 'id' => 'auto_load_next_post_load_js_in_footer', |
125 | 125 | 'default' => 'no', |
126 | 126 | 'type' => 'checkbox' |
127 | 127 | ), |
128 | 128 | |
129 | 129 | 'reset_data' => array( |
130 | - 'title' => esc_html__( 'Reset all data?', 'auto-load-next-post' ), |
|
131 | - 'desc' => esc_html__( 'Press the reset button to clear all settings for this plugin and re-initialize.', 'auto-load-next-post' ), |
|
130 | + 'title' => esc_html__('Reset all data?', 'auto-load-next-post'), |
|
131 | + 'desc' => esc_html__('Press the reset button to clear all settings for this plugin and re-initialize.', 'auto-load-next-post'), |
|
132 | 132 | 'id' => 'auto_load_next_post_reset_data', |
133 | 133 | 'class' => 'reset-settings', |
134 | - 'value' => esc_html__( 'Reset', 'auto-load-next-post' ), |
|
135 | - 'url' => add_query_arg( array( 'page' => 'auto-load-next-post-settings', 'tab' => esc_attr( $this->id ), 'reset-alnp' => 'yes' ), admin_url( 'options-general.php' ) ), |
|
134 | + 'value' => esc_html__('Reset', 'auto-load-next-post'), |
|
135 | + 'url' => add_query_arg(array('page' => 'auto-load-next-post-settings', 'tab' => esc_attr($this->id), 'reset-alnp' => 'yes'), admin_url('options-general.php')), |
|
136 | 136 | 'type' => 'button' |
137 | 137 | ), |
138 | 138 | |
139 | 139 | 'uninstall' => array( |
140 | - 'title' => esc_html__( 'Remove all data on uninstall?', 'auto-load-next-post' ), |
|
141 | - 'desc' => esc_html__( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ), |
|
140 | + 'title' => esc_html__('Remove all data on uninstall?', 'auto-load-next-post'), |
|
141 | + 'desc' => esc_html__('If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post'), |
|
142 | 142 | 'id' => 'auto_load_next_post_uninstall_data', |
143 | 143 | 'default' => 'no', |
144 | 144 | 'type' => 'checkbox' |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | public function output() { |
162 | 162 | $settings = $this->get_settings(); |
163 | 163 | |
164 | - Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); |
|
164 | + Auto_Load_Next_Post_Admin_Settings::output_fields($settings); |
|
165 | 165 | } // END output() |
166 | 166 | |
167 | 167 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | public function save() { |
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 | } // END save() |
178 | 178 | |
179 | 179 | } // END class |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
|
2 | +defined('ABSPATH') || die('Cheatin’ uh?'); |
|
3 | 3 | |
4 | -if ( defined( 'WP_ROCKET_VERSION' ) ) : |
|
4 | +if (defined('WP_ROCKET_VERSION')) : |
|
5 | 5 | /** |
6 | 6 | * Excludes Auto Load Next Post scripts from JS minification. |
7 | 7 | * |
@@ -9,16 +9,16 @@ discard block |
||
9 | 9 | * @param Array $excluded_js An array of JS handles enqueued in WordPress. |
10 | 10 | * @return Array $excluded_js the updated array of handles. |
11 | 11 | */ |
12 | - function rocket_exclude_js_alnp( $excluded_js ) { |
|
13 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/frontend/auto-load-next-post.js' ) ); |
|
14 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/frontend/auto-load-next-post.min.js' ) ); |
|
15 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/frontend/auto-load-next-post.dev.js' ) ); |
|
16 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/libs/jquery.history.js' ) ); |
|
17 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/auto-load-next-post/assets/js/libs/scrollspy.min.js' ) ); |
|
12 | + function rocket_exclude_js_alnp($excluded_js) { |
|
13 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/auto-load-next-post/assets/js/frontend/auto-load-next-post.js')); |
|
14 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/auto-load-next-post/assets/js/frontend/auto-load-next-post.min.js')); |
|
15 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/auto-load-next-post/assets/js/frontend/auto-load-next-post.dev.js')); |
|
16 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/auto-load-next-post/assets/js/libs/jquery.history.js')); |
|
17 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/auto-load-next-post/assets/js/libs/scrollspy.min.js')); |
|
18 | 18 | |
19 | 19 | return $excluded_js; |
20 | 20 | } |
21 | - add_filter( 'rocket_exclude_js', 'rocket_exclude_js_alnp' ); |
|
21 | + add_filter('rocket_exclude_js', 'rocket_exclude_js_alnp'); |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Excludes Auto Load Next Post JS files from defer JS |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | * @param Array $exclude_defer_js Array of JS filepaths to be excluded. |
28 | 28 | * @return Array $exclude_defer_js the updated array of defer JS |
29 | 29 | */ |
30 | - function rocket_exclude_defer_js_alnp( $exclude_defer_js ) { |
|
31 | - $exclude_defer_js[] = rocket_clean_exclude_file( AUTO_LOAD_NEXT_POST_URL_PATH . '/assets/js/frontend/auto-load-next-post.js' ); |
|
32 | - $exclude_defer_js[] = rocket_clean_exclude_file( AUTO_LOAD_NEXT_POST_URL_PATH . '/assets/js/frontend/auto-load-next-post.min.js' ); |
|
33 | - $exclude_defer_js[] = rocket_clean_exclude_file( AUTO_LOAD_NEXT_POST_URL_PATH . '/assets/js/frontend/auto-load-next-post.dev.js' ); |
|
30 | + function rocket_exclude_defer_js_alnp($exclude_defer_js) { |
|
31 | + $exclude_defer_js[] = rocket_clean_exclude_file(AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/frontend/auto-load-next-post.js'); |
|
32 | + $exclude_defer_js[] = rocket_clean_exclude_file(AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/frontend/auto-load-next-post.min.js'); |
|
33 | + $exclude_defer_js[] = rocket_clean_exclude_file(AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/frontend/auto-load-next-post.dev.js'); |
|
34 | 34 | |
35 | 35 | return $exclude_defer_js; |
36 | 36 | } |
37 | - add_filter( 'rocket_exclude_defer_js', 'rocket_exclude_defer_js_alnp' ); |
|
37 | + add_filter('rocket_exclude_defer_js', 'rocket_exclude_defer_js_alnp'); |
|
38 | 38 | |
39 | 39 | endif; |