Skip to content

Commit

Permalink
Merge pull request #2631 from kprajapatii/master
Browse files Browse the repository at this point in the history
2.3.62
  • Loading branch information
kprajapatii authored Jul 8, 2024
2 parents 5fe8e60 + 9e8ed19 commit 0fa6d86
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 1,538 deletions.
111 changes: 0 additions & 111 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,117 +447,6 @@ jQuery(document).ready(function() {
/* Check Uncheck All Related Options End*/

// Diagnosis related js starts here
/* Check Uncheck All Related Options Start*/
jQuery(document).ready(function() {
jQuery('.geodir_diagnosis_button').on("click",function(e) {
e.preventDefault();
var diagnose = (jQuery(this).data('diagnose'));
var step_process = (jQuery(this).data('step'));
var ptype = (jQuery(this).data('ptype'));
if (step_process == '1') {
jQuery('#' + diagnose + '_sub_table').show();
} else {
jQuery('.tool-' + diagnose).remove();
var result_container = jQuery('.geodir_diagnostic_result-' + diagnose);
if (!result_container.length) {
if( typeof ptype !== "undefined") {
jQuery('<tr class="gd-tool-results tool-' + diagnose + '" ><td colspan="3"><span class="gd-tool-results-remove" onclick="jQuery(this).closest(\'tr\').remove();"></span><div class="geodir_diagnostic_result-' + diagnose + '"></div></td></tr>').insertAfter(jQuery('#' + diagnose +'_'+ ptype));
} else {
jQuery('<tr class="gd-tool-results tool-' + diagnose + '" ><td colspan="3"><span class="gd-tool-results-remove" onclick="jQuery(this).closest(\'tr\').remove();"><i class="fas fa-spinner fa-spin"></i></span><div class="geodir_diagnostic_result-' + diagnose + '"></div></td></tr>').insertAfter(jQuery(this).parents('tr'));
}
var result_container = jQuery('.geodir_diagnostic_result-' + diagnose);
}

if( typeof ptype !== "undefined") {
jQuery('<tr>'+
'<td colspan="3">' +
'<div class="">' +
'<div id="gd_progressbar">' +
'<div class="gd-progress-label"></div>' +
'</div>' +
'</div>' +
'</td>' +
'</tr>').insertAfter(jQuery('#' + diagnose +'_'+ ptype));

jQuery('#gd_progressbar').progressbar({value: 0});
jQuery('#gd_progressbar .gd-progress-label').html('<i class="fas fa-sync fa-spin"></i> Processing...');

}

// start the process
gd_process_diagnose_step( 0, ptype, diagnose, result_container );
}

});

geodir_enable_fix_buttons(); // enabel fix buttons
});

function gd_process_diagnose_step(step, ptype, diagnose, result_container) {
jQuery.ajax({
url: geodir_params.ajax_url,
type: 'POST',
dataType: 'html',
data: {
action: 'geodir_admin_ajax',
geodir_admin_ajax_action: 'diagnosis',
diagnose_this: diagnose,
step: step,
ptype: ptype
},
beforeSend: function() {},
success: function(data, textStatus, xhr) {
if( typeof ptype === "undefined" || 'done' == data ) {
if( typeof ptype !== "undefined"){
jQuery('#' + diagnose +'_'+ ptype).html('<ul class="geodir_noproblem_info"><li>'+data+'</li></ul>');
jQuery('#gd_progressbar').remove();
jQuery('#' + diagnose + '_sub_table').find('.gd-tool-results').remove();

} else {
jQuery('.tool-' + diagnose + ' .gd-tool-results-remove').html('<i class="fas fa-times"></i>');
result_container.html(data);
}
geodir_enable_fix_buttons(); //enable new fix buttons
} else {
resp = JSON.parse(data);
jQuery('#gd_progressbar').progressbar({value: resp.percent});
jQuery('#gd_progressbar .gd-progress-label').html('<i class="fas fa-sync fa-spin"></i> Processing...');
gd_process_diagnose_step(parseInt( resp.step ), ptype, diagnose, result_container)
}
},
error: function(xhr, textStatus, errorThrown) {
alert(textStatus);
}
}); // end of ajax
}

function geodir_enable_fix_buttons() {
jQuery('.geodir_fix_diagnostic_issue').on("click",function() {
var diagnose = (jQuery(this).data('diagnostic-issue'))
var result_container = jQuery(this).parents('td').find("div")

jQuery.ajax({
url: geodir_params.ajax_url,
type: 'POST',
dataType: 'html',
data: {
action: 'geodir_admin_ajax',
geodir_admin_ajax_action: 'diagnosis-fix',
diagnose_this: diagnose,
fix: 1
},
beforeSend: function() {},
success: function(data, textStatus, xhr) {
result_container.html(data);
geodir_enable_fix_buttons(); //enable new fix buttons
},
error: function(xhr, textStatus, errorThrown) {
alert(textStatus);
}
}); // end of ajax
});
}

function gd_progressbar(el, value, label) {
var value = parseFloat(value);
if ( value <= 100 ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: GeoDirectory
* Plugin URI: https://wpgeodirectory.com/
* Description: GeoDirectory - Business Directory Plugin for WordPress.
* Version: 2.3.61
* Version: 2.3.62
* Author: AyeCode - WP Business Directory Plugins
* Author URI: https://wpgeodirectory.com
* Text Domain: geodirectory
Expand All @@ -34,7 +34,7 @@ final class GeoDirectory {
*
* @var string
*/
public $version = '2.3.61';
public $version = '2.3.62';

/**
* GeoDirectory instance.
Expand Down Expand Up @@ -309,7 +309,6 @@ private function includes() {
new GeoDir_Admin(); // init the GD admin class

require_once( GEODIRECTORY_PLUGIN_DIR . 'includes/admin/admin-functions.php' );
require_once( GEODIRECTORY_PLUGIN_DIR . 'includes/admin/diagnostic-functions.php' );
require_once( GEODIRECTORY_PLUGIN_DIR . 'includes/admin/dashboard-functions.php' );
GeoDir_Admin_Install::init(); // init the install class
GeoDir_Admin_Upgrade::init(); // init the upgrade class
Expand Down
Loading

0 comments on commit 0fa6d86

Please sign in to comment.