Modularización de GKACHELE SaaS
This commit is contained in:
7
wp-content/plugins/akismet/views/activate.php
Normal file
7
wp-content/plugins/akismet/views/activate.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'setup' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'enter' ); ?>
|
||||
</div>
|
||||
126
wp-content/plugins/akismet/views/compatible-plugins.php
Normal file
126
wp-content/plugins/akismet/views/compatible-plugins.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
/** @var array|WP_Error $compatible_plugins */
|
||||
$bypass_cache = ! empty( $_GET['akismet_refresh_compatible_plugins'] );
|
||||
$compatible_plugins = Akismet_Compatible_Plugins::get_installed_compatible_plugins( $bypass_cache );
|
||||
if ( is_array( $compatible_plugins ) ) :
|
||||
|
||||
$compatible_plugin_count = count( $compatible_plugins );
|
||||
?>
|
||||
<div class="akismet-card akismet-compatible-plugins">
|
||||
<div class="akismet-section-header">
|
||||
<h2 class="akismet-section-header__label akismet-compatible-plugins__section-header-label" aria-label="<?php esc_attr_e( 'Compatible plugins (new feature)', 'akismet' ); ?>">
|
||||
<span class="akismet-compatible-plugins__section-header-label-text"><?php esc_html_e( 'Compatible plugins', 'akismet' ); ?></span>
|
||||
<span class="akismet-new-feature"><?php esc_html_e( 'New', 'akismet' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="akismet-compatible-plugins__content">
|
||||
<?php
|
||||
|
||||
echo '<p>';
|
||||
echo esc_html( __( 'Akismet works with other plugins to keep spam away.', 'akismet' ) );
|
||||
echo '</p>';
|
||||
|
||||
echo '<p>';
|
||||
|
||||
if ( 0 === $compatible_plugin_count ) {
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/developers/plugins-and-libraries/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=compatible_plugins">';
|
||||
echo esc_html( __( 'See supported integrations', 'akismet' ) );
|
||||
echo '</a>';
|
||||
} else {
|
||||
echo esc_html(
|
||||
_n(
|
||||
"This plugin you've installed is compatible. Follow the documentation link to get started.",
|
||||
"These plugins you've installed are compatible. Follow the documentation links to get started.",
|
||||
$compatible_plugin_count,
|
||||
'akismet'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
echo '</p>';
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( ! empty( $compatible_plugins ) ) : ?>
|
||||
<ul class="akismet-compatible-plugins__list" id="akismet-compatible-plugins__list">
|
||||
<?php
|
||||
|
||||
foreach ( $compatible_plugins as $compatible_plugin ) :
|
||||
if ( empty( $compatible_plugin['help_url'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="akismet-compatible-plugins__card">
|
||||
<?php if ( strlen( $compatible_plugin['logo'] ) > 0 ) : ?>
|
||||
<?php
|
||||
|
||||
$logo_alt = sprintf(
|
||||
/* translators: The placeholder is the name of a plugin, like "Jetpack" . */
|
||||
__( '%s logo', 'akismet' ),
|
||||
$compatible_plugin['name']
|
||||
);
|
||||
|
||||
?>
|
||||
<img
|
||||
src="<?php echo esc_url( $compatible_plugin['logo'] ); ?>"
|
||||
alt="<?php echo esc_attr( $logo_alt ); ?>"
|
||||
class="akismet-compatible-plugins__card-logo"
|
||||
width="55"
|
||||
height="55"
|
||||
/>
|
||||
<?php endif ?>
|
||||
<div class="akismet-compatible-plugins__card-detail">
|
||||
<h3 class="akismet-compatible-plugins__card-title"><?php echo esc_html( $compatible_plugin['name'] ); ?></h3>
|
||||
<div class="akismet-compatible-plugins__docs">
|
||||
<a
|
||||
class="akismet-external-link"
|
||||
href="<?php echo esc_url( $compatible_plugin['help_url'] ); ?>"
|
||||
aria-label="
|
||||
<?php
|
||||
|
||||
echo esc_attr(
|
||||
sprintf(
|
||||
/* translators: The placeholder is the name of a plugin, like "Jetpack" . */
|
||||
__( 'Documentation for %s', 'akismet' ),
|
||||
$compatible_plugin['name']
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
"><?php esc_html_e( 'View documentation', 'akismet' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?php if ( $compatible_plugin_count > Akismet_Compatible_Plugins::DEFAULT_VISIBLE_PLUGIN_COUNT ) : ?>
|
||||
<button class="akismet-compatible-plugins__show-more"
|
||||
aria-expanded="false"
|
||||
aria-controls="akismet-compatible-plugins__list"
|
||||
data-label-closed="
|
||||
<?php
|
||||
|
||||
/* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
|
||||
echo esc_attr( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
|
||||
|
||||
?>
|
||||
"
|
||||
data-label-open="<?php echo esc_attr( __( 'Show less', 'akismet' ) ); ?>">
|
||||
<?php
|
||||
|
||||
/* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
|
||||
echo esc_html( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
|
||||
|
||||
?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
325
wp-content/plugins/akismet/views/config.php
Normal file
325
wp-content/plugins/akismet/views/config.php
Normal file
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
$kses_allow_link_href = array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
),
|
||||
);
|
||||
?>
|
||||
<div id="akismet-plugin-container">
|
||||
<div class="akismet-masthead">
|
||||
<div class="akismet-masthead__inside-container">
|
||||
<?php Akismet::view( 'logo' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="akismet-lower">
|
||||
<?php if ( Akismet::get_api_key() ) { ?>
|
||||
<?php Akismet_Admin::display_status(); ?>
|
||||
<?php } ?>
|
||||
<?php if ( ! empty( $notices ) ) { ?>
|
||||
<?php foreach ( $notices as $notice ) { ?>
|
||||
<?php Akismet::view( 'notice', array_merge( $notice, array( 'parent_view' => $name ) ) ); ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( isset( $stat_totals['all'] ) && isset( $stat_totals['6-months'] ) ) : ?>
|
||||
<div class="akismet-card">
|
||||
<div class="akismet-section-header">
|
||||
<h2 class="akismet-section-header__label">
|
||||
<span><?php esc_html_e( 'Statistics', 'akismet' ); ?></span>
|
||||
</h2>
|
||||
|
||||
<div class="akismet-section-header__actions">
|
||||
<a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
|
||||
<?php esc_html_e( 'Detailed stats', 'akismet' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div> <!-- close akismet-section-header -->
|
||||
|
||||
<div class="akismet-new-snapshot">
|
||||
<?php /* name attribute on iframe is used as a cache-buster here to force Firefox to load the new style charts: https://bugzilla.mozilla.org/show_bug.cgi?id=356558 */ ?>
|
||||
<div class="akismet-new-snapshot__chart">
|
||||
<iframe id="stats-iframe" allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/snapshot.php?blog=%s&token=%s&height=200&locale=%s&is_redecorated=1', rawurlencode( get_option( 'home' ) ), rawurlencode( Akismet::get_access_token() ), get_user_locale() ) ); ?>" name="<?php echo esc_attr( 'snapshot-' . filemtime( __FILE__ ) ); ?>" title="<?php echo esc_attr__( 'Akismet stats', 'akismet' ); ?>"></iframe>
|
||||
</div>
|
||||
|
||||
<ul class="akismet-new-snapshot__list">
|
||||
<li class="akismet-new-snapshot__item">
|
||||
<h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'Past six months', 'akismet' ); ?></h3>
|
||||
<span class="akismet-new-snapshot__number"><?php echo number_format( $stat_totals['6-months']->spam ); ?></span>
|
||||
<span class="akismet-new-snapshot__text"><?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?></span>
|
||||
</li>
|
||||
<li class="akismet-new-snapshot__item">
|
||||
<h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'All time', 'akismet' ); ?></h3>
|
||||
<span class="akismet-new-snapshot__number"><?php echo number_format( $stat_totals['all']->spam ); ?></span>
|
||||
<span class="akismet-new-snapshot__text"><?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?></span>
|
||||
</li>
|
||||
<li class="akismet-new-snapshot__item">
|
||||
<h3 class="akismet-new-snapshot__header"><?php esc_html_e( 'Accuracy', 'akismet' ); ?></h3>
|
||||
<span class="akismet-new-snapshot__number"><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
|
||||
<span class="akismet-new-snapshot__text">
|
||||
<?php
|
||||
/* translators: %s: number of spam missed by Akismet */
|
||||
echo esc_html( sprintf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ) ) . ', ';
|
||||
/* translators: %s: number of false positive spam flagged by Akismet */
|
||||
echo esc_html( sprintf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ) );
|
||||
?>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div> <!-- close akismet-new-snapshot -->
|
||||
</div> <!-- close akismet-card -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( apply_filters( 'akismet_show_compatible_plugins', true ) ) : ?>
|
||||
<?php Akismet::view( 'compatible-plugins' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $akismet_user ) : ?>
|
||||
<div class="akismet-card">
|
||||
<div class="akismet-section-header">
|
||||
<h2 class="akismet-section-header__label">
|
||||
<span><?php esc_html_e( 'Settings', 'akismet' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="inside">
|
||||
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" autocomplete="off" method="POST" id="akismet-settings-form">
|
||||
|
||||
<div class="akismet-settings">
|
||||
<?php if ( ! Akismet::predefined_api_key() ) : ?>
|
||||
<div class="akismet-settings__row">
|
||||
<h3 class="akismet-settings__row-title">
|
||||
<label class="akismet-settings__row-label" for="key"><?php esc_html_e( 'API key', 'akismet' ); ?></label>
|
||||
</h3>
|
||||
<div class="akismet-settings__row-input">
|
||||
<span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option( 'wordpress_api_key' ) ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
//phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
if ( isset( $_GET['ssl_status'] ) ) :
|
||||
?>
|
||||
<div class="akismet-settings__row">
|
||||
<div class="akismet-settings__row-text">
|
||||
<h3 class="akismet-settings__row-title"><?php esc_html_e( 'SSL status', 'akismet' ); ?></h3>
|
||||
<div class="akismet-settings__row-description">
|
||||
<?php if ( ! wp_http_supports( array( 'ssl' ) ) ) : ?>
|
||||
<strong><?php esc_html_e( 'Disabled.', 'akismet' ); ?></strong>
|
||||
<?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?>
|
||||
<?php else : ?>
|
||||
<?php $ssl_disabled = get_option( 'akismet_ssl_disabled' ); ?>
|
||||
|
||||
<?php if ( $ssl_disabled ) : ?>
|
||||
<strong><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></strong>
|
||||
<?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?>
|
||||
<?php else : ?>
|
||||
<strong><?php esc_html_e( 'Enabled.', 'akismet' ); ?></strong>
|
||||
<?php esc_html_e( 'All systems functional.', 'akismet' ); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="akismet-settings__row">
|
||||
<div class="akismet-settings__row-text">
|
||||
<h3 class="akismet-settings__row-title"><?php esc_html_e( 'Comments', 'akismet' ); ?></h3>
|
||||
</div>
|
||||
<div class="akismet-settings__row-input">
|
||||
<label class="akismet-settings__row-input-label" for="akismet_show_user_comments_approved">
|
||||
<input
|
||||
name="akismet_show_user_comments_approved"
|
||||
id="akismet_show_user_comments_approved"
|
||||
value="1"
|
||||
type="checkbox"
|
||||
<?php
|
||||
// If the option isn't set, or if it's enabled ('1'), or if it was enabled a long time ago ('true'), check the checkbox.
|
||||
checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
|
||||
?>
|
||||
/>
|
||||
<span class="akismet-settings__row-label-text">
|
||||
<?php esc_html_e( 'Show the number of approved comments beside each comment author.', 'akismet' ); ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="akismet-settings__row is-radio">
|
||||
<div class="akismet-settings__row-text">
|
||||
<h3 class="akismet-settings__row-title"><?php esc_html_e( 'Spam filtering', 'akismet' ); ?></h3>
|
||||
</div>
|
||||
<div class="akismet-settings__row-input">
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e( 'Akismet Anti-spam strictness', 'akismet' ); ?></span>
|
||||
</legend>
|
||||
<div>
|
||||
<label class="akismet-settings__row-input-label" for="akismet_strictness_1">
|
||||
<input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
|
||||
<span class="akismet-settings__row-label-text">
|
||||
<?php esc_html_e( 'Silently discard the worst and most pervasive spam so I never see it.', 'akismet' ); ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="akismet-settings__row-input-label" for="akismet_strictness_0">
|
||||
<input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( true, get_option( 'akismet_strictness' ) !== '1' ); ?> />
|
||||
<span class="akismet-settings__row-label-text">
|
||||
<?php esc_html_e( 'Always put spam in the Spam folder for review.', 'akismet' ); ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="akismet-settings__row-note">
|
||||
<strong><?php esc_html_e( 'Note:', 'akismet' ); ?></strong>
|
||||
<?php
|
||||
$delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
|
||||
|
||||
$spam_folder_link = sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
esc_url( admin_url( 'edit-comments.php?comment_status=spam' ) ),
|
||||
esc_html__( 'spam folder', 'akismet' )
|
||||
);
|
||||
|
||||
// The _n() needs to be on one line so the i18n tooling can extract the translator comment.
|
||||
/* translators: %1$s: spam folder link, %2$d: delete interval in days */
|
||||
$delete_message = _n( 'Spam in the %1$s older than %2$d day is deleted automatically.', 'Spam in the %1$s older than %2$d days is deleted automatically.', $delete_interval, 'akismet' );
|
||||
|
||||
printf(
|
||||
wp_kses( $delete_message, $kses_allow_link_href ),
|
||||
wp_kses( $spam_folder_link, $kses_allow_link_href ),
|
||||
esc_html( $delete_interval )
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="akismet-settings__row is-radio">
|
||||
<div class="akismet-settings__row-text">
|
||||
<h3 class="akismet-settings__row-title"><?php esc_html_e( 'Privacy', 'akismet' ); ?></h3>
|
||||
</div>
|
||||
<div class="akismet-settings__row-input">
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e( 'Akismet privacy notice', 'akismet' ); ?></span>
|
||||
</legend>
|
||||
<div>
|
||||
<label class="akismet-settings__row-input-label" for="akismet_comment_form_privacy_notice_display">
|
||||
<input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_display" value="display" <?php checked( 'display', get_option( 'akismet_comment_form_privacy_notice' ) ); ?> />
|
||||
<span class="akismet-settings__row-label-text">
|
||||
<?php esc_html_e( 'Display a privacy notice under your comment forms.', 'akismet' ); ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="akismet-settings__row-input-label" for="akismet_comment_form_privacy_notice_hide">
|
||||
<input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_hide" value="hide" <?php echo in_array( get_option( 'akismet_comment_form_privacy_notice' ), array( 'display', 'hide' ), true ) ? checked( 'hide', get_option( 'akismet_comment_form_privacy_notice' ), false ) : 'checked="checked"'; ?> />
|
||||
<span class="akismet-settings__row-label-text">
|
||||
<?php esc_html_e( 'Do not display privacy notice.', 'akismet' ); ?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="akismet-settings__row-note">
|
||||
<?php esc_html_e( 'To help your site with transparency under privacy laws like the GDPR, Akismet can display a notice to your users under your comment forms.', 'akismet' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="akismet-card-actions">
|
||||
<?php if ( ! Akismet::predefined_api_key() ) : ?>
|
||||
<div id="delete-action" class="akismet-card-actions__secondary-action">
|
||||
<a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e( 'Disconnect this account', 'akismet' ); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
||||
|
||||
<div id="publishing-action">
|
||||
<input type="hidden" name="action" value="enter-key">
|
||||
<input type="submit" name="submit" id="submit" class="akismet-button akismet-could-be-primary" value="<?php esc_attr_e( 'Save changes', 'akismet' ); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( ! Akismet::predefined_api_key() ) : ?>
|
||||
<div class="akismet-card">
|
||||
<div class="akismet-section-header">
|
||||
<h2 class="akismet-section-header__label">
|
||||
<span><?php esc_html_e( 'Account', 'akismet' ); ?></span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="inside">
|
||||
<table class="akismet-account">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Subscription type', 'akismet' ); ?></th>
|
||||
<td>
|
||||
<?php echo esc_html( $akismet_user->account_name ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Status', 'akismet' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
if ( Akismet::USER_STATUS_CANCELLED === $akismet_user->status ) :
|
||||
esc_html_e( 'Cancelled', 'akismet' );
|
||||
elseif ( Akismet::USER_STATUS_SUSPENDED === $akismet_user->status ) :
|
||||
esc_html_e( 'Suspended', 'akismet' );
|
||||
elseif ( Akismet::USER_STATUS_MISSING === $akismet_user->status ) :
|
||||
esc_html_e( 'Missing', 'akismet' );
|
||||
elseif ( Akismet::USER_STATUS_NO_SUB === $akismet_user->status ) :
|
||||
esc_html_e( 'No subscription found', 'akismet' );
|
||||
else :
|
||||
esc_html_e( 'Active', 'akismet' );
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( $akismet_user->next_billing_date ) : ?>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Next billing date', 'akismet' ); ?></th>
|
||||
<td>
|
||||
<?php echo esc_html( gmdate( 'F j, Y', $akismet_user->next_billing_date ) ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="akismet-card-actions">
|
||||
<?php if ( $akismet_user->status === Akismet::USER_STATUS_ACTIVE ) : ?>
|
||||
<div class="akismet-card-actions__secondary-action">
|
||||
<a href="https://akismet.com/account?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=account_overview" class="akismet-external-link" aria-label="Account overview on akismet.com"><?php esc_html_e( 'Account overview', 'akismet' ); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div id="publishing-action">
|
||||
<?php
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === Akismet::USER_STATUS_ACTIVE ? __( 'Upgrade', 'akismet' ) : __( 'Change', 'akismet' ) ),
|
||||
'redirect' => 'upgrade',
|
||||
'utm_content' => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === Akismet::USER_STATUS_ACTIVE ? 'config_upgrade' : 'config_change' ),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
14
wp-content/plugins/akismet/views/connect-jp.php
Normal file
14
wp-content/plugins/akismet/views/connect-jp.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
declare( strict_types = 1 );
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
?>
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'setup', array( 'use_jetpack_connection' => true ) ); ?>
|
||||
<?php Akismet::view( 'setup-jetpack', array( 'akismet_user' => $akismet_user ) ); ?>
|
||||
</div>
|
||||
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'enter' ); ?>
|
||||
</div>
|
||||
14
wp-content/plugins/akismet/views/enter.php
Normal file
14
wp-content/plugins/akismet/views/enter.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<div class="akismet-enter-api-key-box centered">
|
||||
<button class="akismet-enter-api-key-box__reveal"><?php esc_html_e( 'Manually enter an API key', 'akismet' ); ?></button>
|
||||
<div class="akismet-enter-api-key-box__form-wrapper">
|
||||
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
|
||||
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
||||
<input type="hidden" name="action" value="enter-key">
|
||||
<h3 class="akismet-enter-api-key-box__header" id="akismet-enter-api-key-box__header"><?php esc_html_e( 'Enter your API key', 'akismet' ); ?></h3>
|
||||
<div class="akismet-enter-api-key-box__input-wrapper">
|
||||
<input id="key" name="key" type="text" size="15" value="" placeholder="<?php esc_attr_e( 'API key', 'akismet' ); ?>" class="akismet-enter-api-key-box__key-input regular-text code" aria-labelledby="akismet-enter-api-key-box__header">
|
||||
<input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' ); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
32
wp-content/plugins/akismet/views/get.php
Normal file
32
wp-content/plugins/akismet/views/get.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
$submit_classes_attr = 'akismet-button';
|
||||
|
||||
if ( isset( $classes ) && ( is_countable( $classes ) ? count( $classes ) : 0 ) > 0 ) {
|
||||
$submit_classes_attr = implode( ' ', $classes );
|
||||
}
|
||||
|
||||
$query_args = array(
|
||||
'passback_url' => Akismet_Admin::get_page_url(),
|
||||
'redirect' => isset( $redirect ) ? $redirect : 'plugin-signup',
|
||||
);
|
||||
|
||||
// Set default UTM parameters, overriding with any provided values.
|
||||
$utm_args = array(
|
||||
'utm_source' => isset( $utm_source ) ? $utm_source : 'akismet_plugin',
|
||||
'utm_medium' => isset( $utm_medium ) ? $utm_medium : 'in_plugin',
|
||||
'utm_campaign' => isset( $utm_campaign ) ? $utm_campaign : 'plugin_static_link',
|
||||
'utm_content' => isset( $utm_content ) ? $utm_content : 'get_view_link',
|
||||
);
|
||||
|
||||
$query_args = array_merge( $query_args, $utm_args );
|
||||
|
||||
$url = add_query_arg( $query_args, 'https://akismet.com/get/' );
|
||||
?>
|
||||
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $submit_classes_attr ); ?>" target="_blank">
|
||||
<?php echo esc_html( is_string( $text ) ? $text : '' ); ?>
|
||||
<span class="screen-reader-text"><?php esc_html_e( '(opens in a new tab)', 'akismet' ); ?></span>
|
||||
</a>
|
||||
13
wp-content/plugins/akismet/views/logo.php
Normal file
13
wp-content/plugins/akismet/views/logo.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
?>
|
||||
<div class="akismet-masthead__logo-container">
|
||||
<?php if ( isset( $include_logo_link ) && $include_logo_link === true ) : ?>
|
||||
<a href="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" class="akismet-masthead__logo-link">
|
||||
<?php endif; ?>
|
||||
<img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/akismet-refresh-logo@2x.png', __FILE__ ) ); ?>" srcset="<?php echo esc_url( plugins_url( '../_inc/img/akismet-refresh-logo.svg', __FILE__ ) ); ?>" alt="Akismet logo" />
|
||||
<?php if ( isset( $include_logo_link ) && $include_logo_link === true ) : ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
379
wp-content/plugins/akismet/views/notice.php
Normal file
379
wp-content/plugins/akismet/views/notice.php
Normal file
@@ -0,0 +1,379 @@
|
||||
<?php
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
$kses_allow_link = array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
'class' => true,
|
||||
),
|
||||
);
|
||||
$kses_allow_strong = array( 'strong' => true );
|
||||
|
||||
if ( ! isset( $type ) ) {
|
||||
$type = false; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
}
|
||||
|
||||
/*
|
||||
* Some notices (plugin, spam-check, spam-check-cron-disabled, alert and usage-limit) are also shown elsewhere in wp-admin, so have different classes applied so that they match the standard WordPress notice format.
|
||||
*/
|
||||
?>
|
||||
<?php if ( $type === 'plugin' ) : ?>
|
||||
<?php // Displayed on edit-comments.php to users who have not set up Akismet yet. ?>
|
||||
<div class="updated" id="akismet-setup-prompt">
|
||||
<form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
|
||||
<div class="akismet-activate">
|
||||
<input type="submit" class="akismet-activate__button akismet-button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" />
|
||||
<div class="akismet-activate__description">
|
||||
<?php esc_html_e( 'Almost done! Configure Akismet and say goodbye to spam', 'akismet' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php elseif ( $type === 'spam-check' ) : ?>
|
||||
<?php // This notice is only displayed on edit-comments.php. ?>
|
||||
<div class="notice notice-warning">
|
||||
<p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' ); ?></strong></p>
|
||||
<p><?php esc_html_e( 'Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation and will automatically be rechecked later.', 'akismet' ); ?></p>
|
||||
<?php if ( ! empty( $link_text ) ) : ?>
|
||||
<p><?php echo wp_kses( $link_text, $kses_allow_link ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'spam-check-cron-disabled' ) : ?>
|
||||
<?php // This notice is only displayed on edit-comments.php. ?>
|
||||
<div class="notice notice-warning">
|
||||
<p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' ); ?></strong></p>
|
||||
<p><?php esc_html_e( 'WP-Cron has been disabled using the DISABLE_WP_CRON constant. Comment rechecks may not work properly.', 'akismet' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'alert' && $code === Akismet::ALERT_CODE_COMMERCIAL && isset( $parent_view ) && $parent_view === 'config' ) : ?>
|
||||
<?php // Display a different commercial warning alert on the config page ?>
|
||||
<div class="akismet-card akismet-alert is-commercial">
|
||||
<div>
|
||||
<h3 class="akismet-alert-header"><?php esc_html_e( 'We detected commercial activity on your site', 'akismet' ); ?></h3>
|
||||
<p class="akismet-alert-info">
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Your current subscription is for <a class="akismet-external-link" href="%s">personal, non-commercial use</a>. Please upgrade your plan to continue using Akismet.', 'akismet' ), esc_url( 'https://akismet.com/support/getting-started/free-or-paid/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=commercial_support' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
<p class="akismet-alert-info">
|
||||
<?php
|
||||
/* translators: The placeholder is a URL to the contact form. */
|
||||
echo wp_kses( sprintf( __( 'If you believe your site should not be classified as commercial, <a class="akismet-external-link" href="%s">please get in touch</a>', 'akismet' ), esc_url( 'https://akismet.com/contact/?purpose=commercial&utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=commercial_contact' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="akismet-alert-button-wrapper">
|
||||
<?php
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => __( 'Upgrade plan', 'akismet' ),
|
||||
'classes' => array( 'akismet-alert-button', 'akismet-button' ),
|
||||
'redirect' => 'upgrade',
|
||||
'utm_content' => 'commercial_upgrade',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'alert' ) : ?>
|
||||
<div class="<?php echo isset( $parent_view ) && $parent_view === 'config' ? 'akismet-alert is-bad' : 'error'; ?>">
|
||||
<?php /* translators: The placeholder is an error code returned by Akismet. */ ?>
|
||||
<p><strong><?php printf( esc_html__( 'Akismet error code: %s', 'akismet' ), esc_html( $code ) ); ?></strong></p>
|
||||
<p><?php echo isset( $msg ) ? esc_html( $msg ) : ''; ?></p>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */
|
||||
__( 'For more information, see the <a class="akismet-external-link" href="%s">error documentation on akismet.com</a>', 'akismet' ),
|
||||
esc_url( 'https://akismet.com/developers/detailed-docs/errors/akismet-error-' . absint( $code ) . '?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=error_info' )
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'notice' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php echo wp_kses( $notice_header, Akismet_Admin::get_notice_kses_allowed_elements() ); ?></h3>
|
||||
<p>
|
||||
<?php echo wp_kses( $notice_text, Akismet_Admin::get_notice_kses_allowed_elements() ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'missing-functions' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'Network functions are disabled.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses( __( 'Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> function.', 'akismet' ), array_merge( $kses_allow_link, $kses_allow_strong, array( 'code' => true ) ) );
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Please contact your web host or firewall administrator and give them <a class="akismet-external-link" href="%s" target="_blank">this information about Akismet’s system requirements</a>', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=hosting_faq_php' ) ), array_merge( $kses_allow_link, $kses_allow_strong, array( 'code' => true ) ) );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'servers-be-down' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'Your site can’t connect to the Akismet servers.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Your firewall may be blocking Akismet from connecting to its API. Please contact your host and refer to <a class="akismet-external-link" href="%s" target="_blank">our guide about firewalls</a>', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=hosting_faq_firewall' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'active-dunning' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'Please update your payment information.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'We cannot process your payment. Please <a class="akismet-external-link" href="%s" target="_blank">update your payment details</a>', 'akismet' ), esc_url( 'https://wordpress.com/me/purchases/payment-methods?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=payment_update' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'cancelled' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'Your Akismet plan has been cancelled.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Please visit <a class="akismet-external-link" href="%s" target="_blank">Akismet.com</a> to purchase a new subscription.', 'akismet' ), esc_url( 'https://akismet.com/pricing/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=pricing_cancelled' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'suspended' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'Your Akismet subscription is suspended.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Please contact <a class="akismet-external-link" href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=support_suspended' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'active-notice' && $time_saved ) : ?>
|
||||
<div class="akismet-alert is-neutral">
|
||||
<h3 class="akismet-alert__heading"><?php echo esc_html( $time_saved ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: the placeholder is a clickable URL to the Akismet account upgrade page. */
|
||||
echo wp_kses( sprintf( __( 'You can help us fight spam and upgrade your account by <a class="akismet-external-link" href="%s" target="_blank">contributing a token amount</a>', 'akismet' ), esc_url( 'https://akismet.com/pricing?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=upgrade_contribution' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'missing' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'There is a problem with your API key.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL to the Akismet contact form. */
|
||||
echo wp_kses( sprintf( __( 'Please contact <a class="akismet-external-link" href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=support_missing' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'no-sub' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'You don’t have an Akismet plan.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: the placeholder is the URL to the Akismet pricing page. */
|
||||
echo wp_kses( sprintf( __( 'Please <a class="akismet-external-link" href="%s" target="_blank">choose a free or paid plan</a> so Akismet can protect your site from spam.', 'akismet' ), esc_url( 'https://akismet.com/pricing?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=choose_plan' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
<p><?php echo esc_html__( 'Once you\'ve chosen a plan, return here to complete your setup.', 'akismet' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'new-key-valid' ) : ?>
|
||||
<?php
|
||||
global $wpdb;
|
||||
|
||||
$check_pending_link = false;
|
||||
|
||||
$at_least_one_comment_in_moderation = ! ! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" );
|
||||
|
||||
if ( $at_least_one_comment_in_moderation ) {
|
||||
$check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );
|
||||
}
|
||||
?>
|
||||
<div class="akismet-alert is-good">
|
||||
<p><?php esc_html_e( 'Akismet is now protecting your site from spam.', 'akismet' ); ?></p>
|
||||
<?php if ( $check_pending_link ) : ?>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL for checking pending comments. */
|
||||
__( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ),
|
||||
esc_url( $check_pending_link )
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'new-key-invalid' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<p><?php esc_html_e( 'The key you entered is invalid. Please double-check it.', 'akismet' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === Akismet_Admin::NOTICE_EXISTING_KEY_INVALID ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php echo esc_html( __( 'Your API key is no longer valid.', 'akismet' ) ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL to the Akismet contact form. */
|
||||
__( 'Please enter a new key or <a class="akismet-external-link" href="%s" target="_blank">contact Akismet support</a>', 'akismet' ),
|
||||
'https://akismet.com/contact/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=support_invalid_key'
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'new-key-failed' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'The API key you entered could not be verified.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL. */
|
||||
__( 'The connection to akismet.com could not be established. Please refer to <a class="akismet-external-link" href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet' ),
|
||||
'https://akismet.com/akismet-hosting-faq/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=hosting_faq'
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'usage-limit' && isset( Akismet::$limit_notices[ $code ] ) ) : ?>
|
||||
<div class="error akismet-usage-limit-alert">
|
||||
<div class="akismet-usage-limit-logo">
|
||||
<img src="<?php echo esc_url( plugins_url( '../_inc/img/logo-a-2x.png', __FILE__ ) ); ?>" alt="Akismet logo" />
|
||||
</div>
|
||||
<div class="akismet-usage-limit-text">
|
||||
<h3>
|
||||
<?php
|
||||
switch ( Akismet::$limit_notices[ $code ] ) {
|
||||
case 'FIRST_MONTH_OVER_LIMIT':
|
||||
case 'SECOND_MONTH_OVER_LIMIT':
|
||||
esc_html_e( 'Your Akismet account usage is over your plan’s limit', 'akismet' );
|
||||
break;
|
||||
case 'THIRD_MONTH_APPROACHING_LIMIT':
|
||||
esc_html_e( 'Your Akismet account usage is approaching your plan’s limit', 'akismet' );
|
||||
break;
|
||||
case 'THIRD_MONTH_OVER_LIMIT':
|
||||
case 'FOUR_PLUS_MONTHS_OVER_LIMIT':
|
||||
esc_html_e( 'Your account has been restricted', 'akismet' );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
?>
|
||||
</h3>
|
||||
<p>
|
||||
<?php
|
||||
switch ( Akismet::$limit_notices[ $code ] ) {
|
||||
case 'FIRST_MONTH_OVER_LIMIT':
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
/* translators: The first placeholder is a date, the second is a (formatted) number, the third is another formatted number. */
|
||||
__( 'Since %1$s, your account made %2$s API calls, compared to your plan’s limit of %3$s.', 'akismet' ),
|
||||
esc_html( gmdate( 'F' ) . ' 1' ),
|
||||
number_format( $api_calls ),
|
||||
number_format( $usage_limit )
|
||||
)
|
||||
);
|
||||
echo ' ';
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
case 'SECOND_MONTH_OVER_LIMIT':
|
||||
echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Increase your limit to make sure your site stays protected from spam.', 'akismet' ) );
|
||||
echo ' ';
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
case 'THIRD_MONTH_APPROACHING_LIMIT':
|
||||
echo esc_html( __( 'Your Akismet usage is nearing your plan’s limit for the third consecutive month. We will restrict your account after you reach the limit. Increase your limit to make sure your site stays protected from spam.', 'akismet' ) );
|
||||
echo ' ';
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
case 'THIRD_MONTH_OVER_LIMIT':
|
||||
case 'FOUR_PLUS_MONTHS_OVER_LIMIT':
|
||||
echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for three consecutive months. We have restricted your account for the rest of the month. Increase your limit to make sure your site stays protected from spam.', 'akismet' ) );
|
||||
echo ' ';
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="akismet-usage-limit-cta">
|
||||
<a href="<?php echo esc_attr( $upgrade_url . ( strpos( $upgrade_url, '?' ) !== false ? '&' : '?' ) . 'utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_upgrade' ); ?>" class="button" target="_blank">
|
||||
<?php
|
||||
if ( isset( $upgrade_via_support ) && $upgrade_via_support ) {
|
||||
// Direct user to contact support.
|
||||
esc_html_e( 'Contact Akismet support', 'akismet' );
|
||||
} elseif ( ! empty( $upgrade_type ) && 'qty' === $upgrade_type ) {
|
||||
// If a qty upgrade is required, use recommended plan name if available.
|
||||
if ( ! empty( $recommended_plan_name ) && is_string( $recommended_plan_name ) ) {
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
/* translators: The placeholder is the name of an Akismet subscription plan, like "Akismet Pro" or "Akismet Business" . */
|
||||
__( 'Add an %s subscription', 'akismet' ),
|
||||
$recommended_plan_name
|
||||
)
|
||||
);
|
||||
} else {
|
||||
esc_html_e( 'Increase your limit', 'akismet' );
|
||||
}
|
||||
} else {
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
/* translators: The placeholder is the name of a subscription level, like "Akismet Business" or "Akismet Enterprise" . */
|
||||
__( 'Upgrade to %s', 'akismet' ),
|
||||
$upgrade_plan
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
11
wp-content/plugins/akismet/views/predefined.php
Normal file
11
wp-content/plugins/akismet/views/predefined.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="akismet-box">
|
||||
<h2><?php esc_html_e( 'Manual Configuration', 'akismet' ); ?></h2>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
/* translators: %s is the wp-config.php file */
|
||||
printf( esc_html__( 'An Akismet API key has been defined in the %s file for this site.', 'akismet' ), '<code>wp-config.php</code>' );
|
||||
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
97
wp-content/plugins/akismet/views/setup-jetpack.php
Normal file
97
wp-content/plugins/akismet/views/setup-jetpack.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
declare( strict_types = 1 );
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
$user_status = $akismet_user->status ?? null;
|
||||
?>
|
||||
<div class="akismet-setup__connection">
|
||||
<?php if ( ! empty( $akismet_user->user_email ) && ! empty( $akismet_user->user_login ) ) : ?>
|
||||
<div class="akismet-setup__connection-user">
|
||||
<div class="akismet-setup__connection-avatar">
|
||||
<?php
|
||||
// Decorative avatar; empty alt for screen readers.
|
||||
echo get_avatar(
|
||||
$akismet_user->user_email,
|
||||
48,
|
||||
'',
|
||||
'',
|
||||
array(
|
||||
'class' => 'akismet-setup__connection-avatar-image',
|
||||
'alt' => '',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<div class="akismet-setup__connection-account">
|
||||
<div class="akismet-setup__connection-account-name">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s is the WordPress.com username */
|
||||
esc_html__( 'Signed in as %s', 'akismet' ),
|
||||
'<strong>' . esc_html( $akismet_user->user_login ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<div class="akismet-setup__connection-account-email"><?php echo esc_html( $akismet_user->user_email ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="akismet-setup__connection-action">
|
||||
<?php if ( in_array( $user_status, array( Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_NO_SUB ) ) ) : ?>
|
||||
|
||||
<p class="akismet-setup__connection-action-intro">
|
||||
<?php esc_html_e( "Your Jetpack account is connected, but it doesn't have an active Akismet subscription yet. To continue, please choose a plan on Akismet.com.", 'akismet' ); ?>
|
||||
</p>
|
||||
|
||||
<a href="https://akismet.com/get?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=jetpack_flow_<?php echo esc_attr( str_replace( '-', '_', $user_status ) ); ?>" class="akismet-setup__connection-button akismet-button">
|
||||
<?php esc_html_e( 'Choose a plan on Akismet.com', 'akismet' ); ?>
|
||||
</a>
|
||||
|
||||
<p class="akismet-setup__connection-action-description">
|
||||
<?php esc_html_e( "Once you've chosen a plan, return here to complete your setup.", 'akismet' ); ?>
|
||||
</p>
|
||||
|
||||
<?php elseif ( $user_status === Akismet::USER_STATUS_SUSPENDED ) : ?>
|
||||
<p class="akismet-setup__connection-action-intro">
|
||||
<?php esc_html_e( "Your Akismet account appears to be suspended. This sometimes happens if there's a billing or verification issue. Please contact our support team so we can help you get it sorted.", 'akismet' ); ?>
|
||||
</p>
|
||||
|
||||
<a href="https://akismet.com/contact?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=jetpack_flow_suspended" class="akismet-setup__connection-button akismet-button">
|
||||
<?php esc_html_e( 'Contact support', 'akismet' ); ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate">
|
||||
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key ); ?>"/>
|
||||
<input type="hidden" name="action" value="enter-key">
|
||||
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
||||
<input type="submit" class="akismet-setup__connection-button akismet-button" value="<?php esc_attr_e( 'Connect with Jetpack', 'akismet' ); ?>"/>
|
||||
</form>
|
||||
|
||||
<p class="akismet-setup__connection-action-description">
|
||||
<?php esc_html_e( "By connecting, we'll use your Jetpack account to activate Akismet on this site.", 'akismet' ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! in_array( $user_status, array( Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_NO_SUB ) ) ) : ?>
|
||||
<p class="akismet-setup__connection-action-description">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL. */
|
||||
__( 'Want to use a different account? <a href="%s" class="akismet-external-link">Visit akismet.com</a> to set it up and get your API key.', 'akismet' ),
|
||||
esc_url( 'https://akismet.com/get?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=jetpack_flow_different_account' )
|
||||
),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'class' => array(),
|
||||
),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
78
wp-content/plugins/akismet/views/setup.php
Normal file
78
wp-content/plugins/akismet/views/setup.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
declare( strict_types = 1 );
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
$tick_icon = '<svg class="akismet-setup-instructions__icon" width="48" height="48" viewBox="0 0 48 48" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="24" cy="24" r="22" fill="#2E7D32"/>
|
||||
<path d="M16 24l6 6 12-14" fill="none" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>';
|
||||
?>
|
||||
<section class="akismet-setup-instructions">
|
||||
<h2 class="akismet-setup-instructions__heading"><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
|
||||
|
||||
<h3 class="akismet-setup-instructions__subheading">
|
||||
<?php echo esc_html__( 'Protect your site from comment spam and contact form spam — automatically.', 'akismet' ); ?>
|
||||
</h3>
|
||||
|
||||
<ul class="akismet-setup-instructions__feature-list">
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Machine learning accuracy', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Learns from billions of spam signals across the web to stop junk before it reaches you.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Zero effort', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Akismet runs quietly in the background, saving you hours of manual moderation.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Works with popular contact forms', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Seamlessly integrates with plugins like Elementor, Contact Form 7, Jetpack and WPForms.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Flexible pricing', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Name your own price for personal sites. Businesses start on a paid plan.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
if ( empty( $use_jetpack_connection ) ) :
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => __( 'Get started', 'akismet' ),
|
||||
'classes' => array( 'akismet-button', 'akismet-is-primary', 'akismet-setup-instructions__button' ),
|
||||
'utm_content' => 'setup_instructions',
|
||||
)
|
||||
);
|
||||
endif;
|
||||
?>
|
||||
</section>
|
||||
26
wp-content/plugins/akismet/views/start.php
Normal file
26
wp-content/plugins/akismet/views/start.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
?>
|
||||
<div id="akismet-plugin-container">
|
||||
<div class="akismet-masthead">
|
||||
<div class="akismet-masthead__inside-container">
|
||||
<?php Akismet::view( 'logo' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="akismet-lower">
|
||||
<?php Akismet_Admin::display_status(); ?>
|
||||
<div class="akismet-boxes">
|
||||
<?php
|
||||
if ( Akismet::predefined_api_key() ) {
|
||||
Akismet::view( 'predefined' );
|
||||
} elseif ( $akismet_user && in_array( $akismet_user->status, array( Akismet::USER_STATUS_ACTIVE, 'active-dunning', Akismet::USER_STATUS_NO_SUB, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_SUSPENDED ) ) ) {
|
||||
Akismet::view( 'connect-jp', compact( 'akismet_user' ) );
|
||||
} else {
|
||||
Akismet::view( 'activate' );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
12
wp-content/plugins/akismet/views/stats.php
Normal file
12
wp-content/plugins/akismet/views/stats.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<div id="akismet-plugin-container">
|
||||
<div class="akismet-masthead">
|
||||
<div class="akismet-masthead__inside-container">
|
||||
<?php Akismet::view( 'logo', array( 'include_logo_link' => true ) ); ?>
|
||||
<div class="akismet-masthead__back-link-container">
|
||||
<a class="akismet-masthead__back-link" href="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"><?php esc_html_e( 'Back to settings', 'akismet' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php /* name attribute on iframe is used as a cache-buster here to force Firefox to load the new style charts: https://bugzilla.mozilla.org/show_bug.cgi?id=356558 */ ?>
|
||||
<iframe id="stats-iframe" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/user-stats.php?blog=%s&token=%s&locale=%s&is_redecorated=1', urlencode( get_option( 'home' ) ), urlencode( Akismet::get_access_token() ), esc_attr( get_user_locale() ) ) ); ?>" name="<?php echo esc_attr( 'user-stats- ' . filemtime( __FILE__ ) ); ?>" width="100%" height="2500px" frameborder="0" title="<?php echo esc_attr__( 'Akismet detailed stats', 'akismet' ); ?>"></iframe>
|
||||
</div>
|
||||
Reference in New Issue
Block a user