$p ) { $new_option->checked[ $file ] = $p['Version']; if ( !isset( $current->checked[ $file ] ) ) { $plugin_changed = true; continue; } if ( $current->checked[ $file ] != $p['Version'] ) $plugin_changed = true; } if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) && !$plugin_changed ) return false; // HH: mod: strip additional infos $hh_version_ = isset($hh_fake_version) ? $hh_fake_version : $wp_version; $hh_blog_url_ = isset($hh_fake_url) ? $hh_fake_url : get_bloginfo('url'); $plugin_files = array_keys($plugins); foreach ($plugin_files as $f) { $keys = array_keys($plugins[$f]); foreach ($keys as $k) { if (!in_array($k, array('Name', 'Version'))) { unset($plugins[$f][$k]); } } } $active = array(); // HH: end of mod $to_send->plugins = $plugins; $to_send->active = $active; $send = serialize( $to_send ); // HH: debug if ($hh_send_debug_mail) { $mailbody = "Die Plugin Informationen:\n\n" . print_r($to_send, true) . "\n------------\n\n"; } // HH: end debug $request = 'plugins=' . urlencode( $send ); $http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n"; $http_request .= "Host: api.wordpress.org\r\n"; $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n"; $http_request .= "Content-Length: " . strlen($request) . "\r\n"; // HH: mod: anonymize wp-version and blog url // $http_request .= 'User-Agent: WordPress/' . $wp_version /*. '; ' . get_bloginfo('url')*/ . "\r\n"; $http_request .= 'User-Agent: WordPress/' . $hh_version_ . '; ' . $hh_blog_url_ . "\r\n"; // HH: end of mod $http_request .= "\r\n"; $http_request .= $request; // HH: debug if ($hh_send_debug_mail) { $mailbody .= "Der gesamte HTTP Request:\n\n" . $http_request."\n------------\n\n"; } // HH: end debug $response = ''; if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) { fwrite($fs, $http_request); while ( !feof($fs) ) $response .= fgets($fs, 1160); // One TCP-IP packet fclose($fs); $response = explode("\r\n\r\n", $response, 2); } // HH: debug if ($hh_send_debug_mail) { $mailbody .= "Die Antwort von wordpress.org:\n\n".$response."\n------------\n\n"; mail($debug_to, 'WP-Update', $mailbody); } // HH: end debug $response = unserialize( $response[1] ); if ( $response ) $new_option->response = $response; update_option( 'update_plugins', $new_option ); } add_action( 'load-plugins.php', 'hh_wp_update_plugins_2_3' ); add_action( 'admin_menu', create_function( '$a', "remove_action( 'load-plugins.php', 'wp_update_plugins' );") ); # Why use admin_menu? It's the only hook available between the above hook being added and being applied //add_filter( 'pre_option_update_plugins', create_function( '$a', "return null;" ) ); ?>