From 155d4ab39c6bf89138eaeee015658b28a98701ac Mon Sep 17 00:00:00 2001 From: lechuck <l3chuck@autistici.org> Date: Sat, 3 May 2014 19:24:51 +0000 Subject: [PATCH] Added wordpress-ai-privacy-plugin to upstream --- .../images/mystery-man-50.jpg | Bin 0 -> 1420 bytes .../remove-gravatar.php | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 wp-content/plugins/wordpress-ai-privacy-plugin/images/mystery-man-50.jpg create mode 100644 wp-content/plugins/wordpress-ai-privacy-plugin/remove-gravatar.php diff --git a/wp-content/plugins/wordpress-ai-privacy-plugin/images/mystery-man-50.jpg b/wp-content/plugins/wordpress-ai-privacy-plugin/images/mystery-man-50.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e0e8679fe4542ae3dba2795d0d1cda3515875ff3 GIT binary patch literal 1420 zcmex=<Nrej3D=6uGzJDwPb~%x1_b#3hC$G!G&#GHfsuiQfq}t@f#Lr{X3dO}k^(Dz z{k&qm#FYG`RK4W<T>Xl~0)0b01APV?`-+0Z<m}WEg{0K<%sgAA_q+EiDP*SDDutW+ z8u%7Cr)Fe&R28KLSNVk`S7j$#rYPClDcDq4Rpb`rrj{fsROII56<bx<DuE5R$}6@4 z3F|8<fR&VF+bTJNY*mQx4N!2-FG^J~)icmdHZU_#Ff-IMG&V6eH`h@xGB7mIH!#vS zG}1LRw=y=eGB8kp0wp^Io1&C7s~{IQs9i-VX|_sGPnDOK>y;bp<rk&v8(Lagg3K^7 z(k)6!(=D#dD@m--%_~-hnc$LIoLrPyP?DLSrvNfBF)6>a#8ycOYHUSr0o+)uVTGj7 z*B8Ii++0uqfJ3IZBq$Z(UaSTehg24%>IbD3=a&{Grv{~_DTAykuyQU+O)SYT3dzsU zfrVl~Mt(_taYlZDf^)E`LU?9gN`84UShcUOm1kaYNn&1ds;7&sQblfoUS?*Bm6M~R zxs#iVsfD4XrJ<pVn}w^PqnnYXlc|xBnWd|l8%(cDesXDUYF-IUZwf-M8BV>Rgpga{ z>ucqbT9jFqn&MWJpQ`}&uvI2*w;1Cz52`l>w_8kb>eaVXu+axaD^fJWgo0e$KumCo z1f@<p1w^t>%}cRWDpIny`~QxC51dpPQVuXMFfjhV&CtTY!3F{xY-}7n9PAuCd|VtH zTzmq&ynMX80)jkzyu5rog8V|lBEmxa5)x8U5)#TvN=nM=aKOmP!NJMJ$<4{h&Bx8l z%_qpm$Hylq3^qVmLXe-IpI=ZyOk6}nL|hD{T}nz(Q9)4=u3!EC0R}-11|tR|W=16j zCP7AKLB{__7;+dG8JHOv84-D(frXWgnUNhu2rMhWz{JSJ!pzFf3g$8}FfuVPvj{30 zvN{GP79JE*5^h|$(I}{h?czfxV^cw7Bf%Q}-(uilW@KOzWENzwXZWS#l0D&i3yZI4 z-*H!gkUer%?e_liT3=2FtHk77Go8@l@A<>1ZkEHTBd?3|gRX53Sp8XFaG?yxoCQis zOrE!!wtn4_Ym@x#`-#g}lX_(Rc$NrM3NjZ9nf6}Xy<lskr1VcV7N*MehSs}ToSq0V z9A}l7pCF)Nuf+ZOg7P!1!Z*h?eO2z?wY_^fv>=>cYvC2fb8ZbC9h|kB-)02ny%RqY zZRJtI{L1#ytXtF97kc$yJLsQid3FJ#L#PDf1X+b@K>>w4>s;$wsZ&_jEk5z*m$~QE z)Rd$(2B{VT6@uo*hWjpxtgp#35DhVWD=8s5QIIL_`oGrwckiU_Q({t5P^<r>|90WG P?MGZ3mUeW=|Gx<Uf}x*> literal 0 HcmV?d00001 diff --git a/wp-content/plugins/wordpress-ai-privacy-plugin/remove-gravatar.php b/wp-content/plugins/wordpress-ai-privacy-plugin/remove-gravatar.php new file mode 100644 index 000000000..6d35bd31d --- /dev/null +++ b/wp-content/plugins/wordpress-ai-privacy-plugin/remove-gravatar.php @@ -0,0 +1,60 @@ +<?php +/* +Plugin Name: Wordpress-privacy-ai +Version: 0.0.1 +Plugin URI: none +Description: Filtra alcuni parametri per la privacy +Author: A/I +*/ + +//Elimino i gravatar in caso di avatar non presente +if ( !function_exists('get_avatar') ) : +function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) { + if ( ! get_option('show_avatars') ) + return false; + + if ( false === $alt) + $safe_alt = ''; + else + $safe_alt = esc_attr( $alt ); + + if ( !is_numeric($size) ) + $size = '96'; + + $email = ''; + if ( is_numeric($id_or_email) ) { + $id = (int) $id_or_email; + $user = get_userdata($id); + if ( $user ) + $email = $user->user_email; + } elseif ( is_object($id_or_email) ) { + // No avatar for pingbacks or trackbacks + $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); + if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) + return false; + + if ( !empty($id_or_email->user_id) ) { + $id = (int) $id_or_email->user_id; + $user = get_userdata($id); + if ( $user) + $email = $user->user_email; + } elseif ( !empty($id_or_email->comment_author_email) ) { + $email = $id_or_email->comment_author_email; + } + } else { + $email = $id_or_email; + } + + if ( empty($default) ) { + $default = 'mystery'; + } + + + if ( 'mystery' == $default ) + $default = plugins_url( 'images/mystery-man-50.jpg' , __FILE__ ); + elseif ( 'blank' == $default ) + $default = includes_url('images/blank.gif'); + $avatar = "<img alt='{$safe_alt}' src='{$default}' class='avatar' height='{$size}' width='{$size}' />"; + return apply_filters('get_avatar', $avatar, $id_or_email, 40 , $default, $alt); +} +endif; -- GitLab