Skip to content
Snippets Groups Projects
Commit ee530b2d authored by Mohammad Jangda's avatar Mohammad Jangda
Browse files

Spaces => Tabs

parent 9536c1ef
Branches
No related tags found
No related merge requests found
...@@ -19,10 +19,10 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -19,10 +19,10 @@ class Syndication_WP_REST_Client implements Syndication_Client {
function __construct( $site_ID, $port = 80, $timeout = 45 ) { function __construct( $site_ID, $port = 80, $timeout = 45 ) {
$this->access_token = push_syndicate_decrypt( get_post_meta( $site_ID, 'syn_site_token', true) ); $this->access_token = push_syndicate_decrypt( get_post_meta( $site_ID, 'syn_site_token', true) );
$this->blog_ID = get_post_meta( $site_ID, 'syn_site_id', true); $this->blog_ID = get_post_meta( $site_ID, 'syn_site_id', true);
$this->timeout = $timeout; $this->timeout = $timeout;
$this->useragent = 'push-syndication-plugin'; $this->useragent = 'push-syndication-plugin';
$this->port = $port; $this->port = $port;
} }
...@@ -40,22 +40,22 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -40,22 +40,22 @@ class Syndication_WP_REST_Client implements Syndication_Client {
return true; return true;
$response = wp_remote_post( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/new/', array( $response = wp_remote_post( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/new/', array(
'timeout' => $this->timeout, 'timeout' => $this->timeout,
'user-agent' => $this->useragent, 'user-agent' => $this->useragent,
'sslverify' => false, 'sslverify' => false,
'headers' => array ( 'headers' => array (
'authorization' => 'Bearer ' . $this->access_token, 'authorization' => 'Bearer ' . $this->access_token,
'Content-Type' => 'application/x-www-form-urlencoded' 'Content-Type' => 'application/x-www-form-urlencoded'
), ),
'body' => array ( 'body' => array (
'title' => $post['post_title'], 'title' => $post['post_title'],
'content' => $post['post_content'], 'content' => $post['post_content'],
'excerpt' => $post['post_excerpt'], 'excerpt' => $post['post_excerpt'],
'status' => $post['post_status'], 'status' => $post['post_status'],
'password' => $post['post_password'], 'password' => $post['post_password'],
'date' => $post['post_date_gmt'], 'date' => $post['post_date_gmt'],
'categories' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'category', array('fields' => 'names') ) ), 'categories' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'category', array('fields' => 'names') ) ),
'tags' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'post_tag', array('fields' => 'names') ) ) 'tags' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'post_tag', array('fields' => 'names') ) )
), ),
) ); ) );
...@@ -86,22 +86,22 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -86,22 +86,22 @@ class Syndication_WP_REST_Client implements Syndication_Client {
return true; return true;
$response = wp_remote_post( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/' . $ext_ID . '/', array( $response = wp_remote_post( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/' . $ext_ID . '/', array(
'timeout' => $this->timeout, 'timeout' => $this->timeout,
'user-agent' => $this->useragent, 'user-agent' => $this->useragent,
'sslverify' => false, 'sslverify' => false,
'headers' => array ( 'headers' => array (
'authorization' => 'Bearer ' . $this->access_token, 'authorization' => 'Bearer ' . $this->access_token,
'Content-Type' => 'application/x-www-form-urlencoded' 'Content-Type' => 'application/x-www-form-urlencoded'
), ),
'body' => array ( 'body' => array (
'title' => $post['post_title'], 'title' => $post['post_title'],
'content' => $post['post_content'], 'content' => $post['post_content'],
'excerpt' => $post['post_excerpt'], 'excerpt' => $post['post_excerpt'],
'status' => $post['post_status'], 'status' => $post['post_status'],
'password' => $post['post_password'], 'password' => $post['post_password'],
'date' => $post['post_date_gmt'], 'date' => $post['post_date_gmt'],
'categories' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'category', array('fields' => 'names') ) ), 'categories' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'category', array('fields' => 'names') ) ),
'tags' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'post_tag', array('fields' => 'names') ) ) 'tags' => $this->_prepare_terms( wp_get_object_terms( $post_ID, 'post_tag', array('fields' => 'names') ) )
), ),
) ); ) );
...@@ -137,10 +137,10 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -137,10 +137,10 @@ class Syndication_WP_REST_Client implements Syndication_Client {
public function delete_post( $ext_ID ) { public function delete_post( $ext_ID ) {
$response = wp_remote_post( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/' . $ext_ID . '/delete', array( $response = wp_remote_post( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/' . $ext_ID . '/delete', array(
'timeout' => $this->timeout, 'timeout' => $this->timeout,
'user-agent' => $this->useragent, 'user-agent' => $this->useragent,
'sslverify' => false, 'sslverify' => false,
'headers' => array ( 'headers' => array (
'authorization' => 'Bearer ' . $this->access_token, 'authorization' => 'Bearer ' . $this->access_token,
), ),
) ); ) );
...@@ -164,10 +164,10 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -164,10 +164,10 @@ class Syndication_WP_REST_Client implements Syndication_Client {
public function test_connection() { public function test_connection() {
// @TODo find a better method // @TODo find a better method
$response = wp_remote_get( 'https://public-api.wordpress.com/rest/v1/me/?pretty=1', array( $response = wp_remote_get( 'https://public-api.wordpress.com/rest/v1/me/?pretty=1', array(
'timeout' => $this->timeout, 'timeout' => $this->timeout,
'user-agent' => $this->useragent, 'user-agent' => $this->useragent,
'sslverify' => false, 'sslverify' => false,
'headers' => array ( 'headers' => array (
'authorization' => 'Bearer ' . $this->access_token, 'authorization' => 'Bearer ' . $this->access_token,
), ),
) ); ) );
...@@ -192,10 +192,10 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -192,10 +192,10 @@ class Syndication_WP_REST_Client implements Syndication_Client {
public function is_post_exists( $post_ID ) { public function is_post_exists( $post_ID ) {
$response = wp_remote_get( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/' . $post_ID . '/?pretty=1', array( $response = wp_remote_get( 'https://public-api.wordpress.com/rest/v1/sites/' . $this->blog_ID . '/posts/' . $post_ID . '/?pretty=1', array(
'timeout' => $this->timeout, 'timeout' => $this->timeout,
'user-agent' => $this->useragent, 'user-agent' => $this->useragent,
'sslverify' => false, 'sslverify' => false,
'headers' => array ( 'headers' => array (
'authorization' => 'Bearer ' . $this->access_token, 'authorization' => 'Bearer ' . $this->access_token,
), ),
) ); ) );
...@@ -231,37 +231,37 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -231,37 +231,37 @@ class Syndication_WP_REST_Client implements Syndication_Client {
public static function display_settings( $site ) { public static function display_settings( $site ) {
$site_token = push_syndicate_decrypt( get_post_meta( $site->ID, 'syn_site_token', true) ); $site_token = push_syndicate_decrypt( get_post_meta( $site->ID, 'syn_site_token', true) );
$site_id = get_post_meta( $site->ID, 'syn_site_id', true); $site_id = get_post_meta( $site->ID, 'syn_site_id', true);
$site_url = get_post_meta( $site->ID, 'syn_site_url', true); $site_url = get_post_meta( $site->ID, 'syn_site_url', true);
// @TODO refresh UI // @TODO refresh UI
?> ?>
<p> <p>
<?php echo esc_html__( 'To generate the following information automatically please visit the ', 'push-syndication' ); ?> <?php echo esc_html__( 'To generate the following information automatically please visit the ', 'push-syndication' ); ?>
<a href="<?php echo get_admin_url(); ?>/options-general.php?page=push-syndicate-settings" target="_blank"><?php echo esc_html__( 'settings page', 'push-syndication' ); ?></a> <a href="<?php echo get_admin_url(); ?>/options-general.php?page=push-syndicate-settings" target="_blank"><?php echo esc_html__( 'settings page', 'push-syndication' ); ?></a>
</p> </p>
<p> <p>
<label for=site_token><?php echo esc_html__( 'Enter API Token', 'push-syndication' ); ?></label> <label for=site_token><?php echo esc_html__( 'Enter API Token', 'push-syndication' ); ?></label>
</p> </p>
<p> <p>
<input type="text" class="widefat" name="site_token" id="site_token" size="100" value="<?php echo esc_attr( $site_token ); ?>" /> <input type="text" class="widefat" name="site_token" id="site_token" size="100" value="<?php echo esc_attr( $site_token ); ?>" />
</p> </p>
<p> <p>
<label for=site_id><?php echo esc_html__( 'Enter Blog ID', 'push-syndication' ); ?></label> <label for=site_id><?php echo esc_html__( 'Enter Blog ID', 'push-syndication' ); ?></label>
</p> </p>
<p> <p>
<input type="text" class="widefat" name="site_id" id="site_id" size="100" value="<?php echo esc_attr( $site_id ); ?>" /> <input type="text" class="widefat" name="site_id" id="site_id" size="100" value="<?php echo esc_attr( $site_id ); ?>" />
</p> </p>
<p> <p>
<label for=site_url><?php echo esc_html__( 'Enter a valid Blog URL', 'push-syndication' ); ?></label> <label for=site_url><?php echo esc_html__( 'Enter a valid Blog URL', 'push-syndication' ); ?></label>
</p> </p>
<p> <p>
<input type="text" class="widefat" name="site_url" id="site_url" size="100" value="<?php echo esc_attr( $site_url ); ?>" /> <input type="text" class="widefat" name="site_url" id="site_url" size="100" value="<?php echo esc_attr( $site_url ); ?>" />
</p> </p>
<?php <?php
} }
...@@ -275,13 +275,13 @@ class Syndication_WP_REST_Client implements Syndication_Client { ...@@ -275,13 +275,13 @@ class Syndication_WP_REST_Client implements Syndication_Client {
} }
public function get_post( $ext_ID ) public function get_post( $ext_ID )
{ {
// TODO: Implement get_post() method. // TODO: Implement get_post() method.
} }
public function get_posts( $args = array() ) public function get_posts( $args = array() )
{ {
// TODO: Implement get_posts() method. // TODO: Implement get_posts() method.
} }
} }
\ No newline at end of file
...@@ -7,202 +7,202 @@ include_once( dirname( __FILE__ ) . '/push-syndicate-encryption.php' ); ...@@ -7,202 +7,202 @@ include_once( dirname( __FILE__ ) . '/push-syndicate-encryption.php' );
class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndication_Client { class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndication_Client {
private $username; private $username;
private $password; private $password;
private $ext_thumbnail_ids; private $ext_thumbnail_ids;
private $site_ID; private $site_ID;
function __construct( $site_ID ) { function __construct( $site_ID ) {
// @TODO check port, timeout etc // @TODO check port, timeout etc
$server = untrailingslashit( get_post_meta( $site_ID, 'syn_site_url', true ) ); $server = untrailingslashit( get_post_meta( $site_ID, 'syn_site_url', true ) );
if ( false === strpos( $server, 'xmlrpc.php' ) ) if ( false === strpos( $server, 'xmlrpc.php' ) )
$server = esc_url_raw( trailingslashit( $server ) . 'xmlrpc.php' ); $server = esc_url_raw( trailingslashit( $server ) . 'xmlrpc.php' );
else else
$server = esc_url_raw( $server ); $server = esc_url_raw( $server );
$this->username = get_post_meta( $site_ID, 'syn_site_username', true); $this->username = get_post_meta( $site_ID, 'syn_site_username', true);
$this->password = push_syndicate_decrypt( get_post_meta( $site_ID, 'syn_site_password', true) ); $this->password = push_syndicate_decrypt( get_post_meta( $site_ID, 'syn_site_password', true) );
$this->site_ID = $site_ID; $this->site_ID = $site_ID;
// get the thumbnail ids // get the thumbnail ids
$this->ext_thumbnail_ids = get_option( 'syn_post_thumbnail_ids' ); $this->ext_thumbnail_ids = get_option( 'syn_post_thumbnail_ids' );
$this->ext_thumbnail_ids = !empty( $this->ext_thumbnail_ids ) ? $this->ext_thumbnail_ids : array() ; $this->ext_thumbnail_ids = !empty( $this->ext_thumbnail_ids ) ? $this->ext_thumbnail_ids : array() ;
$this->ext_thumbnail_ids[ $this->site_ID ] = !empty( $this->ext_thumbnail_ids[ $this->site_ID ] ) ? $this->ext_thumbnail_ids[ $this->site_ID ] : array() ; $this->ext_thumbnail_ids[ $this->site_ID ] = !empty( $this->ext_thumbnail_ids[ $this->site_ID ] ) ? $this->ext_thumbnail_ids[ $this->site_ID ] : array() ;
parent::__construct( $server ); parent::__construct( $server );
} }
function __destruct() { function __destruct() {
update_option( 'syn_post_thumbnail_ids', $this->ext_thumbnail_ids ); update_option( 'syn_post_thumbnail_ids', $this->ext_thumbnail_ids );
} }
public static function get_client_data() { public static function get_client_data() {
return array( 'id' => 'WP_XMLRPC', 'modes' => array( 'push' ), 'name' => 'WordPress XMLRPC' ); return array( 'id' => 'WP_XMLRPC', 'modes' => array( 'push' ), 'name' => 'WordPress XMLRPC' );
} }
public function new_post( $post_ID ) { public function new_post( $post_ID ) {
$post = (array)get_post( $post_ID ); $post = (array)get_post( $post_ID );
// This filter can be used to exclude or alter posts during a content push // This filter can be used to exclude or alter posts during a content push
$post = apply_filters( 'syn_xmlrpc_push_filter_new_post', $post, $post_ID ); $post = apply_filters( 'syn_xmlrpc_push_filter_new_post', $post, $post_ID );
if ( false === $post ) if ( false === $post )
return true; return true;
// rearranging arguments // rearranging arguments
$args = array(); $args = array();
$args['post_title'] = $post['post_title']; $args['post_title'] = $post['post_title'];
$args['post_content'] = $post['post_content']; $args['post_content'] = $post['post_content'];
$args['post_excerpt'] = $post['post_excerpt']; $args['post_excerpt'] = $post['post_excerpt'];
$args['post_status'] = $post['post_status']; $args['post_status'] = $post['post_status'];
$args['post_type'] = $post['post_type']; $args['post_type'] = $post['post_type'];
$args['wp_password'] = $post['post_password']; $args['wp_password'] = $post['post_password'];
$args['post_date_gmt'] = $this->convert_date_gmt( $post['post_date_gmt'], $post['post_date'] ); $args['post_date_gmt'] = $this->convert_date_gmt( $post['post_date_gmt'], $post['post_date'] );
$args['terms_names'] = $this->_get_post_terms( $post_ID ); $args['terms_names'] = $this->_get_post_terms( $post_ID );
$args['custom_fields'] = $this->_get_custom_fields( $post_ID ); $args['custom_fields'] = $this->_get_custom_fields( $post_ID );
$result = $this->query( $result = $this->query(
'wp.newPost', 'wp.newPost',
'1', '1',
$this->username, $this->username,
$this->password, $this->password,
$args $args
); );
if( !$result ) if( !$result )
return false; return false;
return $result; return $result;
} }
public function edit_post( $post_ID, $ext_ID ) { public function edit_post( $post_ID, $ext_ID ) {
$post = (array)get_post( $post_ID ); $post = (array)get_post( $post_ID );
// This filter can be used to exclude or alter posts during a content push // This filter can be used to exclude or alter posts during a content push
$post = apply_filters( 'syn_xmlrpc_push_filter_edit_post', $post, $post_ID ); $post = apply_filters( 'syn_xmlrpc_push_filter_edit_post', $post, $post_ID );
if ( false === $post ) if ( false === $post )
return true; return true;
// rearranging arguments // rearranging arguments
$args = array(); $args = array();
$args['post_title'] = $post['post_title']; $args['post_title'] = $post['post_title'];
$args['post_content'] = $post['post_content']; $args['post_content'] = $post['post_content'];
$args['post_excerpt'] = $post['post_excerpt']; $args['post_excerpt'] = $post['post_excerpt'];
$args['post_status'] = $post['post_status']; $args['post_status'] = $post['post_status'];
$args['post_type'] = $post['post_type']; $args['post_type'] = $post['post_type'];
$args['wp_password'] = $post['post_password']; $args['wp_password'] = $post['post_password'];
$args['post_date_gmt'] = $this->convert_date_gmt( $post['post_date_gmt'], $post['post_date'] ); $args['post_date_gmt'] = $this->convert_date_gmt( $post['post_date_gmt'], $post['post_date'] );
$args['terms_names'] = $this->_get_post_terms( $post_ID ); $args['terms_names'] = $this->_get_post_terms( $post_ID );
$args['custom_fields'] = $this->_get_custom_fields( $post_ID ); $args['custom_fields'] = $this->_get_custom_fields( $post_ID );
$result = $this->query( $result = $this->query(
'wp.editPost', 'wp.editPost',
'1', '1',
$this->username, $this->username,
$this->password, $this->password,
$ext_ID, $ext_ID,
$args $args
); );
if( ! $result ) { if( ! $result ) {
return false; return false;
} }
return true; return true;
} }
public function delete_post( $ext_ID ) { public function delete_post( $ext_ID ) {
$result = $this->query( $result = $this->query(
'wp.deletePost', 'wp.deletePost',
'1', '1',
$this->username, $this->username,
$this->password, $this->password,
$ext_ID $ext_ID
); );
if( !$result ) if( !$result )
return false; return false;
return true; return true;
} }
public function manage_thumbnails( $post_ID ) { public function manage_thumbnails( $post_ID ) {
// TODO: check if post thumbnails are supported // TODO: check if post thumbnails are supported
$post_thumbnail_id = get_post_thumbnail_id( $post_ID ); $post_thumbnail_id = get_post_thumbnail_id( $post_ID );
if( empty( $post_thumbnail_id ) ) if( empty( $post_thumbnail_id ) )
return $this->remove_post_thumbnail( $post_ID ); return $this->remove_post_thumbnail( $post_ID );
if( !empty( $this->ext_thumbnail_ids[ $this->site_ID ][ $post_thumbnail_id ] ) ) if( !empty( $this->ext_thumbnail_ids[ $this->site_ID ][ $post_thumbnail_id ] ) )
return true; return true;
if( $this->insert_post_thumbnail( $post_thumbnail_id ) ) { if( $this->insert_post_thumbnail( $post_thumbnail_id ) ) {
$this->ext_thumbnail_ids[ $this->site_ID ][ $post_thumbnail_id ] = (int)$this->get_response(); $this->ext_thumbnail_ids[ $this->site_ID ][ $post_thumbnail_id ] = (int)$this->get_response();
return true; return true;
} }
return false; return false;
} }
public function insert_post_thumbnail( $post_ID ) { public function insert_post_thumbnail( $post_ID ) {
$post = (array)get_post( $post_ID ); $post = (array)get_post( $post_ID );
// This filter can be used to exclude or alter posts during a content push // This filter can be used to exclude or alter posts during a content push
$post = apply_filters( 'syn_xmlrpc_push_filter_insert_thumbnail', $post, $post_ID ); $post = apply_filters( 'syn_xmlrpc_push_filter_insert_thumbnail', $post, $post_ID );
if ( false === $post ) if ( false === $post )
return true; return true;
// rearranging arguments // rearranging arguments
$args = array(); $args = array();
$args['post_title'] = $post['post_title']; $args['post_title'] = $post['post_title'];
$args['post_content'] = $post['post_content']; $args['post_content'] = $post['post_content'];
$args['guid'] = $post['guid']; $args['guid'] = $post['guid'];
// TODO: check that method is supported // TODO: check that method is supported
$result = $this->query( $result = $this->query(
'pushSyndicateInsertThumbnail', 'pushSyndicateInsertThumbnail',
'1', '1',
$this->username, $this->username,
$this->password, $this->password,
$args $args
); );
if( !$result ) if( !$result )
return false; return false;
return true; return true;
} }
public function remove_post_thumbnail( $post_ID ) { public function remove_post_thumbnail( $post_ID ) {
$result = $this->query( $result = $this->query(
'pushSyndicateRemoveThumbnail', 'pushSyndicateRemoveThumbnail',
'1', '1',
$this->username, $this->username,
$this->password, $this->password,
$post_ID $post_ID
); );
if( !$result ) if( !$result )
return false; return false;
return true; return true;
} }
private function _get_custom_fields( $post_id ) { private function _get_custom_fields( $post_id ) {
$post = get_post( $post_id ); $post = get_post( $post_id );
...@@ -292,41 +292,41 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica ...@@ -292,41 +292,41 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica
} }
public function is_post_exists( $ext_ID ) { public function is_post_exists( $ext_ID ) {
$result = $this->query( $result = $this->query(
'wp.getPost', 'wp.getPost',
'1', '1',
$this->username, $this->username,
$this->password, $this->password,
$ext_ID $ext_ID
); );
if( !$result ) if( !$result )
return false; return false;
$post = $this->getResponse(); $post = $this->getResponse();
if( $ext_ID != $post['post_id'] ) if( $ext_ID != $post['post_id'] )
return false; return false;
return true; return true;
} }
protected function convert_date_gmt( $date_gmt, $date ) { protected function convert_date_gmt( $date_gmt, $date ) {
if ( $date !== '0000-00-00 00:00:00' && $date_gmt === '0000-00-00 00:00:00' ) { if ( $date !== '0000-00-00 00:00:00' && $date_gmt === '0000-00-00 00:00:00' ) {
return new IXR_Date( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $date, false ), 'Ymd\TH:i:s' ) ); return new IXR_Date( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $date, false ), 'Ymd\TH:i:s' ) );
} }
return $this->convert_date( $date_gmt ); return $this->convert_date( $date_gmt );
} }
protected function convert_date( $date ) { protected function convert_date( $date ) {
if ( $date === '0000-00-00 00:00:00' ) { if ( $date === '0000-00-00 00:00:00' ) {
return new IXR_Date( '00000000T00:00:00Z' ); return new IXR_Date( '00000000T00:00:00Z' );
} }
return new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date, false ) ); return new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date, false ) );
} }
public function get_response() { public function get_response() {
return parent::getResponse(); return parent::getResponse();
...@@ -346,7 +346,7 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica ...@@ -346,7 +346,7 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica
$site_username = get_post_meta( $site->ID, 'syn_site_username', true); $site_username = get_post_meta( $site->ID, 'syn_site_username', true);
$site_password = push_syndicate_decrypt( get_post_meta( $site->ID, 'syn_site_password', true) ); $site_password = push_syndicate_decrypt( get_post_meta( $site->ID, 'syn_site_password', true) );
?> ?>
<p> <p>
<label for=site_url><?php echo esc_html__( 'Enter a valid site URL', 'push-syndication' ); ?></label> <label for=site_url><?php echo esc_html__( 'Enter a valid site URL', 'push-syndication' ); ?></label>
...@@ -367,7 +367,7 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica ...@@ -367,7 +367,7 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica
<input type="password" class="widefat" name="site_password" id="site_password" size="100" autocomplete="off" value="<?php echo esc_attr( $site_password ); ?>" /> <input type="password" class="widefat" name="site_password" id="site_password" size="100" autocomplete="off" value="<?php echo esc_attr( $site_password ); ?>" />
</p> </p>
<?php <?php
} }
...@@ -388,14 +388,14 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica ...@@ -388,14 +388,14 @@ class Syndication_WP_XMLRPC_Client extends WP_HTTP_IXR_Client implements Syndica
} }
public function get_post( $ext_ID ) public function get_post( $ext_ID )
{ {
// TODO: Implement get_post() method. // TODO: Implement get_post() method.
} }
public function get_posts( $args = array() ) public function get_posts( $args = array() )
{ {
// TODO: Implement get_posts() method. // TODO: Implement get_posts() method.
} }
} }
...@@ -15,11 +15,12 @@ if ( ! defined( 'PUSH_SYNDICATE_KEY' ) ) ...@@ -15,11 +15,12 @@ if ( ! defined( 'PUSH_SYNDICATE_KEY' ) )
define( 'PUSH_SYNDICATE_KEY', 'PUSH_SYNDICATE_KEY' ); define( 'PUSH_SYNDICATE_KEY', 'PUSH_SYNDICATE_KEY' );
require_once ( dirname( __FILE__ ) . '/includes/class-wp-push-syndication-server.php' ); require_once ( dirname( __FILE__ ) . '/includes/class-wp-push-syndication-server.php' );
if( apply_filters( 'syn_use_async_jobs', false ) ) if( apply_filters( 'syn_use_async_jobs', false ) )
require_once ( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ); require_once ( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' );
if ( !defined( 'PUSH_SYNDICATION_ENVIRONMENT' ) ) if ( !defined( 'PUSH_SYNDICATION_ENVIRONMENT' ) )
define( 'PUSH_SYNDICATION_ENVIRONMENT', 'WP' ); define( 'PUSH_SYNDICATION_ENVIRONMENT', 'WP' );
if ( defined( 'WP_CLI' ) && WP_CLI ) if ( defined( 'WP_CLI' ) && WP_CLI )
require_once( dirname( __FILE__ ) . '/includes/class-wp-cli.php' ); require_once( dirname( __FILE__ ) . '/includes/class-wp-cli.php' );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment