Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

index.php security issue

$
0
0

Replies: 0

Sparkling’s error log (in one of my clients’ sites) is reflecting multiple instances of this error:

PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /wp-content/themes/sparkling/index.php.

This likely reflects bot attacks on theme files (outside of the context of WordPress) per https://perishablepress.com/fix-error-undefined-function/, and is easily prevented by adding the following line above the get_header() call:

<?php if (!defined('ABSPATH')) exit; ?>

This prevents execution of index.php unless WordPress is running and eliminates the PHP error message.


Viewing all articles
Browse latest Browse all 59525

Trending Articles