' ) . $msg . '
'
);
}
// check SimpleXML
if( in_array( 'check_simplexml', array_values($actions)) ){
$status = false;
$msg = '';
if ( function_exists('simplexml_load_string') ) {
$msg = __('Your server has the SimpleXML library enabled.', $this->the_plugin->localizationName );
$status = true;
} else {
$msg = sprintf( __( 'Your server does not have the
library enabled - some gateway plugins which use SimpleXML library may not work as expected.', $this->the_plugin->localizationName ), 'http://php.net/manual/en/book.simplexml.php' );
$status = false;
}
$return = array(
'status' => ( $status == true ? 'valid' : 'valid' ),
'html' => ( $status == true ? '
' : '
' ) . $msg . '
'
);
}
// active plugins
if( in_array( 'active_plugins', array_values($actions)) ){
$active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() )
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
$wc_plugins = array();
foreach ( $active_plugins as $plugin ) {
$plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
$dirname = dirname( $plugin );
$version_string = '';
if ( ! empty( $plugin_data['Name'] ) ) {
if ( strstr( $dirname, $this->the_plugin->localizationName ) ) {
if ( false === ( $version_data = get_transient( $plugin . '_version_data' ) ) ) {
$changelog = wp_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' );
$cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) );
if ( ! empty( $cl_lines ) ) {
foreach ( $cl_lines as $line_num => $cl_line ) {
if ( preg_match( '/^[0-9]/', $cl_line ) ) {
$date = str_replace( '.' , '-' , trim( substr( $cl_line , 0 , strpos( $cl_line , '-' ) ) ) );
$version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) );
$update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) );
$version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog );
set_transient( $plugin . '_version_data', $version_data , 60*60*12 );
break;
}
}
}
}
if ( ! empty( $version_data['version'] ) && version_compare( $version_data['version'], $plugin_data['Version'], '!=' ) )
$version_string = ' –
' . $version_data['version'] . ' ' . __( 'is available', $this->the_plugin->localizationName ) . '';
}
$wc_plugins[] = $plugin_data['Name'] . ' ' . __( 'by', $this->the_plugin->localizationName ) . ' ' . $plugin_data['Author'] . ' ' . __( 'version', $this->the_plugin->localizationName ) . ' ' . $plugin_data['Version'] . $version_string;
}
}
if ( sizeof( $wc_plugins ) > 0 ){
$return = array(
'status' => 'valid',
'html' => implode( ',
', $wc_plugins )
);
}
}
// active modules of the plugin
if( in_array( 'active_modules', array_values($actions)) ){
require_once( $this->the_plugin->cfg['paths']['plugin_dir_path'] . 'modules/modules_manager/list.inc.php' );
$active_modules = (array) $this->the_plugin->cfg['activate_modules'];
$__modules = array();
foreach ( $active_modules as $module => $status ) {
$tryed_module = $this->the_plugin->cfg['modules'][ "$module" ];
$moduleInfo = array();
if( isset($tryed_module) && count($tryed_module) > 0 ) {
$alias = $module;
$moduleInfo = array(
'title' => $tryed_module["$module"]['menu']['title'],
'version' => $tryed_module["$module"]['version'],
'icon' => '
', //$tryed_module["$module"]['menu']['icon'],
'description' => isset($tryed_module["$module"]['description']) ? $tryed_module["$module"]['description'] : '',
'url' => isset($tryed_module["$module"]['in_dashboard']['url']) ? $tryed_module["$module"]['in_dashboard']['url'] : ''
);
$title = '
' . $moduleInfo['title'] . '';
if ( isset($moduleInfo['url']) && !empty($moduleInfo['url']) ) {
$title = '
' . $title . '';
}
$__modules[] = '
' . $moduleInfo['icon']
. $title
. ',' . $moduleInfo['version'] . '
(' . $moduleInfo['description'] . ')
';
}
}
if ( sizeof( $__modules ) > 0 ){
$return = array(
'status' => 'valid',
'html' => implode( '', $__modules )
);
}
}
if( in_array('WooZoneEnableAjaxDebug', array_values($actions)) ) {
$wp_ajax_debug = $this->the_plugin->wp_ajax_debug();
$new_status = ! $wp_ajax_debug;
$_SESSION['AATeam_ajax_debug'] = $new_status;
$return = array(
'status' => 'valid',
'box' => $this->get_box_wp_ajax_debug(),
);
}
die(json_encode($return));
}
public function ajax_operation( $retType='die' ) {
$action = isset($_REQUEST['sub_action']) ? $_REQUEST['sub_action'] : '';
$ret = array(
'status' => 'invalid',
'html' => ''
);
if (!in_array($action, array(
'check_integrity_database',
))) die(json_encode($ret));
if ( 'check_integrity_database' == $action ) {
$opStatus = $this->the_plugin->plugin_integrity_check( 'all', true );
$opStatus_stat = $this->the_plugin->plugin_integrity_get_last_status( 'check_database' );
$check_last_msg = '';
if ( '' != trim($opStatus_stat['html']) ) {
$check_last_msg = ( $opStatus_stat['status'] == true ? '