Skip to content
Merged
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
28 changes: 28 additions & 0 deletions inc/admin-pages/class-hosting-integration-wizard-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,32 @@ public function section_test(): void {
]
);
}

/**
* Register the script for the test page.
*
* @return void
*/
public function register_scripts() {
parent::register_scripts();

wp_enqueue_script(
'wu-integration-test',
wu_get_asset('integration-test.js', 'js'),
[
'jquery',
'wu-vue',
],
wu_get_version(),
true
);
wp_add_inline_script(
'wu-integration-test',
'var wu_integration_test_data = {
integration_id: "' . esc_js($this->integration->get_id()) . '",
waiting_message: "' . esc_js(__('Waiting for results...', 'ultimate-multisite')) . '"
};',
'before'
);
}
}
7 changes: 6 additions & 1 deletion inc/checkout/class-checkout-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,12 @@ public function maybe_obfuscate_login_url(): void {

$wp_query->set_404();

include get_404_template();
$four_oh_four = get_404_template();

// Apparently not all themes have a 404 template.
if ($four_oh_four) {
include $four_oh_four;
}

die;
} else {
Expand Down
2 changes: 1 addition & 1 deletion inc/installers/class-base-installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function handle($status, $installer, $wizard) { // phpcs:ignore Generic.C
} catch (\Throwable $e) {
$wpdb->query('ROLLBACK'); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching

return new \WP_Error(esc_html($installer), esc_html($e->getMessage()));
return new \WP_Error(esc_html($installer), wp_kses_post($e->getMessage()));
}

$wpdb->query('COMMIT'); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
Expand Down
2 changes: 0 additions & 2 deletions inc/integrations/host-providers/class-base-host-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function init(): void {
* Adds an admin notice telling the admin that they should probably enable this integration.
*/
$this->alert_provider_detected();
return;
}

/*
Expand All @@ -96,7 +95,6 @@ public function init(): void {
* Adds an admin notice telling the admin that the provider is not correctly setup.
*/
$this->alert_provider_not_setup();
return;
}

/*
Expand Down
9 changes: 4 additions & 5 deletions inc/models/class-domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
* @param array $domains_and_ips The list of domains and IPs found on the DNS lookup.
* @return bool If the DNS is correctly setup or not.
*/
$result = apply_filters('wu_domain_has_correct_dns', $result, $this, $domains_and_ips);

Check failure on line 431 in inc/models/class-domain.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

@param tag must not be named $this. Choose a descriptive alias, for example $instance.

return $result;
}
Expand All @@ -452,7 +452,7 @@
*
* @since 2.0.0
*
* @return bool
* @return bool|\WP_Error
*/
public function save() {

Expand All @@ -473,8 +473,7 @@
* Deprecated: Mercator created domain.
*
* @since 2.0.0
* @param self The domain object after saving.
* @param self The domain object before the changes.
* @param self $domain The domain object after saving.
* @return void.
*/
do_action_deprecated('mercator.mapping.created', $deprecated_args, '2.0.0', 'wu_domain_post_save');
Expand All @@ -489,8 +488,8 @@
* Deprecated: Mercator updated domain.
*
* @since 2.0.0
* @param self The domain object after saving.
* @param self The domain object before the changes.
* @param self $domain The domain object after saving.
* @param self $before_changes The domain object before the changes.
* @return void.
*/
do_action_deprecated('mercator.mapping.updated', $deprecated_args, '2.0.0', 'wu_domain_post_save');
Expand Down Expand Up @@ -621,7 +620,7 @@
$data = wp_cache_get('domain:' . $domain, 'domain_mappings');

if ( ! empty($data) && 'notexists' !== $data) {
return new static($data);

Check failure on line 623 in inc/models/class-domain.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Unsafe usage of new static().
} elseif ('notexists' === $data) {
++$not_exists;
}
Expand Down Expand Up @@ -662,6 +661,6 @@

wp_cache_set('domain:' . $mapping->domain, $mapping, 'domain_mappings');

return new static($mapping);

Check failure on line 664 in inc/models/class-domain.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Unsafe usage of new static().
}
}
12 changes: 0 additions & 12 deletions views/wizards/host-integrations/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,3 @@
</div>

</div>

<?php
wp_enqueue_script('wu-integration-test', wu_get_asset('integration-test.js', 'js'), ['jquery', 'vue'], wu_get_version(), true);
wp_add_inline_script(
'wu-integration-test',
'var wu_integration_test_data = {
integration_id: "' . esc_js($integration->get_id()) . '",
waiting_message: "' . esc_js(__('Waiting for results...', 'ultimate-multisite')) . '"
};',
'before'
);
?>
Loading