Changeset 3232287
- Timestamp:
- 01/30/2025 08:33:57 PM (11 months ago)
- Location:
- akismet/trunk
- Files:
-
- 2 edited
-
akismet.php (modified) (2 diffs)
-
class.akismet-widget.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
akismet/trunk/akismet.php
r3227756 r3232287 7 7 Plugin URI: https://akismet.com/ 8 8 Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. 9 Version: 5.3.6a 59 Version: 5.3.6a6 10 10 Requires at least: 5.8 11 11 Requires PHP: 5.6.20 … … 40 40 } 41 41 42 define( 'AKISMET_VERSION', '5.3.6a 5' );42 define( 'AKISMET_VERSION', '5.3.6a6' ); 43 43 define( 'AKISMET__MINIMUM_WP_VERSION', '5.8' ); 44 44 define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
akismet/trunk/class.akismet-widget.php
r3223918 r3232287 12 12 load_plugin_textdomain( 'akismet' ); 13 13 14 add_action( 'wp_enqueue_scripts', array( $this, 'akismet_widget_enqueue_styles' ) ); 15 14 16 parent::__construct( 15 17 'akismet_widget', … … 17 19 array( 'description' => __( 'Display the number of spam comments Akismet has caught', 'akismet' ) ) 18 20 ); 19 20 if ( is_active_widget( false, false, $this->id_base ) ) {21 add_action( 'wp_head', array( $this, 'css' ) );22 }23 21 } 24 22 25 function css() { 26 ?> 23 public function akismet_widget_enqueue_styles() { 24 // Register the stylesheet handle 25 wp_register_style( 'akismet-widget-style', false ); // No external file, just a handle 27 26 28 <style> 29 .a-stats { 30 --akismet-color-mid-green: #357b49; 31 --akismet-color-white: #fff; 32 --akismet-color-light-grey: #f6f7f7; 27 // Enqueue the registered stylesheet 28 wp_enqueue_style( 'akismet-widget-style' ); 33 29 34 max-width: 350px; 35 width: auto; 36 } 30 // Add inline styles 31 $inline_css = " 32 .a-stats { 33 --akismet-color-mid-green: #357b49; 34 --akismet-color-white: #fff; 35 --akismet-color-light-grey: #f6f7f7; 37 36 38 .a-stats * { 39 all: unset; 40 box-sizing: border-box; 41 } 37 max-width: 350px; 38 width: auto; 39 } 42 40 43 .a-stats strong { 44 font-weight: 600; 45 } 41 .a-stats * { 42 all: unset; 43 box-sizing: border-box; 44 } 46 45 47 .a-stats a.a-stats__link, 48 .a-stats a.a-stats__link:visited, 49 .a-stats a.a-stats__link:active { 50 background: var(--akismet-color-mid-green); 51 border: none; 52 border-radius: 8px; 53 color: var(--akismet-color-white); 54 cursor: pointer; 55 display: block; 56 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif; 57 font-weight: 500; 58 padding: 12px; 59 text-align: center; 60 text-decoration: none; 61 transition: all 0.2s ease; 62 } 46 .a-stats strong { 47 font-weight: 600; 48 } 63 49 64 /* Extra specificity to deal with TwentyTwentyOne focus style */ 65 .widget .a-stats a.a-stats__link:focus { 66 background: var(--akismet-color-mid-green); 67 color: var(--akismet-color-white); 68 text-decoration: none; 69 } 50 .a-stats a.a-stats__link, 51 .a-stats a.a-stats__link:visited, 52 .a-stats a.a-stats__link:active { 53 background: var(--akismet-color-mid-green); 54 border: none; 55 box-shadow: none; 56 border-radius: 8px; 57 color: var(--akismet-color-white); 58 cursor: pointer; 59 display: block; 60 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif; 61 font-weight: 500; 62 padding: 12px; 63 text-align: center; 64 text-decoration: none; 65 transition: all 0.2s ease; 66 } 70 67 71 .a-stats a.a-stats__link:hover { 72 filter: brightness(110%); 73 box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.16); 74 } 68 /* Extra specificity to deal with TwentyTwentyOne focus style */ 69 .widget .a-stats a.a-stats__link:focus { 70 background: var(--akismet-color-mid-green); 71 color: var(--akismet-color-white); 72 text-decoration: none; 73 } 75 74 76 .a-stats .count { 77 color: var(--akismet-color-white); 78 display: block; 79 font-size: 1.5em; 80 line-height: 1.4; 81 padding: 0 13px; 82 white-space: nowrap; 83 } 84 </style> 75 .a-stats a.a-stats__link:hover { 76 filter: brightness(110%); 77 box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.16); 78 } 85 79 86 <?php 80 .a-stats .count { 81 color: var(--akismet-color-white); 82 display: block; 83 font-size: 1.5em; 84 line-height: 1.4; 85 padding: 0 13px; 86 white-space: nowrap; 87 } 88 "; 89 wp_add_inline_style( 'akismet-widget-style', $inline_css ); 87 90 } 88 91 … … 124 127 ?> 125 128 126 <div class="a-stats">127 <?php // Specifying colors inline for maximum specificity without using !important ?>128 <a href="https://akismet.com" class="a-stats__link" target="_blank" rel="noopener" style="background-color: var(--akismet-color-mid-green); color: var(--akismet-color-white);">129 <?php129 <div class="a-stats"> 130 <?php // Specifying colors inline for maximum specificity without using !important ?> 131 <a href="https://akismet.com" class="a-stats__link" target="_blank" rel="noopener" style="background-color: var(--akismet-color-mid-green); color: var(--akismet-color-white);"> 132 <?php 130 133 131 echo wp_kses(132 sprintf(134 echo wp_kses( 135 sprintf( 133 136 /* translators: The placeholder is the number of pieces of spam blocked by Akismet. */ 134 _n( 135 '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', 136 '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', 137 $count, 138 'akismet' 137 _n( 138 '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', 139 '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', 140 $count, 141 'akismet' 142 ), 143 number_format_i18n( $count ) 139 144 ), 140 number_format_i18n( $count ) 141 ), 142 array( 143 'strong' => array( 144 'class' => true, 145 ), 146 ) 147 ); 145 array( 146 'strong' => array( 147 'class' => true, 148 ), 149 ) 150 ); 148 151 149 ?>150 </a>151 </div>152 ?> 153 </a> 154 </div> 152 155 153 156 <?php
Note: See TracChangeset
for help on using the changeset viewer.