Plugin Directory

Changeset 2636750


Ignore:
Timestamp:
11/29/2021 10:26:36 AM (4 years ago)
Author:
spreadsheetconverter
Message:

10.1.3 solves a rare error where the Embed calculator button did not appear in the Classic editor. Tested with WordPress 5.8.2 and PHP 7.4.26, should also work with PHP 8.

Location:
import-spreadsheets-from-microsoft-excel
Files:
38 added
4 edited

Legend:

Unmodified
Added
Removed
  • import-spreadsheets-from-microsoft-excel/trunk/changelog.txt

    r2508832 r2636750  
    11== Changelog ==
     2
     3= 10.1.3 =
     4
     5* Under rare conditions, the **Embed Calculator** button did not appear in the Classic editor.
    26
    37= 10.1.2 =
     
    610
    711= 10.1.1 =
     12
    813* $row array issue fixes.
    914* zip file open/read issue fixed for PHP version 8.
     
    3237
    3338= 9.0.1 =
     39
    3440* Improvement: Added checking for ZipArchive PHP extension and error logging feature.
    3541* Fix: Tested compatibility with more than 35 most common plugins and fixed compatibility issue with another plugin.
    3642
    3743= 9.0.0 =
     44
    3845* Initial version.
  • import-spreadsheets-from-microsoft-excel/trunk/import-spreadsheets-from-microsoft-excel.php

    r2508832 r2636750  
    33 *
    44Plugin Name: Import Spreadsheets from Microsoft Excel
    5 Plugin URI: https://help.spreadsheetconverter.com/support/online-help/ssc-help-wordpress-plugin-to-import-spreadsheets-from-microsoft-excel/
     5Plugin URI: https://www.spreadsheetconverter.com/support/online-help/help-wordpress-plugin-to-import-spreadsheets-from-microsoft-excel
    66Description: Import Spreadsheets from Microsoft Excel
    7 Version: 10.1.2
     7Version: 10.1.3
    88Author: SpreadsheetConverter
    9 Author URI: https://www.spreadsheetconverter.com
     9Author URI: http://www.spreadsheetconverter.com
    1010Text Domain: SpreadsheetConverter
    1111License: GPLv2 or later
     
    1616 *
    1717
    18 Copyright (C) 2019-2021  SpreadsheetConverter, http://www.spreadsheetconverter.com
     18Copyright (C) 2019-2020  SpreadsheetConverter, http://www.spreadsheetconverter.com
    1919This program is free software: you can redistribute it and/or modify
    2020it under the terms of the GNU General Public License as published by
     
    107107
    108108//Add button to the media button context in edit/add new post screen
    109 //add_action('media_buttons_context',  'ims_fme_ssc_ttc_files_button');
     109add_action('media_buttons_context',  'ims_fme_ssc_ttc_files_button');
    110110function ims_fme_ssc_ttc_files_button( $context ) {
    111111    $context .= "<a id='files_media_link' href='#TB_inline?width=650&height=600&inlineId=tt_shortcode_popup_container&guid=".uniqid()."' class='button thickbox' title='". __('Embed SpreadsheetConverter Calculator', 'SpreadsheetConverter') ."'><span class='files_media_icon'></span>". __('Embed SSC Calculator', 'SpreadsheetConverter' )."</a>";
     
    162162                                    $my_query = new WP_Query( $args );
    163163                                    ?>
    164                                     <select name="btn_link" id="btn_link" style="width:67%">
     164                                    <select name="btn_link" id="btn_link_calculator" style="width:67%">
    165165                                        <option value="0" ><?php _e('Select Links', 'SpreadsheetConverter'); ?></option>
    166166                                        <?php
     
    182182                            <li style="display:none;">
    183183                                <label style="width:140px;display: inline-block;">File URL:</label>
    184                                 <input type="text" id="file_url" name="file_url" style="width:67%" />
     184                                <input type="text" id="file_url_calculator" name="file_url" style="width:67%" />
    185185                            </li>
    186186
     
    192192                                <label style="width:140px;display: inline-block;">
    193193                                   <?php _e( 'Iframe Width', 'SpreadsheetConverter'); ?>:<em style="color:red">*</em></label>
    194                                 <input type="text" id="iframe_width" name="iframe_width" style="width:25%" />
     194                                <input type="text" id="iframe_width_calculator" name="iframe_width" style="width:25%" />
    195195                            </li>
    196196
    197197                            <li>
    198198                                <label style="width:140px;display: inline-block;"><?php _e('Iframe Height', 'SpreadsheetConverter') ?>: <em style="color:red">*</em></label>
    199                                 <input type="text" id="iframe_height" name="iframe_height" style="width:25%" />
     199                                <input type="text" id="iframe_height_calculator" name="iframe_height" style="width:25%" />
    200200                            </li>
    201201                             
     
    203203                    </ul>
    204204
    205                         <input class="button-primary" type="button" id="insertbutton" style="margin-left:145px" value="<?php _e('Insert Calculator', 'SpreadsheetConverter'); ?>" />
     205                        <input class="button-primary" type="button" id="insertbutton_calculator" style="margin-left:145px" value="<?php _e('Insert Calculator', 'SpreadsheetConverter'); ?>" />
    206206                        <a class="button" onclick="tb_remove(); return false;" href="#"><?php _e('Cancel', 'SpreadsheetConverter'); ?></a>
    207207
     
    228228    endif;
    229229
    230     $fileurl    = get_post_meta( $postid, 'wp_custom_attachment', true );
     230    $fileurl    = esc_url( get_post_meta( $postid, 'wp_custom_attachment', true ) );
    231231    $height     = intval( get_post_meta( $postid, 'wp_custom_attachment_height', true ) );
    232232    $width      = intval( get_post_meta( $postid, 'wp_custom_attachment_width', true ) );
     
    468468    //     return $id;
    469469    // }
     470
    470471    $folder_name    = basename( sanitize_file_name( $_FILES['wp_custom_attachment']['name'] ),".zip" );
    471472
     
    479480   
    480481    $source         = $_FILES['wp_custom_attachment']['tmp_name'];
    481     $target_path    = $pub_dir."/".$folder_name.'.zip';
     482    $target_path    = $pub_dir."/". sanitize_file_name( $_FILES['wp_custom_attachment']['name'] );
    482483
    483484    // change this to the correct site path
     
    518519
    519520                }
    520 
    521521                // change this to the correct site path
    522522                $zip->extractTo( $pub_dir.'/');
     523               
    523524                if ( true === $rename ){
    524525                    //rename folder to sanitize name
    525                     rename( $pub_dir .'/'. $pathall[0] , $pub_dir .'/'. $folder_name );
     526                    rename( $pub_dir .'/'. $pathall[0] , $pub_dir .'/'. sanitize_file_name( $pathall[0] ) );
    526527
    527528                    //reanme file to sanitize name
    528                     if( file_exists( $pub_dir .'/'. $folder_name .'/'. $pathall[0] . '.htm'  ) ) {
    529                         $oldname = $pub_dir .'/'. $folder_name .'/'. $pathall[0] . '.htm';
    530                         $sanitize_name = $pub_dir .'/'. $folder_name .'/'. $folder_name . '.htm';
     529                    if( file_exists( $pub_dir .'/'. sanitize_file_name( $pathall[0] ) .'/'. $pathall[0] . '.htm'  ) ) {
     530                        $oldname = $pub_dir .'/'. sanitize_file_name( $pathall[0] ) .'/'. $pathall[0] . '.htm';
     531                        $sanitize_name = $pub_dir .'/'. sanitize_file_name( $pathall[0] ) .'/'. sanitize_file_name( $pathall[0] ) . '.htm';
    531532                        copy( $oldname ,  $sanitize_name );
    532533                        wp_delete_file( $oldname );
  • import-spreadsheets-from-microsoft-excel/trunk/js/plugin-shortcode-manager-scripts.js

    r2025154 r2636750  
    22
    33    /*Script For Shortcode Button*/
    4     jQuery("#insertbutton").click(function(){
     4    jQuery("#insertbutton_calculator").click(function(){
    55
    6     var file_url              = jQuery("#file_url").val();
    7     var iframe_height         = jQuery("#iframe_height").val();
    8     var iframe_width          = jQuery("#iframe_width").val();
     6    var file_url              = jQuery("#file_url_calculator").val();
     7    var iframe_height         = jQuery("#iframe_height_calculator").val();
     8    var iframe_width          = jQuery("#iframe_width_calculator").val();
    99        var button_type           = jQuery("#btn_type").val();//Get the value of the button type
    1010        var button_title          = jQuery("#btn_title").val();//Get the title of the button
    11         var button_link           = jQuery("#btn_link").val();
     11        var button_link           = jQuery("#btn_link_calculator").val();
     12    console.log( button_link);
     13    console.log( file_url);
    1214    var button_external_link  = jQuery("#btn_external_url").val();//Get
    1315    var jquery_min            = jQuery("#jquery_min").val();
     
    2325      };
    2426       //to get HTML from iframe
    25         jQuery("#btn_link").val("");
     27        jQuery("#btn_link_calculator").val("");
    2628      jQuery("#btn_external_url").val('');
    27       jQuery("#file_url").val('');
    28       jQuery("#iframe_height").val('');
    29         jQuery("#iframe_width").val('');
     29      jQuery("#file_url_calculator").val('');
     30      jQuery("#iframe_height_calculator").val('');
     31        jQuery("#iframe_width_calculator").val('');
    3032    }
    3133    else{
     
    5254
    5355/*Disable External Url when dropdown is changed*/
    54 jQuery('#btn_link').change(function() {
     56jQuery('#btn_link_calculator').change(function() {
    5557
    56     var button_link = jQuery("#btn_link").val();
     58    var button_link = jQuery("#btn_link_calculator option:selected").val();
    5759    jQuery.ajax({
    5860        type: "POST",
     
    6971        success: function(data){
    7072            data = jQuery.parseJSON(data);
    71       jQuery('#file_url').val(jQuery.trim(data.html));
    72       jQuery('#iframe_width').val(data.width);
    73             jQuery('#iframe_height').val(data.height);
     73      console.log( data );
     74      jQuery('#file_url_calculator').val(jQuery.trim(data.html));
     75      jQuery('#iframe_width_calculator').val(data.width);
     76            jQuery('#iframe_height_calculator').val(data.height);
    7477        }
    7578    });
  • import-spreadsheets-from-microsoft-excel/trunk/readme.txt

    r2573902 r2636750  
    77Tested up to: 5.8
    88Requires PHP: 5.2.4
    9 Stable tag: 10.1.2
     9Stable tag: 10.1.3
    1010
    1111Import live, calculating spreadsheets from Microsoft Excel to WordPress. The uploaded online spreadsheet is live, and looks and feels like in Excel.
     
    357357== Changelog ==
    358358
     359= 10.1.3 =
     360
     361* Under rare conditions, the **Embed Calculator** button did not appear in the Classic editor.
     362
    359363= 10.1.2 =
    360364
Note: See TracChangeset for help on using the changeset viewer.