first commit

This commit is contained in:
2026-04-28 15:13:50 +02:00
commit a95acc355b
63745 changed files with 9487948 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<div class="dlm_mb_shop_product_information">
<?php do_action( 'dlm_mb_product_information_start', $product->get_id(), $product ); ?>
<p class="dlm_shop_field_row">
<label class="dlm_shop_field_label"><?php printf( esc_html__( 'Price (%s)', 'download-monitor' ), esc_html( \WPChill\DownloadMonitor\Shop\Services\Services::get()->service( 'currency' )->get_currency_symbol() ) ); ?></label>
<span class="dlm_shop_field_input">
<input type="text" name="_dlm_price" value="<?php echo esc_attr( $price ); ?>" class="dlm_shop_input" >
</span>
</p>
<p class="dlm_shop_field_row">
<label class="dlm_shop_field_label"><?php printf( esc_html__( 'Downloads', 'download-monitor' ), esc_html( \WPChill\DownloadMonitor\Shop\Services\Services::get()->service( 'currency' )->get_currency_symbol() ) ); ?></label>
<span class="dlm_shop_field_input">
<select id="dlm_downloads" name="_dlm_downloads[]"
multiple="true"
data-placeholder="<?php echo esc_attr__( 'Select Downloads&hellip;', 'download-monitor' ); ?>"
class="dlm-select-ext dlm_shop_input">
<?php if ( ! empty( $downloads ) ) : ?>
<?php foreach ( $downloads as $download ) : ?>
<option value="<?php echo esc_attr( $download->get_id() ); ?>" <?php selected( in_array( $download->get_id(), $current_download_ids ), true ); ?>><?php echo esc_html( $download->get_title() ); ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</span>
</p>
<?php do_action( 'dlm_mb_product_information_end', $product->get_id(), $product ); ?>
</div>

View File

