for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) 2017 Salah Alkhwlani <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Yemenifree\WpSecurity\Modules;
use Yemenifree\WpSecurity\Interfaces\Initializable;
class CoreSecurity implements Initializable
{
/**
* Initialize module (perform any tasks that should be done init hook).
public function init()
// Remove the WordPress version from the <head> tag
add_filter('the_generator', '__return_empty_string');
add_filter
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
// remove really simple discovery link
remove_action('wp_head', 'rsd_link');
remove_action
// remove version from assets url.
add_filter('style_loader_src', [$this, 'remove_wp_ver_css_js'], 9999);
add_filter('script_loader_src', [$this, 'remove_wp_ver_css_js'], 9999);
}
* remove version from assets url.
* @param $src
* @return string
public function remove_wp_ver_css_js($src)
if (\strpos($src, 'ver=' . get_bloginfo('version'))) {
get_bloginfo
if (\strpos($src, 'ver=' . /** @scrutinizer ignore-call */ get_bloginfo('version'))) {
$src = remove_query_arg('ver', $src);
remove_query_arg
$src = /** @scrutinizer ignore-call */ remove_query_arg('ver', $src);
return $src;