@@ -99,7 +99,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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. |