1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Plugin Name: WP to diaspora* |
4
|
|
|
* Plugin URI: https://github.com/gutobenn/wp-to-diaspora |
5
|
|
|
* Description: Automatically shares WordPress posts on diaspora* |
6
|
|
|
* Version: 1.7.2 |
7
|
|
|
* Author: Augusto Bennemann |
8
|
|
|
* Author URI: https://github.com/gutobenn |
9
|
|
|
* Text Domain: wp-to-diaspora |
10
|
|
|
* Domain Path: /languages |
11
|
|
|
* |
12
|
|
|
* Copyright 2014-2015 Augusto Bennemann (email: gutobenn at gmail.com) |
13
|
|
|
* |
14
|
|
|
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
15
|
|
|
* General Public License as published by the Free Software Foundation; either version 2 of the License, |
16
|
|
|
* or (at your option) any later version. |
17
|
|
|
* |
18
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without |
19
|
|
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
20
|
|
|
* |
21
|
|
|
* You should have received a copy of the GNU General Public License along with this program; if not, write |
22
|
|
|
* to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
23
|
|
|
* |
24
|
|
|
* @package WP_To_Diaspora |
25
|
|
|
* @version 1.7.2 |
26
|
|
|
* @author Augusto Bennemann <[email protected]> |
27
|
|
|
* @copyright Copyright (c) 2015, Augusto Bennemann |
28
|
|
|
* @link https://github.com/gutobenn/wp-to-diaspora |
29
|
|
|
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
30
|
|
|
*/ |
31
|
|
|
|
32
|
|
|
// Exit if accessed directly. |
33
|
|
|
defined( 'ABSPATH' ) || exit; |
34
|
|
|
|
35
|
|
|
// Set the current version. |
36
|
|
|
define( 'WP2D_VERSION', '1.7.2' ); |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* WP to diaspora* main plugin class. |
40
|
|
|
*/ |
41
|
|
|
class WP_To_Diaspora { |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Only instance of this class. |
45
|
|
|
* |
46
|
|
|
* @var WP_To_Diaspora |
47
|
|
|
*/ |
48
|
|
|
private static $_instance = null; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* The minimum required WordPress version. |
52
|
|
|
* |
53
|
|
|
* @since 1.5.4 |
54
|
|
|
* |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
private $_min_wp = '3.9.2'; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* The minimum required PHP version. |
61
|
|
|
* |
62
|
|
|
* @since 1.5.4 |
63
|
|
|
* |
64
|
|
|
* @var string |
65
|
|
|
*/ |
66
|
|
|
private $_min_php = '5.3'; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Instance of the API class. |
70
|
|
|
* |
71
|
|
|
* @var WP2D_API |
72
|
|
|
*/ |
73
|
|
|
private $_api = null; |
74
|
|
|
|
75
|
|
|
private function __construct() { |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Create / Get the instance of this class. |
80
|
|
|
* |
81
|
|
|
* @return WP_To_Diaspora Instance of this class. |
82
|
|
|
*/ |
83
|
|
|
public static function instance() { |
84
|
|
|
echo 'before: '; var_dump(self::$_instance); |
|
|
|
|
85
|
|
|
if ( ! isset( self::$_instance ) ) { |
86
|
|
|
self::$_instance = new self(); |
87
|
|
|
self::$_instance->_constants(); |
88
|
|
|
if ( self::$_instance->_version_check() ) { |
89
|
|
|
self::$_instance->_includes(); |
90
|
|
|
self::$_instance->_setup(); |
91
|
|
|
} else { |
92
|
|
|
self::$_instance = null; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
echo 'after: '; var_dump(self::$_instance); |
96
|
|
|
return self::$_instance; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Define all the required constants. |
101
|
|
|
* |
102
|
|
|
* @since 1.5.0 |
103
|
|
|
*/ |
104
|
|
|
private function _constants() { |
105
|
|
|
// Are we in debugging mode? |
106
|
|
|
if ( isset( $_GET['debugging'] ) ) { |
107
|
|
|
defined( 'WP2D_DEBUGGING' ) || define( 'WP2D_DEBUGGING', true ); |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
defined( 'WP2D_DIR' ) || define( 'WP2D_DIR', dirname( __FILE__ ) ); |
111
|
|
|
defined( 'WP2D_LIB_DIR' ) || define( 'WP2D_LIB_DIR', WP2D_DIR . '/lib' ); |
112
|
|
|
defined( 'WP2D_VENDOR_DIR' ) || define( 'WP2D_VENDOR_DIR', WP2D_DIR . '/vendor' ); |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Check the minimum WordPress and PHP requirements. |
117
|
|
|
* |
118
|
|
|
* @since 1.5.4 |
119
|
|
|
* |
120
|
|
|
* @return bool If version requirements are met. |
121
|
|
|
*/ |
122
|
|
|
private function _version_check() { |
|
|
|
|
123
|
|
|
printf( |
124
|
|
|
'WP (min): %s (%s) => %s' . PHP_EOL . 'PHP (min): %s (%s) => %s' . PHP_EOL, |
125
|
|
|
$GLOBALS['wp_version'], |
126
|
|
|
$this->_min_wp, |
127
|
|
|
version_compare( $GLOBALS['wp_version'], $this->_min_wp, '<' ) ? 'fail' : 'ok', |
128
|
|
|
PHP_VERSION, |
129
|
|
|
$this->_min_php, |
130
|
|
|
version_compare( PHP_VERSION, $this->_min_php, '<' ) ? 'fail' : 'ok' |
131
|
|
|
); |
132
|
|
|
// Check for version requirements. |
133
|
|
|
if ( version_compare( $GLOBALS['wp_version'], $this->_min_wp, '<' ) |
134
|
|
|
|| version_compare( PHP_VERSION, $this->_min_php, '<' ) ) { |
135
|
|
|
add_action( 'admin_notices', array( $this, 'deactivate' ) ); |
136
|
|
|
return false; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
return true; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* Callback to deactivate plugin and display admin notice. |
144
|
|
|
* |
145
|
|
|
* @since 1.5.4 |
146
|
|
|
*/ |
147
|
|
|
public function deactivate() { |
|
|
|
|
148
|
|
|
// First of all, deactivate the plugin. |
149
|
|
|
deactivate_plugins( plugin_basename( __FILE__ ) ); |
150
|
|
|
|
151
|
|
|
// Get rid of the "Plugin activated" message. |
152
|
|
|
unset( $_GET['activate'] ); |
153
|
|
|
|
154
|
|
|
// Then display the admin notice. |
155
|
|
|
?> |
156
|
|
|
<div class="error"> |
157
|
|
|
<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> |
158
|
|
|
</div> |
159
|
|
|
<?php |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* Include all the required files. |
164
|
|
|
* |
165
|
|
|
* @since 1.5.0 |
166
|
|
|
*/ |
167
|
|
|
private function _includes() { |
168
|
|
|
require_once WP2D_VENDOR_DIR . '/autoload.php'; |
169
|
|
|
require_once WP2D_LIB_DIR . '/class-api.php'; |
170
|
|
|
require_once WP2D_LIB_DIR . '/class-contextual-help.php'; |
171
|
|
|
require_once WP2D_LIB_DIR . '/class-helpers.php'; |
172
|
|
|
require_once WP2D_LIB_DIR . '/class-options.php'; |
173
|
|
|
require_once WP2D_LIB_DIR . '/class-post.php'; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* Set up the plugin. |
178
|
|
|
*/ |
179
|
|
|
private function _setup() { |
180
|
|
|
|
181
|
|
|
// Load languages. |
182
|
|
|
add_action( 'plugins_loaded', array( $this, 'l10n' ) ); |
183
|
|
|
|
184
|
|
|
// Add "Settings" link to plugin page. |
185
|
|
|
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'settings_link' ) ); |
186
|
|
|
|
187
|
|
|
// Perform any necessary data upgrades. |
188
|
|
|
add_action( 'admin_init', array( $this, 'upgrade' ) ); |
189
|
|
|
|
190
|
|
|
// Enqueue CSS and JS scripts. |
191
|
|
|
add_action( 'admin_enqueue_scripts', array( $this, 'admin_load_scripts' ) ); |
192
|
|
|
|
193
|
|
|
// Set up the options. |
194
|
|
|
add_action( 'init', array( 'WP2D_Options', 'instance' ) ); |
195
|
|
|
|
196
|
|
|
// WP2D Post. |
197
|
|
|
add_action( 'init', array( 'WP2D_Post', 'setup' ) ); |
198
|
|
|
|
199
|
|
|
// AJAX actions for loading pods, aspects and services. |
200
|
|
|
add_action( 'wp_ajax_wp_to_diaspora_update_pod_list', array( $this, 'update_pod_list_callback' ) ); |
201
|
|
|
add_action( 'wp_ajax_wp_to_diaspora_update_aspects_list', array( $this, 'update_aspects_list_callback' ) ); |
202
|
|
|
add_action( 'wp_ajax_wp_to_diaspora_update_services_list', array( $this, 'update_services_list_callback' ) ); |
203
|
|
|
|
204
|
|
|
// Check the pod connection status on the options page. |
205
|
|
|
add_action( 'wp_ajax_wp_to_diaspora_check_pod_connection_status', array( $this, 'check_pod_connection_status_callback' ) ); |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Load the diaspora* API for ease of use. |
210
|
|
|
* |
211
|
|
|
* @return WP2D_API|boolean The API object, or false. |
212
|
|
|
*/ |
213
|
|
|
private function _load_api() { |
214
|
|
|
if ( ! isset( $this->_api ) ) { |
215
|
|
|
$this->_api = WP2D_Helpers::api_quick_connect(); |
216
|
|
|
} |
217
|
|
|
return $this->_api; |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* Initialise upgrade sequence. |
222
|
|
|
*/ |
223
|
|
|
public function upgrade() { |
224
|
|
|
// Get the current options, or assign defaults. |
225
|
|
|
$options = WP2D_Options::instance(); |
226
|
|
|
$version = $options->get_option( 'version' ); |
227
|
|
|
|
228
|
|
|
// If the versions differ, this is probably an update. Need to save updated options. |
229
|
|
|
if ( WP2D_VERSION !== $version ) { |
230
|
|
|
|
231
|
|
|
// Password is stored encrypted since version 1.2.7. |
232
|
|
|
// When upgrading to it, the plain text password is encrypted and saved again. |
233
|
|
|
if ( version_compare( $version, '1.2.7', '<' ) ) { |
234
|
|
|
$options->set_option( 'password', WP2D_Helpers::encrypt( (string) $options->get_option( 'password' ) ) ); |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
if ( version_compare( $version, '1.3.0', '<' ) ) { |
238
|
|
|
// The 'user' setting is renamed to 'username'. |
239
|
|
|
$options->set_option( 'username', $options->get_option( 'user' ) ); |
240
|
|
|
$options->set_option( 'user', null ); |
241
|
|
|
|
242
|
|
|
// Save tags as arrays instead of comma seperated values. |
243
|
|
|
$global_tags = $options->get_option( 'global_tags' ); |
244
|
|
|
$options->set_option( 'global_tags', $options->validate_tags( $global_tags ) ); |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
if ( version_compare( $version, '1.4.0', '<' ) ) { |
248
|
|
|
// Turn tags_to_post string into an array. |
249
|
|
|
$tags_to_post_old = $options->get_option( 'tags_to_post' ); |
250
|
|
|
$tags_to_post = array_filter( array( |
251
|
|
|
( ( false !== strpos( $tags_to_post_old, 'g' ) ) ? 'global' : null ), |
252
|
|
|
( ( false !== strpos( $tags_to_post_old, 'c' ) ) ? 'custom' : null ), |
253
|
|
|
( ( false !== strpos( $tags_to_post_old, 'p' ) ) ? 'post' : null ), |
254
|
|
|
) ); |
255
|
|
|
$options->set_option( 'tags_to_post', $tags_to_post ); |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
// Update version. |
259
|
|
|
$options->set_option( 'version', WP2D_VERSION ); |
260
|
|
|
$options->save(); |
261
|
|
|
} |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* Set up i18n. |
266
|
|
|
*/ |
267
|
|
|
public function l10n() { |
268
|
|
|
load_plugin_textdomain( 'wp-to-diaspora', false, 'wp-to-diaspora/languages' ); |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* Load scripts and styles for Settings and Post pages of allowed post types. |
273
|
|
|
*/ |
274
|
|
|
public function admin_load_scripts() { |
275
|
|
|
// Get the enabled post types to load the script for. |
276
|
|
|
$enabled_post_types = WP2D_Options::instance()->get_option( 'enabled_post_types', array() ); |
277
|
|
|
|
278
|
|
|
// Get the screen to find out where we are. |
279
|
|
|
$screen = get_current_screen(); |
280
|
|
|
|
281
|
|
|
// Only load the styles and scripts on the settings page and the allowed post types. |
282
|
|
|
if ( 'settings_page_wp_to_diaspora' === $screen->id || ( in_array( $screen->post_type, $enabled_post_types ) && 'post' === $screen->base ) ) { |
283
|
|
|
wp_enqueue_style( 'tag-it', plugins_url( '/css/jquery.tagit.css', __FILE__ ) ); |
284
|
|
|
wp_enqueue_style( 'chosen', plugins_url( '/css/chosen.min.css', __FILE__ ) ); |
285
|
|
|
wp_enqueue_style( 'wp-to-diaspora-admin', plugins_url( '/css/wp-to-diaspora.css', __FILE__ ) ); |
286
|
|
|
wp_enqueue_script( 'chosen', plugins_url( '/js/chosen.jquery.min.js', __FILE__ ), array( 'jquery' ), false, true ); |
287
|
|
|
wp_enqueue_script( 'tag-it', plugins_url( '/js/tag-it.min.js', __FILE__ ), array( 'jquery', 'jquery-ui-autocomplete' ), false, true ); |
288
|
|
|
wp_enqueue_script( 'wp-to-diaspora-admin', plugins_url( '/js/wp-to-diaspora.js', __FILE__ ), array( 'jquery' ), false, true ); |
289
|
|
|
// Javascript-specific l10n. |
290
|
|
|
wp_localize_script( 'wp-to-diaspora-admin', 'WP2DL10n', array( |
291
|
|
|
'no_services_connected' => __( 'No services connected yet.', 'wp-to-diaspora' ), |
292
|
|
|
'sure_reset_defaults' => __( 'Are you sure you want to reset to default values?', 'wp-to-diaspora' ), |
293
|
|
|
'conn_testing' => __( 'Testing connection...', 'wp-to-diaspora' ), |
294
|
|
|
'conn_successful' => __( 'Connection successful.', 'wp-to-diaspora' ), |
295
|
|
|
'conn_failed' => __( 'Connection failed.', 'wp-to-diaspora' ), |
296
|
|
|
) ); |
297
|
|
|
} |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* Add the "Settings" link to the plugins page. |
302
|
|
|
* |
303
|
|
|
* @param array $links Links to display for plugin on plugins page. |
304
|
|
|
* @return array Links to display for plugin on plugins page. |
305
|
|
|
*/ |
306
|
|
|
public function settings_link( $links ) { |
307
|
|
|
$links[] = '<a href="' . admin_url( 'options-general.php?page=wp_to_diaspora' ) . '">' . __( 'Settings' ) . '</a>'; |
308
|
|
|
return $links; |
309
|
|
|
} |
310
|
|
|
|
311
|
|
|
/** |
312
|
|
|
* Fetch the updated list of pods from podupti.me and save it to the settings. |
313
|
|
|
* |
314
|
|
|
* @return array The list of pods. |
315
|
|
|
*/ |
316
|
|
|
private function _update_pod_list() { |
317
|
|
|
// API url to fetch pods list from podupti.me. |
318
|
|
|
$pod_list_url = 'http://podupti.me/api.php?format=json&key=4r45tg'; |
319
|
|
|
$pods = array(); |
320
|
|
|
|
321
|
|
|
// Get the response from the WP_HTTP request. |
322
|
|
|
$response = wp_safe_remote_get( $pod_list_url ); |
323
|
|
|
|
324
|
|
|
if ( $json = wp_remote_retrieve_body( $response ) ) { |
325
|
|
|
$pod_list = json_decode( $json ); |
326
|
|
|
|
327
|
|
|
if ( isset( $pod_list->pods ) ) { |
328
|
|
|
foreach ( $pod_list->pods as $pod ) { |
329
|
|
|
if ( 'no' === $pod->hidden ) { |
330
|
|
|
$pods[] = array( |
331
|
|
|
'secure' => $pod->secure, |
332
|
|
|
'domain' => $pod->domain, |
333
|
|
|
); |
334
|
|
|
} |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
$options = WP2D_Options::instance(); |
338
|
|
|
$options->set_option( 'pod_list', $pods ); |
339
|
|
|
$options->save(); |
340
|
|
|
} |
341
|
|
|
} |
342
|
|
|
|
343
|
|
|
return $pods; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* Update the list of pods and return them for use with AJAX. |
348
|
|
|
*/ |
349
|
|
|
public function update_pod_list_callback() { |
350
|
|
|
wp_send_json( $this->_update_pod_list() ); |
351
|
|
|
} |
352
|
|
|
|
353
|
|
|
/** |
354
|
|
|
* Fetch the list of aspects or services and save them to the settings. |
355
|
|
|
* |
356
|
|
|
* NOTE: When updating the lists, always force a fresh fetch. |
357
|
|
|
* |
358
|
|
|
* @param string $type Type of list to update. |
359
|
|
|
* @return array|boolean The list of aspects or services, false if an illegal parameter is passed. |
360
|
|
|
*/ |
361
|
|
|
private function _update_aspects_services_list( $type ) { |
362
|
|
|
// Check for correct argument value. |
363
|
|
|
if ( ! in_array( $type, array( 'aspects', 'services' ) ) ) { |
364
|
|
|
return false; |
365
|
|
|
} |
366
|
|
|
|
367
|
|
|
$options = WP2D_Options::instance(); |
368
|
|
|
$list = $options->get_option( $type . '_list' ); |
369
|
|
|
|
370
|
|
|
// Make sure that we have at least the 'Public' aspect. |
371
|
|
|
if ( 'aspects' === $type && empty( $list ) ) { |
372
|
|
|
$list = array( 'public' => __( 'Public' ) ); |
|
|
|
|
373
|
|
|
} |
374
|
|
|
|
375
|
|
|
// Set up the connection to diaspora*. |
376
|
|
|
$api = $this->_load_api(); |
377
|
|
|
|
378
|
|
|
// If there was a problem loading the API, return false. |
379
|
|
|
if ( $api->has_last_error() ) { |
380
|
|
|
return false; |
381
|
|
|
} |
382
|
|
|
|
383
|
|
|
if ( 'aspects' === $type ) { |
384
|
|
|
$list_new = $api->get_aspects( true ); |
385
|
|
|
} elseif ( 'services' === $type ) { |
386
|
|
|
$list_new = $api->get_services( true ); |
387
|
|
|
} |
388
|
|
|
// If the new list couldn't be fetched successfully, return false. |
389
|
|
|
if ( $api->has_last_error() ) { |
390
|
|
|
return false; |
391
|
|
|
} |
392
|
|
|
|
393
|
|
|
// We have a new list to save and return! |
394
|
|
|
$options->set_option( $type . '_list', $list_new ); |
|
|
|
|
395
|
|
|
$options->save(); |
396
|
|
|
|
397
|
|
|
return $list_new; |
398
|
|
|
} |
399
|
|
|
|
400
|
|
|
/** |
401
|
|
|
* Update the list of aspects and return them for use with AJAX. |
402
|
|
|
*/ |
403
|
|
|
public function update_aspects_list_callback() { |
404
|
|
|
wp_send_json( $this->_update_aspects_services_list( 'aspects' ) ); |
405
|
|
|
} |
406
|
|
|
|
407
|
|
|
/** |
408
|
|
|
* Update the list of services and return them for use with AJAX. |
409
|
|
|
*/ |
410
|
|
|
public function update_services_list_callback() { |
411
|
|
|
wp_send_json( $this->_update_aspects_services_list( 'services' ) ); |
412
|
|
|
} |
413
|
|
|
|
414
|
|
|
/** |
415
|
|
|
* Check the pod connection status. |
416
|
|
|
* |
417
|
|
|
* @return string The status of the connection. |
418
|
|
|
*/ |
419
|
|
|
private function _check_pod_connection_status() { |
420
|
|
|
$options = WP2D_Options::instance(); |
421
|
|
|
|
422
|
|
|
$status = null; |
423
|
|
|
|
424
|
|
|
if ( $options->is_pod_set_up() ) { |
425
|
|
|
$status = ! $this->_load_api()->has_last_error(); |
426
|
|
|
} |
427
|
|
|
|
428
|
|
|
return $status; |
429
|
|
|
} |
430
|
|
|
|
431
|
|
|
/** |
432
|
|
|
* Check the connection to the pod and return the status for use with AJAX. |
433
|
|
|
* |
434
|
|
|
* @todo esc_html |
435
|
|
|
*/ |
436
|
|
|
public function check_pod_connection_status_callback() { |
|
|
|
|
437
|
|
|
if ( isset( $_REQUEST['debugging'] ) && ! defined( 'WP2D_DEBUGGING' ) ) { |
438
|
|
|
define( 'WP2D_DEBUGGING', true ); |
439
|
|
|
} |
440
|
|
|
|
441
|
|
|
$status = $this->_check_pod_connection_status(); |
442
|
|
|
|
443
|
|
|
$data = array( |
444
|
|
|
'debug' => esc_textarea( WP2D_Helpers::get_debugging() ), |
445
|
|
|
'message' => __( 'Connection successful.', 'wp-to-diaspora' ), |
446
|
|
|
); |
447
|
|
|
|
448
|
|
|
if ( true === $status ) { |
449
|
|
|
wp_send_json_success( $data ); |
450
|
|
|
} elseif ( false === $status && $this->_load_api()->has_last_error() ) { |
451
|
|
|
$data['message'] = $this->_load_api()->get_last_error() . ' ' . WP2D_Contextual_Help::get_help_tab_quick_link( $this->_load_api()->get_last_error_object() ); |
452
|
|
|
wp_send_json_error( $data ); |
453
|
|
|
} |
454
|
|
|
// If $status === null, do nothing. |
|
|
|
|
455
|
|
|
} |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
// Get the party started! |
459
|
|
|
WP_To_Diaspora::instance(); |
460
|
|
|
|