@@ -427,29 +427,29 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | // Download the file |
| 430 | - $tmp = \download_url( $url ); |
|
| 430 | + $tmp = \download_url( $url ); |
|
| 431 | 431 | |
| 432 | - preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches ); |
|
| 432 | + preg_match( '/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches ); |
|
| 433 | 433 | |
| 434 | - $file_array['name'] = basename( $matches[0] ); |
|
| 435 | - $file_array['tmp_name'] = $tmp; |
|
| 434 | + $file_array['name'] = basename( $matches[0] ); |
|
| 435 | + $file_array['tmp_name'] = $tmp; |
|
| 436 | 436 | |
| 437 | - // Check for download errors |
|
| 438 | - if ( is_wp_error( $tmp ) ) { |
|
| 439 | - unlink( $file_array[ 'tmp_name' ] ); |
|
| 440 | - error_log( $tmp->get_error_message() ); |
|
| 441 | - } |
|
| 437 | + // Check for download errors |
|
| 438 | + if ( is_wp_error( $tmp ) ) { |
|
| 439 | + unlink( $file_array[ 'tmp_name' ] ); |
|
| 440 | + error_log( $tmp->get_error_message() ); |
|
| 441 | + } |
|
| 442 | 442 | |
| 443 | 443 | // Pull the image into the media library |
| 444 | - $image_id = media_handle_sideload( $file_array, $post_id ); |
|
| 444 | + $image_id = media_handle_sideload( $file_array, $post_id ); |
|
| 445 | 445 | |
| 446 | - // Check for handle sideload errors. |
|
| 447 | - if ( is_wp_error( $image_id ) ) { |
|
| 448 | - unlink( $file_array['tmp_name'] ); |
|
| 449 | - error_log( $image_id->get_error_message() ); |
|
| 450 | - } |
|
| 446 | + // Check for handle sideload errors. |
|
| 447 | + if ( is_wp_error( $image_id ) ) { |
|
| 448 | + unlink( $file_array['tmp_name'] ); |
|
| 449 | + error_log( $image_id->get_error_message() ); |
|
| 450 | + } |
|
| 451 | 451 | |
| 452 | - return apply_filters( "tc_image_data", $image_id ); |
|
| 452 | + return apply_filters( "tc_image_data", $image_id ); |
|
| 453 | 453 | |
| 454 | 454 | } |
| 455 | 455 | |
@@ -472,9 +472,9 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | // If our cURL failed |
| 474 | 474 | if ( $curl_response === false ) { |
| 475 | - $info = curl_getinfo( $curl ); |
|
| 476 | - curl_close( $curl ); |
|
| 477 | - die( 'error occured during curl exec. Additional info: ' . var_export( $info ) ); |
|
| 475 | + $info = curl_getinfo( $curl ); |
|
| 476 | + curl_close( $curl ); |
|
| 477 | + die( 'error occured during curl exec. Additional info: ' . var_export( $info ) ); |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | curl_close( $curl ); |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | $char = "0123456789abcdefghijklmnopqrstuvwxyz"; |
| 621 | 621 | |
| 622 | 622 | $user_length = mt_rand( 5, 20 ); |
| 623 | - $domain_length = mt_rand( 7, 12 ); |
|
| 623 | + $domain_length = mt_rand( 7, 12 ); |
|
| 624 | 624 | |
| 625 | 625 | for ( $i = 1; $i <= $user_length; $i++ ){ |
| 626 | 626 | $user .= substr( $char, mt_rand( 0, strlen( $char ) ), 1 ); |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | * @see load_plugin_textdomain |
| 95 | 95 | */ |
| 96 | 96 | public function load_textdomain() { |
| 97 | - load_plugin_textdomain( 'dummybot', FALSE, basename( dirname( $this->definitions->file ) ) . '/languages/' ); |
|
| 97 | + load_plugin_textdomain( 'dummybot', FALSE, basename( dirname( $this->definitions->file ) ) . '/languages/' ); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | } |
@@ -166,20 +166,20 @@ |
||
| 166 | 166 | |
| 167 | 167 | // Query for our terms |
| 168 | 168 | $args = array( |
| 169 | - 'hide_empty' => false, |
|
| 170 | - 'meta_query' => array( |
|
| 169 | + 'hide_empty' => false, |
|
| 170 | + 'meta_query' => array( |
|
| 171 | 171 | 'relation' => 'OR', |
| 172 | - array( |
|
| 173 | - 'key' => 'dummypress_test_data', |
|
| 174 | - 'value' => '__test__', |
|
| 175 | - 'compare' => '=' |
|
| 172 | + array( |
|
| 173 | + 'key' => 'dummypress_test_data', |
|
| 174 | + 'value' => '__test__', |
|
| 175 | + 'compare' => '=' |
|
| 176 | 176 | ), |
| 177 | 177 | array( |
| 178 | 178 | 'key' => 'evans_test_content', |
| 179 | 179 | 'value' => '__test__', |
| 180 | 180 | 'compare' => '=' |
| 181 | 181 | ), |
| 182 | - ) |
|
| 182 | + ) |
|
| 183 | 183 | ); |
| 184 | 184 | |
| 185 | 185 | $terms = get_terms( $slug, $args ); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | global $wp_roles; |
| 138 | 138 | $clean_roles = array(); |
| 139 | 139 | |
| 140 | - $role_names = $wp_roles->get_names(); |
|
| 140 | + $role_names = $wp_roles->get_names(); |
|
| 141 | 141 | $flipped = array_flip( $role_names ); |
| 142 | 142 | |
| 143 | 143 | // Loop through all available roles |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
| 184 | 184 | foreach ( $post_types as $post_type ) : |
| 185 | 185 | |
| 186 | - $this->delete( $post_type->name ); |
|
| 186 | + $this->delete( $post_type->name ); |
|
| 187 | 187 | |
| 188 | 188 | endforeach; |
| 189 | 189 | |
@@ -228,10 +228,10 @@ discard block |
||
| 228 | 228 | 'number' => 500, |
| 229 | 229 | 'meta_query' => array( |
| 230 | 230 | 'relation' => 'OR', |
| 231 | - array( |
|
| 232 | - 'key' => 'dummypress_test_data', |
|
| 233 | - 'value' => '__test__', |
|
| 234 | - 'compare' => '=' |
|
| 231 | + array( |
|
| 232 | + 'key' => 'dummypress_test_data', |
|
| 233 | + 'value' => '__test__', |
|
| 234 | + 'compare' => '=' |
|
| 235 | 235 | ), |
| 236 | 236 | array( |
| 237 | 237 | 'key' => 'evans_test_content', |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
| 287 | 287 | foreach ( $post_types as $post_type ) : |
| 288 | 288 | |
| 289 | - return $this->delete( $post_type->name ); |
|
| 289 | + return $this->delete( $post_type->name ); |
|
| 290 | 290 | |
| 291 | 291 | endforeach; |
| 292 | 292 | |
@@ -324,10 +324,10 @@ discard block |
||
| 324 | 324 | 'posts_per_page' => 500, |
| 325 | 325 | 'meta_query' => array( |
| 326 | 326 | 'relation' => 'OR', |
| 327 | - array( |
|
| 328 | - 'key' => 'dummypress_test_data', |
|
| 329 | - 'value' => '__test__', |
|
| 330 | - 'compare' => '=' |
|
| 327 | + array( |
|
| 328 | + 'key' => 'dummypress_test_data', |
|
| 329 | + 'value' => '__test__', |
|
| 330 | + 'compare' => '=' |
|
| 331 | 331 | ), |
| 332 | 332 | array( |
| 333 | 333 | 'key' => 'evans_test_content', |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $class = str_replace( __NAMESPACE__ . '\\', '', $class ); |
|
| 31 | + $class = str_replace( __NAMESPACE__ . '\\', '', $class ); |
|
| 32 | 32 | |
| 33 | 33 | $nss = array( |
| 34 | 34 | 'Abstracts', |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | if ( in_array( $namespace[1], $nss ) ){ |
| 40 | - $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '/\1', $class ) ); |
|
| 41 | - $class = str_replace( '\\', '', $class ); |
|
| 42 | - $file = dirname( __FILE__ ) . '/' . $class . '.php'; |
|
| 43 | - } else { |
|
| 44 | - $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '-\\1', $class ) ); |
|
| 45 | - $file = dirname( __FILE__ ) . '/includes/class-' . $class . '.php'; |
|
| 46 | - } |
|
| 40 | + $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '/\1', $class ) ); |
|
| 41 | + $class = str_replace( '\\', '', $class ); |
|
| 42 | + $file = dirname( __FILE__ ) . '/' . $class . '.php'; |
|
| 43 | + } else { |
|
| 44 | + $class = strtolower( preg_replace( '/(?<!^)([A-Z])/', '-\\1', $class ) ); |
|
| 45 | + $file = dirname( __FILE__ ) . '/includes/class-' . $class . '.php'; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | if ( is_readable( $file ) ) { |
| 49 | 49 | require_once( $file ); |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | // Register hook providers and views. |
| 83 | 83 | plugin()->register_hooks( new AdminPage() ) |
| 84 | 84 | ->register_hooks( new Ajax() ) |
| 85 | - ->register_view( new Views\Posts() ) |
|
| 86 | - ->register_view( new Views\Terms() ) |
|
| 85 | + ->register_view( new Views\Posts() ) |
|
| 86 | + ->register_view( new Views\Terms() ) |
|
| 87 | 87 | ->register_view( new Views\Users() ) |
| 88 | 88 | ->register_view( new Views\Various() ) |
| 89 | 89 | ->register_type( new Types\Post() ) |
@@ -4,12 +4,12 @@ |
||
| 4 | 4 | |
| 5 | 5 | // If uninstall is not called from WordPress, exit |
| 6 | 6 | if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 7 | - exit(); |
|
| 7 | + exit(); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | // Check if the current user has priveledges to run this method |
| 11 | 11 | if ( ! current_user_can( 'activate_plugins' ) ){ |
| 12 | - return; |
|
| 12 | + return; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | require dirname( __FILE__ ) . '/includes/class-delete.php'; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * @see check_admin_page, check_airplane_mode, check_internet, check_splashbase |
| 26 | 26 | * |
| 27 | - * @return boolean Status of connection to Internet/Splashbase. |
|
| 27 | + * @return null|boolean Status of connection to Internet/Splashbase. |
|
| 28 | 28 | */ |
| 29 | 29 | public function test(){ |
| 30 | 30 | |
@@ -306,6 +306,9 @@ |
||
| 306 | 306 | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | + /** |
|
| 310 | + * @param string $source |
|
| 311 | + */ |
|
| 309 | 312 | private function add_source( $fields, $source ){ |
| 310 | 313 | |
| 311 | 314 | if ( empty( $fields ) || empty( $source ) ){ |