Changed source root directory

This commit is contained in:
2026-03-05 16:30:11 +01:00
parent dc85447ee1
commit 538f85d7a2
5868 changed files with 749734 additions and 99 deletions

View File

@@ -0,0 +1,35 @@
<?php defined('ABSPATH') or exit;
function _mc4wp_admin_translation_notice()
{
// show for every language other than the default
if (get_locale() === 'en_US') {
return;
}
/* translators: %s links to the WordPress.org translation project */
echo '<p class="description">' . sprintf(wp_kses(__('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! Please <a href="%s">help translate the plugin using your WordPress.org account</a>.', 'mailchimp-for-wp'), ['a' => ['href' => []]]), 'https://translate.wordpress.org/projects/wp-plugins/mailchimp-for-wp/stable/') . '</p>';
}
function _mc4wp_admin_github_notice()
{
if (strpos($_SERVER['HTTP_HOST'], 'localhost') === false && ! WP_DEBUG) {
return;
}
echo '<p class="description">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/mailchimp-for-wordpress/tree/master/sample-code-snippets">sample code snippets</a>.</p>';
}
function _mc4wp_admin_disclaimer_notice()
{
echo '<p class="description">', esc_html__('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="mc4wp-margin-l">
<?php do_action('mc4wp_admin_footer'); ?>
</div>

View File

@@ -0,0 +1,59 @@
<?php
defined('ABSPATH') or exit;
/**
* @ignore
*/
function _mc4wp_admin_sidebar_support_notice()
{
?>
<div class="mc4wp-box mc4wp-margin-m">
<h4 class="mc4wp-title"><?php echo esc_html__('Looking for help?', 'mailchimp-for-wp'); ?></h4>
<p><?php echo esc_html__('We have some resources available to help you in the right direction.', 'mailchimp-for-wp'); ?></p>
<ul class="ul-square">
<li><a href="https://www.mc4wp.com/kb/#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(wp_kses(__('If your answer can not be found in the resources listed above, please use the <a href="%s">support forums on WordPress.org</a>.', 'mailchimp-for-wp'), [ 'a' => [ 'href' => [] ] ]), 'https://wordpress.org/support/plugin/mailchimp-for-wp'); ?></p>
<p><?php echo sprintf(wp_kses(__('Found a bug? Please <a href="%s">open an issue on GitHub</a>.', 'mailchimp-for-wp'), [ 'a' => [ 'href' => [] ] ]), 'https://github.com/ibericode/mailchimp-for-wordpress/issues'); ?></p>
</div>
<?php
}
/**
* @ignore
*/
function _mc4wp_admin_sidebar_other_plugins()
{
echo '<div class="mc4wp-box mc4wp-margin-m">';
echo '<h4 class="mc4wp-title">', esc_html__('Other plugins by ibericode', 'mailchimp-for-wp'), '</h4>';
echo '<ul style="margin-bottom: 0;">';
// Koko Analytics
echo '<li style="margin: 12px 0;">';
echo '<strong><a href="https://wordpress.org/plugins/koko-analytics/">Koko Analytics</a></strong><br />';
echo esc_html__('Privacy-friendly analytics plugin that does not use any external services.', 'mailchimp-for-wp');
echo '</li>';
// Boxzilla
echo '<li style="margin: 12px 0;">';
echo '<strong><a href="https://wordpress.org/plugins/boxzilla/">Boxzilla Pop-ups</a></strong><br />';
echo esc_html__('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>';
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');

View File

@@ -0,0 +1,104 @@
<?php
/**
* @var object[] $merge_fields
* @var object[] $interest_categories
* @var object[] $marketing_permissions
*/
?>
<h3>Merge fields</h3>
<table class="widefat striped">
<thead>
<tr>
<th>Name</th>
<th>Tag</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<?php foreach ($merge_fields as $f) { ?>
<tr>
<td><?php echo esc_html($f->name); ?> <?php
if ($f->required) {
?>
<span class="mc4wp-red">*</span>
<?php } ?></td>
<td><code><?php echo esc_html($f->tag); ?></code></td>
<td>
<?php echo esc_html($f->type); ?>
<?php
if ($f->options && $f->options->date_format) {
echo esc_html('(' . $f->options->date_format . ')');
}
?>
<?php
if ($f->options && $f->options->choices) {
echo esc_html('(' . join(', ', $f->options->choices) . ')');
}
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if ($interest_categories) { ?>
<h3>Interest Categories</h3>
<table class="striped widefat">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Interests</th>
</tr>
</thead>
<tbody>
<?php foreach ($interest_categories as $f) { ?>
<tr>
<td>
<strong><?php echo esc_html($f->title); ?></strong>
<br />
<br />
ID: <code><?php echo esc_html($f->id); ?></code>
</td>
<td><?php echo esc_html($f->type); ?></td>
<td>
<table>
<thead>
<tr><th>Name</th><th>ID</th></tr>
</thead>
<tbody>
<?php foreach ($f->interests as $id => $name) { ?>
<tr>
<td><?php echo esc_html($name); ?></td>
<td><code><?php echo esc_html($id); ?></code></td>
</tr>
<?php } ?>
</tbody>
</table>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } // end if interest categories ?>
<?php if ($marketing_permissions) { ?>
<h3>Marketing Permissions</h3>
<table class="striped widefat">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<?php foreach ($marketing_permissions as $mp) { ?>
<tr>
<td><code><?php echo esc_html($mp->marketing_permission_id); ?></code></td>
<td><?php echo esc_html($mp->text); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } // end if marketing permissions ?>

View File

@@ -0,0 +1,60 @@
<h3><?php echo esc_html__('Your Mailchimp Account', 'mailchimp-for-wp'); ?></h3>
<p><?php echo esc_html__('The table below shows your Mailchimp audiences and their details. If you just applied changes to your Mailchimp account, please use the following button to renew the cache.', 'mailchimp-for-wp'); ?></p>
<div id="mc4wp-list-fetcher">
<form method="post">
<input type="hidden" name="_mc4wp_action" value="empty_lists_cache" />
<p>
<input type="submit" value="<?php echo esc_attr__('Renew Mailchimp audiences', 'mailchimp-for-wp'); ?>" class="button">
</p>
</form>
</div>
<div class="mc4wp-lists-overview">
<?php
if (empty($lists)) {
?>
<p><?php echo esc_html__('No audiences were found in your Mailchimp account', 'mailchimp-for-wp'); ?>.</p>
<?php
} else {
echo '<p>', sprintf(esc_html__('A total of %d audiences were found in your Mailchimp account.', 'mailchimp-for-wp'), count($lists)), '</p>';
echo '<table class="widefat striped" id="mc4wp-mailchimp-lists-overview">';
$headings = [
esc_html__('Audience name', 'mailchimp-for-wp'),
esc_html__('Audience ID', 'mailchimp-for-wp'),
esc_html__('# of contacts', 'mailchimp-for-wp'),
];
echo '<thead>';
echo '<tr>';
foreach ($headings as $heading) {
echo '<th>', $heading, '</th>';
}
echo '</tr>';
echo '</thead>';
echo '<tbody>';
foreach ($lists as $list) {
$attr_data_list_id = esc_attr($list->id);
$list_name = esc_html($list->name);
echo '<tr>';
echo '<td><a href="#" class="mc4wp-mailchimp-list" data-list-id="', $attr_data_list_id, '">', $list_name, '</a><span class="row-actions alignright"></span></td>';
echo '<td><code>', esc_html($list->id), '</code></td>';
echo '<td>', esc_html($list->stats->member_count), '</td>';
echo '</tr>';
echo '<tr class="list-details list-', $list->id, '-details" style="display: none;">';
echo '<td colspan="3" style="padding: 0 20px 40px;">';
echo '<p class="alignright" style="margin: 20px 0;"><a href="https://admin.mailchimp.com/audience/contacts/?id=', $list->web_id, '" target="_blank"><span class="dashicons dashicons-edit"></span> ', esc_html__('Edit this audience in Mailchimp', 'mailchimp-for-wp'), '</a></p>';
echo '<div><div>', esc_html__('Loading... Please wait.', 'mailchimp-for-wp'), '</div></div>';
echo '</td>';
echo '</tr>';
?>
<?php
} // end foreach $lists
echo '</tbody>';
echo '</table>';
} // end if empty
?>
</div>