manager->button( $this->get_button_parameters() ); ?>
@@ -228,5 +240,3 @@ class WP_SMTP {
return $phpmailer;
}
}
-
-new WP_SMTP();
diff --git a/wp-content/plugins/easy-digital-downloads/src/Core.php b/wp-content/plugins/easy-digital-downloads/src/Core.php
new file mode 100644
index 00000000..ac07ef26
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Core.php
@@ -0,0 +1,64 @@
+pass_handler ),
+ new Admin\Extensions\Extension_Manager(),
+ );
+ }
+
+ /**
+ * Gets the admin service providers.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ protected function get_admin_providers() {
+ if ( ! is_admin() ) {
+ return array();
+ }
+
+ return array(
+ new Admin\PassHandler\Settings( $this->pass_handler ),
+ new Admin\PassHandler\Actions( $this->pass_handler ),
+ new Admin\Extensions\Menu(),
+ new Admin\Settings\EmailMarketing(),
+ new Admin\Settings\Invoices(),
+ new Admin\Settings\Recurring(),
+ new Admin\Settings\Reviews(),
+ new Admin\Settings\WP_SMTP(),
+ new Admin\Downloads\Meta(),
+ new Admin\Onboarding\Tools(),
+ new Admin\Onboarding\Wizard(),
+ new Admin\Onboarding\Ajax(),
+ new Licensing\Ajax(),
+ );
+ }
+
+ /**
+ * Gets providers that may be extended/replaced in lite/pro.
+ *
+ * @return array
+ */
+ protected function get_replaceable_providers() {
+ return array(
+ new Admin\Extensions\Legacy(),
+ new Admin\Promos\PromoHandler(),
+ );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/includes/currency/class-currency.php b/wp-content/plugins/easy-digital-downloads/src/Currency/Currency.php
similarity index 95%
rename from wp-content/plugins/easy-digital-downloads/includes/currency/class-currency.php
rename to wp-content/plugins/easy-digital-downloads/src/Currency/Currency.php
index 97b1281c..e907e5f7 100644
--- a/wp-content/plugins/easy-digital-downloads/includes/currency/class-currency.php
+++ b/wp-content/plugins/easy-digital-downloads/src/Currency/Currency.php
@@ -47,6 +47,11 @@ class Currency {
*/
public $number_decimals = 2;
+ /**
+ * @var string Currency position.
+ */
+ public $position = 'before';
+
/**
* Currency constructor.
*
@@ -80,6 +85,7 @@ class Currency {
$this->symbol = $this->get_symbol();
$this->decimal_separator = edd_get_option( 'decimal_separator', '.' );
$this->thousands_separator = edd_get_option( 'thousands_separator', ',' );
+ $this->position = edd_get_option( 'currency_position', 'before' );
/**
* Filters the decimal separator.
@@ -102,7 +108,7 @@ class Currency {
$this->thousands_separator = apply_filters( 'edd_currency_thousands_separator', $this->thousands_separator, $this->code );
$separator = $this->_has_space_around_symbol() ? ' ' : '';
- if ( 'before' === edd_get_option( 'currency_position', 'before' ) ) {
+ if ( 'before' === $this->position ) {
$this->prefix = $this->symbol . $separator;
} else {
$this->suffix = $separator . $this->symbol;
diff --git a/wp-content/plugins/easy-digital-downloads/includes/currency/class-money-formatter.php b/wp-content/plugins/easy-digital-downloads/src/Currency/Money_Formatter.php
similarity index 100%
rename from wp-content/plugins/easy-digital-downloads/includes/currency/class-money-formatter.php
rename to wp-content/plugins/easy-digital-downloads/src/Currency/Money_Formatter.php
diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/NotificationsDB.php b/wp-content/plugins/easy-digital-downloads/src/Database/NotificationsDB.php
similarity index 69%
rename from wp-content/plugins/easy-digital-downloads/includes/database/NotificationsDB.php
rename to wp-content/plugins/easy-digital-downloads/src/Database/NotificationsDB.php
index 2c49b440..789ec940 100644
--- a/wp-content/plugins/easy-digital-downloads/includes/database/NotificationsDB.php
+++ b/wp-content/plugins/easy-digital-downloads/src/Database/NotificationsDB.php
@@ -14,25 +14,13 @@ use EDD\Models\Notification;
use EDD\Utils\EnvironmentChecker;
use EDD\Utils\NotificationImporter;
-class NotificationsDB extends \EDD_DB {
+class NotificationsDB {
/**
* Constructor
*/
public function __construct() {
- global $wpdb;
-
- $this->table_name = $wpdb->prefix . 'edd_notifications';
- $this->primary_key = 'id';
- $this->version = '1.0';
-
add_action( 'edd_daily_scheduled_events', array( $this, 'schedule_daily_notification_checks' ) );
-
- $db_version = get_option( "{$this->table_name}_db_version" );
- if ( version_compare( $db_version, $this->version, '>=' ) ) {
- return;
- }
- $this->create_table();
}
/**
@@ -45,30 +33,6 @@ class NotificationsDB extends \EDD_DB {
$importer->run();
}
- /**
- * Columns and their formats.
- *
- * @since 2.11.4
- *
- * @return string[]
- */
- public function get_columns() {
- return array(
- 'id' => '%d',
- 'remote_id' => '%d',
- 'title' => '%s',
- 'content' => '%s',
- 'buttons' => '%s',
- 'type' => '%s',
- 'conditions' => '%s',
- 'start' => '%s',
- 'end' => '%s',
- 'dismissed' => '%d',
- 'date_created' => '%s',
- 'date_updated' => '%s',
- );
- }
-
/**
* Let MySQL handle most of the defaults.
* We just set the dates here to ensure they get saved in UTC.
@@ -84,6 +48,32 @@ class NotificationsDB extends \EDD_DB {
);
}
+ /**
+ * Adds or updates a local notification.
+ *
+ * @param array $data
+ * @return false|int Returns false if the notification could not be added/updated; the ID of the notification if it could.
+ */
+ public function maybe_add_local_notification( $data = array() ) {
+
+ // A remote_id is required and it cannot be numeric for local notifications.
+ if ( empty( $data['remote_id'] ) || is_numeric( $data['remote_id'] ) ) {
+ return false;
+ }
+ // The source is always always local.
+ $data['source'] = 'local';
+
+ $existing = $this->get_item_by( 'remote_id', $data['remote_id'] );
+ if ( $existing ) {
+ return $this->update(
+ $existing->id,
+ $data
+ );
+ }
+
+ return $this->insert( $data );
+ }
+
/**
* JSON-encodes any relevant columns.
*
@@ -116,7 +106,11 @@ class NotificationsDB extends \EDD_DB {
* @return int
*/
public function insert( $data, $type = 'notification' ) {
- $result = parent::insert( $this->maybeJsonEncode( $data ), $type );
+
+ $data = $this->maybeJsonEncode( $data );
+ $notifications = new \EDD\Database\Queries\Notification();
+
+ $result = $notifications->add_item( $data );
wp_cache_delete( 'edd_active_notification_count', 'edd_notifications' );
@@ -135,7 +129,34 @@ class NotificationsDB extends \EDD_DB {
* @return bool
*/
public function update( $row_id, $data = array(), $where = '' ) {
- return parent::update( $row_id, $this->maybeJsonEncode( $data ), $where );
+ $notifications = new \EDD\Database\Queries\Notification();
+
+ return $notifications->update_item( $row_id, $this->maybeJsonEncode( $data ) );
+ }
+
+ /**
+ * Gets a notification by ID.
+ *
+ * @param int $id
+ * @return false|Notification
+ */
+ public function get( $id ) {
+ $notifications = new \EDD\Database\Queries\Notification();
+
+ return $notifications->get_item( $id );
+ }
+
+ /**
+ * Gets an item by the column name and value.
+ *
+ * @param string $column_name
+ * @param string $column_value
+ * @return false|Notification
+ */
+ public function get_item_by( $column_name = '', $column_value = '' ) {
+ $notifications = new \EDD\Database\Queries\Notification();
+
+ return $notifications->get_item_by( $column_name, $column_value );
}
/**
@@ -194,7 +215,7 @@ class NotificationsDB extends \EDD_DB {
$select = $conditionsOnly ? 'conditions' : '*';
return $wpdb->prepare(
- "SELECT {$select} FROM {$this->table_name}
+ "SELECT {$select} FROM {$wpdb->edd_notifications}
WHERE dismissed = 0
AND (start <= %s OR start IS NULL)
AND (end >= %s OR end IS NULL)
@@ -224,35 +245,4 @@ class NotificationsDB extends \EDD_DB {
return $numberActive;
}
-
- /**
- * Creates the table.
- *
- * @since 2.11.4
- */
- public function create_table() {
- require_once ABSPATH . 'wp-admin/includes/upgrade.php';
-
- global $wpdb;
-
- dbDelta( "CREATE TABLE {$this->table_name} (
- id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
- remote_id bigint(20) UNSIGNED DEFAULT NULL,
- title text NOT NULL,
- content longtext NOT NULL,
- buttons longtext DEFAULT NULL,
- type varchar(64) NOT NULL,
- conditions longtext DEFAULT NULL,
- start datetime DEFAULT NULL,
- end datetime DEFAULT NULL,
- dismissed tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
- date_created datetime NOT NULL DEFAULT CURRENT_TIMESTAMP(),
- date_updated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP(),
- PRIMARY KEY (id),
- KEY dismissed_start_end (dismissed, start, end)
- ) DEFAULT CHARACTER SET {$wpdb->charset} COLLATE {$wpdb->collate};" );
-
- update_option( $this->table_name . '_db_version', $this->version );
- }
-
}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Database/Queries/Notification.php b/wp-content/plugins/easy-digital-downloads/src/Database/Queries/Notification.php
new file mode 100644
index 00000000..644e972d
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Database/Queries/Notification.php
@@ -0,0 +1,115 @@
+ 'id',
+ 'type' => 'bigint',
+ 'length' => '20',
+ 'unsigned' => true,
+ 'extra' => 'auto_increment',
+ 'primary' => true,
+ 'sortable' => true,
+ ),
+
+ // remote_id
+ array(
+ 'name' => 'remote_id',
+ 'type' => 'varchar',
+ 'length' => '20',
+ 'default' => null,
+ ),
+
+ // source
+ array(
+ 'name' => 'source',
+ 'type' => 'varchar',
+ 'default' => 'api',
+ 'allow_null' => false,
+ ),
+
+ // title
+ array(
+ 'name' => 'title',
+ 'type' => 'text',
+ 'default' => '',
+ 'allow_null' => false,
+ ),
+
+ // content
+ array(
+ 'name' => 'content',
+ 'type' => 'longtext',
+ 'default' => '',
+ 'allow_null' => false,
+ ),
+
+ // buttons
+ array(
+ 'name' => 'buttons',
+ 'type' => 'longtext',
+ 'default' => null,
+ 'allow_null' => true,
+ ),
+
+ // type
+ array(
+ 'name' => 'type',
+ 'type' => 'varchar',
+ 'length' => '64',
+ 'allow_null' => true,
+ ),
+
+ // conditions
+ array(
+ 'name' => 'conditions',
+ 'type' => 'longtext',
+ 'default' => null,
+ 'allow_null' => true,
+ ),
+
+ // start
+ array(
+ 'name' => 'start',
+ 'type' => 'datetime',
+ 'default' => null,
+ 'date_query' => true,
+ 'sortable' => true,
+ 'allow_null' => true,
+ ),
+
+ // end
+ array(
+ 'name' => 'end',
+ 'type' => 'datetime',
+ 'default' => null,
+ 'date_query' => true,
+ 'sortable' => true,
+ 'allow_null' => true,
+ ),
+
+ // dismissed
+ array(
+ 'name' => 'dismissed',
+ 'type' => 'tinyint',
+ 'length' => '1',
+ 'unsigned' => true,
+ 'allow_null' => true,
+ 'default' => 0,
+ ),
+
+ // date_created
+ array(
+ 'name' => 'date_created',
+ 'type' => 'datetime',
+ 'default' => '', // Defaults to current time in query class
+ 'date_query' => true,
+ 'sortable' => true,
+ 'created' => true,
+ ),
+
+ // date_updated
+ array(
+ 'name' => 'date_updated',
+ 'type' => 'datetime',
+ 'default' => '', // Defaults to current time in query class
+ 'date_query' => true,
+ 'sortable' => true,
+ 'modified' => true,
+ ),
+ );
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Database/Tables/Notifications.php b/wp-content/plugins/easy-digital-downloads/src/Database/Tables/Notifications.php
new file mode 100644
index 00000000..1d0dd956
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Database/Tables/Notifications.php
@@ -0,0 +1,137 @@
+ 202301251,
+ '202302131' => 202302131,
+ );
+
+ /**
+ * Setup the database schema.
+ *
+ * @access protected
+ * @since 3.1.1
+ * @return void
+ */
+ protected function set_schema() {
+ $this->schema = "id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ remote_id varchar(20) DEFAULT NULL,
+ source varchar(20) NOT NULL DEFAULT 'api',
+ title text NOT NULL,
+ content longtext NOT NULL,
+ buttons longtext DEFAULT NULL,
+ type varchar(64) NOT NULL DEFAULT 'success',
+ conditions longtext DEFAULT NULL,
+ start datetime DEFAULT NULL,
+ end datetime DEFAULT NULL,
+ dismissed tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
+ date_created datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ date_updated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (id),
+ KEY dismissed_start_end (dismissed, start, end),
+ KEY remote_id (remote_id)";
+ }
+
+ /**
+ * Deletes the original database version option.
+ *
+ * @since 3.1.1
+ * @return bool
+ */
+ protected function __202301251() {
+ return delete_option( "{$this->table_name}_db_version" );
+ }
+
+ /**
+ * Upgrade to version 202302131
+ * - Add the `source` text column and modify the remote_id column.
+ *
+ * @since 3.1.1
+ *
+ * @return boolean
+ */
+ protected function __202302131() {
+
+ $updates = array(
+ 'add-source' => false,
+ 'remote-id' => false,
+ );
+
+ $columns = $this->get_db()->get_results( "SHOW FIELDS FROM {$this->table_name} WHERE Field = 'remote_id';" );
+
+ if ( false === $this->column_exists( 'source' ) ) {
+ $source = $this->get_db()->query(
+ "ALTER TABLE {$this->table_name} ADD COLUMN `source` varchar(20) NOT NULL DEFAULT 'api' AFTER `remote_id`;"
+ );
+
+ if ( $this->is_success( $source ) ) {
+ $updates['add-source'] = $this->get_db()->query( "UPDATE {$this->table_name} SET `source` = 'api'" );
+ }
+ } else {
+ $updates['add-source'] = true;
+ }
+
+ $remote_id_column = $this->get_db()->get_row( "SHOW FIELDS FROM {$this->table_name} WHERE Field = 'remote_id'" );
+ if ( 'varchar(20)' !== $remote_id_column->Type ) {
+ $updates['remote-id'] = $this->get_db()->query(
+ "ALTER TABLE {$this->table_name} MODIFY COLUMN `remote_id` varchar(20) DEFAULT NULL;"
+ );
+ } else {
+ $updates['remote-id'] = true;
+ }
+
+ foreach ( $updates as $query_key => $result ) {
+ if ( ! $this->is_success( $result ) ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Downloads/Search.php b/wp-content/plugins/easy-digital-downloads/src/Downloads/Search.php
new file mode 100644
index 00000000..b01908c4
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Downloads/Search.php
@@ -0,0 +1,224 @@
+ '',
+ 'results' => array(),
+ )
+ );
+
+ // Get the search string.
+ $new_search = isset( $_GET['s'] )
+ ? sanitize_text_field( $_GET['s'] )
+ : '';
+
+ // Limit to only alphanumeric characters, including unicode and spaces.
+ $new_search = preg_replace( '/[^\pL^\pN\pZ]/', ' ', $new_search );
+
+ // Bail early if the search text has not changed.
+ if ( $search['text'] === $new_search ) {
+ echo wp_json_encode( $search['results'] );
+ edd_die();
+ }
+
+ // Set the local static search variable.
+ $search['text'] = $new_search;
+
+ // Are we excluding the current ID?
+ $excludes = isset( $_GET['current_id'] )
+ ? array_unique( array_map( 'absint', (array) $_GET['current_id'] ) )
+ : array();
+
+ // Are we excluding bundles?
+ $no_bundles = isset( $_GET['no_bundles'] )
+ ? filter_var( $_GET['no_bundles'], FILTER_VALIDATE_BOOLEAN )
+ : false;
+
+ // Are we including variations?
+ $variations = isset( $_GET['variations'] )
+ ? filter_var( $_GET['variations'], FILTER_VALIDATE_BOOLEAN )
+ : false;
+
+ $variations_only = isset( $_GET['variations_only'] )
+ ? filter_var( $_GET['variations_only'], FILTER_VALIDATE_BOOLEAN )
+ : false;
+
+ // Are we including all statuses, or only public ones?
+ $status = ! current_user_can( 'edit_products' )
+ ? apply_filters( 'edd_product_dropdown_status_nopriv', array( 'publish' ) )
+ : apply_filters( 'edd_product_dropdown_status', array( 'publish', 'draft', 'private', 'future' ) );
+
+ // Default query arguments.
+ $args = array(
+ 'orderby' => 'title',
+ 'order' => 'ASC',
+ 'post_type' => 'download',
+ 'posts_per_page' => 50,
+ 'post_status' => implode( ',', $status ), // String.
+ 'post__not_in' => $excludes, // Array.
+ 'edd_search' => $new_search, // String.
+ 'suppress_filters' => false,
+ );
+
+ // Maybe exclude bundles.
+ if ( true === $no_bundles ) {
+ $args['meta_query'] = array(
+ 'relation' => 'OR',
+ array(
+ 'key' => '_edd_product_type',
+ 'value' => 'bundle',
+ 'compare' => '!=',
+ ),
+ array(
+ 'key' => '_edd_product_type',
+ 'value' => 'bundle',
+ 'compare' => 'NOT EXISTS',
+ ),
+ );
+ }
+
+ add_filter( 'posts_where', array( $this, 'filter_where' ), 10, 2 );
+ // Get downloads.
+ $items = get_posts( $args );
+ remove_filter( 'posts_where', array( $this, 'filter_where' ), 10, 2 );
+
+ // Pluck title & ID.
+ if ( ! empty( $items ) ) {
+ $items = wp_list_pluck( $items, 'post_title', 'ID' );
+
+ // Loop through all items...
+ foreach ( $items as $post_id => $title ) {
+ $product_title = $title;
+
+ // Look for variable pricing.
+ $prices = edd_get_variable_prices( $post_id );
+
+ if ( ! empty( $prices ) && ( false === $variations || ! $variations_only ) ) {
+ $title .= ' (' . __( 'All Price Options', 'easy-digital-downloads' ) . ')';
+ }
+
+ if ( empty( $prices ) || ! $variations_only ) {
+ // Add item to results array.
+ $search['results'][] = array(
+ 'id' => $post_id,
+ 'name' => $title,
+ );
+ }
+
+ // Maybe include variable pricing.
+ if ( ! empty( $variations ) && ! empty( $prices ) ) {
+ foreach ( $prices as $key => $value ) {
+ $name = ! empty( $value['name'] ) ? $value['name'] : '';
+
+ if ( ! empty( $name ) ) {
+ $search['results'][] = array(
+ 'id' => $post_id . '_' . $key,
+ 'name' => esc_html( $product_title . ': ' . $name ),
+ );
+ }
+ }
+ }
+ }
+ } else {
+ // Empty the results array.
+ $search['results'] = array();
+ }
+
+ // Update the transient.
+ set_transient( 'edd_download_search', $search, 30 );
+
+ // Output the results.
+ echo wp_json_encode( $search['results'] );
+
+ // Done!
+ edd_die();
+ }
+
+ /**
+ * Filters the WHERE SQL query for the edd_download_search.
+ * This searches the download titles only, not the excerpt/content.
+ *
+ * @since 3.1.0.2
+ * @since 3.1.0.5 Moved to EDD\Downloads\Ajax.
+ * @param string $where
+ * @param WP_Query $wp_query
+ * @return string
+ */
+ public function filter_where( $where, $wp_query ) {
+ $search = $wp_query->get( 'edd_search' );
+ if ( ! $search ) {
+ return $where;
+ }
+
+ $terms = $this->parse_search_terms( $search );
+ if ( empty( $terms ) ) {
+ return $where;
+ }
+
+ global $wpdb;
+ $query = '';
+ foreach ( $terms as $term ) {
+ $operator = empty( $query ) ? '' : ' AND ';
+ $term = $wpdb->esc_like( $term );
+ $query .= "{$operator}{$wpdb->posts}.post_title LIKE '%{$term}%'";
+ }
+ if ( $query ) {
+ $where .= " AND ({$query})";
+ }
+
+ return $where;
+ }
+
+ /**
+ * Parses the search terms to allow for a "fuzzy" search.
+ *
+ * @since 3.1.0.5
+ * @param string $search
+ * @return array
+ */
+ protected function parse_search_terms( $search ) {
+ $terms = explode( ' ', $search );
+ $strtolower = function_exists( 'mb_strtolower' ) ? 'mb_strtolower' : 'strtolower';
+ $checked = array();
+
+ foreach ( $terms as $term ) {
+ // Keep before/after spaces when term is for exact match.
+ if ( preg_match( '/^".+"$/', $term ) ) {
+ $term = trim( $term, "\"'" );
+ } else {
+ $term = trim( $term, "\"' " );
+ }
+
+ // Avoid single A-Z and single dashes.
+ if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\-]$/i', $term ) ) ) {
+ continue;
+ }
+
+ $checked[] = $term;
+ }
+
+ return $checked;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/EventManagement/EventManager.php b/wp-content/plugins/easy-digital-downloads/src/EventManagement/EventManager.php
new file mode 100644
index 00000000..04b73bde
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/EventManagement/EventManager.php
@@ -0,0 +1,69 @@
+get_subscribed_events() as $hook_name => $parameters ) {
+ $this->add_subscriber_callback( $subscriber, $hook_name, $parameters );
+ }
+ }
+
+ /**
+ * Remove an event subscriber.
+ *
+ * The event manager removes all the hooks that the given subscriber
+ * wants to register with the WordPress Plugin API.
+ *
+ * @param SubscriberInterface $subscriber
+ */
+ public function remove_subscriber( SubscriberInterface $subscriber ) {
+ foreach ( $subscriber->get_subscribed_events() as $hook_name => $parameters ) {
+ $this->remove_subscriber_callback( $subscriber, $hook_name, $parameters );
+ }
+ }
+
+ /**
+ * Adds the given subscriber's callback to a specific hook
+ * of the WordPress plugin API.
+ *
+ * @param SubscriberInterface $subscriber
+ * @param string $hook_name
+ * @param mixed $parameters
+ */
+ private function add_subscriber_callback( SubscriberInterface $subscriber, $hook_name, $parameters ) {
+ if ( is_string( $parameters ) ) {
+ $this->add_callback( $hook_name, array( $subscriber, $parameters ) );
+ } elseif ( is_array( $parameters ) && isset( $parameters[0] ) ) {
+ $this->add_callback( $hook_name, array( $subscriber, $parameters[0] ), isset( $parameters[1] ) ? $parameters[1] : 10, isset( $parameters[2] ) ? $parameters[2] : 1 );
+ }
+ }
+
+ /**
+ * Removes the given subscriber's callback to a specific hook
+ * of the WordPress plugin API.
+ *
+ * @param SubscriberInterface $subscriber
+ * @param string $hook_name
+ * @param mixed $parameters
+ */
+ private function remove_subscriber_callback( SubscriberInterface $subscriber, $hook_name, $parameters ) {
+ if ( is_string( $parameters ) ) {
+ $this->remove_callback( $hook_name, array( $subscriber, $parameters ) );
+ } elseif ( is_array( $parameters ) && isset( $parameters[0] ) ) {
+ $this->remove_callback( $hook_name, array( $subscriber, $parameters[0] ), isset( $parameters[1] ) ? $parameters[1] : 10 );
+ }
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/EventManagement/PluginAPIManager.php b/wp-content/plugins/easy-digital-downloads/src/EventManagement/PluginAPIManager.php
new file mode 100644
index 00000000..ad540658
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/EventManagement/PluginAPIManager.php
@@ -0,0 +1,96 @@
+ 'method_name')
+ * * array('event_name' => array('method_name', $priority))
+ * * array('event_name' => array('method_name', $priority, $accepted_args))
+ *
+ * @return array
+ */
+ public static function get_subscribed_events();
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/EventManagement/Subscribers.php b/wp-content/plugins/easy-digital-downloads/src/EventManagement/Subscribers.php
new file mode 100644
index 00000000..d5f1f67d
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/EventManagement/Subscribers.php
@@ -0,0 +1,76 @@
+pass_handler = new \EDD\Admin\PassHandler\Handler();
+ $this->add_service_providers();
+ }
+
+ /**
+ * Add registered service providers.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ private function add_service_providers() {
+ $events = new EventManager();
+
+ if ( ! $events instanceof EventManager ) {
+ return;
+ }
+
+ $service_providers = array_merge(
+ $this->get_service_providers(),
+ $this->get_admin_providers(),
+ $this->get_replaceable_providers()
+ );
+
+ // Attach subscribers.
+ foreach ( $service_providers as $service_provider ) {
+ try {
+ $events->add_subscriber( $service_provider );
+ } catch ( Exception $e ) {
+ // Do not subscribe.
+ }
+ }
+ }
+
+ /**
+ * Gets providers that may be extended/replaced in lite/pro.
+ *
+ * @return array
+ */
+ protected function get_replaceable_providers() {
+ return array();
+ }
+
+ /**
+ * Gets the service providers for EDD.
+ *
+ * @return array
+ */
+ abstract protected function get_service_providers();
+
+ /**
+ * Gets the admin service providers for EDD.
+ *
+ * @return array
+ */
+ abstract protected function get_admin_providers();
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Licensing/API.php b/wp-content/plugins/easy-digital-downloads/src/Licensing/API.php
new file mode 100644
index 00000000..eaa564d6
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Licensing/API.php
@@ -0,0 +1,78 @@
+api_url;
+ }
+
+ /**
+ * Makes a request to the Software Licensing API.
+ *
+ * @since 3.1.1
+ * @param array $api_params The parameters for the API request.
+ * @return false|stdClass
+ */
+ public function make_request( $api_params = array() ) {
+ if ( empty( $api_params ) || ! is_array( $api_params ) ) {
+ return false;
+ }
+
+ $request = wp_remote_get(
+ $this->api_url,
+ array(
+ 'timeout' => 15,
+ 'sslverify' => true,
+ 'body' => $this->get_body( $api_params ),
+ )
+ );
+
+ // If there was an API error, return false.
+ if ( is_wp_error( $request ) || ( 200 !== wp_remote_retrieve_response_code( $request ) ) ) {
+ return false;
+ }
+
+ return json_decode( wp_remote_retrieve_body( $request ) );
+ }
+
+ /**
+ * Updates the API parameters with the defaults.
+ *
+ * @param array $api_params The parameters for the specific request.
+ * @return array
+ */
+ private function get_body( array $api_params ) {
+ return wp_parse_args(
+ $api_params,
+ array(
+ 'url' => home_url(),
+ )
+ );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Licensing/Ajax.php b/wp-content/plugins/easy-digital-downloads/src/Licensing/Ajax.php
new file mode 100644
index 00000000..dce85f8e
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Licensing/Ajax.php
@@ -0,0 +1,212 @@
+ 'activate',
+ 'wp_ajax_edd_deactivate_extension_license' => 'deactivate',
+ 'wp_ajax_edd_delete_extension_license' => 'delete',
+ );
+ }
+
+ /**
+ * Attempt to activate an extension license.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function activate() {
+ if ( ! $this->can_manage() ) {
+ wp_send_json_error(
+ array(
+ 'message' => wpautop( __( 'You do not have permission to manage this extension.', 'easy-digital-downloads' ) ),
+ )
+ );
+ }
+
+ if ( ! empty( $_POST['license'] ) ) {
+ $this->license_key = sanitize_text_field( $_POST['license'] );
+ }
+ if ( ! $this->license_key ) {
+ wp_send_json_error(
+ array(
+ 'message' => __( 'No key provided.', 'easy-digital-downloads' ),
+ )
+ );
+ }
+
+ $this->name = filter_input( INPUT_POST, 'item_name', FILTER_SANITIZE_SPECIAL_CHARS );
+ $api_params = array(
+ 'edd_action' => 'activate_license',
+ 'license' => $this->license_key,
+ 'item_name' => $this->name,
+ 'item_id' => filter_input( INPUT_POST, 'item_id', FILTER_SANITIZE_NUMBER_INT ),
+ );
+
+ $api = new API();
+ $license_data = $api->make_request( $api_params );
+
+ if ( empty( $license_data->success ) ) {
+ if ( ! empty( $license_data ) ) {
+ $messages = new \EDD\Licensing\Messages(
+ array(
+ 'status' => $license_data->error,
+ 'license_key' => $this->license_key,
+ 'expires' => ! empty( $license_data->expires ) ? $license_data->expires : false,
+ 'name' => $this->name,
+ 'subscription' => ! empty( $license_data->subscription ) ? $license_data->subscription : null,
+ )
+ );
+ $message = $messages->get_message();
+ } else {
+ $message = __( 'Your license key could not be activated.', 'easy-digital-downloads' );
+ }
+ wp_send_json_error(
+ array(
+ 'message' => wpautop( $message ),
+ )
+ );
+ }
+
+ set_site_transient( 'update_plugins', null );
+
+ $pass_manager = new \EDD\Admin\Pass_Manager();
+ $pass_manager->maybe_set_pass_flag( $this->license_key, $license_data );
+
+ // Clear the option for licensed extensions to force regeneration.
+ if ( ! empty( $license_data->license ) && 'valid' === $license_data->license ) {
+ delete_option( 'edd_licensed_extensions' );
+ }
+
+ edd_update_option( filter_input( INPUT_POST, 'key', FILTER_SANITIZE_SPECIAL_CHARS ), $this->license_key );
+ $license = new License( $this->name );
+ $license->save( $license_data );
+ // Get the license again.
+ $this->license = new License( $this->name );
+ $this->set_up_license_data();
+
+ wp_send_json_success(
+ array(
+ 'message' => $this->do_message( false ),
+ 'actions' => $this->get_actions( 'valid' ),
+ )
+ );
+ }
+
+ /**
+ * Attempt to deactivate an extension license.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function deactivate() {
+ if ( ! $this->can_manage() ) {
+ wp_send_json_error(
+ array(
+ 'message' => wpautop( __( 'You do not have permission to manage this extension.', 'easy-digital-downloads' ) ),
+ )
+ );
+ }
+
+ $this->name = filter_input( INPUT_POST, 'item_name', FILTER_SANITIZE_SPECIAL_CHARS );
+ $item_id = filter_input( INPUT_POST, 'item_id', FILTER_SANITIZE_NUMBER_INT );
+ $this->license = new License( $this->name );
+ $this->license_key = $this->license->key;
+ $api_params = array(
+ 'edd_action' => 'deactivate_license',
+ 'license' => $this->license_key,
+ 'item_id' => urlencode( $item_id ),
+ );
+ $api = new API();
+ $license_data = $api->make_request( $api_params );
+
+ $this->license->save( $license_data );
+
+ $pass_manager = new \EDD\Admin\Pass_Manager();
+ $pass_manager->maybe_remove_pass_flag( $this->license_key );
+
+ wp_send_json_success(
+ array(
+ 'message' => wpautop( __( 'Your license key has been deactivated.', 'easy-digital-downloads' ) ),
+ 'actions' => $this->get_actions( $license_data->license ),
+ )
+ );
+ }
+
+ /**
+ * Deletes an extension key and the related option.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function delete() {
+ if ( ! $this->can_manage( 'edd_licensehandler-delete' ) ) {
+ wp_send_json_error(
+ array(
+ 'message' => wpautop( __( 'You do not have permission to manage this extension.', 'easy-digital-downloads' ) ),
+ )
+ );
+ }
+
+ $this->name = filter_input( INPUT_POST, 'item_name', FILTER_SANITIZE_SPECIAL_CHARS );
+ $this->license = new License( $this->name );
+ $this->license->delete();
+ edd_delete_option( filter_input( INPUT_POST, 'key', FILTER_SANITIZE_SPECIAL_CHARS ) );
+
+ wp_send_json_success(
+ array(
+ 'message' => wpautop( __( 'License key deleted.', 'easy-digital-downloads' ) ),
+ )
+ );
+ }
+
+ /**
+ * Whether the current user can manage the extension.
+ * Checks the user capabilities, tokenizer, and nonce.
+ *
+ * @since 3.1.1
+ * @param string $nonce The name of the specific nonce to validate.
+ * @return bool
+ */
+ protected function can_manage( $nonce = 'edd_licensehandler' ) {
+ if ( ! current_user_can( 'manage_shop_settings' ) ) {
+ return false;
+ }
+ $token = isset( $_POST['token'] ) ? sanitize_text_field( $_POST['token'] ) : '';
+ $timestamp = isset( $_POST['timestamp'] ) ? sanitize_text_field( $_POST['timestamp'] ) : '';
+
+ if ( empty( $timestamp ) || empty( $token ) ) {
+ return false;
+ }
+
+ return \EDD\Utils\Tokenizer::is_token_valid( $token, $timestamp ) && wp_verify_nonce( $_POST['nonce'], $nonce );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Licensing/License.php b/wp-content/plugins/easy-digital-downloads/src/Licensing/License.php
new file mode 100644
index 00000000..988770ce
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Licensing/License.php
@@ -0,0 +1,281 @@
+product_shortname = 'edd_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $product_name ) ) );
+ $this->option_name = "{$this->product_shortname}_license_active";
+
+ if ( 'pro' === $product_name ) {
+ $this->option_name = "{$this->product_shortname}_license";
+ $this->single_site = false;
+ } elseif ( $custom_key_option && $custom_key_option !== $this->option_name ) {
+ $this->custom_key_option = $custom_key_option;
+ }
+
+ $this->get();
+ }
+
+ /**
+ * Saves the license data option.
+ *
+ * @since 3.1.1
+ * @param object $license_data
+ * @return bool
+ */
+ public function save( $license_data ) {
+ if ( $this->single_site ) {
+ return update_option(
+ $this->option_name,
+ $license_data,
+ false
+ );
+ }
+
+ return update_site_option(
+ $this->option_name,
+ $license_data
+ );
+ }
+
+ /**
+ * Deletes a license key and related license data.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function delete() {
+ if ( ! $this->single_site ) {
+ delete_site_option( $this->option_name );
+ delete_site_option( "{$this->product_shortname}_license_key" );
+
+ return;
+ }
+
+ delete_option( $this->option_name );
+ edd_delete_option( "{$this->product_shortname}_license_key" );
+ if ( $this->custom_key_option ) {
+ edd_delete_option( $this->custom_key_option );
+ }
+ }
+
+ /**
+ * Selectively update just one piece of the license data.
+ *
+ * @since 3.1.1
+ * @param array $data
+ * @return bool
+ */
+ public function update( array $data ) {
+ $option = $this->single_site ? get_option( $this->option_name, false ) : get_site_option( $this->option_name, false );
+ $update = false;
+ foreach ( $data as $key => $value ) {
+ if ( $value !== $option->$key && in_array( $key, $this->get_editable_keys(), true ) ) {
+ $option->$key = $value;
+ $update = true;
+ }
+ }
+
+ return $update ? $this->save( $option ) : false;
+ }
+
+ /**
+ * Gets the license key for the license.
+ *
+ * @return string
+ */
+ public function get_license_key() {
+
+ $option_name = "{$this->product_shortname}_license_key";
+ $option = trim(
+ $this->single_site ?
+ edd_get_option( $option_name, '' ) :
+ get_site_option( $option_name, '' )
+ );
+
+ if ( ! empty( $option ) || 'edd_pro' === $this->product_shortname ) {
+ return $option;
+ }
+
+ /**
+ * Allows for backwards compatibility with old license options,
+ * i.e. if the plugins had license key fields previously, the license
+ * handler will automatically pick these up and use those in lieu of the
+ * user having to reactivate their license.
+ */
+ return trim( $this->custom_key_option ? edd_get_option( $this->custom_key_option, '' ) : $option );
+ }
+
+ /**
+ * Gets the license object mapped to the class defaults.
+ *
+ * @return EDD\Licensing\License
+ */
+ public function get() {
+ $this->key = $this->get_license_key();
+ if ( empty( $this->key ) ) {
+ return $this;
+ }
+ $option = $this->single_site ? get_option( $this->option_name, false ) : get_site_option( $this->option_name, false );
+ if ( ! $option ) {
+ return $this;
+ }
+
+ foreach ( (array) $option as $key => $value ) {
+ if ( property_exists( $this, $key ) ) {
+ $this->$key = $value;
+ }
+ }
+
+ if ( ! $this->success && is_null( $this->error ) && 'valid' !== $this->license ) {
+ $this->error = $this->license;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Only allow certain keys to be modified.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_editable_keys() {
+ return array( 'license', 'error', 'success' );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Licensing/Messages.php b/wp-content/plugins/easy-digital-downloads/src/Licensing/Messages.php
new file mode 100644
index 00000000..81a08cec
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Licensing/Messages.php
@@ -0,0 +1,274 @@
+license_data = wp_parse_args(
+ $license_data,
+ array(
+ 'status' => '',
+ 'expires' => '',
+ 'name' => '',
+ 'license_key' => '',
+ 'subscription' => false,
+ )
+ );
+ $this->now = current_time( 'timestamp' );
+ if ( ! empty( $this->license_data['expires'] ) && 'lifetime' !== $this->license_data['expires'] ) {
+ if ( ! is_numeric( $this->license_data['expires'] ) ) {
+ $this->expiration = strtotime( $this->license_data['expires'], $this->now );
+ } else {
+ $this->expiration = $this->license_data['expires'];
+ }
+ }
+ }
+
+ /**
+ * Gets the appropriate licensing message from an array of license data.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ public function get_message() {
+
+ $name = $this->license_data['name'] ?: __( 'license key', 'easy-digital-downloads' );
+
+ switch ( $this->license_data['status'] ) {
+
+ case 'expired':
+ $args = array(
+ 'utm_medium' => 'license-notice',
+ 'utm_content' => 'expired',
+ );
+ if ( ! empty( $this->license_data['license_key'] ) ) {
+ $args['license_key'] = $this->license_data['license_key'];
+ }
+ $url = edd_link_helper(
+ 'https://easydigitaldownloads.com/checkout/',
+ $args
+ );
+ if ( $this->expiration ) {
+ $message = sprintf(
+ /* translators: 1. license expiration date; 2. opening link tag; 3. closing link tag. */
+ __( 'Your license key expired on %1$s. Please %2$srenew your license key%3$s.', 'easy-digital-downloads' ),
+ edd_date_i18n( $this->expiration ),
+ '
',
+ ''
+ );
+ } else {
+ $message = sprintf(
+ /* translators: 1. opening link tag; 2. closing link tag. */
+ __( 'Your license key has expired. Please %1$srenew your license key%2$s.', 'easy-digital-downloads' ),
+ '
',
+ ''
+ );
+ }
+ break;
+
+ case 'revoked':
+ case 'disabled':
+ $url = edd_link_helper(
+ 'https://easydigitaldownloads.com/support/',
+ array(
+ 'utm_medium' => 'license-notice',
+ 'utm_content' => 'revoked',
+ )
+ );
+ $message = sprintf(
+ /* translators: 1. opening link tag; 2. closing link tag. */
+ __( 'Your license key has been disabled. Please %1$scontact support%2$s for more information.', 'easy-digital-downloads' ),
+ '
',
+ ''
+ );
+ break;
+
+ case 'missing':
+ $url = edd_link_helper(
+ 'https://easydigitaldownloads.com/your-account/',
+ array(
+ 'utm_medium' => 'license-notice',
+ 'utm_content' => 'missing',
+ )
+ );
+ $message = sprintf(
+ /* translators: 1. opening link tag; 2. closing link tag. */
+ __( 'Invalid license. Please %1$svisit your account page%2$s and verify it.', 'easy-digital-downloads' ),
+ '
',
+ ''
+ );
+ break;
+
+ case 'site_inactive':
+ $url = edd_link_helper(
+ 'https://easydigitaldownloads.com/your-account/',
+ array(
+ 'utm_medium' => 'license-notice',
+ 'utm_content' => 'inactive',
+ )
+ );
+ $message = sprintf(
+ /* translators: 1. the extension name; 2. opening link tag; 3. closing link tag. */
+ __( 'Your %1$s is not active for this URL. Please %2$svisit your account page%3$s to manage your license keys.', 'easy-digital-downloads' ),
+ esc_html( $name ),
+ '
',
+ ''
+ );
+ break;
+
+ case 'invalid':
+ case 'invalid_item_id':
+ case 'item_name_mismatch':
+ case 'key_mismatch':
+ $message = sprintf(
+ /* translators: the extension name. */
+ __( 'This appears to be an invalid license key for %s.', 'easy-digital-downloads' ),
+ $name
+ );
+ break;
+
+ case 'no_activations_left':
+ $url = edd_link_helper(
+ 'https://easydigitaldownloads.com/your-account/',
+ array(
+ 'utm_medium' => 'license-notice',
+ 'utm_content' => 'at-limit',
+ )
+ );
+ $message = sprintf(
+ /* translators: 1. opening link tag; 2 closing link tag. */
+ __( 'Your license key has reached its activation limit. %1$sView possible upgrades%2$s now.', 'easy-digital-downloads' ),
+ '
',
+ ''
+ );
+ break;
+
+ case 'license_not_activable':
+ $message = __( 'The key you entered belongs to a bundle, please use the product specific license key.', 'easy-digital-downloads' );
+ break;
+
+ case 'deactivated':
+ $message = __( 'Your license key has been deactivated.', 'easy-digital-downloads' );
+ break;
+
+ case 'valid':
+ $message = $this->get_valid_message();
+ if ( $this->license_data['subscription'] && 'lifetime' !== $this->license_data['subscription'] ) {
+ $message .= $this->get_subscription_message();
+ }
+ break;
+
+ default:
+ if ( ! empty( $this->license_data['license_key'] ) ) {
+ $error = ! empty( $this->license->error ) ? $this->license->error : __( 'unknown_error', 'easy-digital-downloads' );
+ $message = sprintf(
+ /* translators: 1. the error code; 2. opening link tag; 3. closing link tag. */
+ __( 'There was an error with this license key: %1$s. Please %2$scontact our support team%3$s.', 'easy-digital-downloads' ),
+ '
' . $error . '
',
+ '
',
+ ''
+ );
+ } else {
+ $message = sprintf(
+ /* translators: the extension name. */
+ __( 'Unlicensed: currently not receiving updates.', 'easy-digital-downloads' )
+ );
+ }
+ break;
+ }
+
+ return $message;
+ }
+
+ /**
+ * Gets the message text for a valid license.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_valid_message() {
+ if ( ! empty( $this->license_data['expires'] ) && 'lifetime' === $this->license_data['expires'] ) {
+ return __( 'License key never expires.', 'easy-digital-downloads' );
+ }
+
+ if ( ( $this->expiration > $this->now ) && ( $this->expiration - $this->now < ( DAY_IN_SECONDS * 30 ) ) ) {
+ return sprintf(
+ /* translators: the license expiration date. */
+ __( 'Your license key expires soon! It expires on %s.', 'easy-digital-downloads' ),
+ edd_date_i18n( $this->expiration )
+ );
+ }
+
+ return sprintf(
+ /* translators: the license expiration date. */
+ __( 'Your license key expires on %s.', 'easy-digital-downloads' ),
+ edd_date_i18n( $this->expiration )
+ );
+ }
+
+ /**
+ * Gets the message for a license's subscription.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_subscription_message() {
+ if ( 'active' === $this->license_data['subscription'] ) {
+ return ' ' . __( 'Your license subscription is active and will automatically renew.', 'easy-digital-downloads' );
+ }
+
+ return ' ' . sprintf(
+ /* translators: the license subscription status. */
+ __( 'Your license subscription is %s and will not automatically renew.', 'easy-digital-downloads' ),
+ $this->get_subscription_status_label( $this->license_data['subscription'] )
+ );
+ }
+
+ /**
+ * Gets the subscription status label as a translatable string.
+ *
+ * @since 3.1.1
+ * @param string $status
+ * @return string
+ */
+ private function get_subscription_status_label( $status ) {
+ $statii = array(
+ 'pending' => __( 'pending', 'easy-digital-downloads' ),
+ 'active' => __( 'active', 'easy-digital-downloads' ),
+ 'cancelled' => __( 'cancelled', 'easy-digital-downloads' ),
+ 'expired' => __( 'expired', 'easy-digital-downloads' ),
+ 'trialling' => __( 'trialling', 'easy-digital-downloads' ),
+ 'failing' => __( 'failing', 'easy-digital-downloads' ),
+ 'completed' => __( 'completed', 'easy-digital-downloads' ),
+ );
+
+ return array_key_exists( $status, $statii ) ? $statii[ $status ] : $status;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Licensing/Settings.php b/wp-content/plugins/easy-digital-downloads/src/Licensing/Settings.php
new file mode 100644
index 00000000..a51cf5cf
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Licensing/Settings.php
@@ -0,0 +1,102 @@
+args = $args;
+ $this->license = new License( $this->args['name'], $this->args['options']['is_valid_license_option'] );
+ $this->license_key = $this->license->key;
+ $this->name = $this->args['name'];
+
+ $this->set_up_license_data();
+ $this->do_settings_field();
+ add_action( 'admin_print_footer_scripts', array( $this, 'do_script' ) );
+ }
+
+ /**
+ * Adds the licensing JS to the screen.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function do_script() {
+ if ( wp_script_is( 'edd-licensing' ) ) {
+ return;
+ }
+ wp_enqueue_script( 'edd-licensing', EDD_PLUGIN_URL . 'assets/js/edd-admin-licensing.js', array( 'jquery' ), EDD_VERSION, true );
+ wp_localize_script(
+ 'edd-licensing',
+ 'EDDLicenseHandler',
+ array(
+ 'activating' => __( 'Activating', 'easy-digital-downloads' ),
+ 'deactivating' => __( 'Deactivating', 'easy-digital-downloads' ),
+ )
+ );
+ wp_print_scripts( 'edd-licensing' );
+ ?>
+
+ included_in_pass ) {
+ ?>
+
+ included_in_pass ? ' readonly' : ''; ?>
+ args['options']['item_id'] ) ) : ?>
+ data-item="args['options']['item_id'] ); ?>"
+
+ data-name="args['name'] ); ?>"
+ data-key="args['id'] ); ?>"
+ />
+
+ get_actions( $this->license->license, true );
+ ?>
+
+ do_message();
+ do_action( 'edd/admin/settings/licenses/settings_field', $this->license, $this->included_in_pass );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Licensing/Traits/Controls.php b/wp-content/plugins/easy-digital-downloads/src/Licensing/Traits/Controls.php
new file mode 100644
index 00000000..3326e4d5
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Licensing/Traits/Controls.php
@@ -0,0 +1,241 @@
+get_button_args( $status );
+ $timestamp = time();
+ if ( ! $echo ) {
+ ob_start();
+ }
+ ?>
+
+
+ license_key ) && 'activate' === $button['action'] ) : ?>
+
+
+
+ 'deactivate',
+ 'label' => __( 'Deactivate', 'easy-digital-downloads' ),
+ 'class' => 'secondary',
+ );
+ }
+
+ return array(
+ 'action' => 'activate',
+ 'label' => __( 'Activate', 'easy-digital-downloads' ),
+ 'class' => 'secondary',
+ );
+ }
+
+ /**
+ * Outputs the license key message.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ private function do_message( $echo = true ) {
+ if ( empty( $this->message ) ) {
+ return '';
+ }
+ $classes = array(
+ 'edd-license-data',
+ "edd-license-{$this->class}",
+ $this->license_status,
+ );
+ if ( ! $echo ) {
+ ob_start();
+ }
+ ?>
+
+ license->license;
+ $messages = new \EDD\Licensing\Messages(
+ array(
+ 'status' => $status,
+ 'license_key' => $this->license_key,
+ 'expires' => ! empty( $this->license->expires ) ? $this->license->expires : '',
+ 'name' => $this->name,
+ )
+ );
+ $message = $messages->get_message();
+
+ if ( ! empty( $this->license ) ) {
+ $now = current_time( 'timestamp' );
+ $expiration = ! empty( $this->license->expires )
+ ? strtotime( $this->license->expires, $now )
+ : false;
+
+ // activate_license 'invalid' on anything other than valid, so if there was an error capture it
+ if ( false === $this->license->success ) {
+ $class = ! empty( $this->license->error ) ? $this->license->error : 'error';
+ $license_status = "license-{$class}-notice";
+ } else {
+ $class = 'valid';
+ if ( 'lifetime' === $this->license->expires ) {
+ $license_status = 'license-lifetime-notice';
+ } elseif ( ( $expiration > $now ) && ( $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) ) {
+ $license_status = 'license-expires-soon-notice';
+ } else {
+ $license_status = 'license-expiration-date-notice';
+ }
+ }
+ }
+
+ $pass_manager = $this->get_pass_manager();
+
+ if ( 'valid' !== $class && $pass_manager->has_pass_data && $this->is_included_in_pass() ) {
+ $this->included_in_pass = true;
+ $class = 'included-in-pass';
+ /* translators: the all acess pass name. */
+ $message = sprintf( __( 'Your %s gives you access to this extension.', 'easy-digital-downloads' ), '
' . $pass_manager->get_pass_name() . '' );
+ }
+
+ $this->class = $class;
+ $this->message = $message;
+ $this->license_status = $license_status;
+ }
+
+ /**
+ * Whether a given product is included in the customer's active pass.
+ *
+ * @since 3.1.1
+ * @return bool
+ */
+ private function is_included_in_pass() {
+ $pass_manager = $this->get_pass_manager();
+ // All Access and lifetime passes can access everything.
+ if ( $pass_manager->hasAllAccessPass() ) {
+ return true;
+ }
+ // If we don't know the item ID we can't assume anything.
+ if ( empty( $this->args['options']['item_id'] ) ) {
+ return false;
+ }
+ $api = new \EDD\Admin\Extensions\ExtensionsAPI();
+ $api_item_id = $this->args['options']['item_id'];
+ $product_data = $api->get_product_data( array(), $api_item_id );
+ if ( ! $product_data || empty( $product_data->categories ) ) {
+ return false;
+ }
+
+ return (bool) $pass_manager->can_access_categories( $product_data->categories );
+ }
+
+ /**
+ * Gets the pass manager.
+ *
+ * @return EDD\Admin\Pass_Manager
+ */
+ private function get_pass_manager() {
+ if ( $this->pass_manager ) {
+ return $this->pass_manager;
+ }
+
+ $this->pass_manager = new Pass_Manager();
+
+ return $this->pass_manager;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/Menu.php b/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/Menu.php
new file mode 100644
index 00000000..f92bd992
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/Menu.php
@@ -0,0 +1,60 @@
+has_pass() ) {
+
+ add_submenu_page(
+ 'edit.php?post_type=download',
+ esc_html__( 'Upgrade to Pro', 'easy-digital-downloads' ),
+ esc_html__( 'Upgrade to Pro', 'easy-digital-downloads' ),
+ 'manage_shop_settings',
+ edd_link_helper(
+ 'https://easydigitaldownloads.com/lite-upgrade',
+ array(
+ 'utm_medium' => 'admin-menu',
+ 'utm_content' => 'upgrade-to-pro',
+ )
+ )
+ );
+ add_action( 'admin_head', array( $this, 'adjust_pro_menu_item_class' ) );
+ }
+ }
+
+ /**
+ * Adds the custom pro menu item class.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function adjust_pro_menu_item_class() {
+ new \EDD\Admin\Menu\LinkClass( 'https://easydigitaldownloads.com/lite-upgrade', 'edd-sidebar__upgrade-pro' );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/PassHandler/Connect.php b/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/PassHandler/Connect.php
new file mode 100644
index 00000000..18536fe7
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/PassHandler/Connect.php
@@ -0,0 +1,154 @@
+handler = $handler;
+ $this->pass_manager = new Pass_Manager();
+ }
+
+ public static function get_subscribed_events() {
+ return array(
+ 'wp_ajax_nopriv_easydigitaldownloads_connect_process' => 'process',
+ );
+ }
+
+ /**
+ * Process EDD Connect.
+ *
+ * @since 3.1.1
+ */
+ public function process() {
+
+ $error = esc_html__( 'There was an error while installing an upgrade. Please download the plugin from easydigitaldownloads.com and install it manually.', 'easy-digital-downloads' );
+
+ // Verify params present (oth & download link).
+ $post_oth = ! empty( $_REQUEST['oth'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['oth'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
+ $post_url = ! empty( $_REQUEST['file'] ) ? esc_url_raw( wp_unslash( $_REQUEST['file'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
+
+ if ( empty( $post_oth ) || empty( $post_url ) ) {
+ wp_send_json_error( $error );
+ }
+
+ // Verify oth.
+ $oth = get_option( 'edd_connect_token' );
+
+ if ( empty( $oth ) || ! hash_equals( $oth, $post_oth ) ) {
+ wp_send_json_error( $error );
+ }
+
+ // Delete so cannot replay.
+ delete_option( 'edd_connect_token' );
+
+ // Check license key.
+ $license_key = ! empty( $_REQUEST['key'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['key'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification
+ if ( empty( $license_key ) ) {
+ wp_send_json_error( __( 'No key provided.', 'easy-digital-downloads' ) );
+ }
+
+ if ( ! empty( $_REQUEST['license'] ) ) {
+ update_site_option( 'edd_pro_license_key', $license_key );
+ $license_data = (object) $_REQUEST['license'];
+ $this->handler->update_pro_license( $license_data );
+ $this->pass_manager->maybe_set_pass_flag( $license_key, $license_data );
+ }
+
+ if ( ! get_option( 'edd_pro_activation_date', false ) ) {
+ update_option( 'edd_pro_activation_date', time() );
+ }
+
+ // If pro is already active, return a success message.
+ if ( edd_is_pro() ) {
+ wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'easy-digital-downloads' ) );
+ }
+
+ // Set the current screen to avoid undefined notices.
+ set_current_screen( 'download_page_edd-settings' );
+
+ // Verify pro not installed.
+ $active = activate_plugin( 'easy-digital-downloads-pro/easy-digital-downloads.php', '', false, true );
+ if ( ! is_wp_error( $active ) ) {
+ wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'easy-digital-downloads' ) );
+ }
+
+ // Prepare variables.
+ $url = esc_url_raw(
+ edd_get_admin_url(
+ array( 'page' => 'edd-settings' )
+ )
+ );
+ $creds = request_filesystem_credentials( $url, '', false, false, null );
+
+ // Check for file system permissions.
+ if ( false === $creds || ! WP_Filesystem( $creds ) ) {
+ wp_send_json_error(
+ esc_html__( 'There was an error while installing an upgrade. Please check file system permissions and try again. Also, you can download the plugin from easydigitaldownloads.com and install it manually.', 'easy-digital-downloads' )
+ );
+ }
+
+ /*
+ * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
+ */
+
+ // Do not allow WordPress to search/download translations, as this will break JS output.
+ remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
+
+ // Create the plugin upgrader with our custom skin.
+ $installer = new \EDD\Admin\Installers\PluginSilentUpgrader( new \EDD\Admin\Installers\Install_Skin() );
+
+ // Error check.
+ if ( ! method_exists( $installer, 'install' ) ) {
+ wp_send_json_error( $error );
+ }
+
+ $installer->install( $post_url ); // phpcs:ignore
+
+ // Flush the cache and return the newly installed plugin basename.
+ wp_cache_flush();
+
+ $plugin_basename = $installer->plugin_info();
+
+ if ( $plugin_basename ) {
+
+ // Activate the plugin silently.
+ $activated = activate_plugin( $plugin_basename, '', false, true );
+
+ if ( ! is_wp_error( $activated ) ) {
+ wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'easy-digital-downloads' ) );
+ }
+
+ $error = esc_html__( 'Easy Digital Downloads (Pro) was installed, but needs to be activated on the Plugins page inside your WordPress admin.', 'easy-digital-downloads' );
+ }
+
+ wp_send_json_error( $error );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/PassHandler/Pointer.php b/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/PassHandler/Pointer.php
new file mode 100644
index 00000000..7067cecd
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Lite/Admin/PassHandler/Pointer.php
@@ -0,0 +1,228 @@
+ 'add_menu_item_class',
+ 'user_register' => 'dismiss_pointers_for_new_users',
+ 'admin_enqueue_scripts' => 'pointers',
+ );
+ }
+
+ /**
+ * Add class to the Onboarding Wizard subpage menu item.
+ *
+ * @since 3.1.1
+ */
+ public function add_menu_item_class() {
+ new \EDD\Admin\Menu\LinkClass( 'edd-settings', 'edd-settings__menu-item' );
+ }
+
+ /**
+ * Maybe show an admin pointer showing a message about the new menu locations.
+ *
+ * @since 3.1.1
+ * @return void
+ */
+ public function pointers() {
+ $pointers = $this->get_pointers();
+ if ( empty( $pointers ) ) {
+ return;
+ }
+ wp_enqueue_style( 'wp-pointer' );
+ wp_enqueue_script( 'edd-pointers', EDD_PLUGIN_URL . 'assets/lite/js/pointers.js', array( 'wp-pointer' ), EDD_VERSION, true );
+ wp_localize_script( 'edd-pointers', 'eddPointers', $pointers );
+ }
+
+ /**
+ * Gets the array of pointer notices.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_pointers() {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ return false;
+ }
+ if ( ! $this->has_pass_no_license() ) {
+ return false;
+ }
+
+ // Exclude some pages from showing our pointers so we don't interfeer with user behavior.
+ $excluded_pages = array(
+ 'update-core.php',
+ 'plugin-install.php',
+ );
+
+ global $pagenow;
+ if ( in_array( $pagenow, $excluded_pages, true ) ) {
+ return false;
+ }
+
+ $valid_pointers = array();
+ $dismissed = $this->get_user_dismissals( get_current_user_id() );
+
+ $pointers = array();
+ if ( ! edd_is_admin_page( 'download' ) ) {
+ // Add pointers that need to be registered when we are not on an EDD Admin Page.
+ $pointers[] = array(
+ 'pointer_id' => 'edd_activate_pass_non_edd_setting_page',
+ 'target' => '#menu-posts-download',
+ 'options' => array(
+ 'content' => $this->get_default_pass_upgrade_content(),
+ 'position' => array(
+ 'edge' => 'left',
+ 'align' => 'middle',
+ ),
+ ),
+ );
+ } else {
+ // Add pointers that need to be registered on EDD Admin Pages.
+ $pointers[] = array(
+ 'pointer_id' => 'edd_activate_pass_edd_setting_page',
+ 'target' => '.edd-settings__menu-item:not(.current)',
+ 'options' => array(
+ 'content' => $this->get_default_pass_upgrade_content(),
+ 'position' => array(
+ 'edge' => 'left',
+ 'align' => 'middle',
+ ),
+ ),
+ );
+
+ $pointers[] = array(
+ 'pointer_id' => 'edd_activate_pass_button',
+ 'target' => '.edd-pass-handler__action',
+ 'options' => array(
+ 'content' => sprintf(
+ '
%s
%s
',
+ __( 'Install the Pro Version!', 'easy-digital-downloads' ),
+ __( 'We see you already have an active pass. Click here to verify your license key and we\'ll connect you to install Easy Digital Downloads (Pro).', 'easy-digital-downloads' )
+ ),
+ 'position' => array(
+ 'edge' => 'bottom',
+ 'align' => 'left',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * Allows adding pointers for registration within the EDD Ecosystem.
+ *
+ * @since 3.1.1
+ * @param array $pointers The registerd pointers for EDD to load.
+ */
+ $pointers = apply_filters( 'edd_pointers', $pointers );
+
+ foreach ( $pointers as $pointer ) {
+ if (
+ empty( $pointer ) ||
+ empty( $pointer['pointer_id'] ) ||
+ empty( $pointer['target'] ) ||
+ empty( $pointer['options'] ) ||
+ in_array( $pointer['pointer_id'], $dismissed, true )
+ ) {
+ continue;
+ }
+
+ $valid_pointers['pointers'][] = $pointer;
+ }
+
+ return $valid_pointers;
+ }
+
+ /**
+ * Gets the dismissed_wp_pointers user meta.
+ *
+ * @since 3.1.1
+ * @param int $user_id THe current user ID.
+ * @return array
+ */
+ public function get_user_dismissals( $user_id ) {
+ return explode( ',', (string) get_user_meta( $user_id, 'dismissed_wp_pointers', true ) );
+ }
+
+ /**
+ * Dismisses the pointer notices for new users.
+ *
+ * @since 3.1.1
+ * @param int $user_id The new user ID.
+ * @return void
+ */
+ public function dismiss_pointers_for_new_users( $user_id ) {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ return;
+ }
+
+ if ( $this->has_pass_no_license() ) {
+ return;
+ }
+
+ $dismissals = $this->get_user_dismissals( $user_id );
+
+ if ( ! in_array( 'edd_activate_pass', $dismissals, true ) ) {
+ $dismissals[] = 'edd_activate_pass';
+ }
+
+ if ( ! in_array( 'edd_activate_pass_button', $dismissals, true ) ) {
+ $dismissals[] = 'edd_activate_pass_button';
+ }
+
+ if ( ! in_array( 'edd_activate_pass_non_edd_setting_page', $dismissals, true ) ) {
+ $dismissals[] = 'edd_activate_pass_non_edd_setting_page';
+ }
+
+ update_user_meta( $user_id, 'dismissed_wp_pointers', implode( ',', array_filter( $dismissals ) ) );
+ }
+
+ /**
+ * Checks whether the site has an active pass, but hasn't entered the pro license key yet.
+ *
+ * @since 3.1.1
+ * @return bool
+ */
+ private function has_pass_no_license() {
+ $pro_license = new \EDD\Licensing\License( 'pro' );
+ if ( ! empty( $pro_license->key ) ) {
+ return false;
+ }
+ $pass_manager = new \EDD\Admin\Pass_Manager();
+
+ return ! empty( $pass_manager->highest_license_key );
+ }
+
+ /**
+ * Gets the default notice content for users with passes.
+ *
+ * @since 3.1.1.2
+ * @return string
+ */
+ private function get_default_pass_upgrade_content() {
+ $settings_url = edd_get_admin_url(
+ array(
+ 'page' => 'edd-settings',
+ )
+ );
+
+ return sprintf(
+ '
%s
%s
',
+ __( 'You\'re eligible to install EDD (Pro)!', 'easy-digital-downloads' ),
+ sprintf(
+ /* translators: 1. opening anchor tag; 2. closing anchor tag */
+ __( 'Good news! With your pass subscription, you can install the Pro version of Easy Digital Downloads. %1$sVisit the settings page%2$s to verify your license and access Pro only features.', 'easy-digital-downloads' ),
+ '
',
+ ''
+ )
+ );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Lite/Core.php b/wp-content/plugins/easy-digital-downloads/src/Lite/Core.php
new file mode 100644
index 00000000..a86a6659
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Lite/Core.php
@@ -0,0 +1,60 @@
+get_lite_providers() );
+ }
+
+ /**
+ * Gets the admin service providers.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ protected function get_admin_providers() {
+ return array_merge( parent::get_admin_providers(), $this->get_lite_admin_providers() );
+ }
+
+ /**
+ * Gets the lite service providers.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_lite_providers() {
+ return array(
+ new Admin\PassHandler\Connect( $this->pass_handler ),
+ );
+ }
+
+ /**
+ * Gets the lite admin providers.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_lite_admin_providers() {
+ if ( ! is_admin() ) {
+ return array();
+ }
+
+ return array(
+ new Admin\Menu(),
+ new Admin\PassHandler\Pointer(),
+ );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/includes/models/Notification.php b/wp-content/plugins/easy-digital-downloads/src/Models/Notification.php
similarity index 100%
rename from wp-content/plugins/easy-digital-downloads/includes/models/Notification.php
rename to wp-content/plugins/easy-digital-downloads/src/Models/Notification.php
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Data.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Data.php
new file mode 100644
index 00000000..8cfd9c68
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Data.php
@@ -0,0 +1,72 @@
+ $this->get_id(),
+ );
+
+ $classes = array(
+ 'environment' => new Environment(),
+ 'integrations' => new Integrations(),
+ 'licenses' => new Licenses(),
+ 'sales' => new Orders(),
+ 'refunds' => new Orders( 'refund' ),
+ 'settings' => new Settings(),
+ 'stats' => new Stats(),
+ );
+
+ foreach ( $classes as $key => $class ) {
+ $data[ $key ] = $class->get();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the unique site ID.
+ * This is generated from the home URL and two random pieces of data
+ * to create a hashed site ID that anonymizes the site data.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_id() {
+ $this->id = get_option( 'edd_telemetry_uuid' );
+ if ( $this->id ) {
+ return $this->id;
+ }
+ $home_url = get_home_url();
+ $uuid = wp_generate_uuid4();
+ $today = gmdate( 'now' );
+ $this->id = md5( $home_url . $uuid . $today );
+
+ update_option( 'edd_telemetry_uuid', $this->id, false );
+
+ return $this->id;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Environment.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Environment.php
new file mode 100644
index 00000000..f040511c
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Environment.php
@@ -0,0 +1,75 @@
+ phpversion(),
+ 'wp_version' => $this->get_wp_version(),
+ 'edd_version' => EDD_VERSION,
+ 'edd_pro' => (int) (bool) edd_is_pro(),
+ 'locale' => get_locale(),
+ 'active_theme' => $this->get_active_theme(),
+ 'multisite' => (int) (bool) is_multisite(),
+ 'is_ssl' => (int) (bool) is_ssl(),
+ 'stripe_connect' => (int) (bool) edd_get_option( 'stripe_connect_account_id' ),
+ );
+ $server = $this->parse_server();
+
+ return array_merge( $data, $server );
+ }
+
+ /**
+ * Adds the server data to the array of data.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function parse_server() {
+ $server = ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' );
+ $server = explode( '/', $server );
+
+ $data = array(
+ 'server' => $server[0],
+ );
+ if ( isset( $server[1] ) ) {
+ $data['server_version'] = $server[1];
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the WordPress version.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_wp_version() {
+ $version = get_bloginfo( 'version' );
+ $version = explode( '-', $version );
+
+ return reset( $version );
+ }
+
+ /**
+ * Gets the active theme name.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_active_theme() {
+ $active_theme = wp_get_theme();
+
+ return $active_theme->name;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Integrations.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Integrations.php
new file mode 100644
index 00000000..3a21bb6f
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Integrations.php
@@ -0,0 +1,85 @@
+get_all_plugins() as $basename => $details ) {
+ if ( ! $this->should_log_integration( $basename, $details ) ) {
+ continue;
+ }
+ $data[] = array(
+ 'name' => $details['Name'],
+ 'type' => $this->is_core_integration( $basename, $details ) ? 'core' : 'external',
+ 'version' => $details['Version'],
+ );
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets all plugins on the site.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_all_plugins() {
+ if ( ! function_exists( 'get_plugins' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
+
+ return get_plugins();
+ }
+
+ /**
+ * Whether the integration should be included in the data.
+ *
+ * @since 3.1.1
+ * @param string $basename
+ * @param array $details
+ * @return bool
+ */
+ private function should_log_integration( $basename, $details ) {
+ if ( ! is_plugin_active( $basename ) ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Whether the integration is an EDD or third party integration.
+ *
+ * @since 3.1.1
+ * @param string $basename
+ * @param array $details
+ * @return bool
+ */
+ private function is_core_integration( $basename, $details ) {
+ if ( 'Easy Digital Downloads' === $details['Author'] ) {
+ return true;
+ }
+ if ( in_array( untrailingslashit( $details['AuthorURI'] ), array( 'https://easydigitaldownloads.com', 'https://sandhillsdev.com' ), true ) ) {
+ return false !== strpos( $details['PluginURI'], 'easydigitaldownloads.com' );
+ }
+
+ return false;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Licenses.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Licenses.php
new file mode 100644
index 00000000..8f39a47d
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Licenses.php
@@ -0,0 +1,69 @@
+get_extensions();
+ $pro_license = $this->get_pro_license();
+ if ( $pro_license ) {
+ $data[] = $pro_license;
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the pro license status.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_pro_license() {
+ $pro_license = new License( 'pro' );
+
+ return array(
+ 'extension' => 'edd_pro',
+ 'status' => $pro_license->license,
+ );
+ }
+
+ /**
+ * Gets licensed extensions' statuses.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_extensions() {
+ $data = array();
+ $extensions = \EDD\Extensions\get_licensed_extension_slugs();
+ foreach ( $extensions as $slug ) {
+ $shortname = str_replace( 'edd_', '', $slug );
+ $license = new License( $shortname );
+ if ( ! empty( $license->license ) ) {
+ $data[] = array(
+ 'extension' => $slug,
+ 'status' => $license->license,
+ );
+ }
+ }
+
+ return $data;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Orders.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Orders.php
new file mode 100644
index 00000000..cd1aee9d
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Orders.php
@@ -0,0 +1,166 @@
+type = $type;
+ }
+
+ /**
+ * Gets the gateway data.
+ *
+ * @return array
+ */
+ public function get() {
+ $data = array(
+ 'all_gateways' => $this->get_totals(),
+ );
+ foreach ( $this->get_date_ranges() as $type => $start ) {
+ foreach ( $this->get_totals_by_gateway( $start ) as $gateway => $currency ) {
+ foreach ( $currency as $code => $amounts ) {
+ $data[ $gateway ][ $code ][ $type ] = $amounts;
+ }
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the store order totals for all currencies and gateways.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_totals() {
+ $data = array();
+ foreach ( $this->get_date_ranges() as $type => $start ) {
+ $results = $this->get_totals_by_date( $start );
+ foreach ( $results as $result ) {
+ $data['all_currencies'][ $type ] = array(
+ 'count' => $result->sales,
+ 'total' => $result->earnings,
+ );
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the order count/total for a given date range.
+ *
+ * @since 3.1.1
+ * @param string $start The start date (optional).
+ * @return array
+ */
+ private function get_totals_by_gateway( $start = '' ) {
+ $data = array();
+ foreach ( $this->get_results_by_date( $start ) as $total ) {
+ $gateway = $total->gateway ? $total->gateway : 'unknown';
+ $currency = $total->currency ? $total->currency : 'unknown';
+ $data[ $gateway ][ $currency ] = array(
+ 'count' => $total->sales,
+ 'total' => $total->earnings,
+ );
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets order totals by date.
+ *
+ * @since 3.1.1
+ * @param string $start
+ * @return array
+ */
+ private function get_totals_by_date( $start = '' ) {
+ global $wpdb;
+
+ return $wpdb->get_results(
+ "SELECT COUNT(*) as sales, SUM(total) as earnings
+ FROM {$wpdb->edd_orders}
+ WHERE type = '{$this->type}'
+ {$this->get_status_query()}
+ {$this->get_date_query( $start )}
+ LIMIT 0, 99999;"
+ );
+ }
+
+ /**
+ * Gets orders grouped by gateway and currency.
+ *
+ * @since 3.1.1
+ * @param string $start
+ * @return array
+ */
+ private function get_results_by_date( $start = '' ) {
+ global $wpdb;
+
+ return $wpdb->get_results(
+ "SELECT gateway, currency, COUNT(*) as sales, SUM(total) as earnings
+ FROM {$wpdb->edd_orders}
+ WHERE type = '{$this->type}'
+ {$this->get_status_query()}
+ {$this->get_date_query( $start )}
+ GROUP BY gateway, currency
+ LIMIT 0, 99999;"
+ );
+ }
+
+ /**
+ * Gets the status query string.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_status_query() {
+ return "AND status IN ('" . implode( "', '", edd_get_gross_order_statuses() ) . "')";
+ }
+
+ /**
+ * Gets the date query string.
+ *
+ * @since 3.1.1
+ * @param string $start
+ * @return string
+ */
+ private function get_date_query( $start = '' ) {
+ return $start ? sprintf(
+ "AND ( date_completed >= '%s' AND date_completed <= '%s' )",
+ gmdate( 'Y-m-d 00:00:00', strtotime( $start ) ),
+ gmdate( 'Y-m-d 00:00:00', strtotime( 'today' ) )
+ ) : '';
+ }
+
+ /**
+ * Gets the date ranges for each query.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function get_date_ranges() {
+ return array(
+ 'lifetime' => '',
+ 'week' => '-1 week',
+ 'month' => '-30 days',
+ );
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Settings.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Settings.php
new file mode 100644
index 00000000..1f97d679
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Settings.php
@@ -0,0 +1,218 @@
+ $tab_contents ) {
+ $tab_sections = edd_get_settings_tab_sections( $tab_key );
+ foreach ( $tab_sections as $section_key => $section_title ) {
+ $section_setting_types = edd_get_registered_settings_types( $tab_key, $section_key );
+ if ( ! empty( $settings[ $tab_key ] ) && ! empty( $settings[ $tab_key ][ $section_key ] ) ) {
+ $section_settings = $settings[ $tab_key ][ $section_key ];
+ foreach ( $section_settings as $setting_key => $setting ) {
+ $value = $this->get_setting_value( $tab_key, $section_key, $setting_key );
+ // If the value is null, it's a skipped setting.
+ if ( ! is_null( $value ) ) {
+ $setting_id = isset( $setting['id'] ) ? $setting['id'] : sanitize_title( $setting['name'] );
+ $data[ $setting_id ] = $value;
+ }
+ }
+ }
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the id and value for an individual setting.
+ *
+ * @param string $tab_key
+ * @param string $section_key
+ * @param string $setting_key
+ * @return mixed
+ */
+ private function get_setting_value( $tab_key, $section_key, $setting_key ) {
+ $setting = edd_get_registered_setting_details( $tab_key, $section_key, $setting_key );
+ if ( ! $this->can_include_setting( $setting ) ) {
+ return null;
+ }
+
+ $default = isset( $setting['std'] ) ? $setting['std'] : '';
+ $value = edd_get_option( $setting['id'], $default );
+ if ( in_array( $setting['type'], array( 'checkbox', 'checkbox_description' ), true ) ) {
+ return (int) (bool) $value;
+ }
+ if ( empty( $value ) && 'currency' === $setting['id'] ) {
+ return edd_get_currency();
+ }
+ if ( in_array( $setting['type'], $this->text_settings(), true ) ) {
+ return $this->anonymize_setting( $value );
+ }
+ if ( $this->should_populate_array( $setting ) ) {
+ return $this->update_setting_value_array( $value, $setting );
+ }
+
+ return $value;
+ }
+
+ /**
+ * Evaluates whether a setting can be included in the telemetry data.
+ *
+ * @since 3.1.1
+ * @param array $setting
+ * @return bool
+ */
+ private function can_include_setting( $setting ) {
+
+ // If the setting is marked readonly then it's not really a setting.
+ if ( ! empty( $setting['args']['readonly'] ) ) {
+ return false;
+ }
+
+ // Certain types of settings should always be skipped.
+ if ( in_array( $setting['type'], $this->skipped_settings_types(), true ) ) {
+ return false;
+ }
+
+ // Settings known to be PII are excluded.
+ if ( in_array( $setting['id'], $this->sensitive_settings(), true ) ) {
+ return false;
+ }
+
+ // Text settings are always excluded unless specifically included.
+ if ( in_array( $setting['type'], $this->text_settings(), true ) && ! in_array( $setting['id'], $this->allowed_text_settings(), true ) ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * These settings types are either not settings or nearly always full of sensitive data/PII.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function skipped_settings_types() {
+
+ return array_merge(
+ edd_get_non_setting_types(),
+ array(
+ 'rich_editor',
+ 'upload',
+ 'color',
+ 'recapture',
+ )
+ );
+ }
+
+ /**
+ * These settings are known to be sensitive/PII and are not otherwise excluded.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function sensitive_settings() {
+ return array(
+ 'base_state',
+ 'paypal_live_client_id',
+ 'paypal_live_client_secret',
+ 'paypal_sandbox_client_id',
+ 'paypal_sandbox_client_secret',
+ );
+ }
+
+ /**
+ * We assume that any text field should be excluded unless it's in this array.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function allowed_text_settings() {
+ return array();
+ }
+
+ /**
+ * Settings types which will be strings and which should be evaluated for PII.
+ *
+ * @since 3.1.1
+ * @return array
+ */
+ private function text_settings() {
+ return array(
+ 'text',
+ 'textarea',
+ 'email',
+ );
+ }
+
+ /**
+ * Whether an array of settings should be populated, due to the setting type.
+ *
+ * @since 3.1.1
+ * @param array $setting
+ * @return bool
+ */
+ private function should_populate_array( $setting ) {
+ $settings = array( 'gateways', 'accepted_cards' );
+
+ return 'multicheck' === $setting['type'] || in_array( $setting['id'], $settings, true );
+ }
+
+ /**
+ * Attempts to anonymize a setting value.
+ * @todo check how we want to replace--values or empty strings?
+ *
+ * @since 3.1.1
+ * @param string $value
+ * @return string
+ */
+ private function anonymize_setting( $value ) {
+ $admin_email = get_bloginfo( 'admin_email' );
+ $value = str_replace( $admin_email, 'email@website.dev', $value );
+ $site_name = get_bloginfo( 'name' );
+ $value = str_replace( $site_name, 'Site Name', $value );
+ $home_url = get_home_url();
+ $value = str_replace( $home_url, 'website.dev', $value );
+
+ return $value;
+ }
+
+ /**
+ * Updates the an array setting value to include all options.
+ *
+ * @since 3.1.1
+ * @param mixed $saved_value The actual saved value (can be empty).
+ * @param array $setting The setting definition.
+ * @return array
+ */
+ private function update_setting_value_array( $saved_value, $setting ) {
+ $value = array();
+ foreach ( $setting['options'] as $key => $label ) {
+ if ( is_array( $saved_value ) && ! empty( $saved_value[ $key ] ) ) {
+ $value[] = $key;
+ }
+ }
+
+ return $value;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/src/Telemetry/Stats.php b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Stats.php
new file mode 100644
index 00000000..377ce395
--- /dev/null
+++ b/wp-content/plugins/easy-digital-downloads/src/Telemetry/Stats.php
@@ -0,0 +1,126 @@
+ $this->convert_timestamp( edd_get_activation_date() ),
+ 'pro_activated' => $this->convert_timestamp( get_option( 'edd_pro_activation_date' ) ),
+ 'first_order' => $this->get_first_order_date(),
+ 'onboarding_started' => get_option( 'edd_onboarding_started' ),
+ 'onboarding_completed' => get_option( 'edd_onboarding_completed' ),
+ 'products' => $this->get_product_count(),
+ 'pass_id' => $this->get_pass_id(),
+ );
+ }
+
+ /**
+ * Gets the date of the first completed order.
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_first_order_date() {
+ $orders = edd_get_orders(
+ array(
+ 'mode' => 'live',
+ 'status__in' => edd_get_complete_order_statuses(),
+ 'number' => 1,
+ 'fields' => 'date_completed',
+ 'orderby' => 'id',
+ 'order' => 'ASC',
+ ),
+ );
+
+ return ! empty( $orders ) ? reset( $orders ) : '';
+ }
+
+ /**
+ * Converts a timestamp value to a date string for consistent dates.
+ *
+ * @since 3.1.1
+ * @param string $timestamp
+ * @return string
+ */
+ private function convert_timestamp( $timestamp = '' ) {
+ return $timestamp ? gmdate( 'Y-m-d H:i:s', $timestamp ) : '';
+ }
+
+ /**
+ * Gets the site pass ID.
+ *
+ * @since 3.1.1
+ * @return int|string
+ */
+ private function get_pass_id() {
+ $pass_manager = new Pass_Manager();
+
+ return $pass_manager->highest_pass_id;
+ }
+
+ /**
+ * Gets the number of published products on the website.
+ *
+ * @since 3.1.1
+ * @return int
+ */
+ private function get_product_count() {
+ if ( $this->product_count ) {
+ return $this->product_count;
+ }
+ $query = new \WP_Query(
+ array(
+ 'post_type' => 'download',
+ 'status' => 'publish',
+ 'nopaging' => true,
+ )
+ );
+ $this->product_count = $query->found_posts;
+
+ return $this->product_count;
+ }
+
+ /**
+ * Gets the average total earnings per product.
+ *
+ * @since 3.1.1
+ * @return float
+ */
+ private function get_average_per_product() {
+ global $wpdb;
+
+ $results = $wpdb->get_results(
+ "SELECT SUM(total) as earnings
+ FROM {$wpdb->edd_orders}
+ WHERE type = 'sale'
+ AND status IN ('" . implode( "', '", edd_get_gross_order_statuses() ) . "')
+ LIMIT 0, 99999;"
+ );
+ if ( empty( $results ) ) {
+ return 0;
+ }
+ $results = reset( $results );
+ $products = $this->get_product_count();
+
+ return $results->earnings / $products;
+ }
+}
diff --git a/wp-content/plugins/easy-digital-downloads/includes/utils/EnvironmentChecker.php b/wp-content/plugins/easy-digital-downloads/src/Utils/EnvironmentChecker.php
similarity index 100%
rename from wp-content/plugins/easy-digital-downloads/includes/utils/EnvironmentChecker.php
rename to wp-content/plugins/easy-digital-downloads/src/Utils/EnvironmentChecker.php
diff --git a/wp-content/plugins/easy-digital-downloads/includes/utils/NotificationImporter.php b/wp-content/plugins/easy-digital-downloads/src/Utils/NotificationImporter.php
similarity index 92%
rename from wp-content/plugins/easy-digital-downloads/includes/utils/NotificationImporter.php
rename to wp-content/plugins/easy-digital-downloads/src/Utils/NotificationImporter.php
index 723cf532..f492b43b 100644
--- a/wp-content/plugins/easy-digital-downloads/includes/utils/NotificationImporter.php
+++ b/wp-content/plugins/easy-digital-downloads/src/Utils/NotificationImporter.php
@@ -59,7 +59,7 @@ class NotificationImporter {
try {
$this->validateNotification( $notification );
- $existingId = EDD()->notifications->get_column_by( 'id', 'remote_id', $notification->id );
+ $existingId = $this->get_column_by( 'id', 'remote_id', $notification->id );
if ( $existingId ) {
edd_debug_log( '-- Updating existing notification.' );
@@ -236,4 +236,16 @@ class NotificationImporter {
) ) );
}
+ /**
+ * Retrieve a specific column's value by the the specified column / value
+ *
+ * @since 3.1.1
+ * @return string
+ */
+ private function get_column_by( $column, $column_where, $column_value ) {
+ global $wpdb;
+ $column_where = esc_sql( $column_where );
+ $column = esc_sql( $column );
+ return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM {$wpdb->edd_notifications} WHERE $column_where = %s LIMIT 1;", $column_value ) );
+ }
}
diff --git a/wp-content/plugins/easy-digital-downloads/templates/edd.css b/wp-content/plugins/easy-digital-downloads/templates/edd.css
deleted file mode 100644
index 59a12f7e..00000000
--- a/wp-content/plugins/easy-digital-downloads/templates/edd.css
+++ /dev/null
@@ -1,1054 +0,0 @@
-/**
- * Easy Digital Downloads Styles
- *
- * @package EDD
- * @subpackage CSS
- * @copyright Copyright (c) 2015, Pippin Williamson
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
-*/
-@charset "UTF-8";
-
-/* Base styles for SVG icons. */
-
-.edd-icon {
- display: inline-block;
- fill: currentColor;
- position: relative; /* Align more nicely with capital letters */
- vertical-align: middle;
-}
-
-.edd-icon-spin {
- display: inline-block;
- animation: edd-icon-spin 2s infinite linear;
-}
-
-@keyframes edd-icon-spin {
- 0% {
- transform: rotate(0deg)
- }
- 100% {
- transform: rotate(359deg)
- }
-}
-
-
-/* =Checkout Form
--------------------------------------------------------------- */
-.edd_clearfix:after {
- display: block;
- visibility: hidden;
- float: none;
- clear: both;
- text-indent: -9999px;
- content: ".";
-}
-
-/* Cart Contents */
-#edd_checkout_cart {
- text-align: left;
- width: 100%;
- border: none;
- margin: 0 0 21px;
- table-layout: auto;
-}
-#edd_checkout_cart th,
-#edd_checkout_cart td {
- text-align: left;
- border: 1px solid #eee;
- color: #666;
- padding: 0.5em 1.387em;
-}
-#edd_checkout_cart .edd_cart_header_row th {
- background: #fafafa;
- padding: 1.387em;
-}
-#edd_checkout_cart .edd_cart_tax_row th,
-#edd_checkout_cart .edd_cart_discount_row th {
- background: none;
-}
-#edd_checkout_cart th {
- font-weight: bold;
-}
-#edd_checkout_cart td {
- line-height: 25px;
- vertical-align: middle;
- background: #fff;
-}
-#edd_checkout_cart th.edd_cart_actions,
-#edd_checkout_cart td.edd_cart_actions,
-#edd_checkout_cart th:last-child,
-#edd_checkout_cart td:last-child,
-#edd_checkout_cart th.edd_cart_total {
- text-align: right;
-}
-#edd_checkout_cart td img {
- float: left;
- margin: 0 8px 0 0;
- background: none;
- padding: 0;
- border: none;
-}
-#edd_checkout_cart input.edd-item-quantity {
- width: 3em;
- padding: 2px;
-}
-#edd_checkout_cart .edd_discount {
- display: inline-block;
- margin-left: 5px;
-}
-.edd_discount_remove {
- display: inline-block;
- width: 10px;
- height: 11px;
- background: url(images/xit.gif ) 0 0 no-repeat;
- position: relative;
- top: 3px;
-}
-.edd_discount_remove:hover {
- background-position: -10px 0;
-}
-#edd_checkout_cart br {
- display: none;
-}
-#edd_checkout_cart a.edd-cart-saving-button {
- font-weight: normal;
- text-decoration: none;
-}
-
-/* Checkout Fields */
-#edd_checkout_form_wrap legend {
- display: block;
- font-size: 120%;
- line-height: 1;
- font-weight: bold;
- width: 100%;
- margin: 0 0 21px;
- padding: 0;
- float: left;
-}
-#edd_checkout_form_wrap label {
- font-weight: bold;
- display: block;
- position: relative;
- line-height: 100%;
- font-size: 95%;
- margin: 0 0 5px;
-}
-#edd_checkout_form_wrap span.edd-description {
- color: #666;
- font-size: 80%;
- display: block;
- margin: 0 0 5px;
-}
-#edd_checkout_form_wrap input.edd-input,
-#edd_checkout_form_wrap textarea.edd-input {
- display: inline-block;
- width: 70%;
-}
-#edd_checkout_form_wrap select.edd-select {
- display: block;
- width: 60%;
-}
-#edd_checkout_form_wrap select.edd-select.edd-select-small {
- display: inline;
- width: auto;
-}
-#edd_checkout_form_wrap input.edd-input.error,
-#edd_checkout_form_wrap textarea.edd-input.error {
- border-color: #c4554e;
-}
-#edd_checkout_form_wrap > p {
- margin: 0 0 21px;
-}
-#edd_checkout_form_wrap span.edd-required-indicator {
- color: #b94a48;
- display: inline;
-}
-#edd_checkout_form_wrap textarea,
-#edd_checkout_form_wrap input[type="text"],
-#edd_checkout_form_wrap input[type="email"],
-#edd_checkout_form_wrap input[type="password"],
-#edd_checkout_form_wrap input[type="tel"] {
- padding: 4px 6px;
-}
-#edd_checkout_form_wrap input[type="radio"] {
- border: none;
- margin-right: 5px;
-}
-#edd_checkout_form_wrap input[type="checkbox"] {
- display: inline-block;
- margin: 0 5px 0 0;
-}
-#edd_checkout_form_wrap input[type="checkbox"] + label,
-#edd_checkout_form_wrap input[type="checkbox"] + label:after {
- display: inline;
-}
-#edd_checkout_form_wrap .edd-payment-icons {
- display: -ms-flexbox;
- display: flex;
- margin: 0 0 8px;
-}
-#edd_checkout_form_wrap .edd-payment-icons img.payment-icon {
- max-height: 32px;
-}
-#edd_checkout_form_wrap .edd-payment-icons .payment-icon {
- margin: 0 10px 0 0;
-}
-#edd_checkout_form_wrap #edd-payment-mode-wrap label {
- display: inline-block;
- margin: 0 20px 0 0;
-}
-#edd_checkout_form_wrap #edd-payment-mode-wrap .edd-payment-mode-label {
- font-weight: bold;
- display: inline-block;
- position: relative;
- margin-bottom: 5px;
-}
-#edd_checkout_form_wrap fieldset {
- border: 1px solid #eee;
- padding: 1.387em;
- margin: 0 0 21px;
-}
-#edd_checkout_form_wrap #edd_purchase_submit,
-#edd_checkout_form_wrap #edd_discount_code,
-#edd_checkout_form_wrap #edd_register_account_fields {
- padding: 0;
- border: none;
-}
-#edd_checkout_form_wrap fieldset fieldset {
- margin: 0;
- border: none;
- padding: 0;
-}
-#edd_checkout_form_wrap #edd-login-account-wrap,
-#edd_checkout_form_wrap #edd-new-account-wrap,
-#edd_checkout_form_wrap #edd_show_discount,
-#edd_checkout_form_wrap .edd-cart-adjustment,
-#edd_checkout_form_wrap #edd_final_total_wrap {
- background: #fafafa;
- color: #666;
- padding: 0.5em 1.387em;
-}
-#edd_checkout_form_wrap #edd-discount-code-wrap,
-#edd_checkout_form_wrap #edd_final_total_wrap,
-#edd_checkout_form_wrap #edd_show_discount {
- border: 1px solid #eee;
-}
-#edd_checkout_form_wrap .edd-cart-adjustment {
- padding: 1.387em;
-}
-#edd_checkout_form_wrap .edd-cart-adjustment input.edd-input,
-#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit {
- display: inline-block;
-}
-#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit {
- padding: 3px 12px;
- margin-bottom: 2px;
-}
-#edd_checkout_form_wrap #edd-discount-error-wrap {
- width: 100%;
- display: inline-block;
- margin: 1em 0 0;
-}
-#edd_checkout_form_wrap #edd-new-account-wrap,
-#edd_checkout_form_wrap #edd-login-account-wrap {
- margin: -1.387em -1.387em 21px;
- border-left: none;
- border-right: none;
- border-top: none;
-}
-#edd_checkout_form_wrap #edd_payment_mode_select {
- margin-bottom: 21px;
-}
-#edd_checkout_form_wrap fieldset#edd_register_fields #edd_checkout_user_info {
- margin-bottom: 21px;
-}
-#edd_checkout_form_wrap fieldset#edd_register_account_fields legend {
- padding-top: 11px;
-}
-#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_register_password,
-#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_login_password {
- margin: 0;
-}
-#edd_checkout_form_wrap fieldset#edd_cc_fields legend {
- border: none;
- padding: 0;
-}
-#edd_checkout_form_wrap fieldset p:last-child {
- margin-bottom: 0;
-}
-#edd_checkout_form_wrap fieldset#edd_cc_fields #edd-card-number-wrap {
- margin-top: 5px;
-}
-#edd_checkout_form_wrap #edd_purchase_final_total {
- margin: 21px 0;
-}
-#edd_checkout_form_wrap #edd_purchase_final_total p {
- margin: 0;
-}
-#edd_secure_site_wrapper {
- padding: 4px 4px 4px 0;
- font-weight: bold;
-}
-#edd_secure_site_wrapper span {
- vertical-align: middle;
-}
-#edd_checkout_form_wrap input.edd-input.card-number.valid {
- background-image: url(images/tick.png);
- background-repeat: no-repeat;
- background-position: 98% 50%;
-}
-#edd_checkout_form_wrap span.exp-divider {
- display: inline;
-}
-#edd_checkout_form_wrap span.card-type {
- position: absolute;
- top: 0;
- right: 0;
-}
-#edd_checkout_form_wrap span.card-type.off {
- display: none;
-}
-#edd_checkout_form_wrap .edd-cart-ajax {
- box-shadow: none;
-}
-.edd-amazon-profile-wrapper {
- font-size: 12px;
-}
-.edd-amazon-profile-name {
- font-weight: 600;
-}
-.edd-amazon-logout {
- font-size: 10px;
- line-height: 12px;
-}
-.edd-amazon-logout a {
- cursor: pointer;
-}
-#edd-amazon-wallet-box,
-#edd-amazon-address-box {
- height: 228px;
- width: 350px;
-}
-#edd-amazon-address-box {
- margin-bottom: 15px;
-}
-
-/* Desktop and tablet */
-@media only screen and (min-width: 768px) {
- #edd-amazon-address-box,
- #edd-amazon-wallet-box {
- width: 100%;
- height: 228px;
- }
-}
-
-/* =Ajax Add To Cart Button
--------------------------------------------------------------- */
-.edd_purchase_submit_wrapper {
- position: relative;
-}
-.edd_purchase_submit_wrapper a.edd-add-to-cart {
- text-decoration: none;
- display: none;
- position: relative;
- overflow: hidden;
-}
-.edd_purchase_submit_wrapper a.edd-add-to-cart.edd-has-js {
- display: inline-block;
-}
-.edd_purchase_submit_wrapper .edd-cart-ajax {
- display: none;
- position: relative;
- left: -35px;
-}
-.edd-submit.button.edd-ajax-loading {
- padding-right: 30px;
-}
-.edd-add-to-cart .edd-add-to-cart-label {
- opacity: 1;
- filter: alpha(opacity=100);
-}
-.edd-loading,
-.edd-loading:after {
- border-radius: 50%;
- display: block;
- width: 1.5em;
- height: 1.5em;
-}
-.edd-loading {
- animation: edd-spinning 1.1s infinite linear;
- border-top: 0.2em solid rgba(255, 255, 255, 0.2);
- border-right: 0.2em solid rgba(255, 255, 255, 0.2);
- border-bottom: 0.2em solid rgba(255, 255, 255, 0.2);
- border-left: 0.2em solid #fff;
- font-size: 0.75em;
- position: absolute;
- left: calc(50% - 0.75em);
- top: calc(50% - 0.75em);
- opacity: 0;
- filter: alpha(opacity=0);
- transform: translateZ(0);
-}
-a.edd-add-to-cart.white .edd-loading,
-.edd-discount-loader.edd-loading,
-.edd-loading-ajax.edd-loading {
- border-top-color: rgba(0, 0, 0, 0.2);
- border-right-color: rgba(0, 0, 0, 0.2);
- border-bottom-color: rgba(0, 0, 0, 0.2);
- border-left-color: #000;
-}
-.edd-loading-ajax.edd-loading {
- display: inline-block;
- position: relative;
- top: 0;
- left: 0.25em;
- vertical-align: middle;
-}
-
-#edd_checkout_form_wrap .edd-cart-adjustment .edd-apply-discount.edd-submit {
- display: inline-block;
-}
-.edd-discount-loader.edd-loading {
- display: inline-block;
- position: relative;
- left: auto;
- vertical-align: middle;
- width: 1.25em;
- height: 1.25em;
-}
-
-.edd-loading-ajax.edd-loading {
- opacity: 1;
-}
-
-@keyframes edd-spinning {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
-}
-a.edd-add-to-cart .edd-add-to-cart-label,
-.edd-loading {
- transition: .1s opacity !important;
-}
-.edd-add-to-cart[data-edd-loading] .edd-add-to-cart-label {
- opacity: 0;
- filter: alpha(opacity=0);
-}
-.edd-add-to-cart[data-edd-loading] .edd-loading,
-.edd-discount-loader.edd-loading {
- opacity: 1;
- filter: alpha(opacity=100);
-}
-.edd-cart-added-alert {
- color: #567622;
- display: block;
- position: absolute;
-}
-
-
-/* =Theme Specific styling
--------------------------------------------------------------- */
-
-/* Twenty Twelve */
-.edd_form input.edd-input.required,
-.edd_form select.edd-select.required {
- color: #000;
-}
-
-
-/* =Receipt Page
--------------------------------------------------------------- */
-body.edd_receipt_page {
- background-color: #fff;
- color: #141412;
- margin: 0;
- font-family: Helvetica, sans-serif;
- font-size: 12px;
-}
-body.edd_receipt_page:before {
- position: relative;
-}
-body.edd_receipt_page #edd_receipt_wrapper {
- width: 660px;
- margin: 0 auto;
- padding: 50px 0;
-}
-body.edd_receipt_page table {
- display: table;
- width: 100%;
- border-bottom: 1px solid #ededed;
- border-collapse: collapse;
- border-spacing: 0;
- font-size: 14px;
- line-height: 2;
- margin: 0 0 20px;
-}
-body.edd_receipt_page td,
-body.edd_receipt_page th {
- display: table-cell;
- text-align: left;
- border-top: 1px solid #ededed;
- padding: 6px 10px;
- font-weight: normal;
-}
-body.edd_receipt_page th {
- font-weight: bold;
- text-transform: uppercase;
-}
-body.edd_receipt_page h3 {
- font-size: 22px;
- margin: 40px 0 5px;
- clear: both;
- display: block;
- font-weight: bold;
-}
-body.edd_receipt_page li {
- list-style: none;
-}
-
-
-/* =Purchase Summary Tables
--------------------------------------------------------------- */
-table#edd_purchase_receipt_products,
-table#edd_purchase_receipt {
- width: 100%;
-}
-table#edd_purchase_receipt_products td,
-table#edd_purchase_receipt_products th,
-table#edd_purchase_receipt td,
-table#edd_purchase_receipt th {
- text-align: left;
-}
-table#edd_purchase_receipt .edd_receipt_payment_status.pending,
-table#edd_purchase_receipt .edd_receipt_payment_status.cancelled,
-table#edd_purchase_receipt .edd_receipt_payment_status.revoked,
-table#edd_purchase_receipt .edd_receipt_payment_status.failed {
- color: #f73f2e;
-}
-table#edd_purchase_receipt_products li {
- list-style: none;
- margin: 0 0 8px 10px;
-}
-table#edd_purchase_receipt ul,
-table#edd_purchase_receipt_products ul.edd_purchase_receipt_files {
- margin: 0;
- padding: 0;
-}
-table#edd_purchase_receipt li.edd_download_file {
- list-style: none;
- margin: 0 0 8px 0;
-}
-table#edd_purchase_receipt_products .edd_purchase_receipt_product_notes {
- font-style: italic;
-}
-table#edd_purchase_receipt_products .edd_purchase_receipt_product_name {
- font-weight: bold;
-}
-table#edd_purchase_receipt_products .edd_bundled_product_name {
- font-style: italic;
- font-weight: bold;
-}
-
-
-/* =Purchase History
--------------------------------------------------------------- */
-#edd_user_history {
- text-align: left;
- width: 100%;
- border-top: 1px solid #f0f0f0;
- border-bottom: none;
-}
-#edd_user_history th,
-#edd_user_history td {
- text-align: left;
- padding: 3px 5px;
- border-bottom: 1px solid #f0f0f0;
- border-top: none;
-}
-#edd_user_history th {
- font-weight: bold;
- background: #f5f5f5;
-}
-#edd_user_history td {
- line-height: 25px;
- vertical-align: middle;
-}
-#edd_user_history .edd_purchase_status.revoked,
-#edd_user_history .edd_purchase_status.failed,
-#edd_user_history .edd_purchase_status.cancelled,
-#edd_user_history .edd_purchase_status.pending {
- color: #f73f2e;
-}
-
-
-/* =Registration / login Form
--------------------------------------------------------------- */
-#edd_register_form legend,
-#edd_login_form legend {
- font-size: 120%;
- margin-bottom: 1em;
-}
-
-#edd_register_form fieldset,
-#edd_login_form fieldset {
- border: none;
-}
-
-#edd_register_form .edd-input,
-#edd_login_form .edd-input {
- box-sizing: border-box;
-}
-
-#edd_register_form label,
-#edd_login_form label {
- cursor: pointer;
-}
-
-/* =Profile Form
--------------------------------------------------------------- */
-#edd_profile_editor_form p {
- margin-bottom: 8px;
-}
-#edd_profile_editor_form label {
- display: inline-block;
-}
-#edd_profile_editor_form .edd-profile-emails {
- list-style-type: none;
- display: inline-table;
- margin-left: 0;
- margin-bottom: 0;
-}
-#edd_profile_editor_form .edd-profile-email {
- width: auto;
-}
-#edd_profile_editor_form .edd-profile-email .actions {
- display: none;
-}
-#edd_profile_editor_form .edd-profile-email:hover > span {
- display: inline-block;
-}
-
-
-
-/* =Alerts
--------------------------------------------------------------- */
-.edd_added_to_cart_alert {
- padding: 5px;
- font-size: 14px;
- border: 1px solid #046a9e;
- background: #9ecce2;
- color: #333;
- margin: 8px 0;
-}
-.edd_added_to_cart_alert a.edd_alert_checkout_link {
- color: #000 !important;
-}
-
-
-/* =Purchase buttons
--------------------------------------------------------------- */
-input.edd_submit_plain {
- background: none !important;
- border: none !important;
- padding: 0 !important;
- display: inline;
- cursor: pointer;
-}
-.single-download .edd_download_purchase_form {
- margin-bottom: 1.387em;
-}
-.edd_download_purchase_form .edd_download_quantity_wrapper {
- margin: 0 0 0.5em;
-}
-.edd_download_purchase_form .edd_download_quantity_wrapper .edd-item-quantity {
- width: 75px;
-}
-.edd_download_purchase_form .edd_price_options {
- margin: 0 0 15px;
-}
-.edd_download_purchase_form .edd_price_options ul {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.edd_download_purchase_form .edd_price_options li {
- display: block;
- padding: 0;
- margin: 0;
-}
-.edd_download_purchase_form .edd_price_options span {
- display: inline;
- padding: 0;
- margin: 0;
-}
-.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper {
- padding-left: 18px
-}
-.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper * {
- font-size: 80%
-}
-.edd_download_purchase_form .edd_price_options input.edd-item-quantity {
- display: inline;
- width: 50px;
- max-width: 90%;
-}
-.edd-submit,
-#edd-purchase-button,
-[type="submit"].edd-submit {
- display: inline-block;
- padding: 6px 12px;
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 1.428571429;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- cursor: pointer;
- border: 1px solid #cccccc;
- border-radius: 4px;
- box-shadow: none;
- user-select: none;
-}
-.edd-submit.button:focus,
-[type="submit"].edd-submit:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-.edd-submit.button:active {
- background-image: none;
- outline: 0;
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-}
-.edd-submit.plain {
- padding: 0;
- border: none;
- border-radius: 0;
-}
-
-/** Gray (Default) */
-.edd-submit.button,
-.edd-submit.button,
-.edd-submit.button:visited,
-.edd-submit.button,
-.edd-submit.button.gray {
- color: #333333;
- background: #f0f0f0;
- border-color: #cccccc;
-}
-.edd-submit.button:hover,
-.edd-submit.button:focus,
-.edd-submit.button:active,
-.edd-submit.button.gray:hover,
-.edd-submit.button.gray:focus,
-.edd-submit.button.gray:active {
- color: #333333;
- background: #ebebeb;
- border-color: #adadad;
-}
-.edd-submit.button.gray:active {
- background-image: none;
-}
-
-/** White */
-.edd-submit.button.white {
- color: #333333;
- background: #ffffff;
- border-color: #cccccc;
-}
-.edd-submit.button.white:hover,
-.edd-submit.button.white:focus,
-.edd-submit.button.white:active {
- color: #333333;
- background: #ebebeb;
- border-color: #adadad;
-}
-.edd-submit.button.white:active {
- background-image: none;
-}
-
-/** Blue */
-.edd-submit.button.blue {
- color: #ffffff;
- background: #428bca;
- border-color: #357ebd;
-}
-.edd-submit.button.blue:hover,
-.edd-submit.button.blue:focus,
-.edd-submit.button.blue.active {
- color: #ffffff;
- background: #3276b1;
- border-color: #285e8e;
-}
-.edd-submit.button.blue.active {
- background-image: none;
-}
-
-/** Red */
-.edd-submit.button.red {
- color: #ffffff;
- background: #d9534f;
- border-color: #d43f3a;
-}
-.edd-submit.button.red:hover,
-.edd-submit.button.red:focus,
-.edd-submit.button.red:active {
- color: #ffffff;
- background: #d2322d;
- border-color: #ac2925;
-}
-.edd-submit.button.red:active {
- background-image: none;
-}
-
-/** Green */
-.edd-submit.button.green {
- color: #ffffff;
- background: #5cb85c;
- border-color: #4cae4c;
-}
-.edd-submit.button.green:hover,
-.edd-submit.button.green:focus,
-.edd-submit.button.green:active {
- color: #ffffff;
- background: #47a447;
- border-color: #398439;
-}
-.edd-submit.button.green:active {
- background-image: none;
-}
-
-/** Yellow */
-.edd-submit.button.yellow {
- color: #ffffff;
- background: #f0ad4e;
- border-color: #eea236;
-}
-.edd-submit.button.yellow:hover,
-.edd-submit.button.yellow:focus,
-.edd-submit.button.yellow:active {
- color: #ffffff;
- background: #ed9c28;
- border-color: #d58512;
-}
-.edd-submit.button.yellow:active {
- background-image: none;
-}
-
-/** Orange */
-.edd-submit.button.orange {
- color: #ffffff;
- background: #ed9c28;
- border-color: #e3921e;
-}
-.edd-submit.button.orange:hover,
-.edd-submit.button.orange:focus,
-.edd-submit.button.orange:active {
- color: #ffffff;
- background: #e59016;
- border-color: #d58512;
-}
-.edd-submit.button.orange:active {
- background-image: none;
-}
-
-/** Dark Gray */
-.edd-submit.button.dark-gray {
- color: #fff;
- background: #363636;
- border-color: #222;
-}
-.edd-submit.button.dark-gray:hover,
-.edd-submit.button.dark-gray:focus,
-.edd-submit.button.dark-gray:active {
- color: #fff;
- background: #333;
- border-color: #adadad;
-}
-.edd-submit.button.dark-gray:active {
- background-image: none;
-}
-
-
-/* =Downloads Shortcode
--------------------------------------------------------------- */
-.edd_downloads_list {
- display: grid;
- grid-column-gap: 20px;
- grid-row-gap: 40px;
-}
-.edd_downloads_list:after {
- content: "";
- display: table;
- clear: both;
-}
-.edd_download {
- float: left;
-}
-.edd_download_columns_1 .edd_download { width: 100%; }
-.edd_download_columns_2 .edd_download { width: 50%; }
-.edd_download_columns_0 .edd_download,
-.edd_download_columns_3 .edd_download { width: 33%; }
-.edd_download_columns_4 .edd_download { width: 25%; }
-.edd_download_columns_5 .edd_download { width: 20%; }
-.edd_download_columns_6 .edd_download { width: 16.6%; }
-.edd_download_inner {
- padding: 0 8px 8px;
- margin: 0 0 10px;
-}
-.edd_download_columns_2 .edd_download:nth-child(2n+1),
-.edd_download_columns_3 .edd_download:nth-child(3n+1),
-.edd_download_columns_4 .edd_download:nth-child(4n+1),
-.edd_download_columns_5 .edd_download:nth-child(5n+1),
-.edd_download_columns_6 .edd_download:nth-child(6n+1) {
- clear: left;
-}
-.edd_download_image {
- max-width: 100%;
-}
-.edd_download .edd_price {
- margin-bottom: 10px;
-}
-@media (min-width: 768px) {
- .edd_downloads_list:not(.edd_download_columns_1) {
- grid-template-columns: repeat(2, 1fr);
- }
-}
-@media (min-width: 1200px) {
- .edd_downloads_list.edd_download_columns_2 { grid-template-columns: repeat(2, 1fr); }
- .edd_downloads_list.edd_download_columns_3 { grid-template-columns: repeat(3, 1fr); }
- .edd_downloads_list.edd_download_columns_4 { grid-template-columns: repeat(4, 1fr); }
- .edd_downloads_list.edd_download_columns_5 { grid-template-columns: repeat(5, 1fr); }
- .edd_downloads_list.edd_download_columns_6 { grid-template-columns: repeat(6, 1fr); }
-}
-@supports (display: grid) {
- .edd_downloads_list .edd_download {
- width: auto;
- }
- .edd_download_inner {
- padding: 0;
- margin: 0;
- }
-}
-
-/* =Misc styles
--------------------------------------------------------------- */
-.edd-hide-on-empty.cart-empty {
- display: none;
-}
-.edd-cart-ajax {
- margin: 0 8px 0 4px;
- position: relative;
- top: 2px;
- background: none;
- border: none;
- padding: 0;
-}
-.edd-cart-number-of-items {
- font-style: italic;
- color: grey;
-}
-.edd-cart-meta.edd_subtotal {
- font-weight: bold;
- font-style: italic;
-}
-.edd-cart-meta.edd_cart_tax {
- font-size: 1em;
- font-style: italic;
-}
-
-/** Since this is a LI, make sure to not italicize any list item images */
-.edd-cart-meta.edd_cart_tax::before {
- font-style: normal;
-}
-
-.edd-cart-meta.edd_total {
- font-weight: bold;
-}
-.edd-cart-meta {
- padding: 2px 5px;
-}
-.edd-cart-meta.edd_subtotal,
-.edd-cart-meta.edd_total {
- background-color: #f9f9f9;
-}
-
-
-/** Old Error Styles */
-/* =Error styles
--------------------------------------------------------------- */
-.edd_errors:not(.edd-alert) {
- border-radius: 2px;
- border: 1px solid #E6DB55;
- margin: 0 0 21px;
- background: #FFFFE0;
- color: #333;
-}
-.edd_error {
- padding: 10px;
-}
-p.edd_error {
- margin: 0 !important;
-}
-
-
-/* =Success Message styles
--------------------------------------------------------------- */
-.edd_success:not(.edd-alert) {
- border-radius: 2px;
- border: 1px solid #b3ce89;
- margin: 20px 0;
- background: #d5eab3;
- color: #567622;
- padding: 6px 8px;
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
-}
-
-/** End old Error */
-
-/** Usage Is as Follows */
-/*
This is your error message
*/
-/* Replace edd-error with the class of your choice */
-
-/* Alert Styles */
-.edd-alert {
- border-radius: 2px;
- margin-bottom: 20px;
- padding: 10px;
- border: 1px solid transparent;
- vertical-align: middle;
-}
-.edd-alert p {
- padding: 0;
-}
-.edd-alert p:not(:last-child) {
- margin-bottom: 5px;
-}
-.edd-alert p:last-child {
- margin-bottom: 0;
-}
-.edd-alert-error {
- color: #a94442;
- background-color: #f2dede;
- border-color: #ebccd1;
-}
-.edd-alert-success {
- background-color: #dff0d8;
- border-color: #d6e9c6;
- color:#3c763d;
-}
-.edd-alert-info {
- color: #31708f;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-.edd-alert-warn {
- color: #8a6d3b;
- background-color: #fcf8e3;
- border-color: #faebcc;
-}
diff --git a/wp-content/plugins/easy-digital-downloads/templates/history-downloads.php b/wp-content/plugins/easy-digital-downloads/templates/history-downloads.php
index b6fbb98f..d75e1f64 100644
--- a/wp-content/plugins/easy-digital-downloads/templates/history-downloads.php
+++ b/wp-content/plugins/easy-digital-downloads/templates/history-downloads.php
@@ -72,7 +72,7 @@ if ( $orders ) :
foreach ( $download_files as $filekey => $file ) :
- $download_url = edd_get_download_file_url( $order->payment_key, $order->email, $filekey, $item->product_id, $price_id );
+ $download_url = edd_get_download_file_url( $order, $order->email, $filekey, $item->product_id, $price_id );
?>
diff --git a/wp-content/plugins/easy-digital-downloads/templates/shortcode-receipt.php b/wp-content/plugins/easy-digital-downloads/templates/shortcode-receipt.php
index 29d62137..36d7b2b8 100644
--- a/wp-content/plugins/easy-digital-downloads/templates/shortcode-receipt.php
+++ b/wp-content/plugins/easy-digital-downloads/templates/shortcode-receipt.php
@@ -161,7 +161,7 @@ do_action( 'edd_order_receipt_before_table', $order, $edd_receipt_args );
: |
- id ) ); ?> |
+ |
@@ -246,7 +246,7 @@ if ( empty( $order_items ) ) {
foreach ( $download_files as $filekey => $file ) :
?>
-
+
$file ) :
?>
-
+
bootstrap();
+$edd_settings = get_option( 'edd_settings', array() );
+if ( empty( $edd_settings['uninstall_on_delete'] ) ) {
+ return;
+}
global $wpdb, $wp_roles;
-if( edd_get_option( 'uninstall_on_delete' ) ) {
+/** Delete All the Custom Post Types */
+$edd_taxonomies = array( 'download_category', 'download_tag' );
+$edd_post_types = array( 'download' );
+foreach ( $edd_post_types as $post_type ) {
- /** Delete All the Custom Post Types */
- $edd_taxonomies = array( 'download_category', 'download_tag', 'edd_log_type', );
- $edd_post_types = array( 'download', 'edd_payment', 'edd_discount', 'edd_log' );
- foreach ( $edd_post_types as $post_type ) {
-
- $edd_taxonomies = array_merge( $edd_taxonomies, get_object_taxonomies( $post_type ) );
- $items = get_posts( array( 'post_type' => $post_type, 'post_status' => 'any', 'numberposts' => -1, 'fields' => 'ids' ) );
-
- if ( $items ) {
- foreach ( $items as $item ) {
- wp_delete_post( $item, true);
- }
- }
- }
-
- /** Delete All the Terms & Taxonomies */
- foreach ( array_unique( array_filter( $edd_taxonomies ) ) as $taxonomy ) {
-
- $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
-
- // Delete Terms.
- if ( $terms ) {
- foreach ( $terms as $term ) {
- $wpdb->delete( $wpdb->term_relationships, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
- $wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
- $wpdb->delete( $wpdb->terms, array( 'term_id' => $term->term_id ) );
- }
- }
-
- // Delete Taxonomies.
- $wpdb->delete( $wpdb->term_taxonomy, array( 'taxonomy' => $taxonomy ), array( '%s' ) );
- }
-
- /** Delete the Plugin Pages */
- $edd_created_pages = array( 'purchase_page', 'success_page', 'failure_page', 'purchase_history_page' );
- foreach ( $edd_created_pages as $p ) {
- $page = edd_get_option( $p, false );
- if ( $page ) {
- wp_delete_post( $page, true );
- }
- }
-
- /** Delete all the Plugin Options */
- $edd_options = array(
- 'edd_completed_upgrades',
- 'edd_default_api_version',
- 'edd_earnings_total',
- 'edd_earnings_total_without_tax',
- 'edd_settings',
- 'edd_tracking_notice',
- 'edd_tax_rates',
- 'edd_use_php_sessions',
- 'edd_version',
- 'edd_version_upgraded_from',
- 'edd_notification_req_timeout',
-
- // Widgets
- 'widget_edd_product_details',
- 'widget_edd_cart_widget',
- 'widget_edd_categories_tags_widget',
-
- // Deprecated 3.0.0
- 'wp_edd_customers_db_version',
- 'wp_edd_customermeta_db_version',
- '_edd_table_check'
+ $edd_taxonomies = array_merge( $edd_taxonomies, get_object_taxonomies( $post_type ) );
+ $items = get_posts(
+ array(
+ 'post_type' => $post_type,
+ 'post_status' => 'any',
+ 'numberposts' => -1,
+ 'fields' => 'ids',
+ )
);
- foreach ( $edd_options as $option ) {
- delete_option( $option );
- }
- /** Delete Capabilities */
- EDD()->roles->remove_caps();
-
- /** Delete the Roles */
- $edd_roles = array( 'shop_manager', 'shop_accountant', 'shop_worker', 'shop_vendor' );
- foreach ( $edd_roles as $role ) {
- remove_role( $role );
- }
-
- // Remove all database tables
- foreach ( EDD()->components as $component ) {
- /**
- * @var EDD\Database\Table $table
- */
- $table = $component->get_interface( 'table' );
-
- if ( $table instanceof EDD\Database\Table ) {
- $table->uninstall();
- }
-
- // Check to see if this component has a meta table to uninstall.
-
- /**
- * @var EDD\Database\Table $meta_table
- */
- $meta_table = $component->get_interface( 'meta' );
-
- if ( $meta_table instanceof EDD\Database\Table ) {
- $meta_table->uninstall();
+ if ( $items ) {
+ foreach ( $items as $item ) {
+ wp_delete_post( $item, true );
}
}
-
- /** Cleanup Cron Events */
- wp_clear_scheduled_hook( 'edd_daily_scheduled_events' );
- wp_clear_scheduled_hook( 'edd_daily_cron' );
- wp_clear_scheduled_hook( 'edd_weekly_cron' );
-
- // Remove any transients we've left behind
- $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_edd\_%'" );
- $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_site\_transient\_edd\_%'" );
- $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_timeout\_edd\_%'" );
- $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_site\_transient\_timeout\_edd\_%'" );
}
+
+/** Delete All the Terms & Taxonomies */
+foreach ( array_unique( array_filter( $edd_taxonomies ) ) as $taxonomy ) {
+
+ $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
+
+ // Delete Terms.
+ if ( $terms ) {
+ foreach ( $terms as $term ) {
+ $wpdb->delete( $wpdb->term_relationships, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
+ $wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
+ $wpdb->delete( $wpdb->terms, array( 'term_id' => $term->term_id ) );
+ }
+ }
+
+ // Delete Taxonomies.
+ $wpdb->delete( $wpdb->term_taxonomy, array( 'taxonomy' => $taxonomy ), array( '%s' ) );
+}
+
+/** Delete the Plugin Pages */
+$edd_created_pages = array( 'purchase_page', 'success_page', 'failure_page', 'purchase_history_page' );
+foreach ( $edd_created_pages as $p ) {
+ if ( ! empty( $edd_settings[ $p ] ) ) {
+ wp_delete_post( $p, true );
+ }
+}
+
+/** Delete all the Plugin Options */
+$edd_options = array(
+ 'edd_completed_upgrades',
+ 'edd_default_api_version',
+ 'edd_earnings_total',
+ 'edd_earnings_total_without_tax',
+ 'edd_settings',
+ 'edd_tracking_notice',
+ 'edd_tax_rates',
+ 'edd_use_php_sessions',
+ 'edd_version',
+ 'edd_version_upgraded_from',
+ 'edd_notification_req_timeout',
+ 'edd_pass_licenses',
+ 'edd_pass_data',
+ 'edd_tokenizer_signing_key',
+ 'edd_use_php_sessions',
+ 'edd_licensed_extensions',
+ 'edd_activation_date',
+ 'edd_pro_activation_date',
+ 'edd_onboarding_completed',
+ 'edd_onboarding_started',
+ 'edd_onboarding_latest_step',
+
+ // Widgets
+ 'widget_edd_product_details',
+ 'widget_edd_cart_widget',
+ 'widget_edd_categories_tags_widget',
+
+ // Deprecated 3.0.0
+ 'wp_edd_customers_db_version',
+ 'wp_edd_customermeta_db_version',
+ '_edd_table_check',
+);
+foreach ( $edd_options as $option ) {
+ delete_option( $option );
+}
+
+$site_options = array(
+ 'edd_all_extension_data',
+ 'edd_extension_tag_1578_data',
+ 'edd_extension_product_28530_data',
+ 'edd_extension_product_375153_data',
+ 'edd_extension_product_37976_data',
+ 'edd_pro_license',
+ 'edd_pro_license_key',
+);
+foreach ( $site_options as $site_option ) {
+ delete_site_option( $site_option );
+}
+
+// Load EDD file.
+require_once dirname( __FILE__ ) . '/easy-digital-downloads.php';
+
+// Set the EDD instance.
+EDD();
+
+// Register components.
+edd_setup_components();
+
+/** Delete Capabilities */
+EDD()->roles->remove_caps();
+
+/** Delete the Roles */
+$edd_roles = array( 'shop_manager', 'shop_accountant', 'shop_worker', 'shop_vendor' );
+foreach ( $edd_roles as $role ) {
+ remove_role( $role );
+}
+
+// Remove all database tables
+foreach ( EDD()->components as $component ) {
+ /**
+ * @var EDD\Database\Table $table
+ */
+ $table = $component->get_interface( 'table' );
+
+ if ( $table instanceof EDD\Database\Table ) {
+ $table->uninstall();
+ }
+
+ // Check to see if this component has a meta table to uninstall.
+
+ /**
+ * @var EDD\Database\Table $meta_table
+ */
+ $meta_table = $component->get_interface( 'meta' );
+
+ if ( $meta_table instanceof EDD\Database\Table ) {
+ $meta_table->uninstall();
+ }
+}
+
+/** Cleanup Cron Events */
+wp_clear_scheduled_hook( 'edd_daily_scheduled_events' );
+wp_clear_scheduled_hook( 'edd_daily_cron' );
+wp_clear_scheduled_hook( 'edd_weekly_cron' );
+wp_clear_scheduled_hook( 'edd_email_summary_cron' );
+wp_clear_scheduled_hook( 'edd_weekly_scheduled_events' );
+
+// Remove any transients we've left behind
+$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_edd\_%'" );
+$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_site\_transient\_edd\_%'" );
+$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_transient\_timeout\_edd\_%'" );
+$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '\_site\_transient\_timeout\_edd\_%'" );
diff --git a/wp-content/plugins/easy-digital-downloads/vendor/autoload.php b/wp-content/plugins/easy-digital-downloads/vendor/autoload.php
index aa38557e..7f44aef0 100644
--- a/wp-content/plugins/easy-digital-downloads/vendor/autoload.php
+++ b/wp-content/plugins/easy-digital-downloads/vendor/autoload.php
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit0ed51d806e7376d5e18f6b1459e77951::getLoader();
+return ComposerAutoloaderInita20eaf829aab141060a311bcab1d59b6::getLoader();
diff --git a/wp-content/plugins/easy-digital-downloads/vendor/composer/ClassLoader.php b/wp-content/plugins/easy-digital-downloads/vendor/composer/ClassLoader.php
index afef3fa2..fd56bd7d 100644
--- a/wp-content/plugins/easy-digital-downloads/vendor/composer/ClassLoader.php
+++ b/wp-content/plugins/easy-digital-downloads/vendor/composer/ClassLoader.php
@@ -42,6 +42,9 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
/** @var ?string */
private $vendorDir;
@@ -106,6 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
}
/**
@@ -425,7 +429,7 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
- includeFile($file);
+ (self::$includeFile)($file);
return true;
}
@@ -555,18 +559,23 @@ class ClassLoader
return false;
}
-}
-/**
- * Scope isolated include.
- *
- * Prevents access to $this/self from included files.
- *
- * @param string $file
- * @return void
- * @private
- */
-function includeFile($file)
-{
- include $file;
+ private static function initializeIncludeClosure(): void
+ {
+ if (self::$includeFile !== null) {
+ return;
+ }
+
+ /**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ */
+ self::$includeFile = static function($file) {
+ include $file;
+ };
+ }
}
diff --git a/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_real.php b/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_real.php
index 696999be..3852e707 100644
--- a/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_real.php
+++ b/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit0ed51d806e7376d5e18f6b1459e77951
+class ComposerAutoloaderInita20eaf829aab141060a311bcab1d59b6
{
private static $loader;
@@ -22,12 +22,12 @@ class ComposerAutoloaderInit0ed51d806e7376d5e18f6b1459e77951
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit0ed51d806e7376d5e18f6b1459e77951', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInita20eaf829aab141060a311bcab1d59b6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
- spl_autoload_unregister(array('ComposerAutoloaderInit0ed51d806e7376d5e18f6b1459e77951', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInita20eaf829aab141060a311bcab1d59b6', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit0ed51d806e7376d5e18f6b1459e77951::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInita20eaf829aab141060a311bcab1d59b6::getInitializer($loader));
$loader->register(true);
diff --git a/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_static.php b/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_static.php
index 1defcd69..122bc7bc 100644
--- a/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_static.php
+++ b/wp-content/plugins/easy-digital-downloads/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
-class ComposerStaticInit0ed51d806e7376d5e18f6b1459e77951
+class ComposerStaticInita20eaf829aab141060a311bcab1d59b6
{
public static $prefixLengthsPsr4 = array (
'E' =>
@@ -27,9 +27,9 @@ class ComposerStaticInit0ed51d806e7376d5e18f6b1459e77951
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit0ed51d806e7376d5e18f6b1459e77951::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit0ed51d806e7376d5e18f6b1459e77951::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInit0ed51d806e7376d5e18f6b1459e77951::$classMap;
+ $loader->prefixLengthsPsr4 = ComposerStaticInita20eaf829aab141060a311bcab1d59b6::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInita20eaf829aab141060a311bcab1d59b6::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInita20eaf829aab141060a311bcab1d59b6::$classMap;
}, null, ClassLoader::class);
}
diff --git a/wp-content/plugins/easy-digital-downloads/vendor/composer/installed.php b/wp-content/plugins/easy-digital-downloads/vendor/composer/installed.php
index 35b591b2..b7ae2086 100644
--- a/wp-content/plugins/easy-digital-downloads/vendor/composer/installed.php
+++ b/wp-content/plugins/easy-digital-downloads/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'easydigitaldownloads/easy-digital-downloads',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => '26efb5d43e732283d7043db0d47c586c2b7ea796',
+ 'reference' => '6900e8959df5a7b66fb1c4c033324d2f92f4b97e',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'easydigitaldownloads/easy-digital-downloads' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => '26efb5d43e732283d7043db0d47c586c2b7ea796',
+ 'reference' => '6900e8959df5a7b66fb1c4c033324d2f92f4b97e',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),