@@ -0,0 +1,206 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
?>
<div class="dlm-metabox closed downloadable_file" data-file="<?php echo esc_html( $file_id ); ?>">
<h3>
<span type="button"
class="remove_file dashicons dashicons-trash"></span>
<div class="handlediv" title="<?php echo esc_attr__( 'Click to toggle', 'download-monitor' ); ?>"></div>
<span class="dlm-version-info">
<span>#<?php echo esc_html( $file_id ); ?></span>
<span><span
class="dashicons dashicons-media-text"></span><?php echo esc_html__( 'Version: ', 'download-monitor' ) . '<span class="dlm-version-info__version">' . ( ( $file_version ) ? esc_html( $file_version ) : esc_html__( 'n/a', 'download-monitor' ) ); ?></span></span>
<span><span
class="dashicons dashicons-calendar-alt"></span><?php echo esc_html( date_i18n( $date_format, $file_post_date->format( 'U' ) ) ); ?></span>
<span><span
class="dashicons dashicons-download"></span><?php echo sprintf( __( '%s downloads', 'download-monitor' ), ( ( ! empty( $file_download_count ) ) ? esc_html( $file_download_count ) : 0 ) ); ?></span>
</span>
<input type="hidden" name="downloadable_file_id[<?php echo esc_attr( $version_increment ); ?>]"
value="<?php echo esc_attr( $file_id ); ?>"/>
<input type="hidden" class="file_menu_order"
name="downloadable_file_menu_order[<?php echo esc_attr( $version_increment ); ?>]"
value="<?php echo esc_attr( $version_increment ); ?>"/>
</h3>
<div class="dlm-metabox-content">
<tbody>
<?php do_action( 'dlm_downloadable_file_version_table_start', $file_id, $version_increment ); ?>
<div class="dlm-file-version__row">
<div class="dlm-uploading-file hidden">
<label><?php esc_html_e( 'Uploading file:', 'download-monitor' ) ?> <span></span></label>
<label
class="dlm-file-uploaded hidden"><?php esc_html_e( 'File uploaded.', 'download-monitor' ) ?></label>
<div class="dlm-uploading-progress-bar"></div>
</div>
<div
class="dlm-file-version__drag_and_drop dlm-uploader-container <?php echo ( ! empty( $file_urls ) ) ? 'hidden' : ''; ?>">
<div class="dlm-file-version__uploader">
<div id="plupload-upload-ui" class="hide-if-no-js drag-drop">
<div id="drag-drop-area" style="position: relative;">
<div class="drag-drop-inside">
<p class="drag-drop-info"
style="letter-spacing: 1px;font-size: 10pt"><?php esc_html_e( 'Drag & Drop here', 'download-monitor' ); ?></p>
<p>
</p>
<p>— or —</p>
<p>
<?php
$buttons = array(
'upload_file' => array(
'text' => __( 'Upload file', 'download-monitor' )
),
'media_library' => array(
'text' => __( 'Media Library', 'download-monitor' ),
'data' => array(
'choose' => __( 'Choose a file', 'download-monitor' ),
'update' => __( 'Insert file URL', 'download-monitor' ),
)
),
'external_source' => array(
'text' => __( 'Custom URL', 'download-monitor' )
)
);
if ( ! $file_browser ) {
$buttons['browse_for_file'] = array( 'text' => __( 'Browse for file', 'download-monitor' ) );
}
$buttons = apply_filters( 'dlm_downloadable_file_version_buttons', $buttons );
foreach ( $buttons as $key => $button ) {
echo '<a href="#" class="button dlm_' . esc_attr( $key ) . '" ';
if ( ! empty( $button['data'] ) ) {
foreach ( $button['data'] as $data_key => $data_value ) {
echo 'data-' . esc_attr( $data_key ) . '="' . esc_attr( $data_value ) . '" ';
}
}
echo '>' . esc_html( $button['text'] ) . '</a> ';
}
?>
</p>
</div>
</div>
</div>
</div>
</div>
<div
class="dlm-file-version__file_present dlm-uploader-container <?php echo ( empty( $file_urls ) ) ? 'hidden' : ''; ?>">
<label><?php echo esc_html__( 'File URL(s); note: only enter multiple URLs in here if you want to use file mirrors', 'download-monitor' ); ?></label>
<div class="dlm-uploading-file hidden">
<label><?php esc_html_e( 'Uploading file:', 'download-monitor' ) ?> <span></span></label>
<label
class="dlm-file-uploaded hidden"><?php esc_html_e( 'File uploaded.', 'download-monitor' ) ?></label>
<div class="dlm-uploading-progress-bar"></div>
</div>
<textarea name="downloadable_file_urls[<?php echo esc_attr( $version_increment ); ?>]" wrap="off"
class="downloadable_file_urls"
cols="5" rows="5"
placeholder="<?php echo esc_attr__( 'Enter one file path/URL per line - multiple files will be used as mirrors (chosen at random).', 'download-monitor' ); ?>"><?php echo esc_textarea( implode( "\n", $file_urls ) ); ?></textarea>
<p>
<?php
$buttons = array(
'upload_file' => array(
'text' => __( 'Upload file', 'download-monitor' )
),
'media_library' => array(
'text' => __( 'Media Library', 'download-monitor' ),
'data' => array(
'choose' => __( 'Choose a file', 'download-monitor' ),
'update' => __( 'Insert file URL', 'download-monitor' ),
)
)
);
if ( ! $file_browser ) {
$buttons['browse_for_file'] = array( 'text' => __( 'Browse for file', 'download-monitor' ) );
}
$buttons = apply_filters( 'dlm_downloadable_file_version_buttons', $buttons );
foreach ( $buttons as $key => $button ) {
echo '<a href="#" class="button dlm_' . esc_attr( $key ) . '" ';
if ( ! empty( $button['data'] ) ) {
foreach ( $button['data'] as $data_key => $data_value ) {
echo 'data-' . esc_attr( $data_key ) . '="' . esc_attr( $data_value ) . '" ';
}
}
echo '>' . esc_html( $button['text'] ) . '</a> ';
}
?>
&nbsp;&nbsp;<?php echo sprintf( esc_html__( 'You can use %sDrag & Drop%s to upload files', 'download-monitor' ), '<strong>', '</strong>' ); ?>
</p>
</div>
</div>
<div class="dlm-file-version__row ">
<div class="dlm-file-version__inline">
<div>
<label><?php echo esc_html__( 'Version', 'download-monitor' ); ?>:</label>
<input type="text" class="short"
name="downloadable_file_version[<?php echo esc_attr( $version_increment ); ?>]"
placeholder="<?php echo esc_attr__( 'n/a', 'download-monitor' ); ?>"
value="<?php echo esc_attr( $file_version ); ?>"/>
</div>
<div>
<label><?php echo esc_html__( 'Manual download count', 'download-monitor' ); ?>:</label>
<div class="wpchill-tooltip"><i>[?]</i>
<div
class="wpchill-tooltip-content"><?php esc_html_e( 'Taken into consideration for the total download count ( total = Download Monitor custom table count + manual download count ).', 'download-monitor' ); ?></div>
</div>
<input type="text" class="short"
name="downloadable_file_download_count[<?php echo esc_attr( $version_increment ); ?>]"
placeholder="<?php echo ( isset( $meta_download_count ) ) ? esc_attr( $meta_download_count ) : '0'; ?>"/>
</div>
<?php if ( ! empty( $file_post_date->format( 'Y-m-d' ) ) ) {
?>
<div class="dlm-file-version__date">
<label><?php echo esc_html__( 'File Date', 'download-monitor' ); ?>:</label>
<input type="text" class="date-picker-field"
name="downloadable_file_date[<?php echo esc_attr( $version_increment ); ?>]"
maxlength="10"
value="<?php echo esc_attr( $file_post_date->format( 'Y-m-d' ) ); ?>"/> @
<input
type="text" class="hour" placeholder="<?php echo esc_html__( 'h', 'download-monitor' ) ?>"
name="downloadable_file_date_hour[<?php echo esc_attr( $version_increment ); ?>]"
maxlength="2"
size="2"
value="<?php echo esc_attr( $file_post_date->format( 'H' ) ); ?>"/>:
<input type="text" class="minute"
placeholder="<?php echo esc_attr__( 'm', 'download-monitor' ) ?>"
name="downloadable_file_date_minute[<?php echo esc_attr( $version_increment ); ?>]"
maxlength="2" size="2"
value="<?php echo esc_attr( $file_post_date->format( 'i' ) ); ?>"/>
</div>
<?php
}
// get available hashes
$hashes = download_monitor()->service( 'hasher' )->get_available_hashes();
if ( ! empty( $hashes ) ) {
?>
<?php
foreach ( $hashes as $hash ) {
$value = '';
$method = 'get_' . $hash;
if ( method_exists( $version, $method ) ) {
$value = $version->$method();
}
?>
<div>
<label><?php echo esc_html( strtoupper( $hash ) ); ?> Hash: </label>
<input type="text" readonly="readonly" value="<?php echo esc_attr( $value ); ?>"/>
</div>
<?php } ?>
<?php
}
?>
</div>
</div>
<?php do_action( 'dlm_downloadable_file_version_table_end', $file_id, $version_increment ); ?>
</div>
</div>

