@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * @since 2.2.3 |
| 18 | 18 | */ |
| 19 | 19 | public static function init() { |
| 20 | - if ( ! current_user_can( 'manage_options' ) ) { |
|
| 20 | + if ( ! current_user_can( 'manage_options' )) { |
|
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -38,34 +38,34 @@ discard block |
||
| 38 | 38 | $number = self::get_count(); |
| 39 | 39 | $shares = ppp_get_shceduled_crons(); |
| 40 | 40 | |
| 41 | - if ( ! empty( $shares ) ) { |
|
| 41 | + if ( ! empty($shares)) { |
|
| 42 | 42 | $limited_shares = array_slice( $shares, 0, $number, true ); |
| 43 | 43 | ?> |
| 44 | 44 | <div id="future-tweets" class="activity-block"> |
| 45 | 45 | <h4><?php _e( 'Post-Related shares', 'ppp-tweets' ); ?></h4> |
| 46 | 46 | <ul> |
| 47 | 47 | <?php |
| 48 | - foreach ( $limited_shares as $key => $share ) { |
|
| 48 | + foreach ($limited_shares as $key => $share) { |
|
| 49 | 49 | $ppp_data = $share; |
| 50 | 50 | $timestamp = $ppp_data['timestamp']; |
| 51 | 51 | |
| 52 | 52 | $name_parts = explode( '_', $ppp_data['args'][1] ); |
| 53 | - $service = isset( $name_parts[3] ) ? $name_parts[3] : 'tw'; |
|
| 54 | - $builder = 'ppp_' . $service . '_build_share_message'; |
|
| 53 | + $service = isset($name_parts[3]) ? $name_parts[3] : 'tw'; |
|
| 54 | + $builder = 'ppp_'.$service.'_build_share_message'; |
|
| 55 | 55 | |
| 56 | 56 | $post_id = $ppp_data['args'][0]; |
| 57 | - $date = $timestamp + ( get_option( 'gmt_offset' ) * 3600 ); |
|
| 57 | + $date = $timestamp + (get_option( 'gmt_offset' ) * 3600); |
|
| 58 | 58 | $content = ''; |
| 59 | - if ( function_exists( $builder ) ) { |
|
| 60 | - $content = $builder( $ppp_data['args'][0], $ppp_data['args'][1], false ); |
|
| 59 | + if (function_exists( $builder )) { |
|
| 60 | + $content = $builder( $ppp_data['args'][0], $ppp_data['args'][1], false ); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $regex = "@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@"; |
| 64 | 64 | $content = preg_replace( $regex, '', $content ); |
| 65 | 65 | ?> |
| 66 | 66 | <li> |
| 67 | - <span class="meta"><i class="dashicons icon-ppp-<?php echo $service; ?>"></i> <?php echo date_i18n( 'M jS, ' . get_option( 'time_format' ), $date ); ?></span> |
|
| 68 | - <a href="<?php echo admin_url( 'post.php?post=' . $post_id . '&action=edit' ); ?>"><?php echo $content; ?></a> |
|
| 67 | + <span class="meta"><i class="dashicons icon-ppp-<?php echo $service; ?>"></i> <?php echo date_i18n( 'M jS, '.get_option( 'time_format' ), $date ); ?></span> |
|
| 68 | + <a href="<?php echo admin_url( 'post.php?post='.$post_id.'&action=edit' ); ?>"><?php echo $content; ?></a> |
|
| 69 | 69 | </li> |
| 70 | 70 | <?php } ?> |
| 71 | 71 | </ul> |
@@ -87,18 +87,18 @@ discard block |
||
| 87 | 87 | $recent_post = $recent_posts[0]; |
| 88 | 88 | $post_type = get_post_type_object( $recent_post['post_type'] ); |
| 89 | 89 | $post_type_name = $post_type->labels->singular_name; |
| 90 | - $edit_url = admin_url( 'post.php?post=' . $recent_post['ID'] . '&action=edit' ); |
|
| 90 | + $edit_url = admin_url( 'post.php?post='.$recent_post['ID'].'&action=edit' ); |
|
| 91 | 91 | |
| 92 | - switch( $recent_post['post_status'] ) { |
|
| 92 | + switch ($recent_post['post_status']) { |
|
| 93 | 93 | case 'draft': |
| 94 | - $relative_time = __( '<a href="%s">Configure them</a> for your draft ' . $post_type_name, 'ppp-txt' ); |
|
| 94 | + $relative_time = __( '<a href="%s">Configure them</a> for your draft '.$post_type_name, 'ppp-txt' ); |
|
| 95 | 95 | break; |
| 96 | 96 | case 'future': |
| 97 | - $relative_time = __( '<a href="%s">Schedule one</a> for your upcoming ' . $post_type_name, 'ppp-txt' ); |
|
| 97 | + $relative_time = __( '<a href="%s">Schedule one</a> for your upcoming '.$post_type_name, 'ppp-txt' ); |
|
| 98 | 98 | break; |
| 99 | 99 | case 'publish': |
| 100 | 100 | default: |
| 101 | - $relative_time = __( '<a href="%s">Schedule one</a> for your most recent ' . $post_type_name, 'ppp-txt' ); |
|
| 101 | + $relative_time = __( '<a href="%s">Schedule one</a> for your most recent '.$post_type_name, 'ppp-txt' ); |
|
| 102 | 102 | break; |
| 103 | 103 | |
| 104 | 104 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @since 2.2.3 |
| 120 | 120 | */ |
| 121 | 121 | public static function config() { |
| 122 | - if ( ! empty( $_POST['number_of_tweets'] ) ) { |
|
| 122 | + if ( ! empty($_POST['number_of_tweets'])) { |
|
| 123 | 123 | update_option( 'ppp_dashboard_twitter_count', absint( $_POST['number_of_tweets'] ) ); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | private static function get_count() { |
| 140 | 140 | $stored_count = get_option( 'ppp_dashboard_shares_count' ); |
| 141 | 141 | |
| 142 | - $stored_count = empty( $stored_count ) || ! is_numeric( $stored_count ) ? 5 : absint( $stored_count ); |
|
| 142 | + $stored_count = empty($stored_count) || ! is_numeric( $stored_count ) ? 5 : absint( $stored_count ); |
|
| 143 | 143 | |
| 144 | - return ! empty( $stored_count ) ? $stored_count : 5; |
|
| 144 | + return ! empty($stored_count) ? $stored_count : 5; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | } |
| 148 | -add_action('wp_dashboard_setup', array('PPP_Dashboard_Shares','init') ); |
|
| 148 | +add_action( 'wp_dashboard_setup', array( 'PPP_Dashboard_Shares', 'init' ) ); |
|
@@ -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 | |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | <?php _e( 'License Key', 'ppp-txt' ); ?><br /><span style="font-size: x-small;"><?php _e( 'Enter your license key', 'ppp-txt' ); ?></span> |
| 27 | 27 | </th> |
| 28 | 28 | <td> |
| 29 | - <input id="ppp_license_key" name="_ppp_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $license ); ?>" /><?php if( $status !== false && $status == 'valid' ) { ?> |
|
| 29 | + <input id="ppp_license_key" name="_ppp_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $license ); ?>" /><?php if ($status !== false && $status == 'valid') { ?> |
|
| 30 | 30 | <span style="color:green;"> <?php _e( 'active', 'ppp-txt' ); ?></span><?php } ?> |
| 31 | 31 | </td> |
| 32 | 32 | </tr> |
| 33 | 33 | |
| 34 | - <?php if( false !== $license ) { ?> |
|
| 34 | + <?php if (false !== $license) { ?> |
|
| 35 | 35 | <tr valign="top"> |
| 36 | 36 | <th scope="row" valign="top"> |
| 37 | 37 | <?php _e( 'Activate License', 'ppp-txt' ); ?> |
| 38 | 38 | </th> |
| 39 | 39 | <td> |
| 40 | - <?php if( $status !== false && $status == 'valid' ) { ?> |
|
| 40 | + <?php if ($status !== false && $status == 'valid') { ?> |
|
| 41 | 41 | <?php wp_nonce_field( 'ppp_deactivate_nonce', 'ppp_deactivate_nonce' ); ?> |
| 42 | 42 | <input type="submit" class="button-secondary" name="ppp_license_deactivate" value="<?php _e( 'Deactivate License', 'ppp-txt' ); ?>"/> |
| 43 | 43 | <?php } else { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | <span style="font-size: x-small;"><a href="#" onclick="jQuery('#ppp-text-helper').toggle(); return false;"><?php _e( 'Default Text Tips', 'ppp-txt' ); ?></a></span> |
| 54 | 54 | </th> |
| 55 | 55 | <td> |
| 56 | - <?php $default_text = isset( $ppp_options['default_text'] ) ? $ppp_options['default_text'] : ''; ?> |
|
| 56 | + <?php $default_text = isset($ppp_options['default_text']) ? $ppp_options['default_text'] : ''; ?> |
|
| 57 | 57 | <input type="text" class="regular-text" name="ppp_options[default_text]" value="<?php echo $default_text; ?>" placeholder="Post Title will be used if empty" size="50" /> |
| 58 | 58 | <p id="ppp-text-helper" style="display: none"> |
| 59 | 59 | <small> |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | <br /> |
| 64 | 64 | <?php _e( 'Possible Replacements:', 'ppp-txt' ); ?> |
| 65 | 65 | <br /> |
| 66 | - <?php foreach( ppp_get_text_tokens() as $token ): ?> |
|
| 66 | + <?php foreach (ppp_get_text_tokens() as $token): ?> |
|
| 67 | 67 | <code>{<?php echo $token['token']; ?>}</code> - <?php echo $token['description']; ?><br /> |
| 68 | 68 | <?php endforeach; ?> |
| 69 | 69 | </small> |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | <th scope="row"><?php _e( 'Post Types', 'ppp-txt' ); ?><br /><span style="font-size: x-small;"><?php _e( 'What post types do you want to schedule for?', 'ppp-txt' ); ?></span></th> |
| 76 | 76 | <td> |
| 77 | 77 | <?php $post_types = ppp_supported_post_types(); ?> |
| 78 | - <?php foreach ( $post_types as $post_type => $type_data ): ?> |
|
| 79 | - <?php $value = ( isset( $ppp_options['post_types'] ) && isset( $ppp_options['post_types'][$post_type] ) ) ? true : false; ?> |
|
| 78 | + <?php foreach ($post_types as $post_type => $type_data): ?> |
|
| 79 | + <?php $value = (isset($ppp_options['post_types']) && isset($ppp_options['post_types'][$post_type])) ? true : false; ?> |
|
| 80 | 80 | <input type="checkbox" name="ppp_options[post_types][<?php echo $post_type; ?>]" value="1" id="<?php echo $post_type; ?>" <?php checked( true, $value, true ); ?> /> |
| 81 | 81 | <label for="<?php echo $post_type; ?>"><?php echo $type_data->labels->name; ?></label></br /> |
| 82 | 82 | <?php endforeach; ?> |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | <th scope="row"><?php _e( 'Advanced', 'ppp-txt' ); ?><br /><span style="font-size: x-small;"><?php _e( 'Tools for troubleshooting and advanced usage', 'ppp-txt' ); ?></span></th> |
| 88 | 88 | <td> |
| 89 | 89 | <p> |
| 90 | - <?php $debug_enabled = isset( $ppp_options['enable_debug'] ) ? true : false; ?> |
|
| 90 | + <?php $debug_enabled = isset($ppp_options['enable_debug']) ? true : false; ?> |
|
| 91 | 91 | <input type="checkbox" name="ppp_options[enable_debug]" <?php checked( true, $debug_enabled, true ); ?> value="1" /> <?php _e( 'Enable Debug', 'ppp-txt' ); ?> |
| 92 | 92 | </p> |
| 93 | 93 | <p> |
| 94 | - <?php $delete_on_uninstall = isset( $ppp_options['delete_on_uninstall'] ) ? true : false; ?> |
|
| 94 | + <?php $delete_on_uninstall = isset($ppp_options['delete_on_uninstall']) ? true : false; ?> |
|
| 95 | 95 | <input type="checkbox" name="ppp_options[delete_on_uninstall]" <?php checked( true, $delete_on_uninstall, true ); ?> value="1" /> <?php _e( 'Delete All Data On Uninstall', 'ppp-txt' ); ?> |
| 96 | 96 | </p> |
| 97 | 97 | </td> |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | <?php wp_nonce_field( 'ppp-share-settings' ); ?> |
| 127 | 127 | <h3><?php _e( 'Social Media Accounts', 'ppp-txt' ); ?></h3> |
| 128 | 128 | <?php |
| 129 | - require_once PPP_PATH . 'includes/admin/class-accounts-table.php'; |
|
| 129 | + require_once PPP_PATH.'includes/admin/class-accounts-table.php'; |
|
| 130 | 130 | |
| 131 | 131 | $accounts_table = new PPP_Accounts_Table(); |
| 132 | 132 | $accounts_table->prepare_items(); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $accounts_table->display(); |
| 135 | 135 | ?> |
| 136 | 136 | <table class="form-table"> |
| 137 | - <?php $analytics_option = isset( $ppp_share_settings['analytics'] ) ? $ppp_share_settings['analytics'] : 0; ?> |
|
| 137 | + <?php $analytics_option = isset($ppp_share_settings['analytics']) ? $ppp_share_settings['analytics'] : 0; ?> |
|
| 138 | 138 | <tr valign="top"> |
| 139 | 139 | <th scope="row" valign="top"> |
| 140 | 140 | <?php _e( 'Analytics', 'ppp-txt' ); ?></span> |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | <hr /> |
| 174 | 174 | <small><?php _e( 'Here is an example of what your link will look like', 'ppp-txt' ); ?>: <br /> |
| 175 | 175 | <?php $post = wp_get_recent_posts( array( 'numberposts' => 1 ) ); ?> |
| 176 | - <?php if( count( $post ) > 0 ): ?> |
|
| 177 | - <code><?php echo ppp_generate_link( $post[0]['ID'], 'sharedate_1_' . $post[0]['ID'], false ); ?></code></small> |
|
| 176 | + <?php if (count( $post ) > 0): ?> |
|
| 177 | + <code><?php echo ppp_generate_link( $post[0]['ID'], 'sharedate_1_'.$post[0]['ID'], false ); ?></code></small> |
|
| 178 | 178 | <?php else: ?> |
| 179 | 179 | <em><?php _e( 'No posts available to generate link from.', 'ppp-txt' ); ?></em> |
| 180 | 180 | <?php endif; ?> |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | </tr> |
| 184 | 184 | |
| 185 | 185 | <?php |
| 186 | - $tw_sop = ! empty( $ppp_share_settings['twitter']['share_on_publish'] ) ? true : false; |
|
| 187 | - $fb_sop = ! empty( $ppp_share_settings['facebook']['share_on_publish'] ) ? true : false; |
|
| 188 | - $li_sop = ! empty( $ppp_share_settings['linkedin']['share_on_publish'] ) ? true : false; |
|
| 186 | + $tw_sop = ! empty($ppp_share_settings['twitter']['share_on_publish']) ? true : false; |
|
| 187 | + $fb_sop = ! empty($ppp_share_settings['facebook']['share_on_publish']) ? true : false; |
|
| 188 | + $li_sop = ! empty($ppp_share_settings['linkedin']['share_on_publish']) ? true : false; |
|
| 189 | 189 | ?> |
| 190 | 190 | <tr valign="top"> |
| 191 | 191 | <th scope="row" valign="top"> |
@@ -193,21 +193,21 @@ discard block |
||
| 193 | 193 | <small><em><?php _e( 'Enabled sharing on publish by default', 'ppp-txt' ); ?></em></small> |
| 194 | 194 | </th> |
| 195 | 195 | <td id="ppp-share-on-publish-wrapper"> |
| 196 | - <?php if ( ppp_twitter_enabled() ) : ?> |
|
| 196 | + <?php if (ppp_twitter_enabled()) : ?> |
|
| 197 | 197 | <p> |
| 198 | 198 | <input type="checkbox" id="twitter-share-on-publish" value="1" <?php checked( true, $tw_sop, true ); ?> name="ppp_share_settings[twitter][share_on_publish]" /> |
| 199 | 199 | <label for="twitter-share-on-publish"><?php _e( 'Twitter', 'ppp-txt' ); ?></label> |
| 200 | 200 | </p> |
| 201 | 201 | <?php endif; ?> |
| 202 | 202 | |
| 203 | - <?php if ( ppp_facebook_enabled() ) : ?> |
|
| 203 | + <?php if (ppp_facebook_enabled()) : ?> |
|
| 204 | 204 | <p> |
| 205 | 205 | <input type="checkbox" id="facebook-share-on-publish" value="1" <?php checked( true, $fb_sop, true ); ?> name="ppp_share_settings[facebook][share_on_publish]" /> |
| 206 | 206 | <label for="facebook-share-on-publish"><?php _e( 'Facebook', 'ppp-txt' ); ?></label> |
| 207 | 207 | </p> |
| 208 | 208 | <?php endif; ?> |
| 209 | 209 | |
| 210 | - <?php if ( ppp_linkedin_enabled() ) : ?> |
|
| 210 | + <?php if (ppp_linkedin_enabled()) : ?> |
|
| 211 | 211 | <p> |
| 212 | 212 | <input type="checkbox" id="linkedin-share-on-publish" value="1" <?php checked( true, $li_sop, true ); ?> name="ppp_share_settings[linkedin][share_on_publish]" /> |
| 213 | 213 | <label for="linkedin-share-on-publish"><?php _e( 'LinkedIn', 'ppp-txt' ); ?></label> |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | </tr> |
| 235 | 235 | |
| 236 | 236 | <?php |
| 237 | - $shortener = isset( $ppp_share_settings['shortener'] ) ? $ppp_share_settings['shortener'] : false; |
|
| 237 | + $shortener = isset($ppp_share_settings['shortener']) ? $ppp_share_settings['shortener'] : false; |
|
| 238 | 238 | ?> |
| 239 | 239 | <tr valign="top"> |
| 240 | 240 | <th scope="row" valign="top"> |
@@ -247,8 +247,8 @@ discard block |
||
| 247 | 247 | <?php do_action( 'ppp_url_shorteners', $shortener ); ?> |
| 248 | 248 | </select> |
| 249 | 249 | </p> |
| 250 | - <?php if ( $shortener ) : ?> |
|
| 251 | - <?php do_action( 'ppp_shortener_settings-' . $shortener ); ?> |
|
| 250 | + <?php if ($shortener) : ?> |
|
| 251 | + <?php do_action( 'ppp_shortener_settings-'.$shortener ); ?> |
|
| 252 | 252 | <?php endif; ?> |
| 253 | 253 | </td> |
| 254 | 254 | </tr> |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | .wp-list-table .column-content { width: 50%; } |
| 282 | 282 | </style> |
| 283 | 283 | <?php |
| 284 | - require_once PPP_PATH . 'includes/admin/class-schedule-table.php'; |
|
| 284 | + require_once PPP_PATH.'includes/admin/class-schedule-table.php'; |
|
| 285 | 285 | $schedule_table = new PPP_Schedule_Table(); |
| 286 | 286 | $schedule_table->prepare_items(); |
| 287 | 287 | ?> |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | <div id="icon-options-general" class="icon32"></div><h1><?php _e( 'Post Promoter Pro - Scheduled Shares', 'ppp-txt' ); ?></h1> |
| 290 | 290 | <?php $schedule_table->display() ?> |
| 291 | 291 | </div> |
| 292 | - <?php if ( ppp_is_shortener_enabled() ): ?> |
|
| 292 | + <?php if (ppp_is_shortener_enabled()): ?> |
|
| 293 | 293 | <p> |
| 294 | 294 | <small><?php _e( 'NOTICE: Schedule view does not show shortened links, they will be shortened at the time of sharing', 'ppp-txt' ); ?></small> |
| 295 | 295 | </p> |
@@ -307,24 +307,24 @@ discard block |
||
| 307 | 307 | <div class="wrap"> |
| 308 | 308 | <div id="icon-options-general" class="icon32"></div><h1><?php _e( 'Post Promoter Pro - System Info', 'ppp-txt' ); ?></h1> |
| 309 | 309 | <textarea style="font-family: Menlo, Monaco, monospace; white-space: pre" onclick="this.focus();this.select()" readonly cols="150" rows="35"> |
| 310 | - SITE_URL: <?php echo site_url() . "\n"; ?> |
|
| 311 | - HOME_URL: <?php echo home_url() . "\n"; ?> |
|
| 310 | + SITE_URL: <?php echo site_url()."\n"; ?> |
|
| 311 | + HOME_URL: <?php echo home_url()."\n"; ?> |
|
| 312 | 312 | |
| 313 | - PPP Version: <?php echo PPP_VERSION . "\n"; ?> |
|
| 314 | - WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?> |
|
| 313 | + PPP Version: <?php echo PPP_VERSION."\n"; ?> |
|
| 314 | + WordPress Version: <?php echo get_bloginfo( 'version' )."\n"; ?> |
|
| 315 | 315 | |
| 316 | 316 | PPP SETTINGS: |
| 317 | 317 | <?php |
| 318 | - foreach ( $ppp_options as $name => $value ) { |
|
| 319 | - if ( $value == false ) { |
|
| 318 | + foreach ($ppp_options as $name => $value) { |
|
| 319 | + if ($value == false) { |
|
| 320 | 320 | $value = 'false'; |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | - if ( $value == '1' ) { |
|
| 323 | + if ($value == '1') { |
|
| 324 | 324 | $value = 'true'; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - echo $name . ': ' . maybe_serialize( $value ) . "\n\t"; |
|
| 327 | + echo $name.': '.maybe_serialize( $value )."\n\t"; |
|
| 328 | 328 | } |
| 329 | 329 | ?> |
| 330 | 330 | |
@@ -333,61 +333,61 @@ discard block |
||
| 333 | 333 | $plugins = get_plugins(); |
| 334 | 334 | $active_plugins = get_option( 'active_plugins', array() ); |
| 335 | 335 | |
| 336 | - foreach ( $plugins as $plugin_path => $plugin ) { |
|
| 336 | + foreach ($plugins as $plugin_path => $plugin) { |
|
| 337 | 337 | // If the plugin isn't active, don't show it. |
| 338 | - if ( ! in_array( $plugin_path, $active_plugins ) ) { |
|
| 338 | + if ( ! in_array( $plugin_path, $active_plugins )) { |
|
| 339 | 339 | continue; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - echo $plugin['Name']; ?>: <?php echo $plugin['Version'] ."\n\t"; |
|
| 342 | + echo $plugin['Name']; ?>: <?php echo $plugin['Version']."\n\t"; |
|
| 343 | 343 | |
| 344 | 344 | } |
| 345 | 345 | ?> |
| 346 | 346 | |
| 347 | 347 | CURRENT THEME: |
| 348 | 348 | <?php |
| 349 | - if ( get_bloginfo( 'version' ) < '3.4' ) { |
|
| 350 | - $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
| 351 | - echo $theme_data['Name'] . ': ' . $theme_data['Version']; |
|
| 349 | + if (get_bloginfo( 'version' ) < '3.4') { |
|
| 350 | + $theme_data = get_theme_data( get_stylesheet_directory().'/style.css' ); |
|
| 351 | + echo $theme_data['Name'].': '.$theme_data['Version']; |
|
| 352 | 352 | } else { |
| 353 | 353 | $theme_data = wp_get_theme(); |
| 354 | - echo $theme_data->Name . ': ' . $theme_data->Version; |
|
| 354 | + echo $theme_data->Name.': '.$theme_data->Version; |
|
| 355 | 355 | } |
| 356 | 356 | ?> |
| 357 | 357 | |
| 358 | 358 | |
| 359 | - Multi-site: <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n" ?> |
|
| 359 | + Multi-site: <?php echo is_multisite() ? 'Yes'."\n" : 'No'."\n" ?> |
|
| 360 | 360 | |
| 361 | 361 | ADVANCED INFO: |
| 362 | - PHP Version: <?php echo PHP_VERSION . "\n"; ?> |
|
| 363 | - MySQL Version: <?php echo $wpdb->db_version() . "\n"; ?> |
|
| 364 | - Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?> |
|
| 362 | + PHP Version: <?php echo PHP_VERSION."\n"; ?> |
|
| 363 | + MySQL Version: <?php echo $wpdb->db_version()."\n"; ?> |
|
| 364 | + Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE']."\n"; ?> |
|
| 365 | 365 | |
| 366 | - PHP Memory Limit: <?php echo ini_get( 'memory_limit' ) . "\n"; ?> |
|
| 367 | - PHP Post Max Size: <?php echo ini_get( 'post_max_size' ) . "\n"; ?> |
|
| 368 | - PHP Time Limit: <?php echo ini_get( 'max_execution_time' ) . "\n"; ?> |
|
| 366 | + PHP Memory Limit: <?php echo ini_get( 'memory_limit' )."\n"; ?> |
|
| 367 | + PHP Post Max Size: <?php echo ini_get( 'post_max_size' )."\n"; ?> |
|
| 368 | + PHP Time Limit: <?php echo ini_get( 'max_execution_time' )."\n"; ?> |
|
| 369 | 369 | |
| 370 | - WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?> |
|
| 371 | - SCRIPT_DEBUG: <?php echo defined( 'SCRIPT_DEBUG' ) ? SCRIPT_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?> |
|
| 370 | + WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled'."\n" : 'Disabled'."\n" : 'Not set'."\n" ?> |
|
| 371 | + SCRIPT_DEBUG: <?php echo defined( 'SCRIPT_DEBUG' ) ? SCRIPT_DEBUG ? 'Enabled'."\n" : 'Disabled'."\n" : 'Not set'."\n" ?> |
|
| 372 | 372 | |
| 373 | - WP Table Prefix: <?php echo "Length: ". strlen( $wpdb->prefix ); echo " Status:"; if ( strlen( $wpdb->prefix )>16 ) {echo " ERROR: Too Long";} else {echo " Acceptable";} echo "\n"; ?> |
|
| 373 | + WP Table Prefix: <?php echo "Length: ".strlen( $wpdb->prefix ); echo " Status:"; if (strlen( $wpdb->prefix ) > 16) {echo " ERROR: Too Long"; } else {echo " Acceptable"; } echo "\n"; ?> |
|
| 374 | 374 | |
| 375 | - Show On Front: <?php echo get_option( 'show_on_front' ) . "\n" ?> |
|
| 376 | - Page On Front: <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ) . ' #' . $id . "\n" ?> |
|
| 377 | - Page For Posts: <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ) . ' #' . $id . "\n" ?> |
|
| 375 | + Show On Front: <?php echo get_option( 'show_on_front' )."\n" ?> |
|
| 376 | + Page On Front: <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ).' #'.$id."\n" ?> |
|
| 377 | + Page For Posts: <?php $id = get_option( 'page_on_front' ); echo get_the_title( $id ).' #'.$id."\n" ?> |
|
| 378 | 378 | |
| 379 | - Session: <?php echo isset( $_SESSION ) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?> |
|
| 379 | + Session: <?php echo isset($_SESSION) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?> |
|
| 380 | 380 | Session Name: <?php echo esc_html( ini_get( 'session.name' ) ); ?><?php echo "\n"; ?> |
| 381 | 381 | Cookie Path: <?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?><?php echo "\n"; ?> |
| 382 | 382 | Save Path: <?php echo esc_html( ini_get( 'session.save_path' ) ); ?><?php echo "\n"; ?> |
| 383 | 383 | Use Cookies: <?php echo ini_get( 'session.use_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?> |
| 384 | 384 | Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?> |
| 385 | 385 | |
| 386 | - UPLOAD_MAX_FILESIZE: <?php if ( function_exists( 'phpversion' ) ) echo ini_get( 'upload_max_filesize' ); ?><?php echo "\n"; ?> |
|
| 387 | - POST_MAX_SIZE: <?php if ( function_exists( 'phpversion' ) ) echo ini_get( 'post_max_size' ); ?><?php echo "\n"; ?> |
|
| 386 | + UPLOAD_MAX_FILESIZE: <?php if (function_exists( 'phpversion' )) echo ini_get( 'upload_max_filesize' ); ?><?php echo "\n"; ?> |
|
| 387 | + POST_MAX_SIZE: <?php if (function_exists( 'phpversion' )) echo ini_get( 'post_max_size' ); ?><?php echo "\n"; ?> |
|
| 388 | 388 | WordPress Memory Limit: <?php echo WP_MEMORY_LIMIT; ?><?php echo "\n"; ?> |
| 389 | - DISPLAY ERRORS: <?php echo ( ini_get( 'display_errors' ) ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A'; ?><?php echo "\n"; ?> |
|
| 390 | - FSOCKOPEN: <?php echo ( function_exists( 'fsockopen' ) ) ? __( 'Your server supports fsockopen.', 'ppp-txt' ) : __( 'Your server does not support fsockopen.', 'ppp-txt' ); ?><?php echo "\n"; ?> |
|
| 389 | + DISPLAY ERRORS: <?php echo (ini_get( 'display_errors' )) ? 'On ('.ini_get( 'display_errors' ).')' : 'N/A'; ?><?php echo "\n"; ?> |
|
| 390 | + FSOCKOPEN: <?php echo (function_exists( 'fsockopen' )) ? __( 'Your server supports fsockopen.', 'ppp-txt' ) : __( 'Your server does not support fsockopen.', 'ppp-txt' ); ?><?php echo "\n"; ?> |
|
| 391 | 391 | </textarea> |
| 392 | 392 | </div> |
| 393 | 393 | <?php |
@@ -1,13 +1,13 @@ 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 | |
| 8 | 8 | function ppp_upgrade_notices() { |
| 9 | 9 | |
| 10 | - if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'ppp-about' || $_GET['page'] == 'ppp-upgrades' ) ) { |
|
| 10 | + if (isset($_GET['page']) && ($_GET['page'] == 'ppp-about' || $_GET['page'] == 'ppp-upgrades')) { |
|
| 11 | 11 | return; // Don't show notices on the upgrades page |
| 12 | 12 | } |
| 13 | 13 | |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // Sequential Orders was the first stepped upgrade, so check if we have a stalled upgrade |
| 17 | 17 | $resume_upgrade = ppp_maybe_resume_upgrade(); |
| 18 | - if ( ! empty( $resume_upgrade ) ) { |
|
| 18 | + if ( ! empty($resume_upgrade)) { |
|
| 19 | 19 | |
| 20 | 20 | $resume_url = add_query_arg( $resume_upgrade, admin_url( 'index.php' ) ); |
| 21 | 21 | printf( |
| 22 | - '<div class="error"><p>' . __( 'Post Promoter Pro needs to complete a database upgrade that was previously started, click <a href="%s">here</a> to resume the upgrade.', 'ppp-txt' ) . '</p></div>', |
|
| 22 | + '<div class="error"><p>'.__( 'Post Promoter Pro needs to complete a database upgrade that was previously started, click <a href="%s">here</a> to resume the upgrade.', 'ppp-txt' ).'</p></div>', |
|
| 23 | 23 | esc_url( $resume_url ) |
| 24 | 24 | ); |
| 25 | 25 | |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | // Include all 'Stepped' upgrade process notices in this else statement, |
| 29 | 29 | // to avoid having a pending, and new upgrade suggested at the same time |
| 30 | 30 | |
| 31 | - if ( version_compare( $ppp_version, '2.2', '<' ) || ! ppp_has_upgrade_completed( 'upgrade_post_meta' ) ) { |
|
| 31 | + if (version_compare( $ppp_version, '2.2', '<' ) || ! ppp_has_upgrade_completed( 'upgrade_post_meta' )) { |
|
| 32 | 32 | printf( |
| 33 | - '<div class="notice notice-info"><p>' . __( 'Post Promoter Pro needs to upgrade share override data, click <a href="%s">here</a> to start the upgrade.', 'ppp-txt' ) . '</p></div>', |
|
| 33 | + '<div class="notice notice-info"><p>'.__( 'Post Promoter Pro needs to upgrade share override data, click <a href="%s">here</a> to start the upgrade.', 'ppp-txt' ).'</p></div>', |
|
| 34 | 34 | esc_url( admin_url( 'index.php?page=ppp-upgrades&ppp-upgrade=upgrade_post_meta' ) ) |
| 35 | 35 | ); |
| 36 | 36 | } |
@@ -52,17 +52,17 @@ discard block |
||
| 52 | 52 | $upgrades_executed = false; |
| 53 | 53 | |
| 54 | 54 | // We don't have a version yet, so we need to run the upgrader |
| 55 | - if ( !$ppp_version && PPP_VERSION == '1.3' ) { |
|
| 55 | + if ( ! $ppp_version && PPP_VERSION == '1.3') { |
|
| 56 | 56 | ppp_v13_upgrades(); |
| 57 | 57 | $upgrades_executed = true; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if ( version_compare( $ppp_version, 2.1, '<' ) ) { |
|
| 60 | + if (version_compare( $ppp_version, 2.1, '<' )) { |
|
| 61 | 61 | ppp_v21_upgrades(); |
| 62 | 62 | $upgrades_executed = true; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if ( $upgrades_executed || version_compare( $ppp_version, PPP_VERSION, '<' ) ) { |
|
| 65 | + if ($upgrades_executed || version_compare( $ppp_version, PPP_VERSION, '<' )) { |
|
| 66 | 66 | set_transient( '_ppp_activation_redirect', '1', 60 ); |
| 67 | 67 | update_option( 'ppp_version', PPP_VERSION ); |
| 68 | 68 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $doing_upgrade = get_option( 'ppp_doing_upgrade', false ); |
| 82 | 82 | |
| 83 | - if ( empty( $doing_upgrade ) ) { |
|
| 83 | + if (empty($doing_upgrade)) { |
|
| 84 | 84 | return false; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -96,22 +96,22 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | function ppp_v13_upgrades() { |
| 98 | 98 | global $ppp_share_settings; |
| 99 | - $uq_status = ( isset( $ppp_share_settings['ppp_unique_links'] ) && $ppp_share_settings['ppp_unique_links'] == '1' ) ? $ppp_share_settings['ppp_unique_links'] : 0; |
|
| 100 | - $ga_status = ( isset( $ppp_share_settings['ppp_ga_tags'] ) && $ppp_share_settings['ppp_ga_tags'] == '1' ) ? $ppp_share_settings['ppp_ga_tags'] : 0; |
|
| 99 | + $uq_status = (isset($ppp_share_settings['ppp_unique_links']) && $ppp_share_settings['ppp_unique_links'] == '1') ? $ppp_share_settings['ppp_unique_links'] : 0; |
|
| 100 | + $ga_status = (isset($ppp_share_settings['ppp_ga_tags']) && $ppp_share_settings['ppp_ga_tags'] == '1') ? $ppp_share_settings['ppp_ga_tags'] : 0; |
|
| 101 | 101 | |
| 102 | - if ( $uq_status ) { |
|
| 102 | + if ($uq_status) { |
|
| 103 | 103 | $ppp_share_settings['analytics'] = 'unique_links'; |
| 104 | - unset( $ppp_share_settings['ppp_unique_links'] ); |
|
| 105 | - } elseif ( $ga_status ) { |
|
| 104 | + unset($ppp_share_settings['ppp_unique_links']); |
|
| 105 | + } elseif ($ga_status) { |
|
| 106 | 106 | $ppp_share_settings['analytics'] = 'google_analytics'; |
| 107 | - unset( $ppp_share_settings['ppp_ga_tags'] ); |
|
| 107 | + unset($ppp_share_settings['ppp_ga_tags']); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | update_option( 'ppp_share_settings', $ppp_share_settings ); |
| 111 | 111 | |
| 112 | 112 | global $ppp_options; |
| 113 | 113 | $ppp_options['default_text'] = '{post_title}'; |
| 114 | - $ppp_options['days'] = array( 'day1' => 'on', 'day2' => 'on', 'day3' => 'on', 'day4' => 'on', 'day5' => 'on', 'day6' => 'on'); |
|
| 114 | + $ppp_options['days'] = array( 'day1' => 'on', 'day2' => 'on', 'day3' => 'on', 'day4' => 'on', 'day5' => 'on', 'day6' => 'on' ); |
|
| 115 | 115 | |
| 116 | 116 | update_option( 'ppp_options', $ppp_options ); |
| 117 | 117 | } |
@@ -133,29 +133,29 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | function ppp_v22_postmeta_upgrade() { |
| 135 | 135 | |
| 136 | - if( ! current_user_can( 'manage_options' ) ) { |
|
| 136 | + if ( ! current_user_can( 'manage_options' )) { |
|
| 137 | 137 | wp_die( __( 'You do not have permission to do upgrades', 'ppp-txt' ), __( 'Error', 'ppp-txt' ), array( 'response' => 403 ) ); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | ignore_user_abort( true ); |
| 141 | 141 | |
| 142 | - if ( ! ini_get( 'safe_mode' ) ) { |
|
| 143 | - @set_time_limit(0); |
|
| 142 | + if ( ! ini_get( 'safe_mode' )) { |
|
| 143 | + @set_time_limit( 0 ); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | global $wpdb; |
| 147 | 147 | |
| 148 | 148 | |
| 149 | - $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; |
|
| 149 | + $step = isset($_GET['step']) ? absint( $_GET['step'] ) : 1; |
|
| 150 | 150 | $number = 25; |
| 151 | - $offset = $step == 1 ? 0 : ( $step - 1 ) * $number; |
|
| 151 | + $offset = $step == 1 ? 0 : ($step - 1) * $number; |
|
| 152 | 152 | |
| 153 | - if ( $step < 2 ) { |
|
| 153 | + if ($step < 2) { |
|
| 154 | 154 | // Check if we have any payments before moving on |
| 155 | 155 | $sql = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_ppp_post_override_data' LIMIT 1"; |
| 156 | 156 | $has_overrides = $wpdb->get_col( $sql ); |
| 157 | 157 | |
| 158 | - if( empty( $has_overrides ) ) { |
|
| 158 | + if (empty($has_overrides)) { |
|
| 159 | 159 | // We had no payments, just complete |
| 160 | 160 | update_option( 'ppp_version', preg_replace( '/[^0-9.].*/', '', PPP_VERSION ) ); |
| 161 | 161 | ppp_set_upgrade_complete( 'upgrade_post_meta' ); |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; |
|
| 167 | + $total = isset($_GET['total']) ? absint( $_GET['total'] ) : false; |
|
| 168 | 168 | |
| 169 | - if ( empty( $total ) || $total <= 1 ) { |
|
| 169 | + if (empty($total) || $total <= 1) { |
|
| 170 | 170 | $total_sql = "SELECT COUNT(post_id) as total FROM $wpdb->postmeta WHERE meta_key = '_ppp_post_override_data'"; |
| 171 | 171 | $results = $wpdb->get_row( $total_sql, 0 ); |
| 172 | 172 | |
@@ -176,48 +176,48 @@ discard block |
||
| 176 | 176 | $results = $wpdb->get_results( $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '_ppp_post_override_data' ORDER BY meta_id DESC LIMIT %d,%d;", $offset, $number ) ); |
| 177 | 177 | $new_post_meta = array(); |
| 178 | 178 | |
| 179 | - if ( $results ) { |
|
| 180 | - foreach ( $results as $result ) { |
|
| 179 | + if ($results) { |
|
| 180 | + foreach ($results as $result) { |
|
| 181 | 181 | |
| 182 | 182 | $share_key = 1; |
| 183 | 183 | |
| 184 | 184 | $override_data = unserialize( $result->meta_value ); |
| 185 | 185 | |
| 186 | - foreach ( $override_data as $day => $values ) { |
|
| 186 | + foreach ($override_data as $day => $values) { |
|
| 187 | 187 | |
| 188 | - if ( ! isset( $values['enabled'] ) ) { |
|
| 188 | + if ( ! isset($values['enabled'])) { |
|
| 189 | 189 | continue; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $text = ! empty( $values['text'] ) ? $values['text'] : ''; |
|
| 193 | - $time = ! empty( $values['time'] ) ? $values['time'] : '8:00am'; |
|
| 192 | + $text = ! empty($values['text']) ? $values['text'] : ''; |
|
| 193 | + $time = ! empty($values['time']) ? $values['time'] : '8:00am'; |
|
| 194 | 194 | |
| 195 | 195 | $post = get_post( $result->post_id ); |
| 196 | 196 | $days_ahead = substr( $day, -1 ); |
| 197 | - $date = date( 'm\/d\/Y', strtotime( $post->post_date . '+' . $days_ahead . ' days' ) ); |
|
| 197 | + $date = date( 'm\/d\/Y', strtotime( $post->post_date.'+'.$days_ahead.' days' ) ); |
|
| 198 | 198 | $image = ''; |
| 199 | 199 | $attachment_id = ''; |
| 200 | 200 | |
| 201 | - if ( ! empty( $values['use_image'] ) ) { |
|
| 201 | + if ( ! empty($values['use_image'])) { |
|
| 202 | 202 | $thumb_id = get_post_thumbnail_id( $result->post_id ); |
| 203 | 203 | $thumb_url = wp_get_attachment_image_src( $thumb_id, 'ppp-tw-share-image', true ); |
| 204 | 204 | |
| 205 | - if ( isset( $thumb_url[0] ) && ! empty( $thumb_url[0] ) && !strpos( $thumb_url[0], 'wp-includes/images/media/default.png' ) ) { |
|
| 205 | + if (isset($thumb_url[0]) && ! empty($thumb_url[0]) && ! strpos( $thumb_url[0], 'wp-includes/images/media/default.png' )) { |
|
| 206 | 206 | $thumb_url = $thumb_url[0]; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if ( ! empty( $thumb_id ) && ! empty( $thumb_url ) ) { |
|
| 209 | + if ( ! empty($thumb_id) && ! empty($thumb_url)) { |
|
| 210 | 210 | $attachment_id = $thumb_id; |
| 211 | 211 | $image = $thumb_url; |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - $new_post_meta[$share_key] = array ( |
|
| 215 | + $new_post_meta[$share_key] = array( |
|
| 216 | 216 | 'date' => $date, |
| 217 | 217 | 'time' => $time, |
| 218 | 218 | 'text' => $text, |
| 219 | - 'image' => ! empty( $image ) ? $image : '', |
|
| 220 | - 'attachment_id' => ! empty( $attachment_id ) ? $attachment_id : '' |
|
| 219 | + 'image' => ! empty($image) ? $image : '', |
|
| 220 | + 'attachment_id' => ! empty($attachment_id) ? $attachment_id : '' |
|
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | $share_key++; |
@@ -41,17 +41,17 @@ discard block |
||
| 41 | 41 | * @uses $this->get_logs_to_prune() Returns array of posts via get_posts of logs to prune |
| 42 | 42 | * @uses $this->prune_old_logs() Deletes the logs that we don't want anymore |
| 43 | 43 | */ |
| 44 | - public function prune_logs(){ |
|
| 44 | + public function prune_logs() { |
|
| 45 | 45 | |
| 46 | 46 | $should_we_prune = apply_filters( 'wp_logging_should_we_prune', false ); |
| 47 | 47 | |
| 48 | - if ( $should_we_prune === false ){ |
|
| 48 | + if ($should_we_prune === false) { |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $logs_to_prune = $this->get_logs_to_prune(); |
| 53 | 53 | |
| 54 | - if ( isset( $logs_to_prune ) && ! empty( $logs_to_prune ) ){ |
|
| 54 | + if (isset($logs_to_prune) && ! empty($logs_to_prune)) { |
|
| 55 | 55 | $this->prune_old_logs( $logs_to_prune ); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @filter wp_logging_force_delete_log Allows user to override the force delete setting which bypasses the trash |
| 71 | 71 | */ |
| 72 | - private function prune_old_logs( $logs ){ |
|
| 72 | + private function prune_old_logs( $logs ) { |
|
| 73 | 73 | |
| 74 | 74 | $force = apply_filters( 'wp_logging_force_delete_log', true ); |
| 75 | 75 | |
| 76 | - foreach( $logs as $l ){ |
|
| 76 | + foreach ($logs as $l) { |
|
| 77 | 77 | wp_delete_post( $l->ID, $force ); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @filter wp_logging_prune_when Users can change how long ago we are looking for logs to prune |
| 94 | 94 | * @filter wp_logging_prune_query_args Gives users access to change any query args for pruning |
| 95 | 95 | */ |
| 96 | - private function get_logs_to_prune(){ |
|
| 96 | + private function get_logs_to_prune() { |
|
| 97 | 97 | |
| 98 | 98 | $how_old = apply_filters( 'wp_logging_prune_when', '2 weeks ago' ); |
| 99 | 99 | |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | $types = self::log_types(); |
| 186 | 186 | |
| 187 | - foreach ( $types as $type ) { |
|
| 188 | - if( ! term_exists( $type, 'wp_log_type' ) ) { |
|
| 187 | + foreach ($types as $type) { |
|
| 188 | + if ( ! term_exists( $type, 'wp_log_type' )) { |
|
| 189 | 189 | wp_insert_term( $type, 'wp_log_type' ); |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -270,15 +270,15 @@ discard block |
||
| 270 | 270 | $log_id = wp_insert_post( $args ); |
| 271 | 271 | |
| 272 | 272 | // set the log type, if any |
| 273 | - if( $log_data['log_type'] && self::valid_type( $log_data['log_type'] ) ) { |
|
| 273 | + if ($log_data['log_type'] && self::valid_type( $log_data['log_type'] )) { |
|
| 274 | 274 | wp_set_object_terms( $log_id, $log_data['log_type'], 'wp_log_type', false ); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | 278 | // set log meta, if any |
| 279 | - if( $log_id && ! empty( $log_meta ) ) { |
|
| 280 | - foreach( (array) $log_meta as $key => $meta ) { |
|
| 281 | - update_post_meta( $log_id, '_wp_log_' . sanitize_key( $key ), $meta ); |
|
| 279 | + if ($log_id && ! empty($log_meta)) { |
|
| 280 | + foreach ((array) $log_meta as $key => $meta) { |
|
| 281 | + update_post_meta( $log_id, '_wp_log_'.sanitize_key( $key ), $meta ); |
|
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
@@ -316,10 +316,10 @@ discard block |
||
| 316 | 316 | // store the log entry |
| 317 | 317 | $log_id = wp_update_post( $args ); |
| 318 | 318 | |
| 319 | - if( $log_id && ! empty( $log_meta ) ) { |
|
| 320 | - foreach( (array) $log_meta as $key => $meta ) { |
|
| 321 | - if( ! empty( $meta ) ) |
|
| 322 | - update_post_meta( $log_id, '_wp_log_' . sanitize_key( $key ), $meta ); |
|
| 319 | + if ($log_id && ! empty($log_meta)) { |
|
| 320 | + foreach ((array) $log_meta as $key => $meta) { |
|
| 321 | + if ( ! empty($meta)) |
|
| 322 | + update_post_meta( $log_id, '_wp_log_'.sanitize_key( $key ), $meta ); |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | $query_args = wp_parse_args( $args, $defaults ); |
| 376 | 376 | |
| 377 | - if( $query_args['log_type'] && self::valid_type( $query_args['log_type'] ) ) { |
|
| 377 | + if ($query_args['log_type'] && self::valid_type( $query_args['log_type'] )) { |
|
| 378 | 378 | |
| 379 | 379 | $query_args['tax_query'] = array( |
| 380 | 380 | array( |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | $logs = get_posts( $query_args ); |
| 390 | 390 | |
| 391 | - if( $logs ) |
|
| 391 | + if ($logs) |
|
| 392 | 392 | return $logs; |
| 393 | 393 | |
| 394 | 394 | // no logs found |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | 'post_status' => 'publish' |
| 419 | 419 | ); |
| 420 | 420 | |
| 421 | - if( ! empty( $type ) && self::valid_type( $type ) ) { |
|
| 421 | + if ( ! empty($type) && self::valid_type( $type )) { |
|
| 422 | 422 | |
| 423 | 423 | $query_args['tax_query'] = array( |
| 424 | 424 | array( |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | - if( ! empty( $meta_query ) ) { |
|
| 433 | + if ( ! empty($meta_query)) { |
|
| 434 | 434 | $query_args['meta_query'] = $meta_query; |
| 435 | 435 | } |
| 436 | 436 | |