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
13 changes: 5 additions & 8 deletions plugins/JsTrackerInstallCheck/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ public function __construct(JsTrackerInstallCheck $jsTrackerInstallCheck)
* nonce isn't found, return false. This also returns the main URL for the specified site so that we can auto-
* populate an input with it.
*
* @param int $idSite The numeric ID of the website to query.
* @param string $nonce Optional nonce string. If provided, it validates whether the success response matches the
* provided nonce. If omitted, it simply returns the most recent result for the provided site.
* @return array Indicates whether the check was successful and provides the main URL for the specified site.
* E.g. ['isSuccess' => true, 'mainUrl' => 'https://some-test-site.com']
* @throws \Exception If the user doesn't have the right permissions
* @return array{isSuccess:bool, mainUrl:string} Indicates whether the check was successful and provides the site's main URL.
*/
public function wasJsTrackerInstallTestSuccessful(int $idSite, string $nonce = ''): array
{
Expand All @@ -60,11 +59,9 @@ public function wasJsTrackerInstallTestSuccessful(int $idSite, string $nonce = '
* Initiate a test whether the JS tracking code has been successfully installed for a site. It generates a nonce and
* stores it in the option table so that it can be accessed later during the Tracker.isExcludedVisit event.
*
* @param string $url Optional URL to append the nonce to. If not provided, it uses the main URL of the site
* @return array containing the URL constructed using the main URL for the site and the newly created nonce as a
* query parameter.
* E.g. ['url' => 'https://some-site.com?tracker_install_check=c3dfa1abbbab6381baca0793b8dd5d', 'nonce' => 'c3dfa1abbbab6381baca0793b8dd5d']
* @throws \Exception If the user doesn't have the right permissions
* @param int $idSite The numeric ID of the website to test.
* @param string $url Optional URL to append the nonce to. If not provided, the site's main URL is used.
* @return array{url:string, nonce:string} The test URL and generated nonce.
*/
public function initiateJsTrackerInstallTest(int $idSite, string $url = ''): array
{
Expand Down
3 changes: 1 addition & 2 deletions plugins/JsTrackerInstallCheck/JsTrackerInstallCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ public function checkForJsTrackerInstallTestSuccess(int $idSite, string $nonce =
* stores it in the option table so that it can be accessed later during the Tracker.isExcludedVisit event.
*
* @param string $url Optional URL to append the nonce to. If not provided, it uses the main URL of the site
* @return array containing the URL constructed using the main URL for the site and the newly created nonce as a
* @return array{url:string, nonce:string} containing the URL constructed using the main URL for the site and the newly created nonce as a
* query parameter.
* E.g ['url' => 'https://some-site.com?tracker_install_check=c3dfa1abbbab6381baca0793b8dd5d', 'nonce' => 'c3dfa1abbbab6381baca0793b8dd5d']
* @throws \Exception
*/
public function initiateJsTrackerInstallTest(int $idSite, string $url = ''): array
{
Expand Down
Loading