Changeset 3335321
- Timestamp:
- 07/28/2025 11:23:24 AM (6 months ago)
- Location:
- download-monitor
- Files:
-
- 20 edited
- 1 copied
-
tags/5.0.31 (copied) (copied from download-monitor/trunk)
-
tags/5.0.31/changelog.txt (modified) (1 diff)
-
tags/5.0.31/download-monitor.php (modified) (2 diffs)
-
tags/5.0.31/includes/admin/class-dlm-upsells.php (modified) (2 diffs)
-
tags/5.0.31/includes/bootstrap.php (modified) (1 diff)
-
tags/5.0.31/includes/installer-functions.php (modified) (3 diffs)
-
tags/5.0.31/readme.txt (modified) (2 diffs)
-
tags/5.0.31/src/Admin/AdminScripts.php (modified) (1 diff)
-
tags/5.0.31/src/KeyGeneration/admin/class-dlm-api-keys-table.php (modified) (1 diff)
-
tags/5.0.31/src/KeyGeneration/class-dlm-key-generation.php (modified) (3 diffs)
-
tags/5.0.31/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/download-monitor.php (modified) (2 diffs)
-
trunk/includes/admin/class-dlm-upsells.php (modified) (2 diffs)
-
trunk/includes/bootstrap.php (modified) (1 diff)
-
trunk/includes/installer-functions.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Admin/AdminScripts.php (modified) (1 diff)
-
trunk/src/KeyGeneration/admin/class-dlm-api-keys-table.php (modified) (1 diff)
-
trunk/src/KeyGeneration/class-dlm-key-generation.php (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
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 1 5 = 5.0.30 - 25.07.2025 = 2 6 Fixed: Downloads without a default WPML language were not showing in the admin table. -
download-monitor/tags/5.0.31/download-monitor.php
r3334213 r3335321 4 4 Plugin URI: https://www.download-monitor.com 5 5 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.3 06 Version: 5.0.31 7 7 Author: WPChill 8 8 Author URI: https://wpchill.com … … 35 35 36 36 // Define DLM Version 37 define( 'DLM_VERSION', '5.0.3 0' );37 define( 'DLM_VERSION', '5.0.31' ); 38 38 define( 'DLM_UPGRADER_VERSION', '4.6.0' ); 39 39 -
download-monitor/tags/5.0.31/includes/admin/class-dlm-upsells.php
r3315233 r3335321 80 80 } 81 81 82 public function upsells_init() {82 public function upsells_init() { 83 83 $this->set_offer(); 84 84 … … 98 98 ); 99 99 // 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 // ); 106 106 // } 107 107 // 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 // ); 113 113 // } 114 114 } -
download-monitor/tags/5.0.31/includes/bootstrap.php
r3332245 r3335321 65 65 // Multisite new blog hook. 66 66 add_action( 'wpmu_new_blog', '_download_monitor_mu_new_blog', 10, 6 ); 67 add_action( 'admin_init', 'dlm_check_default_translations' ); 67 68 68 69 // Multisite blog delete. -
download-monitor/tags/5.0.31/includes/installer-functions.php
r3334213 r3335321 53 53 } 54 54 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 ); 57 56 } 58 57 … … 203 202 if ( $string === $endpoint_option ) { 204 203 set_transient( 'dlm_download_endpoints_rewrite', true, HOUR_IN_SECONDS ); 204 } 205 } 206 207 function 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' ); 205 219 } 206 220 } … … 258 272 } 259 273 } 274 275 function 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 4 4 Requires at least: 5.5 5 5 Tested up to: 6.8 6 Stable tag: 5.0.3 06 Stable tag: 5.0.31 7 7 License: GPLv3 8 8 Requires PHP: 7.6 … … 115 115 116 116 == 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 117 121 = 5.0.30 - 25.07.2025 = 118 122 Fixed: 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 311 311 } 312 312 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'] ) { 314 314 315 315 // Enqueue Select2 -
download-monitor/tags/5.0.31/src/KeyGeneration/admin/class-dlm-api-keys-table.php
r3198966 r3335321 67 67 break; 68 68 case 'token': 69 echo esc_html( $item->get_token() ); 69 echo current_user_can( 'manage_options' ) 70 ? esc_html( $item->get_token() ) 71 : '*****'; 70 72 break; 71 73 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 : '*****'; 73 77 break; 74 78 case 'create_date': -
download-monitor/tags/5.0.31/src/KeyGeneration/class-dlm-key-generation.php
r3198966 r3335321 74 74 ?> 75 75 <div class='dlm-api-keys'> 76 <h2 class='wp-heading-inline'><?php77 echo esc_html__( 'API Keys', 'download-monitor' ); ?></h2>78 76 <div class="dlm-api-keys-generator"> 79 77 <br> 80 78 <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> 84 88 </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> 87 94 </div> 88 95 <?php … … 315 322 case 'generate': 316 323 case 'regenerate': 317 318 324 $results = $this->generate_api_key( $user_id, true ); 319 325 … … 340 346 */ 341 347 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§ion=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§ion=rest', 357 'type' => 'callback', 358 'callback' => array( $this, 'render_api_keys_page' ), 359 'priority' => 90, 360 ), 361 ), 364 362 ); 365 363 -
download-monitor/tags/5.0.31/vendor/composer/installed.php
r3334213 r3335321 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',6 'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',16 'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2', 17 17 'type' => 'library', 18 18 '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 1 5 = 5.0.30 - 25.07.2025 = 2 6 Fixed: Downloads without a default WPML language were not showing in the admin table. -
download-monitor/trunk/download-monitor.php
r3334213 r3335321 4 4 Plugin URI: https://www.download-monitor.com 5 5 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.3 06 Version: 5.0.31 7 7 Author: WPChill 8 8 Author URI: https://wpchill.com … … 35 35 36 36 // Define DLM Version 37 define( 'DLM_VERSION', '5.0.3 0' );37 define( 'DLM_VERSION', '5.0.31' ); 38 38 define( 'DLM_UPGRADER_VERSION', '4.6.0' ); 39 39 -
download-monitor/trunk/includes/admin/class-dlm-upsells.php
r3315233 r3335321 80 80 } 81 81 82 public function upsells_init() {82 public function upsells_init() { 83 83 $this->set_offer(); 84 84 … … 98 98 ); 99 99 // 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 // ); 106 106 // } 107 107 // 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 // ); 113 113 // } 114 114 } -
download-monitor/trunk/includes/bootstrap.php
r3332245 r3335321 65 65 // Multisite new blog hook. 66 66 add_action( 'wpmu_new_blog', '_download_monitor_mu_new_blog', 10, 6 ); 67 add_action( 'admin_init', 'dlm_check_default_translations' ); 67 68 68 69 // Multisite blog delete. -
download-monitor/trunk/includes/installer-functions.php
r3334213 r3335321 53 53 } 54 54 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 ); 57 56 } 58 57 … … 203 202 if ( $string === $endpoint_option ) { 204 203 set_transient( 'dlm_download_endpoints_rewrite', true, HOUR_IN_SECONDS ); 204 } 205 } 206 207 function 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' ); 205 219 } 206 220 } … … 258 272 } 259 273 } 274 275 function 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 4 4 Requires at least: 5.5 5 5 Tested up to: 6.8 6 Stable tag: 5.0.3 06 Stable tag: 5.0.31 7 7 License: GPLv3 8 8 Requires PHP: 7.6 … … 115 115 116 116 == 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 117 121 = 5.0.30 - 25.07.2025 = 118 122 Fixed: Downloads without a default WPML language were not showing in the admin table. -
download-monitor/trunk/src/Admin/AdminScripts.php
r3198966 r3335321 311 311 } 312 312 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'] ) { 314 314 315 315 // Enqueue Select2 -
download-monitor/trunk/src/KeyGeneration/admin/class-dlm-api-keys-table.php
r3198966 r3335321 67 67 break; 68 68 case 'token': 69 echo esc_html( $item->get_token() ); 69 echo current_user_can( 'manage_options' ) 70 ? esc_html( $item->get_token() ) 71 : '*****'; 70 72 break; 71 73 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 : '*****'; 73 77 break; 74 78 case 'create_date': -
download-monitor/trunk/src/KeyGeneration/class-dlm-key-generation.php
r3198966 r3335321 74 74 ?> 75 75 <div class='dlm-api-keys'> 76 <h2 class='wp-heading-inline'><?php77 echo esc_html__( 'API Keys', 'download-monitor' ); ?></h2>78 76 <div class="dlm-api-keys-generator"> 79 77 <br> 80 78 <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> 84 88 </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> 87 94 </div> 88 95 <?php … … 315 322 case 'generate': 316 323 case 'regenerate': 317 318 324 $results = $this->generate_api_key( $user_id, true ); 319 325 … … 340 346 */ 341 347 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§ion=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§ion=rest', 357 'type' => 'callback', 358 'callback' => array( $this, 'render_api_keys_page' ), 359 'priority' => 90, 360 ), 361 ), 364 362 ); 365 363 -
download-monitor/trunk/vendor/composer/installed.php
r3334213 r3335321 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',6 'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 96e33c8ecd5ffc6be98692ce847faa5a66f0d3f0',16 'reference' => '63ae7261f9bb48dea4acbb97467dafcb65ea6ec2', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.