Skip to content

Commit

Permalink
deploy: bbf97f1
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Feb 29, 2024
1 parent 4f1d1d7 commit 3449666
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bootstrap.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1 class="page-title">Source: bootstrap.php</h1>
* Bootstrap the main plugin.
*
* This file is included by the main plugin file and is responsible for
* bootstraping the plugin. This allows the main file to be used for version
* bootstrapping the plugin. This allows the main file to be used for version
* support and therefore support earlier versions of PHP and WP than the
* minimum requirements.
*
Expand Down
2 changes: 1 addition & 1 deletion classes_Authentication.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h1 class="page-title">Source: classes/Authentication.php</h1>
* Store pre-sanizited auth credentials in DB
*
* @param int $external_connection_id External connection ID.
* @param array $args Array of creds to store. Should be pre-sanitized.
* @param array $args Array of credentials to store. Should be pre-sanitized.
* @since 0.8
*/
public static function store_credentials( $external_connection_id, $args ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h1 class="page-title">Source: classes/Authentications/WordPressDotcomOauth2Auth
public static $requires_credentials = true;

/**
* Auth hanlder pretty label
* Auth handler pretty label
*
* @var string
*/
Expand Down
8 changes: 5 additions & 3 deletions classes_DistributorPost.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ <h1 class="page-title">Source: classes/DistributorPost.php</h1>
$found = false;

// Note: changes to the cache key or group should be reflected in `includes/settings.php`
$media = wp_cache_get( 'dt_media::{$post_id}', 'dt::post', false, $found );
$cache_key = "dt_media::{$this->post->ID}";
$cache_group = 'dt::post';
$media = wp_cache_get( $cache_key, $cache_group, false, $found );

if ( ! $found ) {
// Parse blocks to determine attached media.
Expand All @@ -712,7 +714,7 @@ <h1 class="page-title">Source: classes/DistributorPost.php</h1>
}

// Only the IDs are cached to keep the cache size down.
wp_cache_set( 'dt_media::{$post_id}', $media, 'dt::post' );
wp_cache_set( $cache_key, $media, $cache_group );
}

/*
Expand Down Expand Up @@ -952,7 +954,7 @@ <h1 class="page-title">Source: classes/DistributorPost.php</h1>
$display_data['distributor_original_site_url'] = $this->source_site['home_url'];

/**
* Filters the post data for when they are being formated for a pull
* Filters the post data for when they are being formatted for a pull
*
* @since 2.0.3
* @hook dt_post_to_pull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ <h1 class="page-title">Source: classes/ExternalConnections/WordPressExternalConn


/**
* Whether if the post type is not distibutor internal post type.
* Whether if the post type is not distributor internal post type.
*
* @param string $post_type Post type
*
Expand Down
2 changes: 1 addition & 1 deletion classes_InternalConnections_NetworkSiteConnection.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ <h1 class="page-title">Source: classes/InternalConnections/NetworkSiteConnection

/**
* Maybe set post modified date
* On wp_insert_post, modified date is overriden by post date
* On wp_insert_post, modified date is overridden by post date
*
* https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes/post.php#L3151
*
Expand Down
28 changes: 24 additions & 4 deletions debug-info.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ <h1 class="page-title">Source: debug-info.php</h1>
],
[
'label' => __( 'Internal Connections', 'distributor' ),
'value' => get_formatted_internal_connnections(),
'value' => get_formatted_internal_connections(),
],
[
'label' => __( 'External Connections', 'distributor' ),
'value' => get_formatted_external_connnections(),
'value' => get_formatted_external_connections(),
],
]
);
Expand All @@ -177,9 +177,19 @@ <h1 class="page-title">Source: debug-info.php</h1>
/**
* Get and format internal connections.
*
* @return array
* @deprecated x.x.x Use get_formatted_internal_connections
*/
function get_formatted_internal_connnections() {
_deprecated_function( __FUNCTION__, 'x.x.x.', __NAMESPACE__ . '\\get_formatted_internal_connections' );
return get_formatted_internal_connections();
}

/**
* Get and format internal connections.
*
* @return array
*/
function get_formatted_internal_connections() {
if ( empty( Connections::factory()->get_registered()['networkblog'] ) ) {
return __( 'N/A', 'distributor' );
}
Expand Down Expand Up @@ -209,9 +219,19 @@ <h1 class="page-title">Source: debug-info.php</h1>
/**
* Get and format external connections.
*
* @return array
* @deprecated x.x.x Use get_formatted_external_connections
*/
function get_formatted_external_connnections() {
_deprecated_function( __FUNCTION__, 'x.x.x', __NAMESPACE__ . '\\get_formatted_external_connections' );
return get_formatted_external_connections();
}

/**
* Get and format external connections.
*
* @return array
*/
function get_formatted_external_connections() {

$output = [];

Expand Down
2 changes: 1 addition & 1 deletion dt_parse_media_blocks.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="classes_DistributorPost.php.html">classes/DistributorPost.php</a>, <a href="classes_DistributorPost.php.html#line719">line 719</a>
<a href="classes_DistributorPost.php.html">classes/DistributorPost.php</a>, <a href="classes_DistributorPost.php.html#line721">line 721</a>
</li></ul></dd>


Expand Down
4 changes: 2 additions & 2 deletions dt_post_to_pull.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h4 class="name" id="dt_post_to_pull">apply_filters( 'dt_post_to_pull', <span cl


<div class="description">
<p>Filters the post data for when they are being formated for a pull</p>
<p>Filters the post data for when they are being formatted for a pull</p>
</div>


Expand Down Expand Up @@ -144,7 +144,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="classes_DistributorPost.php.html">classes/DistributorPost.php</a>, <a href="classes_DistributorPost.php.html#line921">line 921</a>
<a href="classes_DistributorPost.php.html">classes/DistributorPost.php</a>, <a href="classes_DistributorPost.php.html#line923">line 923</a>
</li></ul></dd>


Expand Down
6 changes: 3 additions & 3 deletions external-connection-cpt.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ <h1 class="page-title">Source: external-connection-cpt.php</h1>
$connection_class = \Distributor\Connections::factory()->get_registered()[ sanitize_key( $_POST['dt_external_connection_type'] ) ];
$auth_handler_class_again = $connection_class::$auth_handler_class;

$auth_creds = $auth_handler_class_again::prepare_credentials( array_merge( (array) $current_auth, array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['dt_external_connection_auth'] ) ) ) );
$auth_credentials = $auth_handler_class_again::prepare_credentials( array_merge( (array) $current_auth, array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['dt_external_connection_auth'] ) ) ) );

