Download Monitor - Version 4.5.91

Version Description

Download this release

Release Info

Developer raldea89
Plugin Icon 128x128 Download Monitor
Version 4.5.91
Comparing to
See all releases

Code changes from version 4.5.9 to 4.5.91

changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  = 4.5.9 - 05.04.2022 =
2
  Fixed: Security issues regarding file downloads and download titles
3
  Added: Option to not count admin downloads. ( https://github.com/WPChill/download-monitor/issues/854 )
1
+ = 4.5.91 - 05.04.2022 =
2
+ Fixed: Error when checking for robots.txt file ( https://github.com/WPChill/download-monitor/issues/883 )
3
+
4
  = 4.5.9 - 05.04.2022 =
5
  Fixed: Security issues regarding file downloads and download titles
6
  Added: Option to not count admin downloads. ( https://github.com/WPChill/download-monitor/issues/854 )
download-monitor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
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: 4.5.9
7
  Author: WPChill
8
  Author URI: https://wpchill.com
9
  Requires at least: 5.4
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
- define( 'DLM_VERSION', '4.5.9' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
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: 4.5.91
7
  Author: WPChill
8
  Author URI: https://wpchill.com
9
  Requires at least: 5.4
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
+ define( 'DLM_VERSION', '4.5.91' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpchill, silkalns, barrykooij, mikejolley
3
  Tags: download manager, document management, file manager, digital store, ecommerce, document management plugin, download monitor, download counter, password protection, download protection, password, protect downloads, tracker, sell, shop, ecommerce, paypal
4
  Requires at least: 5.4
5
  Tested up to: 5.9
6
- Stable tag: 4.5.9
7
  License: GPLv3
8
  Text Domain: -
9
  Requires PHP: 5.6
3
  Tags: download manager, document management, file manager, digital store, ecommerce, document management plugin, download monitor, download counter, password protection, download protection, password, protect downloads, tracker, sell, shop, ecommerce, paypal
4
  Requires at least: 5.4
5
  Tested up to: 5.9
6
+ Stable tag: 4.5.91
7
  License: GPLv3
8
  Text Domain: -
9
  Requires PHP: 5.6
src/Admin/Settings/Page.php CHANGED
@@ -552,16 +552,24 @@ Deny from all
552
 
553
  $robots_file = "{$_SERVER['DOCUMENT_ROOT']}/robots.txt";
554
  $page = wp_remote_get( get_home_url() . '/robots.txt');
555
- $has_virtual_robots = false !== strpos( $page['headers']['content-type'], 'text/plain' );
 
 
 
 
556
 
557
  if ( ! file_exists( $robots_file ) ) {
558
  $icon = 'dashicons-dismiss';
559
  $icon_color = '#f00';
560
  $icon_text = __( 'Robots.txt is missing.', 'download-monitor' );
561
 
562
- if ( $has_virtual_robots ) {
563
  $icon_text = __( 'Robots.txt file is missing but site has virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
564
  }
 
 
 
 
565
  } else {
566
 
567
  $content = file_get_contents( $robots_file );
552
 
553
  $robots_file = "{$_SERVER['DOCUMENT_ROOT']}/robots.txt";
554
  $page = wp_remote_get( get_home_url() . '/robots.txt');
555
+ $has_virtual_robots = 'undetermined';
556
+
557
+ if ( ! is_wp_error( $page ) && is_array( $page ) ) {
558
+ $has_virtual_robots = false !== strpos( $page['headers']['content-type'], 'text/plain' );
559
+ }
560
 
561
  if ( ! file_exists( $robots_file ) ) {
562
  $icon = 'dashicons-dismiss';
563
  $icon_color = '#f00';
564
  $icon_text = __( 'Robots.txt is missing.', 'download-monitor' );
565
 
566
+ if ( $has_virtual_robots && 'undetermined' !== $has_virtual_robots ) {
567
  $icon_text = __( 'Robots.txt file is missing but site has virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
568
  }
569
+
570
+ if ( $has_virtual_robots && 'undetermined' === $has_virtual_robots ) {
571
+ $icon_text = __( 'Robots.txt file is missing but site may have virtual Robots.txt file. If you regenerate this you will loose the restrictions set in the virtual one. Please either update the virtual with the corresponding rules for dlm_uploads or regenerate and update the newly created one with the contents from the virtual file.', 'download-monitor' );
572
+ }
573
  } else {
574
 
575
  $content = file_get_contents( $robots_file );
src/Polyfill/DateTimeImmutable/DateTimeImmutable.php CHANGED
@@ -18,7 +18,6 @@ if ( ! class_exists( "DateTimeImmutable" ) ) {
18
  return new DateTimeImmutable( $array['date'] );
19
  }
20
 
21
-
22
  public static function createFromFormat( $format, $time, $object = null ) {
23
  $dt = DateTime::createFromFormat( $format, $time, $object );
24
  if ( $dt === false ) {
18
  return new DateTimeImmutable( $array['date'] );
19
  }
20
 
 
21
  public static function createFromFormat( $format, $time, $object = null ) {
22
  $dt = DateTime::createFromFormat( $format, $time, $object );
23
  if ( $dt === false ) {