Plugin Directory

Changeset 3426034


Ignore:
Timestamp:
12/23/2025 09:27:14 AM (2 months ago)
Author:
memsource
Message:

Version 4.7.6

Location:
memsource-connector/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • memsource-connector/trunk/memsource.php

    r3411119 r3426034  
    55Plugin URI: https://support.phrase.com/hc/en-us/articles/5709657294620
    66Description: Localize WordPress websites with the help of professional translation tools: translation memories, terminology bases and quality checkers.
    7 Version: 4.7.5
     7Version: 4.7.6
    88Text Domain: memsource
    99Domain Path: /locale
     
    1818
    1919define('MEMSOURCE_PLUGIN_PATH', dirname(__FILE__));
    20 define('MEMSOURCE_PLUGIN_VERSION', '4.7.5');
     20define('MEMSOURCE_PLUGIN_VERSION', '4.7.6');
    2121define('MEMSOURCE_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
    2222define('MEMSOURCE_PLUGIN_REQUIERED_PHP_VERSION', '7.4');
     
    102102    wp_enqueue_script('clipboard_js');
    103103    wp_enqueue_style('memsource_css');
     104    wp_localize_script(
     105        'memsource_js',
     106        'memsourceAjax',
     107        [
     108            'ajaxUrl' => admin_url('admin-ajax.php'),
     109            'nonces'  => [
     110                'emailLog' => wp_create_nonce('memsource_zip_and_email_log_action'),
     111                'deleteLog'   => wp_create_nonce('memsource_delete_log_action'),
     112            ],
     113        ]
     114    );
    104115}
    105116
     
    313324function memsource_zip_and_email_log()
    314325{
    315     LogUtils::logSystemInfo();
    316     header('Content-Type: application/json');
    317     $zipFile = LogUtils::zipAndEmailLogFile();
    318     echo json_encode(['zipFile' => $zipFile, 'email' => LogUtils::LOG_EMAIL_RECIPIENT]);
    319     wp_die();
     326    check_ajax_referer('memsource_zip_and_email_log_action', 'security');
     327
     328    if (current_user_can("manage_options")) {
     329        LogUtils::logSystemInfo();
     330        header('Content-Type: application/json');
     331        $zipFile = LogUtils::zipAndEmailLogFile();
     332        echo json_encode(['zipFile' => $zipFile, 'email' => LogUtils::LOG_EMAIL_RECIPIENT]);
     333        wp_die();
     334    }
    320335}
    321336
    322337function memsource_delete_log()
    323338{
    324     header('Content-Type: application/json');
    325     $result = LogUtils::deleteLogFile();
    326     echo json_encode($result);
    327     wp_die();
     339    check_ajax_referer('memsource_delete_log_action', 'security');
     340
     341    if (current_user_can("manage_options")) {
     342        header('Content-Type: application/json');
     343        $result = LogUtils::deleteLogFile();
     344        echo json_encode($result);
     345        wp_die();
     346    }
    328347}
    329348
  • memsource-connector/trunk/readme.txt

    r3411119 r3426034  
    3333== Changelog ==
    3434
     35= 4.7.6 =
     36*Release Date - 23 Dec 2025*
     37
     38* Patched vulnerabilities
     39
    3540= 4.7.5 =
    3641*Release Date - 4 Dec 2025*
  • memsource-connector/trunk/src/Page/AdvancedPage.php

    r3056870 r3426034  
    3131                if (confirm("<?php _e('Do you really want to send the log file to Phrase?', 'memsource'); ?>")) {
    3232                    var data = {
    33                         action: 'zip_and_email_log'
     33                        action: 'zip_and_email_log',
     34                        security: memsourceAjax.nonces.emailLog
    3435                    };
    3536                    jQuery('#email-spinner').addClass('is-active');
    36                     jQuery.post(ajaxurl, data, function(response) {
     37                    jQuery.post(memsourceAjax.ajaxUrl, data, function(response) {
    3738                        jQuery('#email-spinner').removeClass('is-active');
    3839                        jQuery('#email-result').html('File ' + response.zipFile + ' has been sent to Phrase.');
     
    4344                if (confirm("<?php _e('Do you really want to delete the log file?', 'memsource'); ?>")) {
    4445                    var data = {
    45                         action: 'delete_log'
     46                        action: 'delete_log',
     47                        security: memsourceAjax.nonces.deleteLog
    4648                    };
    4749                    jQuery('#delete-spinner').addClass('is-active');
    48                     jQuery.post(ajaxurl, data, function(response) {
     50                    jQuery.post(memsourceAjax.ajaxUrl, data, function(response) {
    4951                        jQuery('#delete-spinner').removeClass('is-active');
    5052                        var files = [];
Note: See TracChangeset for help on using the changeset viewer.