Plugin Directory

Changeset 3103907


Ignore:
Timestamp:
06/18/2024 07:22:13 AM (20 months ago)
Author:
wpzita
Message:

version 1.6.3 updated

Location:
zita-site-library
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • zita-site-library/trunk/importer/wxr-importer.php

    r2374006 r3103907  
    7272     */
    7373    function xml_data_import() {
    74 
    75         // Start the event stream.
    76         header( 'Content-Type: text/event-stream' );
    77 
    78         // Turn off PHP output compression.
    79         $previous = error_reporting( error_reporting() ^ E_WARNING );
    80         ini_set( 'output_buffering', 'off' );
    81         ini_set( 'zlib.output_compression', false );
    82         error_reporting( $previous );
    83 
    84         if ( $GLOBALS['is_nginx'] ) {
    85             // Setting this header instructs Nginx to disable fastcgi_buffering
    86             // and disable gzip for this request.
    87             header( 'X-Accel-Buffering: no' );
    88             header( 'Content-Encoding: none' );
    89         }
    90 
    91         $xml_url = urldecode( $_REQUEST['xml_url'] );
    92         if ( empty( $xml_url ) ) {
     74        if ( isset( $_REQUEST['zita_nonce'] ) && wp_verify_nonce( $_REQUEST['zita_nonce'], 'zita_sl_nonce' ) ) {
     75            // Nonce is valid; process form data
     76            // Start the event stream.
     77            header( 'Content-Type: text/event-stream' );
     78
     79            // Turn off PHP output compression.
     80            $previous = error_reporting( error_reporting() ^ E_WARNING );
     81            ini_set( 'output_buffering', 'off' );
     82            ini_set( 'zlib.output_compression', false );
     83            error_reporting( $previous );
     84
     85            if ( $GLOBALS['is_nginx'] ) {
     86                // Setting this header instructs Nginx to disable fastcgi_buffering
     87                // and disable gzip for this request.
     88                header( 'X-Accel-Buffering: no' );
     89                header( 'Content-Encoding: none' );
     90            }
     91
     92            $xml_url = urldecode( $_REQUEST['xml_url'] );
     93            if ( empty( $xml_url ) ) {
     94                exit;
     95            }
     96
     97            // 2KB padding for IE
     98            echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
     99
     100            // Time to run the import!
     101            set_time_limit( 0 );
     102
     103            // Ensure we're not buffered.
     104            wp_ob_end_flush_all();
     105            flush();
     106
     107            // Are we allowed to create users?
     108            add_filter( 'wxr_importer.pre_process.user', '__return_null' );
     109
     110            // Keep track of our progress.
     111            add_action( 'wxr_importer.processed.post', array( $this, 'imported_post' ), 10, 2 );
     112            add_action( 'wxr_importer.process_failed.post', array( $this, 'imported_post' ), 10, 2 );
     113            add_action( 'wxr_importer.process_already_imported.post', array( $this, 'already_imported_post' ), 10, 2 );
     114            add_action( 'wxr_importer.process_skipped.post', array( $this, 'already_imported_post' ), 10, 2 );
     115            add_action( 'wxr_importer.processed.comment', array( $this, 'imported_comment' ) );
     116            add_action( 'wxr_importer.process_already_imported.comment', array( $this, 'imported_comment' ) );
     117            add_action( 'wxr_importer.processed.term', array( $this, 'imported_term' ) );
     118            add_action( 'wxr_importer.process_failed.term', array( $this, 'imported_term' ) );
     119            add_action( 'wxr_importer.process_already_imported.term', array( $this, 'imported_term' ) );
     120            add_action( 'wxr_importer.processed.user', array( $this, 'imported_user' ) );
     121            add_action( 'wxr_importer.process_failed.user', array( $this, 'imported_user' ) );
     122            // Flush once more.
     123            flush();
     124
     125            $importer = $this->get_importer();
     126            $response = $importer->import( $xml_url );
     127
     128            // Let the browser know we're done.
     129            $complete = array(
     130                'action' => 'complete',
     131                'error'  => false,
     132            );
     133            if ( is_wp_error( $response ) ) {
     134                $complete['error'] = $response->get_error_message();
     135            }
     136
     137            $this->emit_sse_message( $complete );
    93138            exit;
    94         }
    95 
    96         // 2KB padding for IE
    97         echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
    98 
    99         // Time to run the import!
    100         set_time_limit( 0 );
    101 
    102         // Ensure we're not buffered.
    103         wp_ob_end_flush_all();
    104         flush();
    105 
    106         // Are we allowed to create users?
    107         add_filter( 'wxr_importer.pre_process.user', '__return_null' );
    108 
    109         // Keep track of our progress.
    110         add_action( 'wxr_importer.processed.post', array( $this, 'imported_post' ), 10, 2 );
    111         add_action( 'wxr_importer.process_failed.post', array( $this, 'imported_post' ), 10, 2 );
    112         add_action( 'wxr_importer.process_already_imported.post', array( $this, 'already_imported_post' ), 10, 2 );
    113         add_action( 'wxr_importer.process_skipped.post', array( $this, 'already_imported_post' ), 10, 2 );
    114         add_action( 'wxr_importer.processed.comment', array( $this, 'imported_comment' ) );
    115         add_action( 'wxr_importer.process_already_imported.comment', array( $this, 'imported_comment' ) );
    116         add_action( 'wxr_importer.processed.term', array( $this, 'imported_term' ) );
    117         add_action( 'wxr_importer.process_failed.term', array( $this, 'imported_term' ) );
    118         add_action( 'wxr_importer.process_already_imported.term', array( $this, 'imported_term' ) );
    119         add_action( 'wxr_importer.processed.user', array( $this, 'imported_user' ) );
    120         add_action( 'wxr_importer.process_failed.user', array( $this, 'imported_user' ) );
    121         // Flush once more.
    122         flush();
    123 
    124         $importer = $this->get_importer();
    125         $response = $importer->import( $xml_url );
    126 
    127         // Let the browser know we're done.
    128         $complete = array(
    129             'action' => 'complete',
    130             'error'  => false,
    131         );
    132         if ( is_wp_error( $response ) ) {
    133             $complete['error'] = $response->get_error_message();
    134         }
    135 
    136         $this->emit_sse_message( $complete );
    137         exit;
     139
     140        }
     141
    138142    }
    139143
     
    172176            'id'      => '1',
    173177            'xml_url' => $path,
     178            'zita_nonce' => wp_create_nonce('zita_sl_nonce'),
    174179        );
    175180
  • zita-site-library/trunk/readme.txt

    r3100431 r3103907  
    55Requires at least: 5.5
    66Tested up to: 6.5
    7 Stable tag: 1.6.2
     7Stable tag: 1.6.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030== Changelog ==
    3131
     32= Version 1.6.3 18/06/2024 =
     33* Xml import nonce issue fixed.
     34
    3235= Version 1.6.2 10/06/2024 =
    3336* Security issue fixed.
  • zita-site-library/trunk/zita-site-library.php

    r3100431 r3103907  
    44 * Plugin URI: https://wpzita.com/zita-site-library
    55 * Description: Zita site library is a addon plugin for Zita WordPress theme. This plugin contain lot of pre made sites for nearly all niches (like : Corporate, E-commerce, Small businesses ). You can import these sites with a single click.
    6  * Version: 1.6.2
     6 * Version: 1.6.3
    77 * Author: WPZita
    88 * Author URI: https://wpzita.com
     
    1515}
    1616if ( ! defined( 'ZITA_SITE_LIBRARY_VER' ) ) {
    17     define( 'ZITA_SITE_LIBRARY_VER', '1.6.2' );
     17    define( 'ZITA_SITE_LIBRARY_VER', '1.6.3' );
    1818}
    1919
Note: See TracChangeset for help on using the changeset viewer.