View File

@@ -0,0 +1,12 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
?>
<div class="dlm-lu-upgrade-notice">
<h3><?php echo esc_html__('It looks like you upgraded to the latest version of Download Monitor from a legacy version (3.x)', 'download-monitor' ); ?></h3>
<p><?php printf( esc_html__( "Currently your downloads don't work like they should, we need to %s before they'll work again.", 'download-monitor' ), sprintf( '<strong>%s</strong>', esc_html__( 'upgrade your downloads', 'download-monitor' ) ) ); ?></p>
<p><?php printf( esc_html__( "We've created an upgrading tool that will do all the work for you. You can read more about this tool on %sour website (click here)%s or start the upgrade now.", 'download-monitor'), '<a href="https://www.download-monitor.com/kb/legacy-upgrade?utm_source=plugin&utm_medium=dlm-lu-upgrade-notice&utm_campaign=dlm-lu-more-information" target="_blank">', '</a>' ); ?></p>
<a href="<?php echo esc_url( admin_url( 'options.php?page=dlm_legacy_upgrade' ) ); ?>" class="button"><?php echo esc_html__( 'Take me to the Upgrade Tool', 'download-monitor' ); ?></a>
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=dlm_download&dlm_lu_hide_notice=1' ) ); ?>" class="dlm-lu-upgrade-notice-hide"><?php echo esc_html__( 'hide notice', 'download-monitor' ); ?></a>
</div>

