Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
# @see: https://github.com/actions/virtual-environments
runs-on: ubuntu-latest

# Requieres the dependabot-metadata job to have run successfully.
# Requires the dependabot-metadata job to have run successfully.
needs: [dependabot-metadata]

# Always allow non-Dependabot PRs and pushes.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-backward-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
# @see: https://github.com/actions/virtual-environments
runs-on: ubuntu-latest

# Requieres the dependabot-metadata job to have run successfully.
# Requires the dependabot-metadata job to have run successfully.
needs: [dependabot-metadata]

# Always allow non-Dependabot PRs and pushes.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
# @see: https://github.com/actions/virtual-environments
runs-on: ubuntu-latest

# Requieres the dependabot-metadata job to have run successfully.
# Requires the dependabot-metadata job to have run successfully.
needs: [dependabot-metadata]

# Always allow non-Dependabot PRs and pushes.
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
run: mv /home/runner/work/convertkit-wordpress/convertkit-wordpress/convertkit ${{ env.PLUGIN_DIR }}

# WP_DEBUG = true is required so all PHP errors are output and caught by tests (E_ALL).
# WP_DEBUG = false for other integraiton tests, as Elementor in PHP 8.4 throws a deprecation notice
# WP_DEBUG = false for other integration tests, as Elementor in PHP 8.4 throws a deprecation notice
- name: Enable WP_DEBUG
if: ${{ matrix.test-groups != 'EndToEnd/integrations/other' && matrix.php-versions != '8.4' }}
working-directory: ${{ env.ROOT_DIR }}
Expand Down
2 changes: 1 addition & 1 deletion includes/blocks/class-convertkit-block-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function render( $atts, $content = '' ) {
// Get the subscriber's tags, to see if they subscribed to this tag.
$tags = $api->get_subscriber_tags( $subscriber_id );

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $tags ) ) {
if ( $settings->debug_enabled() ) {
return '<!-- Kit Custom Content: ' . $tags->get_error_message() . ' -->';
Expand Down
2 changes: 1 addition & 1 deletion includes/blocks/class-convertkit-block-form-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function maybe_subscribe() {
$custom_fields
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
// Store entry and return.
if ( $form_data['store_entries'] ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/blocks/class-convertkit-block-form-trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function render( $atts ) {
$this->is_block_editor_request()
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $html ) ) {
if ( $settings->debug_enabled() ) {
return '<!-- ' . $html->get_error_message() . ' -->';
Expand Down
6 changes: 3 additions & 3 deletions includes/blocks/class-convertkit-block-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,14 @@ public function render( $atts ) {
$forms = new ConvertKit_Resource_Forms( 'output_form' );
$form = $forms->get_html( $form_id, $post_id );

// If an error occured, it might be that we're requesting a Form ID that exists in ConvertKit
// If an error occurred, it might be that we're requesting a Form ID that exists in ConvertKit
// but does not yet exist in the Plugin's Form Resources.
// If so, refresh the Form Resources and try again.
if ( is_wp_error( $form ) && $form->get_error_data() === 404 ) {
// Refresh Forms from the API.
$result = $forms->refresh();

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
if ( $settings->debug_enabled() ) {
return '<!-- ' . $result->get_error_message() . ' --> <!-- ' . $form->get_error_message() . ' -->';
Expand All @@ -403,7 +403,7 @@ public function render( $atts ) {
$form = $forms->get_html( $form_id, $post_id );
}

// If an error still occured, the shortcode might be from the ConvertKit App for a Legacy Form ID
// If an error still occurred, the shortcode might be from the ConvertKit App for a Legacy Form ID
// These ConvertKit App shortcodes, for some reason, use a different Form ID than the one presented
// to us in the API.
// For example, a Legacy Form ID might be 470099, but the ConvertKit app says to use the shortcode [convertkit form=5281783]).
Expand Down
2 changes: 1 addition & 1 deletion includes/blocks/class-convertkit-block-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public function render( $atts ) {
)
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $html ) ) {
if ( $settings->debug_enabled() ) {
return '<!-- ' . $html->get_error_message() . ' -->';
Expand Down
4 changes: 2 additions & 2 deletions includes/class-convertkit-broadcasts-exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function run_row_action() {
// Export Post to a draft ConvertKit Broadcast.
$result = $this->export_post_to_broadcast( $post_id );

// If an error occured, display an error message.
// If an error occurred, display an error message.
if ( is_wp_error( $result ) ) {
wp_die( esc_html( $result->get_error_message() ) );
}
Expand Down Expand Up @@ -237,7 +237,7 @@ public function export_post_to_broadcast( $post_id ) {
$post->post_excerpt
);

// If an error occured, return it now.
// If an error occurred, return it now.
if ( is_wp_error( $result ) ) {
return $result;
}
Expand Down
10 changes: 5 additions & 5 deletions includes/class-convertkit-broadcasts-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function import_broadcast( $broadcast_id, $post_status = 'publish', $auth
// Unset API class.
unset( $api );

// Bail if an error occured fetching the Broadcast.
// Bail if an error occurred fetching the Broadcast.
if ( is_wp_error( $broadcast ) ) {
$this->maybe_log( 'ConvertKit_Broadcasts_Importer::refresh(): Broadcast #' . $broadcast_id . '. Error fetching from API: ' . $broadcast->get_error_message() );
return $broadcast;
Expand All @@ -190,7 +190,7 @@ public function import_broadcast( $broadcast_id, $post_status = 'publish', $auth
true
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $post_id ) ) {
$this->maybe_log( 'ConvertKit_Broadcasts_Importer::refresh(): Broadcast #' . $broadcast_id . '. Error on wp_insert_post(): ' . $post_id->get_error_message() );
return $post_id;
Expand All @@ -211,7 +211,7 @@ public function import_broadcast( $broadcast_id, $post_status = 'publish', $auth
true
);

// Bail if an error occured updating the Post.
// Bail if an error occurred updating the Post.
if ( is_wp_error( $post_id ) ) {
$this->maybe_log( 'ConvertKit_Broadcasts_Importer::refresh(): Broadcast #' . $broadcast_id . '. Error on wp_update_post() when adding Broadcast content: ' . $post_id->get_error_message() );
return $post_id;
Expand Down Expand Up @@ -251,7 +251,7 @@ public function import_broadcast( $broadcast_id, $post_status = 'publish', $auth
true
);

// Maybe log if an error occured updating the Post to the publish status.
// Maybe log if an error occurred updating the Post to the publish status.
if ( is_wp_error( $post_id ) ) {
$this->maybe_log( 'ConvertKit_Broadcasts_Importer::refresh(): Broadcast #' . $broadcast_id . '. Error on wp_update_post() when transitioning post status from draft to publish: ' . $post_id->get_error_message() );
return $post_id;
Expand Down Expand Up @@ -643,7 +643,7 @@ private function add_broadcast_image_to_post( $broadcast, $post_id ) {
$broadcast['thumbnail_alt']
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $image_id ) ) {
return $image_id;
}
Expand Down
24 changes: 12 additions & 12 deletions includes/class-convertkit-output-restrict-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function register_routes() {
$post_id
);

// If an error occured, build the email form view with the error message.
// If an error occurred, build the email form view with the error message.
if ( is_wp_error( $result ) ) {
// Set error to display on screen.
$output_restrict_content->error = $result;
Expand Down Expand Up @@ -287,7 +287,7 @@ public function register_routes() {
// Run subscriber authentication.
$result = $output_restrict_content->subscriber_authentication_verify( $post_id, $token, $subscriber_code );

// If an error occured, build the code form view with the error message.
// If an error occurred, build the code form view with the error message.
if ( is_wp_error( $result ) ) {
// Set error to display on screen.
$output_restrict_content->error = $result;
Expand Down Expand Up @@ -408,7 +408,7 @@ public function maybe_run_subscriber_authentication() {
// Tag subscriber.
$result = $this->api->tag_subscribe( $this->resource_id, $email );

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
$this->error = $result;
return;
Expand Down Expand Up @@ -436,7 +436,7 @@ public function maybe_run_subscriber_authentication() {
// Run subscriber authentication.
$result = $this->subscriber_authentication_send_code( $email, $this->post_id );

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
$this->error = $result;
return;
Expand Down Expand Up @@ -497,7 +497,7 @@ public function maybe_run_subscriber_verification() {
// Run subscriber verification.
$subscriber_id = $this->subscriber_authentication_verify( $this->post_id, sanitize_text_field( wp_unslash( $_REQUEST['token'] ) ), sanitize_text_field( wp_unslash( $_REQUEST['subscriber_code'] ) ) );

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $subscriber_id ) ) {
$this->error = $subscriber_id;
return;
Expand Down Expand Up @@ -526,7 +526,7 @@ public function subscriber_authentication_send_code( $email, $post_id ) {
$this->get_url( $post_id )
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $token ) ) {
return $token;
}
Expand Down Expand Up @@ -558,7 +558,7 @@ public function subscriber_authentication_verify( $post_id, $token, $subscriber_
// Verify the token and subscriber code.
$subscriber_id = $this->api->subscriber_authentication_verify( $token, $subscriber_code );

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $subscriber_id ) ) {
return $subscriber_id;
}
Expand Down Expand Up @@ -1127,7 +1127,7 @@ private function subscriber_has_access_to_product_by_signed_subscriber_id( $sign
// Get products that the subscriber has access to.
$result = $this->api->profile( $signed_subscriber_id );

// If an error occured, the subscriber ID is invalid.
// If an error occurred, the subscriber ID is invalid.
if ( is_wp_error( $result ) ) {
return false;
}
Expand Down Expand Up @@ -1157,7 +1157,7 @@ private function subscriber_has_access_to_form_by_signed_subscriber_id( $signed_
// Get products that the subscriber has access to.
$result = $this->api->profile( $signed_subscriber_id );

// If an error occured, the subscriber ID is invalid.
// If an error occurred, the subscriber ID is invalid.
if ( is_wp_error( $result ) ) {
return false;
}
Expand Down Expand Up @@ -1187,7 +1187,7 @@ private function subscriber_has_access_to_tag_by_signed_subscriber_id( $signed_s
// Get products that the subscriber has access to.
$result = $this->api->profile( $signed_subscriber_id );

// If an error occured, the subscriber ID is invalid.
// If an error occurred, the subscriber ID is invalid.
if ( is_wp_error( $result ) ) {
return false;
}
Expand Down Expand Up @@ -1217,7 +1217,7 @@ private function subscriber_has_access_to_tag_by_subscriber_id( $subscriber_id,
// Get tags that the subscriber has been assigned.
$tags = $this->api->get_subscriber_tags( $subscriber_id );

// If an error occured, the subscriber ID is invalid.
// If an error occurred, the subscriber ID is invalid.
if ( is_wp_error( $tags ) ) {
return false;
}
Expand Down Expand Up @@ -1253,7 +1253,7 @@ public function get_subscriber_id_from_request() {
$subscriber = new ConvertKit_Subscriber();
$subscriber_id = $subscriber->get_subscriber_id();

// If an error occured, the subscriber ID in the request/cookie is not a valid subscriber.
// If an error occurred, the subscriber ID in the request/cookie is not a valid subscriber.
if ( is_wp_error( $subscriber_id ) ) {
return 0;
}
Expand Down
12 changes: 6 additions & 6 deletions includes/class-convertkit-output.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function register_routes() {
$subscriber = new ConvertKit_Subscriber();
$subscriber_id = $subscriber->validate_and_store_subscriber_email( $email );

// Bail if an error occured i.e. API hasn't been configured.
// Bail if an error occurred i.e. API hasn't been configured.
if ( is_wp_error( $subscriber_id ) ) {
return rest_ensure_response( $subscriber_id );
}
Expand Down Expand Up @@ -202,7 +202,7 @@ public function maybe_tag_subscriber() {
if ( ! is_numeric( $this->subscriber_id ) ) {
$result = $api->profile( $this->subscriber_id );

// If an error occured, the subscriber ID is invalid.
// If an error occurred, the subscriber ID is invalid.
if ( is_wp_error( $result ) ) {
return;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ public function page_takeover() {
// Get Landing Page.
$landing_page = $this->landing_pages->get_html( $this->post_settings->get_landing_page() );

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $landing_page ) ) {
return;
}
Expand Down Expand Up @@ -372,7 +372,7 @@ public function append_form_to_content( $content ) {
// Get Form HTML.
$form = $this->forms->get_html( $form_id, $post_id );

// If an error occured, it could be because the specified Form ID for the Post either:
// If an error occurred, it could be because the specified Form ID for the Post either:
// - belongs to another ConvertKit account (i.e. API credentials were changed in the Plugin, but this Post's specified Form was not changed), or
// - the form was deleted from the ConvertKit account.
// Attempt to fallback to the default form for this Post Type.
Expand All @@ -396,7 +396,7 @@ public function append_form_to_content( $content ) {
// Get Form HTML.
$form = $this->forms->get_html( $form_id, $post_id );

// If an error occured again, the default form doesn't exist in this ConvertKit account.
// If an error occurred again, the default form doesn't exist in this ConvertKit account.
// Just return the Post Content, unedited.
if ( is_wp_error( $form ) ) {
if ( $this->settings->debug_enabled() ) {
Expand Down Expand Up @@ -840,7 +840,7 @@ public function get_subscriber_id_from_request() {
$subscriber = new ConvertKit_Subscriber();
$subscriber_id = $subscriber->get_subscriber_id();

// If an error occured, the subscriber ID in the request/cookie is not a valid subscriber.
// If an error occurred, the subscriber ID in the request/cookie is not a valid subscriber.
if ( is_wp_error( $subscriber_id ) ) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-convertkit-recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function verify_recaptcha( $recaptcha_response, $plugin_action ) {
)
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $response ) ) {
return $response;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function enabled() {
// Get script from API.
$result = $this->api->recommendations_script();

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
delete_option( $this->settings_name );
return false;
Expand Down
2 changes: 1 addition & 1 deletion includes/class-convertkit-resource-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function refresh() {
// Call parent refresh method.
$result = parent::refresh();

// If an error occured, maybe delete credentials from the Plugin's settings
// If an error occurred, maybe delete credentials from the Plugin's settings
// if the error is a 401 unauthorized.
if ( is_wp_error( $result ) ) {
convertkit_maybe_delete_credentials( $result, CONVERTKIT_OAUTH_CLIENT_ID );
Expand Down
2 changes: 1 addition & 1 deletion includes/class-convertkit-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ private function maybe_get_access_token_by_api_key_and_secret() {
get_site_url()
);

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-convertkit-subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function validate_and_store_subscriber_email( $subscriber_email ) {
// Get subscriber by email, to ensure they exist.
$subscriber_id = $api->get_subscriber_id( $subscriber_email );

// Bail if no subscriber exists with the given subscriber ID, or an error occured.
// Bail if no subscriber exists with the given subscriber ID, or an error occurred.
if ( is_wp_error( $subscriber_id ) ) {
// Delete the cookie.
$this->forget();
Expand Down
4 changes: 2 additions & 2 deletions includes/cron-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function convertkit_refresh_token() {
// Refresh the token.
$result = $api->refresh_token();

// If an error occured, don't save the new tokens.
// If an error occurred, don't save the new tokens.
// Logging is handled by the ConvertKit_API_V4 class.
if ( is_wp_error( $result ) ) {
return;
Expand Down Expand Up @@ -86,7 +86,7 @@ function convertkit_resource_refresh_posts() {
$posts = new ConvertKit_Resource_Posts( 'cron' );
$result = $posts->refresh();

// Bail if an error occured.
// Bail if an error occurred.
if ( is_wp_error( $result ) ) {
// Delete credentials if the error is a 401.
convertkit_maybe_delete_credentials( $result, CONVERTKIT_OAUTH_CLIENT_ID );
Expand Down
Loading
Loading