Version Description
- Fixed an extension activation error.
- Fixed a bug that caused the featured image to disappear in some themes.
- Tweak: In multisite only users that are a member of the blog can download 'member only' downloads.
Download this release
Release Info
| Developer | barrykooij |
| Plugin | |
| Version | 1.6.1 |
| Comparing to | |
| See all releases | |
Code changes from version 1.6.0 to 1.6.1
- download-monitor.php +2 -2
- includes/admin/class-dlm-admin-extensions.php +1 -1
- includes/class-dlm-download-handler.php +12 -2
- includes/class-wp-dlm.php +9 -1
- readme.txt +6 -1
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 downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
|
| 6 |
-
Version: 1.6.
|
| 7 |
Author: Barry Kooij & Mike Jolley
|
| 8 |
Author URI: http://www.download-monitor.com
|
| 9 |
Requires at least: 3.8
|
|
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 33 |
function __download_monitor_main() {
|
| 34 |
|
| 35 |
// Define DLM Version
|
| 36 |
-
define( 'DLM_VERSION', '1.6.
|
| 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 downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
|
| 6 |
+
Version: 1.6.1
|
| 7 |
Author: Barry Kooij & Mike Jolley
|
| 8 |
Author URI: http://www.download-monitor.com
|
| 9 |
Requires at least: 3.8
|
| 33 |
function __download_monitor_main() {
|
| 34 |
|
| 35 |
// Define DLM Version
|
| 36 |
+
define( 'DLM_VERSION', '1.6.1' );
|
| 37 |
|
| 38 |
// Define DLM FILE
|
| 39 |
define( 'DLM_PLUGIN_FILE', __FILE__ );
|
includes/admin/class-dlm-admin-extensions.php
CHANGED
|
@@ -147,7 +147,7 @@ class DLM_Admin_Extensions {
|
|
| 147 |
echo '<input type="hidden" id="product_id" value="' . $extension->product_id . '" />' . PHP_EOL;
|
| 148 |
echo '<input type="text" name="key" id="key" value="' . $license->get_key() . '" placeholder="License Key"' . ( ( $license->is_active() ) ? ' disabled="disabled"' : '' ) . ' />' . PHP_EOL;
|
| 149 |
echo '<input type="text" name="email" id="email" value="' . $license->get_email() . '" placeholder="License Email"' . ( ( $license->is_active() ) ? ' disabled="disabled"' : '' ) . ' />' . PHP_EOL;
|
| 150 |
-
echo '<a href="
|
| 151 |
echo '</div>' . PHP_EOL;
|
| 152 |
|
| 153 |
echo '</div>';
|
| 147 |
echo '<input type="hidden" id="product_id" value="' . $extension->product_id . '" />' . PHP_EOL;
|
| 148 |
echo '<input type="text" name="key" id="key" value="' . $license->get_key() . '" placeholder="License Key"' . ( ( $license->is_active() ) ? ' disabled="disabled"' : '' ) . ' />' . PHP_EOL;
|
| 149 |
echo '<input type="text" name="email" id="email" value="' . $license->get_email() . '" placeholder="License Email"' . ( ( $license->is_active() ) ? ' disabled="disabled"' : '' ) . ' />' . PHP_EOL;
|
| 150 |
+
echo '<a href="javascript:;" class="button button-primary">' . ( ( $license->is_active() ) ? 'Deactivate' : 'Activate' ) . '</a>';
|
| 151 |
echo '</div>' . PHP_EOL;
|
| 152 |
|
| 153 |
echo '</div>';
|
includes/class-dlm-download-handler.php
CHANGED
|
@@ -43,8 +43,18 @@ class DLM_Download_Handler {
|
|
| 43 |
* @return void
|
| 44 |
*/
|
| 45 |
public function check_access( $can_download, $download ) {
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
|
| 50 |
return $can_download;
|
| 43 |
* @return void
|
| 44 |
*/
|
| 45 |
public function check_access( $can_download, $download ) {
|
| 46 |
+
|
| 47 |
+
// Check if download is a 'members only' download
|
| 48 |
+
if ( $download->is_members_only() ) {
|
| 49 |
+
|
| 50 |
+
// Check if user is logged in
|
| 51 |
+
if( ! is_user_logged_in() ) {
|
| 52 |
+
$can_download = false;
|
| 53 |
+
} // Check if it's a multisite and if user is member of blog
|
| 54 |
+
else if ( is_multisite() && ! is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) ) {
|
| 55 |
+
$can_download = false;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
}
|
| 59 |
|
| 60 |
return $can_download;
|
includes/class-wp-dlm.php
CHANGED
|
@@ -173,7 +173,15 @@ class WP_DLM {
|
|
| 173 |
remove_post_type_support( 'post', 'thumbnail' );
|
| 174 |
remove_post_type_support( 'page', 'thumbnail' );
|
| 175 |
} else {
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
add_post_type_support( 'download', 'thumbnail' );
|
| 178 |
}
|
| 179 |
}
|
| 173 |
remove_post_type_support( 'post', 'thumbnail' );
|
| 174 |
remove_post_type_support( 'page', 'thumbnail' );
|
| 175 |
} else {
|
| 176 |
+
|
| 177 |
+
// Get current supported
|
| 178 |
+
$current_support = get_theme_support( 'post-thumbnails' );
|
| 179 |
+
|
| 180 |
+
// This can be a bool or array. If array we merge our post type in, if bool ignore because it's like a global theme setting.
|
| 181 |
+
if ( is_array( $current_support ) ) {
|
| 182 |
+
add_theme_support( 'post-thumbnails', array_merge( $current_support, array( 'dlm_download' ) ) );
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
add_post_type_support( 'download', 'thumbnail' );
|
| 186 |
}
|
| 187 |
}
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=barry@ca
|
|
| 4 |
Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
|
| 5 |
Requires at least: 3.8
|
| 6 |
Tested up to: 4.1
|
| 7 |
-
Stable tag: 1.6.
|
| 8 |
License: GPLv3
|
| 9 |
|
| 10 |
Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
|
|
@@ -110,6 +110,11 @@ Admin hits are not counted, log out and try!
|
|
| 110 |
|
| 111 |
== Changelog ==
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
= 1.6.0 =
|
| 114 |
* Plugin is now initiated at plugins_loaded.
|
| 115 |
* Implemented auto loader.
|
| 4 |
Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
|
| 5 |
Requires at least: 3.8
|
| 6 |
Tested up to: 4.1
|
| 7 |
+
Stable tag: 1.6.1
|
| 8 |
License: GPLv3
|
| 9 |
|
| 10 |
Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
|
| 110 |
|
| 111 |
== Changelog ==
|
| 112 |
|
| 113 |
+
= 1.6.1 =
|
| 114 |
+
* Fixed an extension activation error.
|
| 115 |
+
* Fixed a bug that caused the featured image to disappear in some themes.
|
| 116 |
+
* Tweak: In multisite only users that are a member of the blog can download 'member only' downloads.
|
| 117 |
+
|
| 118 |
= 1.6.0 =
|
| 119 |
* Plugin is now initiated at plugins_loaded.
|
| 120 |
* Implemented auto loader.
|
