first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
<?php
// Exit if accessed directly
if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
exit;
}
if (
! empty( $_REQUEST['dgwt-wcas-debug-analytics-delete-all-records'] ) &&
! empty( $_REQUEST['_wpnonce'] ) &&
wp_verify_nonce( $_REQUEST['_wpnonce'], 'dgwt_wcas_debug_analytics' )
) {
\DgoraWcas\Analytics\Database::wipeAllRecords();
?>
<div class="dgwt-wcas-notice notice notice-success">
<p>All analytics records have been deleted.</p>
</div>
<?php
}
if (
! empty( $_REQUEST['dgwt-wcas-debug-analytics-run-maintenance-task'] ) &&
! empty( $_REQUEST['_wpnonce'] ) &&
wp_verify_nonce( $_REQUEST['_wpnonce'], 'dgwt_wcas_debug_analytics' )
) {
do_action( \DgoraWcas\Analytics\Maintenance::HOOK );
?>
<div class="dgwt-wcas-notice notice notice-success">
<p>The task of maintaining the search analytics has been completed.</p>
</div>
<?php
}
?>
<h3>Analytics</h3>
<form action="<?php echo admin_url( 'admin.php' ); ?>" method="get">
<input type="hidden" name="page" value="dgwt_wcas_debug">
<?php wp_nonce_field( 'dgwt_wcas_debug_analytics', '_wpnonce', false ); ?>
<input type="submit" name="dgwt-wcas-debug-analytics-delete-all-records" class="button" value="Delete all records">
<input type="submit" name="dgwt-wcas-debug-analytics-run-maintenance-task" class="button" value="Run maintenance task">
</form>
<table class="wc_status_table widefat dgwt-wcas-table-debug-analytics">
<tr>
<td><b>Does the table exist?</b></td>
<td><?php echo \DgoraWcas\Analytics\Database::exist() ? 'yes' : 'no'; ?></td>
</tr>
<tr>
<td><b>Total records</b></td>
<td><?php echo \DgoraWcas\Analytics\Database::getRecordsCount(); ?></td>
</tr>
<tr>
<td><b>Is the maintenance task scheduled?</b></td>
<td><?php echo wp_next_scheduled( \DgoraWcas\Analytics\Maintenance::HOOK ) ? 'yes' : 'no'; ?></td>
</tr>
<tr>
<td><b>Constant <code>DGWT_WCAS_ANALYTICS_ONLY_CRITICAL</code></b></td>
<?php if ( defined( 'DGWT_WCAS_ANALYTICS_ONLY_CRITICAL' ) ) { ?>
<td>Is defined. <b><?php var_dump( DGWT_WCAS_ANALYTICS_ONLY_CRITICAL ); ?></b></td>
<?php } else { ?>
<td>not defined</td>
<?php } ?>
</tr>
<tr>
<td><b>Constant <code>DGWT_WCAS_ANALYTICS_EXPIRATION_IN_DAYS</code></b></td>
<?php if ( defined( 'DGWT_WCAS_ANALYTICS_EXPIRATION_IN_DAYS' ) ) { ?>
<td>Is defined. Days: <b><?php echo DGWT_WCAS_ANALYTICS_EXPIRATION_IN_DAYS; ?></b></td>
<?php } else { ?>
<td>not defined</td>
<?php } ?>
</tr>
</table>
<?php

View File

@@ -0,0 +1,33 @@
<?php
// Exit if accessed directly
if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
exit;
}
if (
! empty( $_REQUEST['dgwt-wcas-debug-setting-reset-to-default'] ) &&
! empty( $_REQUEST['_wpnonce'] ) &&
wp_verify_nonce( $_REQUEST['_wpnonce'], 'dgwt_wcas_debug_reset_settings' )
) {
global $dgwtWcasSettings;
$dgwtWcasSettings = array();
delete_option( DGWT_WCAS_SETTINGS_KEY );
DgoraWcas\Admin\Install::createOptions();
?>
<div class="dgwt-wcas-notice notice notice-success">
<p>The settings have been reset to the default values.</p>
</div>
<?php
}
?>
<h3>Settings</h3>
<form action="<?php echo admin_url( 'admin.php' ); ?>" method="get"
onsubmit="return confirm('Are you sure you want to reset the settings?');">
<input type="hidden" name="page" value="dgwt_wcas_debug">
<?php wp_nonce_field( 'dgwt_wcas_debug_reset_settings', '_wpnonce', false ); ?>
<input type="submit" name="dgwt-wcas-debug-setting-reset-to-default" class="button"
value="Reset the plugin settings to default values">
</form>
<?php

