晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/stando/www/wp-content/plugins/google-analytics-premium/includes/admin/pages/ |
Upload File : |
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Callback to output the MonsterInsights settings page.
*
* @since 6.0.0
* @access public
*
* @return void
*/
function monsterinsights_tools_page() {
/**
* Developer Alert:
*
* Per the README, this is considered an internal hook and should
* not be used by other developers. This hook's behavior may be modified
* or the hook may be removed at any time, without warning.
*/
do_action( 'monsterinsights_head' );
?>
<?php echo monsterinsights_ublock_notice(); ?>
<!-- Tabs -->
<h1 id="monsterinsights-tools-page-main-nav" class="monsterinsights-main-nav-container monsterinsights-nav-container" data-container="#monsterinsights-tools-pages">
<a class="monsterinsights-main-nav-item monsterinsights-nav-item monsterinsights-spacing-item" href="#"> </a>
<a class="monsterinsights-main-nav-item monsterinsights-nav-item monsterinsights-active" href="#monsterinsights-main-tab-settings" title="<?php echo esc_attr( __( 'Import/Export', 'google-analytics-for-wordpress' ) ); ?>">
<?php echo esc_html__( 'Import/Export', 'google-analytics-for-wordpress' ); ?>
</a>
<a class="monsterinsights-main-nav-item monsterinsights-nav-item" href="#monsterinsights-main-tab-url-builder" title="<?php echo esc_attr( __( 'Campaign URL Builder', 'google-analytics-for-wordpress' ) ); ?>">
<?php echo esc_html__( 'URL Builder', 'google-analytics-for-wordpress' ); ?>
</a>
</h1>
<!-- Tab Panels -->
<div id="monsterinsights-tools-pages" class="monsterinsights-main-nav-tabs monsterinsights-nav-tabs wrap" data-navigation="#monsterinsights-tools-page-main-nav">
<h1 class="monsterinsights-hideme"></h1><!-- so wp notices are below the nav bar -->
<div id="monsterinsights-main-tab-settings" class="monsterinsights-main-nav-tab monsterinsights-nav-tab monsterinsights-active">
<?php monsterinsights_tools_settings_tab(); ?>
</div>
<div id="monsterinsights-main-tab-url-builder" class="monsterinsights-main-nav-tab monsterinsights-nav-tab">
<?php monsterinsights_tools_url_builder_tab(); ?>
</div>
</div>
<?php
}
function monsterinsights_tools_url_builder_tab(){
do_action( 'monsterinsights_tools_url_builder_tab' );
}
function monsterinsights_tools_settings_tab() {
ob_start();?>
<h2><?php echo esc_html__( 'Setting Tools', 'google-analytics-for-wordpress' );?></h2>
<p><?php echo esc_html__( 'You can use the below tools to import settings from other MonsterInsights websites or export settings to import into another MonsterInsights install.', 'google-analytics-for-wordpress' ); ?> </p>
<br />
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="monsterinsights-import-settings">
<?php echo esc_html__( 'Import Settings', 'google-analytics-for-wordpress' );?>
</label>
</th>
<td>
<?php
if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ){
echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'Successfully imported settings!','google-analytics-for-wordpress'), 'success', false, array() );
}
?>
<form method="post" enctype="multipart/form-data">
<p>
<input type="file" name="import_file"/>
<input type="hidden" name="monsterinsights_action" value="monsterinsights_import_settings" />
</p>
<p class="description"><?php echo esc_html__( 'Paste the import field content from another MonsterInsights site in above.', 'google-analytics-for-wordpress' );?></p>
<p>
<?php wp_nonce_field( 'monsterinsights_import_settings', 'monsterinsights_import_settings' ); ?>
</p>
<p>
<?php submit_button( __( 'Import', 'google-analytics-for-wordpress' ), 'monsterinsights-action-button button button-action', 'submit', false ); ?>
</p>
</form>
</td>
</tr>
<tr>
<th scope="row">
<label for="monsterinsights-export-settings">
<?php echo esc_html__( 'Export Settings:', 'google-analytics-for-wordpress' );?>
</label>
</th>
<td>
<form method="post" enctype="multipart/form-data">
<p>
<input type="hidden" name="monsterinsights_action" value="monsterinsights_export_settings" />
</p>
<p>
<?php wp_nonce_field( 'monsterinsights_export_settings', 'monsterinsights_export_settings' ); ?>
</p>
<p>
<?php submit_button( __( 'Export', 'google-analytics-for-wordpress' ), 'monsterinsights-settings-export monsterinsights-action-button button button-action', 'submit', false ); ?>
</p>
</form>
</td>
</tr>
</tbody>
</table>
<?php
echo ob_get_clean();
}
/**
* MonsterInsights settings export.
*
* @since 6.0.0
* @access public
*
* @return void
*/
function monsterinsights_process_export_settings() {
if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) {
return;
}
if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
return;
}
if ( $_POST['monsterinsights_action'] !== 'monsterinsights_export_settings' ){
return;
}
if ( empty( $_POST['monsterinsights_export_settings'] ) || ! wp_verify_nonce( $_POST['monsterinsights_export_settings'], 'monsterinsights_export_settings' ) ) {
return;
}
$settings = monsterinsights_export_settings();
ignore_user_abort( true );
nocache_headers();
header( 'Content-Type: application/json; charset=utf-8' );
header( 'Content-Disposition: attachment; filename=monsterinsights-settings-export-' . date( 'm-d-Y' ) . '.json' );
header( "Expires: 0" );
echo $settings;
exit;
}
add_action( 'admin_init', 'monsterinsights_process_export_settings' );
function monsterinsights_import_settings() {
if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) {
return;
}
if ( ! current_user_can( 'monsterinsights_save_settings' ) ) {
return;
}
if ( $_POST['monsterinsights_action'] !== 'monsterinsights_import_settings' ){
return;
}
if ( !wp_verify_nonce( $_POST['monsterinsights_import_settings'], 'monsterinsights_import_settings' ) ) {
return;
}
$extension = explode( '.', $_FILES['import_file']['name'] );
$extension = end( $extension );
if ( $extension != 'json' ) {
wp_die( __( 'Please upload a valid .json file', 'google-analytics-for-wordpress' ) );
}
$import_file = $_FILES['import_file']['tmp_name'];
if ( empty( $import_file ) ) {
wp_die( __( 'Please upload a file to import', 'google-analytics-for-wordpress' ) );
}
$file = file_get_contents( $import_file );
if ( empty( $file ) ) {
wp_die( __( 'Please upload a real settings export file to import', 'google-analytics-for-wordpress' ) );
}
// Retrieve the settings from the file and convert the json object to an array.
$new_settings = json_decode( wp_json_encode( json_decode( $file ) ), true );
$settings = monsterinsights_get_options();
$exclude = array(
'analytics_profile',
'analytics_profile_code',
'analytics_profile_name',
'oauth_version',
'cron_last_run',
'monsterinsights_oauth_status',
);
foreach ( $exclude as $e ) {
if ( ! empty( $new_settings[ $e ] ) ) {
unset( $new_settings[ $e ] );
}
}
if ( ! is_super_admin() ) {
if ( ! empty( $new_settings[ 'custom_code' ] ) ) {
unset( $new_settings[ 'custom_code' ] );
}
}
foreach ( $exclude as $e ) {
if ( ! empty( $settings[ $e ] ) ) {
$new_settings = $settings[ $e ];
}
}
global $monsterinsights_settings;
$monsterinsights_settings = $new_settings;
update_option( monsterinsights_get_option_name(), $new_settings );
wp_safe_redirect( admin_url( 'admin.php?page=monsterinsights_tools&action=import&result=success#monsterinsights-main-tab-settings' ) ); exit;
}
add_action( 'admin_init', 'monsterinsights_import_settings' );