@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Exit if accessed directly |
4 | -if ( ! defined( 'ABSPATH' ) ) { |
|
4 | +if ( ! defined( 'ABSPATH' )) { |
|
5 | 5 | exit; |
6 | 6 | } |
7 | 7 | |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $date = sanitize_text_field( $_POST['date'] ); |
11 | 11 | $time = sanitize_text_field( $_POST['time'] ); |
12 | 12 | |
13 | - $offset = (int) -( get_option( 'gmt_offset' ) ); // Make the timestamp in the users' timezone, b/c that makes more sense |
|
13 | + $offset = (int) -(get_option( 'gmt_offset' )); // Make the timestamp in the users' timezone, b/c that makes more sense |
|
14 | 14 | |
15 | 15 | $share_time = explode( ':', $time ); |
16 | 16 | |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $minutes = (int) substr( $share_time[1], 0, 2 ); |
19 | 19 | $ampm = strtolower( substr( $share_time[1], -2 ) ); |
20 | 20 | |
21 | - if ( $ampm == 'pm' && $hours != 12 ) { |
|
21 | + if ($ampm == 'pm' && $hours != 12) { |
|
22 | 22 | $hours = $hours + 12; |
23 | 23 | } |
24 | 24 | |
25 | - if ( $ampm == 'am' && $hours == 12 ) { |
|
25 | + if ($ampm == 'am' && $hours == 12) { |
|
26 | 26 | $hours = 00; |
27 | 27 | } |
28 | 28 | |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | } |
39 | 39 | add_action( 'wp_ajax_ppp_has_schedule_conflict', 'ppp_check_for_schedule_conflict' ); |
40 | 40 | |
41 | -add_action( 'wp_ajax_ppp_local_url_notice_dismiss', function() { |
|
41 | +add_action( 'wp_ajax_ppp_local_url_notice_dismiss', function () { |
|
42 | 42 | |
43 | - var_dump($_POST); |
|
43 | + var_dump( $_POST ); |
|
44 | 44 | $error_message = __( 'There was an error dismissing the local URL notice. Please try again.', 'ppp-txt' ); |
45 | - if( ! wp_verify_nonce( $_POST['nonce'], 'ppp_local_url_notice_nonce' ) || ! current_user_can( post_promoter_pro()->get_manage_capability() ) ) { |
|
45 | + if ( ! wp_verify_nonce( $_POST['nonce'], 'ppp_local_url_notice_nonce' ) || ! current_user_can( post_promoter_pro()->get_manage_capability() )) { |
|
46 | 46 | wp_send_json_error( array( |
47 | 47 | 'error' => $error_message, |
48 | 48 | ) ); |
49 | 49 | } |
50 | 50 | $updated = update_option( 'ppp_local_url_notice_dismissed', true ); |
51 | - if( $updated === false ) { |
|
51 | + if ($updated === false) { |
|
52 | 52 | wp_send_json_error( array( |
53 | 53 | 'error' => $error_message, |
54 | 54 | ) ); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Exit if accessed directly |
4 | -if ( ! defined( 'ABSPATH' ) ) { |
|
4 | +if ( ! defined( 'ABSPATH' )) { |
|
5 | 5 | exit; |
6 | 6 | } |
7 | 7 | |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | * @return void |
11 | 11 | */ |
12 | 12 | function ppp_maybe_start_session() { |
13 | - if( !class_exists( 'TwitterOAuth' ) ) { |
|
14 | - require_once ( PPP_PATH . '/includes/libs/twitter/twitteroauth.php' ); |
|
13 | + if ( ! class_exists( 'TwitterOAuth' )) { |
|
14 | + require_once (PPP_PATH.'/includes/libs/twitter/twitteroauth.php'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $ret = false; |
18 | - if ( ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) && ! isset( $_SESSION ) ) { |
|
18 | + if ((is_admin() || (defined( 'DOING_CRON' ) && DOING_CRON)) && ! isset($_SESSION)) { |
|
19 | 19 | $ret = session_start(); |
20 | 20 | } |
21 | 21 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | global $ppp_share_settings; |
31 | 31 | $result = false; |
32 | 32 | |
33 | - if ( isset( $ppp_share_settings['analytics'] ) && $ppp_share_settings['analytics'] !== 'none' ) { |
|
34 | - $result = true; |
|
33 | + if (isset($ppp_share_settings['analytics']) && $ppp_share_settings['analytics'] !== 'none') { |
|
34 | + $result = true; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return apply_filters( 'ppp_is_link_tracking_enabled', $result ); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | function ppp_is_shortener_enabled() { |
73 | 73 | global $ppp_share_settings; |
74 | 74 | |
75 | - return ( isset( $ppp_share_settings['shortener'] ) && !empty( $ppp_share_settings['shortener'] ) && $ppp_share_settings != '-1' ); |
|
75 | + return (isset($ppp_share_settings['shortener']) && ! empty($ppp_share_settings['shortener']) && $ppp_share_settings != '-1'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | $post_types = get_post_types( $post_type_args, NULL, 'and' ); |
105 | 105 | |
106 | 106 | $unsupported_post_types = array( 'wp_log', 'attachment' ); |
107 | - foreach ( $unsupported_post_types as $unsupported_post_type ) { |
|
108 | - if ( array_key_exists( $unsupported_post_type, $post_types ) ) { |
|
109 | - unset( $post_types[ $unsupported_post_type ] ); |
|
107 | + foreach ($unsupported_post_types as $unsupported_post_type) { |
|
108 | + if (array_key_exists( $unsupported_post_type, $post_types )) { |
|
109 | + unset($post_types[$unsupported_post_type]); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -134,16 +134,16 @@ discard block |
||
134 | 134 | function ppp_should_save( $post_id, $post ) { |
135 | 135 | $ret = true; |
136 | 136 | |
137 | - if ( empty( $_POST ) ) { |
|
137 | + if (empty($_POST)) { |
|
138 | 138 | $ret = false; |
139 | 139 | } |
140 | 140 | |
141 | - if ( wp_is_post_revision( $post_id ) ) { |
|
141 | + if (wp_is_post_revision( $post_id )) { |
|
142 | 142 | $ret = false; |
143 | 143 | } |
144 | 144 | |
145 | 145 | global $ppp_options; |
146 | - if ( !isset( $ppp_options['post_types'] ) || !is_array( $ppp_options['post_types'] ) || !array_key_exists( $post->post_type, $ppp_options['post_types'] ) ) { |
|
146 | + if ( ! isset($ppp_options['post_types']) || ! is_array( $ppp_options['post_types'] ) || ! array_key_exists( $post->post_type, $ppp_options['post_types'] )) { |
|
147 | 147 | $ret = false; |
148 | 148 | } |
149 | 149 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | function ppp_set_uploads_dir() { |
160 | 160 | $upload_path = ppp_get_upload_path(); |
161 | 161 | |
162 | - if ( false === get_transient( 'ppp_check_protection_files' ) ) { |
|
162 | + if (false === get_transient( 'ppp_check_protection_files' )) { |
|
163 | 163 | |
164 | 164 | // Make sure the /ppp folder is created |
165 | 165 | wp_mkdir_p( $upload_path ); |
@@ -168,22 +168,22 @@ discard block |
||
168 | 168 | $rules = "Options -Indexes\n"; |
169 | 169 | $rules .= "deny from all\n"; |
170 | 170 | |
171 | - $htaccess_exists = file_exists( $upload_path . '/.htaccess' ); |
|
171 | + $htaccess_exists = file_exists( $upload_path.'/.htaccess' ); |
|
172 | 172 | |
173 | - if ( $htaccess_exists ) { |
|
174 | - $contents = @file_get_contents( $upload_path . '/.htaccess' ); |
|
175 | - if ( $contents !== $rules || ! $contents ) { |
|
173 | + if ($htaccess_exists) { |
|
174 | + $contents = @file_get_contents( $upload_path.'/.htaccess' ); |
|
175 | + if ($contents !== $rules || ! $contents) { |
|
176 | 176 | // Update the .htaccess rules if they don't match |
177 | - @file_put_contents( $upload_path . '/.htaccess', $rules ); |
|
177 | + @file_put_contents( $upload_path.'/.htaccess', $rules ); |
|
178 | 178 | } |
179 | - } elseif( wp_is_writable( $upload_path ) ) { |
|
179 | + } elseif (wp_is_writable( $upload_path )) { |
|
180 | 180 | // Create the file if it doesn't exist |
181 | - @file_put_contents( $upload_path . '/.htaccess', $rules ); |
|
181 | + @file_put_contents( $upload_path.'/.htaccess', $rules ); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | // Top level blank index.php |
185 | - if ( ! file_exists( $upload_path . '/index.php' ) && wp_is_writable( $upload_path ) ) { |
|
186 | - @file_put_contents( $upload_path . '/index.php', '<?php' . PHP_EOL . '// Silence is golden.' ); |
|
185 | + if ( ! file_exists( $upload_path.'/index.php' ) && wp_is_writable( $upload_path )) { |
|
186 | + @file_put_contents( $upload_path.'/index.php', '<?php'.PHP_EOL.'// Silence is golden.' ); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // Check for the files once per day |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | function ppp_get_upload_path() { |
202 | 202 | $wp_upload_dir = wp_upload_dir(); |
203 | - return $wp_upload_dir['basedir'] . '/ppp'; |
|
203 | + return $wp_upload_dir['basedir'].'/ppp'; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | $completed_upgrades = get_option( 'ppp_completed_upgrades' ); |
215 | 215 | |
216 | - if ( false === $completed_upgrades ) { |
|
216 | + if (false === $completed_upgrades) { |
|
217 | 217 | $completed_upgrades = array(); |
218 | 218 | } |
219 | 219 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | function ppp_has_upgrade_completed( $upgrade_action = '' ) { |
232 | 232 | |
233 | - if ( empty( $upgrade_action ) ) { |
|
233 | + if (empty($upgrade_action)) { |
|
234 | 234 | return false; |
235 | 235 | } |
236 | 236 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | function ppp_set_upgrade_complete( $upgrade_action = '' ) { |
251 | 251 | |
252 | - if ( empty( $upgrade_action ) ) { |
|
252 | + if (empty($upgrade_action)) { |
|
253 | 253 | return false; |
254 | 254 | } |
255 | 255 | |
@@ -274,48 +274,48 @@ discard block |
||
274 | 274 | $url = strtolower( trim( get_home_url( '/' ) ) ); |
275 | 275 | |
276 | 276 | // Need to get the host...so let's add the scheme so we can use parse_url |
277 | - if ( false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' ) ) { |
|
278 | - $url = 'http://' . $url; |
|
277 | + if (false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' )) { |
|
278 | + $url = 'http://'.$url; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | $url_parts = parse_url( $url ); |
282 | - $host = ! empty( $url_parts['host'] ) ? $url_parts['host'] : false; |
|
282 | + $host = ! empty($url_parts['host']) ? $url_parts['host'] : false; |
|
283 | 283 | |
284 | - if ( ! empty( $url ) && ! empty( $host ) ) { |
|
284 | + if ( ! empty($url) && ! empty($host)) { |
|
285 | 285 | |
286 | - if ( false !== ip2long( $host ) ) { |
|
287 | - if ( ! filter_var( $host, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) { |
|
286 | + if (false !== ip2long( $host )) { |
|
287 | + if ( ! filter_var( $host, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE )) { |
|
288 | 288 | $is_local_url = true; |
289 | 289 | } |
290 | - } else if ( 'localhost' === $host ) { |
|
290 | + } else if ('localhost' === $host) { |
|
291 | 291 | $is_local_url = true; |
292 | 292 | } |
293 | 293 | |
294 | 294 | $check_tlds = apply_filters( 'ppp_validate_tlds', true ); |
295 | - if ( $check_tlds ) { |
|
295 | + if ($check_tlds) { |
|
296 | 296 | $tlds_to_check = apply_filters( 'ppp_url_tlds', array( |
297 | 297 | '.dev', '.local', '.test' |
298 | 298 | ) ); |
299 | 299 | |
300 | - foreach ( $tlds_to_check as $tld ) { |
|
301 | - if ( false !== strpos( $host, $tld ) ) { |
|
300 | + foreach ($tlds_to_check as $tld) { |
|
301 | + if (false !== strpos( $host, $tld )) { |
|
302 | 302 | $is_local_url = true; |
303 | 303 | continue; |
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
308 | - if ( substr_count( $host, '.' ) > 1 ) { |
|
308 | + if (substr_count( $host, '.' ) > 1) { |
|
309 | 309 | $subdomains_to_check = apply_filters( 'ppp_url_subdomains', array( |
310 | 310 | 'dev.', '*.staging.', |
311 | 311 | ) ); |
312 | 312 | |
313 | - foreach ( $subdomains_to_check as $subdomain ) { |
|
313 | + foreach ($subdomains_to_check as $subdomain) { |
|
314 | 314 | |
315 | 315 | $subdomain = str_replace( '.', '(.)', $subdomain ); |
316 | 316 | $subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain ); |
317 | 317 | |
318 | - if ( preg_match( '/^(' . $subdomain . ')/', $host ) ) { |
|
318 | + if (preg_match( '/^('.$subdomain.')/', $host )) { |
|
319 | 319 | $is_local_url = true; |
320 | 320 | continue; |
321 | 321 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | |
17 | 17 | define( 'PPP_STORE_URL', 'https://postpromoterpro.com' ); |
18 | 18 | define( 'PPP_PLUGIN_NAME', 'Post Promoter Pro' ); |
19 | -if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) { |
|
19 | +if ( ! class_exists( 'EDD_SL_Plugin_Updater' )) { |
|
20 | 20 | // load our custom updater |
21 | - include( PPP_PATH . '/includes/EDD_SL_Plugin_Updater.php' ); |
|
21 | + include(PPP_PATH.'/includes/EDD_SL_Plugin_Updater.php'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | class PostPromoterPro { |
@@ -27,30 +27,30 @@ discard block |
||
27 | 27 | private function __construct() { |
28 | 28 | add_action( 'init', array( $this, 'ppp_loaddomain' ), 1 ); |
29 | 29 | |
30 | - if ( ! is_callable( 'curl_init' ) ) { |
|
30 | + if ( ! is_callable( 'curl_init' )) { |
|
31 | 31 | add_action( 'admin_notices', array( $this, 'no_curl' ) ); |
32 | 32 | } else { |
33 | 33 | global $ppp_options, $ppp_social_settings, $ppp_share_settings; |
34 | 34 | |
35 | - include PPP_PATH . '/includes/general-functions.php'; |
|
36 | - include PPP_PATH . '/includes/share-functions.php'; |
|
37 | - include PPP_PATH . '/includes/cron-functions.php'; |
|
38 | - include PPP_PATH . '/includes/filters.php'; |
|
39 | - include PPP_PATH . '/includes/libs/social-loader.php'; |
|
35 | + include PPP_PATH.'/includes/general-functions.php'; |
|
36 | + include PPP_PATH.'/includes/share-functions.php'; |
|
37 | + include PPP_PATH.'/includes/cron-functions.php'; |
|
38 | + include PPP_PATH.'/includes/filters.php'; |
|
39 | + include PPP_PATH.'/includes/libs/social-loader.php'; |
|
40 | 40 | |
41 | - if( ! class_exists( 'WP_Logging' ) ) { |
|
42 | - include PPP_PATH . '/includes/libs/class-wp-logging.php'; |
|
41 | + if ( ! class_exists( 'WP_Logging' )) { |
|
42 | + include PPP_PATH.'/includes/libs/class-wp-logging.php'; |
|
43 | 43 | } |
44 | 44 | |
45 | - if ( is_admin() ) { |
|
46 | - include PPP_PATH . '/includes/admin/upgrades.php'; |
|
47 | - include PPP_PATH . '/includes/admin/do-upgrades.php'; |
|
48 | - include PPP_PATH . '/includes/admin/actions.php'; |
|
49 | - include PPP_PATH . '/includes/admin/admin-pages.php'; |
|
50 | - include PPP_PATH . '/includes/admin/admin-ajax.php'; |
|
51 | - include PPP_PATH . '/includes/admin/meta-boxes.php'; |
|
52 | - include PPP_PATH . '/includes/admin/welcome.php'; |
|
53 | - include PPP_PATH . '/includes/admin/dashboard.php'; |
|
45 | + if (is_admin()) { |
|
46 | + include PPP_PATH.'/includes/admin/upgrades.php'; |
|
47 | + include PPP_PATH.'/includes/admin/do-upgrades.php'; |
|
48 | + include PPP_PATH.'/includes/admin/actions.php'; |
|
49 | + include PPP_PATH.'/includes/admin/admin-pages.php'; |
|
50 | + include PPP_PATH.'/includes/admin/admin-ajax.php'; |
|
51 | + include PPP_PATH.'/includes/admin/meta-boxes.php'; |
|
52 | + include PPP_PATH.'/includes/admin/welcome.php'; |
|
53 | + include PPP_PATH.'/includes/admin/dashboard.php'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $ppp_options = get_option( 'ppp_options' ); |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | $ppp_share_settings = get_option( 'ppp_share_settings' ); |
59 | 59 | |
60 | 60 | // Do some leg work on the social settings for Issue #257 |
61 | - if ( is_array( $ppp_share_settings ) && ! array_key_exists( 'share_on_publish', $ppp_share_settings ) ) { |
|
62 | - $tw_share_on_publish = ! empty( $ppp_share_settings['twitter']['share_on_publish'] ) ? true : false; |
|
63 | - $fb_share_on_publish = ! empty( $ppp_share_settings['facebook']['share_on_publish'] ) ? true : false; |
|
64 | - $li_share_on_publish = ! empty( $ppp_share_settings['linkedin']['share_on_publish'] ) ? true : false; |
|
61 | + if (is_array( $ppp_share_settings ) && ! array_key_exists( 'share_on_publish', $ppp_share_settings )) { |
|
62 | + $tw_share_on_publish = ! empty($ppp_share_settings['twitter']['share_on_publish']) ? true : false; |
|
63 | + $fb_share_on_publish = ! empty($ppp_share_settings['facebook']['share_on_publish']) ? true : false; |
|
64 | + $li_share_on_publish = ! empty($ppp_share_settings['linkedin']['share_on_publish']) ? true : false; |
|
65 | 65 | |
66 | 66 | unset( |
67 | 67 | $ppp_share_settings['twitter']['share_on_publish'], |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | ); |
71 | 71 | |
72 | 72 | $post_types = ppp_supported_post_types(); |
73 | - foreach ( $post_types as $key => $post_type ) { |
|
74 | - $ppp_share_settings['share_on_publish'][ $key ]['twitter'] = $tw_share_on_publish; |
|
75 | - $ppp_share_settings['share_on_publish'][ $key ]['facebook'] = $fb_share_on_publish; |
|
76 | - $ppp_share_settings['share_on_publish'][ $key ]['linkedin'] = $li_share_on_publish; |
|
73 | + foreach ($post_types as $key => $post_type) { |
|
74 | + $ppp_share_settings['share_on_publish'][$key]['twitter'] = $tw_share_on_publish; |
|
75 | + $ppp_share_settings['share_on_publish'][$key]['facebook'] = $fb_share_on_publish; |
|
76 | + $ppp_share_settings['share_on_publish'][$key]['linkedin'] = $li_share_on_publish; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | update_option( 'ppp_share_settings', $ppp_share_settings ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @access public |
91 | 91 | */ |
92 | 92 | public static function getInstance() { |
93 | - if ( !self::$ppp_instance ) { |
|
93 | + if ( ! self::$ppp_instance) { |
|
94 | 94 | self::$ppp_instance = new PostPromoterPro(); |
95 | 95 | } |
96 | 96 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | private function hooks() { |
113 | - if ( is_admin() ) { |
|
113 | + if (is_admin()) { |
|
114 | 114 | add_action( 'admin_init', array( $this, 'ppp_register_settings' ) ); |
115 | 115 | add_action( 'admin_init', 'ppp_upgrade_plugin', 1 ); |
116 | 116 | |
@@ -125,14 +125,14 @@ discard block |
||
125 | 125 | add_action( 'admin_enqueue_scripts', array( $this, 'load_styles' ), 99999 ); |
126 | 126 | add_action( 'wp_trash_post', 'ppp_remove_scheduled_shares', 10, 1 ); |
127 | 127 | |
128 | - if ( ppp_is_dev_or_staging() ) { |
|
128 | + if (ppp_is_dev_or_staging()) { |
|
129 | 129 | add_action( 'admin_notices', array( $this, 'local_site_nag' ) ); |
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | 133 | add_action( 'init', array( $this, 'get_actions' ) ); |
134 | - add_action( 'wp_insert_post', 'ppp_schedule_share', 99, 2); |
|
135 | - add_action( 'transition_post_status', 'ppp_share_on_publish', 99, 3); |
|
134 | + add_action( 'wp_insert_post', 'ppp_schedule_share', 99, 2 ); |
|
135 | + add_action( 'transition_post_status', 'ppp_share_on_publish', 99, 3 ); |
|
136 | 136 | add_action( 'init', 'ppp_add_image_sizes' ); |
137 | 137 | add_filter( 'wp_log_types', array( $this, 'register_log_type' ), 10, 1 ); |
138 | 138 | } |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | |
158 | 158 | $allowed_pages = apply_filters( 'ppp_admin_scripts_pages', $allowed_pages, $hook ); |
159 | 159 | |
160 | - if ( ! in_array( $hook, $allowed_pages ) ) { |
|
160 | + if ( ! in_array( $hook, $allowed_pages )) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
164 | 164 | wp_enqueue_script( 'jquery-ui-core' ); |
165 | 165 | wp_enqueue_script( 'jquery-ui-datepicker' ); |
166 | 166 | |
167 | - $jquery_ui_timepicker_path = PPP_URL . 'includes/scripts/libs/jquery-ui-timepicker-addon.js'; |
|
168 | - wp_enqueue_script( 'ppp_timepicker_js', $jquery_ui_timepicker_path , array( 'jquery', 'jquery-ui-core' ), PPP_VERSION, true ); |
|
167 | + $jquery_ui_timepicker_path = PPP_URL.'includes/scripts/libs/jquery-ui-timepicker-addon.js'; |
|
168 | + wp_enqueue_script( 'ppp_timepicker_js', $jquery_ui_timepicker_path, array( 'jquery', 'jquery-ui-core' ), PPP_VERSION, true ); |
|
169 | 169 | wp_enqueue_script( 'ppp_core_custom_js', PPP_URL.'includes/scripts/js/ppp_custom.js', 'jquery', PPP_VERSION, true ); |
170 | 170 | |
171 | 171 | } |
@@ -176,15 +176,15 @@ discard block |
||
176 | 176 | |
177 | 177 | // List of people who make it impossible to override their jQuery UI as it's in their core CSS...so only |
178 | 178 | // load ours if they don't exist |
179 | - if ( ! wp_style_is( 'ot-admin-css' ) && ! wp_style_is( 'jquery-ui-css' ) ) { |
|
179 | + if ( ! wp_style_is( 'ot-admin-css' ) && ! wp_style_is( 'jquery-ui-css' )) { |
|
180 | 180 | wp_enqueue_style( 'jquery-ui-css', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/flick/jquery-ui.css' ); |
181 | 181 | } |
182 | 182 | |
183 | - wp_register_style( 'ppp_admin_css', PPP_URL . 'includes/scripts/css/admin-style.css', false, PPP_VERSION ); |
|
183 | + wp_register_style( 'ppp_admin_css', PPP_URL.'includes/scripts/css/admin-style.css', false, PPP_VERSION ); |
|
184 | 184 | wp_enqueue_style( 'ppp_admin_css' ); |
185 | 185 | |
186 | 186 | $sources = array_map( 'basename', (array) wp_list_pluck( $wp_styles->registered, 'src' ) ); |
187 | - if ( ! in_array( 'font-awesome.css', $sources ) || in_array( 'font-awesome.min.css', $sources ) ) { |
|
187 | + if ( ! in_array( 'font-awesome.css', $sources ) || in_array( 'font-awesome.min.css', $sources )) { |
|
188 | 188 | wp_register_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', false, null ); |
189 | 189 | wp_enqueue_style( 'font-awesome' ); |
190 | 190 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @access public |
200 | 200 | */ |
201 | 201 | public function plugin_settings_links( $links, $file ) { |
202 | - if ( $file != PPP_FILE ) { |
|
202 | + if ($file != PPP_FILE) { |
|
203 | 203 | return $links; |
204 | 204 | } |
205 | 205 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @access public |
294 | 294 | */ |
295 | 295 | public function ppp_loaddomain() { |
296 | - load_plugin_textdomain( 'ppp-txt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
296 | + load_plugin_textdomain( 'ppp-txt', false, dirname( plugin_basename( __FILE__ ) ).'/languages/' ); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | /** |
@@ -302,24 +302,24 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function plugin_updater() { |
304 | 304 | global $ppp_options; |
305 | - if ( defined( 'NO_AUTO_UPDATE' ) && true === NO_AUTO_UPDATE ) { |
|
305 | + if (defined( 'NO_AUTO_UPDATE' ) && true === NO_AUTO_UPDATE) { |
|
306 | 306 | return; |
307 | 307 | } |
308 | 308 | |
309 | 309 | $license_key = trim( get_option( '_ppp_license_key' ) ); |
310 | 310 | |
311 | - if ( empty( $license_key ) ) { |
|
311 | + if (empty($license_key)) { |
|
312 | 312 | add_action( 'admin_notices', array( $this, 'no_license_nag' ) ); |
313 | 313 | return; |
314 | 314 | } |
315 | 315 | |
316 | 316 | // setup the updater |
317 | 317 | $edd_updater = new EDD_SL_Plugin_Updater( PPP_STORE_URL, __FILE__, array( |
318 | - 'version' => PPP_VERSION, // current version number |
|
319 | - 'license' => $license_key, // license key (used get_option above to retrieve from DB) |
|
320 | - 'item_name' => PPP_PLUGIN_NAME, // name of this plugin |
|
321 | - 'author' => 'Post Promoter Pro', // author of this plugin |
|
322 | - 'beta' => ! empty( $ppp_options['enable_betas'] ) ? true : false, // If we should install beta versions |
|
318 | + 'version' => PPP_VERSION, // current version number |
|
319 | + 'license' => $license_key, // license key (used get_option above to retrieve from DB) |
|
320 | + 'item_name' => PPP_PLUGIN_NAME, // name of this plugin |
|
321 | + 'author' => 'Post Promoter Pro', // author of this plugin |
|
322 | + 'beta' => ! empty($ppp_options['enable_betas']) ? true : false, // If we should install beta versions |
|
323 | 323 | ) |
324 | 324 | ); |
325 | 325 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | public function local_site_nag() { |
350 | 350 | $dismissed = get_option( 'ppp_local_url_notice_dismissed' ); |
351 | - if ( ! empty( $dismissed ) ) { |
|
351 | + if ( ! empty($dismissed)) { |
|
352 | 352 | return; |
353 | 353 | } |
354 | 354 | ?> |
@@ -385,10 +385,10 @@ discard block |
||
385 | 385 | */ |
386 | 386 | public function deactivate_license() { |
387 | 387 | // listen for our activate button to be clicked |
388 | - if( isset( $_POST['ppp_license_deactivate'] ) ) { |
|
388 | + if (isset($_POST['ppp_license_deactivate'])) { |
|
389 | 389 | |
390 | 390 | // run a quick security check |
391 | - if( ! check_admin_referer( 'ppp_deactivate_nonce', 'ppp_deactivate_nonce' ) ) { |
|
391 | + if ( ! check_admin_referer( 'ppp_deactivate_nonce', 'ppp_deactivate_nonce' )) { |
|
392 | 392 | return; |
393 | 393 | } |
394 | 394 | // get out if we didn't click the Activate button |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | $response = wp_remote_get( add_query_arg( $api_params, PPP_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) ); |
409 | 409 | |
410 | 410 | // make sure the response came back okay |
411 | - if ( is_wp_error( $response ) ) { |
|
411 | + if (is_wp_error( $response )) { |
|
412 | 412 | return false; |
413 | 413 | } |
414 | 414 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $license_data = json_decode( wp_remote_retrieve_body( $response ) ); |
417 | 417 | |
418 | 418 | // $license_data->license will be either "deactivated" or "failed" |
419 | - if( $license_data->license == 'deactivated' ) { |
|
419 | + if ($license_data->license == 'deactivated') { |
|
420 | 420 | delete_option( '_ppp_license_key_status' ); |
421 | 421 | } |
422 | 422 | |
@@ -429,10 +429,10 @@ discard block |
||
429 | 429 | */ |
430 | 430 | public function activate_license() { |
431 | 431 | // listen for our activate button to be clicked |
432 | - if( isset( $_POST['ppp_license_activate'] ) ) { |
|
432 | + if (isset($_POST['ppp_license_activate'])) { |
|
433 | 433 | |
434 | 434 | // run a quick security check |
435 | - if( ! check_admin_referer( 'ppp_activate_nonce', 'ppp_activate_nonce' ) ) { |
|
435 | + if ( ! check_admin_referer( 'ppp_activate_nonce', 'ppp_activate_nonce' )) { |
|
436 | 436 | return; |
437 | 437 | } |
438 | 438 | // get out if we didn't click the Activate button |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $response = wp_remote_get( add_query_arg( $api_params, PPP_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) ); |
453 | 453 | |
454 | 454 | // make sure the response came back okay |
455 | - if ( is_wp_error( $response ) ) { |
|
455 | + if (is_wp_error( $response )) { |
|
456 | 456 | return false; |
457 | 457 | } |
458 | 458 | |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | */ |
474 | 474 | public function ppp_sanitize_license( $new ) { |
475 | 475 | $old = get_option( '_ppp_license_key' ); |
476 | - if( $old && $old != $new ) { |
|
476 | + if ($old && $old != $new) { |
|
477 | 477 | delete_option( '_ppp_license_key_status' ); // new license has been entered, so must reactivate |
478 | 478 | } |
479 | 479 | return $new; |
@@ -485,8 +485,8 @@ discard block |
||
485 | 485 | * @return void |
486 | 486 | */ |
487 | 487 | public function get_actions() { |
488 | - if ( isset( $_GET['ppp_action'] ) ) { |
|
489 | - do_action( 'ppp_' . $_GET['ppp_action'], $_GET ); |
|
488 | + if (isset($_GET['ppp_action'])) { |
|
489 | + do_action( 'ppp_'.$_GET['ppp_action'], $_GET ); |
|
490 | 490 | } |
491 | 491 | } |
492 | 492 | |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | */ |
521 | 521 | function post_promoter_pro_activation_setup() { |
522 | 522 | // If the settings already exist, don't do this |
523 | - if ( get_option( 'ppp_options' ) ) { |
|
523 | + if (get_option( 'ppp_options' )) { |
|
524 | 524 | return; |
525 | 525 | } |
526 | 526 |