$auth_handler_class_again::store_credentials( $post_id, $auth_creds );
$auth_handler_class_again::store_credentials( $post_id, $auth_credentials );
}
}

Expand Down Expand Up @@ -630,7 +630,7 @@ <h1 class="page-title">Source: external-connection-cpt.php</h1>
global $connection_list_table;

$_GET['post_type'] = 'dt_ext_connection';
$_REQUEST['all_posts'] = true; // Default to replacite "All" tab
$_REQUEST['all_posts'] = true; // Default to replicate "All" tab

$connection_list_table->prepare_items();
?>
Expand Down
2 changes: 1 addition & 1 deletion push-ui.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ <h1 class="page-title">Source: push-ui.php</h1>
*/
function ajax_push() {
if ( ! check_ajax_referer( 'dt-push', 'nonce', false ) ) {
wp_send_json_error( new \WP_Error( 'invalid-referal', __( 'Invalid Ajax referer.', 'distributor' ) ) );
wp_send_json_error( new \WP_Error( 'invalid-referral', __( 'Invalid Ajax referer.', 'distributor' ) ) );
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion subscriptions.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h1 class="page-title">Source: subscriptions.php</h1>
* For a post that is distributed, for each distributed post, we create a subscription (CPT) to keep track
* of the copy. Attached to each subscription is a unique signature. When a post is updated, we check for subscriptions.
* If subscriptions exist, we grab the signature for each subscription and send the update to the remote copy along
* with the signature. The signature is a passcode of sorts. The subscription signature must match the copied post's
* with the signature. The signature is a pass code of sorts. The subscription signature must match the copied post's
* signature otherwise the update is not authorized.
*
* You might be wondering why we don't just use HTTP Basic Auth or OAuth since we've already set that up.
Expand Down
4 changes: 2 additions & 2 deletions template-tags.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ <h1 class="page-title">Source: template-tags.php</h1>
/**
* Display information about where a post was distributed from.
*
* @param int|null|mixed $post_id Post ID.
* @param string |null|mixed $preface The string that will preceed the link.
* @param int|null|mixed $post_id Post ID.
* @param string|null|mixed $preface The string that will precede the link.
*/
function distributor_the_connection_source( $post_id = null, $preface = null ) {
if ( ! $post_id ) {
Expand Down
2 changes: 1 addition & 1 deletion tutorial-connect-to-an-existing-post.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h2 id="external-connections">External Connections</h2>
],
];
</code></pre>
<p>In the above example, the <code>internal</code> array will always be empty, unless an item is also linked to an interal site. For the <code>external</code> array, each item in the array will have a key that corresponds to the connection ID (2 in the example above) and then the <code>post_id</code> should be the destination post ID.</p>
<p>In the above example, the <code>internal</code> array will always be empty, unless an item is also linked to an internal site. For the <code>external</code> array, each item in the array will have a key that corresponds to the connection ID (2 in the example above) and then the <code>post_id</code> should be the destination post ID.</p>
<p>As a further example, if I have a post with an ID of 100 that lives on a site with an ID of 1 and I want that post to be linked to an existing post with an ID of 50 on the site with a connection ID of 2, the <code>dt_connection_map</code> data that is stored with the original item (ID of 100, site ID 1) would look like the following:</p>
<pre class="prettyprint source lang-php"><code>$data = [
[
Expand Down
10 changes: 5 additions & 5 deletions utils.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ <h1 class="page-title">Source: utils.php</h1>
function set_taxonomy_terms( $post_id, $taxonomy_terms ) {
// Now let's add the taxonomy/terms to syndicated post
foreach ( $taxonomy_terms as $taxonomy => $terms ) {
// Continue if taxonomy doesnt exist
// Continue if taxonomy doesn't exist
if ( ! taxonomy_exists( $taxonomy ) ) {
continue;
}
Expand Down Expand Up @@ -675,9 +675,9 @@ <h1 class="page-title">Source: utils.php</h1>
*
* @return {bool} Whether term hierarchy should be updated.
*/
$update_term_hierachy = apply_filters( 'dt_update_term_hierarchy', true, $taxonomy );
$update_term_hierarchy = apply_filters( 'dt_update_term_hierarchy', true, $taxonomy );

if ( ! empty( $update_term_hierachy ) ) {
if ( ! empty( $update_term_hierarchy ) ) {
foreach ( $terms as $term_array ) {
if ( ! is_array( $term_array ) ) {
$term_array = (array) $term_array;
Expand Down Expand Up @@ -973,8 +973,8 @@ <h1 class="page-title">Source: utils.php</h1>
$source_file = $args['source_file'];

if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base' ) ) {
$creds = request_filesystem_credentials( site_url() );
wp_filesystem( $creds );
$credentials = request_filesystem_credentials( site_url() );
wp_filesystem( $credentials );
}

// Copy the source file so we don't mess with the original file.
Expand Down

0 comments on commit 3449666

Please sign in to comment.