Completed
Push — update_code ( 3fafab...1c6085 )
by Armando
02:18
created
lib/class-api.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 	 *
597 597
 	 * @param string $url  The URL to request.
598 598
 	 * @param array  $args Arguments to be posted with the request.
599
-	 * @return object An object containing details about this request.
599
+	 * @return string An object containing details about this request.
600 600
 	 */
601 601
 	private function _request( $url, $args = array() ) {
602 602
 		// Prefix the full pod URL if necessary.
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 	 * @see WP_Error::__construct()
666 666
 	 * @since 1.6.0
667 667
 	 *
668
-	 * @param  string|int $code    Error code.
668
+	 * @param  string $code    Error code.
669 669
 	 * @param  string     $message Error message.
670 670
 	 * @param  mixed      $data    Error data.
671 671
 	 */
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -315,9 +315,9 @@
 block discarded – undo
315 315
 
316 316
 		// If we are already logged in and not forcing a relogin, return.
317 317
 		if ( ! $force &&
318
-		     $username === $this->_username &&
319
-		     $password === $this->_password &&
320
-		     $this->is_logged_in()
318
+				 $username === $this->_username &&
319
+				 $password === $this->_password &&
320
+				 $this->is_logged_in()
321 321
 		) {
322 322
 			return true;
323 323
 		}
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @var array
104 104
 	 */
105
-	private $_aspects = [];
105
+	private $_aspects = [ ];
106 106
 
107 107
 	/**
108 108
 	 * The list of user's connected services, which get set after ever http request.
109 109
 	 *
110 110
 	 * @var array
111 111
 	 */
112
-	private $_services = [];
112
+	private $_services = [ ];
113 113
 
114 114
 	/**
115 115
 	 * List of regex expressions used to filter out details from http request responses.
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
 		$this->_is_logged_in = false;
373 373
 		$this->_username     = null;
374 374
 		$this->_password     = null;
375
-		$this->_aspects      = [];
376
-		$this->_services     = [];
375
+		$this->_aspects      = [ ];
376
+		$this->_services     = [ ];
377 377
 	}
378 378
 
379 379
 	/**
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 		$this->logout();
386 386
 		$this->_last_error   = null;
387 387
 		$this->_token        = null;
388
-		$this->_cookies      = [];
388
+		$this->_cookies      = [ ];
389 389
 		$this->_last_request = null;
390 390
 	}
391 391
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 	 *
399 399
 	 * @return bool|object Return the response data of the new diaspora* post if successfully posted, else false.
400 400
 	 */
401
-	public function post( $text, $aspects = 'public', array $extra_data = [] ) {
401
+	public function post( $text, $aspects = 'public', array $extra_data = [ ] ) {
402 402
 		// Are we logged in?
403 403
 		if ( ! $this->_check_login() ) {
404 404
 			return false;
@@ -594,11 +594,11 @@  discard block
 block discarded – undo
594 594
 				/** @var array $raw_list */
595 595
 
596 596
 				// In case this fetch is forced, empty the list.
597
-				$list = [];
597
+				$list = [ ];
598 598
 
599 599
 				if ( 'aspects' === $type ) {
600 600
 					// Add the 'public' aspect, as it's global and not user specific.
601
-					$list['public'] = __( 'Public', 'wp-to-diaspora' );
601
+					$list[ 'public' ] = __( 'Public', 'wp-to-diaspora' );
602 602
 
603 603
 					// Add all user specific aspects.
604 604
 					foreach ( $raw_list as $aspect ) {
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 	 *
626 626
 	 * @return object An object containing details about this request.
627 627
 	 */
628
-	private function _request( $url, array $args = [] ) {
628
+	private function _request( $url, array $args = [ ] ) {
629 629
 		// Prefix the full pod URL if necessary.
630 630
 		if ( 0 === strpos( $url, '/' ) ) {
631 631
 			$url = $this->get_pod_url( $url );
@@ -642,12 +642,12 @@  discard block
 block discarded – undo
642 642
 		// If the certificate bundle has been downloaded manually, use that instead.
643 643
 		// NOTE: This should actually never be necessary, it's a fallback!
644 644
 		if ( file_exists( WP2D_DIR . '/cacert.pem' ) ) {
645
-			$defaults['sslcertificates'] = WP2D_DIR . '/cacert.pem';
645
+			$defaults[ 'sslcertificates' ] = WP2D_DIR . '/cacert.pem';
646 646
 		}
647 647
 
648 648
 		// Set the correct cookie.
649 649
 		if ( ! empty( $this->_cookies ) ) {
650
-			$defaults['cookies'] = $this->_cookies;
650
+			$defaults[ 'cookies' ] = $this->_cookies;
651 651
 		}
652 652
 
653 653
 		$args = wp_parse_args( $args, $defaults );
@@ -679,8 +679,8 @@  discard block
 block discarded – undo
679 679
 		}
680 680
 
681 681
 		// Save the latest cookies.
682
-		if ( isset( $response['cookies'] ) ) {
683
-			$this->_cookies = $response['cookies'];
682
+		if ( isset( $response[ 'cookies' ] ) ) {
683
+			$this->_cookies = $response[ 'cookies' ];
684 684
 		}
685 685
 
686 686
 		// Return the last request details.
Please login to merge, or discard this patch.
lib/class-options.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 	/**
738 738
 	 * Validate checkboxes, make them either true or false.
739 739
 	 *
740
-	 * @param string|array $checkboxes Checkboxes to validate.
740
+	 * @param string[] $checkboxes Checkboxes to validate.
741 741
 	 * @param array        $options    Options values themselves.
742 742
 	 * @return array The validated options.
743 743
 	 */
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	/**
752 752
 	 * Validate single-select fields and make sure their selected value are valid.
753 753
 	 *
754
-	 * @param string|array $selects Name(s) of the select fields.
754
+	 * @param string $selects Name(s) of the select fields.
755 755
 	 * @param array        $options Options values themselves.
756 756
 	 * @return array The validated options.
757 757
 	 */
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 	/**
768 768
 	 * Validate multi-select fields and make sure their selected values are valid.
769 769
 	 *
770
-	 * @param string|array $selects Name(s) of the select fields.
770
+	 * @param string $selects Name(s) of the select fields.
771 771
 	 * @param array        $options Options values themselves.
772 772
 	 * @return array The validated options.
773 773
 	 */
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 	 * Validate the passed aspects or services.
822 822
 	 *
823 823
 	 * @param array $aspects_services List of aspects or services that need to be validated.
824
-	 * @param array $default          Default value if not valid.
824
+	 * @param string[] $default          Default value if not valid.
825 825
 	 * @return array The validated list of aspects or services.
826 826
 	 */
827 827
 	public function validate_aspects_services( &$aspects_services, $default = array() ) {
Please login to merge, or discard this patch.
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -435,8 +435,11 @@  discard block
 block discarded – undo
435 435
 		if ( 'settings_page_wp_to_diaspora' === get_current_screen()->id ) : ?>
436 436
 			<label><?php echo $checkbox; ?><?php esc_html_e( 'Yes' ); ?></label>
437 437
 			<p class="description"><?php echo esc_html( $description ); ?></p>
438
-		<?php else : ?>
439
-			<label title="<?php echo esc_attr( $description ); ?>"><?php echo $checkbox; ?><?php esc_html_e( 'Show "Posted at" link?', 'wp-to-diaspora' ); ?></label>
438
+		<?php else {
439
+	: ?>
440
+			<label title="<?php echo esc_attr( $description );
441
+}
442
+?>"><?php echo $checkbox; ?><?php esc_html_e( 'Show "Posted at" link?', 'wp-to-diaspora' ); ?></label>
440 443
 		<?php endif;
441 444
 	}
442 445
 
@@ -474,9 +477,11 @@  discard block
 block discarded – undo
474 477
 
475 478
 		<?php if ( $on_settings_page ) : ?>
476 479
 			<p class="description"><?php echo esc_html( $description ); ?></p>
477
-		<?php else : ?>
480
+		<?php else {
481
+	: ?>
478 482
 			</label>
479 483
 		<?php endif;
484
+}
480 485
 	}
481 486
 
482 487
 	/**
@@ -558,8 +563,11 @@  discard block
 block discarded – undo
558 563
 				<?php foreach ( $list as $id => $name ) : ?>
559 564
 					<label><input type="checkbox" name="wp_to_diaspora_settings[<?php echo esc_attr( $type ); ?>][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( in_array( $id, $items ) ); ?>><?php echo esc_html( $name ); ?></label>
560 565
 				<?php endforeach; ?>
561
-			<?php else : ?>
562
-				<label><?php echo $empty_label; ?></label>
566
+			<?php else {
567
+	: ?>
568
+				<label><?php echo $empty_label;
569
+}
570
+?></label>
563 571
 			<?php endif; ?>
564 572
 		</div>
565 573
 		<p class="description">
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 	 * @var array
28 28
 	 */
29 29
 	private static $_default_options = [
30
-		'pod_list'           => [],
31
-		'aspects_list'       => [],
32
-		'services_list'      => [],
30
+		'pod_list'           => [ ],
31
+		'aspects_list'       => [ ],
32
+		'services_list'      => [ ],
33 33
 		'post_to_diaspora'   => true,
34 34
 		'enabled_post_types' => [ 'post' ],
35 35
 		'fullentrylink'      => true,
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		'tags_to_post'       => [ 'global', 'custom', 'post' ],
38 38
 		'global_tags'        => '',
39 39
 		'aspects'            => [ 'public' ],
40
-		'services'           => [],
40
+		'services'           => [ ],
41 41
 		'version'            => WP2D_VERSION,
42 42
 	];
43 43
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 * @return string Return the currently selected tab.
107 107
 	 */
108 108
 	private function _current_tab( $default = 'defaults' ) {
109
-		$tab = ( isset ( $_GET['tab'] ) ? $_GET['tab'] : $default );
109
+		$tab = ( isset ( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $default );
110 110
 
111 111
 		// If the pod settings aren't configured yet, open the 'Setup' tab.
112 112
 		if ( ! $this->is_pod_set_up() ) {
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	private function _options_page_tabs( $return = false ) {
127 127
 		// The array defining all options sections to be shown as tabs.
128
-		$tabs = [];
128
+		$tabs = [ ];
129 129
 		if ( $this->is_pod_set_up() ) {
130
-			$tabs['defaults'] = __( 'Defaults', 'wp-to-diaspora' );
130
+			$tabs[ 'defaults' ] = __( 'Defaults', 'wp-to-diaspora' );
131 131
 		}
132 132
 
133 133
 		// Add the 'Setup' tab to the end of the list.
134
-		$tabs['setup'] = __( 'Setup', 'wp-to-diaspora' ) . '<span id="pod-connection-status" class="dashicons-before hidden"></span><span class="spinner"></span>';
134
+		$tabs[ 'setup' ] = __( 'Setup', 'wp-to-diaspora' ) . '<span id="pod-connection-status" class="dashicons-before hidden"></span><span class="spinner"></span>';
135 135
 
136 136
 		// Container for all options tabs.
137 137
 		$out = '<h2 id="options-tabs" class="nav-tab-wrapper">';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			return $tabs;
150 150
 		}
151 151
 
152
-		return [];
152
+		return [ ];
153 153
 	}
154 154
 
155 155
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				}
212 212
 
213 213
 				// Attempt to get the cacert.pem file and save it to the plugin's root directory.
214
-				if ( isset( $_GET['wp2d_temp_ssl_fix'] ) ) {
214
+				if ( isset( $_GET[ 'wp2d_temp_ssl_fix' ] ) ) {
215 215
 					$cacert_file = file_get_contents( 'http://curl.haxx.se/ca/cacert.pem' );
216 216
 					if ( $cacert_file && file_put_contents( WP2D_DIR . '/cacert.pem', $cacert_file ) ) {
217 217
 						add_settings_error(
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 				do_settings_sections( 'wp_to_diaspora_settings' );
246 246
 
247 247
 				// Get the name of the current tab, if set, else take the first one from the list.
248
-				$tab = $this->_current_tab( $page_tabs[0] );
248
+				$tab = $this->_current_tab( $page_tabs[ 0 ] );
249 249
 
250 250
 				// Add Save and Reset buttons.
251 251
 				echo '<input id="submit-' . esc_attr( $tab ) . '" name="wp_to_diaspora_settings[submit_' . esc_attr( $tab ) . ']" type="submit" class="button-primary" value="' . esc_attr__( 'Save Changes' ) . '" />&nbsp;';
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 		https://<input type="text" name="wp_to_diaspora_settings[pod]" value="<?php echo esc_attr( $this->get_option( 'pod' ) ); ?>" placeholder="e.g. joindiaspora.com" autocomplete="on" list="pod-list" required> <a id="refresh-pod-list" class="button hide-if-no-js"><?php esc_html_e( 'Refresh pod list', 'wp-to-diaspora' ); ?></a><span class="spinner"></span>
330 330
 		<datalist id="pod-list">
331 331
 			<?php foreach ( (array) $this->get_option( 'pod_list' ) as $pod ) : ?>
332
-				<option data-secure="<?php echo esc_attr( $pod['secure'] ); ?>" value="<?php echo esc_attr( $pod['domain'] ); ?>"></option>
332
+				<option data-secure="<?php echo esc_attr( $pod[ 'secure' ] ); ?>" value="<?php echo esc_attr( $pod[ 'domain' ] ); ?>"></option>
333 333
 			<?php endforeach; ?>
334 334
 		</datalist>
335 335
 		<?php
@@ -536,14 +536,14 @@  discard block
 block discarded – undo
536 536
 					esc_url( 'https://' . $this->get_option( 'pod' ) . '/services' ),
537 537
 					esc_html__( 'Show available services on my pod.', 'wp-to-diaspora' )
538 538
 				);
539
-				$empty_label    = esc_html__( 'No services connected yet.', 'wp-to-diaspora' );
539
+				$empty_label = esc_html__( 'No services connected yet.', 'wp-to-diaspora' );
540 540
 				break;
541 541
 
542 542
 			default:
543 543
 				return;
544 544
 		}
545 545
 
546
-		$items = array_filter( (array) $items ) ?: [];
546
+		$items = array_filter( (array) $items ) ? : [ ];
547 547
 
548 548
 		// Special case for this field if it's displayed on the settings page.
549 549
 		$on_settings_page = ( 'settings_page_wp_to_diaspora' === get_current_screen()->id );
@@ -676,30 +676,30 @@  discard block
 block discarded – undo
676 676
 		/* Validate all settings before saving to the database. */
677 677
 
678 678
 		// Saving the pod setup details.
679
-		if ( isset( $input['submit_setup'] ) ) {
680
-			$input['pod']      = trim( sanitize_text_field( $input['pod'] ), ' /' );
681
-			$input['username'] = sanitize_text_field( $input['username'] );
682
-			$input['password'] = sanitize_text_field( $input['password'] );
679
+		if ( isset( $input[ 'submit_setup' ] ) ) {
680
+			$input[ 'pod' ]      = trim( sanitize_text_field( $input[ 'pod' ] ), ' /' );
681
+			$input[ 'username' ] = sanitize_text_field( $input[ 'username' ] );
682
+			$input[ 'password' ] = sanitize_text_field( $input[ 'password' ] );
683 683
 
684 684
 			// If password is blank, it hasn't been changed.
685 685
 			// If new password is equal to the encrypted password already saved, it was just passed again. It happens everytime update_option('wp_to_diaspora_settings') is called.
686
-			if ( '' === $input['password'] || $this->get_option( 'password' ) === $input['password'] ) {
687
-				$input['password'] = $this->get_option( 'password' );
686
+			if ( '' === $input[ 'password' ] || $this->get_option( 'password' ) === $input[ 'password' ] ) {
687
+				$input[ 'password' ] = $this->get_option( 'password' );
688 688
 			} else {
689
-				$input['password'] = WP2D_Helpers::encrypt( $input['password'] );
689
+				$input[ 'password' ] = WP2D_Helpers::encrypt( $input[ 'password' ] );
690 690
 			}
691 691
 
692 692
 			// This is for when JS in not enabled, to make sure that the aspects and services
693 693
 			// are refetched when displaying the options page after saving.
694
-			if ( isset( $input['no_js'] ) ) {
694
+			if ( isset( $input[ 'no_js' ] ) ) {
695 695
 				set_transient( 'wp2d_no_js_force_refetch', true );
696 696
 			}
697 697
 		}
698 698
 
699 699
 		// Saving the default options.
700
-		if ( isset( $input['submit_defaults'] ) ) {
701
-			if ( ! isset( $input['enabled_post_types'] ) ) {
702
-				$input['enabled_post_types'] = [];
700
+		if ( isset( $input[ 'submit_defaults' ] ) ) {
701
+			if ( ! isset( $input[ 'enabled_post_types' ] ) ) {
702
+				$input[ 'enabled_post_types' ] = [ ];
703 703
 			}
704 704
 
705 705
 			// Checkboxes.
@@ -712,26 +712,26 @@  discard block
 block discarded – undo
712 712
 			$this->validate_multi_selects( 'tags_to_post', $input );
713 713
 
714 714
 			// Get unique, non-empty, trimmed tags and clean them up.
715
-			$this->validate_tags( $input['global_tags'] );
715
+			$this->validate_tags( $input[ 'global_tags' ] );
716 716
 
717 717
 			// Clean up the list of aspects. If the list is empty, only use the 'Public' aspect.
718
-			$this->validate_aspects_services( $input['aspects'], [ 'public' ] );
718
+			$this->validate_aspects_services( $input[ 'aspects' ], [ 'public' ] );
719 719
 
720 720
 			// Clean up the list of services.
721
-			$this->validate_aspects_services( $input['services'] );
721
+			$this->validate_aspects_services( $input[ 'services' ] );
722 722
 		}
723 723
 
724 724
 		// Reset to defaults.
725
-		if ( isset( $input['reset_defaults'] ) ) {
725
+		if ( isset( $input[ 'reset_defaults' ] ) ) {
726 726
 			// Set the input to the default options.
727 727
 			$input = self::$_default_options;
728 728
 
729 729
 			// Don't reset the fetched lists of pods, aspects and services.
730
-			unset( $input['pod_list'], $input['aspects_list'], $input['services_list'] );
730
+			unset( $input[ 'pod_list' ], $input[ 'aspects_list' ], $input[ 'services_list' ] );
731 731
 		}
732 732
 
733 733
 		// Unset all unused input fields.
734
-		unset( $input['submit_defaults'], $input['reset_defaults'], $input['submit_setup'] );
734
+		unset( $input[ 'submit_defaults' ], $input[ 'reset_defaults' ], $input[ 'submit_setup' ] );
735 735
 
736 736
 		// Parse inputs with default options and return.
737 737
 		return wp_parse_args( $input, array_merge( self::$_default_options, self::$_options ) );
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 					}
790 790
 				}
791 791
 			} else {
792
-				$options[ $select ] = [];
792
+				$options[ $select ] = [ ];
793 793
 			}
794 794
 		}
795 795
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 	 *
839 839
 	 * @return array The validated list of aspects or services.
840 840
 	 */
841
-	public function validate_aspects_services( &$aspects_services, array $default = [] ) {
841
+	public function validate_aspects_services( &$aspects_services, array $default = [ ] ) {
842 842
 		if ( empty( $aspects_services ) || ! is_array( $aspects_services ) ) {
843 843
 			$aspects_services = $default;
844 844
 		} else {
Please login to merge, or discard this patch.
lib/class-post.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 		// Unset post_to_diaspora meta field to prevent mistakenly republishing to diaspora*.
260 260
 		$meta                     = get_post_meta( $post_id, '_wp_to_diaspora', true );
261
-		$meta['post_to_diaspora'] = false;
261
+		$meta[ 'post_to_diaspora' ] = false;
262 262
 		update_post_meta( $post_id, '_wp_to_diaspora', $meta );
263 263
 
264 264
 		return true;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	private function _get_full_content() {
301 301
 		// Only allow certain shortcodes.
302 302
 		global $shortcode_tags;
303
-		$shortcode_tags_bkp = [];
303
+		$shortcode_tags_bkp = [ ];
304 304
 
305 305
 		foreach ( $shortcode_tags as $shortcode_tag => $shortcode_function ) {
306 306
 			if ( ! in_array( $shortcode_tag, apply_filters( 'wp2d_shortcodes_filter', [ 'wp_caption', 'caption', 'gallery' ] ), true ) ) {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		// Add any diaspora* tags?
377 377
 		if ( ! empty( $tags_to_post ) ) {
378 378
 			// The diaspora* tags to add to the post.
379
-			$diaspora_tags = [];
379
+			$diaspora_tags = [ ];
380 380
 
381 381
 			// Add global tags?
382 382
 			$global_tags = $options->get_option( 'global_tags' );
@@ -401,9 +401,9 @@  discard block
 block discarded – undo
401 401
 			$options->validate_tags( $diaspora_tags );
402 402
 
403 403
 			// Get all the tags and list them all nicely in a row.
404
-			$diaspora_tags_clean = [];
404
+			$diaspora_tags_clean = [ ];
405 405
 			foreach ( $diaspora_tags as $tag ) {
406
-				$diaspora_tags_clean[] = '#' . $tag;
406
+				$diaspora_tags_clean[ ] = '#' . $tag;
407 407
 			}
408 408
 
409 409
 			// Add all the found tags.
@@ -459,11 +459,11 @@  discard block
 block discarded – undo
459 459
 	private function _save_to_history( $response ) {
460 460
 		// Make sure the post history is an array.
461 461
 		if ( empty( $this->post_history ) ) {
462
-			$this->post_history = [];
462
+			$this->post_history = [ ];
463 463
 		}
464 464
 
465 465
 		// Add a new entry to the history.
466
-		$this->post_history[] = [
466
+		$this->post_history[ ] = [
467 467
 			'id'         => $response->id,
468 468
 			'guid'       => $response->guid,
469 469
 			'created_at' => $this->post->post_modified,
@@ -549,8 +549,8 @@  discard block
 block discarded – undo
549 549
 		$content = do_shortcode( $content );
550 550
 
551 551
 		// If a caption attribute is defined, we'll add it after the image.
552
-		if ( isset( $attr['caption'] ) && '' !== $attr['caption'] ) {
553
-			$content .= "\n" . $this->get_img_caption( $attr['caption'] );
552
+		if ( isset( $attr[ 'caption' ] ) && '' !== $attr[ 'caption' ] ) {
553
+			$content .= "\n" . $this->get_img_caption( $attr[ 'caption' ] );
554 554
 		}
555 555
 
556 556
 		return $content;
@@ -570,8 +570,8 @@  discard block
 block discarded – undo
570 570
 		$captiontag = current_theme_supports( 'html5', 'gallery' ) ? 'figcaption' : 'dd';
571 571
 
572 572
 		// User value.
573
-		if ( isset( $attr['captiontag'] ) ) {
574
-			$captiontag = $attr['captiontag'];
573
+		if ( isset( $attr[ 'captiontag' ] ) ) {
574
+			$captiontag = $attr[ 'captiontag' ];
575 575
 		}
576 576
 
577 577
 		// Let WordPress create the regular gallery.
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 	 * @return string Prettified gallery image caption.
596 596
 	 */
597 597
 	public function custom_gallery_regex_callback( $m ) {
598
-		return $this->get_img_caption( $m[2] );
598
+		return $this->get_img_caption( $m[ 2 ] );
599 599
 	}
600 600
 
601 601
 	/*
@@ -638,18 +638,18 @@  discard block
 block discarded – undo
638 638
 		$options = WP2D_Options::instance();
639 639
 
640 640
 		// Make sure we have some value for post meta fields.
641
-		$this->custom_tags = $this->custom_tags ?: [];
641
+		$this->custom_tags = $this->custom_tags ? : [ ];
642 642
 
643 643
 		// If this post is already published, don't post again to diaspora* by default.
644 644
 		$this->post_to_diaspora = ( $this->post_to_diaspora && 'publish' !== get_post_status( $this->ID ) );
645
-		$this->aspects          = $this->aspects ?: [];
646
-		$this->services         = $this->services ?: [];
645
+		$this->aspects          = $this->aspects ? : [ ];
646
+		$this->services         = $this->services ? : [ ];
647 647
 
648 648
 		// Have we already posted on diaspora*?
649 649
 		if ( is_array( $this->post_history ) ) {
650 650
 			$latest_post = end( $this->post_history );
651 651
 			?>
652
-			<p><a href="<?php echo esc_attr( $latest_post['post_url'] ); ?>" target="_blank"><?php esc_html_e( 'Already posted to diaspora*.', 'wp-to-diaspora' ); ?></a></p>
652
+			<p><a href="<?php echo esc_attr( $latest_post[ 'post_url' ] ); ?>" target="_blank"><?php esc_html_e( 'Already posted to diaspora*.', 'wp-to-diaspora' ); ?></a></p>
653 653
 			<?php
654 654
 		}
655 655
 		?>
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 		/* OK, it's safe for us to save the data now. */
685 685
 
686 686
 		// Meta data to save.
687
-		$meta_to_save = $_POST['wp_to_diaspora_settings'];
687
+		$meta_to_save = $_POST[ 'wp_to_diaspora_settings' ];
688 688
 		$options      = WP2D_Options::instance();
689 689
 
690 690
 		// Checkboxes.
@@ -697,13 +697,13 @@  discard block
 block discarded – undo
697 697
 		$options->validate_multi_selects( 'tags_to_post', $meta_to_save );
698 698
 
699 699
 		// Save custom tags as array.
700
-		$options->validate_tags( $meta_to_save['custom_tags'] );
700
+		$options->validate_tags( $meta_to_save[ 'custom_tags' ] );
701 701
 
702 702
 		// Clean up the list of aspects. If the list is empty, only use the 'Public' aspect.
703
-		$options->validate_aspects_services( $meta_to_save['aspects'], [ 'public' ] );
703
+		$options->validate_aspects_services( $meta_to_save[ 'aspects' ], [ 'public' ] );
704 704
 
705 705
 		// Clean up the list of services.
706
-		$options->validate_aspects_services( $meta_to_save['services'] );
706
+		$options->validate_aspects_services( $meta_to_save[ 'services' ] );
707 707
 
708 708
 		// Update the meta data for this post.
709 709
 		update_post_meta( $post_id, '_wp_to_diaspora', $meta_to_save );
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 	 */
719 719
 	private function _is_safe_to_save() {
720 720
 		// Verify that our nonce is set and  valid.
721
-		if ( ! ( isset( $_POST['wp_to_diaspora_meta_box_nonce'] ) && wp_verify_nonce( $_POST['wp_to_diaspora_meta_box_nonce'], 'wp_to_diaspora_meta_box' ) ) ) {
721
+		if ( ! ( isset( $_POST[ 'wp_to_diaspora_meta_box_nonce' ] ) && wp_verify_nonce( $_POST[ 'wp_to_diaspora_meta_box_nonce' ], 'wp_to_diaspora_meta_box' ) ) ) {
722 722
 			return false;
723 723
 		}
724 724
 
@@ -728,13 +728,13 @@  discard block
 block discarded – undo
728 728
 		}
729 729
 
730 730
 		// Check the user's permissions.
731
-		$permission = ( isset( $_POST['post_type'] ) && 'page' === $_POST['post_type'] ) ? 'edit_pages' : 'edit_posts';
731
+		$permission = ( isset( $_POST[ 'post_type' ] ) && 'page' === $_POST[ 'post_type' ] ) ? 'edit_pages' : 'edit_posts';
732 732
 		if ( ! current_user_can( $permission, $this->ID ) ) {
733 733
 			return false;
734 734
 		}
735 735
 
736 736
 		// Make real sure that we have some meta data to save.
737
-		if ( ! isset( $_POST['wp_to_diaspora_settings'] ) ) {
737
+		if ( ! isset( $_POST[ 'wp_to_diaspora_settings' ] ) ) {
738 738
 			return false;
739 739
 		}
740 740
 
@@ -771,10 +771,10 @@  discard block
 block discarded – undo
771 771
 			$latest_post = end( $diaspora_post_history );
772 772
 
773 773
 			// Only show if this post is showing a message and the post is a fresh share.
774
-			if ( isset( $_GET['message'] ) && $post->post_modified === $latest_post['created_at'] ) {
774
+			if ( isset( $_GET[ 'message' ] ) && $post->post_modified === $latest_post[ 'created_at' ] ) {
775 775
 				printf( '<div class="updated notice is-dismissible"><p>%1$s <a href="%2$s" target="_blank">%3$s</a></p></div>',
776 776
 					esc_html__( 'Successfully posted to diaspora*.', 'wp-to-diaspora' ),
777
-					esc_url( $latest_post['post_url'] ),
777
+					esc_url( $latest_post[ 'post_url' ] ),
778 778
 					esc_html__( 'View Post' )
779 779
 				);
780 780
 			}
@@ -788,8 +788,8 @@  discard block
 block discarded – undo
788 788
 	 */
789 789
 	public function ignore_post_error() {
790 790
 		// If "Ignore" link has been clicked, delete the post error meta data.
791
-		if ( isset( $_GET['wp2d_ignore_post_error'], $_GET['post'] ) ) {
792
-			delete_post_meta( $_GET['post'], '_wp_to_diaspora_post_error' );
791
+		if ( isset( $_GET[ 'wp2d_ignore_post_error' ], $_GET[ 'post' ] ) ) {
792
+			delete_post_meta( $_GET[ 'post' ], '_wp_to_diaspora_post_error' );
793 793
 		}
794 794
 	}
795 795
 }
Please login to merge, or discard this patch.
lib/class-contextual-help.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
 			'content' => '<p><strong>' . esc_html__( 'Enter your diaspora* login details to connect your account.', 'wp-to-diaspora' ) . '</strong></p>
124 124
 				<ul>
125 125
 					<li><strong>' . esc_html__( 'diaspora* Pod', 'wp-to-diaspora' ) . '</strong>: ' .
126
-			             esc_html__( 'This is the domain name of the pod you are on (e.g. joindiaspora.com)', 'wp-to-diaspora' ) . '<br>
126
+									 esc_html__( 'This is the domain name of the pod you are on (e.g. joindiaspora.com)', 'wp-to-diaspora' ) . '<br>
127 127
 						<em>' . sprintf( esc_html__( 'Use the "%s" button to prepopulate the input field to help choose your pod.', 'wp-to-diaspora' ), esc_html__( 'Refresh pod list', 'wp-to-diaspora' ) ) . '</em>
128 128
 					<li><strong>' . esc_html__( 'Username', 'wp-to-diaspora' ) . '</strong>: ' .
129
-			             esc_html__( 'Your diaspora* username (without the pod domain).', 'wp-to-diaspora' ) . '
129
+									 esc_html__( 'Your diaspora* username (without the pod domain).', 'wp-to-diaspora' ) . '
130 130
 					<li><strong>' . esc_html__( 'Password', 'wp-to-diaspora' ) . '</strong>: ' .
131
-			             esc_html__( 'Your diaspora* password.', 'wp-to-diaspora' ) . '
131
+									 esc_html__( 'Your diaspora* password.', 'wp-to-diaspora' ) . '
132 132
 				</ul>',
133 133
 		] );
134 134
 
@@ -139,27 +139,27 @@  discard block
 block discarded – undo
139 139
 			'content' => '<p><strong>' . esc_html__( 'Define the default posting behaviour.', 'wp-to-diaspora' ) . '</strong></p>
140 140
 				<ul>
141 141
 					<li><strong>' . esc_html__( 'Post types', 'wp-to-diaspora' ) . '</strong>: ' .
142
-			             esc_html__( 'Choose the post types that are allowed to be shared to diaspora*.', 'wp-to-diaspora' ) . '
142
+									 esc_html__( 'Choose the post types that are allowed to be shared to diaspora*.', 'wp-to-diaspora' ) . '
143 143
 					<li><strong>' . esc_html__( 'Post to diaspora*', 'wp-to-diaspora' ) . '</strong>: ' .
144
-			             esc_html__( 'Automatically share new posts to diaspora* when publishing them.', 'wp-to-diaspora' ) . '
144
+									 esc_html__( 'Automatically share new posts to diaspora* when publishing them.', 'wp-to-diaspora' ) . '
145 145
 					<li><strong>' . esc_html__( 'Show "Posted at" link?', 'wp-to-diaspora' ) . '</strong>: ' .
146
-			             esc_html__( 'Add a link back to your original post, at the bottom of the diaspora* post.', 'wp-to-diaspora' ) . '
146
+									 esc_html__( 'Add a link back to your original post, at the bottom of the diaspora* post.', 'wp-to-diaspora' ) . '
147 147
 					<li><strong>' . esc_html__( 'Display', 'wp-to-diaspora' ) . '</strong>: ' .
148
-			             esc_html__( 'Choose whether you would like to post the whole post or just the excerpt.', 'wp-to-diaspora' ) . '
148
+									 esc_html__( 'Choose whether you would like to post the whole post or just the excerpt.', 'wp-to-diaspora' ) . '
149 149
 					<li><strong>' . esc_html__( 'Tags to post', 'wp-to-diaspora' ) . '</strong>: ' .
150
-			             esc_html__( 'You can add tags to your post to make it easier to find on diaspora*.' ) . '<br>
150
+									 esc_html__( 'You can add tags to your post to make it easier to find on diaspora*.' ) . '<br>
151 151
 						<ul>
152 152
 							<li><strong>' . esc_html__( 'Global tags', 'wp-to-diaspora' ) . '</strong>: ' . esc_html__( 'Tags that apply to all posts.', 'wp-to-diaspora' ) . '
153 153
 							<li><strong>' . esc_html__( 'Custom tags', 'wp-to-diaspora' ) . '</strong>: ' . esc_html__( 'Tags that apply to individual posts (can be set on each post).', 'wp-to-diaspora' ) . '
154 154
 							<li><strong>' . esc_html__( 'Post tags', 'wp-to-diaspora' ) . '</strong>: ' . esc_html__( 'Default WordPress Tags of individual posts.', 'wp-to-diaspora' ) . '
155 155
 						</ul>
156 156
 					<li><strong>' . esc_html__( 'Global tags', 'wp-to-diaspora' ) . '</strong>: ' .
157
-			             esc_html__( 'A list of tags that gets added to every post.', 'wp-to-diaspora' ) . '
157
+									 esc_html__( 'A list of tags that gets added to every post.', 'wp-to-diaspora' ) . '
158 158
 					<li><strong>' . esc_html__( 'Aspects', 'wp-to-diaspora' ) . '</strong>: ' .
159
-			             esc_html__( 'Decide which of your diaspora* aspects can see your posts.', 'wp-to-diaspora' ) . '<br>
159
+									 esc_html__( 'Decide which of your diaspora* aspects can see your posts.', 'wp-to-diaspora' ) . '<br>
160 160
 							<em>' . sprintf( esc_html__( 'Use the "%s" button to load your aspects from diaspora*.', 'wp-to-diaspora' ), esc_html__( 'Refresh Aspects', 'wp-to-diaspora' ) ) . '</em>
161 161
 					<li><strong>' . esc_html__( 'Services', 'wp-to-diaspora' ) . '</strong>: ' .
162
-			             esc_html__( 'Choose the services your new diaspora* post gets shared to.', 'wp-to-diaspora' ) . '<br>
162
+									 esc_html__( 'Choose the services your new diaspora* post gets shared to.', 'wp-to-diaspora' ) . '<br>
163 163
 							<em>' . sprintf( esc_html__( 'Use the "%s" button to fetch the list of your connected services from diaspora*.', 'wp-to-diaspora' ), esc_html__( 'Refresh Services', 'wp-to-diaspora' ) ) . '</em>
164 164
 				</ul>',
165 165
 		] );
@@ -196,30 +196,30 @@  discard block
 block discarded – undo
196 196
 				<p>' . esc_html__( 'Lucky for you though, we have you covered if this is the case for you!', 'wp-to-diaspora' ) . '</p>
197 197
 				<ol>
198 198
 					<li><strong>' . esc_html__( 'Check the WordPress certificate bundle', 'wp-to-diaspora' ) . '</strong>: ' .
199
-			             esc_html__( 'The best option is to make sure that the WordPress internal certificate bundle is available and accessible. You should be able to find it here: "wp-includes/certificates/ca-bundle.crt".', 'wp-to-diaspora' ) . '
199
+									 esc_html__( 'The best option is to make sure that the WordPress internal certificate bundle is available and accessible. You should be able to find it here: "wp-includes/certificates/ca-bundle.crt".', 'wp-to-diaspora' ) . '
200 200
 					<li><strong>' . esc_html__( 'Get in touch with your hosting provider', 'wp-to-diaspora' ) . '</strong>: ' .
201
-			             esc_html__( 'Get in touch with your hosting provider and ask them to update the bundle on the server for you. They should know what you\'re talking about.', 'wp-to-diaspora' ) . '
201
+									 esc_html__( 'Get in touch with your hosting provider and ask them to update the bundle on the server for you. They should know what you\'re talking about.', 'wp-to-diaspora' ) . '
202 202
 					<li><strong>' . esc_html__( 'Install the CA bundle yourself', 'wp-to-diaspora' ) . '</strong>: ' .
203
-			             sprintf(
204
-				             esc_html_x(
205
-					             'If you maintain your own server, it\'s your job to keep the bundle up to date. You can find a short and simple way on how to do this %shere%s.',
206
-					             'Placeholders are HTML for a link.',
207
-					             'wp-to-diaspora'
208
-				             ),
209
-				             '<a href="http://serverfault.com/a/394835" target="_blank">', '</a>'
210
-			             ) . '
203
+									 sprintf(
204
+										 esc_html_x(
205
+											 'If you maintain your own server, it\'s your job to keep the bundle up to date. You can find a short and simple way on how to do this %shere%s.',
206
+											 'Placeholders are HTML for a link.',
207
+											 'wp-to-diaspora'
208
+										 ),
209
+										 '<a href="http://serverfault.com/a/394835" target="_blank">', '</a>'
210
+									 ) . '
211 211
 					<li><strong>' . esc_html__( 'Quick "temporary" fix', 'wp-to-diaspora' ) . '</strong>: ' .
212
-			             sprintf(
213
-				             esc_html_x(
214
-					             'As a temporary solution, you can download the up to date %sCA certificate bundle%s (Right-click &#8594; Save As...) and place the cacert.pem file at the top level of the WP to diaspora* plugin folder. This is a "last resort" option.',
215
-					             'Placeholders are HTML for links.',
216
-					             'wp-to-diaspora'
217
-				             ),
218
-				             '<a href="http://curl.haxx.se/ca/cacert.pem" download>', '</a>'
219
-			             )
220
-			             . '<br><p>' .
221
-			             $ssl_install_output
222
-			             . '</p>
212
+									 sprintf(
213
+										 esc_html_x(
214
+											 'As a temporary solution, you can download the up to date %sCA certificate bundle%s (Right-click &#8594; Save As...) and place the cacert.pem file at the top level of the WP to diaspora* plugin folder. This is a "last resort" option.',
215
+											 'Placeholders are HTML for links.',
216
+											 'wp-to-diaspora'
217
+										 ),
218
+										 '<a href="http://curl.haxx.se/ca/cacert.pem" download>', '</a>'
219
+									 )
220
+									 . '<br><p>' .
221
+									 $ssl_install_output
222
+									 . '</p>
223 223
 				</ul>
224 224
 				<p class="dashicons-before dashicons-info">' . esc_html__( 'NOTE: If you choose the temporary option, the copy procedure needs to be done every time the plugin is updated because all files get replaced!', 'wp-to-diaspora' ) . '</p>',
225 225
 		] );
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 				<p>' . esc_html__( 'There are a few important differences to the settings page:', 'wp-to-diaspora' ) . '</p>
234 234
 				<ul>
235 235
 					<li><strong>' . esc_html__( 'Already posted to diaspora*', 'wp-to-diaspora' ) . '</strong>: ' .
236
-			             esc_html__( 'If the post has already been posted to diaspora* a link to the diaspora* post will appear at the top.', 'wp-to-diaspora' ) . '
236
+									 esc_html__( 'If the post has already been posted to diaspora* a link to the diaspora* post will appear at the top.', 'wp-to-diaspora' ) . '
237 237
 					<li><strong>' . esc_html__( 'Custom tags', 'wp-to-diaspora' ) . '</strong>: ' .
238
-			             esc_html__( 'A list of tags that gets added to this post. Note that they are seperate from the WordPress post tags!', 'wp-to-diaspora' ) . '
238
+									 esc_html__( 'A list of tags that gets added to this post. Note that they are seperate from the WordPress post tags!', 'wp-to-diaspora' ) . '
239 239
 				</ul>
240 240
 				<p class="dashicons-before dashicons-info">' . esc_html__( 'If you don\'t see the meta box, make sure the post type you\'re on has been added to the "Post types" list on the settings page. Also make sure it has been selected from the "Screen Options" at the top of the screen.', 'wp-to-diaspora' ) . '</p>',
241 241
 		] );
@@ -248,17 +248,17 @@  discard block
 block discarded – undo
248 248
 				<p>' . esc_html__( 'Here are a few common errors and their possible solutions:', 'wp-to-diaspora' ) . '</p>
249 249
 				<ul>
250 250
 					<li><strong>' . esc_html( sprintf( __( 'Failed to initialise connection to pod "%s"', 'wp-to-diaspora' ), 'xyz' ) ) . '</strong>: ' .
251
-			             esc_html__( 'This could have multiple reasons.' ) . '
251
+									 esc_html__( 'This could have multiple reasons.' ) . '
252 252
 						<ul>
253 253
 							<li>' . esc_html__( 'Make sure that your pod domain is entered correctly.', 'wp-to-diaspora' ) . '
254 254
 							<li>' .
255
-			             esc_html__( 'It might be an SSL problem.', 'wp-to-diaspora' ) .
256
-			             sprintf( ' <a href="#" class="open-help-tab" data-help-tab="ssl">%s</a>',
257
-				             esc_html__( 'Learn More', 'wp-to-diaspora' ) ) . '
255
+									 esc_html__( 'It might be an SSL problem.', 'wp-to-diaspora' ) .
256
+									 sprintf( ' <a href="#" class="open-help-tab" data-help-tab="ssl">%s</a>',
257
+										 esc_html__( 'Learn More', 'wp-to-diaspora' ) ) . '
258 258
 							<li>' . esc_html__( 'The pod might be offline at the moment.', 'wp-to-diaspora' ) . '
259 259
 						</ul>
260 260
 					<li><strong>' . esc_html__( 'Login failed. Check your login details.', 'wp-to-diaspora' ) . '</strong>: ' .
261
-			             esc_html__( 'Make sure that your username and password are entered correctly.', 'wp-to-diaspora' ) . '
261
+									 esc_html__( 'Make sure that your username and password are entered correctly.', 'wp-to-diaspora' ) . '
262 262
 				</ul>',
263 263
 		] );
264 264
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			'fclose',
173 173
 			'file_get_contents',
174 174
 			'file_put_contents',
175
-		], $defined_functions['internal'] ) );
175
+		], $defined_functions[ 'internal' ] ) );
176 176
 
177 177
 		$ssl_cert_is_installed = file_exists( WP2D_DIR . '/cacert.pem' );
178 178
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	public static function get_help_tab_quick_link( $error ) {
308 308
 		$help_tab = '';
309 309
 		if ( is_wp_error( $error ) && ( $error_data = $error->get_error_data() ) && array_key_exists( 'help_tab', $error_data ) ) {
310
-			$help_tab = $error_data['help_tab'];
310
+			$help_tab = $error_data[ 'help_tab' ];
311 311
 		} elseif ( is_string( $error ) ) {
312 312
 			$help_tab = $error;
313 313
 		}
Please login to merge, or discard this patch.
wp-to-diaspora.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	private function _constants() {
101 101
 		// Are we in debugging mode?
102
-		if ( isset( $_GET['debugging'] ) ) {
102
+		if ( isset( $_GET[ 'debugging' ] ) ) {
103 103
 			define( 'WP2D_DEBUGGING', true );
104 104
 		}
105 105
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	private function _version_check() {
119 119
 		// Check for version requirements.
120
-		if ( version_compare( PHP_VERSION, $this->_min_php, '<' ) || version_compare( $GLOBALS['wp_version'], $this->_min_wp, '<' ) ) {
120
+		if ( version_compare( PHP_VERSION, $this->_min_php, '<' ) || version_compare( $GLOBALS[ 'wp_version' ], $this->_min_wp, '<' ) ) {
121 121
 			add_action( 'admin_notices', [ $this, 'deactivate' ] );
122 122
 
123 123
 			return false;
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 		deactivate_plugins( plugin_basename( __FILE__ ) );
137 137
 
138 138
 		// Get rid of the "Plugin activated" message.
139
-		unset( $_GET['activate'] );
139
+		unset( $_GET[ 'activate' ] );
140 140
 
141 141
 		// Then display the admin notice.
142 142
 		?>
143 143
 		<div class="error">
144
-			<p><?php echo esc_html( sprintf( 'WP to diaspora* requires at least WordPress %1$s (you have %2$s) and PHP %3$s (you have %4$s)!', $this->_min_wp, $GLOBALS['wp_version'], $this->_min_php, PHP_VERSION ) ); ?></p>
144
+			<p><?php echo esc_html( sprintf( 'WP to diaspora* requires at least WordPress %1$s (you have %2$s) and PHP %3$s (you have %4$s)!', $this->_min_wp, $GLOBALS[ 'wp_version' ], $this->_min_php, PHP_VERSION ) ); ?></p>
145 145
 		</div>
146 146
 		<?php
147 147
 	}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function admin_load_scripts() {
263 263
 		// Get the enabled post types to load the script for.
264
-		$enabled_post_types = WP2D_Options::instance()->get_option( 'enabled_post_types', [] );
264
+		$enabled_post_types = WP2D_Options::instance()->get_option( 'enabled_post_types', [ ] );
265 265
 
266 266
 		// Get the screen to find out where we are.
267 267
 		$screen = get_current_screen();
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 	 * @return array Links to display for plugin on plugins page.
294 294
 	 */
295 295
 	public function settings_link( $links ) {
296
-		$links[] = '<a href="' . admin_url( 'options-general.php?page=wp_to_diaspora' ) . '">' . __( 'Settings' ) . '</a>';
296
+		$links[ ] = '<a href="' . admin_url( 'options-general.php?page=wp_to_diaspora' ) . '">' . __( 'Settings' ) . '</a>';
297 297
 
298 298
 		return $links;
299 299
 	}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	private function _update_pod_list() {
307 307
 		// API url to fetch pods list from podupti.me.
308 308
 		$pod_list_url = 'http://podupti.me/api.php?format=json&key=4r45tg';
309
-		$pods         = [];
309
+		$pods         = [ ];
310 310
 
311 311
 		// Get the response from the WP_HTTP request.
312 312
 		$response = wp_safe_remote_get( $pod_list_url );
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 				$pod_list_pods = $pod_list->pods;
320 320
 				foreach ( $pod_list_pods as $pod ) {
321 321
 					if ( 'no' === $pod->hidden ) {
322
-						$pods[] = [
322
+						$pods[ ] = [
323 323
 							'secure' => $pod->secure,
324 324
 							'domain' => $pod->domain,
325 325
 						];
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	 * @todo esc_html
430 430
 	 */
431 431
 	public function check_pod_connection_status_callback() {
432
-		if ( ! defined( 'WP2D_DEBUGGING' ) && isset( $_REQUEST['debugging'] ) ) {
432
+		if ( ! defined( 'WP2D_DEBUGGING' ) && isset( $_REQUEST[ 'debugging' ] ) ) {
433 433
 			define( 'WP2D_DEBUGGING', true );
434 434
 		}
435 435
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 		if ( true === $status ) {
444 444
 			wp_send_json_success( $data );
445 445
 		} elseif ( false === $status && $this->_load_api()->has_last_error() ) {
446
-			$data['message'] = $this->_load_api()->get_last_error() . ' ' . WP2D_Contextual_Help::get_help_tab_quick_link( $this->_load_api()->get_last_error_object() );
446
+			$data[ 'message' ] = $this->_load_api()->get_last_error() . ' ' . WP2D_Contextual_Help::get_help_tab_quick_link( $this->_load_api()->get_last_error_object() );
447 447
 			wp_send_json_error( $data );
448 448
 		}
449 449
 		// If $status === null, do nothing.
Please login to merge, or discard this patch.