first commit
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php defined('ABSPATH') or exit;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _mc4wp_admin_translation_notice()
|
||||
{
|
||||
|
||||
// show for every language other than the default
|
||||
if (stripos(get_locale(), 'en_us') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Check translation progress from Transifex here. Only show when < 100.
|
||||
|
||||
echo '<p class="help">' . sprintf(__('Mailchimp for WordPress is in need of translations. Is the plugin not translated in your language or do you spot errors with the current translations? Helping out is easy! Head over to <a href="%s">the translation project and click "help translate"</a>.', 'mailchimp-for-wp'), 'https://www.transifex.com/projects/p/mailchimp-for-wordpress/') . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _mc4wp_admin_github_notice()
|
||||
{
|
||||
if (strpos($_SERVER['HTTP_HOST'], 'local') !== 0 && ! WP_DEBUG) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<p class="help">Developer? Follow <a href="https://github.com/ibericode/mailchimp-for-wordpress">Mailchimp for WordPress on GitHub</a> or have a look at our repository of <a href="https://github.com/ibericode/mc4wp-snippets">sample code snippets</a>.</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _mc4wp_admin_disclaimer_notice()
|
||||
{
|
||||
echo '<p class="help">' . __('This plugin is not developed by or affiliated with Mailchimp in any way.', 'mailchimp-for-wp') . '</p>';
|
||||
}
|
||||
|
||||
add_action('mc4wp_admin_footer', '_mc4wp_admin_translation_notice', 20);
|
||||
add_action('mc4wp_admin_footer', '_mc4wp_admin_github_notice', 50);
|
||||
add_action('mc4wp_admin_footer', '_mc4wp_admin_disclaimer_notice', 80);
|
||||
?>
|
||||
|
||||
<div class="big-margin">
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Runs while printing the footer of every Mailchimp for WordPress settings page.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
do_action('mc4wp_admin_footer'); ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
defined('ABSPATH') or exit;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _mc4wp_admin_sidebar_support_notice()
|
||||
{
|
||||
?>
|
||||
<div class="mc4wp-box">
|
||||
<h4 class="mc4wp-title"><?php echo esc_html__('Looking for help?', 'mailchimp-for-wp'); ?></h4>
|
||||
<p><?php echo __('We have some resources available to help you in the right direction.', 'mailchimp-for-wp'); ?></p>
|
||||
<ul class="ul-square">
|
||||
<li><a href="https://kb.mc4wp.com/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=sidebar"><?php echo esc_html__('Knowledge Base', 'mailchimp-for-wp'); ?></a></li>
|
||||
<li><a href="https://wordpress.org/plugins/mailchimp-for-wp/faq/"><?php echo esc_html__('Frequently Asked Questions', 'mailchimp-for-wp'); ?></a></li>
|
||||
</ul>
|
||||
<p><?php echo sprintf(__('If your answer can not be found in the resources listed above, please use the <a href="%s">support forums on WordPress.org</a>.'), 'https://wordpress.org/support/plugin/mailchimp-for-wp'); ?></p>
|
||||
<p><?php echo sprintf(__('Found a bug? Please <a href="%s">open an issue on GitHub</a>.'), 'https://github.com/ibericode/mailchimp-for-wordpress/issues'); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _mc4wp_admin_sidebar_other_plugins()
|
||||
{
|
||||
echo '<div class="mc4wp-box">';
|
||||
echo '<h4 class="mc4wp-title">' . __('Other plugins by ibericode', 'mailchimp-for-wp') . '</h4>';
|
||||
|
||||
echo '<ul style="margin-bottom: 0;">';
|
||||
|
||||
// Boxzilla
|
||||
echo '<li>';
|
||||
echo sprintf('<strong><a href="%s">Boxzilla Pop-ups</a></strong><br />', 'https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=sidebar');
|
||||
echo __('Pop-ups or boxes that slide-in with a newsletter sign-up form. A sure-fire way to grow your email lists.', 'mailchimp-for-wp');
|
||||
echo '</li>';
|
||||
|
||||
// HTML Forms
|
||||
echo '<li>';
|
||||
echo sprintf('<strong><a href="%s">HTML Forms</a></strong><br />', 'https://www.htmlforms.io/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=sidebar');
|
||||
echo __('Super flexible forms using native HTML. Just like with Mailchimp for WordPress forms but for other purposes, like a contact form.', 'mailchimp-for-wp');
|
||||
echo '</li>';
|
||||
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
add_action('mc4wp_admin_sidebar', '_mc4wp_admin_sidebar_other_plugins', 40);
|
||||
add_action('mc4wp_admin_sidebar', '_mc4wp_admin_sidebar_support_notice', 50);
|
||||
|
||||
/**
|
||||
* Runs when the sidebar is outputted on Mailchimp for WordPress settings pages.
|
||||
*
|
||||
* Please note that not all pages have a sidebar.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
do_action('mc4wp_admin_sidebar');
|
||||
@@ -0,0 +1,57 @@
|
||||
<h3><?php _e('Your Mailchimp Account', 'mailchimp-for-wp'); ?></h3>
|
||||
<p><?php _e('The table below shows your Mailchimp lists and their details. If you just applied changes to your Mailchimp lists, please use the following button to renew the cached lists configuration.', 'mailchimp-for-wp'); ?></p>
|
||||
|
||||
|
||||
<div id="mc4wp-list-fetcher">
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="_mc4wp_action" value="empty_lists_cache" />
|
||||
|
||||
<p>
|
||||
<input type="submit" value="<?php _e('Renew Mailchimp lists', 'mailchimp-for-wp'); ?>" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="mc4wp-lists-overview">
|
||||
<?php if (empty($lists)) {
|
||||
?>
|
||||
<p><?php _e('No lists were found in your Mailchimp account', 'mailchimp-for-wp'); ?>.</p>
|
||||
<?php
|
||||
} else {
|
||||
printf('<p>' . __('A total of %d lists were found in your Mailchimp account.', 'mailchimp-for-wp') . '</p>', count($lists));
|
||||
|
||||
echo '<table class="widefat striped" id="mc4wp-mailchimp-lists-overview">';
|
||||
|
||||
$headings = array(
|
||||
__('List Name', 'mailchimp-for-wp'),
|
||||
__('ID', 'mailchimp-for-wp'),
|
||||
__('Subscribers', 'mailchimp-for-wp')
|
||||
);
|
||||
|
||||
echo '<thead>';
|
||||
echo '<tr>';
|
||||
foreach ($headings as $heading) {
|
||||
echo sprintf('<th>%s</th>', $heading);
|
||||
}
|
||||
echo '</tr>';
|
||||
echo '</thead>';
|
||||
|
||||
foreach ($lists as $list) {
|
||||
echo '<tr>';
|
||||
echo sprintf('<td><a href="#" class="mc4wp-mailchimp-list" data-list-id="%s">%s</a><span class="row-actions alignright"></span></td>', esc_attr($list->id), esc_html($list->name));
|
||||
echo sprintf('<td><code>%s</code></td>', esc_html($list->id));
|
||||
echo sprintf('<td>%s</td>', esc_html($list->stats->member_count));
|
||||
echo '</tr>';
|
||||
|
||||
echo sprintf('<tr class="list-details list-%s-details" style="display: none;">', $list->id);
|
||||
echo '<td colspan="3" style="padding: 0 20px 40px;">';
|
||||
|
||||
echo sprintf('<p class="alignright" style="margin: 20px 0;"><a href="https://admin.mailchimp.com/lists/members/?id=%s" target="_blank"><span class="dashicons dashicons-edit"></span> ' . __('Edit this list in Mailchimp', 'mailchimp-for-wp') . '</a></p>', $list->web_id);
|
||||
echo '<div><div>' . __('Loading... Please wait.', 'mailchimp-for-wp') . '</div></div>';
|
||||
echo '</td>';
|
||||
echo '</tr>'; ?>
|
||||
<?php
|
||||
} // end foreach $lists
|
||||
echo '</table>';
|
||||
} // end if empty?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user