| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Redirection |
| 4 |
Plugin URI: http://urbangiraffe.com/plugins/redirection/ |
| 5 |
Description: Manage all your 301 redirects and monitor 404 errors |
| 6 |
Version: 2.6.1 |
| 7 |
Author: John Godley |
| 8 |
Author URI: http://urbangiraffe.com |
| 9 |
Text Domain: redirection |
| 10 |
Domain Path: /locale |
| 11 |
============================================================================================================ |
| 12 |
This software is provided "as is" and any express or implied warranties, including, but not limited to, the |
| 13 |
implied warranties of merchantibility and fitness for a particular purpose are disclaimed. In no event shall |
| 14 |
the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or |
| 15 |
consequential damages(including, but not limited to, procurement of substitute goods or services; loss of |
| 16 |
use, data, or profits; or business interruption) however caused and on any theory of liability, whether in |
| 17 |
contract, strict liability, or tort(including negligence or otherwise) arising in any way out of the use of |
| 18 |
this software, even if advised of the possibility of such damage. |
| 19 |
|
| 20 |
For full license details see license.txt |
| 21 |
============================================================================================================ |
| 22 |
*/ |
| 23 |
|
| 24 |
define( 'REDIRECTION_VERSION', '2.3.3' ); // DB schema version. Only change if DB needs changing |
| 25 |
define( 'REDIRECTION_FILE', __FILE__ ); |
| 26 |
|
| 27 |
include dirname( __FILE__ ).'/models/redirect.php'; |
| 28 |
include dirname( __FILE__ ).'/models/module.php'; |
| 29 |
include dirname( __FILE__ ).'/models/log.php'; |
| 30 |
include dirname( __FILE__ ).'/models/flusher.php'; |
| 31 |
include dirname( __FILE__ ).'/models/match.php'; |
| 32 |
include dirname( __FILE__ ).'/models/action.php'; |
| 33 |
include dirname( __FILE__ ).'/models/request.php'; |
| 34 |
|
| 35 |
function red_get_options() { |
| 36 |
$options = get_option( 'redirection_options' ); |
| 37 |
if ( $options === false ) |
| 38 |
$options = array(); |
| 39 |
|
| 40 |
$defaults = apply_filters( 'red_default_options', array( |
| 41 |
'support' => false, |
| 42 |
'token' => md5( uniqid() ), |
| 43 |
'monitor_post' => 0, |
| 44 |
'auto_target' => '', |
| 45 |
'expire_redirect' => 7, |
| 46 |
'expire_404' => 7, |
| 47 |
'modules' => array(), |
| 48 |
) ); |
| 49 |
|
| 50 |
foreach ( $defaults as $key => $value ) { |
| 51 |
if ( ! isset( $options[ $key ] ) ) |
| 52 |
$options[ $key ] = $value; |
| 53 |
} |
| 54 |
|
| 55 |
$options['lookup'] = apply_filters( 'red_lookup_ip', 'http://urbangiraffe.com/map/?ip=' ); |
| 56 |
return $options; |
| 57 |
} |
| 58 |
|
| 59 |
if ( is_admin() ) |
| 60 |
include dirname( __FILE__ ).'/redirection-admin.php'; |
| 61 |
else |
| 62 |
include dirname( __FILE__ ).'/redirection-front.php'; |
| 63 |
|