Forums

[Plugin: WP-SpamFree Anti-Spam] plugin dir hardcoded. why? (2 posts)

  1. RavanH
    Member
    Posted 2 years ago #

    Hi Scott,

    I noticed in your code (several times so why not once and make it global??)

    // Pre-2.6 compatibility
    	if ( !defined('WP_CONTENT_DIR') ) {
    		define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    		}
    	// Guess the location
    	$wpsf_plugin_path = WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__));

    Would it not be wiser to do something like

    // Pre-2.6 compatibility
    	if ( !defined('WP_CONTENT_DIR') )
    		define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    	if ( ! defined( 'WP_PLUGIN_DIR' ) )
    		define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
    	// Know the location
    	$wpsf_plugin_path = WP_PLUGIN_DIR.'/'.plugin_basename(dirname(__FILE__));

    http://wordpress.org/extend/plugins/wp-spamfree/

  2. daveabrahams
    Member
    Posted 1 year ago #

    Maybe this accounts for why nobody can post comments unless they're logged in when I "network activate" that plugin?

Topic Closed

This topic has been closed to new replies.

About this Topic