Version Description
- 2021.12.24 =
- Fixed several input sanitization issues
Download this release
Release Info
Developer | codename065 |
Plugin | WordPress Download Manager |
Version | 3.2.28 |
Comparing to | |
See all releases |
Code changes from version 3.2.27 to 3.2.28
- download-manager.php +16 -13
- readme.txt +4 -1
- src/Admin/AdminController.php +4 -49
- src/Admin/DashboardWidgets.php +0 -5
- src/Admin/Menu/Packages.php +9 -43
- src/Admin/Menu/Settings.php +3 -29
- src/Admin/Menu/Templates.php +0 -1
- src/Admin/views/addons-list.php +1 -1
- src/Admin/views/dashboard-widget.php +0 -144
- src/Admin/views/dashboard-widgets/offer.php +0 -9
- src/Admin/views/import.php +13 -13
- src/Admin/views/metaboxes/additional-preview-images.php +1 -1
- src/Admin/views/metaboxes/attached-files.php +5 -5
- src/Admin/views/metaboxes/file-info.php +3 -3
- src/Admin/views/metaboxes/file-info.tpl.php +2 -2
- src/Admin/views/page-header.php +3 -3
- src/Admin/views/settings/basic.php +2 -2
- src/Admin/views/stats.php +1 -1
- src/Admin/views/stats/history.php +12 -12
- src/Admin/views/stats/insight.php +0 -256
- src/Admin/views/stats/overview.php +0 -174
- src/Admin/views/stats/pvdaud.php +0 -61
- src/Admin/views/stats/pvdpu.php +0 -65
- src/Admin/views/stats/pvupd.php +0 -100
- src/Admin/views/stats/today.php +0 -80
- src/Admin/views/templates/custom-tags.php +1 -1
- src/Admin/views/templates/list-templates.php +1 -1
- src/Admin/views/welcome.php +3 -3
- src/AssetManager/AssetManager.php +1 -19
- src/AssetManager/views/asset-manager-ui.php +19 -19
- src/AssetManager/views/asset-viewer.php +0 -535
- src/Category/views/taxonomy-wpdmcategory.php +1 -1
- src/MediaLibrary/MediaAccessControl.php +4 -14
- src/MediaLibrary/views/media-download.php +0 -205
- src/Package/views/all-packages-shortcode.php +1 -4
- src/Package/views/datatable.php +1 -1
- src/Package/views/download-page-clean.php +1 -1
- src/Package/views/lock-options-iframe.php +2 -2
- src/Package/views/lock-options/recaptcha-lock.php +1 -1
- src/Package/views/shortcode-iframe.php +2 -2
- src/User/Login.php +3 -3
- src/User/views/dashboard/edit-profile.php +2 -2
- src/User/views/login-form.php +4 -4
- src/User/views/reg-form.php +1 -1
- src/__/Apply.php +30 -30
- src/__/FileSystem.php +0 -2
- src/__/Messages.php +1 -7
- src/__/Updater.php +0 -123
- src/__/__.php +12 -31
- src/__/views/blank.php +0 -52
- src/__/views/message.php +40 -35
- src/__/views/template-preview.php +1 -1
- src/wpdm-core.php +5 -96
- src/wpdm-functions.php +1 -1
- src/wpdm-start-download.php +0 -1
download-manager.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.wpdownloadmanager.com/purchases/
|
|
5 |
Description: Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.
|
6 |
Author: W3 Eden, Inc.
|
7 |
Author URI: https://www.wpdownloadmanager.com/
|
8 |
-
Version: 3.2.
|
9 |
Text Domain: download-manager
|
10 |
Domain Path: /languages
|
11 |
*/
|
@@ -24,7 +24,6 @@ use WPDM\__\Session;
|
|
24 |
use WPDM\__\Settings;
|
25 |
use WPDM\__\Template;
|
26 |
use WPDM\__\UI;
|
27 |
-
use WPDM\__\Updater;
|
28 |
use WPDM\__\UserAgent;
|
29 |
use WPDM\Admin\AdminController;
|
30 |
use WPDM\AssetManager\AssetManager;
|
@@ -39,7 +38,7 @@ use WPDM\Widgets\WidgetController;
|
|
39 |
|
40 |
global $WPDM;
|
41 |
|
42 |
-
define('WPDM_VERSION','3.2.
|
43 |
|
44 |
define('WPDM_TEXT_DOMAIN','download-manager');
|
45 |
|
@@ -136,7 +135,6 @@ final class WordPressDownloadManager{
|
|
136 |
public $bsversion = '';
|
137 |
public $userAgent;
|
138 |
public $message;
|
139 |
-
public $updater;
|
140 |
public $ui;
|
141 |
public $wpdm_urls;
|
142 |
|
@@ -195,7 +193,6 @@ final class WordPressDownloadManager{
|
|
195 |
$this->downloadHistory = new DownloadStats();
|
196 |
$this->userAgent = new UserAgent();
|
197 |
$this->message = new Messages();
|
198 |
-
$this->updater = new Updater();
|
199 |
$this->ui = new UI();
|
200 |
$this->email = new Email();
|
201 |
|
@@ -409,16 +406,16 @@ final class WordPressDownloadManager{
|
|
409 |
|
410 |
if(is_admin()) return;
|
411 |
|
412 |
-
wp_register_style('wpdm-front-bootstrap3', plugins_url('/
|
413 |
wp_register_style('wpdm-front-bootstrap', plugins_url('/download-manager/assets/bootstrap/css/bootstrap.min.css'));
|
414 |
wp_register_style('wpdm-font-awesome', WPDM_FONTAWESOME_URL);
|
415 |
-
wp_register_style('wpdm-front3', plugins_url(
|
416 |
-
wp_register_style('wpdm-front', plugins_url(
|
417 |
|
418 |
-
wp_register_script('wpdm-front-bootstrap3', plugins_url('/
|
419 |
-
wp_register_script('wpdm-poper', plugins_url('/
|
420 |
-
wp_register_script('wpdm-front-bootstrap', plugins_url('/
|
421 |
-
wp_register_script('jquery-validate', plugins_url('/
|
422 |
|
423 |
}
|
424 |
|
@@ -459,7 +456,7 @@ final class WordPressDownloadManager{
|
|
459 |
}
|
460 |
|
461 |
//wp_enqueue_script('audio-player', plugins_url('/download-manager/assets/js/audio-player.js'), array('jquery'));
|
462 |
-
wp_register_script('wpdm-frontjs', plugins_url('/
|
463 |
|
464 |
$wpdm_js = array(
|
465 |
'spinner' => '<i class="fas fa-sun fa-spin"></i>'
|
@@ -473,6 +470,12 @@ final class WordPressDownloadManager{
|
|
473 |
|
474 |
wp_enqueue_script('wpdm-frontjs');
|
475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
|
477 |
}
|
478 |
|
5 |
Description: Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.
|
6 |
Author: W3 Eden, Inc.
|
7 |
Author URI: https://www.wpdownloadmanager.com/
|
8 |
+
Version: 3.2.28
|
9 |
Text Domain: download-manager
|
10 |
Domain Path: /languages
|
11 |
*/
|
24 |
use WPDM\__\Settings;
|
25 |
use WPDM\__\Template;
|
26 |
use WPDM\__\UI;
|
|
|
27 |
use WPDM\__\UserAgent;
|
28 |
use WPDM\Admin\AdminController;
|
29 |
use WPDM\AssetManager\AssetManager;
|
38 |
|
39 |
global $WPDM;
|
40 |
|
41 |
+
define('WPDM_VERSION','3.2.28');
|
42 |
|
43 |
define('WPDM_TEXT_DOMAIN','download-manager');
|
44 |
|
135 |
public $bsversion = '';
|
136 |
public $userAgent;
|
137 |
public $message;
|
|
|
138 |
public $ui;
|
139 |
public $wpdm_urls;
|
140 |
|
193 |
$this->downloadHistory = new DownloadStats();
|
194 |
$this->userAgent = new UserAgent();
|
195 |
$this->message = new Messages();
|
|
|
196 |
$this->ui = new UI();
|
197 |
$this->email = new Email();
|
198 |
|
406 |
|
407 |
if(is_admin()) return;
|
408 |
|
409 |
+
wp_register_style('wpdm-front-bootstrap3', plugins_url('/assets/bootstrap3/css/bootstrap.min.css', __FILE__));
|
410 |
wp_register_style('wpdm-front-bootstrap', plugins_url('/download-manager/assets/bootstrap/css/bootstrap.min.css'));
|
411 |
wp_register_style('wpdm-font-awesome', WPDM_FONTAWESOME_URL);
|
412 |
+
wp_register_style('wpdm-front3', plugins_url('/assets/css/front3.css', __FILE__));
|
413 |
+
wp_register_style('wpdm-front', plugins_url('/assets/css/front.css', __FILE__) , 99999999);
|
414 |
|
415 |
+
wp_register_script('wpdm-front-bootstrap3', plugins_url('/assets/bootstrap3/js/bootstrap.min.js', __FILE__), array('jquery'));
|
416 |
+
wp_register_script('wpdm-poper', plugins_url('/assets/bootstrap/js/popper.min.js', __FILE__), array('jquery'));
|
417 |
+
wp_register_script('wpdm-front-bootstrap', plugins_url('/assets/bootstrap/js/bootstrap.min.js', __FILE__), array('jquery'));
|
418 |
+
wp_register_script('jquery-validate', plugins_url('/assets/js/jquery.validate.min.js', __FILE__), array('jquery'));
|
419 |
|
420 |
}
|
421 |
|
456 |
}
|
457 |
|
458 |
//wp_enqueue_script('audio-player', plugins_url('/download-manager/assets/js/audio-player.js'), array('jquery'));
|
459 |
+
wp_register_script('wpdm-frontjs', plugins_url('/assets/js/front.js', __FILE__), array('jquery'), WPDM_VERSION);
|
460 |
|
461 |
$wpdm_js = array(
|
462 |
'spinner' => '<i class="fas fa-sun fa-spin"></i>'
|
470 |
|
471 |
wp_enqueue_script('wpdm-frontjs');
|
472 |
|
473 |
+
if(substr_count($post->post_content, "wpdm_all_packages")){
|
474 |
+
wp_enqueue_script("datatable", plugins_url('/assets/js/jquery.dataTables.min.js', __FILE__));
|
475 |
+
wp_enqueue_script("datatable-bs4", plugins_url('/assets/js/dataTables.bootstrap4.min.js', __FILE__));
|
476 |
+
wp_enqueue_style("datatable-css", plugins_url('/assets/css/jquery.dataTables.min.css', __FILE__));
|
477 |
+
}
|
478 |
+
|
479 |
|
480 |
}
|
481 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: download manager, document management, file manager, digital store, ecomme
|
|
5 |
Requires at least: 5.3
|
6 |
Tested up to: 5.8
|
7 |
License: GPLv2 or later
|
8 |
-
Stable tag: 3.2.
|
9 |
|
10 |
|
11 |
This File Management & Digital Store plugin will help you to control file downloads & sell digital products from your WP site.
|
@@ -181,6 +181,9 @@ Check download stats and get a push notification when someone downloads, install
|
|
181 |
|
182 |
== Changelog ==
|
183 |
|
|
|
|
|
|
|
184 |
= 3.2.27 - 2021.12.20 =
|
185 |
* Improved add-ons page
|
186 |
|
5 |
Requires at least: 5.3
|
6 |
Tested up to: 5.8
|
7 |
License: GPLv2 or later
|
8 |
+
Stable tag: 3.2.28
|
9 |
|
10 |
|
11 |
This File Management & Digital Store plugin will help you to control file downloads & sell digital products from your WP site.
|
181 |
|
182 |
== Changelog ==
|
183 |
|
184 |
+
= 3.2.28 - 2021.12.24 =
|
185 |
+
* Fixed several input sanitization issues
|
186 |
+
|
187 |
= 3.2.27 - 2021.12.20 =
|
188 |
* Improved add-ons page
|
189 |
|
src/Admin/AdminController.php
CHANGED
@@ -35,9 +35,6 @@ class AdminController {
|
|
35 |
add_action('admin_head', array($this, 'adminHead'));
|
36 |
add_action('admin_footer', array($this, 'adminFooter'));
|
37 |
|
38 |
-
add_action('wp_ajax_updateaddon', array($this, 'updateAddon'));
|
39 |
-
add_action('wp_ajax_installaddon', array($this, 'installAddon'));
|
40 |
-
|
41 |
add_action("admin_notices", [$this, 'notices']);
|
42 |
add_action("wp_ajax_wpdm_remove_admin_notice", [$this, 'removeNotices']);
|
43 |
add_action("wp_ajax_hide_wpdmpro_notice", [$this, 'hideProNotice']);
|
@@ -116,6 +113,7 @@ class AdminController {
|
|
116 |
|
117 |
|
118 |
}
|
|
|
119 |
wp_enqueue_style('wpdm-gutenberg-styles',WPDM_BASE_URL.'assets/css/gutenberg-styles.css', 9999);
|
120 |
}
|
121 |
|
@@ -125,49 +123,6 @@ class AdminController {
|
|
125 |
}
|
126 |
|
127 |
|
128 |
-
/**
|
129 |
-
* @usage Single click add-on update
|
130 |
-
*/
|
131 |
-
function updateAddon() {
|
132 |
-
if (isset($_POST['updateurl'])) {
|
133 |
-
__::isAuthentic('__upanonce', WPDM_PRI_NONCE, WPDM_ADMIN_CAP);
|
134 |
-
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
135 |
-
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
136 |
-
$upgrader = new \Plugin_Upgrader(new \Plugin_Installer_Skin(compact('title', 'url', 'nonce', 'plugin', 'api')));
|
137 |
-
$downloadlink = wpdm_query_var('updateurl') . '&wpdm_access_token=' . wpdm_access_token() . '&__wpdmnocache=' . uniqid();
|
138 |
-
$update = new \stdClass();
|
139 |
-
$plugininfo = wpdm_plugin_data(wpdm_query_var('plugin'));
|
140 |
-
deactivate_plugins($plugininfo['plugin_index_file'], true);
|
141 |
-
delete_plugins(array($plugininfo['plugin_index_file']));
|
142 |
-
$upgrader->install($downloadlink);
|
143 |
-
if (file_exists(dirname(WPDM_BASE_DIR) . '/' . $plugininfo['plugin_index_file']))
|
144 |
-
activate_plugin($plugininfo['plugin_index_file']);
|
145 |
-
die("Updated Successfully");
|
146 |
-
} else {
|
147 |
-
die("Only site admin is authorized to install add-on");
|
148 |
-
}
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* @usage Single click add-on install
|
153 |
-
*/
|
154 |
-
function installAddon() {
|
155 |
-
if (isset($_POST['updateurl'])) {
|
156 |
-
__::isAuthentic('__upanonce', WPDM_PRI_NONCE, WPDM_ADMIN_CAP);
|
157 |
-
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
158 |
-
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
159 |
-
$upgrader = new \Plugin_Upgrader(new \Plugin_Installer_Skin(compact('title', 'url', 'nonce', 'plugin', 'api')));
|
160 |
-
$downloadlink = wpdm_query_var('updateurl') . '&wpdm_access_token=' . wpdm_access_token();
|
161 |
-
$upgrader->install($downloadlink);
|
162 |
-
$plugininfo = wpdm_plugin_data(wpdm_query_var('plugin'));
|
163 |
-
if (file_exists(dirname(WPDM_BASE_DIR) . '/' . $plugininfo['plugin_index_file']))
|
164 |
-
activate_plugin($plugininfo['plugin_index_file']);
|
165 |
-
die("Installed Successfully");
|
166 |
-
} else {
|
167 |
-
die("Only site admin is authorized to install add-on");
|
168 |
-
}
|
169 |
-
}
|
170 |
-
|
171 |
function usersRowAction($actions, $user)
|
172 |
{
|
173 |
$actions[] = "<a href='edit.php?post_type=wpdmpro&page=wpdm-stats&type=history&filter=1&user_ids[0]={$user->ID}'>".__( 'Download History', 'download-manager' )."</a>";
|
@@ -206,7 +161,7 @@ class AdminController {
|
|
206 |
});
|
207 |
|
208 |
jQuery('body').on('click', '#wpdmvnotice .notice-dismiss', function (){
|
209 |
-
jQuery.post(ajaxurl, {action: 'wpdm_remove_admin_notice', __rnnonce: '
|
210 |
});
|
211 |
|
212 |
});
|
@@ -290,7 +245,7 @@ class AdminController {
|
|
290 |
#wpdmpro_notice .xcontent{
|
291 |
flex: 4;
|
292 |
position: relative;
|
293 |
-
background: url('
|
294 |
background-size: contain;
|
295 |
padding-left: 60px
|
296 |
}
|
@@ -365,7 +320,7 @@ class AdminController {
|
|
365 |
$('#wnxclose').on('click', function (e) {
|
366 |
e.preventDefault();
|
367 |
$('#wpdmpro_notice').fadeOut();
|
368 |
-
$.get(ajaxurl, {__wpnnonce: '
|
369 |
});
|
370 |
});
|
371 |
</script>
|
35 |
add_action('admin_head', array($this, 'adminHead'));
|
36 |
add_action('admin_footer', array($this, 'adminFooter'));
|
37 |
|
|
|
|
|
|
|
38 |
add_action("admin_notices", [$this, 'notices']);
|
39 |
add_action("wp_ajax_wpdm_remove_admin_notice", [$this, 'removeNotices']);
|
40 |
add_action("wp_ajax_hide_wpdmpro_notice", [$this, 'hideProNotice']);
|
113 |
|
114 |
|
115 |
}
|
116 |
+
|
117 |
wp_enqueue_style('wpdm-gutenberg-styles',WPDM_BASE_URL.'assets/css/gutenberg-styles.css', 9999);
|
118 |
}
|
119 |
|
123 |
}
|
124 |
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
function usersRowAction($actions, $user)
|
127 |
{
|
128 |
$actions[] = "<a href='edit.php?post_type=wpdmpro&page=wpdm-stats&type=history&filter=1&user_ids[0]={$user->ID}'>".__( 'Download History', 'download-manager' )."</a>";
|
161 |
});
|
162 |
|
163 |
jQuery('body').on('click', '#wpdmvnotice .notice-dismiss', function (){
|
164 |
+
jQuery.post(ajaxurl, {action: 'wpdm_remove_admin_notice', __rnnonce: '<?php echo wp_create_nonce(WPDM_PUB_NONCE) ?>'});
|
165 |
});
|
166 |
|
167 |
});
|
245 |
#wpdmpro_notice .xcontent{
|
246 |
flex: 4;
|
247 |
position: relative;
|
248 |
+
background: url('<?php echo WPDM_BASE_URL ?>assets/images/wpdm-logo.png') left center no-repeat;
|
249 |
background-size: contain;
|
250 |
padding-left: 60px
|
251 |
}
|
320 |
$('#wnxclose').on('click', function (e) {
|
321 |
e.preventDefault();
|
322 |
$('#wpdmpro_notice').fadeOut();
|
323 |
+
$.get(ajaxurl, {__wpnnonce: '<?php echo wp_create_nonce(WPDM_PUB_NONCE)?>', action: 'hide_wpdmpro_notice'});
|
324 |
});
|
325 |
});
|
326 |
</script>
|
src/Admin/DashboardWidgets.php
CHANGED
@@ -25,17 +25,12 @@ class DashboardWidgets
|
|
25 |
include wpdm_admin_tpl_path('dashboard-widgets/social.php');
|
26 |
}
|
27 |
|
28 |
-
function specialOffer()
|
29 |
-
{
|
30 |
-
include wpdm_admin_tpl_path('dashboard-widgets/offer.php');
|
31 |
-
}
|
32 |
|
33 |
|
34 |
function addDashboardWidget()
|
35 |
{
|
36 |
wp_add_dashboard_widget('wpdm_overview', __( "Download Manager Overview" , "download-manager" ), array($this, 'overview'));
|
37 |
wp_add_dashboard_widget('wpdm_social_overview', __( "Social Overview" , "download-manager" ), array($this, 'socialOverview'));
|
38 |
-
wp_add_dashboard_widget('wpdm_offer', __( "Special Offer" , "download-manager" ), array($this, 'specialOffer'));
|
39 |
|
40 |
}
|
41 |
|
25 |
include wpdm_admin_tpl_path('dashboard-widgets/social.php');
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
28 |
|
29 |
|
30 |
function addDashboardWidget()
|
31 |
{
|
32 |
wp_add_dashboard_widget('wpdm_overview', __( "Download Manager Overview" , "download-manager" ), array($this, 'overview'));
|
33 |
wp_add_dashboard_widget('wpdm_social_overview', __( "Social Overview" , "download-manager" ), array($this, 'socialOverview'));
|
|
|
34 |
|
35 |
}
|
36 |
|
src/Admin/Menu/Packages.php
CHANGED
@@ -109,45 +109,11 @@ class Packages
|
|
109 |
}
|
110 |
|
111 |
|
112 |
-
/*
|
113 |
-
function uploadFile1(){
|
114 |
-
check_ajax_referer('wpdm_admin_upload_file');
|
115 |
-
if(!current_user_can('upload_files')) die('-2');
|
116 |
-
|
117 |
-
$ext = explode('.', $_FILES['package_file']['name']);
|
118 |
-
$ext = end($ext);
|
119 |
-
$ext = strtolower($ext);
|
120 |
-
if(in_array($ext, array('php', 'js', 'html', 'py', 'pl', 'htaccess'))) die('-3');
|
121 |
-
|
122 |
-
if(file_exists(UPLOAD_DIR.$_FILES['package_file']['name']) && get_option('__wpdm_overwrrite_file',0)==1){
|
123 |
-
@unlink(UPLOAD_DIR.$_FILES['package_file']['name']);
|
124 |
-
}
|
125 |
-
if(file_exists(UPLOAD_DIR.$_FILES['package_file']['name']))
|
126 |
-
$filename = time().'wpdm_'.$_FILES['package_file']['name'];
|
127 |
-
else
|
128 |
-
$filename = $_FILES['package_file']['name'];
|
129 |
-
|
130 |
-
do_action("wpdm_before_upload_file", $_FILES['package_file']);
|
131 |
-
|
132 |
-
$filename = esc_html($filename);
|
133 |
-
|
134 |
-
if(get_option('__wpdm_sanitize_filename', 0) == 1)
|
135 |
-
$filename = sanitize_file_name($filename);
|
136 |
-
|
137 |
-
move_uploaded_file($_FILES['package_file']['tmp_name'],UPLOAD_DIR.$filename);
|
138 |
-
|
139 |
-
$filename = apply_filters("wpdm_after_upload_file", $filename);
|
140 |
-
|
141 |
-
echo "|||".$filename."|||";
|
142 |
-
exit;
|
143 |
-
}
|
144 |
-
*/
|
145 |
-
|
146 |
function uploadFile(){
|
147 |
check_ajax_referer(NONCE_KEY);
|
148 |
if(!current_user_can('upload_files')) die('-2');
|
149 |
|
150 |
-
$name = isset($_FILES['package_file']['name']) && !isset($_REQUEST["chunks"])
|
151 |
|
152 |
$ext = FileSystem::fileExt($name);
|
153 |
|
@@ -331,38 +297,38 @@ class Packages
|
|
331 |
<div class="input-group input-group-lg">
|
332 |
<input type="text" value="[wpdm_package id='{{ID}}']" id="cpsc" readonly="readonly" class="form-control bg-white" style="font-family: monospace;font-weight: bold;text-align: center">
|
333 |
<div class="input-group-btn">
|
334 |
-
<button style="padding-left: 30px;padding-right: 30px" onclick="WPDM.copy('cpsc');" type="button" class="btn btn-secondary"><i class="fa fa-copy"></i>
|
335 |
</div>
|
336 |
</div>
|
337 |
<div class="alert alert-info" style="margin-top: 20px">
|
338 |
-
|
339 |
</div>
|
340 |
|
341 |
<div class="panel panel-default card-plain">
|
342 |
<div class="panel-heading">
|
343 |
-
|
344 |
</div>
|
345 |
<div class="panel-body">
|
346 |
<div class="row">
|
347 |
<div class="col-md-9"><?php wp_dropdown_pages(['class' => 'form-control wpdm-custom-select', 'id' => 'gotopg']); ?></div>
|
348 |
-
<div class="col-md-3"><button onclick="location.href='post.php?action=edit&post='+jQuery('#gotopg').val()" type="button" class="btn btn-secondary btn-block"
|
349 |
</div>
|
350 |
|
351 |
</div>
|
352 |
<div class="panel-footer bg-white">
|
353 |
-
<a href="post-new.php?post_type=page"
|
354 |
</div>
|
355 |
</div>
|
356 |
|
357 |
|
358 |
<?php if(!defined('__WPDM_GB__')) { ?>
|
359 |
-
<a class="btn btn-block btn-secondary thickbox open-plugin-details-modal" href="
|
360 |
<?php } ?>
|
361 |
<?php if(!defined('__WPDM_ELEMENTOR__')) { ?>
|
362 |
-
<a class="btn btn-block btn-secondary thickbox open-plugin-details-modal" style="margin-top: 10px" href="
|
363 |
<?php } ?>
|
364 |
<?php if(!function_exists('LiveForms')) { ?>
|
365 |
-
<a class="btn btn-block btn-info thickbox open-plugin-details-modal" style="margin-top: 10px" href="
|
366 |
<?php } ?>
|
367 |
|
368 |
|
109 |
}
|
110 |
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
function uploadFile(){
|
113 |
check_ajax_referer(NONCE_KEY);
|
114 |
if(!current_user_can('upload_files')) die('-2');
|
115 |
|
116 |
+
$name = isset($_FILES['package_file']['name']) && !isset($_REQUEST["chunks"])?sanitize_text_field($_FILES['package_file']['name']):wpdm_query_var('name', 'txt');
|
117 |
|
118 |
$ext = FileSystem::fileExt($name);
|
119 |
|
297 |
<div class="input-group input-group-lg">
|
298 |
<input type="text" value="[wpdm_package id='{{ID}}']" id="cpsc" readonly="readonly" class="form-control bg-white" style="font-family: monospace;font-weight: bold;text-align: center">
|
299 |
<div class="input-group-btn">
|
300 |
+
<button style="padding-left: 30px;padding-right: 30px" onclick="WPDM.copy('cpsc');" type="button" class="btn btn-secondary"><i class="fa fa-copy"></i> <?php echo esc_attr__( 'Copy', 'download-manager' );?></button>
|
301 |
</div>
|
302 |
</div>
|
303 |
<div class="alert alert-info" style="margin-top: 20px">
|
304 |
+
<?php echo esc_attr__( 'If you are on Gutenberg Editor or elementor, you may use gutenberg block or elementor add-on for wpdm to embed wpdm packages and categories or generate another available layouts', 'download-manager' ); ?>
|
305 |
</div>
|
306 |
|
307 |
<div class="panel panel-default card-plain">
|
308 |
<div class="panel-heading">
|
309 |
+
<?php echo esc_attr__( 'Go To Page', 'download-manager' );?>
|
310 |
</div>
|
311 |
<div class="panel-body">
|
312 |
<div class="row">
|
313 |
<div class="col-md-9"><?php wp_dropdown_pages(['class' => 'form-control wpdm-custom-select', 'id' => 'gotopg']); ?></div>
|
314 |
+
<div class="col-md-3"><button onclick="location.href='post.php?action=edit&post='+jQuery('#gotopg').val()" type="button" class="btn btn-secondary btn-block"><?php echo esc_attr__( 'Go', 'download-manager' ); ?></button></div>
|
315 |
</div>
|
316 |
|
317 |
</div>
|
318 |
<div class="panel-footer bg-white">
|
319 |
+
<a href="post-new.php?post_type=page"><?php echo esc_attr__( 'Create new page', 'download-manager' );?></a>
|
320 |
</div>
|
321 |
</div>
|
322 |
|
323 |
|
324 |
<?php if(!defined('__WPDM_GB__')) { ?>
|
325 |
+
<a class="btn btn-block btn-secondary thickbox open-plugin-details-modal" href="<?php echo admin_url('/plugin-install.php?tab=plugin-information&plugin=wpdm-gutenberg-blocks&TB_iframe=true&width=600&height=550')?>"><?php echo esc_attr__( 'Install Gutenberg Blocks by WordPress Download Manager', 'download-manager' );?></a>
|
326 |
<?php } ?>
|
327 |
<?php if(!defined('__WPDM_ELEMENTOR__')) { ?>
|
328 |
+
<a class="btn btn-block btn-secondary thickbox open-plugin-details-modal" style="margin-top: 10px" href="<?php echo admin_url('/plugin-install.php?tab=plugin-information&plugin=wpdm-elementor&TB_iframe=true&width=600&height=550')?>"><?php echo esc_attr__( 'Install Download Manager Addons for Elementor', 'download-manager' );?></a>
|
329 |
<?php } ?>
|
330 |
<?php if(!function_exists('LiveForms')) { ?>
|
331 |
+
<a class="btn btn-block btn-info thickbox open-plugin-details-modal" style="margin-top: 10px" href="<?php echo admin_url('/plugin-install.php?tab=plugin-information&plugin=liveforms&TB_iframe=true&width=600&height=550')?>"><?php echo esc_attr__( 'Install The Best WordPress Contact Form Builder', 'download-manager' );?></a>
|
332 |
<?php } ?>
|
333 |
|
334 |
|
src/Admin/Menu/Settings.php
CHANGED
@@ -105,12 +105,10 @@ class Settings
|
|
105 |
|
106 |
foreach ($stabs as $tab) {
|
107 |
if ($sel == $tab['id'])
|
108 |
-
echo "<li class='active'><a id='
|
109 |
else
|
110 |
-
echo "<li class=''><a id='
|
111 |
-
|
112 |
-
// add_action('wp_ajax_' . $tab['func'], $tab['func']);
|
113 |
-
//}
|
114 |
}
|
115 |
}
|
116 |
|
@@ -276,30 +274,6 @@ class Settings
|
|
276 |
}
|
277 |
|
278 |
|
279 |
-
function License()
|
280 |
-
{
|
281 |
-
if (isset($_POST['task']) && $_POST['task'] == 'wdm_save_settings') {
|
282 |
-
|
283 |
-
if (is_valid_license_key()) {
|
284 |
-
delete_option('__wpdm_core_update_check');
|
285 |
-
Session::clear('__wpdm_download_url');
|
286 |
-
update_option('_wpdm_license_key', wpdm_query_var('_wpdm_license_key'), false);
|
287 |
-
die('Congratulation! Your <b>Download Manager</b> copy registered successfully!');
|
288 |
-
} else {
|
289 |
-
delete_option('_wpdm_license_key');
|
290 |
-
die('Invalid License Key!');
|
291 |
-
}
|
292 |
-
}
|
293 |
-
?>
|
294 |
-
<div class="panel panel-default">
|
295 |
-
|
296 |
-
<div class="panel-heading"><b>License Key </b></div>
|
297 |
-
<div class="panel-body"><input type="text" placeholder="Enter License Key" class="form-control input-lg" value="<?php echo get_option('_wpdm_license_key'); ?>"
|
298 |
-
name="_wpdm_license_key"/></div>
|
299 |
-
|
300 |
-
</div>
|
301 |
-
<?php
|
302 |
-
}
|
303 |
|
304 |
function Privacy(){
|
305 |
if (wpdm_query_var('task') == 'wdm_save_settings' && wpdm_query_var('section') == 'privacy') {
|
105 |
|
106 |
foreach ($stabs as $tab) {
|
107 |
if ($sel == $tab['id'])
|
108 |
+
echo "<li class='active'><a id='".sanitize_text_field($tab['id'])."' href='".esc_url_raw($tab['link'])."'><i class='".sanitize_text_field($tab['icon'])."' style='margin-right: 6px'></i>".sanitize_text_field($tab['title'])."</a></li>";
|
109 |
else
|
110 |
+
echo "<li class=''><a id='".sanitize_text_field($tab['id'])."' href='".esc_url_raw($tab['link'])."'><i class='".sanitize_text_field($tab['icon'])."' style='margin-right: 6px'></i>".sanitize_text_field($tab['title'])."</a></li>";
|
111 |
+
|
|
|
|
|
112 |
}
|
113 |
}
|
114 |
|
274 |
}
|
275 |
|
276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
|
278 |
function Privacy(){
|
279 |
if (wpdm_query_var('task') == 'wdm_save_settings' && wpdm_query_var('section') == 'privacy') {
|
src/Admin/Menu/Templates.php
CHANGED
@@ -93,7 +93,6 @@ class Templates
|
|
93 |
*/
|
94 |
function preview()
|
95 |
{
|
96 |
-
error_reporting(0);
|
97 |
|
98 |
$wposts = array();
|
99 |
__::isAuthentic('_tplnonce', WPDM_PUB_NONCE, WPDM_ADMIN_CAP);
|
93 |
*/
|
94 |
function preview()
|
95 |
{
|
|
|
96 |
|
97 |
$wposts = array();
|
98 |
__::isAuthentic('_tplnonce', WPDM_PUB_NONCE, WPDM_ADMIN_CAP);
|
src/Admin/views/addons-list.php
CHANGED
@@ -201,7 +201,7 @@
|
|
201 |
display: none;
|
202 |
}
|
203 |
</style>
|
204 |
-
<link rel="stylesheet" href="
|
205 |
<div class="wrap w3eden">
|
206 |
<div id="wpdm-admin-page-header">
|
207 |
<div id="wpdm-admin-main-header">
|
201 |
display: none;
|
202 |
}
|
203 |
</style>
|
204 |
+
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL ?>assets/css/settings-ui.css" />
|
205 |
<div class="wrap w3eden">
|
206 |
<div id="wpdm-admin-page-header">
|
207 |
<div id="wpdm-admin-main-header">
|
src/Admin/views/dashboard-widget.php
DELETED
@@ -1,144 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
global $wpdb;
|
3 |
-
echo "<img height='30px' src='" . plugins_url('/download-manager/assets/images/wpdm-logo.png') . "' /><br/>";
|
4 |
-
?>
|
5 |
-
<link href="<?php echo plugins_url('/download-manager/assets/bootstrap/css/bootstrap.css'); ?>" rel='stylesheet' type='text/css'>
|
6 |
-
<script language="JavaScript" src="<?php echo plugins_url('/download-manager/assets/bootstrap/js/bootstrap.min.js'); ?>"></script>
|
7 |
-
|
8 |
-
<style type="text/css">
|
9 |
-
.nav-tabs {
|
10 |
-
margin-bottom: 0px !important;
|
11 |
-
}
|
12 |
-
|
13 |
-
.tab-content {
|
14 |
-
padding: 10px;
|
15 |
-
background: #fff;
|
16 |
-
border: 1px solid #ddd;
|
17 |
-
border-top: 0px;
|
18 |
-
-webkit-border-bottom-right-radius: 5px;
|
19 |
-
-webkit-border-bottom-left-radius: 5px;
|
20 |
-
-moz-border-radius-bottomright: 5px;
|
21 |
-
-moz-border-radius-bottomleft: 5px;
|
22 |
-
border-bottom-right-radius: 5px;
|
23 |
-
border-bottom-left-radius: 5px;
|
24 |
-
}
|
25 |
-
.tab-content * {
|
26 |
-
font-size: 10pt;
|
27 |
-
font-weight: 400;
|
28 |
-
}
|
29 |
-
|
30 |
-
.nav-tabs a {
|
31 |
-
font-size: 9pt;
|
32 |
-
font-weight: 700;
|
33 |
-
}
|
34 |
-
|
35 |
-
.tab-content * {
|
36 |
-
font-size: 10pt;
|
37 |
-
font-weight: 400;
|
38 |
-
}
|
39 |
-
|
40 |
-
.nav-tabs{ margin: 0 !important; }
|
41 |
-
|
42 |
-
.tab-content{
|
43 |
-
border: 1px solid #dddddd;
|
44 |
-
border-top: 0;
|
45 |
-
padding: 10px;
|
46 |
-
}
|
47 |
-
.tab-content{
|
48 |
-
background: #ffffff;
|
49 |
-
}
|
50 |
-
.w3eden td{
|
51 |
-
font-size: 9pt;
|
52 |
-
}
|
53 |
-
.w3eden .nav.nav-tabs > li > a {
|
54 |
-
background: rgba(0, 0, 0, 0.05) none repeat scroll 0 0;
|
55 |
-
color: #333333 !important;
|
56 |
-
border: 1px solid #dddddd;
|
57 |
-
border-bottom: 0 none;
|
58 |
-
margin-right: 3px;
|
59 |
-
border-radius: 2px 2px 0 0;
|
60 |
-
font-size: 8pt;
|
61 |
-
padding: 7px 15px;
|
62 |
-
text-transform: uppercase;
|
63 |
-
}
|
64 |
-
.w3eden .nav.nav-tabs > li.active > a{
|
65 |
-
background: #ffffff;
|
66 |
-
}
|
67 |
-
|
68 |
-
</style>
|
69 |
-
|
70 |
-
|
71 |
-
<div class="w3eden">
|
72 |
-
<ul class="nav nav-tabs" id="myTab">
|
73 |
-
<li class="active"><a href="#home"><?php _e( "Summary" , "download-manager" ); ?></a></li>
|
74 |
-
<li><a href="#social"><?php _e( "Social" , "download-manager" ); ?></a></li>
|
75 |
-
<li><a href="#settings"><?php _e( "News Updates" , "download-manager" ); ?></a></li>
|
76 |
-
</ul>
|
77 |
-
|
78 |
-
<div class="tab-content">
|
79 |
-
<div class="tab-pane active" id="home">
|
80 |
-
<table class="table table-bordered table-striped" style="margin-bottom: 0px;width:100%">
|
81 |
-
<tr>
|
82 |
-
<td><?php _e( "Total Packages" , "download-manager" ); ?></td>
|
83 |
-
<th><?php $packs = wp_count_posts('wpdmpro'); echo $packs->publish; ?></th>
|
84 |
-
</tr>
|
85 |
-
<tr>
|
86 |
-
<td><?php _e( "Total Downloads" , "download-manager" ); ?></td>
|
87 |
-
<th><?php echo $wpdb->get_var("select sum(meta_value) from {$wpdb->prefix}postmeta where meta_key='__wpdm_download_count'"); ?></th>
|
88 |
-
</tr>
|
89 |
-
<tr>
|
90 |
-
<td><?php _e( "Total Categories" , "download-manager" ); ?></td>
|
91 |
-
<th><?php echo wp_count_terms('wpdmcategory'); ?></th>
|
92 |
-
</tr>
|
93 |
-
<tr>
|
94 |
-
<td><?php _e( "Total Subscribers" , "download-manager" ); ?></td>
|
95 |
-
<th><?php echo count($wpdb->get_results("select count(email) from {$wpdb->prefix}ahm_emails group by email")); ?></th>
|
96 |
-
</tr>
|
97 |
-
<tr>
|
98 |
-
<td><?php _e( "Subscribed Today" , "download-manager" ); ?></td>
|
99 |
-
<th><?php $s = strtotime(date("Y-m-d 0:0:0"));
|
100 |
-
$e = time();
|
101 |
-
echo count($wpdb->get_results("select count(email) from {$wpdb->prefix}ahm_emails where date > $s and date < $e group by email")); ?></th>
|
102 |
-
</tr>
|
103 |
-
</table>
|
104 |
-
</div>
|
105 |
-
<div class="tab-pane" id="social">
|
106 |
-
<table class="table table-bordered table-striped" style="margin-bottom: 0px;width:100%">
|
107 |
-
<tr>
|
108 |
-
<td><?php _e( "Total FB Likes" , "download-manager" ); ?></td>
|
109 |
-
<th><?php echo get_option('wpdm_fb_likes', 0); ?></th>
|
110 |
-
</tr>
|
111 |
-
<tr>
|
112 |
-
<td><?php _e( "Total Tweets" , "download-manager" ); ?></td>
|
113 |
-
<th><?php echo get_option('wpdm_tweets', 0); ?></th>
|
114 |
-
</tr>
|
115 |
-
<tr>
|
116 |
-
<td><?php _e( "Total Google +1" , "download-manager" ); ?></td>
|
117 |
-
<th><?php echo get_option('wpdm_gplus1s', 0); ?></th>
|
118 |
-
</tr>
|
119 |
-
<tr>
|
120 |
-
<td><?php _e( "Total LinkedIn Shares" , "download-manager" ); ?></td>
|
121 |
-
<th><?php echo get_option('wpdm_linkedins', 0); ?></th>
|
122 |
-
</tr>
|
123 |
-
</table>
|
124 |
-
</div>
|
125 |
-
<div class="tab-pane" id="messages">...</div>
|
126 |
-
<div class="tab-pane" id="settings">
|
127 |
-
<iframe src="//cdn.wpdownloadmanager.com/notice.php?wpdmvarsion=<?php echo WPDM_VERSION; ?>"
|
128 |
-
style="height: 300px;width:100%;border:0px"></iframe>
|
129 |
-
</div>
|
130 |
-
</div>
|
131 |
-
|
132 |
-
<script>
|
133 |
-
jQuery(function () {
|
134 |
-
|
135 |
-
jQuery('#myTab a').click(function (e) {
|
136 |
-
e.preventDefault();
|
137 |
-
jQuery(this).tab('show');
|
138 |
-
jQuery(this).css('outline', 'none');
|
139 |
-
});
|
140 |
-
})
|
141 |
-
</script>
|
142 |
-
|
143 |
-
|
144 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/dashboard-widgets/offer.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* User: shahnuralam
|
4 |
-
* Date: 5/7/17
|
5 |
-
* Time: 10:59 AM
|
6 |
-
*/
|
7 |
-
if(!defined('ABSPATH')) die('!');
|
8 |
-
?>
|
9 |
-
<iframe src="//cdn.wpdownloadmanager.com/notice.php?wpdmvarsion=<?php echo WPDM_VERSION; ?>" style="height: 400px;width:100%;border:0px"></iframe>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/import.php
CHANGED
@@ -184,7 +184,7 @@
|
|
184 |
|
185 |
</div>
|
186 |
<div class="panel-footer" id="importstatus">
|
187 |
-
|
188 |
</div>
|
189 |
</div>
|
190 |
|
@@ -200,7 +200,7 @@
|
|
200 |
|
201 |
<div class="progress" id="wxprogressbar" style="height: 43px !important;border-radius: 3px !important;margin: 0;position: relative;background: #0d406799;display: none;box-shadow: none">
|
202 |
<div id="wxprogress" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;line-height: 43px;background-color: #007bff"></div>
|
203 |
-
<div class="fetfont" style="font-size:12px;position: absolute;line-height: 43px;height: 43px;width: 100%;z-index: 999;text-align: center;color: #ffffff;font-weight: 600;letter-spacing: 1px"
|
204 |
</div>
|
205 |
|
206 |
</div>
|
@@ -219,7 +219,7 @@
|
|
219 |
color: #333333
|
220 |
}
|
221 |
#dirselector li > .handle {
|
222 |
-
background: url("
|
223 |
background-size: 16px;
|
224 |
display: inline-block;
|
225 |
width: 20px;
|
@@ -232,7 +232,7 @@
|
|
232 |
background-size: 16px;
|
233 |
}
|
234 |
#dirselector li.expanded > .handle {
|
235 |
-
background: url("
|
236 |
background-size: 16px;
|
237 |
}
|
238 |
#dirselector ul ul {
|
@@ -358,19 +358,19 @@
|
|
358 |
</tr>
|
359 |
<tr>
|
360 |
<th width="20" class="check-column"><input type="checkbox" class="multicheck"></th>
|
361 |
-
<th
|
362 |
-
<th
|
363 |
-
<th
|
364 |
-
<th width=100
|
365 |
</tr>
|
366 |
</thead>
|
367 |
<tfoot>
|
368 |
<tr>
|
369 |
<th width="20" class="check-column"><input type="checkbox" class="multicheck"></th>
|
370 |
-
<th
|
371 |
-
<th
|
372 |
-
<th
|
373 |
-
<th width=100
|
374 |
</tr>
|
375 |
</tfoot>
|
376 |
<tbody id="__the_list">
|
@@ -477,7 +477,7 @@
|
|
477 |
|
478 |
$('body').on('click', '.slctdir', function(){
|
479 |
WPDM.blockUI('#importarea');
|
480 |
-
$.post(ajaxurl, {action: 'wpdm_select_import_dir', _ids_nonce: '
|
481 |
if(res.success) {
|
482 |
__dim_files.files = res.files;
|
483 |
}
|
184 |
|
185 |
</div>
|
186 |
<div class="panel-footer" id="importstatus">
|
187 |
+
<?php echo esc_attr__( 'Download sample csv file', WPDM_TEXT_DOMAIN ); ?>: <a href="<?php echo plugins_url('/download-manager/assets/sample.csv'); ?>">sample.csv</a>
|
188 |
</div>
|
189 |
</div>
|
190 |
|
200 |
|
201 |
<div class="progress" id="wxprogressbar" style="height: 43px !important;border-radius: 3px !important;margin: 0;position: relative;background: #0d406799;display: none;box-shadow: none">
|
202 |
<div id="wxprogress" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;line-height: 43px;background-color: #007bff"></div>
|
203 |
+
<div class="fetfont" style="font-size:12px;position: absolute;line-height: 43px;height: 43px;width: 100%;z-index: 999;text-align: center;color: #ffffff;font-weight: 600;letter-spacing: 1px"><?php echo esc_attr__( 'Processing', WPDM_TEXT_DOMAIN ); ?>... <span id="wxloaded">0</span>%</div>
|
204 |
</div>
|
205 |
|
206 |
</div>
|
219 |
color: #333333
|
220 |
}
|
221 |
#dirselector li > .handle {
|
222 |
+
background: url("<?php echo WPDM_BASE_URL ?>/assets/images/folder.svg") left center no-repeat;
|
223 |
background-size: 16px;
|
224 |
display: inline-block;
|
225 |
width: 20px;
|
232 |
background-size: 16px;
|
233 |
}
|
234 |
#dirselector li.expanded > .handle {
|
235 |
+
background: url("<?php echo WPDM_BASE_URL ?>/assets/images/folder-o.svg") left center no-repeat;
|
236 |
background-size: 16px;
|
237 |
}
|
238 |
#dirselector ul ul {
|
358 |
</tr>
|
359 |
<tr>
|
360 |
<th width="20" class="check-column"><input type="checkbox" class="multicheck"></th>
|
361 |
+
<th ><?php echo esc_attr__( 'File name', WPDM_TEXT_DOMAIN ); ?></th>
|
362 |
+
<th ><?php echo esc_attr__( 'Title', WPDM_TEXT_DOMAIN ); ?></th>
|
363 |
+
<th ><?php echo esc_attr__( 'Description', WPDM_TEXT_DOMAIN ); ?></th>
|
364 |
+
<th width=100><?php echo esc_attr__( 'Password', WPDM_TEXT_DOMAIN ); ?></th>
|
365 |
</tr>
|
366 |
</thead>
|
367 |
<tfoot>
|
368 |
<tr>
|
369 |
<th width="20" class="check-column"><input type="checkbox" class="multicheck"></th>
|
370 |
+
<th ><?php echo esc_attr__( 'File name', WPDM_TEXT_DOMAIN ); ?></th>
|
371 |
+
<th ><?php echo esc_attr__( 'Title', WPDM_TEXT_DOMAIN ); ?></th>
|
372 |
+
<th ><?php echo esc_attr__( 'Description', WPDM_TEXT_DOMAIN ); ?></th>
|
373 |
+
<th width=100><?php echo esc_attr__( 'Password', WPDM_TEXT_DOMAIN ); ?></th>
|
374 |
</tr>
|
375 |
</tfoot>
|
376 |
<tbody id="__the_list">
|
477 |
|
478 |
$('body').on('click', '.slctdir', function(){
|
479 |
WPDM.blockUI('#importarea');
|
480 |
+
$.post(ajaxurl, {action: 'wpdm_select_import_dir', _ids_nonce: '<?php echo wp_create_nonce(WPDM_PRI_NONCE)?>', importdir: $(this).val()}, function (res){
|
481 |
if(res.success) {
|
482 |
__dim_files.files = res.files;
|
483 |
}
|
src/Admin/views/metaboxes/additional-preview-images.php
CHANGED
@@ -16,7 +16,7 @@ if(!defined("ABSPATH")) die("Shit happens!");
|
|
16 |
?>
|
17 |
<div id='<?php echo ++$mmv; ?>' style='float:left;margin:3px;' class='adp'>
|
18 |
<input type='hidden' id='in_<?php echo $mmv; ?>' name='file[additional_previews][]' value='<?php echo esc_attr($mpv); ?>' />
|
19 |
-
<img style='position:absolute;z-index:9999;cursor:pointer;width: 16px;height: 16px' id='del_<?php echo $mmv; ?>' rel="<?php echo $mmv; ?>" src='
|
20 |
<?php echo $image; ?>
|
21 |
<div style='clear:both'></div>
|
22 |
</div>
|
16 |
?>
|
17 |
<div id='<?php echo ++$mmv; ?>' style='float:left;margin:3px;' class='adp'>
|
18 |
<input type='hidden' id='in_<?php echo $mmv; ?>' name='file[additional_previews][]' value='<?php echo esc_attr($mpv); ?>' />
|
19 |
+
<img style='position:absolute;z-index:9999;cursor:pointer;width: 16px;height: 16px' id='del_<?php echo $mmv; ?>' rel="<?php echo $mmv; ?>" src='<?php echo WPDM_BASE_URL ?>assets/images/delete.svg' class="del_adp" />
|
20 |
<?php echo $image; ?>
|
21 |
<div style='clear:both'></div>
|
22 |
</div>
|
src/Admin/views/metaboxes/attached-files.php
CHANGED
@@ -128,15 +128,15 @@ $fileinfo = get_post_meta($post->ID, '__wpdm_fileinfo', true);
|
|
128 |
<div class="w3eden">
|
129 |
<div class="wpdm-split-container">
|
130 |
<div class="wpdm-sidebar">
|
131 |
-
<input type="text" style="border: 0;border-radius: 0;border-bottom: 1px solid #ccd0d4;" class="form-control input-lg" id="searchfile" placeholder="
|
132 |
<div id="wpdm-attach-files">
|
133 |
<?php foreach ($files as $file_id => $file) { ?>
|
134 |
-
<div class="wpdm-list-item" style="position: relative" data-target="#file_info_
|
135 |
<button type="button" class="btn btn-sm btn-danger show-on-hover" style="position: absolute;right: 20px" rel="del"><i class="fas fa-trash"></i></button>
|
136 |
<div>
|
137 |
-
<input class="faz" type="hidden" value="
|
138 |
-
<strong class="d-block"
|
139 |
-
|
140 |
</div>
|
141 |
</div>
|
142 |
<?php } ?>
|
128 |
<div class="w3eden">
|
129 |
<div class="wpdm-split-container">
|
130 |
<div class="wpdm-sidebar">
|
131 |
+
<input type="text" style="border: 0;border-radius: 0;border-bottom: 1px solid #ccd0d4;" class="form-control input-lg" id="searchfile" placeholder="<?php echo __( 'Search in Attached Files...', 'download-manager' ); ?>" />
|
132 |
<div id="wpdm-attach-files">
|
133 |
<?php foreach ($files as $file_id => $file) { ?>
|
134 |
+
<div class="wpdm-list-item" style="position: relative" data-target="#file_info_<?php echo $file_id ?>">
|
135 |
<button type="button" class="btn btn-sm btn-danger show-on-hover" style="position: absolute;right: 20px" rel="del"><i class="fas fa-trash"></i></button>
|
136 |
<div>
|
137 |
+
<input class="faz" type="hidden" value="<?php echo $file ?>" name="file[files][<?php echo $file_id ?>]" />
|
138 |
+
<strong class="d-block"><?php echo wpdm_valueof($fileinfo, "{$file_id}/title"); ?></strong>
|
139 |
+
<?php echo $file ?>
|
140 |
</div>
|
141 |
</div>
|
142 |
<?php } ?>
|
src/Admin/views/metaboxes/file-info.php
CHANGED
@@ -6,7 +6,7 @@ use WPDM\__\FileSystem;
|
|
6 |
if(!defined("ABSPATH")) die("Shit happens!");
|
7 |
?>
|
8 |
|
9 |
-
<div class="tab-pane hide" id="file_info_
|
10 |
<div class="form-group">
|
11 |
<div class="media">
|
12 |
<div class="pull-left">
|
@@ -89,7 +89,7 @@ if(!defined("ABSPATH")) die("Shit happens!");
|
|
89 |
} ?>
|
90 |
</tr>
|
91 |
<tr>
|
92 |
-
<td colspan="
|
93 |
</tr>
|
94 |
<tr>
|
95 |
<?php foreach ($pre_licenses as $licid => $pre_license) { ?>
|
@@ -104,7 +104,7 @@ if(!defined("ABSPATH")) die("Shit happens!");
|
|
104 |
} ?>
|
105 |
</tr>
|
106 |
<tr>
|
107 |
-
<td colspan="
|
108 |
</tr>
|
109 |
<tr>
|
110 |
<?php
|
6 |
if(!defined("ABSPATH")) die("Shit happens!");
|
7 |
?>
|
8 |
|
9 |
+
<div class="tab-pane hide" id="file_info_<?php echo $id ?>">
|
10 |
<div class="form-group">
|
11 |
<div class="media">
|
12 |
<div class="pull-left">
|
89 |
} ?>
|
90 |
</tr>
|
91 |
<tr>
|
92 |
+
<td colspan="<?php echo count($pre_licenses); ?>"><?php _e('License specific file price:', 'download-manager'); ?></td>
|
93 |
</tr>
|
94 |
<tr>
|
95 |
<?php foreach ($pre_licenses as $licid => $pre_license) { ?>
|
104 |
} ?>
|
105 |
</tr>
|
106 |
<tr>
|
107 |
+
<td colspan="<?php echo count($pre_licenses); ?>"><?php _e('File availability with license pack:', 'download-manager'); ?></td>
|
108 |
</tr>
|
109 |
<tr>
|
110 |
<?php
|
src/Admin/views/metaboxes/file-info.tpl.php
CHANGED
@@ -72,7 +72,7 @@ if(!defined("ABSPATH")) die("Shit happens!");
|
|
72 |
} ?>
|
73 |
</tr>
|
74 |
<tr>
|
75 |
-
<td colspan="
|
76 |
</tr>
|
77 |
<tr>
|
78 |
<?php foreach ($pre_licenses as $licid => $pre_license) { ?>
|
@@ -87,7 +87,7 @@ if(!defined("ABSPATH")) die("Shit happens!");
|
|
87 |
} ?>
|
88 |
</tr>
|
89 |
<tr>
|
90 |
-
<td colspan="
|
91 |
</tr>
|
92 |
<tr>
|
93 |
<?php
|
72 |
} ?>
|
73 |
</tr>
|
74 |
<tr>
|
75 |
+
<td colspan="<?php echo count($pre_licenses); ?>"><?php _e('License specific file price:', 'download-manager'); ?></td>
|
76 |
</tr>
|
77 |
<tr>
|
78 |
<?php foreach ($pre_licenses as $licid => $pre_license) { ?>
|
87 |
} ?>
|
88 |
</tr>
|
89 |
<tr>
|
90 |
+
<td colspan="<?php echo count($pre_licenses); ?>"><?php _e('File availability with license pack:', 'download-manager'); ?></td>
|
91 |
</tr>
|
92 |
<tr>
|
93 |
<?php
|
src/Admin/views/page-header.php
CHANGED
@@ -4,9 +4,9 @@ use WPDM\__\__;
|
|
4 |
|
5 |
if(!defined("ABSPATH")) die("Shit happens!");
|
6 |
?>
|
7 |
-
<link rel="stylesheet" href="
|
8 |
<div id="wpdm-admin-page-header">
|
9 |
-
<div id="wpdm-admin-main-header" class="
|
10 |
<div class="media">
|
11 |
<div class="pull-right">
|
12 |
<?php
|
@@ -43,7 +43,7 @@ if(!defined("ABSPATH")) die("Shit happens!");
|
|
43 |
<div class="media">
|
44 |
<div class="media-body">
|
45 |
<h3>
|
46 |
-
|
47 |
</h3>
|
48 |
</div>
|
49 |
</div>
|
4 |
|
5 |
if(!defined("ABSPATH")) die("Shit happens!");
|
6 |
?>
|
7 |
+
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL ?>/assets/css/settings-ui.css" />
|
8 |
<div id="wpdm-admin-page-header">
|
9 |
+
<div id="wpdm-admin-main-header" class="<?php echo wpdm_valueof($params, 'class')?>">
|
10 |
<div class="media">
|
11 |
<div class="pull-right">
|
12 |
<?php
|
43 |
<div class="media">
|
44 |
<div class="media-body">
|
45 |
<h3>
|
46 |
+
<?php echo __::is_url($icon) ? "<img src='{$icon}' />" : "<i class='fa fa-{$icon}'></i>" ?> <?php echo $title; ?>
|
47 |
</h3>
|
48 |
</div>
|
49 |
</div>
|
src/Admin/views/settings/basic.php
CHANGED
@@ -148,8 +148,8 @@
|
|
148 |
<?php
|
149 |
$allowed_file_types = get_option("__wpdm_allowed_file_types", '');
|
150 |
?>
|
151 |
-
<input type="text" class="form-control" value="
|
152 |
-
placeholder="
|
153 |
name="__wpdm_allowed_file_types"/>
|
154 |
<em><?php _e('Enter the file extensions you want to allow to upload through WPDM ( ex: png,jpg,pdf )', 'download-manager'); ?></em>
|
155 |
<br/>
|
148 |
<?php
|
149 |
$allowed_file_types = get_option("__wpdm_allowed_file_types", '');
|
150 |
?>
|
151 |
+
<input type="text" class="form-control" value="<?php echo $allowed_file_types; ?>"
|
152 |
+
placeholder="<?php echo esc_attr__('Keep empty to use wordpress defaults', 'download-manager'); ?>"
|
153 |
name="__wpdm_allowed_file_types"/>
|
154 |
<em><?php _e('Enter the file extensions you want to allow to upload through WPDM ( ex: png,jpg,pdf )', 'download-manager'); ?></em>
|
155 |
<br/>
|
src/Admin/views/stats.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
$type = wpdm_query_var('type', array('validate' => 'alpha', 'default' => 'history'));
|
3 |
$base_page_uri = "edit.php?post_type=wpdmpro&page=wpdm-stats";
|
4 |
?>
|
5 |
-
<link rel="stylesheet" href="
|
6 |
<div class="wrap w3eden">
|
7 |
|
8 |
<?php
|
2 |
$type = wpdm_query_var('type', array('validate' => 'alpha', 'default' => 'history'));
|
3 |
$base_page_uri = "edit.php?post_type=wpdmpro&page=wpdm-stats";
|
4 |
?>
|
5 |
+
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL ?>/assets/css/settings-ui.css" />
|
6 |
<div class="wrap w3eden">
|
7 |
|
8 |
<?php
|
src/Admin/views/stats/history.php
CHANGED
@@ -122,7 +122,7 @@ $pagination = array(
|
|
122 |
<div class="input-group-addon">
|
123 |
<span class="input-group-text"><?php _e("From Date", "download-manager"); ?>:</span>
|
124 |
</div>
|
125 |
-
<input type="text" name="from_date" value="
|
126 |
</div>
|
127 |
</div>
|
128 |
|
@@ -132,7 +132,7 @@ $pagination = array(
|
|
132 |
<div class="input-group-addon">
|
133 |
<span class="input-group-text"><?php _e("To Date", "download-manager"); ?>:</span>
|
134 |
</div>
|
135 |
-
<input type="text" name="to_date" value="
|
136 |
</div>
|
137 |
</div>
|
138 |
|
@@ -145,7 +145,7 @@ $pagination = array(
|
|
145 |
|
146 |
<select id="user_ids" name="user_ids[]" multiple="multiple" style="width: 100%; height: 100%">
|
147 |
<?php foreach ($selected_users as $u) : ?>
|
148 |
-
<option selected value="
|
149 |
<?php endforeach ?>
|
150 |
</select>
|
151 |
|
@@ -173,7 +173,7 @@ $pagination = array(
|
|
173 |
</div>
|
174 |
<select id="package_ids" name="package_ids[]" multiple="multiple" style="width: 100%; height: 100%">
|
175 |
<?php foreach ($selected_packages as $p) : ?>
|
176 |
-
<option selected value="
|
177 |
<?php endforeach ?>
|
178 |
</select>
|
179 |
<!-- remove package filter -->
|
@@ -190,7 +190,7 @@ $pagination = array(
|
|
190 |
</div>
|
191 |
</div>
|
192 |
<div class="col-md-3">
|
193 |
-
<label class="form-control input-lg" style="border-radius: 0;font-size: 10pt;font-weight: 400"><input type="checkbox" value="1" <?php checked(1, wpdm_query_var('uniq', 'int')); ?> name="uniq">
|
194 |
</div>
|
195 |
|
196 |
|
@@ -200,7 +200,7 @@ $pagination = array(
|
|
200 |
<br/>
|
201 |
<div style="float:right">
|
202 |
<button type="submit" class="btn btn-primary btn-lg"><?php echo __("Filter", "download-manager") ?></button>
|
203 |
-
<a href="edit.php?post_type=wpdmpro&page=wpdm-stats&task=export&__xnonce
|
204 |
<a href="edit.php?post_type=wpdmpro&page=wpdm-stats&type=history" class="btn btn-danger btn-lg"><?php echo __("Reset", "download-manager") ?></a>
|
205 |
</div>
|
206 |
</div>
|
@@ -216,7 +216,7 @@ $pagination = array(
|
|
216 |
|
217 |
|
218 |
<?php if ($count_downloads_without_paging) : ?>
|
219 |
-
<p> <strong>Showing downloads
|
220 |
|
221 |
<!-- Result table -->
|
222 |
<div class="panel panel-default dashboard-panel">
|
@@ -306,14 +306,14 @@ $pagination = array(
|
|
306 |
|
307 |
<!-- SCRIPTS -->
|
308 |
|
309 |
-
<link href="
|
310 |
-
<script src="
|
311 |
<script>
|
312 |
jQuery(function($) {
|
313 |
|
314 |
$(".datepicker").datepicker({
|
315 |
dateFormat: 'yy-mm-dd',
|
316 |
-
minDate: new Date(
|
317 |
maxDate: new Date()
|
318 |
});
|
319 |
|
@@ -328,7 +328,7 @@ $pagination = array(
|
|
328 |
data: function(params) {
|
329 |
return {
|
330 |
action: 'wpdm_stats_get_packages',
|
331 |
-
__spnonce: '
|
332 |
term: params.term, // search term
|
333 |
};
|
334 |
},
|
@@ -348,7 +348,7 @@ $pagination = array(
|
|
348 |
data: function(params) {
|
349 |
return {
|
350 |
action: 'wpdm_stats_get_users',
|
351 |
-
__spnonce: '
|
352 |
term: params.term, // search term
|
353 |
};
|
354 |
},
|
122 |
<div class="input-group-addon">
|
123 |
<span class="input-group-text"><?php _e("From Date", "download-manager"); ?>:</span>
|
124 |
</div>
|
125 |
+
<input type="text" name="from_date" value="<?php echo $selected_from_date->format('Y-m-d') ?>" class="datepicker form-control bg-white text-right" readonly="readonly" />
|
126 |
</div>
|
127 |
</div>
|
128 |
|
132 |
<div class="input-group-addon">
|
133 |
<span class="input-group-text"><?php _e("To Date", "download-manager"); ?>:</span>
|
134 |
</div>
|
135 |
+
<input type="text" name="to_date" value="<?php echo $selected_to_date->format('Y-m-d') ?>" class="datepicker form-control bg-white text-right" readonly="readonly" />
|
136 |
</div>
|
137 |
</div>
|
138 |
|
145 |
|
146 |
<select id="user_ids" name="user_ids[]" multiple="multiple" style="width: 100%; height: 100%">
|
147 |
<?php foreach ($selected_users as $u) : ?>
|
148 |
+
<option selected value="<?php echo $u->ID ?>"> <?php echo $u->display_name . "($u->user_login)" ?> </option>
|
149 |
<?php endforeach ?>
|
150 |
</select>
|
151 |
|
173 |
</div>
|
174 |
<select id="package_ids" name="package_ids[]" multiple="multiple" style="width: 100%; height: 100%">
|
175 |
<?php foreach ($selected_packages as $p) : ?>
|
176 |
+
<option selected value="<?php echo $p->ID ?>"> <?php echo $p->post_title ?> </option>
|
177 |
<?php endforeach ?>
|
178 |
</select>
|
179 |
<!-- remove package filter -->
|
190 |
</div>
|
191 |
</div>
|
192 |
<div class="col-md-3">
|
193 |
+
<label class="form-control input-lg" style="border-radius: 0;font-size: 10pt;font-weight: 400"><input type="checkbox" value="1" <?php checked(1, wpdm_query_var('uniq', 'int')); ?> name="uniq"> <?php echo __( 'Count Unique Downloads Only', 'download-manager' ); ?></label>
|
194 |
</div>
|
195 |
|
196 |
|
200 |
<br/>
|
201 |
<div style="float:right">
|
202 |
<button type="submit" class="btn btn-primary btn-lg"><?php echo __("Filter", "download-manager") ?></button>
|
203 |
+
<a href="edit.php?post_type=wpdmpro&page=wpdm-stats&task=export&__xnonce=<?php echo wp_create_nonce(NONCE_KEY); ?>&hash=<?php echo $hash; ?>" class="btn btn-info btn-lg"><?php echo __("Export", "download-manager") ?></a>
|
204 |
<a href="edit.php?post_type=wpdmpro&page=wpdm-stats&type=history" class="btn btn-danger btn-lg"><?php echo __("Reset", "download-manager") ?></a>
|
205 |
</div>
|
206 |
</div>
|
216 |
|
217 |
|
218 |
<?php if ($count_downloads_without_paging) : ?>
|
219 |
+
<p> <strong>Showing downloads <?php echo $start + 1 ?> - <?php echo $start + count($filtered_result_rows) ?> of total <?php echo $count_downloads_without_paging ?> </strong></p>
|
220 |
|
221 |
<!-- Result table -->
|
222 |
<div class="panel panel-default dashboard-panel">
|
306 |
|
307 |
<!-- SCRIPTS -->
|
308 |
|
309 |
+
<link href="<?php echo WPDM_BASE_URL ?>assets/select2/css/select2.min.css" rel="stylesheet" />
|
310 |
+
<script src="<?php echo WPDM_BASE_URL ?>assets/select2/js/select2.min.js"></script>
|
311 |
<script>
|
312 |
jQuery(function($) {
|
313 |
|
314 |
$(".datepicker").datepicker({
|
315 |
dateFormat: 'yy-mm-dd',
|
316 |
+
minDate: new Date(<?php echo intval($min_timestamp) * 1000 ?>),
|
317 |
maxDate: new Date()
|
318 |
});
|
319 |
|
328 |
data: function(params) {
|
329 |
return {
|
330 |
action: 'wpdm_stats_get_packages',
|
331 |
+
__spnonce: '<?php echo wp_create_nonce(WPDM_PUB_NONCE); ?>',
|
332 |
term: params.term, // search term
|
333 |
};
|
334 |
},
|
348 |
data: function(params) {
|
349 |
return {
|
350 |
action: 'wpdm_stats_get_users',
|
351 |
+
__spnonce: '<?php echo wp_create_nonce(WPDM_PUB_NONCE); ?>',
|
352 |
term: params.term, // search term
|
353 |
};
|
354 |
},
|
src/Admin/views/stats/insight.php
DELETED
@@ -1,256 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$get_params = $_GET;
|
3 |
-
|
4 |
-
global $wp_rewrite, $wp_query, $wpdb;
|
5 |
-
|
6 |
-
$states_table = "{$wpdb->prefix}ahm_download_stats";
|
7 |
-
$posts_table = "{$wpdb->prefix}posts";
|
8 |
-
|
9 |
-
/**
|
10 |
-
* GET Parameters
|
11 |
-
*/
|
12 |
-
$from_date_string = wpdm_query_var('from_date'); // format Y-m-d 2020-05-31
|
13 |
-
$to_date_string = wpdm_query_var('to_date');
|
14 |
-
$pid = wpdm_query_var('pid', 'int');
|
15 |
-
$uid = wpdm_query_var('uid', 'int');
|
16 |
-
|
17 |
-
$min_timestamp = $wpdb->get_var("select min(timestamp) from $states_table") ?: time();
|
18 |
-
|
19 |
-
// DateTime Objects
|
20 |
-
$selected_from_date = $from_date_string ? new DateTime($from_date_string) : (new DateTime())->setTimestamp($min_timestamp);
|
21 |
-
$selected_to_date = $to_date_string ? (new DateTime($to_date_string)) : (new DateTime())->setTimestamp(time());
|
22 |
-
// we need to get the timestamp of the end of selected to_date
|
23 |
-
$selected_to_date->modify('tomorrow');
|
24 |
-
$end_of_selected_to_date_timestamp = $selected_to_date->getTimestamp() - 1;
|
25 |
-
$selected_to_date->setTimestamp($end_of_selected_to_date_timestamp);
|
26 |
-
//pd($selected_to_date->getTimestamp());
|
27 |
-
|
28 |
-
$timestamp_filter = "s.timestamp >= {$selected_from_date->getTimestamp()} and s.timestamp <= {$selected_to_date->getTimestamp()}";
|
29 |
-
$pid_filter = ($pid > 0) ? " and s.pid = '{$pid}'" : "";
|
30 |
-
$uid_filter = ($uid > 0) ? " and s.uid = '{$uid}'" : "";
|
31 |
-
|
32 |
-
$items_per_page = 30;
|
33 |
-
$start = isset($_GET['page_no']) ? ((int)$_GET['page_no'] - 1) * $items_per_page : 0;
|
34 |
-
|
35 |
-
//pd($selected_from_date->getTimestamp());
|
36 |
-
$limit = 10;
|
37 |
-
$top_packages = $wpdb->get_results("select p.post_title, s.pid, count(s.pid) as total_downloaded from $posts_table p, $states_table s where s.pid = p.ID
|
38 |
-
and {$timestamp_filter}
|
39 |
-
group by s.pid
|
40 |
-
order by `total_downloaded` desc limit $limit ");
|
41 |
-
|
42 |
-
$top_users = $wpdb->get_results("select s.uid, count(s.pid) as total_downloaded from $states_table s
|
43 |
-
where {$timestamp_filter}
|
44 |
-
group by s.uid
|
45 |
-
order by `total_downloaded` desc limit $limit ");
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
$top_packages_array = [];
|
50 |
-
foreach ($top_packages as $p) {
|
51 |
-
array_push($top_packages_array, [$p->post_title, intval($p->total_downloaded)]);
|
52 |
-
}
|
53 |
-
//pd($top_packages_array);
|
54 |
-
|
55 |
-
?>
|
56 |
-
|
57 |
-
<form method="get" action="<?php echo admin_url('edit.php'); ?>">
|
58 |
-
|
59 |
-
<!-- hidden fields. Necessary for navigating this page -->
|
60 |
-
<input type="hidden" name="post_type" value="wpdmpro" />
|
61 |
-
<input type="hidden" name="page" value="wpdm-stats" />
|
62 |
-
<input type="hidden" name="type" value="insight" />
|
63 |
-
|
64 |
-
|
65 |
-
<!-- Top filters -->
|
66 |
-
<div class="row">
|
67 |
-
|
68 |
-
<!-- From date -->
|
69 |
-
<div class="col-md-3">
|
70 |
-
<div class="input-group input-group-lg">
|
71 |
-
<div class="input-group-addon">
|
72 |
-
<span class="input-group-text"><?php _e("From Date", "download-manager"); ?>:</span>
|
73 |
-
</div>
|
74 |
-
<input type="text" name="from_date" value="<?= $selected_from_date->format('Y-m-d') ?>" class="datepicker form-control bg-white text-right" readonly="readonly" />
|
75 |
-
</div>
|
76 |
-
</div>
|
77 |
-
|
78 |
-
<!-- To date -->
|
79 |
-
<div class="col-md-3">
|
80 |
-
<div class="input-group input-group-lg">
|
81 |
-
<div class="input-group-addon">
|
82 |
-
<span class="input-group-text"><?php _e("To Date", "download-manager"); ?>:</span>
|
83 |
-
</div>
|
84 |
-
<input type="text" name="to_date" value="<?= $selected_to_date->format('Y-m-d') ?>" class="datepicker form-control bg-white text-right" readonly="readonly" />
|
85 |
-
</div>
|
86 |
-
</div>
|
87 |
-
|
88 |
-
<!-- Filter submit button -->
|
89 |
-
<div class="col-md-2">
|
90 |
-
<div class="btn-group">
|
91 |
-
<button type="submit" class="btn btn-primary btn-lg"><?php echo __("Filter", "download-manager") ?></button>
|
92 |
-
<a href="edit.php?post_type=wpdmpro&page=wpdm-stats&type=insight" class="btn btn-danger btn-lg"><?php echo __("Reset", "download-manager") ?></a>
|
93 |
-
</div>
|
94 |
-
</div>
|
95 |
-
</div>
|
96 |
-
</form>
|
97 |
-
|
98 |
-
|
99 |
-
<div class="row" style="margin-top: 20px;">
|
100 |
-
|
101 |
-
</div>
|
102 |
-
<div class="row" style="margin-top: 20px;">
|
103 |
-
<section class="col-md-6">
|
104 |
-
<div class="panel panel-default dashboard-panel">
|
105 |
-
<div class="panel-heading">
|
106 |
-
<?= esc_attr__( 'Top Packages', WPDM_TEXT_DOMAIN ); ?>
|
107 |
-
</div>
|
108 |
-
<table class="table table-striped">
|
109 |
-
<thead>
|
110 |
-
<tr>
|
111 |
-
<th class="bg-white"><?php _e("Package Name", "download-manager"); ?></th>
|
112 |
-
<th class="bg-white"><?php _e("Downloaded", "download-manager"); ?></th>
|
113 |
-
</tr>
|
114 |
-
</thead>
|
115 |
-
<tbody>
|
116 |
-
<?php foreach ($top_packages as $package) : ?>
|
117 |
-
<tr>
|
118 |
-
<!-- Package -->
|
119 |
-
<td>
|
120 |
-
<a title='View this package' class='ttip' href="<?php echo get_permalink($package->pid); ?>">
|
121 |
-
<?php echo $package->post_title; ?>
|
122 |
-
</a>
|
123 |
-
<div class="show-on-hover pull-right">
|
124 |
-
<a target='_blank' href="post.php?action=edit&post=<?php echo $package->pid; ?>" title='Edit Package' class='ttip'>
|
125 |
-
<i class="fas fa-pen-square"></i>
|
126 |
-
</a>
|
127 |
-
—
|
128 |
-
<a target='_blank' href="<?php echo get_permalink($package->pid); ?>" title='View Package' class='ttip'>
|
129 |
-
<i class="fas fa-eye"></i>
|
130 |
-
</a>
|
131 |
-
</div>
|
132 |
-
</td>
|
133 |
-
<td>
|
134 |
-
<?= $package->total_downloaded . ' times' ?>
|
135 |
-
</td>
|
136 |
-
</tr>
|
137 |
-
<?php endforeach ?>
|
138 |
-
|
139 |
-
</tbody>
|
140 |
-
</table>
|
141 |
-
</div>
|
142 |
-
</section>
|
143 |
-
|
144 |
-
<section class="col-md-6">
|
145 |
-
<div class="panel panel-default">
|
146 |
-
<div class="panel-body">
|
147 |
-
<div id="top-packages-chart" style="min-height: 400px;"></div>
|
148 |
-
</div>
|
149 |
-
</div>
|
150 |
-
</section>
|
151 |
-
</div>
|
152 |
-
|
153 |
-
<div class="row">
|
154 |
-
<!-- Top Users -->
|
155 |
-
<section class="col-md-12">
|
156 |
-
<div class="panel panel-default dashboard-panel">
|
157 |
-
<div class="panel-heading">
|
158 |
-
<?= esc_attr__( 'Top Users', WPDM_TEXT_DOMAIN ); ?>
|
159 |
-
</div>
|
160 |
-
<table class="table table-striped">
|
161 |
-
<thead>
|
162 |
-
<tr>
|
163 |
-
<th class="bg-white"><?php _e("User name", "download-manager"); ?></th>
|
164 |
-
<th class="bg-white"><?php _e("Downloaded", "download-manager"); ?></th>
|
165 |
-
<th class="bg-white"><?php _e("Last Active", "download-manager"); ?></th>
|
166 |
-
</tr>
|
167 |
-
</thead>
|
168 |
-
<tbody>
|
169 |
-
<?php foreach ($top_users as $user) : ?>
|
170 |
-
<?php
|
171 |
-
$display_name = 'Guest';
|
172 |
-
if ($user->uid > 0) {
|
173 |
-
$u = get_user_by('id', $user->uid);
|
174 |
-
if (is_object($u))
|
175 |
-
$display_name = $u->display_name;
|
176 |
-
else
|
177 |
-
$display_name = esc_attr__( '[ Deleted User ]', 'download-manager' );
|
178 |
-
}
|
179 |
-
?>
|
180 |
-
<tr>
|
181 |
-
<!-- Package -->
|
182 |
-
<td>
|
183 |
-
<a title='View this package' class='ttip' href="#">
|
184 |
-
<?php echo $display_name; ?>
|
185 |
-
</a>
|
186 |
-
</td>
|
187 |
-
<td>
|
188 |
-
<?= $user->total_downloaded . ' times' ?>
|
189 |
-
</td>
|
190 |
-
<td>
|
191 |
-
<?= wp_date( get_option('date_format'), get_user_meta($user->uid, '__wpdm_last_login_time', true) ); ?>
|
192 |
-
</td>
|
193 |
-
</tr>
|
194 |
-
<?php endforeach ?>
|
195 |
-
|
196 |
-
</tbody>
|
197 |
-
</table>
|
198 |
-
</div>
|
199 |
-
</section>
|
200 |
-
|
201 |
-
<section class="col-md-5">
|
202 |
-
<div id="top-users-chart"></div>
|
203 |
-
|
204 |
-
</section>
|
205 |
-
</div>
|
206 |
-
|
207 |
-
<style>
|
208 |
-
.w3eden .panel th.bg-white {
|
209 |
-
background: #ffffff !important;
|
210 |
-
}
|
211 |
-
</style>
|
212 |
-
|
213 |
-
<script>
|
214 |
-
jQuery(function($) {
|
215 |
-
$(".datepicker").datepicker({
|
216 |
-
dateFormat: 'yy-mm-dd',
|
217 |
-
minDate: new Date(<?= intval($min_timestamp) * 1000 ?>),
|
218 |
-
maxDate: new Date()
|
219 |
-
});
|
220 |
-
});
|
221 |
-
</script>
|
222 |
-
|
223 |
-
|
224 |
-
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
225 |
-
<script type="text/javascript">
|
226 |
-
google.charts.load('current', {
|
227 |
-
'packages': ['bar']
|
228 |
-
});
|
229 |
-
google.charts.setOnLoadCallback(drawChart);
|
230 |
-
|
231 |
-
function drawChart() {
|
232 |
-
var data = new google.visualization.DataTable();
|
233 |
-
data.addColumn('string', '<?=esc_attr__( 'Package Name', 'download-manager' );?>');
|
234 |
-
data.addColumn('number', '<?=esc_attr__( 'Downloads', 'download-manager' ); ?>');
|
235 |
-
data.addRows(<?= json_encode($top_packages_array) ?>);
|
236 |
-
|
237 |
-
var options = {
|
238 |
-
title: "<?=esc_attr__( 'Top Packages', 'download-manager' );?>",
|
239 |
-
width: "50%",
|
240 |
-
curveType: 'function',
|
241 |
-
bars: 'horizontal',
|
242 |
-
bar: {
|
243 |
-
groupWidth: "90%"
|
244 |
-
},
|
245 |
-
legend: {
|
246 |
-
position: 'bottom'
|
247 |
-
},
|
248 |
-
backgroundColor: {
|
249 |
-
fill: '#ffffff'
|
250 |
-
}
|
251 |
-
};
|
252 |
-
|
253 |
-
var chart = new google.charts.Bar(document.getElementById('top-packages-chart'));
|
254 |
-
chart.draw(data, options);
|
255 |
-
}
|
256 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/stats/overview.php
DELETED
@@ -1,174 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
global $wpdb;
|
3 |
-
$db_table_name = "{$wpdb->prefix}ahm_download_stats";
|
4 |
-
|
5 |
-
//minimum year data available in the db
|
6 |
-
$min_year = $wpdb->get_var("select min(year) as my from $db_table_name");
|
7 |
-
|
8 |
-
$pid = isset($_GET['pid']) && $_GET['pid'] != '' ? intval($_GET['pid']) : null;
|
9 |
-
$pid_filter = $pid ? '1 and pid=' . $pid : '1';
|
10 |
-
|
11 |
-
if ($pid) {
|
12 |
-
$package = get_post($pid);
|
13 |
-
}
|
14 |
-
|
15 |
-
$current_month = date("m");
|
16 |
-
$current_year = date("Y");
|
17 |
-
$current_day = date("d");
|
18 |
-
|
19 |
-
$selected_month = isset($_GET['m']) ? intval($_GET['m']) : $current_month;
|
20 |
-
$selected_year = isset($_GET['y']) ? intval($_GET['y']) : $current_year;
|
21 |
-
|
22 |
-
$total_downloads = $wpdb->get_var("select count(id) as total from $db_table_name where $pid_filter");
|
23 |
-
$total_downloads_month = $wpdb->get_var("select count(id) as total from $db_table_name where $pid_filter and `month` = {$selected_month} and `year` = {$selected_year}");
|
24 |
-
$total_downloads_year = $wpdb->get_var("select count(id) as total from $db_table_name where $pid_filter and `year` = {$selected_year}");
|
25 |
-
$total_downloads_date = $wpdb->get_var("select count(id) as total from $db_table_name where $pid_filter and `day` = {$current_day} and `month` = {$selected_month} and `year` = {$selected_year}");
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Data for charts
|
29 |
-
*/
|
30 |
-
$data = $wpdb->get_results("select day,count(day) as downloads from $db_table_name where year = {$selected_year} and month= {$selected_month} and $pid_filter group by day");
|
31 |
-
|
32 |
-
$full_month_data_array = [];
|
33 |
-
// fill with empty values
|
34 |
-
for ($i = 1; $i <= 31; $i++) {
|
35 |
-
$full_month_data_array[$i] = array($i, 0);
|
36 |
-
}
|
37 |
-
|
38 |
-
//fill with actual data
|
39 |
-
foreach ($data as $dd) {
|
40 |
-
$full_month_data_array[$dd->day] = [
|
41 |
-
intval($dd->day),
|
42 |
-
intval($dd->downloads)
|
43 |
-
];
|
44 |
-
}
|
45 |
-
|
46 |
-
$full_month_data_array = array_values($full_month_data_array);
|
47 |
-
|
48 |
-
//pd($full_month_json_data);
|
49 |
-
|
50 |
-
?>
|
51 |
-
<?php if (isset($package)) : ?>
|
52 |
-
<div class="panel panel-default">
|
53 |
-
<div class="panel-body">
|
54 |
-
<?php echo "<b>Package: " . $package->post_title . "</b>"; ?>
|
55 |
-
</div>
|
56 |
-
</div>
|
57 |
-
<?php endif; ?>
|
58 |
-
|
59 |
-
<div class="row">
|
60 |
-
|
61 |
-
<!-- downloads today -->
|
62 |
-
<?php if ($current_month == $selected_month && $current_year == $selected_year) : ?>
|
63 |
-
<div class="col-md-3">
|
64 |
-
<div class="panel panel-default text-center">
|
65 |
-
<div class="panel-body">
|
66 |
-
<h2><?php echo $total_downloads_date; ?></h2>
|
67 |
-
</div>
|
68 |
-
<div class="panel-footer">
|
69 |
-
<?= __('Today\'s downloads', 'download-manager'); ?>
|
70 |
-
</div>
|
71 |
-
</div>
|
72 |
-
</div>
|
73 |
-
<?php endif ?>
|
74 |
-
|
75 |
-
<!-- downloads this month -->
|
76 |
-
<div class="col-md-3">
|
77 |
-
<div class="panel panel-default text-center">
|
78 |
-
<div class="panel-body">
|
79 |
-
<h2><?php echo $total_downloads_month; ?></h2>
|
80 |
-
</div>
|
81 |
-
<div class="panel-footer">
|
82 |
-
<?php echo wpdm_query_var('m') ? date("F, {$selected_year}", mktime(0, 0, 0, $selected_month, 10)) : __('This month', 'download-manager'); ?>
|
83 |
-
</div>
|
84 |
-
</div>
|
85 |
-
</div>
|
86 |
-
|
87 |
-
<!-- downloads this year -->
|
88 |
-
<div class="col-md-3">
|
89 |
-
<div class="panel panel-default text-center">
|
90 |
-
<div class="panel-body">
|
91 |
-
<h2><?php echo $total_downloads_year; ?></h2>
|
92 |
-
</div>
|
93 |
-
<div class="panel-footer">
|
94 |
-
<?php echo wpdm_query_var('y') ? "Year {$selected_year}" : __('This year', 'download-manager'); ?>
|
95 |
-
</div>
|
96 |
-
</div>
|
97 |
-
</div>
|
98 |
-
|
99 |
-
<!-- Total downloads -->
|
100 |
-
<div class="col-md-3">
|
101 |
-
<div class="panel panel-default text-center">
|
102 |
-
<div class="panel-body">
|
103 |
-
<h2><?php echo $total_downloads; ?></h2>
|
104 |
-
</div>
|
105 |
-
<div class="panel-footer">
|
106 |
-
<?php _e('Total Downloads', 'download-manager'); ?>
|
107 |
-
</div>
|
108 |
-
</div>
|
109 |
-
</div>
|
110 |
-
</div>
|
111 |
-
|
112 |
-
|
113 |
-
<div class="panel panel-default">
|
114 |
-
<!-- chart -->
|
115 |
-
<div id="monthlyoverview" class="panel-body" style="height: 500px"></div>
|
116 |
-
|
117 |
-
<!-- Filters form -->
|
118 |
-
<div class="panel-footer text-center">
|
119 |
-
<form method="get" action="edit.php">
|
120 |
-
<!-- hidden fields -->
|
121 |
-
<input type="hidden" name="post_type" value="wpdmpro">
|
122 |
-
<input type="hidden" name="page" value="wpdm-stats">
|
123 |
-
|
124 |
-
<!-- YEAR selection -->
|
125 |
-
Year:
|
126 |
-
<select name="y" class="form-control wpdm-custom-select" style="width: 80px; min-width: 60px;display: inline;">
|
127 |
-
<?php for ($i = $min_year; $i <= date('Y'); $i++) {
|
128 |
-
$selected = $selected_year == $i ? 'selected=selected' : '';
|
129 |
-
echo "<option $selected value='{$i}'>{$i}</option>";
|
130 |
-
} ?>
|
131 |
-
</select>
|
132 |
-
|
133 |
-
<!-- MONTH selection -->
|
134 |
-
Month: <select class="form-control wpdm-custom-select" name="m" style="min-width: 145px;width: 60px;display: inline;">
|
135 |
-
<?php for ($i = 1; $i <= 12; $i++) {
|
136 |
-
$selected = $selected_month == $i ? 'selected=selected' : '';
|
137 |
-
$month_name = date("F", mktime(0, 0, 0, $i, 10));
|
138 |
-
echo "<option $selected value='{$i}'>{$month_name}</option>";
|
139 |
-
} ?>
|
140 |
-
</select>
|
141 |
-
<input type="submit" class="btn btn-secondary" value="Submit">
|
142 |
-
|
143 |
-
</form>
|
144 |
-
</div>
|
145 |
-
</div>
|
146 |
-
|
147 |
-
|
148 |
-
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
149 |
-
<script type="text/javascript">
|
150 |
-
google.charts.load('current', {
|
151 |
-
'packages': ['corechart']
|
152 |
-
});
|
153 |
-
google.charts.setOnLoadCallback(drawChart);
|
154 |
-
|
155 |
-
function drawChart() {
|
156 |
-
var data = new google.visualization.DataTable();
|
157 |
-
data.addColumn('number', 'Date');
|
158 |
-
data.addColumn('number', 'Downloads');
|
159 |
-
data.addRows(<?= json_encode($full_month_data_array); ?>);
|
160 |
-
|
161 |
-
var options = {
|
162 |
-
curveType: 'function',
|
163 |
-
legend: {
|
164 |
-
position: 'bottom'
|
165 |
-
},
|
166 |
-
backgroundColor: {
|
167 |
-
fill: '#ffffff'
|
168 |
-
}
|
169 |
-
};
|
170 |
-
|
171 |
-
var chart = new google.visualization.AreaChart(document.getElementById('monthlyoverview'));
|
172 |
-
chart.draw(data, options);
|
173 |
-
}
|
174 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/stats/pvdaud.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<style type="text/css">
|
2 |
-
.stable {
|
3 |
-
border-top:1px solid #888;
|
4 |
-
border-left:1px solid #888;
|
5 |
-
}
|
6 |
-
.stable td,.stable th{
|
7 |
-
border-bottom:1px solid #888;
|
8 |
-
border-right:1px solid #888;
|
9 |
-
padding:3px;
|
10 |
-
}
|
11 |
-
|
12 |
-
</style><?php
|
13 |
-
if(!defined("ABSPATH")) die("Shit happens!");
|
14 |
-
global $wpdb;
|
15 |
-
$my = $wpdb->get_var("select min(year) as my from {$wpdb->prefix}ahm_download_stats");
|
16 |
-
|
17 |
-
$d = isset($_GET['d'])?(int)$_GET['d']:date('d');
|
18 |
-
$m = isset($_GET['m'])?(int)$_GET['m']:date('n');
|
19 |
-
$y = isset($_GET['y'])?(int)$_GET['y']:date('Y');
|
20 |
-
$file = wpdm_query_var('pid', ['validate' => 'int']);
|
21 |
-
$fd = $wpdb->get_row("select * from {$wpdb->prefix}posts where id='$file'",ARRAY_A);
|
22 |
-
$data = $wpdb->get_results("select * from {$wpdb->prefix}ahm_download_stats where pid='$file' and `year`='$y' and `month`='$m' and `day`='$d'",ARRAY_A);
|
23 |
-
?>
|
24 |
-
<b>Package: <?php echo $fd['post_title']; ?></b><br>
|
25 |
-
<form method="get" action="edit.php">
|
26 |
-
<input type="hidden" name="post_type" value="wpdmpro">
|
27 |
-
<input type="hidden" name="page" value="wpdm-stats">
|
28 |
-
<input type="hidden" name="type" value="pvdaud">
|
29 |
-
Package ID: <input style="width: 80px" type="text" name="pid" value="<?php echo $file;?>">
|
30 |
-
Year:
|
31 |
-
<select name="y">
|
32 |
-
<?php for($i=$my;$i<=date('Y');$i++) { $sel = $y==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
33 |
-
</select>
|
34 |
-
Month: <select name="m">
|
35 |
-
<?php for($i=1;$i<=12;$i++) { $sel = $m==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
36 |
-
</select>
|
37 |
-
Day: <select name="d">
|
38 |
-
<?php for($i=1;$i<=31;$i++) { $sel = $d==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
39 |
-
</select>
|
40 |
-
<input type="submit" class="button-secondary" value="Submit">
|
41 |
-
|
42 |
-
</form>
|
43 |
-
<br>
|
44 |
-
<table class='table table-bordered' width="100%" cellspacing="0">
|
45 |
-
<tr>
|
46 |
-
<th align="left">User</th>
|
47 |
-
<th align="left">Date/Time</th>
|
48 |
-
<th align="left">IP</th>
|
49 |
-
</tr>
|
50 |
-
<?php
|
51 |
-
foreach($data as $d){
|
52 |
-
?>
|
53 |
-
<tr>
|
54 |
-
<td><?php echo $wpdb->get_var("select user_login from {$wpdb->prefix}users where ID='$d[uid]'"); ?></td>
|
55 |
-
<td><?php echo date("M d,Y H:i:s",$d['timestamp']); ?></td>
|
56 |
-
<td><?php echo $d['ip']; ?></td>
|
57 |
-
</tr>
|
58 |
-
<?php
|
59 |
-
}
|
60 |
-
?>
|
61 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/stats/pvdpu.php
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<style type="text/css">
|
2 |
-
.stable {
|
3 |
-
border-top:1px solid #888;
|
4 |
-
border-left:1px solid #888;
|
5 |
-
}
|
6 |
-
.stable td,.stable th{
|
7 |
-
border-bottom:1px solid #888;
|
8 |
-
border-right:1px solid #888;
|
9 |
-
padding:3px;
|
10 |
-
}
|
11 |
-
</style>
|
12 |
-
<?php
|
13 |
-
if(!defined("ABSPATH")) die("Shit happens!");
|
14 |
-
global $wpdb;
|
15 |
-
$my = $wpdb->get_var("select min(year) as my from {$wpdb->prefix}ahm_download_stats");
|
16 |
-
|
17 |
-
$uid = isset($_GET['uid'])&&$_GET['uid']!='all'?" uid='".intval($_GET['uid'])."' and":'';
|
18 |
-
$m = isset($_GET['m'])?intval($_GET['m']):date('n');
|
19 |
-
$y = isset($_GET['y'])?intval($_GET['y']):date('Y');
|
20 |
-
?>
|
21 |
-
<form method="get" action="edit.php">
|
22 |
-
<input type="hidden" name="post_type" value="wpdmpro">
|
23 |
-
<input type="hidden" name="page" value="wpdm-stats">
|
24 |
-
<input type="hidden" name="type" value="pvdpu">
|
25 |
-
User ID: <input style="width: 60px" type="text" name="uid" value="<?php echo isset($_GET['uid'])?esc_attr($_GET['uid']):'all';?>">
|
26 |
-
Year:
|
27 |
-
<select name="y">
|
28 |
-
<?php for($i=$my;$i<=date('Y');$i++) { $sel = $y==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
29 |
-
</select>
|
30 |
-
Month: <select name="m">
|
31 |
-
<?php for($i=1;$i<=12;$i++) { $sel = $m==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
32 |
-
</select>
|
33 |
-
<input type="submit" class="button-secondary" value="Submit">
|
34 |
-
|
35 |
-
</form>
|
36 |
-
<br>
|
37 |
-
|
38 |
-
<?php
|
39 |
-
|
40 |
-
$files = $wpdb->get_results("select ID, post_title from {$wpdb->prefix}posts where post_type='wpdmpro' and post_status='publish'",ARRAY_A);
|
41 |
-
$dates = $wpdb->get_results("select *, concat(year,month,day) as dt from {$wpdb->prefix}ahm_download_stats where $uid `year`='$y' and `month`='$m' group by dt order by timestamp asc",ARRAY_A);
|
42 |
-
echo "<table class='table table-bordered table-hover' width=100% cellspacing=0>" ;
|
43 |
-
echo "<tr><th>PACKAGE/DATE</th>";
|
44 |
-
foreach($dates as $date){
|
45 |
-
echo "<th><a href='edit.php?post_type=wpdmpro&page=wpdm-stats&type=pvupd&y={$date['year']}&m={$date['month']}&d={$date['day']}'>".date("d",$date['timestamp'])."</a></th>";
|
46 |
-
|
47 |
-
}
|
48 |
-
echo "</tr>";
|
49 |
-
foreach($files as $file){
|
50 |
-
echo "<tr><th align=left>{$file['post_title']}</th>";
|
51 |
-
foreach($dates as $date){
|
52 |
-
|
53 |
-
$fstats[$file['ID']][$date['dt']] = $wpdb->get_var("select count(*) from {$wpdb->prefix}ahm_download_stats where concat(year,month,day)='{$date['dt']}' and pid='{$file['ID']}'");
|
54 |
-
if($fstats[$file['ID']][$date['dt']]>0)
|
55 |
-
echo "<td class='info' title='".$fstats[$file['ID']][$date['dt']]." downloads' align=center><a href='edit.php?post_type=wpdmpro&page=wpdm-stats&type=pvdaud&pid={$file['ID']}&y={$date['year']}&m={$date['month']}&d={$date['day']}'>".$fstats[$file['ID']][$date['dt']]."</a></td>";
|
56 |
-
else
|
57 |
-
echo "<td align=center>".$fstats[$file['ID']][$date['dt']]."</td>";
|
58 |
-
|
59 |
-
}
|
60 |
-
echo "</tr>";
|
61 |
-
}
|
62 |
-
echo "</table>" ;
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/stats/pvupd.php
DELETED
@@ -1,100 +0,0 @@
|
|
1 |
-
<style type="text/css">
|
2 |
-
.stable {
|
3 |
-
border-top:1px solid #888;
|
4 |
-
border-left:1px solid #888;
|
5 |
-
}
|
6 |
-
.stable td,.stable th{
|
7 |
-
border-bottom:1px solid #888;
|
8 |
-
border-right:1px solid #888;
|
9 |
-
padding:3px;
|
10 |
-
}
|
11 |
-
</style>
|
12 |
-
<?php
|
13 |
-
if(!defined("ABSPATH")) die("Shit happens!");
|
14 |
-
global $wpdb;
|
15 |
-
$my = $wpdb->get_var("select min(year) as my from {$wpdb->prefix}ahm_download_stats");
|
16 |
-
|
17 |
-
$uid = isset($_GET['uid'])?intval($_GET['uid']):1;
|
18 |
-
$m = isset($_GET['m'])?intval($_GET['m']):date('n');
|
19 |
-
$d = isset($_GET['d'])?intval($_GET['d']):date('d');
|
20 |
-
$y = isset($_GET['y'])?intval($_GET['y']):date('Y');
|
21 |
-
?>
|
22 |
-
<form method="get" action="edit.php">
|
23 |
-
<input type="hidden" name="post_type" value="wpdmpro">
|
24 |
-
<input type="hidden" name="page" value="wpdm-stats">
|
25 |
-
<input type="hidden" name="type" value="pvupd">
|
26 |
-
Year:
|
27 |
-
<select name="y">
|
28 |
-
<?php for($i=$my;$i<=date('Y');$i++) { $sel = $y==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
29 |
-
</select>
|
30 |
-
Month: <select name="m">
|
31 |
-
<?php for($i=1;$i<=12;$i++) { $sel = $m==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
32 |
-
</select>
|
33 |
-
Day: <select name="d">
|
34 |
-
<?php for($i=1;$i<=31;$i++) { $sel = $d==$i?'selected=selected':''; echo "<option $sel value='{$i}'>{$i}</option>";} ?>
|
35 |
-
</select>
|
36 |
-
<input type="submit" class="button-secondary" value="Submit">
|
37 |
-
|
38 |
-
</form>
|
39 |
-
<br>
|
40 |
-
|
41 |
-
<?php
|
42 |
-
|
43 |
-
$limit = 10;
|
44 |
-
$cp = isset($_GET['paged'])?(int)$_GET['paged']:1;
|
45 |
-
$start = ($cp-1)*$limit;
|
46 |
-
$wpdb->show_errors();
|
47 |
-
$tusers = $wpdb->get_var("select count(s.id) as td from {$wpdb->prefix}users u,{$wpdb->prefix}ahm_download_stats s where `s`.`day`='$d' and `s`.`month`='$m' and `s`.`year`='$y' and u.ID=s.uid group by s.uid");
|
48 |
-
$users = $wpdb->get_results("select u.*,count(s.id) as td from {$wpdb->prefix}users u,{$wpdb->prefix}ahm_download_stats s where `s`.`day`='$d' and `s`.`month`='$m' and `s`.`year`='$y' and u.ID=s.uid group by ID limit $start, $limit",ARRAY_A);
|
49 |
-
$files = $wpdb->get_results("select f.*,count(s.id) as td from {$wpdb->prefix}posts f,{$wpdb->prefix}ahm_download_stats s where `s`.`day`='$d' and `s`.`month`='$m' and `s`.`year`='$y' and `s`.`pid`=`f`.`ID` and `f`.`post_type`='wpdmpro' group by `f`.`ID`",ARRAY_A);
|
50 |
-
$d = isset($_GET['d'])?intval($_GET['d']):date('d');
|
51 |
-
$m = isset($_GET['m'])?intval($_GET['m']):date('n');
|
52 |
-
$y = isset($_GET['y'])?intval($_GET['y']):date('Y');
|
53 |
-
echo "<table class='table table-bordered' width=100% cellspacing=0>" ;
|
54 |
-
echo "<tr><th>PACKAGE/USER</th>";
|
55 |
-
foreach($users as $user){
|
56 |
-
if($user['td']>0){
|
57 |
-
echo "<th>".$user['user_login']."</th>";
|
58 |
-
$dusers[] = $user;
|
59 |
-
}
|
60 |
-
|
61 |
-
}
|
62 |
-
|
63 |
-
echo "</tr>";
|
64 |
-
foreach($files as $file){
|
65 |
-
echo "<tr><th align=left>{$file['post_title']}</th>";
|
66 |
-
if($dusers){
|
67 |
-
foreach($dusers as $user){
|
68 |
-
|
69 |
-
$fstats[$file['ID']][$user['ID']] = $wpdb->get_var("select count(*) from {$wpdb->prefix}ahm_download_stats where `year`='{$y}' and `month`='{$m}' and `day`='{$d}' and pid='{$file['ID']}' and uid='{$user['ID']}'");
|
70 |
-
echo "<td align=center>".$fstats[$file['ID']][$user['ID']]."</td>";
|
71 |
-
|
72 |
-
}}
|
73 |
-
echo "</tr>";
|
74 |
-
}
|
75 |
-
echo "</table>" ;
|
76 |
-
|
77 |
-
|
78 |
-
$page_links = paginate_links( array(
|
79 |
-
'base' => add_query_arg( 'paged', '%#%' ),
|
80 |
-
'format' => '',
|
81 |
-
'prev_text' => __('«'),
|
82 |
-
'next_text' => __('»'),
|
83 |
-
'total' => ceil($tusers/$limit),
|
84 |
-
'current' => $cp
|
85 |
-
));
|
86 |
-
|
87 |
-
?>
|
88 |
-
<?php if ( $page_links ) { ?>
|
89 |
-
<div class="tablenav">
|
90 |
-
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s users' ) . '</span>%s',
|
91 |
-
number_format_i18n( ( $cp - 1 ) * $limit + 1 ),
|
92 |
-
number_format_i18n( min( $cp * $limit, $tusers ) ),
|
93 |
-
number_format_i18n( $tusers ),
|
94 |
-
$page_links
|
95 |
-
); echo $page_links_text; ?></div>
|
96 |
-
</div>
|
97 |
-
<?php } ?>
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/stats/today.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
|
2 |
-
<?php
|
3 |
-
global $wpdb;
|
4 |
-
$data = $wpdb->get_results("select day,count(day) as downloads from {$wpdb->prefix}ahm_download_stats where year='".date('Y')."' and month='".date('m')."' group by day");
|
5 |
-
$d = array_fill(1,31,0);
|
6 |
-
foreach($data as $dd){
|
7 |
-
$d[$dd->day] = $dd->downloads;
|
8 |
-
}
|
9 |
-
|
10 |
-
?>
|
11 |
-
<style type="text/css">
|
12 |
-
#holder{
|
13 |
-
float:left;
|
14 |
-
background: #000;
|
15 |
-
margin:30px;
|
16 |
-
padding:30px;
|
17 |
-
-webkit-border-radius: 6px;
|
18 |
-
-moz-border-radius: 6px;
|
19 |
-
border-radius: 6px;
|
20 |
-
}
|
21 |
-
</style>
|
22 |
-
<div style="clear: both;margin-left:30px">
|
23 |
-
<i><b>Download statistics for <?php echo date("F Y"); ?></b></i>
|
24 |
-
</div>
|
25 |
-
<table id="data">
|
26 |
-
<tfoot>
|
27 |
-
|
28 |
-
<tr>
|
29 |
-
<th>1</th>
|
30 |
-
<th>2</th>
|
31 |
-
<th>3</th>
|
32 |
-
<th>4</th>
|
33 |
-
<th>5</th>
|
34 |
-
|
35 |
-
<th>6</th>
|
36 |
-
<th>7</th>
|
37 |
-
<th>8</th>
|
38 |
-
<th>9</th>
|
39 |
-
<th>10</th>
|
40 |
-
<th>11</th>
|
41 |
-
|
42 |
-
<th>12</th>
|
43 |
-
<th>13</th>
|
44 |
-
<th>14</th>
|
45 |
-
<th>15</th>
|
46 |
-
<th>16</th>
|
47 |
-
<th>17</th>
|
48 |
-
|
49 |
-
<th>18</th>
|
50 |
-
<th>19</th>
|
51 |
-
<th>19</th>
|
52 |
-
<th>20</th>
|
53 |
-
<th>22</th>
|
54 |
-
<th>23</th>
|
55 |
-
|
56 |
-
<th>24</th>
|
57 |
-
<th>25</th>
|
58 |
-
<th>26</th>
|
59 |
-
<th>27</th>
|
60 |
-
<th>28</th>
|
61 |
-
<th>29</th>
|
62 |
-
|
63 |
-
<th>30</th>
|
64 |
-
<th>31</th>
|
65 |
-
</tr>
|
66 |
-
</tfoot>
|
67 |
-
<tbody>
|
68 |
-
<tr>
|
69 |
-
<?php for($i=1;$i<32;$i++){
|
70 |
-
echo "<td>{$d[$i]}</td>";
|
71 |
-
} ?>
|
72 |
-
|
73 |
-
</tr>
|
74 |
-
</tbody>
|
75 |
-
</table>
|
76 |
-
<div id="holder"></div>
|
77 |
-
<br>
|
78 |
-
<br>
|
79 |
-
<br>
|
80 |
-
<div style="clear: both;"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Admin/views/templates/custom-tags.php
CHANGED
@@ -10,7 +10,7 @@ if(!defined("ABSPATH")) die();
|
|
10 |
<div class="panel panel-default">
|
11 |
<div class="panel-heading">
|
12 |
<a href="#" data-toggle="modal" data-target="#newtagmodal" class="btn btn-success pull-right btn-xs"><i class="fa fa-plus-circle"></i> <?php _e( "Add New Tag", "download-manager" ); ?></a>
|
13 |
-
|
14 |
</div>
|
15 |
<table class="table table-striped" id="tagstable">
|
16 |
<thead>
|
10 |
<div class="panel panel-default">
|
11 |
<div class="panel-heading">
|
12 |
<a href="#" data-toggle="modal" data-target="#newtagmodal" class="btn btn-success pull-right btn-xs"><i class="fa fa-plus-circle"></i> <?php _e( "Add New Tag", "download-manager" ); ?></a>
|
13 |
+
<?php echo esc_attr__( 'Custom Template Tags', WPDM_TEXT_DOMAIN ); ?>
|
14 |
</div>
|
15 |
<table class="table table-striped" id="tagstable">
|
16 |
<thead>
|
src/Admin/views/templates/list-templates.php
CHANGED
@@ -72,7 +72,7 @@ if(!isset($_GET['_type']) || $_GET['_type'] !== 'email'){ ?>
|
|
72 |
</div>
|
73 |
</td>
|
74 |
<td style="text-align: right">
|
75 |
-
<a data-toggle="modal" href="#" data-href="admin-ajax.php?action=template_preview&_type=<?php echo $ttype; ?>&template=<?php echo $ctpl; ?>&_tplnonce
|
76 |
<?php if(!in_array($ctpl, $ctemplates)){ ?>
|
77 |
<a href="edit.php?post_type=wpdmpro&page=templates&_type=<?php echo $ttype; ?>&task=NewTemplate&clone=<?php echo $ctpl; ?>" class="btn btn-sm btn-primary"><i class="fa fa-copy"></i> <?php echo __( "Clone" , "download-manager" ); ?></a>
|
78 |
<?php } else { ?>
|
72 |
</div>
|
73 |
</td>
|
74 |
<td style="text-align: right">
|
75 |
+
<a data-toggle="modal" href="#" data-href="admin-ajax.php?action=template_preview&_type=<?php echo $ttype; ?>&template=<?php echo $ctpl; ?>&_tplnonce=<?php echo wp_create_nonce(WPDM_PUB_NONCE) ?>" data-target="#preview-modal" rel="<?php echo $ctpl; ?>" class="template_preview btn btn-sm btn-success"><i class="fa fa-desktop"></i> Preview</a>
|
76 |
<?php if(!in_array($ctpl, $ctemplates)){ ?>
|
77 |
<a href="edit.php?post_type=wpdmpro&page=templates&_type=<?php echo $ttype; ?>&task=NewTemplate&clone=<?php echo $ctpl; ?>" class="btn btn-sm btn-primary"><i class="fa fa-copy"></i> <?php echo __( "Clone" , "download-manager" ); ?></a>
|
78 |
<?php } else { ?>
|
src/Admin/views/welcome.php
CHANGED
@@ -251,7 +251,7 @@
|
|
251 |
</div>
|
252 |
</div>
|
253 |
<div style="line-height: 30px;" class="panel-footer">
|
254 |
-
<a href="
|
255 |
</div>
|
256 |
</div>
|
257 |
</div>
|
@@ -268,7 +268,7 @@
|
|
268 |
</div>
|
269 |
</div>
|
270 |
<div style="line-height: 30px;" class="panel-footer">
|
271 |
-
<a href="
|
272 |
</div>
|
273 |
</div>
|
274 |
</div>
|
@@ -285,7 +285,7 @@
|
|
285 |
</div>
|
286 |
</div>
|
287 |
<div style="line-height: 30px;" class="panel-footer">
|
288 |
-
<a href="
|
289 |
</div>
|
290 |
</div>
|
291 |
</div>
|
251 |
</div>
|
252 |
</div>
|
253 |
<div style="line-height: 30px;" class="panel-footer">
|
254 |
+
<a href="<?php echo admin_url('plugin-install.php?tab=plugin-information&plugin=wpdm-gutenberg-blocks&TB_iframe=true&width=600&height=550')?>" class="btn btn-primary btn-block thickbox open-plugin-details-modal">Install</a>
|
255 |
</div>
|
256 |
</div>
|
257 |
</div>
|
268 |
</div>
|
269 |
</div>
|
270 |
<div style="line-height: 30px;" class="panel-footer">
|
271 |
+
<a href="<?php echo admin_url('plugin-install.php?tab=plugin-information&plugin=wpdm-premium-packages&TB_iframe=true&width=600&height=550')?>" class="btn btn-primary btn-block thickbox open-plugin-details-modal">Install</a>
|
272 |
</div>
|
273 |
</div>
|
274 |
</div>
|
285 |
</div>
|
286 |
</div>
|
287 |
<div style="line-height: 30px;" class="panel-footer">
|
288 |
+
<a href="<?php echo admin_url('plugin-install.php?tab=plugin-information&plugin=liveforms&TB_iframe=true&width=600&height=550')?>" class="btn btn-success btn-block thickbox open-plugin-details-modal">Install</a>
|
289 |
</div>
|
290 |
</div>
|
291 |
</div>
|
src/AssetManager/AssetManager.php
CHANGED
@@ -56,7 +56,6 @@ class AssetManager
|
|
56 |
private function actions()
|
57 |
{
|
58 |
|
59 |
-
add_action('wp', array($this, 'assetPage'), 1);
|
60 |
add_action('init', array($this, 'assetPicker'), 1);
|
61 |
add_action('init', array($this, 'download'), 1);
|
62 |
|
@@ -79,7 +78,7 @@ class AssetManager
|
|
79 |
add_action('wp_ajax_wpdm_updatelink', array($this, 'updateLink'));
|
80 |
add_action('wp_ajax_wpdm_deletelink', array($this, 'deleteLink'));
|
81 |
|
82 |
-
add_action('wpdm_asset_viewer_head', [$this, 'enqueueScripts']);
|
83 |
|
84 |
add_action('wpdm_after_upload_file', array($this, 'upload'), 1);
|
85 |
//add_action('wp_enqueue_scripts', array($this,'siteScripts'));
|
@@ -108,18 +107,6 @@ class AssetManager
|
|
108 |
}
|
109 |
}
|
110 |
|
111 |
-
function assetPage()
|
112 |
-
{
|
113 |
-
global $wp_query;
|
114 |
-
$url = parse_url($_SERVER['REQUEST_URI']);
|
115 |
-
if (preg_match('/wpdm\-asset\/([^\/]+)/', wpdm_valueof($url, 'path'), $matches)) {
|
116 |
-
$asset = new Asset();
|
117 |
-
$asset->resolveKey($matches[1]);
|
118 |
-
http_response_code(200);
|
119 |
-
include Template::locate("asset-viewer.php", __DIR__.'/views');
|
120 |
-
die();
|
121 |
-
}
|
122 |
-
}
|
123 |
|
124 |
function siteScripts()
|
125 |
{
|
@@ -671,11 +658,6 @@ class AssetManager
|
|
671 |
}
|
672 |
}
|
673 |
|
674 |
-
function enqueueScripts()
|
675 |
-
{
|
676 |
-
__::enqueueStyle('ttps://fonts.googleapis.com/css?family=IBM+Plex+Mono|IBM+Plex+Sans:400,600&display=swap');
|
677 |
-
__::enqueueScript(includes_url('js/jquery/jquery.js'));
|
678 |
-
}
|
679 |
}
|
680 |
|
681 |
|
56 |
private function actions()
|
57 |
{
|
58 |
|
|
|
59 |
add_action('init', array($this, 'assetPicker'), 1);
|
60 |
add_action('init', array($this, 'download'), 1);
|
61 |
|
78 |
add_action('wp_ajax_wpdm_updatelink', array($this, 'updateLink'));
|
79 |
add_action('wp_ajax_wpdm_deletelink', array($this, 'deleteLink'));
|
80 |
|
81 |
+
//add_action('wpdm_asset_viewer_head', [$this, 'enqueueScripts']);
|
82 |
|
83 |
add_action('wpdm_after_upload_file', array($this, 'upload'), 1);
|
84 |
//add_action('wp_enqueue_scripts', array($this,'siteScripts'));
|
107 |
}
|
108 |
}
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
function siteScripts()
|
112 |
{
|
658 |
}
|
659 |
}
|
660 |
|
|
|
|
|
|
|
|
|
|
|
661 |
}
|
662 |
|
663 |
|
src/AssetManager/views/asset-manager-ui.php
CHANGED
@@ -506,7 +506,7 @@ if(is_admin()){
|
|
506 |
<button class="btn btn-primary btn-simple btn-sm ttip" title="Reload" id="reload"><i class="fa fa-sync"></i></button>
|
507 |
<div class="btn-group">
|
508 |
<button class="btn btn-simple btn-sm" data-toggle="modal" data-target="#newfol"><i class="fa fa-folder-open"></i> <?php echo __( "New Folder", "download-manager" ) ?></button>
|
509 |
-
<button class="btn btn-simple btn-sm" data-toggle="modal" data-target="#newfile"><i class="far fa-file"></i>
|
510 |
<button class="btn btn-simple btn-sm" id="btn-upload-file" ><i class="fa fa-cloud-upload-alt"></i> <?php echo __( "Upload File", "download-manager" ) ?></button>
|
511 |
</div>
|
512 |
<button class="btn btn-info btn-simple btn-sm ttip" id="btn-paste" disabled="disabled" title="Paste"><i class="fa fa-clipboard"></i></button>
|
@@ -527,7 +527,7 @@ if(is_admin()){
|
|
527 |
</div>
|
528 |
</div>
|
529 |
<div class="panel-heading" style="border-radius: 0;border-top: 1px solid #dddddd">
|
530 |
-
<div id="ldn" style="float:right;font-size: 9pt;margin-top: 10px;display: none" class="text-danger"><i class="fa fa-sun fa-spin"></i>
|
531 |
<div id="breadcrumb" style="margin: 0"></div>
|
532 |
</div>
|
533 |
<div class="panel-body-c" id="wpdmfm_explorer">
|
@@ -537,7 +537,7 @@ if(is_admin()){
|
|
537 |
<div class="col-md-3 wpdm-dir-locator">
|
538 |
<div data-simplebar ss-container>
|
539 |
<ul class="wpdmfm-folder-tree" id="wpdmfm-folder-tree">
|
540 |
-
<li data-path="" id="<?php echo md5('home'); ?>" class="expand-dir"><i class="fa fa-hdd color-purple"></i> <a class="explore-dir" href="#" data-path="">
|
541 |
</ul>
|
542 |
</div>
|
543 |
</div>
|
@@ -559,14 +559,14 @@ if(is_admin()){
|
|
559 |
<div class="panel panel-default blockui" style="left:0;width: 100%;height: 900px;border: 0;border-left: 1px solid #eee;border-radius: 0;position: absolute;">
|
560 |
<div class="panel-heading" style="border-radius: 0;border-top: 0 !important;">
|
561 |
<a href="#" class="pull-right" id="close-settings"><i class="fas fa-times-circle text-muted"></i></a>
|
562 |
-
|
563 |
</div>
|
564 |
<div class="panel-body" id="__asset_settings">
|
565 |
<div class="thumbnail text-center" v-html="asset.preview"></div>
|
566 |
<div class="form-group">
|
567 |
<div class="media" style="border:1px solid #e8e8e8;border-radius: 3px;padding: 10px;">
|
568 |
<div class="pull-right">
|
569 |
-
<button class="btn btn-xs btn-secondary btn-rename" type="button" title="
|
570 |
</div>
|
571 |
<div class="media-body">
|
572 |
{{ asset.name }}
|
@@ -578,13 +578,13 @@ if(is_admin()){
|
|
578 |
<div class="modal-content">
|
579 |
<div class="modal-header">
|
580 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
581 |
-
<strong class="modal-title" id="myModalLabel"
|
582 |
</div>
|
583 |
<div id="upload" class="modal-body">
|
584 |
-
<input type="text" v-bind:value="asset.name" placeholder="
|
585 |
</div>
|
586 |
<div class="modal-footer text-right">
|
587 |
-
<button type="button" id="renamenow" class="btn btn-info" :data-assetid="asset.ID" :data-oldname="asset.name" :data-path="asset.path"
|
588 |
</div>
|
589 |
</div>
|
590 |
</div>
|
@@ -596,7 +596,7 @@ if(is_admin()){
|
|
596 |
|
597 |
<!-- Nav tabs -->
|
598 |
<ul class="nav nav-tabs" id="__file_settings_tabs" role="tablist" style="margin-left: -15px;padding-left: 15px;margin-right: -15px;border-bottom: 1px solid #e8e8e8;">
|
599 |
-
<li role="presentation" class="active"><a href="#share" aria-controls="share" role="tab" data-toggle="tab"
|
600 |
</ul>
|
601 |
|
602 |
<!-- Tab panes -->
|
@@ -609,7 +609,7 @@ if(is_admin()){
|
|
609 |
<div onclick="jQuery('#sharecode').select();document.execCommand('copy');" class="input-group-addon ttip" title="<?php echo __( "Copy Shortcode", "download-manager" ) ?>" style="border: 0 !important;background: #ffffff;cursor: pointer;"><i class="fa fa-copy color-purple"></i></div>
|
610 |
</div>
|
611 |
<div class="panel-footer text-center">
|
612 |
-
|
613 |
</div>
|
614 |
</div>
|
615 |
|
@@ -768,14 +768,14 @@ if(is_admin()){
|
|
768 |
<div class="modal-content">
|
769 |
<div class="modal-header">
|
770 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
771 |
-
<strong class="modal-title" id="myModalLabel"
|
772 |
</div>
|
773 |
<div id="upload" class="modal-body">
|
774 |
<input type="text" placeholder="Folder Name" id="folname" class="form-control form-control-lg" style="margin: 0">
|
775 |
</div>
|
776 |
<div class="modal-footer text-right">
|
777 |
-
<button type="button" id="createfol" class="btn btn-info"
|
778 |
-
<div style="float:left;display: none;" id="fcd" class="text-success"><i class="fa fa-check-circle"></i>
|
779 |
</div>
|
780 |
</div>
|
781 |
</div>
|
@@ -786,14 +786,14 @@ if(is_admin()){
|
|
786 |
<div class="modal-content">
|
787 |
<div class="modal-header">
|
788 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
789 |
-
<strong class="modal-title" id="myModalLabel"
|
790 |
</div>
|
791 |
<div id="upload" class="modal-body">
|
792 |
<input type="text" placeholder="File Name" id="filename" class="form-control form-control-lg" style="margin: 0">
|
793 |
</div>
|
794 |
<div class="modal-footer text-right">
|
795 |
-
<button type="button" id="createfile" class="btn btn-info"
|
796 |
-
<div style="float:left;display: none;" id="fcd" class="text-success"><i class="fa fa-check-circle"></i>
|
797 |
</div>
|
798 |
</div>
|
799 |
</div>
|
@@ -804,7 +804,7 @@ if(is_admin()){
|
|
804 |
<div class="modal-content">
|
805 |
<div class="modal-header">
|
806 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
807 |
-
<strong class="modal-title"
|
808 |
</div>
|
809 |
<div class="modal-body">
|
810 |
<form id="update_sharelink_form" method="post" action="<?php echo admin_url('admin-ajax.php'); ?>">
|
@@ -853,7 +853,7 @@ if(is_admin()){
|
|
853 |
</div>
|
854 |
|
855 |
<div class="text-right">
|
856 |
-
<button type="submit" id="create_sharelink" class="btn btn-info"
|
857 |
</div>
|
858 |
|
859 |
|
@@ -969,7 +969,7 @@ if(is_admin()){
|
|
969 |
$('#breadcrumb').html(data.breadcrumb);
|
970 |
|
971 |
} else {
|
972 |
-
WPDM.pushNotify("
|
973 |
}
|
974 |
});
|
975 |
}
|
506 |
<button class="btn btn-primary btn-simple btn-sm ttip" title="Reload" id="reload"><i class="fa fa-sync"></i></button>
|
507 |
<div class="btn-group">
|
508 |
<button class="btn btn-simple btn-sm" data-toggle="modal" data-target="#newfol"><i class="fa fa-folder-open"></i> <?php echo __( "New Folder", "download-manager" ) ?></button>
|
509 |
+
<button class="btn btn-simple btn-sm" data-toggle="modal" data-target="#newfile"><i class="far fa-file"></i> <?php echo esc_attr__( 'New File', WPDM_TEXT_DOMAIN ); ?></button>
|
510 |
<button class="btn btn-simple btn-sm" id="btn-upload-file" ><i class="fa fa-cloud-upload-alt"></i> <?php echo __( "Upload File", "download-manager" ) ?></button>
|
511 |
</div>
|
512 |
<button class="btn btn-info btn-simple btn-sm ttip" id="btn-paste" disabled="disabled" title="Paste"><i class="fa fa-clipboard"></i></button>
|
527 |
</div>
|
528 |
</div>
|
529 |
<div class="panel-heading" style="border-radius: 0;border-top: 1px solid #dddddd">
|
530 |
+
<div id="ldn" style="float:right;font-size: 9pt;margin-top: 10px;display: none" class="text-danger"><i class="fa fa-sun fa-spin"></i> <?php echo esc_attr__( 'Loading', WPDM_TEXT_DOMAIN ); ?>...</div>
|
531 |
<div id="breadcrumb" style="margin: 0"></div>
|
532 |
</div>
|
533 |
<div class="panel-body-c" id="wpdmfm_explorer">
|
537 |
<div class="col-md-3 wpdm-dir-locator">
|
538 |
<div data-simplebar ss-container>
|
539 |
<ul class="wpdmfm-folder-tree" id="wpdmfm-folder-tree">
|
540 |
+
<li data-path="" id="<?php echo md5('home'); ?>" class="expand-dir"><i class="fa fa-hdd color-purple"></i> <a class="explore-dir" href="#" data-path=""> <?php echo esc_attr__( 'Home', WPDM_TEXT_DOMAIN ); ?></a></li>
|
541 |
</ul>
|
542 |
</div>
|
543 |
</div>
|
559 |
<div class="panel panel-default blockui" style="left:0;width: 100%;height: 900px;border: 0;border-left: 1px solid #eee;border-radius: 0;position: absolute;">
|
560 |
<div class="panel-heading" style="border-radius: 0;border-top: 0 !important;">
|
561 |
<a href="#" class="pull-right" id="close-settings"><i class="fas fa-times-circle text-muted"></i></a>
|
562 |
+
<?php echo esc_attr__( 'Asset Settings', WPDM_TEXT_DOMAIN ); ?>
|
563 |
</div>
|
564 |
<div class="panel-body" id="__asset_settings">
|
565 |
<div class="thumbnail text-center" v-html="asset.preview"></div>
|
566 |
<div class="form-group">
|
567 |
<div class="media" style="border:1px solid #e8e8e8;border-radius: 3px;padding: 10px;">
|
568 |
<div class="pull-right">
|
569 |
+
<button class="btn btn-xs btn-secondary btn-rename" type="button" title="<?php echo esc_attr__( 'Rename', WPDM_TEXT_DOMAIN ); ?>" data-toggle="modal" data-target="#rename"><i class="fas fa-i-cursor"></i> <?php echo esc_attr__( 'Rename', WPDM_TEXT_DOMAIN ); ?></button>
|
570 |
</div>
|
571 |
<div class="media-body">
|
572 |
{{ asset.name }}
|
578 |
<div class="modal-content">
|
579 |
<div class="modal-header">
|
580 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
581 |
+
<strong class="modal-title" id="myModalLabel"><?php echo esc_attr__( 'Rename', WPDM_TEXT_DOMAIN ); ?></strong>
|
582 |
</div>
|
583 |
<div id="upload" class="modal-body">
|
584 |
+
<input type="text" v-bind:value="asset.name" placeholder="<?php echo esc_attr__( 'New Name', WPDM_TEXT_DOMAIN ); ?>" id="newname" class="form-control form-control-lg" style="margin: 0px;border: 1px dashed #d4d4d4;">
|
585 |
</div>
|
586 |
<div class="modal-footer text-right">
|
587 |
+
<button type="button" id="renamenow" class="btn btn-info" :data-assetid="asset.ID" :data-oldname="asset.name" :data-path="asset.path"><?php echo esc_attr__( 'Rename', WPDM_TEXT_DOMAIN ); ?></button>
|
588 |
</div>
|
589 |
</div>
|
590 |
</div>
|
596 |
|
597 |
<!-- Nav tabs -->
|
598 |
<ul class="nav nav-tabs" id="__file_settings_tabs" role="tablist" style="margin-left: -15px;padding-left: 15px;margin-right: -15px;border-bottom: 1px solid #e8e8e8;">
|
599 |
+
<li role="presentation" class="active"><a href="#share" aria-controls="share" role="tab" data-toggle="tab"><?php echo esc_attr__( 'Share', WPDM_TEXT_DOMAIN ); ?></a></li>
|
600 |
</ul>
|
601 |
|
602 |
<!-- Tab panes -->
|
609 |
<div onclick="jQuery('#sharecode').select();document.execCommand('copy');" class="input-group-addon ttip" title="<?php echo __( "Copy Shortcode", "download-manager" ) ?>" style="border: 0 !important;background: #ffffff;cursor: pointer;"><i class="fa fa-copy color-purple"></i></div>
|
610 |
</div>
|
611 |
<div class="panel-footer text-center">
|
612 |
+
<?php echo esc_attr__( 'Use the shortcode to embed this asset on any page or post', WPDM_TEXT_DOMAIN ); ?>
|
613 |
</div>
|
614 |
</div>
|
615 |
|
768 |
<div class="modal-content">
|
769 |
<div class="modal-header">
|
770 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
771 |
+
<strong class="modal-title" id="myModalLabel"><?php echo esc_attr__( 'New Folder', WPDM_TEXT_DOMAIN ); ?></strong>
|
772 |
</div>
|
773 |
<div id="upload" class="modal-body">
|
774 |
<input type="text" placeholder="Folder Name" id="folname" class="form-control form-control-lg" style="margin: 0">
|
775 |
</div>
|
776 |
<div class="modal-footer text-right">
|
777 |
+
<button type="button" id="createfol" class="btn btn-info"><?php echo esc_attr__( 'Create Folder', WPDM_TEXT_DOMAIN ); ?></button>
|
778 |
+
<div style="float:left;display: none;" id="fcd" class="text-success"><i class="fa fa-check-circle"></i> <?php echo esc_attr__( 'Folder Created', WPDM_TEXT_DOMAIN ); ?></div>
|
779 |
</div>
|
780 |
</div>
|
781 |
</div>
|
786 |
<div class="modal-content">
|
787 |
<div class="modal-header">
|
788 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
789 |
+
<strong class="modal-title" id="myModalLabel"><?php echo esc_attr__( 'New File', WPDM_TEXT_DOMAIN ); ?></strong>
|
790 |
</div>
|
791 |
<div id="upload" class="modal-body">
|
792 |
<input type="text" placeholder="File Name" id="filename" class="form-control form-control-lg" style="margin: 0">
|
793 |
</div>
|
794 |
<div class="modal-footer text-right">
|
795 |
+
<button type="button" id="createfile" class="btn btn-info"><?php echo esc_attr__( 'Create File', WPDM_TEXT_DOMAIN ); ?></button>
|
796 |
+
<div style="float:left;display: none;" id="fcd" class="text-success"><i class="fa fa-check-circle"></i> <?php echo esc_attr__( 'File Created', WPDM_TEXT_DOMAIN ); ?></div>
|
797 |
</div>
|
798 |
</div>
|
799 |
</div>
|
804 |
<div class="modal-content">
|
805 |
<div class="modal-header">
|
806 |
<button type="button" class="close pull-right" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span></button>
|
807 |
+
<strong class="modal-title"><?php echo esc_attr__( 'Update link', WPDM_TEXT_DOMAIN ); ?></strong>
|
808 |
</div>
|
809 |
<div class="modal-body">
|
810 |
<form id="update_sharelink_form" method="post" action="<?php echo admin_url('admin-ajax.php'); ?>">
|
853 |
</div>
|
854 |
|
855 |
<div class="text-right">
|
856 |
+
<button type="submit" id="create_sharelink" class="btn btn-info"><?php echo esc_attr__( 'Update Link', WPDM_TEXT_DOMAIN ); ?></button>
|
857 |
</div>
|
858 |
|
859 |
|
969 |
$('#breadcrumb').html(data.breadcrumb);
|
970 |
|
971 |
} else {
|
972 |
+
WPDM.pushNotify("<?php echo esc_attr__( 'Error', 'download-manager' ); ?>!", data.message, 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png', 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png');
|
973 |
}
|
974 |
});
|
975 |
}
|
src/AssetManager/views/asset-viewer.php
DELETED
@@ -1,535 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if(!defined("ABSPATH")) die();
|
3 |
-
|
4 |
-
if(!$asset->hasAccess())
|
5 |
-
{
|
6 |
-
\WPDM\__\Messages::error(array('title' => 'Access Denied!', 'message' => __( "You do not have access to this asset", "download-manager" )), 1);
|
7 |
-
}
|
8 |
-
|
9 |
-
?><!DOCTYPE html>
|
10 |
-
<html lang="en">
|
11 |
-
<head>
|
12 |
-
<meta charset="UTF-8">
|
13 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
14 |
-
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
15 |
-
<link rel="icon" href="<?php echo WPDM_BASE_URL ?>assets/images/wpdm-logo.png" />
|
16 |
-
<title><?php echo $asset->name; ?></title>
|
17 |
-
|
18 |
-
<?php do_action("wpdm_asset_viewer_head"); ?>
|
19 |
-
<style>
|
20 |
-
|
21 |
-
*, *:before, *:after {
|
22 |
-
box-sizing: inherit;
|
23 |
-
}
|
24 |
-
html {
|
25 |
-
box-sizing: border-box;
|
26 |
-
font-family: sans-serif;
|
27 |
-
}
|
28 |
-
html, body {
|
29 |
-
width: 100%;
|
30 |
-
height: 100%;
|
31 |
-
margin: 0;
|
32 |
-
color: #637282;
|
33 |
-
background: #F6F9FC;
|
34 |
-
font-family: 'IBM Plex Sans', sans-serif;
|
35 |
-
}
|
36 |
-
|
37 |
-
.mb-1 {
|
38 |
-
margin-bottom: 15px;
|
39 |
-
}
|
40 |
-
.mt-2 {
|
41 |
-
margin-top: 25px;
|
42 |
-
}
|
43 |
-
|
44 |
-
/******* Nav *******/
|
45 |
-
.nav {
|
46 |
-
background: #fff;
|
47 |
-
min-height: 60px;
|
48 |
-
padding: 0 20px;
|
49 |
-
border-bottom: 1px solid #f1f1f1;
|
50 |
-
position: fixed;
|
51 |
-
width: 100%;
|
52 |
-
z-index: 999;
|
53 |
-
}
|
54 |
-
.nav__links {
|
55 |
-
text-transform: capitalize;
|
56 |
-
display: inline-block;
|
57 |
-
float:right;
|
58 |
-
}
|
59 |
-
.nav__links a {
|
60 |
-
text-decoration: none;
|
61 |
-
color: #637282;
|
62 |
-
font-size: 14px;
|
63 |
-
padding: 10px 15px;
|
64 |
-
line-height: 64px;
|
65 |
-
letter-spacing: .5px;
|
66 |
-
margin-right: 5px;
|
67 |
-
}
|
68 |
-
.nav__links a span {
|
69 |
-
/* transform: scaleX(2) translateY(-4px); */
|
70 |
-
display: inline-block;
|
71 |
-
font-size: 30px;
|
72 |
-
line-height: 0;
|
73 |
-
}
|
74 |
-
.nav__links a span svg {
|
75 |
-
width: 20px;
|
76 |
-
transform: translateY(6px);
|
77 |
-
}
|
78 |
-
.nav__logo {
|
79 |
-
display: inline-block;
|
80 |
-
padding: 15px 15px 15px 0;
|
81 |
-
}
|
82 |
-
.nav__logo .file-logo {
|
83 |
-
width: 30px;
|
84 |
-
}
|
85 |
-
.file-names {
|
86 |
-
max-width: 70%;
|
87 |
-
display: inline-block;
|
88 |
-
text-transform: capitalize;
|
89 |
-
}
|
90 |
-
.file-name {
|
91 |
-
font-weight: 700;
|
92 |
-
font-size: 14px;
|
93 |
-
line-height: 15px;
|
94 |
-
}
|
95 |
-
.file-tag {
|
96 |
-
font-size: 13px;
|
97 |
-
margin-top: 7px;
|
98 |
-
}
|
99 |
-
label {
|
100 |
-
font-size: 20px;
|
101 |
-
display: none;
|
102 |
-
width: 2rem;
|
103 |
-
float: right;
|
104 |
-
text-align: center;
|
105 |
-
margin-top: 18px;
|
106 |
-
}
|
107 |
-
#toggle {
|
108 |
-
display: none;
|
109 |
-
}
|
110 |
-
|
111 |
-
.nav__links .btn {
|
112 |
-
border: 1px solid #e9e9e9;
|
113 |
-
padding: 10px 22px;
|
114 |
-
border-radius: 3px;
|
115 |
-
}
|
116 |
-
.btn.btn-success {
|
117 |
-
background-color: #18CE0F;
|
118 |
-
color: #fff;
|
119 |
-
border: none;
|
120 |
-
}
|
121 |
-
|
122 |
-
/******* Sidebar *******/
|
123 |
-
.sidenav {
|
124 |
-
height: calc(100% - 60px);
|
125 |
-
position: fixed;
|
126 |
-
z-index: 1;
|
127 |
-
top: 63px;
|
128 |
-
right: 0;
|
129 |
-
width: 300px;
|
130 |
-
background-color: #EBF4FE;
|
131 |
-
padding: 20px;
|
132 |
-
transition: 0.3s;
|
133 |
-
border-left: 1px solid #E3ECF6;
|
134 |
-
}
|
135 |
-
.sidenav a {
|
136 |
-
cursor: pointer;
|
137 |
-
position: relative;
|
138 |
-
padding: 8px 0 17px;
|
139 |
-
text-decoration: none;
|
140 |
-
display: inline-block;
|
141 |
-
transition: 0.3s;
|
142 |
-
color: #637282;
|
143 |
-
margin-right: 12px;
|
144 |
-
text-transform: uppercase;
|
145 |
-
letter-spacing: .5px;
|
146 |
-
font-size: 12px;
|
147 |
-
}
|
148 |
-
.sidenav a:hover {
|
149 |
-
color: #0DC304;
|
150 |
-
}
|
151 |
-
a.open-close-btn {
|
152 |
-
position: absolute;
|
153 |
-
top: 10px;
|
154 |
-
right: 10px;
|
155 |
-
font-size: 26px;
|
156 |
-
margin-left: 50px;
|
157 |
-
line-height: 0;
|
158 |
-
width: 30px;
|
159 |
-
height: 30px;
|
160 |
-
text-align: center;
|
161 |
-
text-decoration: none;
|
162 |
-
color: #637282;
|
163 |
-
padding: 5px 0;
|
164 |
-
}
|
165 |
-
|
166 |
-
/* Tabs */
|
167 |
-
.buttons {
|
168 |
-
margin-top: -12px;
|
169 |
-
border-bottom: 1px solid #D1DAE4;
|
170 |
-
}
|
171 |
-
.buttons a.button--active::before {
|
172 |
-
content: '';
|
173 |
-
position: absolute;
|
174 |
-
width: 100%;
|
175 |
-
height: 2px;
|
176 |
-
bottom: 0;
|
177 |
-
background-color: #0DC304;
|
178 |
-
}
|
179 |
-
.tab-content {
|
180 |
-
position: relative;
|
181 |
-
}
|
182 |
-
.tab {
|
183 |
-
padding: 25px 0;
|
184 |
-
width: 100%;
|
185 |
-
}
|
186 |
-
.file-names .file-name,
|
187 |
-
.tab .file-tag {
|
188 |
-
color: #233242;
|
189 |
-
text-transform: capitalize;
|
190 |
-
}
|
191 |
-
.tab .file-name {
|
192 |
-
font-weight: 500;
|
193 |
-
}
|
194 |
-
.tab form {
|
195 |
-
position: relative;
|
196 |
-
}
|
197 |
-
|
198 |
-
[data-target] {
|
199 |
-
position: absolute;
|
200 |
-
visibility: hidden;
|
201 |
-
}
|
202 |
-
.button--active {
|
203 |
-
color: #0DC304;
|
204 |
-
}
|
205 |
-
.tab--active {
|
206 |
-
visibility: visible;
|
207 |
-
}
|
208 |
-
|
209 |
-
/* comments */
|
210 |
-
input {
|
211 |
-
padding: 16px 40px 16px 16px;
|
212 |
-
font-size: 14px;
|
213 |
-
width: 100%;
|
214 |
-
border-radius: 4px;
|
215 |
-
border: 1px solid #DCE5EF;
|
216 |
-
}
|
217 |
-
.submit {
|
218 |
-
cursor: pointer;
|
219 |
-
position: absolute;
|
220 |
-
top: 16px;
|
221 |
-
right: 14px;
|
222 |
-
width: 18px;
|
223 |
-
}
|
224 |
-
input:focus::-webkit-input-placeholder {
|
225 |
-
color: transparent;
|
226 |
-
}
|
227 |
-
.comment-content {
|
228 |
-
padding-top: 15px;
|
229 |
-
}
|
230 |
-
.comment-media {
|
231 |
-
font-size: 12px;
|
232 |
-
margin-bottom: 18px;
|
233 |
-
display: flex;
|
234 |
-
}
|
235 |
-
.comment-media .avatar{
|
236 |
-
width: 48px;
|
237 |
-
height: auto;
|
238 |
-
border-radius: 500px;
|
239 |
-
margin-right: 10px;
|
240 |
-
}
|
241 |
-
.comment-media .comment-data .comment-head{
|
242 |
-
text-transform: capitalize;
|
243 |
-
}
|
244 |
-
.comment-media .comment-data .comment-head strong{
|
245 |
-
font-size: 11pt;
|
246 |
-
}
|
247 |
-
.comment-media p{
|
248 |
-
margin: 5px 0;
|
249 |
-
}
|
250 |
-
.file-comment > div {
|
251 |
-
font-size: 13px;
|
252 |
-
margin-bottom: 8px;
|
253 |
-
}
|
254 |
-
.file-comment span {
|
255 |
-
background: #18CE0F;
|
256 |
-
color: #fff;
|
257 |
-
padding: 3px;
|
258 |
-
border-radius: 30px;
|
259 |
-
text-transform: uppercase;
|
260 |
-
font-size: 12px;
|
261 |
-
font-weight: 700;
|
262 |
-
margin-right: 8px;
|
263 |
-
width: 22px;
|
264 |
-
display: inline-block;
|
265 |
-
}
|
266 |
-
|
267 |
-
/******* Main *******/
|
268 |
-
#main {
|
269 |
-
margin-right: 300px;
|
270 |
-
padding: 80px 20px 20px;
|
271 |
-
transition: margin-right 0.3s;
|
272 |
-
}
|
273 |
-
|
274 |
-
/******* Svg *******/
|
275 |
-
.nav-svg {
|
276 |
-
width: 12px;
|
277 |
-
margin-right: 3px;
|
278 |
-
}
|
279 |
-
.nav-svg.arrow {
|
280 |
-
width: 18px;
|
281 |
-
}
|
282 |
-
.nav-svg .color-white {
|
283 |
-
fill: #fff;
|
284 |
-
}
|
285 |
-
.nav-svg.color-gray {
|
286 |
-
fill: #637282;
|
287 |
-
}
|
288 |
-
|
289 |
-
/******* Media Queries *******/
|
290 |
-
@media (max-width: 589.98px) {
|
291 |
-
label {
|
292 |
-
display: block;
|
293 |
-
cursor: pointer;
|
294 |
-
}
|
295 |
-
.sidenav {
|
296 |
-
right: -300px;
|
297 |
-
overflow: visible;
|
298 |
-
}
|
299 |
-
.nav__links {
|
300 |
-
z-index: 2;
|
301 |
-
width: 100%;
|
302 |
-
display: none;
|
303 |
-
float: none;
|
304 |
-
background: white;
|
305 |
-
padding: 20px;
|
306 |
-
position: absolute;
|
307 |
-
border-top: 1px solid #eee;
|
308 |
-
transform: translateX(-18px);
|
309 |
-
}
|
310 |
-
.nav__links a {
|
311 |
-
line-height: 1;
|
312 |
-
display: block;
|
313 |
-
margin-top: 12px;
|
314 |
-
}
|
315 |
-
.nav__links a {
|
316 |
-
line-height: 1;
|
317 |
-
display: block;
|
318 |
-
margin-top: 12px;
|
319 |
-
}
|
320 |
-
#toggle:checked + .nav__links {
|
321 |
-
display: block;
|
322 |
-
}
|
323 |
-
}
|
324 |
-
|
325 |
-
|
326 |
-
#asset-viewer{
|
327 |
-
white-space: nowrap;
|
328 |
-
font-family: 'IBM Plex Mono', monospace;
|
329 |
-
font-size: 11pt;
|
330 |
-
}
|
331 |
-
|
332 |
-
#asset-viewer .wpdm-asset-video,
|
333 |
-
#asset-viewer .wpdm-asset-audio,
|
334 |
-
#asset-viewer .wpdm-asset-text{
|
335 |
-
max-width: 960px;
|
336 |
-
margin: 30px auto;
|
337 |
-
padding: 50px;
|
338 |
-
background: #ffffff;
|
339 |
-
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
340 |
-
line-height: 1.5;
|
341 |
-
overflow: hidden;
|
342 |
-
}
|
343 |
-
#asset-viewer .wpdm-asset-text .hljs{
|
344 |
-
background: #ffffff;
|
345 |
-
line-break: anywhere !important;
|
346 |
-
}
|
347 |
-
#asset-viewer .wpdm-asset-image {
|
348 |
-
max-width: 80%;
|
349 |
-
margin: 30px auto;
|
350 |
-
padding: 30px;
|
351 |
-
}
|
352 |
-
#asset-viewer .wpdm-asset-image img{
|
353 |
-
max-width: 100%;
|
354 |
-
height: auto;
|
355 |
-
margin: 0 auto;
|
356 |
-
display: inherit;
|
357 |
-
}
|
358 |
-
#asset-viewer .wpdm-asset-video .wp-video{
|
359 |
-
width: 100% !important;
|
360 |
-
padding: 0 !important;
|
361 |
-
margin: 0 !important;
|
362 |
-
}
|
363 |
-
#asset-viewer .wpdm-asset-video,
|
364 |
-
#asset-viewer .wpdm-asset-audio{
|
365 |
-
padding: 28px 28px 20px !important;
|
366 |
-
}
|
367 |
-
#asset-viewer .wpdm-asset-video .wp-video video{
|
368 |
-
width: 100% !important;
|
369 |
-
padding: 0 !important;
|
370 |
-
margin: 0 !important;
|
371 |
-
height: 100%;
|
372 |
-
}
|
373 |
-
.d-flex{
|
374 |
-
display: flex;
|
375 |
-
margin-bottom: 10px;
|
376 |
-
font-size: 9pt;
|
377 |
-
background: rgba(255, 255, 255, 0.81);
|
378 |
-
padding: 15px;
|
379 |
-
border-radius: 3px;
|
380 |
-
}
|
381 |
-
|
382 |
-
.d-flex .meta-name{
|
383 |
-
font-weight: 400;
|
384 |
-
width: 50%;
|
385 |
-
}
|
386 |
-
.d-flex .meta-value{
|
387 |
-
width: 50%;text-align: right;color: #007eff;font-weight: bold;
|
388 |
-
}
|
389 |
-
|
390 |
-
</style>
|
391 |
-
</head>
|
392 |
-
<body>
|
393 |
-
|
394 |
-
<!--==== Navbar ====-->
|
395 |
-
<header class="nav">
|
396 |
-
<div class="nav__logo">
|
397 |
-
|
398 |
-
<svg class="file-logo" enable-background="new 0 0 222.2 229.6" version="1.1" viewBox="0 0 222.2 229.6" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
399 |
-
<style type="text/css">
|
400 |
-
.st0{fill:#239CEF;}
|
401 |
-
.st1{fill:#094168;}
|
402 |
-
</style>
|
403 |
-
<path class="st0" d="m97.3 131.4-91.4-91c-7.8-7.7-7.9-20.4-0.1-28.2l5.7-5.7c7.8-7.8 20.5-7.9 28.3-0.1l71.5 71.2 71-71.7c7.8-7.8 20.4-7.9 28.3-0.1l5.7 5.6c7.8 7.8 7.9 20.4 0.1 28.3l-90.8 91.6c-7.7 7.9-20.4 7.9-28.3 0.1v0z"/>
|
404 |
-
<path class="st1" d="m134.1 154.1c-12.4 12.6-32.7 12.6-45.3 0.2l-43.8-43.7c-22.6 36.7-11.3 84.8 25.4 107.4s84.7 11.3 107.3-25.4c15.6-25.3 15.5-57.2-0.3-82.4l-43.3 43.9z"/>
|
405 |
-
</svg>
|
406 |
-
|
407 |
-
</div>
|
408 |
-
<div class="file-names">
|
409 |
-
<div class="file-name"><?php echo $asset->name; ?></div>
|
410 |
-
<div class="file-tag">Modified on <?php echo date ("F d, Y", fileatime($asset->path)); ?></div>
|
411 |
-
</div>
|
412 |
-
<label for="toggle">☰</label>
|
413 |
-
<input type="checkbox" id="toggle">
|
414 |
-
<div class="nav__links">
|
415 |
-
<?php if(!is_user_logged_in()){ ?>
|
416 |
-
<a class="btn btn-border" href="<?php echo wpdm_login_url($_SERVER['REQUEST_URI']) ?>">
|
417 |
-
|
418 |
-
<svg class="nav-svg color-white" enable-background="new 0 0 488 488" version="1.1" viewBox="0 0 488 488" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
419 |
-
<path d="m398.85 216.6h-14.7v-76.5c0-77.2-62.8-140.1-140.1-140.1s-140.1 62.9-140.1 140.1v27.6c0 9.9 8.1 18 18 18s18-8.1 18-18v-27.6c0-57.4 46.7-104.1 104.1-104.1s104.1 46.7 104.1 104.1v76.5h-259c-24.6 0-44.7 20-44.7 44.7v182c0 24.6 20 44.7 44.7 44.7h270.5c9.9 0 18-8.1 18-18s-8.1-18-18-18h-270.5c-4.8 0-8.7-3.9-8.7-8.7v-182c0-4.8 3.9-8.7 8.7-8.7h309.7c4.8 0 8.7 3.9 8.7 8.7v182c0 9.9 8.1 18 18 18s18-8.1 18-18v-182c0-24.6-20-44.7-44.7-44.7z"/>
|
420 |
-
<path d="m287.15 334.3c-9.9 0-18 8.1-18 18 0 13.8-11.3 25.1-25.1 25.1s-25.1-11.3-25.1-25.1 11.3-25.1 25.1-25.1c9.9 0 18-8.1 18-18s-8.1-18-18-18c-33.7 0-61.1 27.4-61.1 61.1s27.4 61.1 61.1 61.1 61.1-27.4 61.1-61.1c0-9.9-8.1-18-18-18z"/>
|
421 |
-
</svg>
|
422 |
-
Sign in</a>
|
423 |
-
<?php } ?>
|
424 |
-
|
425 |
-
<a class="btn btn-success" href="<?php echo $asset->temp_download_url; ?>">
|
426 |
-
|
427 |
-
<svg style="margin-bottom: -1px;" class="nav-svg color-gray" enable-background="new 0 0 490.1 490.1" version="1.1" viewBox="0 0 490.1 490.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
428 |
-
<path fill="#fff" d="m407.3 0.05h-162.3c-9.9 0-18 8.1-18 18v277.1l-39.8-39.8c-7-7-18.4-7-25.5 0-7 7-7 18.4 0 25.5l70.6 70.6c3.5 3.5 8.1 5.3 12.7 5.3s9.2-1.8 12.7-5.3l70.6-70.6c7-7 7-18.4 0-25.5-7-7-18.4-7-25.5 0l-39.8 39.8v-259.1h144.3c25.7 0 46.7 20.8 46.7 46.5v325c0 25.6-20.9 46.5-46.7 46.5h-324.6c-25.8 0-46.7-20.8-46.7-46.5v-325c0-25.7 20.9-46.5 46.7-46.5h42.1c9.9 0 18-8.1 18-18s-8.1-18-18-18h-42.1c-45.6 0-82.7 37-82.7 82.5v325c0 45.5 37.1 82.5 82.7 82.5h324.7c45.6 0 82.7-37 82.7-82.5v-325c-0.1-45.5-37.2-82.5-82.8-82.5z"/>
|
429 |
-
</svg>
|
430 |
-
Download</a>
|
431 |
-
|
432 |
-
|
433 |
-
</div>
|
434 |
-
</header>
|
435 |
-
|
436 |
-
<!--==== Sidebar ====-->
|
437 |
-
<div id="mySidenav" class="sidenav">
|
438 |
-
<a href="javascript:void(0)" class="open-close-btn" onclick="closeNav()">
|
439 |
-
<svg class="nav-svg arrow color-gray" aria-hidden="true" data-icon="arrow-to-right" data-prefix="far" focusable="false" role="img" viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg">
|
440 |
-
<path class="" d="M200.1 99.5l148.4 148c4.7 4.7 4.7 12.3 0 17l-148.4 148c-4.7 4.7-12.3 4.7-17 0l-19.6-19.6c-4.8-4.8-4.7-12.5.2-17.1l97.1-93.7H12c-6.6 0-12-5.4-12-12v-28c0-6.6 5.4-12 12-12h248.8l-97.1-93.7c-4.8-4.7-4.9-12.4-.2-17.1l19.6-19.6c4.7-4.9 12.3-4.9 17-.2zM396 76v360c0 6.6 5.4 12 12 12h28c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12h-28c-6.6 0-12 5.4-12 12z" fill="currentColor"/>
|
441 |
-
</svg>
|
442 |
-
</a>
|
443 |
-
<a href="javascript:void(0)" class="open-close-btn" onclick="openNav()" style="left: -90px">
|
444 |
-
|
445 |
-
<svg class="nav-svg arrow color-gray" aria-hidden="true" data-icon="arrow-to-left" data-prefix="far" focusable="false" role="img" viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg">
|
446 |
-
<path class="" d="M247.9 412.5l-148.4-148c-4.7-4.7-4.7-12.3 0-17l148.4-148c4.7-4.7 12.3-4.7 17 0l19.6 19.6c4.8 4.8 4.7 12.5-.2 17.1L187.2 230H436c6.6 0 12 5.4 12 12v28c0 6.6-5.4 12-12 12H187.2l97.1 93.7c4.8 4.7 4.9 12.4.2 17.1l-19.6 19.6c-4.7 4.8-12.3 4.8-17 .1zM52 436V76c0-6.6-5.4-12-12-12H12C5.4 64 0 69.4 0 76v360c0 6.6 5.4 12 12 12h28c6.6 0 12-5.4 12-12z" fill="currentColor"/>
|
447 |
-
</svg>
|
448 |
-
</a>
|
449 |
-
|
450 |
-
<!-- Tabs -->
|
451 |
-
<nav class="buttons" data-buttons>
|
452 |
-
<a class="tab-button button--active" data-trigger="tab-b">Asset Info</a>
|
453 |
-
</nav>
|
454 |
-
<div class="tab-content">
|
455 |
-
|
456 |
-
<!-- About -->
|
457 |
-
<div data-target="tab-b" class="tab tab--active">
|
458 |
-
<div class="d-flex"><div class="meta-name">File Size</div><div class="meta-value"><?php echo $asset->size ?></div></div>
|
459 |
-
<?php
|
460 |
-
$mime = wp_check_filetype($asset->path);
|
461 |
-
?>
|
462 |
-
<div class="d-flex"><div class="meta-name">Content Type</div><div class="meta-value"><?php echo wpdm_valueof($mime, 'type') ?></div></div>
|
463 |
-
|
464 |
-
<?php
|
465 |
-
if(is_array($asset->metadata)) {
|
466 |
-
foreach ($asset->metadata as $name => $value) { ?>
|
467 |
-
<div class="d-flex">
|
468 |
-
<div class="meta-name"><?php echo $name; ?></div>
|
469 |
-
<div class="meta-value"><?php echo $value; ?></div>
|
470 |
-
</div>
|
471 |
-
<?php }
|
472 |
-
}
|
473 |
-
?>
|
474 |
-
</div>
|
475 |
-
</div>
|
476 |
-
</div>
|
477 |
-
|
478 |
-
<!--==== Content ====-->
|
479 |
-
<div id="main">
|
480 |
-
<div id="asset-viewer">
|
481 |
-
<?php
|
482 |
-
echo $asset->view($asset->path); ?>
|
483 |
-
</div>
|
484 |
-
<?php //wpdmprecho($asset); ?>
|
485 |
-
</div>
|
486 |
-
|
487 |
-
|
488 |
-
<script>
|
489 |
-
|
490 |
-
//=========== SideBar
|
491 |
-
var sidebar = document.getElementById("mySidenav");
|
492 |
-
var main = document.getElementById("main");
|
493 |
-
|
494 |
-
function openNav() {
|
495 |
-
// Sidebar
|
496 |
-
sidebar.style.right = "0";
|
497 |
-
sidebar.style.overflow = "hidden";
|
498 |
-
// Main
|
499 |
-
main.style.marginRight = "300px";
|
500 |
-
main.style.paddingRight = "20px";
|
501 |
-
}
|
502 |
-
|
503 |
-
function closeNav() {
|
504 |
-
// Sidebar
|
505 |
-
sidebar.style.right = "-300px";
|
506 |
-
sidebar.style.overflow = "visible";
|
507 |
-
// Main
|
508 |
-
main.style.marginRight = "0";
|
509 |
-
main.style.paddingRight = "50px";
|
510 |
-
}
|
511 |
-
|
512 |
-
//=========== Tabs
|
513 |
-
const allBtns = [...document.querySelectorAll('[data-trigger]')]
|
514 |
-
const allTargets = [...document.querySelectorAll('[data-target]')]
|
515 |
-
|
516 |
-
document.querySelector('[data-buttons]').addEventListener('click', function(e) {
|
517 |
-
|
518 |
-
const clickedEl = e.target
|
519 |
-
if (clickedEl.hasAttribute('data-buttons')) return
|
520 |
-
if (clickedEl.classList.contains('button--active')) return
|
521 |
-
|
522 |
-
allBtns.forEach(i => i.classList.remove('button--active'))
|
523 |
-
allTargets.forEach(i => i.classList.remove('tab--active'))
|
524 |
-
|
525 |
-
clickedEl.classList.add('button--active')
|
526 |
-
|
527 |
-
const target = document.querySelector(`[data-target=${e.target.dataset.trigger}]`)
|
528 |
-
target.classList.toggle('tab--active')
|
529 |
-
});
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
</script>
|
534 |
-
</body>
|
535 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Category/views/taxonomy-wpdmcategory.php
CHANGED
@@ -23,7 +23,7 @@ $cpage['paging'] = 1;
|
|
23 |
$cols = 12/$cpage['cols'];
|
24 |
$colspad = 12/$cpage['colspad'];
|
25 |
$colsphone = 12/$cpage['colsphone'];
|
26 |
-
if(
|
27 |
?>
|
28 |
<div class="w3eden">
|
29 |
<div class="container pt-3">
|
23 |
$cols = 12/$cpage['cols'];
|
24 |
$colspad = 12/$cpage['colspad'];
|
25 |
$colsphone = 12/$cpage['colsphone'];
|
26 |
+
if(wpdm_query_var('skw', 'txt') !== '') $cpage['s'] = wpdm_query_var('skw', 'txt');
|
27 |
?>
|
28 |
<div class="w3eden">
|
29 |
<div class="container pt-3">
|
src/MediaLibrary/MediaAccessControl.php
CHANGED
@@ -31,7 +31,7 @@ class MediaAccessControl
|
|
31 |
}
|
32 |
else {
|
33 |
add_action("init", array($this, 'protectMediaLibrary'), 8);
|
34 |
-
|
35 |
}
|
36 |
|
37 |
add_shortcode('wpdm_media', array($this, 'mediaShortcode'));
|
@@ -94,6 +94,7 @@ class MediaAccessControl
|
|
94 |
$media->filesize = wpdm_file_size($media->path);
|
95 |
|
96 |
$access = get_post_meta($media->ID, '__wpdm_media_access', true);
|
|
|
97 |
$password = get_post_meta($media->ID, '__wpdm_media_pass', true);
|
98 |
$private = get_post_meta($media->ID, '__wpdm_private', true);
|
99 |
if(current_user_can('manage_options')) $private = false;
|
@@ -106,8 +107,8 @@ class MediaAccessControl
|
|
106 |
$keyvalid = true;
|
107 |
$__hash = Crypt::encrypt($media->ID);
|
108 |
$download_url = "";
|
109 |
-
|
110 |
-
|
111 |
}
|
112 |
|
113 |
$upload_dir = wp_upload_dir();
|
@@ -328,16 +329,5 @@ class MediaAccessControl
|
|
328 |
return $form_fields;
|
329 |
}
|
330 |
|
331 |
-
function mediaDownloadHeader()
|
332 |
-
{
|
333 |
-
__::enqueueStyle(WPDM_BASE_URL.'assets/bootstrap/css/bootstrap.css');
|
334 |
-
__::enqueueStyle(WPDM_BASE_URL.'assets/css/front.css');
|
335 |
-
__::enqueueStyle('https://fonts.googleapis.com/css?family=Merriweather+Sans:300,400,700');
|
336 |
-
__::enqueueScript(includes_url('/js/jquery/jquery.js'));
|
337 |
-
__::enqueueScript(includes_url('/js/jquery/jquery.form.js'));
|
338 |
-
__::enqueueScript(WPDM_BASE_URL.'assets/bootstrap/js/bootstrap.min.js');
|
339 |
-
}
|
340 |
-
|
341 |
-
|
342 |
}
|
343 |
|
31 |
}
|
32 |
else {
|
33 |
add_action("init", array($this, 'protectMediaLibrary'), 8);
|
34 |
+
|
35 |
}
|
36 |
|
37 |
add_shortcode('wpdm_media', array($this, 'mediaShortcode'));
|
94 |
$media->filesize = wpdm_file_size($media->path);
|
95 |
|
96 |
$access = get_post_meta($media->ID, '__wpdm_media_access', true);
|
97 |
+
if(!is_array($access)) $access = [];
|
98 |
$password = get_post_meta($media->ID, '__wpdm_media_pass', true);
|
99 |
$private = get_post_meta($media->ID, '__wpdm_private', true);
|
100 |
if(current_user_can('manage_options')) $private = false;
|
107 |
$keyvalid = true;
|
108 |
$__hash = Crypt::encrypt($media->ID);
|
109 |
$download_url = "";
|
110 |
+
wp_die('Direct access disabled!');
|
111 |
+
|
112 |
}
|
113 |
|
114 |
$upload_dir = wp_upload_dir();
|
329 |
return $form_fields;
|
330 |
}
|
331 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
}
|
333 |
|
src/MediaLibrary/views/media-download.php
DELETED
@@ -1,205 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) die();
|
3 |
-
/**
|
4 |
-
* User: shahnuralam
|
5 |
-
* Date: 1/26/18
|
6 |
-
* Time: 12:33 AM
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
?>
|
11 |
-
<!DOCTYPE html>
|
12 |
-
<html style="background: transparent">
|
13 |
-
<head>
|
14 |
-
<title><?php echo $user_allowed ? $media->post_title : '404 - Not found!'; ?></title>
|
15 |
-
<script>
|
16 |
-
var wpdm_url = <?= json_encode(WPDM()->wpdm_urls) ?>;
|
17 |
-
</script>
|
18 |
-
|
19 |
-
<?php
|
20 |
-
do_action("wpdm_media_download_header");
|
21 |
-
WPDM()->apply::uiColors();
|
22 |
-
?>
|
23 |
-
<style>
|
24 |
-
body{
|
25 |
-
font-family: "Merriweather Sans", sans-serif;
|
26 |
-
font-weight: 400;
|
27 |
-
font-size: 10px;
|
28 |
-
color: #425676;
|
29 |
-
background: #233459;
|
30 |
-
}
|
31 |
-
.w3eden #wpdm-download h1{
|
32 |
-
font-size: 11pt;
|
33 |
-
font-weight: 600;
|
34 |
-
line-height: 1.5;
|
35 |
-
}
|
36 |
-
h1,h2,h3{
|
37 |
-
font-weight: 800;
|
38 |
-
letter-spacing: 0.4px;
|
39 |
-
}
|
40 |
-
.w3eden #wpdm-download h3{
|
41 |
-
font-size: 9pt;
|
42 |
-
}
|
43 |
-
.w3eden p{
|
44 |
-
font-size: 10px;
|
45 |
-
margin: 0;
|
46 |
-
letter-spacing: 0.3px;
|
47 |
-
line-height: 1.5;
|
48 |
-
}
|
49 |
-
#wpdm-download .modal-dialog{
|
50 |
-
width: 360px;
|
51 |
-
max-width: 96%;
|
52 |
-
}
|
53 |
-
#wpdm-download .modal-content{
|
54 |
-
border-radius: 4px;
|
55 |
-
border: 0;
|
56 |
-
box-shadow: 0 0 15px rgba(0,0,0,0.12);
|
57 |
-
}
|
58 |
-
#wpdm-download .modal-footer{
|
59 |
-
border-top: 1px solid #eeeeee;
|
60 |
-
background: #fafafa;
|
61 |
-
padding: 15px;
|
62 |
-
}
|
63 |
-
.w3eden #wpdm-download .btn.btn-download{
|
64 |
-
padding: 12px;
|
65 |
-
font-weight: 600 !important;
|
66 |
-
font-size: 9pt;
|
67 |
-
letter-spacing: 1.5px;
|
68 |
-
}
|
69 |
-
.modal-backdrop{
|
70 |
-
background: rgba(70, 99, 156, 0.87);
|
71 |
-
}
|
72 |
-
.modal-backdrop.show{
|
73 |
-
opacity: 1;
|
74 |
-
}
|
75 |
-
p svg{
|
76 |
-
width: 12px;
|
77 |
-
display: inline-block;
|
78 |
-
margin-right: 3px;
|
79 |
-
margin-top: -3px;
|
80 |
-
}
|
81 |
-
.w3eden .list-group {
|
82 |
-
border-color: rgba(67, 93, 148, 0.1) !important;
|
83 |
-
max-height: 103px;
|
84 |
-
overflow: auto;
|
85 |
-
border-radius: 0 !important;
|
86 |
-
}
|
87 |
-
.w3eden .list-group div.file-item{
|
88 |
-
padding: 10px;
|
89 |
-
color: var(--color-muted);
|
90 |
-
font-size: 10px;
|
91 |
-
border-color: rgba(67, 93, 148, 0.1) !important;
|
92 |
-
line-height: 1.5;
|
93 |
-
border-radius: 0 !important;
|
94 |
-
}
|
95 |
-
.w3eden .list-group div.file-item h3{
|
96 |
-
font-size:10pt;
|
97 |
-
margin: 0;
|
98 |
-
font-weight: 600;
|
99 |
-
color: #4b6286;
|
100 |
-
}
|
101 |
-
.w3eden .list-group div.file-item svg{
|
102 |
-
width: 18px;
|
103 |
-
margin-top: 5px;
|
104 |
-
}
|
105 |
-
.attachment-thumbnail.size-thumbnail {
|
106 |
-
height: 48px;
|
107 |
-
width: auto;
|
108 |
-
}
|
109 |
-
.form-control:focus{
|
110 |
-
box-shadow: none !important;
|
111 |
-
}
|
112 |
-
#__pwd{
|
113 |
-
background: #ffffff url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIzMnB4IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c2tldGNoPSJodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2gvbnMiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48dGl0bGUvPjxkZXNjLz48ZGVmcy8+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSI+PGcgZmlsbD0iIzE1N0VGQiIgaWQ9Imljb24tMTE0LWxvY2siPjxwYXRoIGQ9Ik0xNiwyMS45MTQ2NDcyIEwxNiwyNC41MDg5OTQ4IEMxNiwyNC43ODAxNjk1IDE2LjIzMTkzMzYsMjUgMTYuNSwyNSBDMTYuNzc2MTQyNCwyNSAxNywyNC43NzIxMTk1IDE3LDI0LjUwODk5NDggTDE3LDIxLjkxNDY0NzIgQzE3LjU4MjU5NjIsMjEuNzA4NzI5IDE4LDIxLjE1MzEwOTUgMTgsMjAuNSBDMTgsMTkuNjcxNTcyOCAxNy4zMjg0MjcyLDE5IDE2LjUsMTkgQzE1LjY3MTU3MjgsMTkgMTUsMTkuNjcxNTcyOCAxNSwyMC41IEMxNSwyMS4xNTMxMDk1IDE1LjQxNzQwMzgsMjEuNzA4NzI5IDE2LDIxLjkxNDY0NzIgTDE2LDIxLjkxNDY0NzIgWiBNOSwxNC4wMDAwMTI1IEw5LDEwLjQ5OTIzNSBDOSw2LjM1NjcwNDg1IDEyLjM1Nzg2NDQsMyAxNi41LDMgQzIwLjYzMzcwNzIsMyAyNCw2LjM1NzUyMTg4IDI0LDEwLjQ5OTIzNSBMMjQsMTQuMDAwMDEyNSBDMjUuNjU5MTQ3MSwxNC4wMDQ3NDg4IDI3LDE1LjM1MDMxNzQgMjcsMTcuMDA5NDc3NiBMMjcsMjYuOTkwNTIyNCBDMjcsMjguNjYzMzY4OSAyNS42NTI5MTk3LDMwIDIzLjk5MTIxMiwzMCBMOS4wMDg3ODc5OSwzMCBDNy4zNDU1OTAxOSwzMCA2LDI4LjY1MjYxMSA2LDI2Ljk5MDUyMjQgTDYsMTcuMDA5NDc3NiBDNiwxNS4zMzk1ODEgNy4zNDIzMzM0OSwxNC4wMDQ3MTUyIDksMTQuMDAwMDEyNSBMOSwxNC4wMDAwMTI1IEw5LDE0LjAwMDAxMjUgWiBNMTIsMTQgTDEyLDEwLjUwMDg1MzcgQzEyLDguMDA5MjQ3OCAxNC4wMTQ3MTg2LDYgMTYuNSw2IEMxOC45ODAyMjQzLDYgMjEsOC4wMTUxMDA4MiAyMSwxMC41MDA4NTM3IEwyMSwxNCBMMTIsMTQgTDEyLDE0IEwxMiwxNCBaIiBpZD0ibG9jayIvPjwvZz48L2c+PC9zdmc+") 8px center no-repeat !important;
|
114 |
-
background-size: 18px !important;
|
115 |
-
padding-left: 36px;
|
116 |
-
}
|
117 |
-
</style>
|
118 |
-
|
119 |
-
</head>
|
120 |
-
<body class="w3eden">
|
121 |
-
<div id="wpdm-download" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="wpdm-download-title" aria-hidden="true">
|
122 |
-
<div class="modal-dialog modal-dialog-centered" role="document">
|
123 |
-
<div id="__error" class="alert alert-danger position-absolute" style="display: none;z-index: 999999;width: 100%;top: 0;border: 0;background: #ffe4ed;border-bottom: 2px solid #df1d5d;color: #df1d5d;font-size: 10pt"><?php _e('Wrong Password. Try Again!'); ?></div>
|
124 |
-
<div class="modal-content">
|
125 |
-
<?php if(!$user_allowed){ ?>
|
126 |
-
<div class="modal-body">
|
127 |
-
<div class="text-danger lead text-center p-4" style="font-weight: 300;font-size: 13pt;line-height: 30px">
|
128 |
-
<div class="d-inline-block">
|
129 |
-
<svg id="Layer_1" style="width: 28px;height: 28px" version="1.1" viewBox="0 0 64 64" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style type="text/css">
|
130 |
-
.st0{fill:var(--color-danger);}
|
131 |
-
</style><g><g id="Icon-Exclamation" transform="translate(228.000000, 278.000000)"><path class="st0" d="M-196-222.1c-13.2,0-23.9-10.7-23.9-23.9c0-13.2,10.7-23.9,23.9-23.9s23.9,10.7,23.9,23.9 C-172.1-232.8-182.8-222.1-196-222.1L-196-222.1z M-196-267.3c-11.7,0-21.3,9.6-21.3,21.3s9.6,21.3,21.3,21.3s21.3-9.6,21.3-21.3 S-184.3-267.3-196-267.3L-196-267.3z" id="Fill-49"/><polygon class="st0" id="Fill-50" points="-197.4,-236.1 -194.6,-236.1 -194.6,-233.3 -197.4,-233.3 "/><polyline class="st0" id="Fill-51" points="-195.2,-238.9 -196.8,-238.9 -197.4,-250.2 -197.4,-258.7 -194.6,-258.7 -194.6,-250.2 -195.2,-238.9 "/></g></g></svg>
|
132 |
-
</div>
|
133 |
-
<?php echo __( "File not found!", "download-manager" ); ?>
|
134 |
-
</div>
|
135 |
-
</div>
|
136 |
-
<?php } else { ?>
|
137 |
-
<div class="modal-body">
|
138 |
-
<div class="media">
|
139 |
-
<?php if($picon !== ''){ ?>
|
140 |
-
<div class="mr-3">
|
141 |
-
<?php echo $picon; ?>
|
142 |
-
</div>
|
143 |
-
<?php } ?>
|
144 |
-
<div class="media-body">
|
145 |
-
<h1><?php echo $media->post_title; ?></h1>
|
146 |
-
<p>
|
147 |
-
Updated on <?php echo date(get_option('date_format'), strtotime($media->post_modified)); ?> <?php echo date(get_option('time_format'), strtotime($media->post_modified)); ?>
|
148 |
-
</p>
|
149 |
-
</div>
|
150 |
-
</div>
|
151 |
-
</div>
|
152 |
-
<div class="modal-footer">
|
153 |
-
<?php if($password){ ?>
|
154 |
-
<form method="post" id="__vpass" action="<?php echo admin_url('admin-ajax.php'); ?>">
|
155 |
-
<?php wp_nonce_field(NONCE_KEY, '__xnonce'); ?>
|
156 |
-
<input type="hidden" name="__meida" value="<?php echo $__hash; ?>">
|
157 |
-
<input type="hidden" name="action" value="wpdm_media_pass">
|
158 |
-
<div class="input-group">
|
159 |
-
<input name="__pswd" required="required" id="__pwd" autocomplete="off" placeholder="<?php echo __( "Media Password", "download-manager" ); ?>" class="form-control" type="password">
|
160 |
-
<div class="input-group-append">
|
161 |
-
<button class="btn btn-primary" type="submit"><?php echo __( "Download", "download-manager" ); ?></button>
|
162 |
-
</div>
|
163 |
-
</div>
|
164 |
-
</form>
|
165 |
-
<script>
|
166 |
-
jQuery(function ($) {
|
167 |
-
$('#__vpass').on('submit', function (e) {
|
168 |
-
$('#__vpass').addClass('blockui');
|
169 |
-
e.preventDefault();
|
170 |
-
$(this).ajaxSubmit({
|
171 |
-
success: function (res) {
|
172 |
-
if(res.success){
|
173 |
-
location.href = "<?php echo home_url('/?__mediakey='); ?>"+res.__mediakey;
|
174 |
-
} else {
|
175 |
-
$('#__error').html(res.error).fadeIn();
|
176 |
-
$('#__vpass').removeClass('blockui');
|
177 |
-
}
|
178 |
-
|
179 |
-
}
|
180 |
-
})
|
181 |
-
});
|
182 |
-
});
|
183 |
-
</script>
|
184 |
-
<?php } ?>
|
185 |
-
<?php if(!$password){ ?>
|
186 |
-
<button href="<?php echo $download_url; ?>" class="btn btn-primary btn-block btn-download">
|
187 |
-
Download [ <?php echo $media->filesize; ?> ]
|
188 |
-
</button>
|
189 |
-
<?php } ?>
|
190 |
-
</div>
|
191 |
-
|
192 |
-
<?php } ?>
|
193 |
-
|
194 |
-
</div>
|
195 |
-
|
196 |
-
</div>
|
197 |
-
</div>
|
198 |
-
|
199 |
-
<script>
|
200 |
-
jQuery(function ($) {
|
201 |
-
$('#wpdm-download').modal({backdrop: 'static'});
|
202 |
-
});
|
203 |
-
</script>
|
204 |
-
</body>
|
205 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Package/views/all-packages-shortcode.php
CHANGED
@@ -26,9 +26,6 @@ if(isset($params['jstable']) && $params['jstable']==1):
|
|
26 |
$datatable_order = ( isset($params['order']) && $params['order'] == 'DESC' ) ? 'desc' : 'asc';
|
27 |
|
28 |
?>
|
29 |
-
<script src="<?php echo WPDM_BASE_URL.'assets/js/jquery.dataTables.min.js' ?>"></script>
|
30 |
-
<script src="<?php echo WPDM_BASE_URL.'assets/js/dataTables.bootstrap4.min.js' ?>"></script>
|
31 |
-
<link href="<?php echo WPDM_BASE_URL.'assets/css/jquery.dataTables.min.css' ?>" rel="stylesheet" />
|
32 |
|
33 |
<script>
|
34 |
jQuery(function($){
|
@@ -65,7 +62,7 @@ if(isset($params['jstable']) && $params['jstable']==1):
|
|
65 |
});
|
66 |
|
67 |
<?php if(count($_GET) > 0){ ?>
|
68 |
-
$("div.wpdmdt-toolbar .dataTables_filter").append('<a href="<?php the_permalink(); ?>" class="btn btn-secondary ml-3" style="margin-top: -5px;border: 0;"
|
69 |
<?php } ?>
|
70 |
});
|
71 |
</script>
|
26 |
$datatable_order = ( isset($params['order']) && $params['order'] == 'DESC' ) ? 'desc' : 'asc';
|
27 |
|
28 |
?>
|
|
|
|
|
|
|
29 |
|
30 |
<script>
|
31 |
jQuery(function($){
|
62 |
});
|
63 |
|
64 |
<?php if(count($_GET) > 0){ ?>
|
65 |
+
$("div.wpdmdt-toolbar .dataTables_filter").append('<a href="<?php the_permalink(); ?>" class="btn btn-secondary ml-3" style="margin-top: -5px;border: 0;"><?php echo esc_attr__( 'Reset Filter', WPDM_TEXT_DOMAIN ); ?></a>');
|
66 |
<?php } ?>
|
67 |
});
|
68 |
</script>
|
src/Package/views/datatable.php
CHANGED
@@ -219,7 +219,7 @@ $_scparams = \WPDM\__\Crypt::encrypt($scparams);
|
|
219 |
</div>
|
220 |
</div>
|
221 |
</div>
|
222 |
-
<script src="
|
223 |
<script>
|
224 |
var datatable_<?php echo $scid; ?> = new Vue({
|
225 |
el: '#wpdm_datatable_<?php echo $scid; ?>',
|
219 |
</div>
|
220 |
</div>
|
221 |
</div>
|
222 |
+
<script src="<?php echo WPDM_BASE_URL ?>assets/js/vue.min.js"></script>
|
223 |
<script>
|
224 |
var datatable_<?php echo $scid; ?> = new Vue({
|
225 |
el: '#wpdm_datatable_<?php echo $scid; ?>',
|
src/Package/views/download-page-clean.php
CHANGED
@@ -13,7 +13,7 @@ if (!defined('ABSPATH')) die();
|
|
13 |
<head>
|
14 |
<title><?php echo $package->post_title; ?></title>
|
15 |
<script>
|
16 |
-
var wpdm_url =
|
17 |
</script>
|
18 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
|
19 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
13 |
<head>
|
14 |
<title><?php echo $package->post_title; ?></title>
|
15 |
<script>
|
16 |
+
var wpdm_url = <?php echo json_encode(WPDM()->wpdm_urls) ?>;
|
17 |
</script>
|
18 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
|
19 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
src/Package/views/lock-options-iframe.php
CHANGED
@@ -5,7 +5,7 @@ if (!defined('ABSPATH')) die();
|
|
5 |
* Date: 1/16/18
|
6 |
* Time: 12:33 AM
|
7 |
*/
|
8 |
-
|
9 |
//global $post;
|
10 |
$ID = wpdm_query_var('__wpdmlo');
|
11 |
//$post = get_post(wpdm_query_var('__wpdmlo'));
|
@@ -22,7 +22,7 @@ $base_price = (double)get_post_meta($ID, '__wpdm_base_price', true);
|
|
22 |
<?php if($form_lock === 1 || $base_price > 0) wp_head(); else { ?>
|
23 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.min.css" />
|
24 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
25 |
-
<link rel="stylesheet" href="
|
26 |
<script src="<?php echo includes_url(); ?>/js/jquery/jquery.js"></script>
|
27 |
<script src="<?php echo includes_url(); ?>/js/jquery/jquery.form.min.js"></script>
|
28 |
<script src="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/js/bootstrap.min.js"></script>
|
5 |
* Date: 1/16/18
|
6 |
* Time: 12:33 AM
|
7 |
*/
|
8 |
+
|
9 |
//global $post;
|
10 |
$ID = wpdm_query_var('__wpdmlo');
|
11 |
//$post = get_post(wpdm_query_var('__wpdmlo'));
|
22 |
<?php if($form_lock === 1 || $base_price > 0) wp_head(); else { ?>
|
23 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.min.css" />
|
24 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
25 |
+
<link rel="stylesheet" href="<?php echo WPDM_FONTAWESOME_URL ?>" />
|
26 |
<script src="<?php echo includes_url(); ?>/js/jquery/jquery.js"></script>
|
27 |
<script src="<?php echo includes_url(); ?>/js/jquery/jquery.form.min.js"></script>
|
28 |
<script src="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/js/bootstrap.min.js"></script>
|
src/Package/views/lock-options/recaptcha-lock.php
CHANGED
@@ -10,7 +10,7 @@ if (!defined('ABSPATH')) die();
|
|
10 |
|
11 |
?>
|
12 |
<div class='panel panel-default card'><div class='panel-heading card-header'>
|
13 |
-
<span id="capc_label_<?php echo $package['ID']; ?>"
|
14 |
<span id="capcv_label_<?php echo $package['ID']; ?>" style="display: none"><?php _e( "Your Download Link is Ready" , "download-manager" ); ?></span>
|
15 |
</div>
|
16 |
<div class='panel-body card-body wpdm-social-locks text-center'>
|
10 |
|
11 |
?>
|
12 |
<div class='panel panel-default card'><div class='panel-heading card-header'>
|
13 |
+
<span id="capc_label_<?php echo $package['ID']; ?>"><?php echo esc_attr__("Verify CAPTCHA to Download", "download-manager"); ?></span>
|
14 |
<span id="capcv_label_<?php echo $package['ID']; ?>" style="display: none"><?php _e( "Your Download Link is Ready" , "download-manager" ); ?></span>
|
15 |
</div>
|
16 |
<div class='panel-body card-body wpdm-social-locks text-center'>
|
src/Package/views/shortcode-iframe.php
CHANGED
@@ -5,7 +5,7 @@ if (!defined('ABSPATH')) die();
|
|
5 |
* Date: 1/16/18
|
6 |
* Time: 12:33 AM
|
7 |
*/
|
8 |
-
|
9 |
|
10 |
$pid = wpdm_query_var('__wpdmxp');
|
11 |
//setup_postdata($post);
|
@@ -18,7 +18,7 @@ $pid = wpdm_query_var('__wpdmxp');
|
|
18 |
<head>
|
19 |
<title>Download <?php the_title(); ?></title>
|
20 |
<script>
|
21 |
-
var wpdm_url =
|
22 |
</script>
|
23 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
|
24 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
5 |
* Date: 1/16/18
|
6 |
* Time: 12:33 AM
|
7 |
*/
|
8 |
+
|
9 |
|
10 |
$pid = wpdm_query_var('__wpdmxp');
|
11 |
//setup_postdata($post);
|
18 |
<head>
|
19 |
<title>Download <?php the_title(); ?></title>
|
20 |
<script>
|
21 |
+
var wpdm_url = <?php echo json_encode(WPDM()->wpdm_urls) ?>;
|
22 |
</script>
|
23 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
|
24 |
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
src/User/Login.php
CHANGED
@@ -200,12 +200,12 @@ class Login
|
|
200 |
|
201 |
if (empty($_POST['user_login'])) {
|
202 |
die('error');
|
203 |
-
} elseif (
|
204 |
-
$user_data = get_user_by('email',
|
205 |
if (empty($user_data))
|
206 |
die('error');
|
207 |
} else {
|
208 |
-
$login =
|
209 |
$user_data = get_user_by('login', $login);
|
210 |
}
|
211 |
if (Session::get('__reset_time') && time() - Session::get('__reset_time') < 60) {
|
200 |
|
201 |
if (empty($_POST['user_login'])) {
|
202 |
die('error');
|
203 |
+
} elseif (is_email($_POST['user_login'])) {
|
204 |
+
$user_data = get_user_by('email', sanitize_email($_POST['user_login']));
|
205 |
if (empty($user_data))
|
206 |
die('error');
|
207 |
} else {
|
208 |
+
$login = sanitize_text_field($_POST['user_login']);
|
209 |
$user_data = get_user_by('login', $login);
|
210 |
}
|
211 |
if (Session::get('__reset_time') && time() - Session::get('__reset_time') < 60) {
|
src/User/views/dashboard/edit-profile.php
CHANGED
@@ -9,7 +9,7 @@ $user = get_userdata($current_user->ID);
|
|
9 |
<?php wp_nonce_field(NONCE_KEY, '__wpdm_epnonce'); ?>
|
10 |
<div class="card card-default dashboard-panel">
|
11 |
<div class="card-header bg-white">
|
12 |
-
<h3 class="m-0 pt-2 pb-2"><i class="fa fa-user-edit title-icon color-primary"></i>
|
13 |
</div>
|
14 |
<div class="card-body">
|
15 |
<div class="row">
|
@@ -55,7 +55,7 @@ $user = get_userdata($current_user->ID);
|
|
55 |
$('#edit_profile').on('submit', function (e) {
|
56 |
e.preventDefault();
|
57 |
var edit_profile_sbtn = $('#edit_profile_sbtn').html();
|
58 |
-
$('#edit_profile_sbtn').html("<i class='fa fa-sync fa-spin'></i>
|
59 |
$(this).ajaxSubmit({
|
60 |
success: function (res) {
|
61 |
WPDM.notify(res.msg, res.type, '#wpdm-fixed-top-center', 10000);
|
9 |
<?php wp_nonce_field(NONCE_KEY, '__wpdm_epnonce'); ?>
|
10 |
<div class="card card-default dashboard-panel">
|
11 |
<div class="card-header bg-white">
|
12 |
+
<h3 class="m-0 pt-2 pb-2"><i class="fa fa-user-edit title-icon color-primary"></i> <?php echo __('Basic Profile', WPDM_TEXT_DOMAIN); ?></h3>
|
13 |
</div>
|
14 |
<div class="card-body">
|
15 |
<div class="row">
|
55 |
$('#edit_profile').on('submit', function (e) {
|
56 |
e.preventDefault();
|
57 |
var edit_profile_sbtn = $('#edit_profile_sbtn').html();
|
58 |
+
$('#edit_profile_sbtn').html("<i class='fa fa-sync fa-spin'></i> <?php echo esc_attr__( 'Please Wait...', WPDM_TEXT_DOMAIN ) ?>").attr('disabled','disabled');
|
59 |
$(this).ajaxSubmit({
|
60 |
success: function (res) {
|
61 |
WPDM.notify(res.msg, res.type, '#wpdm-fixed-top-center', 10000);
|
src/User/views/login-form.php
CHANGED
@@ -29,7 +29,7 @@ if(!defined('ABSPATH')) die();
|
|
29 |
if($wpdm_signup_success == '') $wpdm_signup_success = apply_filters("wpdm_signup_success", __("Your account has been created successfully.", "download-manager"));
|
30 |
?>
|
31 |
<div class="alert alert-success dismis-on-click">
|
32 |
-
|
33 |
</div>
|
34 |
<?php
|
35 |
}
|
@@ -39,16 +39,16 @@ if(!defined('ABSPATH')) die();
|
|
39 |
<?php
|
40 |
if(isset($params['note_before']) && $params['note_before'] !== '') { ?>
|
41 |
<div class="alert alert-info alert-note-before mb-3" >
|
42 |
-
|
43 |
</div>
|
44 |
<?php } ?>
|
45 |
|
46 |
-
|
47 |
|
48 |
|
49 |
<?php if(isset($params['note_after']) && $params['note_before'] !== '') { ?>
|
50 |
<div class="alert alert-info alter-note-after mb-3" >
|
51 |
-
|
52 |
</div>
|
53 |
<?php } ?>
|
54 |
|
29 |
if($wpdm_signup_success == '') $wpdm_signup_success = apply_filters("wpdm_signup_success", __("Your account has been created successfully.", "download-manager"));
|
30 |
?>
|
31 |
<div class="alert alert-success dismis-on-click">
|
32 |
+
<?php echo $wpdm_signup_success; ?>
|
33 |
</div>
|
34 |
<?php
|
35 |
}
|
39 |
<?php
|
40 |
if(isset($params['note_before']) && $params['note_before'] !== '') { ?>
|
41 |
<div class="alert alert-info alert-note-before mb-3" >
|
42 |
+
<?php echo esc_attr($params['note_before']); ?>
|
43 |
</div>
|
44 |
<?php } ?>
|
45 |
|
46 |
+
<?php echo $this->formFields($params); ?>
|
47 |
|
48 |
|
49 |
<?php if(isset($params['note_after']) && $params['note_before'] !== '') { ?>
|
50 |
<div class="alert alert-info alter-note-after mb-3" >
|
51 |
+
<?php echo esc_attr($params['note_after']); ?>
|
52 |
</div>
|
53 |
<?php } ?>
|
54 |
|
src/User/views/reg-form.php
CHANGED
@@ -26,7 +26,7 @@
|
|
26 |
</div>
|
27 |
<?php } ?>
|
28 |
|
29 |
-
|
30 |
|
31 |
<?php if(isset($params['note_after']) && trim($params['note_after']) != '') { ?>
|
32 |
<div class="alert alert-info alter-note-after mb-3" >
|
26 |
</div>
|
27 |
<?php } ?>
|
28 |
|
29 |
+
<?php echo $form_html; ?>
|
30 |
|
31 |
<?php if(isset($params['note_after']) && trim($params['note_after']) != '') { ?>
|
32 |
<div class="alert alert-info alter-note-after mb-3" >
|
src/__/Apply.php
CHANGED
@@ -708,40 +708,40 @@ class Apply
|
|
708 |
<style>
|
709 |
|
710 |
:root {
|
711 |
-
--color-primary: <?php echo
|
712 |
-
--color-primary-rgb: <?php echo wpdm_hex2rgb($primary); ?>;
|
713 |
-
--color-primary-hover: <?php echo
|
714 |
-
--color-primary-active: <?php echo
|
715 |
-
--color-secondary: <?php echo
|
716 |
-
--color-secondary-rgb: <?php echo wpdm_hex2rgb($secondary); ?>;
|
717 |
-
--color-secondary-hover: <?php echo
|
718 |
-
--color-secondary-active: <?php echo
|
719 |
-
--color-success: <?php echo $success; ?>;
|
720 |
-
--color-success-rgb: <?php echo wpdm_hex2rgb($success); ?>;
|
721 |
-
--color-success-hover: <?php echo
|
722 |
-
--color-success-active: <?php echo
|
723 |
-
--color-info: <?php echo
|
724 |
-
--color-info-rgb: <?php echo wpdm_hex2rgb($info); ?>;
|
725 |
-
--color-info-hover: <?php echo
|
726 |
-
--color-info-active: <?php echo
|
727 |
-
--color-warning: <?php echo
|
728 |
-
--color-warning-rgb: <?php echo wpdm_hex2rgb($warning); ?>;
|
729 |
-
--color-warning-hover: <?php echo
|
730 |
-
--color-warning-active: <?php echo
|
731 |
-
--color-danger: <?php echo $danger; ?>;
|
732 |
--color-danger-rgb: <?php echo wpdm_hex2rgb($danger); ?>;
|
733 |
-
--color-danger-hover: <?php echo
|
734 |
-
--color-danger-active: <?php echo
|
735 |
-
--color-green: <?php echo
|
736 |
-
--color-blue: <?php echo
|
737 |
-
--color-purple: <?php echo
|
738 |
-
--color-red: <?php echo
|
739 |
--color-muted: rgba(69, 89, 122, 0.6);
|
740 |
-
--wpdm-font: <?php echo
|
741 |
}
|
742 |
|
743 |
-
.wpdm-download-link<?php echo $class; ?> {
|
744 |
-
border-radius: <?php echo (
|
745 |
}
|
746 |
|
747 |
|
708 |
<style>
|
709 |
|
710 |
:root {
|
711 |
+
--color-primary: <?php echo sanitize_text_field($primary); ?>;
|
712 |
+
--color-primary-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($primary)); ?>;
|
713 |
+
--color-primary-hover: <?php echo sanitize_text_field($uicolors['primary'] ?? '#4a8eff' ); ?>;
|
714 |
+
--color-primary-active: <?php echo sanitize_text_field($uicolors['primary'] ?? '#4a8eff' ); ?>;
|
715 |
+
--color-secondary: <?php echo sanitize_text_field($secondary); ?>;
|
716 |
+
--color-secondary-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($secondary)); ?>;
|
717 |
+
--color-secondary-hover: <?php echo sanitize_text_field($uicolors['secondary'] ?? '#4a8eff'); ?>;
|
718 |
+
--color-secondary-active: <?php echo sanitize_text_field($uicolors['secondary'] ?? '#4a8eff' ); ?>;
|
719 |
+
--color-success: <?php echo sanitize_text_field($success); ?>;
|
720 |
+
--color-success-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($success)); ?>;
|
721 |
+
--color-success-hover: <?php echo sanitize_text_field($uicolors['success_hover'] ?? '#4a8eff'); ?>;
|
722 |
+
--color-success-active: <?php echo sanitize_text_field($uicolors['success_active'] ?? '#4a8eff' ); ?>;
|
723 |
+
--color-info: <?php echo sanitize_text_field($info); ?>;
|
724 |
+
--color-info-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($info)); ?>;
|
725 |
+
--color-info-hover: <?php echo sanitize_text_field($uicolors['info_hover'] ?? '#2CA8FF' ); ?>;
|
726 |
+
--color-info-active: <?php echo sanitize_text_field($uicolors['info_active'] ?? '#2CA8FF'); ?>;
|
727 |
+
--color-warning: <?php echo sanitize_text_field($warning); ?>;
|
728 |
+
--color-warning-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($warning)); ?>;
|
729 |
+
--color-warning-hover: <?php echo sanitize_text_field($uicolors['warning_hover'] ?? 'orange' ); ?>;
|
730 |
+
--color-warning-active: <?php echo sanitize_text_field($uicolors['warning_active'] ?? 'orange'); ?>;
|
731 |
+
--color-danger: <?php echo sanitize_text_field($danger); ?>;
|
732 |
--color-danger-rgb: <?php echo wpdm_hex2rgb($danger); ?>;
|
733 |
+
--color-danger-hover: <?php echo sanitize_text_field($uicolors['danger_hover'] ?? '#ff5062'); ?>;
|
734 |
+
--color-danger-active: <?php echo sanitize_text_field($uicolors['danger_active'] ?? '#ff5062'); ?>;
|
735 |
+
--color-green: <?php echo sanitize_text_field($uicolors['green'] ?? '#30b570'); ?>;
|
736 |
+
--color-blue: <?php echo sanitize_text_field($uicolors['blue'] ?? '#0073ff'); ?>;
|
737 |
+
--color-purple: <?php echo sanitize_text_field($uicolors['purple'] ?? '#8557D3'); ?>;
|
738 |
+
--color-red: <?php echo sanitize_text_field($uicolors['red'] ?? '#ff5062'); ?>;
|
739 |
--color-muted: rgba(69, 89, 122, 0.6);
|
740 |
+
--wpdm-font: <?php echo sanitize_text_field($font); ?> -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
741 |
}
|
742 |
|
743 |
+
.wpdm-download-link<?php echo sanitize_text_field($class); ?> {
|
744 |
+
border-radius: <?php echo (int)($ui_button['borderradius'] ?? 4 ); ?>px;
|
745 |
}
|
746 |
|
747 |
|
src/__/FileSystem.php
CHANGED
@@ -61,8 +61,6 @@ class FileSystem
|
|
61 |
|
62 |
$bandwidth = 0;
|
63 |
|
64 |
-
if (function_exists('ini_set'))
|
65 |
-
@ini_set('display_errors', 0);
|
66 |
|
67 |
@session_write_close();
|
68 |
|
61 |
|
62 |
$bandwidth = 0;
|
63 |
|
|
|
|
|
64 |
|
65 |
@session_write_close();
|
66 |
|
src/__/Messages.php
CHANGED
@@ -31,13 +31,7 @@ class Messages {
|
|
31 |
if($die==0)
|
32 |
echo $message;
|
33 |
if($die==1) {
|
34 |
-
$
|
35 |
-
<div style='text-align: center;height: 100%;display: table-cell;vertical-align: middle'>
|
36 |
-
<div style='max-width: 70% !important;display: inline-block;font-size: 13pt'>
|
37 |
-
$message
|
38 |
-
</div></div></div>";
|
39 |
-
include Template::locate("blank.php", __DIR__.'/views');
|
40 |
-
die();
|
41 |
}
|
42 |
return true;
|
43 |
}
|
31 |
if($die==0)
|
32 |
echo $message;
|
33 |
if($die==1) {
|
34 |
+
wp_die($message);
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
return true;
|
37 |
}
|
src/__/Updater.php
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace WPDM\__;
|
5 |
-
|
6 |
-
|
7 |
-
class Updater
|
8 |
-
{
|
9 |
-
function __construct()
|
10 |
-
{
|
11 |
-
add_action('admin_footer', [$this, 'requestUpdateCheck']);
|
12 |
-
add_action("wp_ajax_wpdm_check_update", [$this, 'checkUpdate']);
|
13 |
-
}
|
14 |
-
|
15 |
-
function getLatestVersions()
|
16 |
-
{
|
17 |
-
$latest = get_option('wpdm_latest', false);
|
18 |
-
$latest_check = get_option('wpdm_latest_check');
|
19 |
-
$time = time() - intval($latest_check);
|
20 |
-
if(!$latest || $time > 86400) {
|
21 |
-
$latest_v_url = 'https://wpdmcdn.s3-accelerate.amazonaws.com/versions.json';
|
22 |
-
$latest = wpdm_remote_get($latest_v_url);
|
23 |
-
update_option('wpdm_latest', $latest, false);
|
24 |
-
update_option('wpdm_latest_check', time(), false);
|
25 |
-
}
|
26 |
-
$latest = json_decode($latest);
|
27 |
-
$latest = (array)$latest;
|
28 |
-
return $latest;
|
29 |
-
}
|
30 |
-
|
31 |
-
function checkUpdate()
|
32 |
-
{
|
33 |
-
|
34 |
-
if (get_option('wpdm_update_notice') === 'disabled') die();
|
35 |
-
|
36 |
-
__::isAuthentic('__upcnonce', WPDM_PRI_NONCE, WPDM_ADMIN_CAP);
|
37 |
-
|
38 |
-
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
39 |
-
|
40 |
-
$latest = $this->getLatestVersions();
|
41 |
-
$plugins = get_plugins();
|
42 |
-
|
43 |
-
$page = wpdm_query_var('page');
|
44 |
-
$plugin_info_url = wpdm_query_var('plugin_url', 'url', 'https://www.wpdownloadmanager.com/purchases/');
|
45 |
-
if (is_array($latest)) {
|
46 |
-
foreach ($latest as $plugin_dir => $latestv) {
|
47 |
-
if ($plugin_dir !== 'download-manager') {
|
48 |
-
if (!($page == 'plugins' || get_post_type() == 'wpdmpro')) die('');
|
49 |
-
$plugin_data = wpdm_plugin_data($plugin_dir);
|
50 |
-
if(!is_array($plugin_data) || !isset($plugin_data['Name'])) continue;
|
51 |
-
$plugin_name = $plugin_data['Name'];
|
52 |
-
$plugin_info_url = isset($plugin_data['PluginURI']) ? $plugin_data['PluginURI'] : '';
|
53 |
-
$active = is_plugin_active($plugin_data['plugin_index_file']) ? 'active' : '';
|
54 |
-
$current_version = isset($plugin_data['Version']) ? $plugin_data['Version'] : '0';
|
55 |
-
if (version_compare($current_version, $latestv, '<') == true) {
|
56 |
-
$trid = sanitize_title($plugin_name);
|
57 |
-
$plugin_update_url = admin_url('/edit.php?post_type=wpdmpro&page=settings&tab=plugin-update&plugin=' . $plugin_dir); //'https://www.wpdownloadmanager.com/purchases/?'; //
|
58 |
-
if ($trid != '') {
|
59 |
-
wpdm_plugin_update_email($plugin_name, $latestv, $plugin_update_url);
|
60 |
-
if ($page == 'plugins') {
|
61 |
-
echo <<<NOTICE
|
62 |
-
<script type="text/javascript">
|
63 |
-
jQuery(function(){
|
64 |
-
jQuery('tr:data[data-slug={$trid}]').addClass('update').after('<tr class="plugin-update-tr {$active} update"><td colspan=3 class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p>There is a new version of <strong>{$plugin_name}</strong> available. <a href="{$plugin_update_url}&v={$latestv}" style="margin-left:10px" target=_blank>Update now ( v{$latestv} )</a></p></div></td></tr>');
|
65 |
-
});
|
66 |
-
</script>
|
67 |
-
NOTICE;
|
68 |
-
} else {
|
69 |
-
echo <<<NOTICE
|
70 |
-
<script type="text/javascript">
|
71 |
-
jQuery(function(){
|
72 |
-
jQuery('.wrap > h2').after('<div class="updated error" style="margin:10px 0px;padding:10px;border-left:2px solid #dd3d36;background: #ffffff"><div style="float:left;"><b style="color:#dd3d36;">Important!</b><br/>There is a new version of <u>{$plugin_name}</u> available.</div> <a style="border-radius:0; float:right;;color:#ffffff; background: #D54E21;padding:10px 15px;text-decoration: none;font-weight: bold;font-size: 9pt;letter-spacing:1px" href="{$plugin_update_url}&v={$latestv}" target=_blank><i class="fa fa-sync"></i> update v{$latestv}</a><div style="clear:both"></div></div>');
|
73 |
-
});
|
74 |
-
</script>
|
75 |
-
NOTICE;
|
76 |
-
}
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
}
|
82 |
-
}
|
83 |
-
if (__::is_ajax())
|
84 |
-
die('');
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Add js code in admin footer to sent update check request
|
89 |
-
*/
|
90 |
-
function requestUpdateCheck()
|
91 |
-
{
|
92 |
-
|
93 |
-
global $pagenow;
|
94 |
-
if (!current_user_can(WPDM_ADMIN_CAP)) return;
|
95 |
-
|
96 |
-
if(!in_array($pagenow, array('plugins.php'))) return;
|
97 |
-
$tmpvar = explode("?", basename($_SERVER['REQUEST_URI']));
|
98 |
-
$page = array_shift($tmpvar);
|
99 |
-
$page = explode(".", $page);
|
100 |
-
$page = array_shift($page);
|
101 |
-
|
102 |
-
|
103 |
-
$page = $page == 'plugins' ? $page : get_post_type();
|
104 |
-
|
105 |
-
?>
|
106 |
-
<script type="text/javascript">
|
107 |
-
jQuery(function () {
|
108 |
-
console.log('Checking WPDM Version!');
|
109 |
-
jQuery.post(ajaxurl, {
|
110 |
-
action: 'wpdm_check_update',
|
111 |
-
__upcnonce: '<?= wp_create_nonce(WPDM_PRI_NONCE) ?>',
|
112 |
-
page: '<?php echo $page; ?>'
|
113 |
-
}, function (res) {
|
114 |
-
jQuery('#wpfooter').after(res);
|
115 |
-
});
|
116 |
-
|
117 |
-
|
118 |
-
});
|
119 |
-
</script>
|
120 |
-
|
121 |
-
<?php
|
122 |
-
}
|
123 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/__/__.php
CHANGED
@@ -3,9 +3,11 @@
|
|
3 |
|
4 |
namespace WPDM\__;
|
5 |
|
6 |
-
|
7 |
class __
|
8 |
{
|
|
|
|
|
|
|
9 |
/**
|
10 |
* Get the client's IP address
|
11 |
*
|
@@ -38,14 +40,17 @@ class __
|
|
38 |
static function media_field($data)
|
39 |
{
|
40 |
ob_start();
|
|
|
|
|
|
|
41 |
?>
|
42 |
<div class="input-group">
|
43 |
-
<input placeholder="<?php echo $data['placeholder']; ?>" type="url" name="<?php echo $data['name']; ?>"
|
44 |
-
id="<?php echo
|
45 |
-
value="<?php echo
|
46 |
<span class="input-group-btn">
|
47 |
<button class="btn btn-default btn-media-upload" type="button"
|
48 |
-
rel="#<?php echo
|
49 |
class="fa fa-picture-o"></i></button>
|
50 |
</span>
|
51 |
</div>
|
@@ -239,7 +244,7 @@ class __
|
|
239 |
break;
|
240 |
case 'txt':
|
241 |
case 'str':
|
242 |
-
$value =
|
243 |
break;
|
244 |
case 'kses':
|
245 |
$allowedtags = wp_kses_allowed_html();
|
@@ -261,7 +266,7 @@ class __
|
|
261 |
$value = esc_html($value);
|
262 |
break;
|
263 |
case 'url':
|
264 |
-
$value =
|
265 |
break;
|
266 |
case 'noscript':
|
267 |
case 'escs':
|
@@ -448,30 +453,6 @@ class __
|
|
448 |
if(!current_user_can($access_level)) wp_send_json(['success' => false, 'message' => __( "You are not allowed to change settings!", "download-manager" )]);
|
449 |
}
|
450 |
|
451 |
-
static function p(...$args)
|
452 |
-
{
|
453 |
-
foreach ($args as $arg) {
|
454 |
-
echo "<pre>".print_r($arg, 1)."</pre>";
|
455 |
-
}
|
456 |
-
}
|
457 |
|
458 |
-
static function d(...$args)
|
459 |
-
{
|
460 |
-
foreach ($args as $arg) {
|
461 |
-
echo "<pre>".print_r($arg, 1)."</pre>";
|
462 |
-
}
|
463 |
-
die();
|
464 |
-
}
|
465 |
-
|
466 |
-
static function enqueueScript($script)
|
467 |
-
{
|
468 |
-
$script = esc_url_raw($script);
|
469 |
-
echo "<script src='{$script}'></script>";
|
470 |
-
}
|
471 |
|
472 |
-
static function enqueueStyle($style)
|
473 |
-
{
|
474 |
-
$style = esc_url_raw($style);
|
475 |
-
echo "<link rel='stylesheet' href='{$style}'/>";
|
476 |
-
}
|
477 |
}
|
3 |
|
4 |
namespace WPDM\__;
|
5 |
|
|
|
6 |
class __
|
7 |
{
|
8 |
+
|
9 |
+
static public $custom_scripts = [];
|
10 |
+
static public $custom_styles = [];
|
11 |
/**
|
12 |
* Get the client's IP address
|
13 |
*
|
40 |
static function media_field($data)
|
41 |
{
|
42 |
ob_start();
|
43 |
+
$id = uniqid();
|
44 |
+
$id = $data['id'] ?? $id;
|
45 |
+
$value = $data['value'] ?? "";
|
46 |
?>
|
47 |
<div class="input-group">
|
48 |
+
<input placeholder="<?php echo sanitize_text_field($data['placeholder']); ?>" type="url" name="<?php echo sanitize_text_field($data['name']); ?>"
|
49 |
+
id="<?php echo sanitize_text_field($id); ?>" class="form-control"
|
50 |
+
value="<?php echo sanitize_text_field($value); ?>"/>
|
51 |
<span class="input-group-btn">
|
52 |
<button class="btn btn-default btn-media-upload" type="button"
|
53 |
+
rel="#<?php echo sanitize_text_field($id); ?>"><i
|
54 |
class="fa fa-picture-o"></i></button>
|
55 |
</span>
|
56 |
</div>
|
244 |
break;
|
245 |
case 'txt':
|
246 |
case 'str':
|
247 |
+
$value = sanitize_text_field($value);
|
248 |
break;
|
249 |
case 'kses':
|
250 |
$allowedtags = wp_kses_allowed_html();
|
266 |
$value = esc_html($value);
|
267 |
break;
|
268 |
case 'url':
|
269 |
+
$value = esc_url_raw($value);
|
270 |
break;
|
271 |
case 'noscript':
|
272 |
case 'escs':
|
453 |
if(!current_user_can($access_level)) wp_send_json(['success' => false, 'message' => __( "You are not allowed to change settings!", "download-manager" )]);
|
454 |
}
|
455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
|
|
|
|
|
|
|
|
|
|
|
458 |
}
|
src/__/views/blank.php
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) die();
|
3 |
-
/**
|
4 |
-
* User: shahnuralam
|
5 |
-
* Date: 1/26/18
|
6 |
-
* Time: 12:33 AM
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
?>
|
11 |
-
<!DOCTYPE html>
|
12 |
-
<html style="background: transparent">
|
13 |
-
<head>
|
14 |
-
<title>Download <?php the_title(); ?></title>
|
15 |
-
<script>
|
16 |
-
var wpdm_url = <?= json_encode(WPDM()->wpdm_urls) ?>;
|
17 |
-
</script>
|
18 |
-
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
|
19 |
-
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
20 |
-
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/font-awesome/css/font-awesome.min.css" />
|
21 |
-
<link href="https://fonts.googleapis.com/css?family=Overpass:400,700" rel="stylesheet">
|
22 |
-
<!--
|
23 |
-
<script src="<?php echo includes_url(); ?>/js/jquery/jquery.js"></script>
|
24 |
-
<script src="<?php echo includes_url(); ?>/js/jquery/jquery.form.min.js"></script>
|
25 |
-
<script src="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/js/bootstrap.min.js"></script>
|
26 |
-
<script src="<?php echo WPDM_BASE_URL; ?>assets/js/front.js"></script>
|
27 |
-
-->
|
28 |
-
<?php
|
29 |
-
WPDM()->apply::uiColors();
|
30 |
-
?>
|
31 |
-
<style>
|
32 |
-
body{
|
33 |
-
font-family: Overpass, sans-serif;
|
34 |
-
font-weight: 400;
|
35 |
-
font-size: 14px;
|
36 |
-
}
|
37 |
-
.w3eden .alert:before{
|
38 |
-
text-transform: uppercase !important;
|
39 |
-
}
|
40 |
-
.w3eden .alert{
|
41 |
-
letter-spacing: 0.5px !important;
|
42 |
-
}
|
43 |
-
</style>
|
44 |
-
</head>
|
45 |
-
<body class="w3eden">
|
46 |
-
|
47 |
-
<?php
|
48 |
-
echo $content;
|
49 |
-
?>
|
50 |
-
|
51 |
-
</body>
|
52 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/__/views/message.php
CHANGED
@@ -7,51 +7,56 @@ if (!defined('ABSPATH')) die();
|
|
7 |
*/
|
8 |
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
<html style="background: transparent">
|
13 |
<head>
|
14 |
-
<
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
|
19 |
-
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
|
20 |
-
<link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/font-awesome/css/font-awesome.min.css" />
|
21 |
-
<link href="https://fonts.googleapis.com/css?family=Overpass:400,700" rel="stylesheet">
|
22 |
-
|
23 |
-
<?php
|
24 |
-
\WPDM\__\Apply::uiColors();
|
25 |
-
?>
|
26 |
<style>
|
27 |
body{
|
28 |
-
font-family:
|
29 |
-
|
30 |
-
|
31 |
}
|
32 |
-
.
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
-
|
36 |
-
|
|
|
|
|
37 |
}
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
40 |
}
|
41 |
-
.w3eden
|
42 |
-
|
43 |
}
|
|
|
44 |
</style>
|
45 |
</head>
|
46 |
-
<body
|
47 |
-
<div
|
48 |
-
<div
|
49 |
-
<div
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
</div
|
54 |
-
|
|
|
55 |
|
56 |
</body>
|
|
|
|
|
57 |
</html>
|
7 |
*/
|
8 |
|
9 |
|
10 |
+
?><!DOCTYPE html>
|
11 |
+
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
|
|
|
12 |
<head>
|
13 |
+
<meta http-equiv="Content-Type"
|
14 |
+
content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>"/>
|
15 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
16 |
+
<?php wp_head(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<style>
|
18 |
body{
|
19 |
+
font-family: var(--wpdm-font);
|
20 |
+
background: #ffffff url("<?php echo get_the_post_thumbnail_url(); ?>") no-repeat;
|
21 |
+
background-size: cover;
|
22 |
}
|
23 |
+
.outer {
|
24 |
+
display: table;
|
25 |
+
position: absolute;
|
26 |
+
top: 0;
|
27 |
+
left: 0;
|
28 |
+
height: 100%;
|
29 |
+
width: 100%;
|
30 |
}
|
31 |
+
|
32 |
+
.middle {
|
33 |
+
display: table-cell;
|
34 |
+
vertical-align: middle;
|
35 |
}
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
.w3eden .panel .panel-heading{
|
40 |
+
font-size: 10px;
|
41 |
}
|
42 |
+
.w3eden p{
|
43 |
+
margin: 15px 0 !important;
|
44 |
}
|
45 |
+
|
46 |
</style>
|
47 |
</head>
|
48 |
+
<body>
|
49 |
+
<div class="outer">
|
50 |
+
<div class="middle">
|
51 |
+
<div class="inner">
|
52 |
+
<?php
|
53 |
+
echo do_shortcode($msg);
|
54 |
+
?>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
|
59 |
</body>
|
60 |
+
|
61 |
+
|
62 |
</html>
|
src/__/views/template-preview.php
CHANGED
@@ -40,7 +40,7 @@
|
|
40 |
<div class="outer">
|
41 |
<div class="middle">
|
42 |
<div class="inner">
|
43 |
-
|
44 |
</div>
|
45 |
</div>
|
46 |
</div>
|
40 |
<div class="outer">
|
41 |
<div class="middle">
|
42 |
<div class="inner">
|
43 |
+
<?php echo wpdm_escs($template); ?>
|
44 |
</div>
|
45 |
</div>
|
46 |
</div>
|
src/wpdm-core.php
CHANGED
@@ -168,65 +168,6 @@ function wpdm_remote_get($url, $headers = [])
|
|
168 |
}
|
169 |
|
170 |
|
171 |
-
function is_valid_license_key()
|
172 |
-
{
|
173 |
-
$key = isset($_POST['_wpdm_license_key']) ? $_POST['_wpdm_license_key'] : get_option('_wpdm_license_key');
|
174 |
-
if($key === '') return false;
|
175 |
-
$post = isset($_POST['_wpdm_license_key']) ? 1 : 0;
|
176 |
-
$domain = strtolower(str_replace("www.", "", $_SERVER['HTTP_HOST']));
|
177 |
-
if($post === 0) {
|
178 |
-
$data = unserialize(base64_decode(get_option("wpdm_{$domain}")));
|
179 |
-
if (is_array($data)) {
|
180 |
-
//$data = unserialize(base64_decode(file_get_contents(WPDM_CACHE_DIR . "wpdm_{$domain}")));
|
181 |
-
if ($data[0] == md5($domain . $key) && $data[1] > time())
|
182 |
-
return true;
|
183 |
-
else
|
184 |
-
delete_option("wpdm_{$domain}");
|
185 |
-
}
|
186 |
-
if ((int)get_option('__wpdm_nlc') > time()) return false;
|
187 |
-
}
|
188 |
-
$res = wpdm_remote_post('https://www.wpdownloadmanager.com/', array('wpdmLicense' => 'validate', 'domain' => $domain, 'licenseKey' => $key, 'productId' => 'wpdmpro'));
|
189 |
-
$res = json_decode($res);
|
190 |
-
delete_option('__wpdm_core_update_check');
|
191 |
-
if ($res->status === 'VALID') {
|
192 |
-
//file_put_contents(WPDM_CACHE_DIR . "wpdm_{$domain}", base64_encode(serialize(array(md5($domain . $key), strtotime("+180 days")))));
|
193 |
-
update_option("wpdm_{$domain}", base64_encode(serialize(array(md5($domain . $key), $res->expire))), false);
|
194 |
-
update_option("__wpdm_license_det", json_encode($res), false);
|
195 |
-
update_option("__wpdm_nlc", $res->expire, false);
|
196 |
-
return true;
|
197 |
-
}
|
198 |
-
update_option("__wpdm_nlc", strtotime('+30 days'), false);
|
199 |
-
if (get_option('settings_ok') == '')
|
200 |
-
update_option('settings_ok', strtotime('+30 days'), false);
|
201 |
-
else {
|
202 |
-
$page = isset($_GET['page']) ? $_GET['page'] : "";
|
203 |
-
$time = (int)get_option('settings_ok');
|
204 |
-
if ($time < time() && $page == 'settings' && (!isset($_GET['tab']) || $_GET['tab'] != 'license')) {
|
205 |
-
die("<script>location.href='edit.php?post_type=wpdmpro&page=settings&tab=license';</script>");
|
206 |
-
}
|
207 |
-
}
|
208 |
-
return false;
|
209 |
-
}
|
210 |
-
|
211 |
-
function wpdm_access_token(){
|
212 |
-
$at = get_option("__wpdm_access_token", false);
|
213 |
-
if($at)
|
214 |
-
return $at;
|
215 |
-
if(get_option('__wpdm_suname') != '') {
|
216 |
-
$auth = array('login' => get_option('__wpdm_suname'), 'pass' => get_option('__wpdm_supass'));
|
217 |
-
$auth = base64_encode(serialize($auth));
|
218 |
-
$access_token = wpdm_remote_get('https://www.wpdownloadmanager.com/?wpdm_api_req=getAccessToken&__wpdm_auth=' . $auth);
|
219 |
-
$access_token = json_decode($access_token);
|
220 |
-
//wpdmdd($access_token);
|
221 |
-
if (isset($access_token->access_token)) {
|
222 |
-
update_option("__wpdm_access_token", $access_token->access_token, false);
|
223 |
-
return $access_token->access_token;
|
224 |
-
}
|
225 |
-
}
|
226 |
-
return '';
|
227 |
-
}
|
228 |
-
|
229 |
-
|
230 |
function wpdm_plugin_data($dir)
|
231 |
{
|
232 |
$plugins = get_plugins();
|
@@ -238,44 +179,12 @@ function wpdm_plugin_data($dir)
|
|
238 |
return false;
|
239 |
}
|
240 |
|
241 |
-
function wpdm_plugin_update_email($plugin_name, $version, $update_url)
|
242 |
-
{
|
243 |
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
$message = 'New version available. Please update your copy.<br/><table class="email" style="width: 100%" cellpadding="5px"><tr><th>Plugin Name</th><th>Version</th></tr><tr><td>' . $plugin_name . '</td><td>' . $version . '</td></tr></table><div style="padding-top: 10px;"><a style="display: block;text-align: center" class="button" href="' . $update_url . '">Update Now</a></div>';
|
250 |
-
|
251 |
-
$params = array(
|
252 |
-
'subject' => sprintf(__("[%s] Update Available"), $plugin_name, 'download-manager'),
|
253 |
-
'to_email' => get_option('admin_email'),
|
254 |
-
'from_name' => 'WordPress Download Manager',
|
255 |
-
'from_email' => 'support@wpdownloadmanager.com',
|
256 |
-
'message' => $message
|
257 |
-
);
|
258 |
-
|
259 |
-
\WPDM\__\Email::send("default", $params);
|
260 |
-
update_option($hash, 1, false);
|
261 |
-
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
function wpdm_ldetails($license_key = null){
|
266 |
-
$lic_det = get_option('__wpdm_license_det');
|
267 |
-
$lic_det = json_decode($lic_det);
|
268 |
-
return $lic_det;
|
269 |
-
}
|
270 |
-
|
271 |
-
if (!isset($_REQUEST['P3_NOCACHE'])) {
|
272 |
-
|
273 |
-
$files = scandir(dirname(__FILE__) . '/Modules/');
|
274 |
-
foreach ($files as $file) {
|
275 |
-
$tmpdata = explode(".", $file);
|
276 |
-
if ($file != '.' && $file != '..' && !@is_dir($file) && end($tmpdata) == 'php')
|
277 |
-
include(dirname(__FILE__) . '/Modules/' . $file);
|
278 |
-
}
|
279 |
}
|
280 |
|
281 |
function wpdmpro_required(){
|
168 |
}
|
169 |
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
function wpdm_plugin_data($dir)
|
172 |
{
|
173 |
$plugins = get_plugins();
|
179 |
return false;
|
180 |
}
|
181 |
|
|
|
|
|
182 |
|
183 |
+
$files = scandir(dirname(__FILE__) . '/Modules/');
|
184 |
+
foreach ($files as $file) {
|
185 |
+
$tmpdata = explode(".", $file);
|
186 |
+
if ($file != '.' && $file != '..' && !@is_dir($file) && end($tmpdata) == 'php')
|
187 |
+
include(dirname(__FILE__) . '/Modules/' . $file);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
|
190 |
function wpdmpro_required(){
|
src/wpdm-functions.php
CHANGED
@@ -53,7 +53,7 @@ function wpdm_download_file($filepath, $filename, $speed = 0, $resume_support =
|
|
53 |
{
|
54 |
do_action("wpdm_download_success", $extras);
|
55 |
if (!file_exists($filepath)) Messages::fullPage("Download Error", "<div class='card bg-danger text-white text-left' style='min-width: 300px'><div class='card-header'>" . __("Download Error", "download-manager") . "</div><div class='card-body'>" . __("File Not Found!", "download-manager") . "</div></div>");
|
56 |
-
if (isset($_GET['play'])) $extras['play'] = $_GET['play'];
|
57 |
\WPDM\__\FileSystem::downloadFile($filepath, $filename, $speed, $resume_support, $extras);
|
58 |
}
|
59 |
|
53 |
{
|
54 |
do_action("wpdm_download_success", $extras);
|
55 |
if (!file_exists($filepath)) Messages::fullPage("Download Error", "<div class='card bg-danger text-white text-left' style='min-width: 300px'><div class='card-header'>" . __("Download Error", "download-manager") . "</div><div class='card-body'>" . __("File Not Found!", "download-manager") . "</div></div>");
|
56 |
+
if (isset($_GET['play'])) $extras['play'] = sanitize_text_field($_GET['play']);
|
57 |
\WPDM\__\FileSystem::downloadFile($filepath, $filename, $speed, $resume_support, $extras);
|
58 |
}
|
59 |
|
src/wpdm-start-download.php
CHANGED
@@ -7,7 +7,6 @@ use WPDM\__\TempStorage;
|
|
7 |
|
8 |
if(!defined("ABSPATH")) die('!');
|
9 |
|
10 |
-
error_reporting(0);
|
11 |
|
12 |
global $current_user, $dfiles;
|
13 |
|
7 |
|
8 |
if(!defined("ABSPATH")) die('!');
|
9 |
|
|
|
10 |
|
11 |
global $current_user, $dfiles;
|
12 |
|