4

I recently browsed WooCommerce source, and it appears that they're doing this:

<?php
/**
 * The template for displaying product content within loops.
 *
 * Override this template by copying it to yourtheme/woocommerce/content-product.php
 *
 * @author      WooThemes
 * @package     WooCommerce/Templates
 * @version     1.6.4
 */

  if ( ! defined( 'ABSPATH' ) )  exit; // Exit if accessed directly

global $product, $woocommerce_loop;

So I did some reading about checking if ABSPATH is defined - it appears to be used for security purposes.

However, I don't see _s theme ( developed by automattic ) doing anything with ABSPATH, so my question is - is this a plugin thing, a paranoid thing, a best security practice ? Who should be checking for ABSPATH ?

Should I check for ABSPATH in my theme files ? Custom function files ? Should I check at all ?

Browse other questions tagged or ask your own question.