Changeset 3217188
- Timestamp:
- 01/05/2025 01:03:39 PM (14 months ago)
- Location:
- admin-screenshots
- Files:
-
- 18 added
- 3 edited
-
tags/1.0.5 (added)
-
tags/1.0.5/README.md (added)
-
tags/1.0.5/admin-screenshots.php (added)
-
tags/1.0.5/assets (added)
-
tags/1.0.5/assets/css (added)
-
tags/1.0.5/assets/css/admin-screenshots-front.css (added)
-
tags/1.0.5/assets/css/admin-screenshots.css (added)
-
tags/1.0.5/assets/images (added)
-
tags/1.0.5/assets/images/shot-1.png (added)
-
tags/1.0.5/assets/images/shot-2.png (added)
-
tags/1.0.5/assets/js (added)
-
tags/1.0.5/assets/js/admin-screenshots.js (added)
-
tags/1.0.5/assets/js/html2canvas.js (added)
-
tags/1.0.5/assets/js/html2canvas.min.js (added)
-
tags/1.0.5/index.php (added)
-
tags/1.0.5/license.txt (added)
-
tags/1.0.5/readme.txt (added)
-
tags/1.0.5/uninstall.php (added)
-
trunk/README.md (modified) (3 diffs)
-
trunk/admin-screenshots.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin-screenshots/trunk/README.md
r3147253 r3217188 5 5 * Plugin URI: https://wordpress.org/plugins/admin-screenshots/ 6 6 * Requires at least: 5.0 7 * Tested up to: 6. 6.18 * Stable tag: 1.0. 47 * Tested up to: 6.7 8 * Stable tag: 1.0.5 9 9 * License: GPLv3 10 10 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 11 11 12 Want to take a screenshot of any page in your admin Dashboard and share it with someone else? It couldn't be easier with Admin Screenshots for WordPress.12 Want to take a screenshot of any page in your admin Dashboard and share it with someone else? It couldn't be easier with Admin Screenshots! 13 13 14 14 ## Description … … 66 66 ## Changelog 67 67 68 = 1.0.5 = 69 * Adjusted some code to better adhere to plugin standards. 70 68 71 = 1.0.4 = 69 72 * Fix for a bug in HTML2CANVAS library that rendered text with wrong spacing: https://github.com/niklasvh/html2canvas/issues/3037 … … 77 80 ## Upgrade Notice 78 81 82 = 1.0.5 = 83 * Code updates 84 79 85 = 1.0.4 = 80 86 * Minor bugfix -
admin-screenshots/trunk/admin-screenshots.php
r3147253 r3217188 10 10 * Description: The easiest way to share a screenshot of any of your site's settings pages, without giving anyone direct access to your dashboard. 11 11 * Author: Senff 12 * Version: 1.0. 412 * Version: 1.0.5 13 13 * Author URI: https://www.senff.com/ 14 14 * Text Domain: admin-screenshots 15 * License: GPLv3 16 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 17 * 15 18 */ 16 19 17 20 defined('ABSPATH') or die('INSERT COIN'); 18 21 22 19 23 /* --- ADD THE .CSS AND .JS TO ADMIN AREA -------------------------------------------------------------- */ 20 24 if (!function_exists('admin_screenshots_styles')) { 21 25 function admin_screenshots_styles() { 22 wp_register_style('adminScreenshotsStyle', plugins_url('/assets/css/admin-screenshots.css', __FILE__) );26 wp_register_style('adminScreenshotsStyle', plugins_url('/assets/css/admin-screenshots.css', __FILE__),'', '1.0.5' ); 23 27 wp_enqueue_style('adminScreenshotsStyle'); 24 28 25 wp_register_script('admin-screenshots-library', plugin_dir_url( __FILE__ ) . 'assets/js/html2canvas.min.js', array( 'jquery' ), '1.0. 0', true );29 wp_register_script('admin-screenshots-library', plugin_dir_url( __FILE__ ) . 'assets/js/html2canvas.min.js', array( 'jquery' ), '1.0.5', true ); 26 30 wp_enqueue_script('admin-screenshots-library'); 27 31 28 wp_register_script('admin-screenshots-script', plugin_dir_url( __FILE__ ) . 'assets/js/admin-screenshots.js', array( 'jquery' ), '1.0. 0', true );32 wp_register_script('admin-screenshots-script', plugin_dir_url( __FILE__ ) . 'assets/js/admin-screenshots.js', array( 'jquery' ), '1.0.5', true ); 29 33 wp_enqueue_script('admin-screenshots-script'); 30 34 } … … 36 40 if (!function_exists('admin_screenshots_front_styles')) { 37 41 function admin_screenshots_front_styles() { 38 wp_register_style('adminScreenshotsFrontStyle', plugins_url('/assets/css/admin-screenshots-front.css', __FILE__) );42 wp_register_style('adminScreenshotsFrontStyle', plugins_url('/assets/css/admin-screenshots-front.css', __FILE__),'', '1.0.5' ); 39 43 wp_enqueue_style('adminScreenshotsFrontStyle'); 40 44 } … … 63 67 /* --- THE FUNCTION THAT CREATES A CANVAS AND SAVES IT AS AN IMAGE -------------------------------------------------------------- */ 64 68 if (!function_exists('admin_screenshots_save_canvas')) { 69 65 70 function admin_screenshots_save_canvas() { 71 72 if ( ! function_exists( 'request_filesystem_credentials' ) ) { 73 require_once ABSPATH . 'wp-admin/includes/file.php'; 74 } 75 76 $credentials = request_filesystem_credentials( site_url() ); 77 78 if ( ! WP_Filesystem( $credentials ) ) { 79 wp_die( esc_html(__( 'Could not initialize filesystem API', 'admin-screenshots' ) ) ); 80 } 81 82 global $wp_filesystem; 83 66 84 if ( isset( $_POST['image'] ) ) { 67 85 … … 76 94 } 77 95 78 $image_data = sanitize_text_field( $_POST['image']);96 $image_data = sanitize_text_field(wp_unslash($_POST['image'])); 79 97 $timestamp = time(); 80 98 $img = $timestamp . '.png'; 81 99 $file = $upload_path . '/' . $img; 82 100 $fullpath = $upload_dir['url'] . '/admin-screenshots/' . $img; 83 $success = file_put_contents( $file, base64_decode( str_replace( 'data:image/png;base64,', '', $image_data ) ) ); 101 // $success = file_put_contents( $file, base64_decode( str_replace( 'data:image/png;base64,', '', $image_data ) ) ); 102 // Previous line is old, outdated version. Never version follows. 103 $success = $wp_filesystem->put_contents( $file, base64_decode( str_replace( 'data:image/png;base64,', '', $image_data ) ), FS_CHMOD_FILE ); 84 104 if ( $success ) { 85 105 $wp_filetype = wp_check_filetype( $img, null ); … … 94 114 $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file ); 95 115 wp_update_attachment_metadata( $attachment_id, $attachment_data ); 96 echo $upload_dir_url . ',' . $timestamp; // Sending this to the JS function in screenshotThis()116 echo esc_attr($upload_dir_url) . ',' . esc_attr($timestamp); // Sending this to the JS function in screenshotThis() 97 117 } else { 98 _e('Failed to save image.', 'admin-screenshots');118 esc_html_e('Failed to save image.','admin-screenshots'); 99 119 } 100 120 } … … 102 122 } 103 123 } 124 104 125 add_action( 'wp_ajax_save_canvas', 'admin_screenshots_save_canvas' ); 105 126 add_action( 'wp_ajax_nopriv_save_canvas', 'admin_screenshots_save_canvas' ); -
admin-screenshots/trunk/readme.txt
r3147253 r3217188 5 5 Plugin URI: https://wordpress.org/plugins/admin-screenshots/ 6 6 Requires at least: 5.0 7 Tested up to: 6. 6.18 Stable tag: 1.0. 47 Tested up to: 6.7 8 Stable tag: 1.0.5 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html 11 11 12 Want to take a screenshot of any page in your admin Dashboard and share it with someone else? It couldn't be easier with Admin Screenshots for WordPress.12 Want to take a screenshot of any page in your admin Dashboard and share it with someone else? It couldn't be easier with Admin Screenshots! 13 13 14 14 == Description == … … 69 69 == Changelog == 70 70 71 = 1.0.5 = 72 * Adjusted some code to better adhere to plugin standards. 73 71 74 = 1.0.4 = 72 75 * Fix for a bug in HTML2CANVAS library that rendered text with wrong spacing: https://github.com/niklasvh/html2canvas/issues/3037 … … 81 84 == Upgrade Notice == 82 85 86 = 1.0.5 = 87 * Code updates 88 83 89 = 1.0.4 = 84 90 * Minor bugfix
Note: See TracChangeset
for help on using the changeset viewer.