View File

@@ -0,0 +1,149 @@
<?php
// Exit if accessed directly
if ( !defined( 'DGWT_WCAS_FILE' ) ) {
exit;
}
$prefix = 'fibosearch-debug_page-';
?>
<div class="wrap dgwt-wcas-settings dgwt-wcas-debug">
<h2 class="dgwt-wcas-settings__head">
<div class="dgwt-wcas-settings__title">
<div class="dgwt-wcas-settings__title-top">
<div class="dgwt-wcas-settings-logo-wrapper">
<img class="dgwt-wcas-settings-logo" src="<?php
echo DGWT_WCAS_URL . 'assets/img/logo-30.png' ;
?>"/>
<span class="dgwt-wcas-settings-logo-pro">Pro</span>
</div>
<span class="dgwt-wcas-settings__title-core"><?php
_e( 'Debug page', 'ajax-search-for-woocommerce' );
?></span>
</div>
</div>
</h2>
<h2 class="nav-tab-wrapper fibosearch-debug_page-nav-tab-wrapper">
<?php
?>
<a href="#dgwt_wcas_deb_anatytics" class="nav-tab" id="dgwt_wcas_deb_anatytics-tab">Analytics</a>
<a href="#dgwt_wcas_deb_maintenance" class="nav-tab" id="dgwt_wcas_deb_maintenance-tab">Maintenance</a>
</h2>
<?php
$active = 'analytics';
?>
<div class="dgwt-wcas-settings-body js-dgwt-wcas-settings-body" data-dgwt-wcas-active="<?php
echo esc_attr( $active ) ;
?>">
<?php
?>
<div id="dgwt_wcas_deb_anatytics" class="fibosearch-debug_page-group">
<?php
include_once DGWT_WCAS_DIR . 'partials/admin/debug/body-analytics.php';
?>
</div>
<div id="dgwt_wcas_deb_maintenance" class="fibosearch-debug_page-group">
<?php
include_once DGWT_WCAS_DIR . 'partials/admin/debug/body-maintenance.php';
?>
</div>
</div>
</div>
<script>
jQuery(document).ready(function ($) {
function markActiveGroup($group) {
var name = $group.attr('id').replace('dgwt_wcas_', '');
$group.addClass('dgwt-wcas-group-active');
$group.closest('.js-dgwt-wcas-settings-body').attr('data-dgwt-wcas-active', name)
}
// Switches option sections
$('.<?php
echo $prefix ;
?>group').hide();
var activetab = '';
if (typeof (localStorage) != 'undefined') {
maybe_active = localStorage.getItem('<?php
echo $prefix ;
?>settings-active-tab');
if (maybe_active) {
// Check if tabs exists
$('.<?php
echo $prefix ;
?>nav-tab-wrapper a:not(.js-nav-tab-minor)').each(function () {
if ($(this).attr('href') === maybe_active) {
activetab = maybe_active;
}
});
}
}
if (activetab != '' && $(activetab).length) {
$(activetab).fadeIn();
markActiveGroup($(activetab));
} else {
$('.<?php
echo $prefix ;
?>group:first').fadeIn();
markActiveGroup($('.<?php
echo $prefix ;
?>group:first'));
}
$('.<?php
echo $prefix ;
?>group .collapsed').each(function () {
$(this).find('input:checked').parent().parent().parent().nextAll().each(
function () {
if ($(this).hasClass('last')) {
$(this).removeClass('hidden');
return false;
}
$(this).filter('.hidden').removeClass('hidden');
});
});
if (activetab != '' && $(activetab + '-tab').length) {
$(activetab + '-tab').addClass('nav-tab-active');
} else {
$('.<?php
echo $prefix ;
?>nav-tab-wrapper a:first').addClass('nav-tab-active');
}
$('.<?php
echo $prefix ;
?>nav-tab-wrapper a:not(.js-nav-tab-minor)').on('click', function (evt) {
if (typeof (localStorage) != 'undefined') {
localStorage.setItem('<?php
echo $prefix ;
?>settings-active-tab', $(this).attr('href'));
}
$('.<?php
echo $prefix ;
?>nav-tab-wrapper a').removeClass('nav-tab-active');
$(this).addClass('nav-tab-active').trigger('blur');
var clicked_group = $(this).attr('href');
$('.<?php
echo $prefix ;
?>group').hide();
$(clicked_group).fadeIn();
markActiveGroup($(clicked_group));
evt.preventDefault();
});
});
</script>