PluginProbe ʕ •ᴥ•ʔ
Akismet Anti-spam: Spam Protection / 5.3.3
Akismet Anti-spam: Spam Protection v5.3.3
5.7 3.0.4 3.0.5 3.1 3.1.1 3.1.10 3.1.11 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 5.0 5.0.1 5.0.2 5.1 5.2 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.4 5.5 5.6 trunk 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.4.0 2.4.1 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 3.0.0 3.0.0-RC1 3.0.1 3.0.2 3.0.3
akismet / class.akismet-widget.php
akismet Last commit date
_inc 2 years ago views 1 year ago .htaccess 2 years ago LICENSE.txt 10 years ago akismet.php 1 year ago changelog.txt 2 years ago class.akismet-admin.php 1 year ago class.akismet-cli.php 2 years ago class.akismet-rest-api.php 2 years ago class.akismet-widget.php 2 years ago class.akismet.php 1 year ago index.php 12 years ago readme.txt 1 year ago wrapper.php 7 years ago
class.akismet-widget.php
138 lines
1 <?php
2 /**
3 * @package Akismet
4 */
5 class Akismet_Widget extends WP_Widget {
6
7 function __construct() {
8 load_plugin_textdomain( 'akismet' );
9
10 parent::__construct(
11 'akismet_widget',
12 __( 'Akismet Widget' , 'akismet'),
13 array( 'description' => __( 'Display the number of spam comments Akismet has caught' , 'akismet') )
14 );
15
16 if ( is_active_widget( false, false, $this->id_base ) ) {
17 add_action( 'wp_head', array( $this, 'css' ) );
18 }
19 }
20
21 function css() {
22 ?>
23
24 <style type="text/css">
25 .a-stats {
26 width: auto;
27 }
28 .a-stats a {
29 background: #7CA821;
30 background-image:-moz-linear-gradient(0% 100% 90deg,#5F8E14,#7CA821);
31 background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#7CA821),to(#5F8E14));
32 border: 1px solid #5F8E14;
33 border-radius:3px;
34 color: #CFEA93;
35 cursor: pointer;
36 display: block;
37 font-weight: normal;
38 height: 100%;
39 -moz-border-radius:3px;
40 padding: 7px 0 8px;
41 text-align: center;
42 text-decoration: none;
43 -webkit-border-radius:3px;
44 width: 100%;
45 }
46 .a-stats a:hover {
47 text-decoration: none;
48 background-image:-moz-linear-gradient(0% 100% 90deg,#6F9C1B,#659417);
49 background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#659417),to(#6F9C1B));
50 }
51 .a-stats .count {
52 color: #FFF;
53 display: block;
54 font-size: 15px;
55 line-height: 16px;
56 padding: 0 13px;
57 white-space: nowrap;
58 }
59 </style>
60
61 <?php
62 }
63
64 function form( $instance ) {
65 if ( $instance && isset( $instance['title'] ) ) {
66 $title = $instance['title'];
67 }
68 else {
69 $title = __( 'Spam Blocked' , 'akismet' );
70 }
71 ?>
72
73 <p>
74 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:' , 'akismet'); ?></label>
75 <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
76 </p>
77
78 <?php
79 }
80
81 function update( $new_instance, $old_instance ) {
82 $instance = array();
83 $instance['title'] = strip_tags( $new_instance['title'] );
84 return $instance;
85 }
86
87 function widget( $args, $instance ) {
88 $count = get_option( 'akismet_spam_count' );
89
90 if ( ! isset( $instance['title'] ) ) {
91 $instance['title'] = __( 'Spam Blocked' , 'akismet' );
92 }
93
94 echo $args['before_widget'];
95 if ( ! empty( $instance['title'] ) ) {
96 echo $args['before_title'];
97 echo esc_html( $instance['title'] );
98 echo $args['after_title'];
99 }
100 ?>
101
102 <div class="a-stats">
103 <a href="https://akismet.com" target="_blank" rel="noopener" title="">
104 <?php
105
106 echo wp_kses(
107 sprintf(
108 /* translators: The placeholder is the number of pieces of spam blocked by Akismet. */
109 _n(
110 '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>',
111 '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>',
112 $count,
113 'akismet'
114 ),
115 number_format_i18n( $count )
116 ),
117 array(
118 'strong' => array(
119 'class' => true,
120 ),
121 )
122 );
123
124 ?>
125 </a>
126 </div>
127
128 <?php
129 echo $args['after_widget'];
130 }
131 }
132
133 function akismet_register_widgets() {
134 register_widget( 'Akismet_Widget' );
135 }
136
137 add_action( 'widgets_init', 'akismet_register_widgets' );
138