forked from LiveCarta/LiveCartaWP
Changed source root directory
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
if (! class_exists ( 'PostmanAdminPointer' )) {
|
||||
|
||||
/**
|
||||
* From http://code.tutsplus.com/articles/integrating-with-wordpress-ui-admin-pointers--wp-26853
|
||||
*
|
||||
* @author jasonhendriks
|
||||
*
|
||||
*/
|
||||
class PostmanAdminPointer {
|
||||
private $logger;
|
||||
private $rootPluginFilenameAndPath;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mixed $rootPluginFilenameAndPath
|
||||
*/
|
||||
function __construct($rootPluginFilenameAndPath) {
|
||||
$this->logger = new PostmanLogger ( get_class ( $this ) );
|
||||
$this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath;
|
||||
|
||||
// Don't run on WP < 3.3
|
||||
if (get_bloginfo ( 'version' ) < '3.3' || true)
|
||||
return;
|
||||
|
||||
add_action ( 'admin_enqueue_scripts', array (
|
||||
$this,
|
||||
'wptuts_pointer_load'
|
||||
), 1000 );
|
||||
add_filter ( 'postman_admin_pointers-settings_page_postman', array (
|
||||
$this,
|
||||
'wptuts_register_pointer_testing'
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mixed $hook_suffix
|
||||
*/
|
||||
function wptuts_pointer_load($hook_suffix) {
|
||||
// only do this for administrators
|
||||
if (PostmanUtils::isAdmin ()) {
|
||||
$this->logger->trace ( 'wptuts' );
|
||||
|
||||
$screen = get_current_screen ();
|
||||
$screen_id = $screen->id;
|
||||
|
||||
// Get pointers for this screen
|
||||
$pointers = apply_filters ( 'postman_admin_pointers-' . $screen_id, array () );
|
||||
|
||||
if (! $pointers || ! is_array ( $pointers ))
|
||||
return;
|
||||
|
||||
// Get dismissed pointers
|
||||
$dismissed = explode ( ',', ( string ) get_user_meta ( get_current_user_id (), 'dismissed_wp_pointers', true ) );
|
||||
$this->logger->trace ( $dismissed );
|
||||
$valid_pointers = array ();
|
||||
|
||||
// Check pointers and remove dismissed ones.
|
||||
foreach ( $pointers as $pointer_id => $pointer ) {
|
||||
|
||||
// Sanity check
|
||||
if (in_array ( $pointer_id, $dismissed ) || empty ( $pointer ) || empty ( $pointer_id ) || empty ( $pointer ['target'] ) || empty ( $pointer ['options'] ))
|
||||
continue;
|
||||
|
||||
$pointer ['pointer_id'] = $pointer_id;
|
||||
|
||||
// Add the pointer to $valid_pointers array
|
||||
$valid_pointers ['pointers'] [] = $pointer;
|
||||
}
|
||||
|
||||
// No valid pointers? Stop here.
|
||||
if (empty ( $valid_pointers )) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add pointers style to queue.
|
||||
wp_enqueue_style ( 'wp-pointer' );
|
||||
|
||||
// Add pointers script to queue. Add custom script.
|
||||
/**
|
||||
* @todo Check if this work
|
||||
*/
|
||||
/*
|
||||
wp_enqueue_script ( 'postman_admin_pointer', plugins_url ( 'script/postman-admin-pointer.js', $this->rootPluginFilenameAndPath ), array (
|
||||
'wp-pointer'
|
||||
) );
|
||||
|
||||
// Add pointer options to script.
|
||||
wp_localize_script ( 'postman_admin_pointer', 'postman_admin_pointer', $valid_pointers );
|
||||
*/
|
||||
$this->logger->trace ( 'out wptuts' );
|
||||
}
|
||||
}
|
||||
function wptuts_register_pointer_testing($p) {
|
||||
// only do this for administrators
|
||||
if (PostmanUtils::isAdmin () && false) {
|
||||
$p ['postman16_log'] = array (
|
||||
'target' => '.configure_manually',
|
||||
'options' => array (
|
||||
'content' => '',
|
||||
'position' => array (
|
||||
'edge' => 'top',
|
||||
'align' => 'left'
|
||||
)
|
||||
)
|
||||
);
|
||||
return $p;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,623 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
if (! class_exists ( "PostmanDashboardWidgetController" )) {
|
||||
|
||||
//
|
||||
class PostmanDashboardWidgetController {
|
||||
private $rootPluginFilenameAndPath;
|
||||
private $options;
|
||||
private $authorizationToken;
|
||||
private $wpMailBinder;
|
||||
|
||||
/**
|
||||
* Start up
|
||||
*/
|
||||
public function __construct($rootPluginFilenameAndPath, PostmanOptions $options, PostmanOAuthToken $authorizationToken, PostmanWpMailBinder $binder) {
|
||||
assert ( ! empty ( $rootPluginFilenameAndPath ) );
|
||||
assert ( ! empty ( $options ) );
|
||||
assert ( ! empty ( $authorizationToken ) );
|
||||
assert ( ! empty ( $binder ) );
|
||||
$this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath;
|
||||
$this->options = $options;
|
||||
$this->authorizationToken = $authorizationToken;
|
||||
$this->wpMailBinder = $binder;
|
||||
|
||||
add_action( 'wp_ajax_post_smtp_dash_widget_lite_save_widget_meta', array( $this, 'post_smtp_save_widget_meta_ajax' ) );
|
||||
|
||||
add_action ( 'admin_enqueue_scripts', array (
|
||||
$this,
|
||||
'dasboardWidgetsScripts'
|
||||
) );
|
||||
|
||||
add_action ( 'wp_dashboard_setup', array (
|
||||
$this,
|
||||
'addDashboardWidget'
|
||||
) );
|
||||
|
||||
add_action ( 'wp_network_dashboard_setup', array (
|
||||
$this,
|
||||
'addNetworkDashboardWidget'
|
||||
) );
|
||||
|
||||
// dashboard glance mod
|
||||
if ($this->options->isMailLoggingEnabled ()) {
|
||||
add_filter ( 'dashboard_glance_items', array (
|
||||
$this,
|
||||
'customizeAtAGlanceDashboardWidget'
|
||||
), 10, 1 );
|
||||
}
|
||||
|
||||
// Postman API: register the human-readable plugin state
|
||||
add_filter ( 'print_postman_status', array (
|
||||
$this,
|
||||
'print_postman_status'
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a widget meta for a current user using AJAX.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public function post_smtp_save_widget_meta_ajax() {
|
||||
|
||||
check_admin_referer( 'post_smtp_dash_widget_lite_nonce' );
|
||||
|
||||
// if ( ! current_user_can( post_smtp()->get_capability_manage_options() ) ) {
|
||||
// wp_send_json_error();
|
||||
// }
|
||||
|
||||
$meta = ! empty( $_POST['meta'] ) ? sanitize_key( $_POST['meta'] ) : '';
|
||||
$value = ! empty( $_POST['value'] ) ? sanitize_key( $_POST['value'] ) : 0;
|
||||
|
||||
$this->post_smtp_widget_meta( 'set', $meta, $value );
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get/set a widget meta.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*
|
||||
* @param string $action Possible value: 'get' or 'set'.
|
||||
* @param string $meta Meta name.
|
||||
* @param int $value Value to set.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function post_smtp_widget_meta( $action, $meta, $value = 0 ) {
|
||||
|
||||
$allowed_actions = [ 'get', 'set' ];
|
||||
|
||||
if ( ! in_array( $action, $allowed_actions, true ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $action === 'get' ) {
|
||||
return $this->post_smtp_get_widget_meta( $meta );
|
||||
}
|
||||
|
||||
$meta_key = $this->post_smtp_get_widget_meta_key( $meta );
|
||||
$value = sanitize_key( $value );
|
||||
|
||||
if ( 'set' === $action && ! empty( $value ) ) {
|
||||
return update_user_meta( get_current_user_id(), $meta_key, $value );
|
||||
}
|
||||
|
||||
if ( 'set' === $action && empty( $value ) ) {
|
||||
return delete_user_meta( get_current_user_id(), $meta_key );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the widget meta value.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*
|
||||
* @param string $meta Meta name.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function post_smtp_get_widget_meta( $meta ) {
|
||||
|
||||
$defaults = [
|
||||
'hide_graph' => 0,
|
||||
'hide_summary_report_email_block' => 0,
|
||||
'hide_email_alerts_banner' => 0,
|
||||
];
|
||||
|
||||
$meta_value = get_user_meta( get_current_user_id(), $this->post_smtp_get_widget_meta_key( $meta ), true );
|
||||
|
||||
if ( ! empty( $meta_value ) ) {
|
||||
return $meta_value;
|
||||
}
|
||||
|
||||
if ( isset( $defaults[ $meta ] ) ) {
|
||||
return $defaults[ $meta ];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the meta key.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*
|
||||
* @param string $meta Meta name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function post_smtp_get_widget_meta_key( $meta ) {
|
||||
|
||||
return 'post_smtp_dash_widget_' . $meta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a widget to the dashboard.
|
||||
*
|
||||
* This function is hooked into the 'wp_dashboard_setup' action below.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public function dasboardWidgetsScripts( $hook ) {
|
||||
if ( 'index.php' === $hook ) {
|
||||
// Enqueue Chart.js (with the built-in Luxon adapter).
|
||||
wp_enqueue_script( 'chart-js', POST_SMTP_URL . '/Postman/Postman-Controller/assets/js/chart.min.js', array(), '', true );
|
||||
|
||||
// Enqueue Moment.js Adapter (chartjs-adapter-moment).
|
||||
wp_enqueue_script( 'moment-js', POST_SMTP_URL . '/Postman/Postman-Controller/assets/js/moment.min.js', array( 'chart-js' ), '1.0.0', true );
|
||||
// Enqueue your custom script that depends on both Chart.js and Luxon.
|
||||
wp_enqueue_script( 'post-smtp-wp-dashboard-widget', POST_SMTP_URL . '/Postman/Postman-Controller/assets/js/post-smtp-wp-dashboard.js', array( 'jquery', 'chart-js', 'moment-js' ), POST_SMTP_VER, true );
|
||||
wp_localize_script(
|
||||
'post-smtp-wp-dashboard-widget',
|
||||
'post_smtp_dashboard_widget',
|
||||
array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'slug' => 'dash_widget_lite',
|
||||
'nonce' => wp_create_nonce( 'post_smtp_dash_widget_lite_nonce' ),
|
||||
)
|
||||
);
|
||||
wp_enqueue_script( 'post-smtp-wp-dashboard-widget' );
|
||||
wp_enqueue_style( 'post-smtp-wp-dashboard-widget-style', POST_SMTP_URL . '/Postman/Postman-Controller/assets/css/post-smtp-wp-dashboard-style.css', array(), POST_SMTP_VER, 'all' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a widget to the dashboard.
|
||||
*
|
||||
* This function is hooked into the 'wp_dashboard_setup' action below.
|
||||
*/
|
||||
public function addDashboardWidget() {
|
||||
// only display to the widget to administrator
|
||||
if (PostmanUtils::isAdmin ()) {
|
||||
wp_add_dashboard_widget ( 'example_dashboard_widget', __ ( 'Postman SMTP', 'post-smtp' ), array (
|
||||
$this,
|
||||
'printDashboardWidget'
|
||||
) ); // Display function.
|
||||
|
||||
if ( ! post_smtp_has_pro() ) {
|
||||
$widget_key = 'post_smtp_reports_widget_lite';
|
||||
} else {
|
||||
$widget_key = 'post_smtp_reports_widget';
|
||||
}
|
||||
wp_add_dashboard_widget ( $widget_key, __ ( 'Postman SMTP Stats', 'post-smtp' ), array (
|
||||
$this,
|
||||
'printStatsDashboardWidget'
|
||||
),
|
||||
'high'
|
||||
); // Display function.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a widget to the network dashboard
|
||||
*/
|
||||
public function addNetworkDashboardWidget() {
|
||||
// only display to the widget to administrator
|
||||
if (PostmanUtils::isAdmin ()) {
|
||||
wp_add_dashboard_widget ( 'example_dashboard_widget', __ ( 'Postman SMTP', 'post-smtp' ), array (
|
||||
$this,
|
||||
'printNetworkDashboardWidget'
|
||||
) ); // Display function.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the function to output the contents of our Dashboard Widget.
|
||||
*/
|
||||
public function printDashboardWidget() {
|
||||
$goToSettings = sprintf ( '<a href="%s">%s</a>', PostmanUtils::getSettingsPageUrl (), __ ( 'Settings', 'post-smtp' ) );
|
||||
$goToEmailLog = sprintf ( '%s', _x ( 'Email Log', 'The log of Emails that have been delivered', 'post-smtp' ) );
|
||||
if ($this->options->isMailLoggingEnabled ()) {
|
||||
$goToEmailLog = sprintf ( '<a href="%s">%s</a>', PostmanUtils::getEmailLogPageUrl (), $goToEmailLog );
|
||||
}
|
||||
apply_filters ( 'print_postman_status', null );
|
||||
printf ( '<p>%s | %s</p>', $goToEmailLog, $goToSettings );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the function to output the contents of our Dashboard Widget.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public function printStatsDashboardWidget() {
|
||||
?>
|
||||
<div class="post-smtp-dash-widget post-smtp-dash-widget--lite">
|
||||
<div class="post-smtp-dash-widget-chart-block-container">
|
||||
<div class="post-smtp-dash-widget-block post-smtp-dash-widget-chart-block">
|
||||
<canvas id="post-smtp-dash-widget-chart" width="554" height="291"></canvas>
|
||||
<?php if ( ! post_smtp_has_pro() ) { ?>
|
||||
<div class="post-smtp-dash-widget-chart-upgrade">
|
||||
<div class="post-smtp-dash-widget-modal">
|
||||
<a href="#" class="post-smtp-dash-widget-dismiss-chart-upgrade">
|
||||
<span class="dashicons dashicons-no-alt"></span>
|
||||
</a>
|
||||
<h2><?php esc_html_e( 'To get Graphs Insights', 'post-smtp' ); ?></h2>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( 'https://postmansmtp.com/pricing/?utm_source=plugin&utm_medium=wp_dashboard_widget' ); // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ?>" target="_blank" rel="noopener noreferrer" class="button button-primary post_smtp_pro_btn button-hero">
|
||||
<?php esc_html_e( 'Upgrade to Post SMTP Pro ', 'post-smtp' ); ?><span class="dashicons dashicons-arrow-right-alt"></span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else if ( ! class_exists( 'Post_SMTP_Report_And_Tracking' ) ) { ?>
|
||||
<div class="post-smtp-dash-widget-chart-upgrade">
|
||||
<div class="post-smtp-dash-widget-modal">
|
||||
<?php $extension_page_url = '<a href="'.PostmanUtils::getPageUrl ( 'post-smtp-pro' ).'" target="_blank" rel="noopener noreferrer">Reporting and Tracking</a>' ?>
|
||||
<p>
|
||||
<?php printf(
|
||||
/* translators: %s is the link text */
|
||||
esc_html__( 'Activate %s Extension to get Graphs Insights', 'post-smtp' ),
|
||||
$extension_page_url
|
||||
); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="post-smtp-dash-widget-overlay"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-smtp-dash-widget-block post-smtp-dash-widget-block-settings">
|
||||
<div>
|
||||
<?php $this->emailTypesSelectHtml(); ?>
|
||||
<?php $this->viewFullEmailLogs(); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
$this->TimespanSelectHtml();
|
||||
$this->widgetSettingsHtml();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="post-smtp-dash-widget-email-stats-block" class="post-smtp-dash-widget-block post-smtp-dash-widget-email-stats-block">
|
||||
<?php $this->emailStatsBlock(); ?>
|
||||
</div>
|
||||
<div id="post-smtp-dash-widget-upgrade-footer" class="post-smtp-dash-widget-block post-smtp-dash-widget-upgrade-footer post-smtp-dash-widget-upgrade-footer--">
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses( /* translators: %s - URL to WPMailSMTP.com. */
|
||||
__( 'Now Post SMTP is available on your mobile device. <a href="%s" target="_blank" rel="noopener noreferrer">Download now</a>', 'post-smtp' ),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'rel' => [],
|
||||
'target' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
// phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
esc_url( "https://postmansmtp.com/post-smtp-mobile-app/" )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Email types select HTML.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
private function emailTypesSelectHtml() {
|
||||
|
||||
$options = array(
|
||||
'sent_emails' => esc_html__( 'Sent Emails', 'post-smtp' ),
|
||||
'failed_emails' => esc_html__( 'Failed Emails', 'post-smtp' ),
|
||||
);
|
||||
if ( ! post_smtp_has_pro() ) {
|
||||
$disabled = 'disabled';
|
||||
} else {
|
||||
$disabled = '';
|
||||
}
|
||||
?>
|
||||
<select id="post-smtp-dash-widget-email-type" class="post-smtp-dash-widget-select-email-type" title="<?php esc_attr_e( 'Select email type', 'post-smtp' ); ?>">
|
||||
<option value="all_emails">
|
||||
<?php esc_html_e( 'All Emails', 'post-smtp' ); ?>
|
||||
</option>
|
||||
<?php foreach ( $options as $key => $title ) : ?>
|
||||
<option value="<?php echo sanitize_key( $key ); ?>" <?php echo $disabled; ?>>
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Email types select HTML.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
private function viewFullEmailLogs() {
|
||||
$goToEmailLog = sprintf ( '%s', _x ( 'View Full Log', 'The log of Emails that have been delivered', 'post-smtp' ) );
|
||||
if ($this->options->isMailLoggingEnabled ()) {
|
||||
$goToEmailLog = sprintf ( '<a href="%s">%s</a>', PostmanUtils::getEmailLogPageUrl (), $goToEmailLog );
|
||||
}
|
||||
printf ( '<p>%s</p>', $goToEmailLog );
|
||||
}
|
||||
|
||||
/**
|
||||
* Timespan select HTML.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
private function TimespanSelectHtml() {
|
||||
// Check if Post SMTP Pro is available, disable options if not
|
||||
$disabled = post_smtp_has_pro() ? '' : 'disabled';
|
||||
?>
|
||||
<select id="post-smtp-dash-widget-timespan" class="post-smtp-dash-widget-select-timespan" title="<?php esc_attr_e( 'Select timespan', 'post-smtp' ); ?>">
|
||||
<?php
|
||||
if ( ! post_smtp_has_pro() ) { ?>
|
||||
<option value=""><?php esc_html_e( 'Select a timespan', 'post-smtp' ); ?></option>
|
||||
<?php }
|
||||
foreach ( [ 7, 14, 30 ] as $option ) : ?>
|
||||
<option value="<?php echo absint( $option ); ?>" <?php echo $disabled; ?>>
|
||||
<?php /* translators: %d - Number of days. */ ?>
|
||||
<?php echo esc_html( sprintf( _n( 'Last %d day', 'Last %d days', absint( $option ), 'post-smtp' ), absint( $option ) ) ); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget settings HTML.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
private function widgetSettingsHtml() {
|
||||
|
||||
$chart_style = $this->post_smtp_get_widget_meta( 'chart_style' );
|
||||
|
||||
if ( ! post_smtp_has_pro() ) {
|
||||
$disabled = 'disabled';
|
||||
} else {
|
||||
$disabled = '';
|
||||
}
|
||||
?>
|
||||
<div class="post-smtp-dash-widget-settings-container">
|
||||
<button id="post-smtp-dash-widget-settings-button" class="post-smtp-dash-widget-settings-button button" type="button">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19 19">
|
||||
<path d="M18,11l-2.18,0c-0.17,0.7 -0.44,1.35 -0.81,1.93l1.54,1.54l-2.1,2.1l-1.54,-1.54c-0.58,0.36 -1.23,0.63 -1.91,0.79l0,2.18l-3,0l0,-2.18c-0.68,-0.16 -1.33,-0.43 -1.91,-0.79l-1.54,1.54l-2.12,-2.12l1.54,-1.54c-0.36,-0.58 -0.63,-1.23 -0.79,-1.91l-2.18,0l0,-2.97l2.17,0c0.16,-0.7 0.44,-1.35 0.8,-1.94l-1.54,-1.54l2.1,-2.1l1.54,1.54c0.58,-0.37 1.24,-0.64 1.93,-0.81l0,-2.18l3,0l0,2.18c0.68,0.16 1.33,0.43 1.91,0.79l1.54,-1.54l2.12,2.12l-1.54,1.54c0.36,0.59 0.64,1.24 0.8,1.94l2.17,0l0,2.97Zm-8.5,1.5c1.66,0 3,-1.34 3,-3c0,-1.66 -1.34,-3 -3,-3c-1.66,0 -3,1.34 -3,3c0,1.66 1.34,3 3,3Z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="post-smtp-dash-widget-settings-menu">
|
||||
<div class="post-smtp-dash-widget-settings-menu--style">
|
||||
<h4><?php esc_html_e( 'Graph Style', 'post-smtp' ); ?></h4>
|
||||
<div>
|
||||
<div class="post-smtp-dash-widget-settings-menu-item">
|
||||
<input type="radio" id="post-smtp-dash-widget-settings-style-bar" class="post-smtp-dash-widget-settings-style" name="post-smtp-chart-style" value="bar" <?php echo $chart_style == 'bar' ? 'checked' : ''; ?> <?php echo $disabled; ?>>
|
||||
<label for="post-smtp-dash-widget-settings-style-bar"><?php esc_html_e( 'Bar', 'post-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="post-smtp-dash-widget-settings-menu-item">
|
||||
<input type="radio" id="post-smtp-dash-widget-settings-style-line" class="post-smtp-dash-widget-settings-style" name="post-smtp-chart-style" value="line" <?php echo $chart_style == 'line' ? 'checked' : ''; ?> <?php echo $disabled; ?>>
|
||||
<label for="post-smtp-dash-widget-settings-style-line"><?php esc_html_e( 'Line', 'post-smtp' ); ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="button post-smtp-dash-widget-settings-menu-save" <?php echo $disabled; ?>><?php esc_html_e( 'Save Changes', 'post-smtp' ); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Email statistics block.
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
private function emailStatsBlock() {
|
||||
|
||||
$logs_query = new PostmanEmailQueryLog;
|
||||
$logs = $logs_query->get_logs();
|
||||
|
||||
$total = count( $logs );
|
||||
|
||||
$output_data = array();
|
||||
|
||||
// Initialize the categories
|
||||
$output_data['all_emails'] = array(
|
||||
'type' => 'all',
|
||||
'icon' => esc_url( POST_SMTP_URL . "/Postman/Postman-Controller/assets/images/email.svg" ),
|
||||
'title' => $total . ' total', // Set the actual total count
|
||||
);
|
||||
|
||||
// Initialize counters for sent and failed emails
|
||||
$sent_count = 0;
|
||||
$failed_count = 0;
|
||||
|
||||
if ( post_smtp_has_pro() ){
|
||||
$opened_count = 0;
|
||||
// $opened_email = new Post_SMTP_New_Dashboard;
|
||||
$current_time = current_time( 'timestamp' );
|
||||
$period = 'day';
|
||||
$filter = strtotime( 'today', $current_time );
|
||||
$opened_count = apply_filters(
|
||||
'post_smtp_dashboard_opened_emails_count',
|
||||
0,
|
||||
array(
|
||||
'period' => $period,
|
||||
'current_time' => $current_time,
|
||||
'filter' => $filter,
|
||||
)
|
||||
);
|
||||
}
|
||||
// Loop through logs to count sent and failed emails, including fallback sent.
|
||||
foreach ( $logs as $log ) {
|
||||
if ( isset( $log->success ) ) {
|
||||
// Treat normal success and successful fallback ("Sent ( ** Fallback ** )") as sent.
|
||||
$success_value = $log->success;
|
||||
|
||||
$is_normal_success = ( 1 === $success_value || '1' === $success_value );
|
||||
$is_fallback_sent = is_string( $success_value ) && 0 === strpos( $success_value, 'Sent ( ** Fallback ** )' );
|
||||
|
||||
if ( $is_normal_success || $is_fallback_sent ) {
|
||||
$sent_count++;
|
||||
} else {
|
||||
// Any other value (including fallback failures) is considered failed.
|
||||
$failed_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set sent and failed emails data
|
||||
$output_data['sent_emails'] = array(
|
||||
'type' => 'sent',
|
||||
'icon' => esc_url( POST_SMTP_URL . "/Postman/Postman-Controller/assets/images/sent.svg" ),
|
||||
'title' => 'Sent '. $sent_count, // Show the actual count of sent emails.
|
||||
);
|
||||
|
||||
$output_data['failed_emails'] = array(
|
||||
'type' => 'failed',
|
||||
'icon' => esc_url( POST_SMTP_URL . "/Postman/Postman-Controller/assets/images/failed.svg" ),
|
||||
'title' => 'Failed '. $failed_count, // Show the actual count of failed emails.
|
||||
);
|
||||
if ( post_smtp_has_pro() ){
|
||||
$output_data['opened_emails'] = array(
|
||||
'type' => 'opened',
|
||||
'icon' => esc_url( POST_SMTP_URL . "/Postman/Postman-Controller/assets/images/opend.svg" ),
|
||||
'title' => 'Opened '. $opened_count, // Show the actual count of failed emails.
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<table id="post-smtp-dash-widget-email-stats-table" cellspacing="0">
|
||||
<tr>
|
||||
<?php
|
||||
$count = 0;
|
||||
$per_row = 3;
|
||||
if ( post_smtp_has_pro() ) {
|
||||
$per_row = 4;
|
||||
}
|
||||
foreach ( array_values( $output_data ) as $stats ) :
|
||||
if ( ! is_array( $stats ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! isset( $stats['icon'], $stats['title'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create new row after every $per_row cells.
|
||||
if ( $count !== 0 && $count % $per_row === 0 ) {
|
||||
echo '</tr><tr>';
|
||||
}
|
||||
|
||||
$count++;
|
||||
?>
|
||||
<td class="post-smtp-dash-widget-email-stats-table-cell post-smtp-dash-widget-email-stats-table-cell--<?php echo esc_attr( $stats['type'] ); ?> post-smtp-dash-widget-email-stats-table-cell--<?php echo esc_attr( count($output_data) ); ?>">
|
||||
<div class="post-smtp-dash-widget-email-stats-table-cell-container">
|
||||
<img src="<?php echo esc_url( $stats['icon'] ); ?>" alt="<?php esc_attr_e( 'Table cell icon', 'post-smtp' ); ?>">
|
||||
<span>
|
||||
<?php echo esc_html( $stats['title'] ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print the human-readable plugin state
|
||||
*/
|
||||
public function print_postman_status() {
|
||||
if (! PostmanPreRequisitesCheck::isReady ()) {
|
||||
printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Error: Postman is missing a required PHP library.', 'post-smtp' ) );
|
||||
} else if ($this->wpMailBinder->isUnboundDueToException ()) {
|
||||
printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Postman: wp_mail has been declared by another plugin or theme, so you won\'t be able to use Postman until the conflict is resolved.', 'post-smtp' ) );
|
||||
} else {
|
||||
if ($this->options->getRunMode () != PostmanOptions::RUN_MODE_PRODUCTION) {
|
||||
printf ( '<p><span style="background-color:yellow">%s</span></p>', __ ( 'Postman is in <em>non-Production</em> mode and is dumping all emails.', 'post-smtp' ) );
|
||||
} else if (PostmanTransportRegistry::getInstance ()->getSelectedTransport ()->isConfiguredAndReady ()) {
|
||||
printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s </p>', sprintf ( _n ( '<span style="color:green">Postman is configured</span> and has delivered <span style="color:green">%d</span> email.', '<span style="color:green">Postman is configured</span> and has delivered <span style="color:green">%d</span> emails.', PostmanState::getInstance ()->getSuccessfulDeliveries (), 'post-smtp' ), PostmanState::getInstance ()->getSuccessfulDeliveries () ) );
|
||||
} else {
|
||||
printf ( '<p><span style="color:red">%s</span></p>', __ ( 'Postman is <em>not</em> configured and is mimicking out-of-the-box WordPress email delivery.', 'post-smtp' ) );
|
||||
}
|
||||
$currentTransport = PostmanTransportRegistry::getInstance ()->getActiveTransport ();
|
||||
$deliveryDetails = $currentTransport->getDeliveryDetails ( $this->options );
|
||||
printf ( '<p>%s</p>', $deliveryDetails );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the function to output the contents of our Dashboard Widget.
|
||||
*/
|
||||
public function printNetworkDashboardWidget() {
|
||||
printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s</p>', __ ( 'Postman is operating in per-site mode.', 'post-smtp' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* From http://www.hughlashbrooke.com/2014/02/wordpress-add-items-glance-widget/
|
||||
* http://coffeecupweb.com/how-to-add-custom-post-types-to-at-a-glance-dashboard-widget-in-wordpress/
|
||||
*
|
||||
* @param mixed $items
|
||||
* @return string
|
||||
*/
|
||||
function customizeAtAGlanceDashboardWidget($items = array()) {
|
||||
// only modify the At-a-Glance for administrators
|
||||
if (PostmanUtils::isAdmin ()) {
|
||||
$post_types = array (
|
||||
PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG
|
||||
);
|
||||
|
||||
foreach ( $post_types as $type ) {
|
||||
|
||||
if (! post_type_exists ( $type ))
|
||||
continue;
|
||||
|
||||
$num_posts = wp_count_posts ( $type );
|
||||
|
||||
if ($num_posts) {
|
||||
|
||||
$published = intval ( $num_posts->publish );
|
||||
$privated = intval ( $num_posts->private );
|
||||
$post_type = get_post_type_object ( $type );
|
||||
|
||||
$text = _n ( '%s ' . $post_type->labels->singular_name, '%s ' . $post_type->labels->name, $privated, 'post-smtp' );
|
||||
$text = sprintf ( $text, number_format_i18n ( $privated ) );
|
||||
|
||||
$items [] = sprintf ( '<a class="%1$s-count" href="%3$s">%2$s</a>', $type, $text, PostmanUtils::getEmailLogPageUrl () ) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class PostmanWizardSocket {
|
||||
|
||||
// these variables are populated by the Port Test
|
||||
public $hostname;
|
||||
public $hostnameDomainOnly;
|
||||
public $port;
|
||||
public $protocol;
|
||||
public $secure;
|
||||
public $mitm;
|
||||
public $reportedHostname;
|
||||
public $reportedHostnameDomainOnly;
|
||||
public $message;
|
||||
public $startTls;
|
||||
public $authPlain;
|
||||
public $auth_login;
|
||||
public $auth_crammd5;
|
||||
public $auth_xoauth;
|
||||
public $auth_none;
|
||||
public $try_smtps;
|
||||
public $success;
|
||||
public $transport;
|
||||
|
||||
/**
|
||||
* Extra Fields
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public $data = false;
|
||||
|
||||
// these variables are populated by The Transport Recommenders
|
||||
public $label;
|
||||
public $id;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mixed $queryHostData
|
||||
*/
|
||||
function __construct($queryHostData) {
|
||||
$this->hostname = $queryHostData ['hostname'];
|
||||
$this->hostnameDomainOnly = $queryHostData ['hostname_domain_only'];
|
||||
$this->port = $queryHostData ['port'];
|
||||
$this->protocol = $queryHostData ['protocol'];
|
||||
$this->secure = PostmanUtils::parseBoolean ( $queryHostData ['secure'] );
|
||||
$this->mitm = PostmanUtils::parseBoolean ( $queryHostData ['mitm'] );
|
||||
$this->reportedHostname = $queryHostData ['reported_hostname'];
|
||||
$this->reportedHostnameDomainOnly = $queryHostData ['reported_hostname_domain_only'];
|
||||
$this->message = $queryHostData ['message'];
|
||||
$this->startTls = PostmanUtils::parseBoolean ( $queryHostData ['start_tls'] );
|
||||
$this->authPlain = PostmanUtils::parseBoolean ( $queryHostData ['auth_plain'] );
|
||||
$this->auth_login = PostmanUtils::parseBoolean ( $queryHostData ['auth_login'] );
|
||||
$this->auth_crammd5 = PostmanUtils::parseBoolean ( $queryHostData ['auth_crammd5'] );
|
||||
$this->auth_xoauth = PostmanUtils::parseBoolean ( $queryHostData ['auth_xoauth'] );
|
||||
$this->auth_none = PostmanUtils::parseBoolean ( $queryHostData ['auth_none'] );
|
||||
$this->try_smtps = PostmanUtils::parseBoolean ( $queryHostData ['try_smtps'] );
|
||||
$this->success = PostmanUtils::parseBoolean ( $queryHostData ['success'] );
|
||||
$this->transport = $queryHostData ['transport'];
|
||||
$this->data = $queryHostData['data'];
|
||||
|
||||
assert ( ! empty ( $this->transport ) );
|
||||
$this->id = sprintf ( '%s_%s', $this->hostname, $this->port );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class PostmanWelcomeController {
|
||||
|
||||
private $rootPluginFilenameAndPath, $pluginUrl, $version;
|
||||
|
||||
public function __construct( $rootPluginFilenameAndPath ) {
|
||||
$this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath;
|
||||
$this->pluginUrl = plugins_url( 'style', $rootPluginFilenameAndPath );
|
||||
$this->version = PostmanState::getInstance()->getVersion();
|
||||
|
||||
add_action( 'admin_menu', array( $this, 'add_menus' ) );
|
||||
add_action( 'admin_head', array( $this, 'admin_head' ) );
|
||||
}
|
||||
|
||||
public function add_menus() {
|
||||
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
|
||||
// About
|
||||
add_dashboard_page(
|
||||
__( 'Welcome', 'post-smtp' ),
|
||||
__( 'Welcome', 'post-smtp' ),
|
||||
'manage_options',
|
||||
'post-about',
|
||||
array( $this, 'about_screen' )
|
||||
);
|
||||
|
||||
// Credits
|
||||
add_dashboard_page(
|
||||
__( 'Credits', 'post-smtp' ),
|
||||
__( 'Credits', 'post-smtp' ),
|
||||
'manage_options',
|
||||
'post-credits',
|
||||
array( $this, 'credits_screen' )
|
||||
);
|
||||
|
||||
// add_action( 'admin_print_styles-' . $page, array( $this, 'postman_about_enqueue_resources' ) );
|
||||
}
|
||||
}
|
||||
|
||||
public function admin_head() {
|
||||
remove_submenu_page( 'index.php', 'post-about' );
|
||||
remove_submenu_page( 'index.php', 'post-credits' );
|
||||
}
|
||||
|
||||
public function postman_about_enqueue_resources() {
|
||||
// wp_enqueue_style( 'font-awsome', '' );
|
||||
}
|
||||
|
||||
|
||||
public function about_screen() {
|
||||
?>
|
||||
<style type="text/css">
|
||||
.post-badge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding-top: 142px;
|
||||
height: 50px;
|
||||
width: 140px;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
margin: 0 -5px;
|
||||
background: url( <?php echo $this->pluginUrl; ?>/images/badge.png) no-repeat;
|
||||
}
|
||||
|
||||
.about-wrap [class$="-col"] {
|
||||
flex-wrap: nowrap !important;
|
||||
}
|
||||
</style>
|
||||
<div class="wrap about-wrap">
|
||||
<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', 'post-smtp' ), $this->version ); ?></h1>
|
||||
<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! Post SMTP %s is bundled up and ready to take your SMTP needs to the next level!', 'post-smtp' ), $this->version ); ?><br>
|
||||
<?php printf( '<strong>%s</strong>','Post SMTP support every SMTP service: Gmail/G-suite, SendGrid, Mandrill, Office365, and more...' ); ?>
|
||||
</div>
|
||||
<div class="post-badge"><?php printf( esc_html__( 'Version %s', 'post-smtp' ), $this->version ); ?></div>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-about' ), 'index.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'What’s New', 'post-smtp' ); ?>
|
||||
</a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-credits' ), 'index.php' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Credits', 'post-smtp' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog">
|
||||
<h3><?php esc_html_e( 'Email Log', 'post-smtp' ); ?></h3>
|
||||
|
||||
<div class="feature-section col two-col">
|
||||
<div class="last-feature">
|
||||
<h4><?php esc_html_e( 'Email log filter', 'post-smtp' ); ?></h4>
|
||||
<p>
|
||||
<?php esc_html_e( 'You can easily filter by dates and search in your log.', 'post-smtp' ); ?>
|
||||
<img src="<?php echo $this->pluginUrl; ?>/images/filter-preview.gif">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php esc_html_e( 'Multiple emails resend', 'post-smtp' ); ?></h4>
|
||||
<p>
|
||||
<?php esc_html_e( 'Resend any email to the original recipient or any other emails you choose.', 'post-smtp' ); ?>
|
||||
<img src="<?php echo $this->pluginUrl; ?>/images/resend-preview.gif">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<h3><?php esc_html_e( 'The best delivery experience', 'post-smtp' ); ?></h3>
|
||||
|
||||
<div class="feature-section col one-col">
|
||||
<div class="last-feature">
|
||||
<p><?php esc_html_e( 'Easy-to-use, powerful Setup Wizard for perfect configuration,
|
||||
Commercial-grade Connectivity Tester to diagnose server issues,
|
||||
Log and resend all emails; see the exact cause of failed emails,
|
||||
Supports International alphabets, HTML Mail and MultiPart/Alternative,
|
||||
Supports forced recipients (cc, bcc, to) and custom email headers,
|
||||
SASL Support: Plain/Login/CRAM-MD5/XOAUTH2 authentication,
|
||||
Security Support: SMTPS and STARTTLS (SSL/TLS),
|
||||
Copy configuration to other instances of Post.', 'post-smtp' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="feature-section col three-col">
|
||||
<div>
|
||||
<h4><?php esc_html_e( 'Email log HTML preview', 'post-smtp' ); ?></h4>
|
||||
<p><?php esc_html_e( 'You can now see sent emails as HTML.', 'post-smtp' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php esc_html_e( 'Continues email delivery', 'post-smtp' ); ?></h4>
|
||||
<p><?php esc_html_e( 'if email fail to sent you will get notified using the local mail system.', 'post-smtp' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="last-feature">
|
||||
<h4><?php esc_html_e( 'The best debugging tools.', 'post-smtp' ); ?></h4>
|
||||
<p><?php esc_html_e( 'Full Transcripts, Connectivity Test, Diagnostic Test.', 'post-smtp' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="return-to-dashboard">
|
||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', 'post-smtp' ); ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
public function credits_screen() {
|
||||
?>
|
||||
<style type="text/css">
|
||||
.post-badge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding-top: 142px;
|
||||
height: 50px;
|
||||
width: 140px;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
margin: 0 -5px;
|
||||
background: url( <?php echo $this->pluginUrl; ?>/images/badge.png) no-repeat;
|
||||
}
|
||||
</style>
|
||||
<div class="wrap about-wrap">
|
||||
<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', 'post-smtp' ), $this->version ); ?></h1>
|
||||
<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', 'post-smtp' ), $this->version ); ?></div>
|
||||
<div class="post-badge"><?php printf( esc_html__( 'Version %s', 'post-smtp' ), $this->version ); ?></div>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
|
||||
<?php esc_html_e( 'What’s New', 'post-smtp' ); ?>
|
||||
</a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
|
||||
<?php esc_html_e( 'Credits', 'post-smtp' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<p class="about-description"><?php esc_html_e( 'Post SMTP started by Jason Hendriks, Jason left the project and Yehuda Hassine (me) continue his work.', 'post-smtp' ); ?></p>
|
||||
|
||||
<h4 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'post-smtp' ); ?></h4>
|
||||
<ul class="wp-people-group " id="wp-people-group-project-leaders">
|
||||
<li class="wp-person" id="wp-person-yehudah">
|
||||
<a href="http://profiles.wordpress.org/yehudah"><img src="https://secure.gravatar.com/avatar/c561638d04ea8fef351f974dbb9ece39?s=60&d=mm&r=g" class="gravatar" alt="Yehuda Hassine" /></a>
|
||||
<a class="web" href="http://profiles.wordpress.org/yehudah">Yehuda Hassine</a>
|
||||
<span class="title"><?php esc_html_e( 'Lead Developer', 'post-smtp' ); ?></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="wp-people-group"><?php esc_html_e( 'Top Community Members', 'post-smtp' ); ?></h4>
|
||||
<h5><?php esc_html_e( 'Here I will list top users that help Post SMTP grow (bugs, features, etc...)', 'post-smtp' ); ?>
|
||||
<p class="wp-credits-list">
|
||||
<a href="http://profiles.wordpress.org/diegocanal">diegocanal</a>,
|
||||
<a href="http://profiles.wordpress.org/jyourstone">Johan Yourstone</a>,
|
||||
<a href="http://profiles.wordpress.org/bodhirayo">bodhirayo</a>,
|
||||
<a href="http://profiles.wordpress.org/buzztone">Neil Murray </a>,
|
||||
<a href="#">A place waiting for you? :-) </a>
|
||||
</p>
|
||||
|
||||
<div class="return-to-dashboard">
|
||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', 'post-smtp' ); ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,740 @@
|
||||
#dashboard-widgets .meta-box-sortables .postbox:last-child .post-smtp-dash-widget-settings-menu {
|
||||
top: auto;
|
||||
bottom: 50px
|
||||
}
|
||||
|
||||
@media(min-width: 800px) {
|
||||
#dashboard-widgets .meta-box-sortables .postbox:last-child .post-smtp-dash-widget-settings-menu {
|
||||
bottom: 40px
|
||||
}
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_pro .inside,
|
||||
#post_smtp_reports_widget_lite .inside {
|
||||
margin: 0;
|
||||
padding: 0
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget button:focus {
|
||||
outline: none
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget-block {
|
||||
position: relative;
|
||||
padding: 0 12px;
|
||||
margin-top: 12px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget-block h3 {
|
||||
display: inline-block;
|
||||
line-height: 2
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget-block p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-chart-block-container {
|
||||
position: relative
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-chart-block {
|
||||
height: 291px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 0 12px 12px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
justify-content: space-between;
|
||||
margin-top: 0;
|
||||
padding: 13px;
|
||||
background-color: #fafafa
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings>div {
|
||||
display: flex
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings>div:first-child {
|
||||
flex-wrap: wrap
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings>div:first-child a {
|
||||
line-height: 30px
|
||||
}
|
||||
|
||||
@media(max-width: 980px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings {
|
||||
padding: 13px 4px
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 960px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings {
|
||||
padding: 13px
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 856px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings {
|
||||
padding: 13px 2px
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 799px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings {
|
||||
padding: 13px
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 436px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings {
|
||||
flex-direction: column;
|
||||
align-items: normal
|
||||
}
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings select {
|
||||
width: 100%;
|
||||
margin: 0 0 10px
|
||||
}
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-select-timespan {
|
||||
width: calc(100% - 38px)
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings a {
|
||||
vertical-align: middle
|
||||
}
|
||||
|
||||
@media(max-width: 1150px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings a {
|
||||
display: none
|
||||
}
|
||||
}
|
||||
|
||||
@media(min-width: 1500px)and (max-width: 1630px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings a {
|
||||
display: none
|
||||
}
|
||||
}
|
||||
|
||||
@media(min-width: 1801px)and (max-width: 2080px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings a {
|
||||
display: none
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-select-email-type {
|
||||
margin-right: 6px
|
||||
}
|
||||
|
||||
@media(max-width: 830px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-select-email-type {
|
||||
margin-right: 2px
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 436px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-select-email-type {
|
||||
margin-right: 0
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-container {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
margin-left: 6px
|
||||
}
|
||||
|
||||
@media(max-width: 830px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-container {
|
||||
margin-left: 2px
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 799px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-container {
|
||||
margin-left: 6px
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button {
|
||||
background: #fafafa;
|
||||
color: #787c82;
|
||||
border-color: #787c82;
|
||||
padding: 1px 6px 0;
|
||||
margin-bottom: 0;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button:hover,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button:active,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button:focus {
|
||||
color: #2271b1;
|
||||
border-color: #2271b1
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button:hover svg path,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button:active svg path,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button:focus svg path {
|
||||
fill: #2271b1
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button.open svg path {
|
||||
transform: rotate(90deg)
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button svg {
|
||||
display: inline-block;
|
||||
width: 19px;
|
||||
height: 19px
|
||||
}
|
||||
|
||||
@media(max-width: 782px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button svg {
|
||||
padding: 5px
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-button svg path {
|
||||
fill: #787c82;
|
||||
transition: transform .2s;
|
||||
transform-origin: center center
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
width: 160px;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0px 5px 15px rgba(0, 0, 0, .15);
|
||||
padding: 10px;
|
||||
z-index: 9999;
|
||||
right: 0;
|
||||
top: 50px
|
||||
}
|
||||
|
||||
@media(min-width: 800px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu {
|
||||
top: 40px
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--style,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color {
|
||||
border-bottom: 1px solid #eee
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--style h4,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color h4 {
|
||||
text-transform: uppercase !important;
|
||||
color: #3c434a !important;
|
||||
font-size: 11px !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: 13px !important;
|
||||
margin: 0 0 10px !important
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--style .post-smtp-dash-widget-settings-menu-item,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color .post-smtp-dash-widget-settings-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #3c434a;
|
||||
font-size: 13px;
|
||||
line-height: 16px;
|
||||
margin: 0 0 13px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--style .post-smtp-dash-widget-settings-menu-item:last-child,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color .post-smtp-dash-widget-settings-menu-item:last-child {
|
||||
margin: 0 0 10px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--style .post-smtp-dash-widget-settings-menu-item input[type=radio],
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color .post-smtp-dash-widget-settings-menu-item input[type=radio] {
|
||||
margin-right: 5px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--style .post-smtp-dash-widget-settings-menu-item label,
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color .post-smtp-dash-widget-settings-menu-item label {
|
||||
vertical-align: top;
|
||||
margin-top: -3px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu--color {
|
||||
margin-top: 10px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-settings .post-smtp-dash-widget-settings-menu-save {
|
||||
margin-top: 10px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table {
|
||||
width: calc(100% + 24px);
|
||||
margin: 0 -12px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell {
|
||||
padding: 10px 6px;
|
||||
border-right: 1px solid #eee;
|
||||
border-top: 1px solid #eee;
|
||||
color: #3c434a;
|
||||
font-size: 14px;
|
||||
width: 50%;
|
||||
line-height: 17px
|
||||
}
|
||||
|
||||
@media(max-width: 436px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell {
|
||||
display: block;
|
||||
width: 100%
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell--2:not(:first-child) {
|
||||
border-right: none
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell--3 {
|
||||
width: 33.33%
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell--4 {
|
||||
width: 25%
|
||||
}
|
||||
|
||||
@media(max-width: 436px) {
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell--3 {
|
||||
width: 100%
|
||||
}
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell--3:last-child {
|
||||
border-right: none
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell--4:last-child {
|
||||
border-right: none
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell-container {
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block table .post-smtp-dash-widget-email-stats-table-cell-container img {
|
||||
width: 18px;
|
||||
margin-right: 5px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-stats-block .post-smtp-dash-widget-overlay {
|
||||
background-position-y: 50%
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block {
|
||||
display: flex;
|
||||
padding: 12px 7px 12px 12px;
|
||||
border-top: 1px solid #eee;
|
||||
color: #787c82;
|
||||
font-size: 13px;
|
||||
line-height: 16px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block b {
|
||||
color: #3c434a
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .sep {
|
||||
display: inline-block;
|
||||
margin: 0 3px;
|
||||
color: #ddd
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .sep-vertical {
|
||||
color: #ddd
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block p {
|
||||
margin: 0
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .post-smtp-dash-widget-recommended-plugin {
|
||||
display: inline-block;
|
||||
width: calc(100% - 24px)
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .post-smtp-dash-widget-recommended-plugin span {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .post-smtp-dash-widget-dismiss-recommended-plugin-block {
|
||||
display: inline-block;
|
||||
border: 0;
|
||||
color: gray;
|
||||
opacity: .3;
|
||||
vertical-align: baseline;
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
padding: 0 2px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .post-smtp-dash-widget-dismiss-recommended-plugin-block:hover {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-recommended-plugin-block .post-smtp-dash-widget-dismiss-recommended-plugin-block .dashicons {
|
||||
font-size: 16px;
|
||||
height: 16px;
|
||||
width: 16px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education {
|
||||
align-items: center;
|
||||
border-left: 4px solid #d63638;
|
||||
border-top: 1px solid #eee;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 0;
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education-error-icon {
|
||||
display: flex;
|
||||
height: 44px;
|
||||
width: 40px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education-error-icon img {
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
margin: auto
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education-content {
|
||||
padding-right: 14px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education-content p {
|
||||
color: #1d2327;
|
||||
font-size: 14px;
|
||||
line-height: 20px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education-content p a {
|
||||
color: #2271b1;
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education-content p strong {
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education .post-smtp-dash-widget-dismiss-email-alert-block {
|
||||
background: none;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 10px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-email-alerts-education .post-smtp-dash-widget-dismiss-email-alert-block .dashicons {
|
||||
color: #a0a5aa;
|
||||
font-size: 16px;
|
||||
height: 17px;
|
||||
width: 16px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-error {
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-chart-upgrade,
|
||||
.post-smtp-dash-widget .post-smtp-error-no-data-chart {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 255, 255, 0);
|
||||
background: -moz-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%);
|
||||
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgb(255, 255, 255)));
|
||||
background: -webkit-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%);
|
||||
background: -o-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%);
|
||||
background: -ms-radial-gradient(center, ellipse cover, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%);
|
||||
background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 0%, rgb(255, 255, 255) 100%)
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-chart-upgrade .post-smtp-dash-widget-modal,
|
||||
.post-smtp-dash-widget .post-smtp-error-no-data-chart .post-smtp-dash-widget-modal {
|
||||
position: absolute;
|
||||
top: calc(50% - 2em);
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 1.5em 2em 2em 2em;
|
||||
box-shadow: 0 0 25px 10px rgba(0, 0, 0, .08);
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
width: 20em
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-chart-upgrade .post-smtp-dash-widget-modal h2,
|
||||
.post-smtp-dash-widget .post-smtp-error-no-data-chart .post-smtp-dash-widget-modal h2 {
|
||||
padding: 0;
|
||||
margin-bottom: 5px;
|
||||
font-size: 18px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-chart-upgrade .post-smtp-dash-widget-modal p,
|
||||
.post-smtp-dash-widget .post-smtp-error-no-data-chart .post-smtp-dash-widget-modal p {
|
||||
line-height: 1.3
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-error-no-data-email-stats {
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-logs-disabled {
|
||||
padding: 21px 25px 30px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-logs-disabled .post-smtp-dash-widget-block-logo {
|
||||
width: 75px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-logs-disabled h2 {
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
font-weight: 500;
|
||||
padding: 10px 0 0
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-logs-disabled p {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
margin: 7px 0 19px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-block-logs-disabled a.button:first-of-type:not(:only-of-type) {
|
||||
margin-right: 10px
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .post-smtp-dash-widget-overlay {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: url(../images/wp-spinner.gif) no-repeat center calc(50% - 12px);
|
||||
background-color: #fff;
|
||||
z-index: 10
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget i.post-smtp-dash-widget-loader {
|
||||
background-image: url(../images/wp-spinner.gif);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover
|
||||
}
|
||||
|
||||
.post-smtp-dash-widget .hidden {
|
||||
display: none !important
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-block-container #post-smtp-dash-widget-chart {
|
||||
opacity: .35
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-upgrade {
|
||||
background: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-upgrade h2 {
|
||||
font-size: 20px !important;
|
||||
line-height: 20px !important;
|
||||
font-weight: 500 !important;
|
||||
color: #3c434a !important;
|
||||
margin-bottom: 15px !important
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-upgrade p {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
color: #787c82;
|
||||
margin-bottom: 15px
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-upgrade p:last-child {
|
||||
margin-bottom: 0
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-upgrade a.button.button-hero {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
padding: 9px 24px;
|
||||
min-height: 40px;
|
||||
border-radius: 100px;
|
||||
background: linear-gradient(45deg, #FFDAA5, #F9AA39);
|
||||
border: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-chart-upgrade .post-smtp-dash-widget-modal {
|
||||
position: relative;
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
transform: none;
|
||||
width: 24em;
|
||||
padding: 2.5em;
|
||||
box-shadow: 0 5px 25px rgba(0, 0, 0, .15);
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e1e1e1;
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-dismiss-chart-upgrade {
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 17px;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
color: #a0a5aa;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-dismiss-chart-upgrade .dashicons {
|
||||
width: 16px;
|
||||
height: 17px;
|
||||
font-style: normal;
|
||||
font-weight: 100;
|
||||
font-size: 24px;
|
||||
line-height: 6px
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-settings-menu input[type=radio]:checked::before {
|
||||
background-color: #a0a5aa
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-settings-menu * {
|
||||
cursor: not-allowed
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block {
|
||||
margin-top: 0;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-top: 1px solid #eee;
|
||||
font-size: 13px;
|
||||
line-height: 16px
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block>div {
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
background: #f0f6fc
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting {
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting label {
|
||||
display: flex;
|
||||
margin: 0 10px 0 0;
|
||||
color: #3c434a
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting label input,
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting label i {
|
||||
margin: 0 10px 0 0
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting label i {
|
||||
display: none;
|
||||
width: 16px;
|
||||
height: 16px
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting label b {
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting a {
|
||||
white-space: nowrap;
|
||||
margin-right: 10px
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting .dashicons-dismiss {
|
||||
margin-left: auto;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
color: #a0a5aa;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-setting .dashicons-dismiss:hover {
|
||||
color: #2271b1
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-applied {
|
||||
display: flex
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-summary-report-email-block-applied .post-smtp-dashicons-yes-alt-green {
|
||||
margin-right: 10px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-image: url("../images/dash-widget/yes-green.svg")
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-upgrade-footer {
|
||||
padding: 12px 0px 12px 0px !important;
|
||||
margin-top: 0 !important;
|
||||
border-top: 1px solid #eee !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
div#post-smtp-dash-widget-upgrade-footer {
|
||||
padding: 12px 0px 0px 0px !important;
|
||||
margin-top: 0 !important;
|
||||
border-top: 1px solid #eee !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-upgrade-footer p {
|
||||
font-size: 13px;
|
||||
line-height: 16px
|
||||
}
|
||||
|
||||
div#post-smtp-dash-widget-upgrade-footer p {
|
||||
font-size: 13px;
|
||||
line-height: 16px
|
||||
}
|
||||
|
||||
#post_smtp_reports_widget_lite .post-smtp-dash-widget-upgrade-footer--hide {
|
||||
display: none
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.37868 5.87868C3.5 6.75736 3.5 8.17157 3.5 11V13C3.5 15.8284 3.5 17.2426 4.37868 18.1213C5.25736 19 6.67157 19 9.5 19H15.5C18.3284 19 19.7426 19 20.6213 18.1213C21.5 17.2426 21.5 15.8284 21.5 13V11C21.5 8.17157 21.5 6.75736 20.6213 5.87868C19.7426 5 18.3284 5 15.5 5H9.5C6.67157 5 5.25736 5 4.37868 5.87868ZM7.0547 8.16795C6.59517 7.8616 5.9743 7.98577 5.66795 8.4453C5.3616 8.90483 5.48577 9.5257 5.9453 9.83205L11.3906 13.4622C12.0624 13.9101 12.9376 13.9101 13.6094 13.4622L19.0547 9.83205C19.5142 9.5257 19.6384 8.90483 19.3321 8.4453C19.0257 7.98577 18.4048 7.8616 17.9453 8.16795L12.5 11.7982L7.0547 8.16795Z" fill="#646464"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 787 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12ZM7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071Z" fill="#E57373"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 793 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="3.5" y="3" width="18" height="18" rx="9" fill="#F9AA39"/>
|
||||
<path d="M9.07174 10.2856L12.5003 12.4285L15.9289 10.2856L12.5003 8.14278L9.07174 10.2856ZM16.786 10.2856V14.5713C16.786 14.7987 16.6957 15.0167 16.535 15.1774C16.3742 15.3382 16.1562 15.4285 15.9289 15.4285H9.07174C8.84441 15.4285 8.6264 15.3382 8.46565 15.1774C8.30491 15.0167 8.2146 14.7987 8.2146 14.5713V10.2856C8.2146 9.97278 8.38174 9.70278 8.63031 9.55278L12.5003 7.13135L16.3703 9.55278C16.6189 9.70278 16.786 9.97278 16.786 10.2856Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 629 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 21C17.4706 21 21.5 16.9706 21.5 12C21.5 7.02944 17.4706 3 12.5 3C7.52944 3 3.5 7.02944 3.5 12C3.5 16.9706 7.52944 21 12.5 21ZM17.2682 9.64018C17.6218 9.21591 17.5645 8.58534 17.1402 8.23178C16.7159 7.87821 16.0853 7.93554 15.7318 8.35982L12.1338 12.6774C11.7871 13.0934 11.5922 13.3238 11.4366 13.4653L11.4306 13.4707L11.4242 13.4659C11.2564 13.339 11.0415 13.1272 10.6585 12.7443L9.20711 11.2929C8.81658 10.9024 8.18342 10.9024 7.79289 11.2929C7.40237 11.6834 7.40237 12.3166 7.79289 12.7071L9.24428 14.1585L9.28511 14.1993L9.28512 14.1993C9.61161 14.526 9.9257 14.8402 10.2179 15.0611C10.5453 15.3087 10.974 15.5415 11.5234 15.5165C12.0728 15.4916 12.4787 15.221 12.7823 14.9448C13.0534 14.6983 13.3377 14.3569 13.6333 14.0021L13.6333 14.0021L13.6703 13.9577L17.2682 9.64018Z" fill="#74B27B"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 954 B |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
15
html/wp-content/plugins/post-smtp/Postman/Postman-Controller/assets/js/chart.min.js
vendored
Normal file
15
html/wp-content/plugins/post-smtp/Postman/Postman-Controller/assets/js/chart.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
html/wp-content/plugins/post-smtp/Postman/Postman-Controller/assets/js/moment.min.js
vendored
Normal file
2
html/wp-content/plugins/post-smtp/Postman/Postman-Controller/assets/js/moment.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,187 @@
|
||||
window.chartInstances = window.chartInstances || {};
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var el = {
|
||||
canvas : jQuery('#post-smtp-dash-widget-chart'),
|
||||
settingsBtn : jQuery('#post-smtp-dash-widget-settings-button'),
|
||||
dismissBtn : jQuery('.post-smtp-dash-widget-dismiss-chart-upgrade'),
|
||||
summaryReportEmailBlock : jQuery('.post-smtp-dash-widget-summary-report-email-block'),
|
||||
summaryReportEmailDismissBtn : jQuery('.post-smtp-dash-widget-summary-report-email-dismiss'),
|
||||
summaryReportEmailEnableInput: jQuery('#post-smtp-dash-widget-summary-report-email-enable'),
|
||||
emailAlertsDismissBtn : jQuery('#post-smtp-dash-widget-dismiss-email-alert-block')
|
||||
};
|
||||
// Initialize Chart
|
||||
var ctx = el.canvas[0].getContext('2d');
|
||||
|
||||
var transactionChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [
|
||||
{
|
||||
label: '',
|
||||
data: [],
|
||||
backgroundColor: 'rgba(34, 113, 177, 0.15)',
|
||||
borderColor: 'rgba(34, 113, 177, 1)',
|
||||
borderWidth: 2,
|
||||
pointRadius: 4,
|
||||
pointBorderWidth: 1,
|
||||
pointBackgroundColor: 'rgba(255, 255, 255, 1)'
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
// responsive: true,
|
||||
maintainAspectRatio: false, // Maintain aspect ratio
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
ticks: {
|
||||
stepSize: 1,
|
||||
},
|
||||
},
|
||||
x: {
|
||||
grid: {
|
||||
display: true
|
||||
}
|
||||
}
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0.4,
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
duration: 1000, // Animation duration in milliseconds
|
||||
easing: 'easeInOutQuart', // Easing function to make it smooth
|
||||
},
|
||||
hover: {
|
||||
animationDuration: 0,
|
||||
},
|
||||
legend: {
|
||||
display: true,
|
||||
},
|
||||
tooltip: {
|
||||
mode: 'index',
|
||||
intersect: false
|
||||
},
|
||||
responsiveAnimationDuration: 0,
|
||||
},
|
||||
});
|
||||
window.chartInstances['myChart'] = transactionChart;
|
||||
updateWithDummyData(transactionChart);
|
||||
|
||||
el.settingsBtn.on( 'click', function( e ) {
|
||||
$( this ).toggleClass( 'open' );
|
||||
$( this ).siblings( '.post-smtp-dash-widget-settings-menu' ).fadeToggle( 200 );
|
||||
} );
|
||||
|
||||
el.dismissBtn.on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
// saveWidgetMeta( 'hide_graph', 1 );
|
||||
$( this ).closest( '.post-smtp-dash-widget-chart-block-container' ).remove();
|
||||
// $( '#post-smtp-dash-widget-upgrade-footer' ).show();
|
||||
} );
|
||||
|
||||
// Hide summary report email block on dismiss icon click.
|
||||
el.summaryReportEmailDismissBtn.on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
saveWidgetMeta( 'hide_summary_report_email_block', 1 );
|
||||
el.summaryReportEmailBlock.slideUp();
|
||||
} );
|
||||
|
||||
// Enable summary report email on checkbox enable.
|
||||
el.summaryReportEmailEnableInput.on( 'change', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
var $self = $( this ),
|
||||
$loader = $self.next( 'i' );
|
||||
|
||||
$self.hide();
|
||||
$loader.show();
|
||||
|
||||
var data = {
|
||||
_wpnonce: post_smtp_dashboard_widget.nonce,
|
||||
action : 'post_smtp_' + post_smtp_dashboard_widget.slug + '_enable_summary_report_email'
|
||||
};
|
||||
|
||||
$.post( post_smtp_dashboard_widget.ajax_url, data )
|
||||
.done( function() {
|
||||
el.summaryReportEmailBlock.find( '.post-smtp-dash-widget-summary-report-email-block-setting' )
|
||||
.addClass( 'hidden' );
|
||||
el.summaryReportEmailBlock.find( '.post-smtp-dash-widget-summary-report-email-block-applied' )
|
||||
.removeClass( 'hidden' );
|
||||
} )
|
||||
.fail( function() {
|
||||
$self.show();
|
||||
$loader.hide();
|
||||
} );
|
||||
} );
|
||||
|
||||
// Hide email alerts banner on dismiss icon click.
|
||||
el.emailAlertsDismissBtn.on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
$( '#post-smtp-dash-widget-email-alerts-education' ).remove();
|
||||
saveWidgetMeta( 'hide_email_alerts_banner', 1 );
|
||||
} );
|
||||
|
||||
// chart.init();
|
||||
|
||||
});
|
||||
|
||||
function updateWithDummyData(chart) {
|
||||
var end = moment().startOf('day'),
|
||||
days = 7, // Number of days to go back
|
||||
data = [55, 45, 34, 45, 32, 55, 65], // The dummy data points
|
||||
date,
|
||||
i;
|
||||
|
||||
// Clear the previous data in the chart
|
||||
chart.data.labels = [];
|
||||
chart.data.datasets[0].data = [];
|
||||
|
||||
// Loop to create dummy data for each day in the range
|
||||
for (i = 0; i < days; i++) {
|
||||
// Clone the 'end' date to avoid modifying the original 'end' date
|
||||
date = end.clone().subtract(i, 'days');
|
||||
|
||||
// Push formatted date to labels (e.g., 'Apr 27', 'Apr 26', etc.)
|
||||
chart.data.labels.push(date.format('MMM DD')); // Format the date as string (e.g., 'Apr 27')
|
||||
|
||||
// Push the data for this day to the dataset
|
||||
chart.data.datasets[0].data.push({
|
||||
t: date.valueOf(), // Convert the Moment object to Unix timestamp (milliseconds)
|
||||
y: data[i], // Corresponding y value
|
||||
});
|
||||
}
|
||||
|
||||
console.log('chart data updated: ', chart.data); // Log the chart data for debugging
|
||||
|
||||
// Update the chart with the new data
|
||||
chart.update();
|
||||
removeOverlay( jQuery('#post-smtp-dash-widget-chart') );
|
||||
}
|
||||
|
||||
function removeOverlay( $el ) {
|
||||
$el.siblings( '.post-smtp-dash-widget-overlay' ).hide();
|
||||
}
|
||||
|
||||
function showOverlay( $el ) {
|
||||
$el.siblings( '.post-smtp-dash-widget-overlay' ).show();
|
||||
}
|
||||
function saveWidgetMeta( meta, value ) {
|
||||
|
||||
var data = {
|
||||
_wpnonce: post_smtp_dashboard_widget.nonce,
|
||||
action : 'post_smtp_' + post_smtp_dashboard_widget.slug + '_save_widget_meta',
|
||||
meta : meta,
|
||||
value : value,
|
||||
};
|
||||
|
||||
jQuery.post( post_smtp_dashboard_widget.ajax_url, data );
|
||||
|
||||
jQuery( '.post-smtp-dash-widget-settings-menu' ).fadeToggle( 200 );
|
||||
}
|
||||
Reference in New Issue
Block a user