|
12 | 12 | }
|
13 | 13 |
|
14 | 14 |
|
| 15 | +/** |
| 16 | + * Remove unethical Jetpack search results Ads as no one needs these anyway. |
| 17 | + * Additionally remove other promotions and Ads from Jetpack. |
| 18 | + * |
| 19 | + * @link https://wptavern.com/jetpack-7-1-adds-feature-suggestions-to-plugin-search-results#comment-284531 |
| 20 | + * |
| 21 | + * @since 1.6.0 |
| 22 | + */ |
| 23 | +add_filter( 'jetpack_show_promotions', '__return_false', 20 ); |
| 24 | +add_filter( 'can_display_jetpack_manage_notice', '__return_false', 20 ); |
| 25 | +add_filter( 'jetpack_just_in_time_msgs', '__return_false', 20 ); |
| 26 | + |
| 27 | + |
| 28 | +/** |
| 29 | + * Remove unethical WooCommerce Ads injections. |
| 30 | + * |
| 31 | + * @since 1.6.0 |
| 32 | + */ |
| 33 | +add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false' ); |
| 34 | + |
| 35 | + |
15 | 36 | /**
|
16 | 37 | * Add "Custom Taxonomy" link to Plugins page.
|
17 | 38 | *
|
@@ -154,6 +175,104 @@ function ddw_btc_admin_footer_text( $footer_text ) {
|
154 | 175 | } // end function
|
155 | 176 |
|
156 | 177 |
|
| 178 | +add_filter( 'debug_information', 'ddw_btc_site_health_add_debug_info', 12 ); |
| 179 | +/** |
| 180 | + * Add additional plugin related info to the Site Health Debug Info section. |
| 181 | + * (Only relevant for WordPress 5.2 or higher) |
| 182 | + * |
| 183 | + * @link https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/ |
| 184 | + * |
| 185 | + * @since 1.5.1 |
| 186 | + * |
| 187 | + * @uses ddw_btc_get_integrations() |
| 188 | + * @uses ddw_btc_tax_edit_info_content() |
| 189 | + * |
| 190 | + * @param array $debug_info Array holding all Debug Info items. |
| 191 | + * @return array Modified array of Debug Info. |
| 192 | + */ |
| 193 | +function ddw_btc_site_health_add_debug_info( $debug_info ) { |
| 194 | + |
| 195 | + /** Get all integrations */ |
| 196 | + $get_integrations = ddw_btc_get_integrations(); |
| 197 | + $integrations_output = ''; |
| 198 | + |
| 199 | + /** Collect string for each active integration */ |
| 200 | + foreach ( $get_integrations as $integration => $integration_data ) { |
| 201 | + |
| 202 | + if ( 'default-none' !== $integration ) { |
| 203 | + |
| 204 | + $integrations_output .= sprintf( |
| 205 | + '%1$s (%2$s), ', |
| 206 | + esc_html( $integration_data[ 'label' ] ), |
| 207 | + sanitize_key( $integration_data[ 'post_type' ] ) |
| 208 | + ); |
| 209 | + |
| 210 | + } // end if |
| 211 | + |
| 212 | + } // end foreach |
| 213 | + |
| 214 | + /** Setup strings */ |
| 215 | + $string_enabled = __( 'Enabled', 'builder-template-categories' ); |
| 216 | + $string_disabled = __( 'Disabled', 'builder-template-categories' ); |
| 217 | + |
| 218 | + $block_editor_cpt_ui = apply_filters( 'btc/filter/wp_block/post_type_ui', TRUE ); |
| 219 | + |
| 220 | + /** Add our Debug info */ |
| 221 | + $debug_info[ 'builder-template-categories' ] = array( |
| 222 | + 'label' => esc_html__( 'Builder Template Categories', 'builder-template-categories' ) . ' (' . esc_html__( 'Plugin', 'builder-template-categories' ) . ')', |
| 223 | + 'fields' => array( |
| 224 | + 'btc_plugin_version' => array( |
| 225 | + 'label' => __( 'Plugin version', 'builder-template-categories' ), |
| 226 | + 'value' => BTC_PLUGIN_VERSION, |
| 227 | + ), |
| 228 | + 'current_active_integrations' => array( |
| 229 | + 'label' => __( 'Current active integrations', 'builder-template-categories' ), |
| 230 | + 'value' => $integrations_output, |
| 231 | + ), |
| 232 | + 'wpblock_post_type_ui' => array( |
| 233 | + 'label' => __( 'Reusable Blocks Post Type UI', 'builder-template-categories' ), |
| 234 | + 'value' => ( $block_editor_cpt_ui ) ? $string_enabled : $string_disabled, |
| 235 | + ), |
| 236 | + ), |
| 237 | + ); |
| 238 | + |
| 239 | + /** Return modified Debug Info array */ |
| 240 | + return $debug_info; |
| 241 | + |
| 242 | +} // end function |
| 243 | + |
| 244 | + |
| 245 | +if ( ! function_exists( 'ddw_wp_site_health_remove_percentage' ) ) : |
| 246 | + |
| 247 | + add_action( 'admin_head', 'ddw_wp_site_health_remove_percentage', 100 ); |
| 248 | + /** |
| 249 | + * Remove the "Percentage Progress" display in Site Health feature as this will |
| 250 | + * get users obsessed with fullfilling a 100% where there are non-problems! |
| 251 | + * |
| 252 | + * @link https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/ |
| 253 | + * |
| 254 | + * @since 1.5.1 |
| 255 | + */ |
| 256 | + function ddw_wp_site_health_remove_percentage() { |
| 257 | + |
| 258 | + /** Bail early if not on WP 5.2+ */ |
| 259 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '5.2-beta', '<' ) ) { |
| 260 | + return; |
| 261 | + } |
| 262 | + |
| 263 | + ?> |
| 264 | + <style type="text/css"> |
| 265 | + .site-health-progress { |
| 266 | + display: none; |
| 267 | + } |
| 268 | + </style> |
| 269 | + <?php |
| 270 | + |
| 271 | + } // end function |
| 272 | + |
| 273 | +endif; |
| 274 | + |
| 275 | + |
157 | 276 | /**
|
158 | 277 | * Inline CSS fix for Plugins page update messages.
|
159 | 278 | *
|
@@ -305,12 +424,12 @@ function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
|
305 | 424 | if ( ddw_btc_is_block_editor_active() && ddw_btc_is_block_editor_wanted() ) {
|
306 | 425 |
|
307 | 426 | $plugins_block_editor = array(
|
308 |
| - 'classic-editor' => array( |
| 427 | + 'ultimate-addons-for-gutenberg' => array( |
309 | 428 | 'featured' => 'yes',
|
310 | 429 | 'recommended' => 'yes',
|
311 | 430 | 'popular' => 'yes',
|
312 | 431 | ),
|
313 |
| - 'classic-editor-addon' => array( |
| 432 | + 'kadence-blocks' => array( |
314 | 433 | 'featured' => 'yes',
|
315 | 434 | 'recommended' => 'yes',
|
316 | 435 | 'popular' => 'yes',
|
@@ -340,11 +459,6 @@ function ddw_btc_register_extra_plugin_recommendations( array $plugins ) {
|
340 | 459 | 'recommended' => 'yes',
|
341 | 460 | 'popular' => 'no',
|
342 | 461 | ),
|
343 |
| - 'custom-fields-gutenberg' => array( |
344 |
| - 'featured' => 'yes', |
345 |
| - 'recommended' => 'yes', |
346 |
| - 'popular' => 'no', |
347 |
| - ), |
348 | 462 | );
|
349 | 463 |
|
350 | 464 | } // end if
|
|
0 commit comments