Plugin Directory

Changeset 3217188


Ignore:
Timestamp:
01/05/2025 01:03:39 PM (14 months ago)
Author:
senff
Message:

Update to 1.0.5

Location:
admin-screenshots
Files:
18 added
3 edited

Legend:

Unmodified
Added
Removed
  • admin-screenshots/trunk/README.md

    r3147253 r3217188  
    55* Plugin URI: https://wordpress.org/plugins/admin-screenshots/
    66* Requires at least: 5.0
    7 * Tested up to: 6.6.1
    8 * Stable tag: 1.0.4
     7* Tested up to: 6.7
     8* Stable tag: 1.0.5
    99* License: GPLv3
    1010* License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1111
    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.
     12Want 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!
    1313
    1414## Description
     
    6666## Changelog
    6767
     68= 1.0.5 =
     69* Adjusted some code to better adhere to plugin standards.
     70
    6871= 1.0.4 =
    6972* Fix for a bug in HTML2CANVAS library that rendered text with wrong spacing: https://github.com/niklasvh/html2canvas/issues/3037
     
    7780## Upgrade Notice
    7881
     82= 1.0.5 =
     83* Code updates
     84
    7985= 1.0.4 =
    8086* Minor bugfix
  • admin-screenshots/trunk/admin-screenshots.php

    r3147253 r3217188  
    1010 * Description: The easiest way to share a screenshot of any of your site's settings pages, without giving anyone direct access to your dashboard.
    1111 * Author: Senff
    12  * Version: 1.0.4
     12 * Version: 1.0.5
    1313 * Author URI: https://www.senff.com/
    1414 * Text Domain: admin-screenshots
     15 * License: GPLv3
     16 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
     17 *
    1518 */
    1619
    1720defined('ABSPATH') or die('INSERT COIN');
    1821
     22
    1923/* --- ADD THE .CSS AND .JS TO ADMIN AREA -------------------------------------------------------------- */
    2024if (!function_exists('admin_screenshots_styles')) {
    2125    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' );
    2327        wp_enqueue_style('adminScreenshotsStyle'); 
    2428
    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 );
    2630        wp_enqueue_script('admin-screenshots-library');
    2731
    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 );
    2933        wp_enqueue_script('admin-screenshots-script');
    3034    }
     
    3640if (!function_exists('admin_screenshots_front_styles')) {
    3741    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' );
    3943        wp_enqueue_style('adminScreenshotsFrontStyle'); 
    4044    }
     
    6367/* --- THE FUNCTION THAT CREATES A CANVAS AND SAVES IT AS AN IMAGE -------------------------------------------------------------- */
    6468if (!function_exists('admin_screenshots_save_canvas')) {
     69
    6570    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
    6684        if ( isset( $_POST['image'] ) ) {
    6785           
     
    7694            }
    7795
    78             $image_data = sanitize_text_field($_POST['image']);
     96            $image_data = sanitize_text_field(wp_unslash($_POST['image']));
    7997            $timestamp = time();
    8098            $img = $timestamp . '.png';
    8199            $file = $upload_path . '/' . $img;
    82100            $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 );
    84104            if ( $success ) {
    85105                $wp_filetype = wp_check_filetype( $img, null );
     
    94114                $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file );
    95115                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()
    97117            } else {
    98                 _e('Failed to save image.', 'admin-screenshots');
     118                esc_html_e('Failed to save image.','admin-screenshots');
    99119            }
    100120        }
     
    102122    }
    103123}
     124
    104125add_action( 'wp_ajax_save_canvas', 'admin_screenshots_save_canvas' );
    105126add_action( 'wp_ajax_nopriv_save_canvas', 'admin_screenshots_save_canvas' );
  • admin-screenshots/trunk/readme.txt

    r3147253 r3217188  
    55Plugin URI: https://wordpress.org/plugins/admin-screenshots/
    66Requires at least: 5.0
    7 Tested up to: 6.6.1
    8 Stable tag: 1.0.4
     7Tested up to: 6.7
     8Stable tag: 1.0.5
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1111
    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.
     12Want 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!
    1313
    1414== Description ==
     
    6969== Changelog ==
    7070
     71= 1.0.5 =
     72* Adjusted some code to better adhere to plugin standards.
     73
    7174= 1.0.4 =
    7275* Fix for a bug in HTML2CANVAS library that rendered text with wrong spacing: https://github.com/niklasvh/html2canvas/issues/3037
     
    8184== Upgrade Notice ==
    8285
     86= 1.0.5 =
     87* Code updates
     88
    8389= 1.0.4 =
    8490* Minor bugfix
Note: See TracChangeset for help on using the changeset viewer.