View File

@@ -0,0 +1,179 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
/** @var \WPChill\DownloadMonitor\Shop\Order\Order $order */
/** @var array $customer */
$items = $order->get_items();
?>
<div class="wrap dlm-order-details">
<h1><?php printf( esc_html__( 'Order Details #%s', 'download-monitor' ), esc_html( $order->get_id() ) ); ?></h1>
<div class="dlm-order-details-main">
<div class="dlm-order-details-block dlm-order-details-order-items">
<h2 class="dlm-order-details-block-title"><span><?php echo esc_html__( 'Order Items', 'download-monitor' ); ?></span>
</h2>
<div class="dlm-order-details-block-inside">
<table cellspacing="0" cellpadding="0" border="0" class="dlm-order-details-data-table">
<thead>
<tr>
<th><?php echo esc_html__( "Product", 'download-monitor' ); ?></th>
<th><?php echo esc_html__( "Price", 'download-monitor' ); ?></th>
<th><?php echo esc_html__( "QTY", 'download-monitor' ); ?></th>
<th class="dlm-order-details-order-items-item-total"><?php echo esc_html__( "Total", 'download-monitor' ); ?></th>
</tr>
</thead>
<tbody>
<?php if ( ! empty( $items ) ) : ?>
<?php foreach ( $items as $item ) : ?>
<tr>
<td><?php echo esc_html( $item->get_label() ); ?></td>
<td><?php echo esc_html( dlm_format_money( $item->get_subtotal(), array( 'currency' => $order->get_currency() ) ) ); ?></td>
<td><?php echo esc_html( $item->get_qty() ); ?></td>
<td class="dlm-order-details-order-items-item-total"><?php echo esc_html( dlm_format_money( $item->get_total(), array( 'currency' => $order->get_currency() ) ) ); ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" border="0" class="dlm-order-details-overview">
<tbody>
<tr>
<th><?php echo esc_html__( "Total", 'download-monitor' ); ?>:</th>
<td><?php echo esc_html( dlm_format_money( $order->get_total() ), array( 'currency' => $order->get_currency() ) ); ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="dlm-order-details-block">
<h2 class="dlm-order-details-block-title">
<span><?php echo esc_html__( 'Transactions', 'download-monitor' ); ?></span>
</h2>
<div class="dlm-order-details-block-inside">
<?php
$transactions = $order->get_transactions();
if ( ! empty( $transactions ) ) :
?>
<table cellspacing="0" cellpadding="0" border="0" class="dlm-order-details-data-table">
<thead>
<tr>
<th><?php echo esc_html__( "ID", 'download-monitor' ); ?></th>
<th><?php echo esc_html__( "Date", 'download-monitor' ); ?></th>
<th><?php echo esc_html__( "Status", 'download-monitor' ); ?></th>
<th><?php echo esc_html__( "Amount", 'download-monitor' ); ?></th>
<th><?php echo esc_html__( "Processor", 'download-monitor' ); ?></th>
<th class="dlm-order-transaction-processor-id"><?php echo esc_html__( "Processor ID", 'download-monitor' ); ?></th>
</tr>
</thead>
<tbody>
<?php
// replace long date format vars for short ones
$date_short_format = str_replace( "F", "M", str_replace( "Y", "y", get_option( 'date_format' ) ) );
foreach ( $transactions as $transaction ) :
if ( $transaction->get_date_modified() !== null ) {
$date_obj = $transaction->get_date_modified();
} else {
$date_obj = $transaction->get_date_created();
}
$date = date_i18n( $date_short_format, $date_obj->format( 'U' ) ) . " " . $date_obj->format( 'H:i:s' );
?>
<tr>
<td><?php echo esc_html( $transaction->get_id() ); ?></td>
<td><?php echo esc_html( $date ); ?></td>
<td><?php echo esc_html( $transaction->get_status()->get_label() ); ?></td>
<td><?php echo esc_html( dlm_format_money( $transaction->get_amount(), array( 'currency' => $order->get_currency() ) ) ); ?></td>
<td><?php echo esc_html( $transaction->get_processor_nice_name() ); ?></td>
<td class="dlm-order-transaction-processor-id"><?php echo esc_html( $transaction->get_processor_transaction_id() ); ?></td>
</tr>
<?php
endforeach;
?>
</tbody>
</table>
<?php
else: ?>
<p><?php echo esc_html__( "No transactions found", 'download-monitor' ); ?></p>
<?php endif; ?>
</div>
</div>
</div>
<div class="dlm-order-details-side">
<div class="dlm-order-details-block dlm-order-details-customer">
<h2 class="dlm-order-details-block-title"><span><?php echo esc_html__( 'Customer', 'download-monitor' ); ?></span></h2>
<div class="dlm-order-details-block-inside">
<?php
if ( ! empty( $customer['email'] ) ) {
echo "<img src='https://www.gravatar.com/avatar/" . esc_attr( md5( $customer['email'] ) ) . "?s=95&d=mp' alt='" . esc_attr( $customer['name'] ) . "' class='dlm-order-details-customer-image' />";
}
?>
<ul>
<?php
foreach ( $customer as $key => $data ) {
if ( ! empty( $data ) ) {
if ( "email" === $key ) {
echo "<li><a href='mailto:" . esc_attr( $data ) . "'>" . esc_html( $data ) . "</a></li>";
continue;
}
echo "<li>" . esc_html( $data ) . "</li>";
}
}
?>
</ul>
</div>
</div>
<div class="dlm-order-details-block">
<h2 class="dlm-order-details-block-title"><span><?php echo esc_html__( 'Order Details', 'download-monitor' ); ?></span>
</h2>
<div class="dlm-order-details-block-inside">
<ul>
<li>
<label><?php echo esc_html__( "Order Status", 'download-monitor' ); ?>:</label>
<select name="dlm_new_order_status" class="dlm-order-details-current-state"
id="dlm-order-details-current-state">
<?php
if ( ! empty( $statuses ) ) :
foreach ( $statuses as $status ):
echo "<option value='" . esc_attr( $status->get_key() ) . "' " . selected( $status->get_key(), $order->get_status()->get_key(), false ) . ">" . esc_html( $status->get_label() ) . "</option>" . PHP_EOL;
endforeach;
endif;
?>
</select>
<button class="button button-primary button-large"
id="dlm-order-details-button-change-state"><?php echo esc_html__( "Change", 'download-monitor' ); ?></button>
</li>
<li>
<label><?php echo esc_html__( "Date created", 'download-monitor' ); ?>:</label>
<p><?php echo esc_html( date_i18n( get_option( 'date_format' ), $order->get_date_created()->format( 'U' ) ) . " " . $order->get_date_created()->format( 'H:i:s' ) ); ?></p>
</li>
<li>
<label><?php echo esc_html__( "IP Address", 'download-monitor' ); ?>:</label>
<p><?php echo esc_html( $order->get_customer()->get_ip_address() ); ?></p>
</li>
<?php if ( ! empty( $processors ) ) : ?>
<li>
<label><?php echo esc_html__( "Payment Method", 'download-monitor' ); ?>:</label>
<p><?php echo esc_html( $processors[ count( $processors ) - 1 ] ); ?></p>
</li>
<?php endif; ?>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
?>
<div class="wrap dlm-order-overview">
<?php
$table = new \WPChill\DownloadMonitor\Shop\Admin\OrderTable();
$table->prepare_items();
?>
<div id="icon-edit" class="icon32 icon32-posts-dlm_download"><br/></div>
<h1><?php echo esc_html__( 'Orders', 'download-monitor' ); ?></h1>
<form method="post">
<?php $table->display() ?>
</form>
</div>