Changeset 3436248
- Timestamp:
- 01/09/2026 07:11:06 PM (3 months ago)
- Location:
- eps-301-redirects/trunk
- Files:
-
- 4 edited
-
eps-301-redirects.php (modified) (7 diffs)
-
libs/eps-plugin-options.php (modified) (1 diff)
-
plugin.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eps-301-redirects/trunk/eps-301-redirects.php
r3431731 r3436248 3 3 Plugin Name: 301 Redirects 4 4 Description: Easily create and manage redirect rules, and view 404 error log. 5 Version: 2.8 25 Version: 2.83 6 6 Author: WebFactory Ltd 7 7 Author URI: https://www.webfactoryltd.com/ … … 13 13 License: GPLv2 or later 14 14 15 Copyright 2015 - 202 5WebFactory Ltd (email: [email protected])15 Copyright 2015 - 2026 WebFactory Ltd (email: [email protected]) 16 16 17 17 This program is free software; you can redistribute it and/or modify … … 128 128 // add widget to dashboard 129 129 function add_widget() { 130 if (current_user_can( 'manage_options')) {130 if (current_user_can(apply_filters('eps_301_redirects_capability', 'manage_options'))) { 131 131 add_meta_box('wp301_404_errors', '404 Error Log', array($this, 'widget_content'), 'dashboard', 'side', 'high'); 132 132 } … … 637 637 check_ajax_referer('eps_301_save_redirect'); 638 638 639 if (!current_user_can( 'manage_options')) {639 if (!current_user_can(apply_filters('eps_301_redirects_capability', 'manage_options'))) { 640 640 wp_die('You are not allowed to run this action.'); 641 641 } … … 859 859 check_ajax_referer('eps_301_delete_entry'); 860 860 861 if (!current_user_can( 'manage_options')) {861 if (!current_user_can(apply_filters('eps_301_redirects_capability', 'manage_options'))) { 862 862 wp_die('You are not allowed to run this action.'); 863 863 } … … 915 915 check_ajax_referer('eps_301_get_inline_edit_entry'); 916 916 917 if (!current_user_can( 'manage_options')) {917 if (!current_user_can(apply_filters('eps_301_redirects_capability', 'manage_options'))) { 918 918 wp_die('You are not allowed to run this action.'); 919 919 } … … 937 937 check_ajax_referer('eps_301_get_entry'); 938 938 939 if (!current_user_can( 'manage_options')) {939 if (!current_user_can(apply_filters('eps_301_redirects_capability', 'manage_options'))) { 940 940 wp_die('You are not allowed to run this action.'); 941 941 } -
eps-301-redirects/trunk/libs/eps-plugin-options.php
r3246720 r3436248 241 241 { 242 242 if (in_array($this->plugin->config('menu_location'), $this->menu_locations)) { 243 $func = sprintf("add_%s_page", $this->plugin->config('menu_location')); 244 return $func($this->plugin->name, $this->plugin->name, $this->plugin->config('page_permission'), $this->plugin->config('page_slug'), array($this, 'do_admin_page')); 243 $capability = apply_filters('eps_301_redirects_capability', 'manage_options'); 244 $location = ($capability == 'manage_options' ? $this->plugin->config('menu_location') : 'menu'); 245 $func = sprintf("add_%s_page", $location); 246 return $func($this->plugin->name, $this->plugin->name, apply_filters('eps_301_redirects_capability', 'manage_options'), $this->plugin->config('page_slug'), array($this, 'do_admin_page')); 245 247 } else { 246 248 // TODO proper errors dude. 247 printf('ERROR: menu location "%s" not valid.', esc_attr($this-> config['menu_location']));249 printf('ERROR: menu location "%s" not valid.', esc_attr($this->plugin->config['menu_location'])); 248 250 } 249 251 return false; -
eps-301-redirects/trunk/plugin.php
r3391935 r3436248 22 22 'page_title' => '301 Redirects', 23 23 'menu_location' => 'options', 24 'page_permission' => 'manage_options',25 24 'directory' => 'eps-301-redirects' 26 25 ); … … 250 249 $sql = "CREATE TABLE $table_name ( 251 250 id mediumint(9) NOT NULL AUTO_INCREMENT, 252 url_from VARCHAR( 256) DEFAULT '' NOT NULL,253 url_to VARCHAR( 256) DEFAULT '' NOT NULL,251 url_from VARCHAR(1024) DEFAULT '' NOT NULL, 252 url_to VARCHAR(1024) DEFAULT '' NOT NULL, 254 253 status VARCHAR(12) DEFAULT '301' NOT NULL, 255 254 type VARCHAR(12) DEFAULT 'url' NOT NULL, -
eps-301-redirects/trunk/readme.txt
r3431731 r3436248 4 4 Requires at least: 4.0 5 5 Tested up to: 6.9 6 Stable tag: 2.8 26 Stable tag: 2.83 7 7 Requires PHP: 5.2 8 8 License: GPLv2 or later … … 68 68 69 69 == Changelog == 70 = 2.83 = 71 * 2026/01/09 72 * increased maximum URL length to 1024 characters 73 * added 'eps_301_redirects_capability' filter to change the capability required to manage redirects. If set to anything other than 'manage_options' 301 Redirects will show under its own menu page instead of under Settings 74 70 75 = 2.82 = 71 76 * 2026/01/03
Note: See TracChangeset
for help on using the changeset viewer.