Changeset 3244712
- Timestamp:
- 02/21/2025 09:43:44 PM (13 days ago)
- Location:
- moving-contents/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
moving-contents/trunk/lib/class-movingcontentsadmin.php
r3092627 r3244712 84 84 if ( $file == $this_plugin ) { 85 85 $links[] = '<a href="' . admin_url( 'admin.php?page=movingcontents' ) . '">Moving Contents</a>'; 86 $links[] = '<a href="' . admin_url( 'admin.php?page=movingcontents-generate-json' ) . '">' . __( 'Export' ) . '</a>';87 $links[] = '<a href="' . admin_url( 'admin.php?page=movingcontents-update-db' ) . '">' . __( 'Import' ) . '</a>';86 $links[] = '<a href="' . admin_url( 'admin.php?page=movingcontents-generate-json' ) . '">' . __( 'Export', 'moving-contents' ) . '</a>'; 87 $links[] = '<a href="' . admin_url( 'admin.php?page=movingcontents-update-db' ) . '">' . __( 'Import', 'moving-contents' ) . '</a>'; 88 88 } 89 89 return $links; … … 106 106 add_submenu_page( 107 107 'movingcontents', 108 __( 'Export' ),109 __( 'Export' ),108 __( 'Export', 'moving-contents' ), 109 __( 'Export', 'moving-contents' ), 110 110 'manage_options', 111 111 'movingcontents-generate-json', … … 114 114 add_submenu_page( 115 115 'movingcontents', 116 __( 'Import' ),117 __( 'Import' ),116 __( 'Import', 'moving-contents' ), 117 __( 'Import', 'moving-contents' ), 118 118 'manage_options', 119 119 'movingcontents-update-db', … … 130 130 131 131 if ( ! current_user_can( 'manage_options' ) ) { 132 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );132 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'moving-contents' ) ); 133 133 } 134 134 … … 142 142 update_option( 'moving_contents_mail_send', false ); 143 143 } 144 echo '<div class="notice notice-success is-dismissible"><ul><li>' . esc_html( __( 'Settings' ) . ' --> ' . __( 'Changes saved.' ) ) . '</li></ul></div>';144 echo '<div class="notice notice-success is-dismissible"><ul><li>' . esc_html( __( 'Settings', 'moving-contents' ) . ' --> ' . __( 'Changes saved.', 'moving-contents' ) ) . '</li></ul></div>'; 145 145 } 146 146 } … … 150 150 if ( ! empty( $_POST['number_files'] ) ) { 151 151 update_option( 'moving_contents_number_files', absint( $_POST['number_files'] ) ); 152 echo '<div class="notice notice-success is-dismissible"><ul><li>' . esc_html( __( 'Settings' ) . ' --> ' . __( 'Changes saved.' ) ) . '</li></ul></div>';152 echo '<div class="notice notice-success is-dismissible"><ul><li>' . esc_html( __( 'Settings', 'moving-contents' ) . ' --> ' . __( 'Changes saved.', 'moving-contents' ) ) . '</li></ul></div>'; 153 153 } 154 154 } … … 170 170 array( 171 171 'options' => function ( $value ) { 172 return sanitize_ text_field( $value );172 return sanitize_file_name( $value ); 173 173 }, 174 174 ) … … 182 182 <div class="wrap"> 183 183 184 <h2>Moving Contents <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-generate-json' ) ); ?>" style="text-decoration: none;"><?php esc_html_e( 'Export' ); ?></a>185 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-update-db' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Import' ); ?></a>184 <h2>Moving Contents <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-generate-json' ) ); ?>" style="text-decoration: none;"><?php esc_html_e( 'Export', 'moving-contents' ); ?></a> 185 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-update-db' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Import', 'moving-contents' ); ?></a> 186 186 <?php 187 187 if ( class_exists( 'MovingUsers' ) ) { … … 207 207 <div style="clear: both;"></div> 208 208 209 <h3><?php esc_html_e( 'Export' ); ?></h3>209 <h3><?php esc_html_e( 'Export', 'moving-contents' ); ?></h3> 210 210 <form method="post" action="<?php echo esc_url( $scriptname ); ?>"> 211 211 <div style="margin: 5px; padding: 5px;"> … … 217 217 <input type="checkbox" name="mail_send" value="1" <?php checked( get_option( 'moving_contents_mail_send' ), true ); ?>> 218 218 <?php esc_html_e( 'Send the exported JSON file by e-mail', 'moving-contents' ); ?> 219 <?php submit_button( __( 'Change' ), 'large', 'Jsonmailsend', false, array( 'style' => 'vertical-align: middle;' ) ); ?>219 <?php submit_button( __( 'Change', 'moving-contents' ), 'large', 'Jsonmailsend', false, array( 'style' => 'vertical-align: middle;' ) ); ?> 220 220 </div> 221 <?php submit_button( __( 'Export as JSON' ), 'large', 'Cjson', true ); ?>221 <?php submit_button( __( 'Export as JSON', 'moving-contents' ), 'large', 'Cjson', true ); ?> 222 222 </div> 223 223 <?php … … 229 229 <?php esc_html_e( 'Number of latest files to keep', 'moving-contents' ); ?> : 230 230 <input type="number" name="number_files" value="<?php echo esc_attr( get_option( 'moving_contents_number_files', 5 ) ); ?>" min="1" max="100" step="1" style="width: 70px;" /> 231 <?php submit_button( __( 'Change' ), 'large', 'Cnumber', false ); ?>232 <?php submit_button( __( 'Delete' ), 'large', 'Djson', true ); ?>231 <?php submit_button( __( 'Change', 'moving-contents' ), 'large', 'Cnumber', false ); ?> 232 <?php submit_button( __( 'Delete', 'moving-contents' ), 'large', 'Djson', true ); ?> 233 233 <table border=1 cellspacing="0" cellpadding="5" bordercolor="#000000" style="border-collapse: collapse;"> 234 234 <tr> 235 <th><?php esc_html_e( 'Delete' ); ?></th>236 <th><?php esc_html_e( 'Name' ); ?></th>237 <th><?php esc_html_e( 'Date/time' ); ?></th>238 <th><?php esc_html_e( 'Size' ); ?></th>239 <th><?php esc_html_e( 'Action' ); ?></th>235 <th><?php esc_html_e( 'Delete', 'moving-contents' ); ?></th> 236 <th><?php esc_html_e( 'Name', 'moving-contents' ); ?></th> 237 <th><?php esc_html_e( 'Date/time', 'moving-contents' ); ?></th> 238 <th><?php esc_html_e( 'Size', 'moving-contents' ); ?></th> 239 <th><?php esc_html_e( 'Action', 'moving-contents' ); ?></th> 240 240 </tr> 241 241 <?php … … 266 266 </td> 267 267 <td> 268 <button type="button" class="button button-large" onclick="location.href='<?php echo esc_url( $json_fileurl ); ?>'"><?php esc_html_e( 'View' ); ?></button>268 <button type="button" class="button button-large" onclick="location.href='<?php echo esc_url( $json_fileurl ); ?>'"><?php esc_html_e( 'View', 'moving-contents' ); ?></button> 269 269 270 270 <a href="<?php echo esc_url( $json_fileurl ); ?>" download="<?php echo esc_attr( $value ); ?>"><button type="button" class="button button-large"><?php esc_html_e( 'Download', 'moving-contents' ); ?></button></a> … … 276 276 ?> 277 277 </table> 278 <?php submit_button( __( 'Delete' ), 'large', 'Djson', true ); ?>278 <?php submit_button( __( 'Delete', 'moving-contents' ), 'large', 'Djson', true ); ?> 279 279 </div> 280 280 <?php … … 296 296 297 297 if ( ! current_user_can( 'manage_options' ) ) { 298 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );298 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'moving-contents' ) ); 299 299 } 300 300 … … 310 310 if ( isset( $_SERVER['CONTENT_LENGTH'] ) && ! empty( $_SERVER['CONTENT_LENGTH'] ) ) { 311 311 if ( 0 < $max_upload_size && $max_upload_size < intval( $_SERVER['CONTENT_LENGTH'] ) ) { 312 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'This is larger than the maximum size. Please try another.' ) . '</li></ul></div>';312 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'This is larger than the maximum size. Please try another.', 'moving-contents' ) . '</li></ul></div>'; 313 313 } 314 314 } … … 318 318 if ( ! empty( $_POST['max_execution_time'] ) ) { 319 319 update_option( 'moving_contents_max_execution_time', absint( $_POST['max_execution_time'] ) ); 320 echo '<div class="notice notice-success is-dismissible"><ul><li>' . esc_html( __( 'Settings' ) . ' --> ' . __( 'Changes saved.' ) ) . '</li></ul></div>';320 echo '<div class="notice notice-success is-dismissible"><ul><li>' . esc_html( __( 'Settings', 'moving-contents' ) . ' --> ' . __( 'Changes saved.', 'moving-contents' ) ) . '</li></ul></div>'; 321 321 } 322 322 } … … 343 343 $filetype = wp_check_filetype( $filename ); 344 344 if ( ! $filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) { 345 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'Sorry, this file type is not permitted for security reasons.' ) . '</li></ul></div>';345 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'Sorry, this file type is not permitted for security reasons.', 'moving-contents' ) . '</li></ul></div>'; 346 346 } else { 347 347 $filetype2 = wp_check_filetype( $filename, array( $filetype['ext'] => $mimetype ) ); … … 392 392 wp_delete_file( $json_file ); 393 393 } else { 394 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'Could not copy file.' ) . '</li></ul></div>';394 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'Could not copy file.', 'moving-contents' ) . '</li></ul></div>'; 395 395 } 396 396 } else { 397 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'Sorry, this file type is not permitted for security reasons.' ) . '</li></ul></div>';397 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'Sorry, this file type is not permitted for security reasons.', 'moving-contents' ) . '</li></ul></div>'; 398 398 } 399 399 } 400 400 } else { 401 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'No such file exists! Double check the name and try again.' ) . '</li></ul></div>';401 echo '<div class="notice notice-error is-dismissible"><ul><li>' . esc_html__( 'No such file exists! Double check the name and try again.', 'moving-contents' ) . '</li></ul></div>'; 402 402 } 403 403 } … … 408 408 <div class="wrap"> 409 409 410 <h2>Moving Contents <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-update-db' ) ); ?>" style="text-decoration: none;"><?php esc_html_e( 'Import' ); ?></a>411 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-generate-json' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Export' ); ?></a>410 <h2>Moving Contents <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-update-db' ) ); ?>" style="text-decoration: none;"><?php esc_html_e( 'Import', 'moving-contents' ); ?></a> 411 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-generate-json' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Export', 'moving-contents' ); ?></a> 412 412 <?php 413 413 if ( class_exists( 'MovingUsers' ) ) { … … 444 444 <form method="post" action="<?php echo esc_url( $scriptname ); ?>" enctype="multipart/form-data"> 445 445 <?php wp_nonce_field( 'mc_file_load', 'movingcontents_import_file_load' ); ?> 446 <strong><?php esc_html_e( 'Database' ); ?></strong>446 <strong><?php esc_html_e( 'Database', 'moving-contents' ); ?></strong> 447 447 <div style="margin: 5px; padding: 5px;"> 448 448 <input type="checkbox" name="all_clear" value="1" checked="checked" /> … … 451 451 </div> 452 452 <hr> 453 <strong><?php esc_html_e( 'User' ); ?></strong>453 <strong><?php esc_html_e( 'User', 'moving-contents' ); ?></strong> 454 454 <div style="margin: 5px; padding: 5px;"> 455 455 <input type="checkbox" name="current_user_id" value="1" /> … … 464 464 <table border=1 cellspacing="0" cellpadding="5" bordercolor="#000000" style="border-collapse: collapse;"> 465 465 <tr> 466 <th><?php echo esc_html( __( 'Original site', 'moving-contents' ) . '[' . __( 'User' ) . ' ID' ); ?>]</th>467 <th><?php echo esc_html( __( 'Current site', 'moving-contents' ) . '[' . __( 'Username' ) . ' : ' . __( 'User' ) . ' ID' ); ?>]</th>466 <th><?php echo esc_html( __( 'Original site', 'moving-contents' ) . '[' . __( 'User', 'moving-contents' ) . ' ID' ); ?>]</th> 467 <th><?php echo esc_html( __( 'Current site', 'moving-contents' ) . '[' . __( 'Username', 'moving-contents' ) . ' : ' . __( 'User', 'moving-contents' ) . ' ID' ); ?>]</th> 468 468 </tr> 469 469 <?php … … 496 496 <hr> 497 497 498 <strong><?php esc_html_e( 'Content' ); ?></strong>498 <strong><?php esc_html_e( 'Content', 'moving-contents' ); ?></strong> 499 499 <div style="margin: 5px; padding: 5px;"> 500 500 <?php esc_html_e( 'Replace all URLs in the content as follows.', 'moving-contents' ); ?> … … 536 536 <p class="description"> 537 537 <?php echo wp_kses_post( $max_execution_time_text ); ?>:<input type="number" step="1" min="1" max="9999" style="width: 80px;" name="max_execution_time" value="<?php echo esc_attr( $max_execution_time ); ?>" /> 538 <?php submit_button( __( 'Change' ), 'large', 'C_max_execution_time', false ); ?>538 <?php submit_button( __( 'Change', 'moving-contents' ), 'large', 'C_max_execution_time', false ); ?> 539 539 </p> 540 540 <?php … … 554 554 <?php 555 555 /* translators: Maximum upload file size */ 556 echo esc_html( sprintf( __( 'Maximum upload file size: %s.' ), $limit_str ) );556 echo esc_html( sprintf( __( 'Maximum upload file size: %s.', 'moving-contents' ), $limit_str ) ); 557 557 ?> 558 558 </div> … … 576 576 577 577 if ( ! current_user_can( 'manage_options' ) ) { 578 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );578 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'moving-contents' ) ); 579 579 } 580 580 … … 583 583 584 584 <h2>Moving Contents 585 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-generate-json' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Export' ); ?></a>586 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-update-db' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Import' ); ?></a>585 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-generate-json' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Export', 'moving-contents' ); ?></a> 586 <a href="<?php echo esc_url( admin_url( 'admin.php?page=movingcontents-update-db' ) ); ?>" class="page-title-action"><?php esc_html_e( 'Import', 'moving-contents' ); ?></a> 587 587 <?php 588 588 if ( class_exists( 'MovingUsers' ) ) { … … 652 652 } 653 653 } 654 $plugin_version = __( 'Version:' ) . ' ' . $plugin_ver_num;654 $plugin_version = __( 'Version:', 'moving-contents' ) . ' ' . $plugin_ver_num; 655 655 /* translators: FAQ Link & Slug */ 656 656 $faq = sprintf( __( 'https://wordpress.org/plugins/%s/faq', 'moving-contents' ), $slug ); … … 673 673 <?php 674 674 /* translators: Plugin translation link */ 675 echo esc_html( sprintf( __( 'Translations for %s' ), $plugin_name ) );675 echo esc_html( sprintf( __( 'Translations for %s', 'moving-contents' ), $plugin_name ) ); 676 676 ?> 677 677 </a> | <a style="text-decoration: none;" href="<?php echo esc_url( $facebook ); ?>" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-facebook"></span></a> | <a style="text-decoration: none;" href="<?php echo esc_url( $twitter ); ?>" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-twitter"></span></a> | <a style="text-decoration: none;" href="<?php echo esc_url( $youtube ); ?>" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-video-alt3"></span></a> … … 682 682 <h3><?php esc_html_e( 'Please make a donation if you like my work or would like to further the development of this plugin.', 'moving-contents' ); ?></h3> 683 683 <div style="text-align: right; margin: 5px; padding: 5px;"><span style="padding: 3px; color: #ffffff; background-color: #008000">Plugin Author</span> <span style="font-weight: bold;">Katsushi Kawamori</span></div> 684 <button type="button" style="margin: 5px; padding: 5px;" onclick="window.open('<?php echo esc_url( $donate ); ?>')"><?php esc_html_e( 'Donate to this plugin »' ); ?></button>684 <button type="button" style="margin: 5px; padding: 5px;" onclick="window.open('<?php echo esc_url( $donate ); ?>')"><?php esc_html_e( 'Donate to this plugin »', 'moving-contents' ); ?></button> 685 685 </div> 686 686 -
moving-contents/trunk/movingcontents.php
r3092627 r3244712 4 4 * Plugin URI: https://wordpress.org/plugins/moving-contents/ 5 5 * Description: Supports the transfer of Contents between servers. 6 * Version: 1.1 16 * Version: 1.12 7 7 * Author: Katsushi Kawamori 8 8 * Author URI: https://riverforest-wp.info/ -
moving-contents/trunk/readme.txt
r3182717 r3244712 6 6 Requires PHP: 8.0 7 7 Tested up to: 6.7 8 Stable tag: 1.1 18 Stable tag: 1.12 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 58 58 == Changelog == 59 59 60 = [1.12] 2025/02/22 = 61 * Fix - Sanitize file names when deleting json files. 62 60 63 = [1.11] 2024/05/26 = 61 64 * Fix - Fixed problem with import files not being copied. … … 96 99 = 1.00 = 97 100 Initial release. 101 102 == Upgrade Notice == 103 104 = 1.12 = 105 Security measures. 106 107 = 1.00 = 108 Initial release. 109
Note: See TracChangeset
for help on using the changeset viewer.