Plugin Directory

Changeset 3335321


Ignore:
Timestamp:
07/28/2025 11:23:24 AM (6 months ago)
Author:
wpchill
Message:

Update to version 5.0.31 from GitHub

Location:
download-monitor
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • download-monitor/tags/5.0.31/changelog.txt

    r3334213 r3335321  
     1= 5.0.31 - 28.07.2025 =
     2* Fixed: Set the default language for download taxonomies when using the Polylang plugin.
     3* Changed: Removed 'dlm_enable_api_keys' filter and always render the REST API table in Settings -> Advanced -> REST API.
     4
    15= 5.0.30 - 25.07.2025 =
    26Fixed: Downloads without a default WPML language were not showing in the admin table.
  • download-monitor/tags/5.0.31/download-monitor.php

    r3334213 r3335321  
    44    Plugin URI: https://www.download-monitor.com
    55    Description: A full solution for managing and selling downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
    6     Version: 5.0.30
     6    Version: 5.0.31
    77    Author: WPChill
    88    Author URI: https://wpchill.com
     
    3535
    3636// Define DLM Version
    37 define( 'DLM_VERSION', '5.0.30' );
     37define( 'DLM_VERSION', '5.0.31' );
    3838define( 'DLM_UPGRADER_VERSION', '4.6.0' );
    3939
  • download-monitor/tags/5.0.31/includes/admin/class-dlm-upsells.php

    r3315233 r3335321  
    8080    }
    8181
    82     public function upsells_init(){
     82    public function upsells_init() {
    8383        $this->set_offer();
    8484
     
    9898        );
    9999        // if ( 11 == $month ) {
    100         //  $this->offer = array(
    101         //      'class'       => 'wpchill-bf-upsell',
    102         //      'column'      => 'bf-upsell-columns',
    103         //      'label'       => __( '40% OFF for Black Friday', 'download-monitor' ),
    104         //      'description' => '40% OFF on new purchases, early renewals or upgrades.',
    105         //  );
     100        //  $this->offer = array(
     101        //      'class'       => 'wpchill-bf-upsell',
     102        //      'column'      => 'bf-upsell-columns',
     103        //      'label'       => __( '40% OFF for Black Friday', 'download-monitor' ),
     104        //      'description' => '40% OFF on new purchases, early renewals or upgrades.',
     105        //  );
    106106        // }
    107107        // if ( 12 == $month ) {
    108         //  $this->offer = array(
    109         //      'class'  => 'wpchill-xmas-upsell',
    110         //      'column' => 'xmas-upsell-columns',
    111         //      'label'  => __( '25% OFF for Christmas', 'download-monitor' ),
    112         //  );
     108        //  $this->offer = array(
     109        //      'class'  => 'wpchill-xmas-upsell',
     110        //      'column' => 'xmas-upsell-columns',
     111        //      'label'  => __( '25% OFF for Christmas', 'download-monitor' ),
     112        //  );
    113113        // }
    114114    }
  • download-monitor/tags/5.0.31/includes/bootstrap.php

    r3332245 r3335321  
    6565    // Multisite new blog hook.
    6666    add_action( 'wpmu_new_blog', '_download_monitor_mu_new_blog', 10, 6 );
     67    add_action( 'admin_init', 'dlm_check_default_translations' );
    6768
    6869    // Multisite blog delete.
  • download-monitor/tags/5.0.31/includes/installer-functions.php

    r3334213 r3335321  
    5353    }
    5454
    55     // sets the default language of dlm_downloads post types
    56     dlm_set_wpml_language_default();
     55    update_option( 'dlm_activation_check_default_languages', true );
    5756}
    5857
     
    203202    if ( $string === $endpoint_option ) {
    204203        set_transient( 'dlm_download_endpoints_rewrite', true, HOUR_IN_SECONDS );
     204    }
     205}
     206
     207function dlm_check_default_translations(){
     208    if ( ! get_option( 'dlm_check_default_languages', false ) || get_option( 'dlm_activation_check_default_languages' ) ) {
     209
     210        // sets the default language of dlm_downloads post types
     211        dlm_set_wpml_language_default();
     212        dlm_set_polylang_language_for_dlm_terms();
     213
     214        // add option so we sure the check is ran at least once
     215        add_option( 'dlm_check_default_languages', 'checked' );
     216
     217        // delte activation option.
     218        delete_option( 'dlm_activation_check_default_languages' );
    205219    }
    206220}
     
    258272    }
    259273}
     274
     275function dlm_set_polylang_language_for_dlm_terms() {
     276
     277    if ( ! function_exists( 'pll_get_term_language' ) || ! function_exists( 'pll_set_term_language' ) || ! function_exists( 'pll_default_language' ) ) {
     278        return;
     279    }
     280
     281    $default_lang = pll_default_language();
     282    $taxonomies   = array( 'dlm_download_category', 'dlm_download_tag' );
     283
     284    foreach ( $taxonomies as $taxonomy ) {
     285        $terms = get_terms(
     286            array(
     287                'taxonomy'   => $taxonomy,
     288                'hide_empty' => false,
     289            )
     290        );
     291
     292        foreach ( $terms as $term ) {
     293            $current_lang = pll_get_term_language( $term->term_id );
     294            if ( ! $current_lang ) {
     295                pll_set_term_language( $term->term_id, $default_lang );
     296            }
     297        }
     298    }
     299}
  • download-monitor/tags/5.0.31/readme.txt

    r3334213 r3335321  
    44Requires at least: 5.5 
    55Tested up to: 6.8 
    6 Stable tag: 5.0.30
     6Stable tag: 5.0.31
    77License: GPLv3 
    88Requires PHP: 7.6 
     
    115115
    116116== Changelog ==
     117= 5.0.31 - 28.07.2025 =
     118* Fixed: Set the default language for download taxonomies when using the Polylang plugin.
     119* Changed: Removed 'dlm_enable_api_keys' filter and always render the REST API table in Settings -> Advanced -> REST API.
     120
    117121= 5.0.30 - 25.07.2025 =
    118122Fixed: Downloads without a default WPML language were not showing in the admin table.
  • download-monitor/tags/5.0.31/src/Admin/AdminScripts.php

    r3198966 r3335321  
    311311        }
    312312
    313         if ( 'edit.php' == $pagenow && isset( $_GET['page'] ) && 'download-monitor-settings' === $_GET['page'] && ! empty( $_GET['section'] ) && 'misc' === $_GET['section'] ) {
     313        if ( 'edit.php' == $pagenow && isset( $_GET['page'] ) && 'download-monitor-settings' === $_GET['page'] && ! empty( $_GET['section'] ) && 'rest' === $_GET['section'] ) {
    314314
    315315            // Enqueue Select2
  • download-monitor/tags/5.0.31/src/KeyGeneration/admin/class-dlm-api-keys-table.php

    r3198966 r3335321  
    6767                break;
    6868            case 'token':
    69                 echo esc_html( $item->get_token() );
     69                echo current_user_can( 'manage_options' )
     70                    ? esc_html( $item->get_token() )
     71                    : '*****';
    7072                break;
    7173            case 'secret_key':
    72                 echo esc_html( $item->get_secret_key() );
     74                echo current_user_can( 'manage_options' )
     75                    ? esc_html( $item->get_secret_key() )
     76                    : '*****';
    7377                break;
    7478            case 'create_date':
  • download-monitor/tags/5.0.31/src/KeyGeneration/class-dlm-key-generation.php

    r3198966 r3335321  
    7474        ?>
    7575        <div class='dlm-api-keys'>
    76             <h2 class='wp-heading-inline'><?php
    77                 echo esc_html__( 'API Keys', 'download-monitor' ); ?></h2>
    7876            <div class="dlm-api-keys-generator">
    7977                <br>
    8078                <select name="dlm-keygen-user-select" class="dlm-keygen-user-select">
    81                     <option selected="selected" value="<?php
    82                     echo esc_attr( $current_user->data->ID ); ?>"> <?php
    83                         echo esc_html( $current_user->data->display_name . '(' . $current_user->data->user_email . ')' ); ?> </option>
     79                    <option selected="selected" value="
     80                    <?php
     81                    echo esc_attr( $current_user->data->ID );
     82                    ?>
     83                    ">
     84                    <?php
     85                        echo esc_html( $current_user->data->display_name . '(' . $current_user->data->user_email . ')' );
     86                    ?>
     87                    </option>
    8488                </select>
    85                 <button class="dlm-keygen-generate button button-secondary"><?php
    86                     echo esc_html__( 'Generate API Key', 'download-monitor' ); ?></button>
     89                <button class="dlm-keygen-generate button button-secondary">
     90                <?php
     91                    echo esc_html__( 'Generate API Key', 'download-monitor' );
     92                ?>
     93                </button>
    8794            </div>
    8895            <?php
     
    315322            case 'generate':
    316323            case 'regenerate':
    317 
    318324                $results = $this->generate_api_key( $user_id, true );
    319325
     
    340346     */
    341347    public function add_api_section( $settings ) {
    342         /**
    343          * Filter to enable API keys menu entry
    344          *
    345          * @hook  dlm_enable_api_keys
    346          *
    347          * @param  bool  $enable_api_keys  True to enable API keys, false to disable.
    348          *
    349          * @since 5.0.0
    350          *
    351          */
    352         if ( ! apply_filters( 'dlm_enable_api_keys', false ) ) {
    353             return $settings;
    354         }
    355 
    356         $settings['general']['sections']['misc']['fields'][] = array(
    357             'name'     => 'dlm_api_keys_section',
    358             'label'    => '',
    359             'desc'     => '',
    360             'link'     => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=misc',
    361             'type'     => 'callback',
    362             'callback' => array( $this, 'render_api_keys_page' ),
    363             'priority' => 90,
     348
     349        $settings['advanced']['sections']['rest'] = array(
     350            'title'  => __( 'REST API', 'download-monitor' ),
     351            'fields' => array(
     352                array(
     353                    'name'     => 'dlm_api_keys_section',
     354                    'label'    => '',
     355                    'desc'     => '',
     356                    'link'     => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=rest',
     357                    'type'     => 'callback',
     358                    'callback' => array( $this, 'render_api_keys_page' ),
     359                    'priority' => 90,
     360                ),
     361            ),
    364362        );
    365363
  • download-monitor/tags/5.0.31/vendor/composer/installed.php

    r3334213 r3335321  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',
     6        'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-master',
    1515            'version' => 'dev-master',
    16             'reference' => '96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',
     16            'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • download-monitor/trunk/changelog.txt

    r3334213 r3335321  
     1= 5.0.31 - 28.07.2025 =
     2* Fixed: Set the default language for download taxonomies when using the Polylang plugin.
     3* Changed: Removed 'dlm_enable_api_keys' filter and always render the REST API table in Settings -> Advanced -> REST API.
     4
    15= 5.0.30 - 25.07.2025 =
    26Fixed: Downloads without a default WPML language were not showing in the admin table.
  • download-monitor/trunk/download-monitor.php

    r3334213 r3335321  
    44    Plugin URI: https://www.download-monitor.com
    55    Description: A full solution for managing and selling downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
    6     Version: 5.0.30
     6    Version: 5.0.31
    77    Author: WPChill
    88    Author URI: https://wpchill.com
     
    3535
    3636// Define DLM Version
    37 define( 'DLM_VERSION', '5.0.30' );
     37define( 'DLM_VERSION', '5.0.31' );
    3838define( 'DLM_UPGRADER_VERSION', '4.6.0' );
    3939
  • download-monitor/trunk/includes/admin/class-dlm-upsells.php

    r3315233 r3335321  
    8080    }
    8181
    82     public function upsells_init(){
     82    public function upsells_init() {
    8383        $this->set_offer();
    8484
     
    9898        );
    9999        // if ( 11 == $month ) {
    100         //  $this->offer = array(
    101         //      'class'       => 'wpchill-bf-upsell',
    102         //      'column'      => 'bf-upsell-columns',
    103         //      'label'       => __( '40% OFF for Black Friday', 'download-monitor' ),
    104         //      'description' => '40% OFF on new purchases, early renewals or upgrades.',
    105         //  );
     100        //  $this->offer = array(
     101        //      'class'       => 'wpchill-bf-upsell',
     102        //      'column'      => 'bf-upsell-columns',
     103        //      'label'       => __( '40% OFF for Black Friday', 'download-monitor' ),
     104        //      'description' => '40% OFF on new purchases, early renewals or upgrades.',
     105        //  );
    106106        // }
    107107        // if ( 12 == $month ) {
    108         //  $this->offer = array(
    109         //      'class'  => 'wpchill-xmas-upsell',
    110         //      'column' => 'xmas-upsell-columns',
    111         //      'label'  => __( '25% OFF for Christmas', 'download-monitor' ),
    112         //  );
     108        //  $this->offer = array(
     109        //      'class'  => 'wpchill-xmas-upsell',
     110        //      'column' => 'xmas-upsell-columns',
     111        //      'label'  => __( '25% OFF for Christmas', 'download-monitor' ),
     112        //  );
    113113        // }
    114114    }
  • download-monitor/trunk/includes/bootstrap.php

    r3332245 r3335321  
    6565    // Multisite new blog hook.
    6666    add_action( 'wpmu_new_blog', '_download_monitor_mu_new_blog', 10, 6 );
     67    add_action( 'admin_init', 'dlm_check_default_translations' );
    6768
    6869    // Multisite blog delete.
  • download-monitor/trunk/includes/installer-functions.php

    r3334213 r3335321  
    5353    }
    5454
    55     // sets the default language of dlm_downloads post types
    56     dlm_set_wpml_language_default();
     55    update_option( 'dlm_activation_check_default_languages', true );
    5756}
    5857
     
    203202    if ( $string === $endpoint_option ) {
    204203        set_transient( 'dlm_download_endpoints_rewrite', true, HOUR_IN_SECONDS );
     204    }
     205}
     206
     207function dlm_check_default_translations(){
     208    if ( ! get_option( 'dlm_check_default_languages', false ) || get_option( 'dlm_activation_check_default_languages' ) ) {
     209
     210        // sets the default language of dlm_downloads post types
     211        dlm_set_wpml_language_default();
     212        dlm_set_polylang_language_for_dlm_terms();
     213
     214        // add option so we sure the check is ran at least once
     215        add_option( 'dlm_check_default_languages', 'checked' );
     216
     217        // delte activation option.
     218        delete_option( 'dlm_activation_check_default_languages' );
    205219    }
    206220}
     
    258272    }
    259273}
     274
     275function dlm_set_polylang_language_for_dlm_terms() {
     276
     277    if ( ! function_exists( 'pll_get_term_language' ) || ! function_exists( 'pll_set_term_language' ) || ! function_exists( 'pll_default_language' ) ) {
     278        return;
     279    }
     280
     281    $default_lang = pll_default_language();
     282    $taxonomies   = array( 'dlm_download_category', 'dlm_download_tag' );
     283
     284    foreach ( $taxonomies as $taxonomy ) {
     285        $terms = get_terms(
     286            array(
     287                'taxonomy'   => $taxonomy,
     288                'hide_empty' => false,
     289            )
     290        );
     291
     292        foreach ( $terms as $term ) {
     293            $current_lang = pll_get_term_language( $term->term_id );
     294            if ( ! $current_lang ) {
     295                pll_set_term_language( $term->term_id, $default_lang );
     296            }
     297        }
     298    }
     299}
  • download-monitor/trunk/readme.txt

    r3334213 r3335321  
    44Requires at least: 5.5 
    55Tested up to: 6.8 
    6 Stable tag: 5.0.30
     6Stable tag: 5.0.31
    77License: GPLv3 
    88Requires PHP: 7.6 
     
    115115
    116116== Changelog ==
     117= 5.0.31 - 28.07.2025 =
     118* Fixed: Set the default language for download taxonomies when using the Polylang plugin.
     119* Changed: Removed 'dlm_enable_api_keys' filter and always render the REST API table in Settings -> Advanced -> REST API.
     120
    117121= 5.0.30 - 25.07.2025 =
    118122Fixed: Downloads without a default WPML language were not showing in the admin table.
  • download-monitor/trunk/src/Admin/AdminScripts.php

    r3198966 r3335321  
    311311        }
    312312
    313         if ( 'edit.php' == $pagenow && isset( $_GET['page'] ) && 'download-monitor-settings' === $_GET['page'] && ! empty( $_GET['section'] ) && 'misc' === $_GET['section'] ) {
     313        if ( 'edit.php' == $pagenow && isset( $_GET['page'] ) && 'download-monitor-settings' === $_GET['page'] && ! empty( $_GET['section'] ) && 'rest' === $_GET['section'] ) {
    314314
    315315            // Enqueue Select2
  • download-monitor/trunk/src/KeyGeneration/admin/class-dlm-api-keys-table.php

    r3198966 r3335321  
    6767                break;
    6868            case 'token':
    69                 echo esc_html( $item->get_token() );
     69                echo current_user_can( 'manage_options' )
     70                    ? esc_html( $item->get_token() )
     71                    : '*****';
    7072                break;
    7173            case 'secret_key':
    72                 echo esc_html( $item->get_secret_key() );
     74                echo current_user_can( 'manage_options' )
     75                    ? esc_html( $item->get_secret_key() )
     76                    : '*****';
    7377                break;
    7478            case 'create_date':
  • download-monitor/trunk/src/KeyGeneration/class-dlm-key-generation.php

    r3198966 r3335321  
    7474        ?>
    7575        <div class='dlm-api-keys'>
    76             <h2 class='wp-heading-inline'><?php
    77                 echo esc_html__( 'API Keys', 'download-monitor' ); ?></h2>
    7876            <div class="dlm-api-keys-generator">
    7977                <br>
    8078                <select name="dlm-keygen-user-select" class="dlm-keygen-user-select">
    81                     <option selected="selected" value="<?php
    82                     echo esc_attr( $current_user->data->ID ); ?>"> <?php
    83                         echo esc_html( $current_user->data->display_name . '(' . $current_user->data->user_email . ')' ); ?> </option>
     79                    <option selected="selected" value="
     80                    <?php
     81                    echo esc_attr( $current_user->data->ID );
     82                    ?>
     83                    ">
     84                    <?php
     85                        echo esc_html( $current_user->data->display_name . '(' . $current_user->data->user_email . ')' );
     86                    ?>
     87                    </option>
    8488                </select>
    85                 <button class="dlm-keygen-generate button button-secondary"><?php
    86                     echo esc_html__( 'Generate API Key', 'download-monitor' ); ?></button>
     89                <button class="dlm-keygen-generate button button-secondary">
     90                <?php
     91                    echo esc_html__( 'Generate API Key', 'download-monitor' );
     92                ?>
     93                </button>
    8794            </div>
    8895            <?php
     
    315322            case 'generate':
    316323            case 'regenerate':
    317 
    318324                $results = $this->generate_api_key( $user_id, true );
    319325
     
    340346     */
    341347    public function add_api_section( $settings ) {
    342         /**
    343          * Filter to enable API keys menu entry
    344          *
    345          * @hook  dlm_enable_api_keys
    346          *
    347          * @param  bool  $enable_api_keys  True to enable API keys, false to disable.
    348          *
    349          * @since 5.0.0
    350          *
    351          */
    352         if ( ! apply_filters( 'dlm_enable_api_keys', false ) ) {
    353             return $settings;
    354         }
    355 
    356         $settings['general']['sections']['misc']['fields'][] = array(
    357             'name'     => 'dlm_api_keys_section',
    358             'label'    => '',
    359             'desc'     => '',
    360             'link'     => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=misc',
    361             'type'     => 'callback',
    362             'callback' => array( $this, 'render_api_keys_page' ),
    363             'priority' => 90,
     348
     349        $settings['advanced']['sections']['rest'] = array(
     350            'title'  => __( 'REST API', 'download-monitor' ),
     351            'fields' => array(
     352                array(
     353                    'name'     => 'dlm_api_keys_section',
     354                    'label'    => '',
     355                    'desc'     => '',
     356                    'link'     => admin_url( 'edit.php?post_type=dlm_download&page=download-monitor-settings' ) . '&tab=advanced&section=rest',
     357                    'type'     => 'callback',
     358                    'callback' => array( $this, 'render_api_keys_page' ),
     359                    'priority' => 90,
     360                ),
     361            ),
    364362        );
    365363
  • download-monitor/trunk/vendor/composer/installed.php

    r3334213 r3335321  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',
     6        'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-master',
    1515            'version' => 'dev-master',
    16             'reference' => '96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',
     16            'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.