diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 070280083..9aef07465 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -1,6 +1,6 @@ # Dependency Review Action # -# This Action will scan dependency manifest files that change as part of a Pull Reqest, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. # # Source repository: https://github.com/actions/dependency-review-action # Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement diff --git a/CHANGELOG.md b/CHANGELOG.md index 806ccad89..cdd75aaea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ All notable changes to this project will be documented in this file, per [the Ke - Bump WordPress "tested up to" version 6.4 (props [@severine-pozzo](https://github.com/severine-pozzo), [@QAharshalkadu](https://github.com/QAharshalkadu), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#1151](https://github.com/10up/distributor/pull/1151)). ### Fixed -- Copy the htaccess file when initilizing the E2E test environment (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@theskinnyghost](https://github.com/theskinnyghost), [@dkotter](https://github.com/dkotter) via [#1143](https://github.com/10up/distributor/pull/1143)). +- Copy the htaccess file when initializing the E2E test environment (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@theskinnyghost](https://github.com/theskinnyghost), [@dkotter](https://github.com/dkotter) via [#1143](https://github.com/10up/distributor/pull/1143)). - Prevent early publishing of scheduled posts when pulled internally (props [@peterwilsoncc](https://github.com/peterwilsoncc), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@maxledoux](https://github.com/maxledoux), [@pcrumm](https://github.com/pcrumm) via [#1156](https://github.com/10up/distributor/pull/1156)). - Avoid a PHP fatal error when pulling content that has previously been pulled into a different network site (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#1159](https://github.com/10up/distributor/pull/1159)). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e354e2dfe..d0e76b3f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,6 @@ The `develop` branch is the development branch which means it contains the next ## Release instructions 1. Branch: Starting from `develop`, create a release branch named `release/X.Y.Z` for your changes. -2. Follow pull request checklist: A draft release pull request will be created once you push your branch to Github. Follow the steps in the pull request. +2. Follow pull request checklist: A draft release pull request will be created once you push your branch to GitHub. Follow the steps in the pull request. Should the pull request fail to be created, a pull request can be manually created using the [template file](https://github.com/10up/distributor/blob/develop/.github/release-pull-request-template.md) containing each of the steps. diff --git a/README.md b/README.md index a8757470b..484e183df 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ You can navigate to the `Posts` > `All Posts` table list view to see all content ## Known Caveats/Issues -__Remote Request Timeouts__ - With external connections, HTTP requests are sent back and forth - creating posts, transfering images, syncing post updates, etc. In certain situations, mostly commonly when distributing posts with a large number of images (or very large file sizes), using poorly configured or saturated servers / hosts, or using plugins that add significant weight to post creation, Distributor requests can fail. Although we do some error handling, there are certain cases in which post distribution can fail silently. If distribution requests are taking a long time to load and/or failing, consider adjusting the timeout; you can filter the timeout for pushing external posts using the [`dt_push_post_timeout` filter](https://10up.github.io/distributor/dt_push_post_timeout.html). More advanced handling of large content requests, and improved error handling is on the road map for a future update. +__Remote Request Timeouts__ - With external connections, HTTP requests are sent back and forth - creating posts, transferring images, syncing post updates, etc. In certain situations, mostly commonly when distributing posts with a large number of images (or very large file sizes), using poorly configured or saturated servers / hosts, or using plugins that add significant weight to post creation, Distributor requests can fail. Although we do some error handling, there are certain cases in which post distribution can fail silently. If distribution requests are taking a long time to load and/or failing, consider adjusting the timeout; you can filter the timeout for pushing external posts using the [`dt_push_post_timeout` filter](https://10up.github.io/distributor/dt_push_post_timeout.html). More advanced handling of large content requests, and improved error handling is on the road map for a future update. __Post Meta Associations__ - A distributed post includes all of the post meta from the original version. Sometimes arbitrary post meta references an ID for another piece of content on the original site. Distributor _does not_ "bring along" the referenced content or update references for arbitrary post meta (it will take care of updating references in the case of core WordPress features, such as the featured image ID). This issue is very common when using field management plugins like Advanced Custom Fields (ACF). This can be addressed on a case by case basis by extending the plugin; for external connections, you can manually handle post meta associations using [the `dt_push_post` hook](https://github.com/10up/distributor/blob/f7b60740e679bce4671ccd69a670abadce4f2f93/includes/classes/ExternalConnections/WordPressExternalConnection.php#L646). For internal connections, use the [`dt_push_post` hook](https://10up.github.io/distributor/dt_push_post.html). Note that while named the same, these hooks accept different parameters. diff --git a/docs/connect-to-an-existing-post.md b/docs/connect-to-an-existing-post.md index 7598ff165..be0f10d17 100644 --- a/docs/connect-to-an-existing-post.md +++ b/docs/connect-to-an-existing-post.md @@ -72,7 +72,7 @@ $data = [ ]; ``` -In the above example, the `internal` array will always be empty, unless an item is also linked to an interal site. For the `external` array, each item in the array will have a key that corresponds to the connection ID (2 in the example above) and then the `post_id` should be the destination post ID. +In the above example, the `internal` array will always be empty, unless an item is also linked to an internal site. For the `external` array, each item in the array will have a key that corresponds to the connection ID (2 in the example above) and then the `post_id` should be the destination post ID. 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 `dt_connection_map` data that is stored with the original item (ID of 100, site ID 1) would look like the following: diff --git a/includes/bootstrap.php b/includes/bootstrap.php index 70b8bb3f3..9be1200b8 100644 --- a/includes/bootstrap.php +++ b/includes/bootstrap.php @@ -3,7 +3,7 @@ * 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. * diff --git a/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php b/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php index 5407ae733..db4dd44ae 100644 --- a/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php +++ b/includes/classes/Authentications/WordPressDotcomOauth2Authentication.php @@ -28,7 +28,7 @@ class WordPressDotcomOauth2Authentication extends Authentication { public static $requires_credentials = true; /** - * Auth hanlder pretty label + * Auth handler pretty label * * @var string */ diff --git a/includes/classes/DistributorPost.php b/includes/classes/DistributorPost.php index 96e965704..c356b30d0 100644 --- a/includes/classes/DistributorPost.php +++ b/includes/classes/DistributorPost.php @@ -919,7 +919,7 @@ protected function to_pull_list( $args = array() ) { $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 diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index ac424d647..0428347f7 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -774,7 +774,7 @@ public static function update_syndicated( $post ) { /** * 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 * diff --git a/includes/debug-info.php b/includes/debug-info.php index fb4206f0b..5907907da 100644 --- a/includes/debug-info.php +++ b/includes/debug-info.php @@ -124,11 +124,11 @@ function add_debug_info( $info ) { ], [ '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(), ], ] ); @@ -146,7 +146,7 @@ function add_debug_info( $info ) { * * @return array */ -function get_formatted_internal_connnections() { +function get_formatted_internal_connections() { if ( empty( Connections::factory()->get_registered()['networkblog'] ) ) { return __( 'N/A', 'distributor' ); } @@ -178,7 +178,7 @@ function get_formatted_internal_connnections() { * * @return array */ -function get_formatted_external_connnections() { +function get_formatted_external_connections() { $output = []; diff --git a/includes/push-ui.php b/includes/push-ui.php index d883425ed..db071c1a4 100644 --- a/includes/push-ui.php +++ b/includes/push-ui.php @@ -246,7 +246,7 @@ function get_connections() { */ 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; } diff --git a/includes/settings.php b/includes/settings.php index b25603dc6..afee92722 100644 --- a/includes/settings.php +++ b/includes/settings.php @@ -195,7 +195,7 @@ function setup_fields_sections() { add_settings_field( 'media_handling', esc_html__( 'Media Handling', 'distributor' ), __NAMESPACE__ . '\media_handling_callback', 'distributor', 'dt-section-1' ); if ( false === DT_IS_NETWORK ) { - add_settings_field( 'registation_key', esc_html__( 'Registration Key', 'distributor' ), __NAMESPACE__ . '\license_key_callback', 'distributor', 'dt-section-1' ); + add_settings_field( 'registration_key', esc_html__( 'Registration Key', 'distributor' ), __NAMESPACE__ . '\license_key_callback', 'distributor', 'dt-section-1' ); } } diff --git a/includes/template-tags.php b/includes/template-tags.php index 0c1e2e3ea..95c408318 100644 --- a/includes/template-tags.php +++ b/includes/template-tags.php @@ -215,8 +215,8 @@ function distributor_get_the_connection_source( $post_id = null ) { /** * 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 ) { diff --git a/includes/utils.php b/includes/utils.php index 41aa5b8df..84f7abfec 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -642,9 +642,9 @@ function set_taxonomy_terms( $post_id, $taxonomy_terms ) { * * @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; diff --git a/tests/cypress/e2e/external-connection.test.js b/tests/cypress/e2e/external-connection.test.js index 22de77924..da5c77db5 100644 --- a/tests/cypress/e2e/external-connection.test.js +++ b/tests/cypress/e2e/external-connection.test.js @@ -9,7 +9,7 @@ describe( 'Admin can add a new external connection', () => { it( 'Should create external connection', () => { const connectionName = 'Connection ' + randomName(); - // The command includes the workaround to sucessfully create new connection. + // The command includes the workaround to successfully create new connection. cy.createExternalConnection( connectionName, 'http://localhost/second/wp-json' diff --git a/tests/cypress/e2e/push-menu.test.js b/tests/cypress/e2e/push-menu.test.js index f84f4a530..89ba4fc5d 100644 --- a/tests/cypress/e2e/push-menu.test.js +++ b/tests/cypress/e2e/push-menu.test.js @@ -110,7 +110,7 @@ describe( 'Push menu test', () => { .contains( externalConnectionName ) .should( 'be.visible' ); - // Deselct the external connection. + // Deselect the external connection. cy.get( '#distributor-push-wrapper .selected-connections-list' ) .contains( externalConnectionName ) .find( '.remove-connection' ) diff --git a/webpack.config.js b/webpack.config.js index 2dbd9ad9d..382903824 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,7 +10,7 @@ const { resolve } = require( 'path' ); * suffix is removed from the file name to avoid the tortologist `-css.css`. * * In some cases the CSS file name differs from the JavaScript filename. In a - * possibly foolhardy attemt to maintain backward compatibility, these values are + * possibly foolhardy attempt to maintain backward compatibility, these values are * hard coded here. * * @param {Object} pathData Entry point path data.