@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @return WP_To_Diaspora Instance of this class. |
| 82 | 82 | */ |
| 83 | 83 | public static function instance() { |
| 84 | - echo 'before: '; var_dump(self::$_instance); |
|
| 84 | + echo 'before: '; var_dump( self::$_instance ); |
|
| 85 | 85 | if ( ! isset( self::$_instance ) ) { |
| 86 | 86 | self::$_instance = new self(); |
| 87 | 87 | self::$_instance->_constants(); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | self::$_instance = null; |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | - echo 'after: '; var_dump(self::$_instance); |
|
| 95 | + echo 'after: '; var_dump( self::$_instance ); |
|
| 96 | 96 | return self::$_instance; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | private function _constants() { |
| 105 | 105 | // Are we in debugging mode? |
| 106 | - isset( $_GET['debugging'] ) && define( 'WP2D_DEBUGGING', true ); |
|
| 106 | + isset( $_GET[ 'debugging' ] ) && define( 'WP2D_DEBUGGING', true ); |
|
| 107 | 107 | |
| 108 | 108 | define( 'WP2D_DIR', dirname( __FILE__ ) ); |
| 109 | 109 | define( 'WP2D_LIB_DIR', WP2D_DIR . '/lib' ); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | private function _version_check() { |
| 121 | 121 | // Check for version requirements. |
| 122 | - if ( version_compare( $GLOBALS['wp_version'], $this->_min_wp, '<' ) |
|
| 122 | + if ( version_compare( $GLOBALS[ 'wp_version' ], $this->_min_wp, '<' ) |
|
| 123 | 123 | || version_compare( PHP_VERSION, $this->_min_php, '<' ) ) { |
| 124 | 124 | add_action( 'admin_notices', array( $this, 'deactivate' ) ); |
| 125 | 125 | return false; |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 139 | 139 | |
| 140 | 140 | // Get rid of the "Plugin activated" message. |
| 141 | - unset( $_GET['activate'] ); |
|
| 141 | + unset( $_GET[ 'activate' ] ); |
|
| 142 | 142 | |
| 143 | 143 | // Then display the admin notice. |
| 144 | 144 | ?> |
| 145 | 145 | <div class="error"> |
| 146 | - <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> |
|
| 146 | + <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> |
|
| 147 | 147 | </div> |
| 148 | 148 | <?php |
| 149 | 149 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $tags_to_post = array_filter( array( |
| 240 | 240 | ( ( false !== strpos( $tags_to_post_old, 'g' ) ) ? 'global' : null ), |
| 241 | 241 | ( ( false !== strpos( $tags_to_post_old, 'c' ) ) ? 'custom' : null ), |
| 242 | - ( ( false !== strpos( $tags_to_post_old, 'p' ) ) ? 'post' : null ), |
|
| 242 | + ( ( false !== strpos( $tags_to_post_old, 'p' ) ) ? 'post' : null ), |
|
| 243 | 243 | ) ); |
| 244 | 244 | $options->set_option( 'tags_to_post', $tags_to_post ); |
| 245 | 245 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 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 | return $links; |
| 298 | 298 | } |
| 299 | 299 | |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | if ( isset( $pod_list->pods ) ) { |
| 317 | 317 | foreach ( $pod_list->pods as $pod ) { |
| 318 | 318 | if ( 'no' === $pod->hidden ) { |
| 319 | - $pods[] = array( |
|
| 319 | + $pods[ ] = array( |
|
| 320 | 320 | 'secure' => $pod->secure, |
| 321 | 321 | 'domain' => $pod->domain, |
| 322 | 322 | ); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | * @todo esc_html |
| 424 | 424 | */ |
| 425 | 425 | public function check_pod_connection_status_callback() { |
| 426 | - if ( isset( $_REQUEST['debugging'] ) && ! defined( 'WP2D_DEBUGGING' ) ) { |
|
| 426 | + if ( isset( $_REQUEST[ 'debugging' ] ) && ! defined( 'WP2D_DEBUGGING' ) ) { |
|
| 427 | 427 | define( 'WP2D_DEBUGGING', true ); |
| 428 | 428 | } |
| 429 | 429 | |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | if ( true === $status ) { |
| 438 | 438 | wp_send_json_success( $data ); |
| 439 | 439 | } elseif ( false === $status && $this->_load_api()->has_last_error() ) { |
| 440 | - $data['message'] = $this->_load_api()->get_last_error() . ' ' . WP2D_Contextual_Help::get_help_tab_quick_link( $this->_load_api()->get_last_error_object() ); |
|
| 440 | + $data[ 'message' ] = $this->_load_api()->get_last_error() . ' ' . WP2D_Contextual_Help::get_help_tab_quick_link( $this->_load_api()->get_last_error_object() ); |
|
| 441 | 441 | wp_send_json_error( $data ); |
| 442 | 442 | } |
| 443 | 443 | // If $status === null, do nothing. |