├── .wordpress-org
├── screenshot-1.png
├── screenshot-2.png
├── screenshot-3.png
├── screenshot-4.png
├── banner-1544x500.png
└── banner-772x250.png
├── .github
├── CODEOWNERS
├── workflows
│ ├── deploy.yml
│ └── integration.yml
└── dependabot.yml
├── .gitignore
├── .distignore
├── tests
├── Unit
│ ├── TestCase.php
│ └── Core
│ │ └── RewriteRulesTest.php
├── Integration
│ ├── TestCase.php
│ └── PluginTest.php
└── bootstrap.php
├── .wp-env.json
├── .editorconfig
├── phpunit.xml.dist
├── assets
├── js
│ └── admin.js
└── css
│ └── admin.css
├── rector.php
├── rewrite-rules-inspector.php
├── src
├── Core
│ ├── RuleFlush.php
│ ├── FileExport.php
│ ├── Permastructs.php
│ ├── RewriteRules.php
│ └── UrlTester.php
├── Admin
│ ├── AdminPage.php
│ ├── ContextualHelp.php
│ ├── RewriteRulesTable.php
│ └── ViewRenderer.php
└── Plugin.php
├── composer.json
├── views
└── permastructs-table.php
├── .phpcs.xml.dist
├── CHANGELOG.md
├── README.md
├── languages
└── rewrite-rules-inspector.pot
└── LICENSE
/.wordpress-org/screenshot-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Automattic/Rewrite-Rules-Inspector/HEAD/.wordpress-org/screenshot-1.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Automattic/Rewrite-Rules-Inspector/HEAD/.wordpress-org/screenshot-2.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Automattic/Rewrite-Rules-Inspector/HEAD/.wordpress-org/screenshot-3.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Automattic/Rewrite-Rules-Inspector/HEAD/.wordpress-org/screenshot-4.png
--------------------------------------------------------------------------------
/.wordpress-org/banner-1544x500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Automattic/Rewrite-Rules-Inspector/HEAD/.wordpress-org/banner-1544x500.png
--------------------------------------------------------------------------------
/.wordpress-org/banner-772x250.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Automattic/Rewrite-Rules-Inspector/HEAD/.wordpress-org/banner-772x250.png
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # The following teams will get auto-tagged for a review.
2 | # See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3 | * @Automattic/vip-plugins
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | /node_modules/
3 | /vendor/
4 |
5 | # Composer
6 | /composer.lock
7 |
8 | # Tests
9 | /.phpunit.cache/
10 |
11 | # Local config overrides
12 | /.phpcs.xml
13 | /phpcs.xml
14 | /phpunit.xml
15 | /.wp-env.override.json
16 |
--------------------------------------------------------------------------------
/.distignore:
--------------------------------------------------------------------------------
1 | # Directories
2 | /.git/
3 | /.github/
4 | /bin/
5 | /node_modules/
6 | /tests/
7 | /vendor/
8 |
9 | # Files
10 | .distignore
11 | .editorconfig
12 | .gitattributes
13 | .gitignore
14 | .phpcs.xml.dist
15 | .wp-env.json
16 | .wp-env.override.json
17 | CHANGELOG.md
18 | composer.json
19 | composer.lock
20 | package.json
21 | package-lock.json
22 | phpunit.xml.dist
23 |
--------------------------------------------------------------------------------
/tests/Unit/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue( class_exists( \Automattic\RewriteRulesInspector\Core\RewriteRules::class ) );
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy to WordPress.org
2 | on:
3 | release:
4 | types: [released]
5 | # Allow manual triggering of the workflow.
6 | workflow_dispatch:
7 |
8 | permissions: {}
9 |
10 | jobs:
11 | release:
12 | name: New release to WordPress.org
13 | runs-on: ubuntu-latest
14 | permissions:
15 | contents: read
16 | steps:
17 | - name: Checkout
18 | uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19 | with:
20 | persist-credentials: false
21 |
22 | - name: Install SVN (Subversion)
23 | run: |
24 | sudo apt-get update
25 | sudo apt-get install subversion
26 |
27 | - name: Push to WordPress.org
28 | uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # 2.3.0
29 | env:
30 | SLUG: rewrite-rules-inspector
31 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
32 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
33 |
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
22 | 26 |
27 | 28 || 33 | 34 | | 35 |36 | 37 | | 38 |39 | 40 | | 41 |
|---|---|---|
| 47 | 48 | | 49 |
50 |
51 | |
52 | 53 | 54 | | 55 |
| 61 | 62 | | 63 |64 | 65 | | 66 |67 | 68 | | 69 |
' . __( 'The Rewrite Rules Inspector helps you understand and debug your WordPress site\'s URL structure. It shows you all the rewrite rules and permastructs that WordPress uses to handle URLs.', 'rewrite-rules-inspector' ) . '
', 29 | ] 30 | ); 31 | 32 | // Rewrite Rules tab. 33 | $screen->add_help_tab( 34 | [ 35 | 'id' => 'rewrite-rules', 36 | 'title' => __( 'Rewrite Rules', 'rewrite-rules-inspector' ), 37 | 'content' => '' . __( 'Rewrite Rules are the actual URL patterns that WordPress uses to match incoming requests and determine what content to display.', 'rewrite-rules-inspector' ) . '
' . 38 | '' . __( 'Each rule consists of:', 'rewrite-rules-inspector' ) . '
' . 39 | '^category/([^/]+)/?$)', 'rewrite-rules-inspector' ) . 'index.php?category_name=$matches[1])', 'rewrite-rules-inspector' ) . '' . __( 'When someone visits a URL, WordPress checks these rules in order until it finds a match, then executes the corresponding rewrite to determine what content to show.', 'rewrite-rules-inspector' ) . '
', 45 | ] 46 | ); 47 | 48 | // Permastructs tab. 49 | $screen->add_help_tab( 50 | [ 51 | 'id' => 'permastructs', 52 | 'title' => __( 'Permastructs', 'rewrite-rules-inspector' ), 53 | 'content' => '' . __( 'Permastructs are the URL structure templates that define how different types of content should be accessed via URLs.', 'rewrite-rules-inspector' ) . '
' . 54 | '' . __( 'For example:', 'rewrite-rules-inspector' ) . '
' . 55 | '/%year%/%monthnum%/%day%/%postname%/ - defines how individual posts are accessed', 'rewrite-rules-inspector' ) . '/category/%category% - defines how category pages are accessed', 'rewrite-rules-inspector' ) . '/tag/%post_tag% - defines how tag pages are accessed', 'rewrite-rules-inspector' ) . '' . __( 'WordPress uses these permastructs to generate the actual rewrite rules. The permastructs are like blueprints, while the rewrite rules are the specific patterns that get created from those blueprints.', 'rewrite-rules-inspector' ) . '
' . 64 | '' . __( 'You can customize permastructs through WordPress settings (Settings → Permalinks) or by using WordPress functions like add_permastruct() in your theme or plugin.', 'rewrite-rules-inspector' ) . '
' . __( 'Common Issues:', 'rewrite-rules-inspector' ) . '
' . 74 | '' . __( 'Tips:', 'rewrite-rules-inspector' ) . '
' . 81 | '' . __( 'For more information:', 'rewrite-rules-inspector' ) . '
' . 100 | '' . __( 'WordPress Permalinks Documentation', 'rewrite-rules-inspector' ) . '
' . 101 | '' . __( 'WordPress Rewrite API', 'rewrite-rules-inspector' ) . '
' . 102 | '' . __( 'Plugin on GitHub', 'rewrite-rules-inspector' ) . '
' 103 | ); 104 | } 105 | 106 | /** 107 | * Add all help content to the current screen. 108 | * 109 | * @since 1.5.0 110 | */ 111 | public function add_help_content(): void { 112 | $this->add_help_tabs(); 113 | $this->set_help_sidebar(); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/Core/RewriteRules.php: -------------------------------------------------------------------------------- 1 | generate_rules_by_source( $wp_rewrite ); 39 | 40 | // Apply the filters used in core just in case. 41 | foreach ( $rewrite_rules_by_source as $source => $rules ) { 42 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- core hook. 43 | $rewrite_rules_by_source[ $source ] = apply_filters( $source . '_rewrite_rules', $rules ); 44 | if ( 'post_tag' === $source ) { 45 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core hook. 46 | $rewrite_rules_by_source[ $source ] = apply_filters( 'tag_rewrite_rules', $rules ); 47 | } 48 | } 49 | 50 | // Match rules with their sources. 51 | foreach ( $rewrite_rules as $rule => $rewrite ) { 52 | $rewrite_rules_array[ $rule ]['rewrite'] = $rewrite; 53 | foreach ( $rewrite_rules_by_source as $source => $rules ) { 54 | if ( array_key_exists( $rule, $rules ) ) { 55 | $rewrite_rules_array[ $rule ]['source'] = $source; 56 | } 57 | } 58 | 59 | if ( ! isset( $rewrite_rules_array[ $rule ]['source'] ) ) { 60 | $rewrite_rules_array[ $rule ]['source'] = apply_filters( 'rewrite_rules_inspector_source', 'other', $rule, $rewrite ); 61 | } 62 | } 63 | 64 | // Find any rewrite rules that should've been generated but weren't. 65 | $maybe_missing = $wp_rewrite->rewrite_rules(); 66 | $rewrite_rules_array = array_reverse( $rewrite_rules_array, true ); 67 | foreach ( $maybe_missing as $rule => $rewrite ) { 68 | if ( ! array_key_exists( $rule, $rewrite_rules_array ) ) { 69 | $rewrite_rules_array[ $rule ] = [ 70 | 'rewrite' => $rewrite, 71 | 'source' => 'missing', 72 | ]; 73 | } 74 | } 75 | 76 | // Prepend rules so it's obvious. 77 | $rewrite_rules_array = array_reverse( $rewrite_rules_array, true ); 78 | 79 | // Allow static sources of rewrite rules to override, etc. 80 | $rewrite_rules_array = apply_filters( 'rri_rewrite_rules', $rewrite_rules_array ); 81 | 82 | // Set the sources used in our filtering. 83 | $sources = [ 'all' ]; 84 | foreach ( $rewrite_rules_array as $rule => $data ) { 85 | $sources[] = $data['source']; 86 | } 87 | 88 | $this->sources = array_unique( $sources ); 89 | 90 | // Apply filtering based on search and source. 91 | $rewrite_rules_array = $this->apply_filters( $rewrite_rules_array ); 92 | 93 | return $rewrite_rules_array; 94 | } 95 | 96 | /** 97 | * Generate rewrite rules by source. 98 | * 99 | * @since 1.5.0 100 | * @param \WP_Rewrite $wp_rewrite WordPress rewrite object. 101 | * @return array Array of rules organized by source. 102 | */ 103 | private function generate_rules_by_source( \WP_Rewrite $wp_rewrite ): array { 104 | $rewrite_rules_by_source = []; 105 | 106 | // Core permastructs. 107 | $rewrite_rules_by_source['post'] = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->permalink_structure, EP_PERMALINK ); 108 | $rewrite_rules_by_source['date'] = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->get_date_permastruct(), EP_DATE ); 109 | $rewrite_rules_by_source['root'] = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->root . '/', EP_ROOT ); 110 | $rewrite_rules_by_source['comments'] = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->root . $wp_rewrite->comments_base, EP_COMMENTS, true, true, true, false ); 111 | $rewrite_rules_by_source['search'] = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->get_search_permastruct(), EP_SEARCH ); 112 | $rewrite_rules_by_source['author'] = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->get_author_permastruct(), EP_AUTHORS ); 113 | $rewrite_rules_by_source['page'] = $wp_rewrite->page_rewrite_rules(); 114 | 115 | // Extra permastructs including tags, categories, etc. 116 | foreach ( $wp_rewrite->extra_permastructs as $permastructname => $permastruct ) { 117 | if ( is_array( $permastruct ) ) { 118 | // Pre 3.4 compat. 119 | if ( count( $permastruct ) === 2 ) { 120 | $rewrite_rules_by_source[ $permastructname ] = $wp_rewrite->generate_rewrite_rules( $permastruct[0], $permastruct[1] ); 121 | } else { 122 | $rewrite_rules_by_source[ $permastructname ] = $wp_rewrite->generate_rewrite_rules( $permastruct['struct'], $permastruct['ep_mask'], $permastruct['paged'], $permastruct['feed'], $permastruct['forcomments'], $permastruct['walk_dirs'], $permastruct['endpoints'] ); 123 | } 124 | } else { 125 | $rewrite_rules_by_source[ $permastructname ] = $wp_rewrite->generate_rewrite_rules( $permastruct, EP_NONE ); 126 | } 127 | } 128 | 129 | return $rewrite_rules_by_source; 130 | } 131 | 132 | /** 133 | * Apply search and source filters to rules. 134 | * 135 | * @since 1.5.0 136 | * @param array $rewrite_rules_array Array of rewrite rules. 137 | * @return array Filtered array of rewrite rules. 138 | */ 139 | private function apply_filters( array $rewrite_rules_array ): array { 140 | $match_path = $this->get_search_path(); 141 | 142 | $should_filter_by_source = ! empty( $_GET['source'] ) && 'all' !== $_GET['source'] && in_array( $_GET['source'], $this->sources, true ); 143 | 144 | // Filter based on match or source if necessary. 145 | foreach ( $rewrite_rules_array as $rule => $data ) { 146 | // If we're searching rules based on URL and there's no match, don't return it. 147 | if ( $match_path !== '' && $match_path !== '0' && ! preg_match( sprintf( '#^%s#', $rule ), $match_path ) ) { 148 | unset( $rewrite_rules_array[ $rule ] ); 149 | } elseif ( $should_filter_by_source && $data['source'] !== $_GET['source'] ) { 150 | unset( $rewrite_rules_array[ $rule ] ); 151 | } 152 | } 153 | 154 | return $rewrite_rules_array; 155 | } 156 | 157 | /** 158 | * Get the search path from URL parameter. 159 | * 160 | * @since 1.5.0 161 | * @return string The search path. 162 | */ 163 | private function get_search_path(): string { 164 | $match_path = ''; 165 | 166 | if ( ! empty( $_GET['s'] ) ) { 167 | $input = sanitize_text_field( $_GET['s'] ); 168 | 169 | // If the input doesn't start with http:// or https://, treat it as a path. 170 | if ( ! preg_match( '/^https?:\/\//', $input ) ) { 171 | $match_path = $input; 172 | } else { 173 | $match_path = wp_parse_url( esc_url( $input ), PHP_URL_PATH ); 174 | } 175 | 176 | // Ensure we have a string value. 177 | if ( null === $match_path ) { 178 | $match_path = ''; 179 | } 180 | 181 | $wordpress_subdir_for_site = wp_parse_url( home_url(), PHP_URL_PATH ); 182 | if ( ! empty( $wordpress_subdir_for_site ) ) { 183 | $match_path = str_replace( $wordpress_subdir_for_site, '', $match_path ); 184 | } 185 | 186 | $match_path = ltrim( $match_path, '/' ); 187 | } 188 | 189 | return $match_path; 190 | } 191 | 192 | /** 193 | * Get available sources for filtering. 194 | * 195 | * @since 1.5.0 196 | * @return array Array of available sources. 197 | */ 198 | public function get_sources(): array { 199 | return $this->sources; 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /src/Plugin.php: -------------------------------------------------------------------------------- 1 | initialize_services(); 116 | } 117 | 118 | /** 119 | * Initialize all services. 120 | * 121 | * @since 1.5.0 122 | */ 123 | private function initialize_services(): void { 124 | $this->rewrite_rules_service = new RewriteRules(); 125 | $this->permastruct_service = new Permastructs(); 126 | $this->file_export_service = new FileExport( $this->view_cap ); 127 | $this->rule_flush_service = new RuleFlush( $this->flushing_enabled, $this->view_cap ); 128 | $this->url_tester_service = new UrlTester(); 129 | $this->view_renderer = new ViewRenderer( plugin_dir_path( __DIR__ ) ); 130 | $this->help_service = new ContextualHelp(); 131 | $this->admin_page = new AdminPage( $this->parent_slug, $this->page_slug, $this->view_cap, [ $this, 'view_rules' ], $this->help_service ); 132 | } 133 | 134 | /** 135 | * Run the integration. 136 | * 137 | * @since 1.3.0 138 | */ 139 | public function run(): void { 140 | // This plugin only runs in the admin, but we need it initialized on init. 141 | add_action( 'init', [ $this, 'action_init' ] ); 142 | 143 | // Register and enqueue admin styles. 144 | add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_styles' ] ); 145 | 146 | } 147 | 148 | /** 149 | * Initialize the plugin. 150 | * 151 | * @since 1.0.0 152 | */ 153 | public function action_init(): void { 154 | if ( ! is_admin() ) { 155 | return; 156 | } 157 | 158 | // Allow the view to be placed elsewhere than tools.php. 159 | $this->parent_slug = apply_filters( 'rri_parent_slug', $this->parent_slug ); 160 | 161 | // Whether or not users can flush the rewrite rules from this tool. 162 | $this->flushing_enabled = apply_filters( 'rri_flushing_enabled', $this->flushing_enabled ); 163 | 164 | // Re-initialize services with updated settings. 165 | $this->initialize_services(); 166 | 167 | // Register admin page. 168 | $this->admin_page->register(); 169 | 170 | // User actions available for the rewrite rules page. 171 | if ( isset( $_GET['page'], $_GET['action'] ) && $_GET['page'] === $this->page_slug && 'download-rules' === $_GET['action'] ) { 172 | add_action( 'admin_init', [ $this, 'download_rules' ] ); 173 | } elseif ( isset( $_GET['page'], $_GET['action'] ) && $_GET['page'] === $this->page_slug && 'flush-rules' === $_GET['action'] ) { 174 | add_action( 'admin_init', [ $this, 'flush_rules' ] ); 175 | } 176 | } 177 | 178 | /** 179 | * Enqueue admin styles and scripts for the rewrite rules inspector page. 180 | * 181 | * @since 1.5.0 182 | * @param string $hook_suffix The current admin page hook suffix. 183 | */ 184 | public function enqueue_admin_styles( string $hook_suffix ): void { 185 | // Only enqueue on our admin page. 186 | if ( 'tools_page_' . $this->page_slug !== $hook_suffix ) { 187 | return; 188 | } 189 | 190 | $css_url = plugin_dir_url( __DIR__ ) . 'assets/css/admin.css'; 191 | $js_url = plugin_dir_url( __DIR__ ) . 'assets/js/admin.js'; 192 | $version = REWRITE_RULES_INSPECTOR_VERSION; 193 | 194 | // Enqueue styles. 195 | wp_enqueue_style( 196 | 'rewrite-rules-inspector-admin', 197 | $css_url, 198 | [], 199 | $version 200 | ); 201 | 202 | // Enqueue scripts. 203 | wp_enqueue_script( 204 | 'rewrite-rules-inspector-admin', 205 | $js_url, 206 | [ 'jquery' ], 207 | $version, 208 | true 209 | ); 210 | } 211 | 212 | /** 213 | * View the rewrite rules for the site. 214 | * 215 | * @since 1.0.0 216 | */ 217 | public function view_rules(): void { 218 | $rules = $this->rewrite_rules_service->get_rules(); 219 | $sources = $this->rewrite_rules_service->get_sources(); 220 | $permastructs = $this->permastruct_service->get_permastructs(); 221 | 222 | $wp_list_table = new RewriteRulesTable( $rules, $sources, $this->flushing_enabled ); 223 | $wp_list_table->prepare_items(); 224 | 225 | // Test URL if one is provided. 226 | $url_test_results = null; 227 | if ( ! empty( $_GET['s'] ) ) { 228 | $url = sanitize_text_field( $_GET['s'] ); 229 | // Use the same filtered rules for URL testing to ensure consistency. 230 | $url_test_results = $this->url_tester_service->test_url_with_rules( $url, $rules ); 231 | } 232 | $flush_success = ( isset( $_GET['message'] ) && 'flush-success' === $_GET['message'] ); 233 | 234 | $this->view_renderer->render_rules_view( $rules, $permastructs, $wp_list_table, $url_test_results, $flush_success ); 235 | } 236 | 237 | /** 238 | * Process a user's request to download a set of the rewrite rules. 239 | * 240 | * @since 1.0.0 241 | */ 242 | public function download_rules(): void { 243 | $rules = $this->rewrite_rules_service->get_rules(); 244 | $this->file_export_service->download_rules( $rules ); 245 | } 246 | 247 | /** 248 | * Allow a user to flush rewrite rules for their site. 249 | * 250 | * @since 1.0.0 251 | */ 252 | public function flush_rules(): void { 253 | global $plugin_page; 254 | $redirect_url = menu_page_url( $plugin_page, false ); 255 | $this->rule_flush_service->flush_rules( $redirect_url ); 256 | } 257 | 258 | 259 | /** 260 | * Get the URL tester service. 261 | * 262 | * @since 1.5.0 263 | * @return UrlTester The URL tester service. 264 | */ 265 | public function get_url_tester(): UrlTester { 266 | return $this->url_tester_service; 267 | } 268 | } 269 | -------------------------------------------------------------------------------- /src/Admin/RewriteRulesTable.php: -------------------------------------------------------------------------------- 1 | items = $rules; 45 | $this->sources = $sources; 46 | $this->flushing_enabled = $flushing_enabled; 47 | 48 | parent::__construct( 49 | [ 50 | 'plural' => 'Rewrite Rules', 51 | ] 52 | ); 53 | } 54 | 55 | /** 56 | * Load all of the matching rewrite rules into our list table. 57 | * 58 | * @since 1.0.0 59 | */ 60 | public function prepare_items() { 61 | $columns = $this->get_columns(); 62 | $hidden = []; 63 | $sortable = []; 64 | $this->_column_headers = [ $columns, $hidden, $sortable ]; 65 | } 66 | 67 | /** 68 | * What to print when no items were found. 69 | * 70 | * @since 1.0.0 71 | */ 72 | public function no_items() { 73 | esc_html_e( 'No rewrite rules were found.', 'rewrite-rules-inspector' ); 74 | } 75 | 76 | /** 77 | * Display the list of views available on this table. 78 | * 79 | * @since 1.0.0 80 | */ 81 | public function get_views(): array { 82 | return []; 83 | } 84 | 85 | /** 86 | * Display the search box. 87 | * 88 | * @since 1.0.0 89 | * @param string $text The 'submit' button label. 90 | * @param string $input_id ID attribute value for the search input field. 91 | */ 92 | public function search_box( $text, $input_id ) { 93 | // This is intentionally empty since we have a custom search box. 94 | } 95 | 96 | /** 97 | * Display the pagination. 98 | * 99 | * @since 1.0.0 100 | * @param string $which The location of the pagination: 'top' or 'bottom'. 101 | */ 102 | protected function pagination( $which ) { 103 | // This is intentionally empty since we don't paginate. 104 | } 105 | 106 | /** 107 | * Display a view switcher. 108 | * 109 | * @since 1.0.0 110 | * @param string $current_mode The current view mode. 111 | */ 112 | protected function view_switcher( $current_mode ) { 113 | // This is intentionally empty since we don't have view modes. 114 | } 115 | 116 | /** 117 | * Display the bulk actions dropdown. 118 | * 119 | * @since 1.0.0 120 | * @param string $which The location of the bulk actions: 'top' or 'bottom'. 121 | */ 122 | protected function bulk_actions( $which = '' ) { 123 | // This is intentionally empty since we don't have bulk actions. 124 | } 125 | 126 | /** 127 | * Display the list table. 128 | * 129 | * @since 1.0.0 130 | */ 131 | public function display() { 132 | $this->display_tablenav( 'top' ); 133 | 134 | // Only show the table if there are items to display 135 | if ( $this->has_items() ) { 136 | ?> 137 |
313 |
316 | ' . wp_kses_post( $error_message ) . '
'; 124 | } 125 | } elseif ( $missing_count > 0 ) { 126 | /* translators: %d: Count of missing rewrite rules */ 127 | $error_message = apply_filters( 'rri_message_missing_rules', sprintf( _n( '%d rewrite rule may be missing, try flushing.', '%d rewrite rules may be missing, try flushing.', $missing_count, 'rewrite-rules-inspector' ), $missing_count ) ); 128 | echo '' . wp_kses_post( $error_message ) . '
178 | 185 |
189 | 196 |
| 207 | | |
208 |
|---|---|
| 211 | | |
212 |
| 215 | | 216 | |
| 220 | |
221 | ' . esc_html( $query_string ) . '';
232 | } else {
233 | // Array format - show key-value pairs, removing index.php? prefix from keys
234 | foreach ( $query_vars as $key => $value ) :
235 | // Remove index.php? prefix from key if present
236 | $clean_key = $key;
237 | if ( strpos( $key, 'index.php?' ) === 0 ) {
238 | $clean_key = substr( $key, 10 );
239 | }
240 | ?>
241 | = 242 | 245 | |
246 |
' . esc_html__( 'Rewrite rules flushed.', 'rewrite-rules-inspector' ) . '
'; 277 | } 278 | } 279 | -------------------------------------------------------------------------------- /assets/css/admin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Rewrite Rules Inspector Admin Styles 3 | * 4 | * @package automattic\rewrite-rules-inspector 5 | * @since 1.5.0 6 | */ 7 | 8 | /* ========================================================================== 9 | CSS Custom Properties (Variables) 10 | ========================================================================== */ 11 | 12 | :root { 13 | --rri-primary-color: #0073aa; 14 | --rri-border-color: #c3c4c7; 15 | --rri-background-light: #f6f7f7; 16 | --rri-text-color: #1d2327; 17 | --rri-border-radius: 4px; 18 | --rri-spacing-xs: 4px; 19 | --rri-spacing-sm: 8px; 20 | --rri-spacing-md: 16px; 21 | --rri-spacing-xl: 32px; 22 | } 23 | 24 | /* ========================================================================== 25 | Layout and Structure 26 | ========================================================================== */ 27 | 28 | .rri-admin-page { 29 | max-width: 100%; 30 | } 31 | 32 | .rri-section { 33 | margin-bottom: var(--rri-spacing-xl); 34 | } 35 | 36 | /* ========================================================================== 37 | Tabs 38 | ========================================================================== */ 39 | /* WordPress provides base styles for .nav-tab-wrapper and .nav-tab */ 40 | .nav-tab-wrapper { 41 | margin-bottom: 12px; 42 | } 43 | 44 | /* ========================================================================== 45 | Rewrite Rules Table Styles 46 | ========================================================================== */ 47 | 48 | #the-list tr.type-sunrise, 49 | #the-list tr.type-custom { 50 | background-color: #eec7f0; 51 | transition: background-color 0.2s ease; 52 | } 53 | 54 | #the-list tr.type-sunrise:hover, 55 | #the-list tr.type-custom:hover { 56 | background-color: #e6b8e8; 57 | } 58 | 59 | #the-list tr.type-sunrise td, 60 | #the-list tr.type-custom td { 61 | border-top-color: #f4e6f5; 62 | border-bottom-color: #efbbf2; 63 | } 64 | 65 | #the-list tr.source-missing { 66 | background-color: #f7a8a9; 67 | transition: background-color 0.2s ease; 68 | } 69 | 70 | #the-list tr.source-missing:hover { 71 | background-color: #f48a8c; 72 | } 73 | 74 | #the-list tr.type-missing td { 75 | border-top-color: #fecfd0; 76 | border-bottom-color: #f99b9d; 77 | } 78 | 79 | /* ========================================================================== 80 | Permastructs Section Styles 81 | ========================================================================== */ 82 | 83 | #permastructs-section { 84 | margin-top: var(--rri-spacing-xl); 85 | } 86 | 87 | .permastructs-table-wrapper { 88 | overflow-x: auto; 89 | margin-top: var(--rri-spacing-md); 90 | } 91 | 92 | .permastructs-table { 93 | margin-top: 0; 94 | } 95 | 96 | .permastruct-structure { 97 | font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; 98 | background: var(--rri-background-light); 99 | padding: var(--rri-spacing-xs) var(--rri-spacing-sm); 100 | border-radius: var(--rri-border-radius); 101 | font-size: 13px; 102 | border: 1px solid var(--rri-border-color); 103 | display: inline-block; 104 | max-width: 100%; 105 | word-break: break-all; 106 | transition: all 0.2s ease; 107 | } 108 | 109 | .permastruct-structure:hover { 110 | background: #e8e9ea; 111 | border-color: var(--rri-primary-color); 112 | } 113 | 114 | /* ========================================================================== 115 | List Table Navigation Styles 116 | ========================================================================== */ 117 | 118 | .custom-tablenav-top { 119 | padding: var(--rri-spacing-sm) 0; 120 | } 121 | 122 | .custom-tablenav-top .tablenav-actions { 123 | float: right; 124 | display: flex; 125 | align-items: center; 126 | gap: var(--rri-spacing-sm); 127 | } 128 | 129 | .rri-rules-count { 130 | color: #666; 131 | font-size: 13px; 132 | margin-right: var(--rri-spacing-sm); 133 | } 134 | 135 | /* Priority column should be narrow */ 136 | .column-priority { 137 | width: 60px; 138 | text-align: center; 139 | } 140 | 141 | .custom-tablenav-top form { 142 | display: inline-block; 143 | margin-right: var(--rri-spacing-md); 144 | vertical-align: middle; 145 | } 146 | 147 | .custom-tablenav-top form > * { 148 | margin-right: var(--rri-spacing-xs); 149 | } 150 | 151 | .custom-tablenav-top form > *:last-child { 152 | margin-right: 0; 153 | } 154 | 155 | .custom-tablenav-top label { 156 | font-weight: 600; 157 | color: var(--rri-text-color); 158 | vertical-align: middle; 159 | } 160 | 161 | .custom-tablenav-top input[type="text"], 162 | .custom-tablenav-top select, 163 | .custom-tablenav-top .button { 164 | height: 28px; 165 | padding: 0 8px; 166 | border: 1px solid var(--rri-border-color); 167 | border-radius: var(--rri-border-radius); 168 | font-size: 13px; 169 | line-height: 26px; 170 | vertical-align: middle; 171 | box-sizing: border-box; 172 | } 173 | 174 | .custom-tablenav-top select { 175 | min-width: 120px; 176 | } 177 | 178 | .custom-tablenav-top input[type="text"]:focus, 179 | .custom-tablenav-top select:focus { 180 | border-color: var(--rri-primary-color); 181 | outline: none; 182 | box-shadow: 0 0 0 1px var(--rri-primary-color); 183 | } 184 | 185 | .custom-tablenav-top .button { 186 | display: inline-block; 187 | text-decoration: none; 188 | text-align: center; 189 | cursor: pointer; 190 | background: #f6f7f7; 191 | color: var(--rri-text-color); 192 | } 193 | 194 | .custom-tablenav-top .button:hover { 195 | background: #f0f0f1; 196 | border-color: #8c8f94; 197 | } 198 | 199 | .custom-tablenav-top .button-primary { 200 | background: var(--rri-primary-color); 201 | color: #fff; 202 | border-color: var(--rri-primary-color); 203 | } 204 | 205 | .custom-tablenav-top .button-primary:hover { 206 | background: #005a87; 207 | border-color: #005a87; 208 | } 209 | 210 | /* ========================================================================== 211 | Responsive Design 212 | ========================================================================== */ 213 | 214 | @media (max-width: 782px) { 215 | .custom-tablenav-top .tablenav-actions { 216 | float: none; 217 | display: block; 218 | margin-top: var(--rri-spacing-sm); 219 | } 220 | 221 | .custom-tablenav-top form { 222 | display: block; 223 | margin-right: 0; 224 | margin-bottom: var(--rri-spacing-sm); 225 | } 226 | 227 | .custom-tablenav-top form > * { 228 | margin-right: var(--rri-spacing-xs); 229 | margin-bottom: var(--rri-spacing-xs); 230 | } 231 | 232 | .permastructs-table-wrapper { 233 | font-size: 14px; 234 | } 235 | 236 | .permastruct-structure { 237 | font-size: 12px; 238 | padding: 2px 4px; 239 | } 240 | 241 | } 242 | 243 | @media (max-width: 600px) { 244 | .custom-tablenav-top input[type="text"] { 245 | width: 100%; 246 | } 247 | } 248 | 249 | /* ========================================================================== 250 | Accessibility Improvements 251 | ========================================================================== */ 252 | 253 | /* Focus indicators */ 254 | .rri-admin-page *:focus { 255 | outline: 2px solid var(--rri-primary-color); 256 | outline-offset: 2px; 257 | } 258 | 259 | /* High contrast mode support */ 260 | @media (prefers-contrast: high) { 261 | :root { 262 | --rri-border-color: #000; 263 | --rri-background-light: #fff; 264 | --rri-text-muted: #000; 265 | } 266 | } 267 | 268 | /* Reduced motion support */ 269 | @media (prefers-reduced-motion: reduce) { 270 | * { 271 | transition: none !important; 272 | animation: none !important; 273 | } 274 | } 275 | 276 | /* ========================================================================== 277 | JavaScript Enhancement Styles 278 | ========================================================================== */ 279 | 280 | /* Highlight effect for smooth scrolling targets */ 281 | .rri-highlight { 282 | animation: rri-highlight 2s ease-in-out; 283 | } 284 | 285 | @keyframes rri-highlight { 286 | 0% { background-color: transparent; } 287 | 50% { background-color: rgba(0, 115, 170, 0.1); } 288 | 100% { background-color: transparent; } 289 | } 290 | 291 | /* Active state for jump links */ 292 | .jump-link.rri-active { 293 | color: var(--rri-primary-color); 294 | text-decoration: none; 295 | } 296 | 297 | /* Screen reader text utility */ 298 | .screen-reader-text { 299 | border: 0; 300 | clip: rect(1px, 1px, 1px, 1px); 301 | clip-path: inset(50%); 302 | height: 1px; 303 | margin: -1px; 304 | overflow: hidden; 305 | padding: 0; 306 | position: absolute !important; 307 | width: 1px; 308 | word-wrap: normal !important; 309 | } 310 | 311 | /* ========================================================================== 312 | Print Styles 313 | ========================================================================== */ 314 | 315 | @media print { 316 | .jump-link, 317 | .custom-tablenav-top { 318 | display: none; 319 | } 320 | 321 | .permastruct-structure { 322 | background: transparent; 323 | border: 1px solid #000; 324 | } 325 | 326 | .rri-highlight { 327 | animation: none; 328 | background: transparent !important; 329 | } 330 | } 331 | 332 | /* URL Test Results Styling */ 333 | .rri-url-test-results { 334 | margin: 20px 0; 335 | padding: 20px; 336 | background: #f9f9f9; 337 | border: 1px solid #ddd; 338 | border-radius: 4px; 339 | } 340 | 341 | /* Notices kept inside the tab content to avoid core relocation */ 342 | .rri-notice { 343 | /* Match core .notice spacing */ 344 | margin: 5px 0 15px; 345 | padding: 12px; 346 | background: #fff; 347 | border-left: 4px solid #72aee6; /* info color default */ 348 | box-shadow: 0 1px 1px rgba(0,0,0,.04); 349 | color: #1d2327; 350 | } 351 | 352 | .rri-notice p { 353 | margin: .5em 0; 354 | } 355 | 356 | .rri-notice-success { 357 | border-left-color: #46b450; /* core success */ 358 | } 359 | 360 | .rri-notice-error { 361 | border-left-color: #dc3232; /* core error */ 362 | } 363 | 364 | .rri-url-test-results h3 { 365 | margin-top: 0; 366 | color: #23282d; 367 | } 368 | 369 | .rri-test-summary p { 370 | margin: 8px 0; 371 | } 372 | 373 | .rri-test-summary code { 374 | background: #fff; 375 | padding: 2px 6px; 376 | border: 1px solid #ddd; 377 | border-radius: 3px; 378 | font-family: Consolas, Monaco, monospace; 379 | } 380 | 381 | .rri-first-match { 382 | margin: 20px 0; 383 | } 384 | 385 | .rri-first-match h4 { 386 | margin-bottom: 10px; 387 | color: #23282d; 388 | } 389 | 390 | .rri-first-match table { 391 | margin: 0; 392 | } 393 | 394 | .rri-first-match th { 395 | width: 150px; 396 | text-align: left; 397 | vertical-align: top; 398 | padding: 8px 12px; 399 | background: #f1f1f1; 400 | border-bottom: 1px solid #ddd; 401 | } 402 | 403 | .rri-first-match td { 404 | padding: 8px 12px; 405 | border-bottom: 1px solid #ddd; 406 | } 407 | 408 | .rri-first-match code { 409 | background: #fff; 410 | padding: 2px 6px; 411 | border: 1px solid #ddd; 412 | border-radius: 3px; 413 | font-family: Consolas, Monaco, monospace; 414 | display: inline-block; 415 | margin: 2px 0; 416 | } 417 | 418 | .rri-all-matches { 419 | margin: 20px 0; 420 | } 421 | 422 | .rri-all-matches h4 { 423 | margin-bottom: 10px; 424 | color: #23282d; 425 | } 426 | 427 | .rri-all-matches ol { 428 | margin: 0; 429 | padding-left: 20px; 430 | } 431 | 432 | .rri-all-matches li { 433 | margin: 8px 0; 434 | } 435 | 436 | .rri-all-matches code { 437 | background: #fff; 438 | padding: 2px 6px; 439 | border: 1px solid #ddd; 440 | border-radius: 3px; 441 | font-family: Consolas, Monaco, monospace; 442 | } 443 | 444 | .rri-match-source { 445 | color: #666; 446 | font-style: italic; 447 | margin-left: 8px; 448 | } 449 | 450 | /* Filter form improvements */ 451 | .rri-filter-row { 452 | display: flex; 453 | align-items: center; 454 | gap: 10px; 455 | flex-wrap: wrap; 456 | } 457 | 458 | .rri-filter-row label { 459 | font-weight: 600; 460 | margin-right: 5px; 461 | } 462 | 463 | .rri-filter-row input[type="text"] { 464 | min-width: 300px; 465 | } 466 | 467 | .rri-filter-row select { 468 | min-width: 120px; 469 | } 470 | -------------------------------------------------------------------------------- /languages/rewrite-rules-inspector.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 Automattic, Daniel Bachhuber 2 | # This file is distributed under the GPL-2.0-or-later. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Rewrite Rules Inspector 1.5.1\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/rewrite-rules-inspector\n" 7 | "Last-Translator: FULL NAME^category/([^/]+)/?$)"
68 | msgstr ""
69 |
70 | #: src/Admin/ContextualHelp.php:41
71 | msgid "Rewrite: The internal WordPress query that gets executed (e.g., index.php?category_name=$matches[1])"
72 | msgstr ""
73 |
74 | #: src/Admin/ContextualHelp.php:42
75 | msgid "Source: Where the rule comes from (e.g., category, post, custom permastruct)"
76 | msgstr ""
77 |
78 | #: src/Admin/ContextualHelp.php:44
79 | msgid "When someone visits a URL, WordPress checks these rules in order until it finds a match, then executes the corresponding rewrite to determine what content to show."
80 | msgstr ""
81 |
82 | #: src/Admin/ContextualHelp.php:52
83 | #: src/Admin/ViewRenderer.php:75
84 | #: src/Admin/ViewRenderer.php:95
85 | #: views/permastructs-table.php:18
86 | msgid "Permastructs"
87 | msgstr ""
88 |
89 | #: src/Admin/ContextualHelp.php:53
90 | msgid "Permastructs are the URL structure templates that define how different types of content should be accessed via URLs."
91 | msgstr ""
92 |
93 | #: src/Admin/ContextualHelp.php:54
94 | msgid "For example:"
95 | msgstr ""
96 |
97 | #. translators: %year%, %monthnum%, %day%, %postname% are permalink structure tags. Keep them as-is in the URL example.
98 | #: src/Admin/ContextualHelp.php:57
99 | #, php-format
100 | msgid "Post Permalink: /%year%/%monthnum%/%day%/%postname%/ - defines how individual posts are accessed"
101 | msgstr ""
102 |
103 | #. translators: %category% is a permalink structure tag. Keep it as-is in the URL example.
104 | #: src/Admin/ContextualHelp.php:59
105 | #, php-format
106 | msgid "Category Archive: /category/%category% - defines how category pages are accessed"
107 | msgstr ""
108 |
109 | #. translators: %post_tag% is a permalink structure tag. Keep it as-is in the URL example.
110 | #: src/Admin/ContextualHelp.php:61
111 | msgid "Tag Archive: /tag/%post_tag% - defines how tag pages are accessed"
112 | msgstr ""
113 |
114 | #: src/Admin/ContextualHelp.php:63
115 | msgid "WordPress uses these permastructs to generate the actual rewrite rules. The permastructs are like blueprints, while the rewrite rules are the specific patterns that get created from those blueprints."
116 | msgstr ""
117 |
118 | #: src/Admin/ContextualHelp.php:64
119 | msgid "You can customize permastructs through WordPress settings (Settings → Permalinks) or by using WordPress functions like add_permastruct() in your theme or plugin."
120 | msgstr ""
121 |
122 | #: src/Admin/ContextualHelp.php:72
123 | msgid "Troubleshooting"
124 | msgstr ""
125 |
126 | #: src/Admin/ContextualHelp.php:73
127 | msgid "Common Issues:"
128 | msgstr ""
129 |
130 | #: src/Admin/ContextualHelp.php:75
131 | msgid "Missing Rules: If you see rules marked as \"missing\", try clicking the \"Flush Rules\" button to regenerate them."
132 | msgstr ""
133 |
134 | #: src/Admin/ContextualHelp.php:76
135 | msgid "404 Errors: Check if the URL pattern exists in the rewrite rules. Use the \"Match URL\" filter to test specific URLs."
136 | msgstr ""
137 |
138 | #: src/Admin/ContextualHelp.php:77
139 | msgid "Custom URLs Not Working: Verify that your custom permastruct is properly registered and that rewrite rules have been flushed."
140 | msgstr ""
141 |
142 | #: src/Admin/ContextualHelp.php:78
143 | msgid "Plugin Conflicts: Some plugins may modify rewrite rules. Check the \"Source\" column to see which rules come from which sources."
144 | msgstr ""
145 |
146 | #: src/Admin/ContextualHelp.php:80
147 | msgid "Tips:"
148 | msgstr ""
149 |
150 | #: src/Admin/ContextualHelp.php:82
151 | msgid "Use the \"Rule Source\" filter to focus on specific types of rules."
152 | msgstr ""
153 |
154 | #: src/Admin/ContextualHelp.php:83
155 | msgid "Download the rules as a text file for offline analysis."
156 | msgstr ""
157 |
158 | #: src/Admin/ContextualHelp.php:84
159 | msgid "Check the permastructs section to understand the URL structure templates."
160 | msgstr ""
161 |
162 | #: src/Admin/ContextualHelp.php:99
163 | msgid "For more information:"
164 | msgstr ""
165 |
166 | #: src/Admin/ContextualHelp.php:100
167 | msgid "WordPress Permalinks Documentation"
168 | msgstr ""
169 |
170 | #: src/Admin/ContextualHelp.php:101
171 | msgid "WordPress Rewrite API"
172 | msgstr ""
173 |
174 | #: src/Admin/ContextualHelp.php:102
175 | msgid "Plugin on GitHub"
176 | msgstr ""
177 |
178 | #: src/Admin/RewriteRulesTable.php:73
179 | msgid "No rewrite rules were found."
180 | msgstr ""
181 |
182 | #. translators: %d: Number of rules
183 | #: src/Admin/RewriteRulesTable.php:185
184 | #, php-format
185 | msgid "%d rule for this selection"
186 | msgid_plural "%d rules for this selection"
187 | msgstr[0] ""
188 | msgstr[1] ""
189 |
190 | #. translators: %d: Number of rules
191 | #: src/Admin/RewriteRulesTable.php:191
192 | #, php-format
193 | msgid "%d rule total"
194 | msgid_plural "%d rules total"
195 | msgstr[0] ""
196 | msgstr[1] ""
197 |
198 | #: src/Admin/RewriteRulesTable.php:218
199 | msgid "Flush Rules"
200 | msgstr ""
201 |
202 | #: src/Admin/RewriteRulesTable.php:237
203 | msgid "Download"
204 | msgstr ""
205 |
206 | #: src/Admin/RewriteRulesTable.php:241
207 | msgid "Test URL:"
208 | msgstr ""
209 |
210 | #: src/Admin/RewriteRulesTable.php:242
211 | msgid "Enter URL (e.g., /my-page/ or https://example.com/my-page/)"
212 | msgstr ""
213 |
214 | #: src/Admin/RewriteRulesTable.php:244
215 | msgid "Rule Source:"
216 | msgstr ""
217 |
218 | #: src/Admin/RewriteRulesTable.php:259
219 | msgid "Test URL"
220 | msgstr ""
221 |
222 | #: src/Admin/RewriteRulesTable.php:261
223 | msgid "Reset"
224 | msgstr ""
225 |
226 | #: src/Admin/RewriteRulesTable.php:278
227 | msgid "Priority"
228 | msgstr ""
229 |
230 | #: src/Admin/RewriteRulesTable.php:279
231 | msgid "Rule"
232 | msgstr ""
233 |
234 | #: src/Admin/RewriteRulesTable.php:280
235 | msgid "Rewrite"
236 | msgstr ""
237 |
238 | #: src/Admin/RewriteRulesTable.php:281
239 | #: src/Admin/ViewRenderer.php:214
240 | msgid "Source"
241 | msgstr ""
242 |
243 | #: src/Admin/RewriteRulesTable.php:320
244 | msgid "missing"
245 | msgstr ""
246 |
247 | #: src/Admin/ViewRenderer.php:57
248 | msgid "Rewrite Rules Inspector sections"
249 | msgstr ""
250 |
251 | #: src/Admin/ViewRenderer.php:122
252 | msgid "No rewrite rules yet, try flushing."
253 | msgstr ""
254 |
255 | #. translators: %d: Count of missing rewrite rules
256 | #: src/Admin/ViewRenderer.php:127
257 | #, php-format
258 | msgid "%d rewrite rule may be missing, try flushing."
259 | msgid_plural "%d rewrite rules may be missing, try flushing."
260 | msgstr[0] ""
261 | msgstr[1] ""
262 |
263 | #: src/Admin/ViewRenderer.php:155
264 | msgid "URL Test Results"
265 | msgstr ""
266 |
267 | #: src/Admin/ViewRenderer.php:158
268 | msgid "URL Tested:"
269 | msgstr ""
270 |
271 | #: src/Admin/ViewRenderer.php:159
272 | msgid "Path Tested:"
273 | msgstr ""
274 |
275 | #: src/Admin/ViewRenderer.php:167
276 | msgid "No rewrite rules match the selected rule source."
277 | msgstr ""
278 |
279 | #: src/Admin/ViewRenderer.php:177
280 | msgid "Result: 404 Error"
281 | msgstr ""
282 |
283 | #. translators: %d: Number of rules tested
284 | #: src/Admin/ViewRenderer.php:181
285 | #, php-format
286 | msgid "This URL does not match any of the %d rewrite rules and would result in a 404 error."
287 | msgstr ""
288 |
289 | #: src/Admin/ViewRenderer.php:188
290 | msgid "Result: No matching rules"
291 | msgstr ""
292 |
293 | #. translators: %d: Number of rules tested
294 | #: src/Admin/ViewRenderer.php:192
295 | #, php-format
296 | msgid "This URL does not match any of the %d rewrite rules, but it may be handled by WordPress core routing."
297 | msgstr ""
298 |
299 | #: src/Admin/ViewRenderer.php:203
300 | msgid "First Match (WordPress will use this):"
301 | msgstr ""
302 |
303 | #: src/Admin/ViewRenderer.php:206
304 | msgid "Rule Pattern"
305 | msgstr ""
306 |
307 | #: src/Admin/ViewRenderer.php:210
308 | msgid "Rewrite Target"
309 | msgstr ""
310 |
311 | #: src/Admin/ViewRenderer.php:219
312 | msgid "Query Variables"
313 | msgstr ""
314 |
315 | #: src/Admin/ViewRenderer.php:254
316 | msgid "Additional Matching Rules:"
317 | msgstr ""
318 |
319 | #. translators: %d: Number of additional matches
320 | #: src/Admin/ViewRenderer.php:258
321 | #, php-format
322 | msgid "See the table below for all %d matching rules in priority order."
323 | msgstr ""
324 |
325 | #: src/Admin/ViewRenderer.php:276
326 | msgid "Rewrite rules flushed."
327 | msgstr ""
328 |
329 | #: src/Core/FileExport.php:45
330 | #: src/Core/RuleFlush.php:51
331 | msgid "You do not have permissions to perform this action."
332 | msgstr ""
333 |
334 | #: src/Core/Permastructs.php:56
335 | msgid "Post Permalink"
336 | msgstr ""
337 |
338 | #: src/Core/Permastructs.php:58
339 | msgid "The permalink structure for posts"
340 | msgstr ""
341 |
342 | #: src/Core/Permastructs.php:61
343 | msgid "Date Archive"
344 | msgstr ""
345 |
346 | #: src/Core/Permastructs.php:63
347 | msgid "The permalink structure for date archives"
348 | msgstr ""
349 |
350 | #: src/Core/Permastructs.php:66
351 | msgid "Search Results"
352 | msgstr ""
353 |
354 | #: src/Core/Permastructs.php:68
355 | msgid "The permalink structure for search results"
356 | msgstr ""
357 |
358 | #: src/Core/Permastructs.php:71
359 | msgid "Author Archive"
360 | msgstr ""
361 |
362 | #: src/Core/Permastructs.php:73
363 | msgid "The permalink structure for author archives"
364 | msgstr ""
365 |
366 | #: src/Core/Permastructs.php:76
367 | msgid "Comments"
368 | msgstr ""
369 |
370 | #: src/Core/Permastructs.php:78
371 | msgid "The permalink structure for comments"
372 | msgstr ""
373 |
374 | #: src/Core/Permastructs.php:81
375 | msgid "Root"
376 | msgstr ""
377 |
378 | #: src/Core/Permastructs.php:83
379 | msgid "The root permalink structure"
380 | msgstr ""
381 |
382 | #. translators: %s: permastruct name
383 | #: src/Core/Permastructs.php:104
384 | #, php-format
385 | msgid "The permalink structure for %s"
386 | msgstr ""
387 |
388 | #: src/Core/Permastructs.php:156
389 | msgid "Category Archive"
390 | msgstr ""
391 |
392 | #: src/Core/Permastructs.php:157
393 | msgid "The permalink structure for category archives"
394 | msgstr ""
395 |
396 | #: src/Core/Permastructs.php:160
397 | msgid "Tag Archive"
398 | msgstr ""
399 |
400 | #: src/Core/Permastructs.php:161
401 | msgid "The permalink structure for tag archives"
402 | msgstr ""
403 |
404 | #: src/Core/Permastructs.php:164
405 | msgid "Post Format Archive"
406 | msgstr ""
407 |
408 | #: src/Core/Permastructs.php:165
409 | msgid "The permalink structure for post format archives"
410 | msgstr ""
411 |
412 | #: src/Core/Permastructs.php:168
413 | msgid "Test Custom (Demo)"
414 | msgstr ""
415 |
416 | #: src/Core/Permastructs.php:169
417 | msgid "A custom permastruct added for testing the permastructs display feature"
418 | msgstr ""
419 |
420 | #: src/Core/Permastructs.php:172
421 | msgid "Demo Archive (Test)"
422 | msgstr ""
423 |
424 | #: src/Core/Permastructs.php:173
425 | msgid "A demo archive permastruct with date-based structure for testing"
426 | msgstr ""
427 |
428 | #. translators: %1$s: URL, %2$d: Number of rules tested
429 | #: src/Core/UrlTester.php:273
430 | #, php-format
431 | msgid "The URL \"%1$s\" does not match any of the %2$d rewrite rules and would result in a 404 error."
432 | msgstr ""
433 |
434 | #. translators: %1$s: URL, %2$s: Rule pattern
435 | #: src/Core/UrlTester.php:285
436 | #, php-format
437 | msgid "The URL \"%1$s\" matches exactly one rewrite rule: %2$s"
438 | msgstr ""
439 |
440 | #. translators: %1$s: URL, %2$d: Number of matches, %3$s: First matching rule
441 | #: src/Core/UrlTester.php:293
442 | #, php-format
443 | msgid "The URL \"%1$s\" matches %2$d rewrite rules. The first match (which WordPress will use) is: %3$s"
444 | msgstr ""
445 |
446 | #. translators: %d: Count of permastructs
447 | #: views/permastructs-table.php:24
448 | #, php-format
449 | msgid "A listing of all %d permastructs that WordPress is aware of."
450 | msgstr ""
451 |
452 | #: views/permastructs-table.php:29
453 | msgid "WordPress Permastructs"
454 | msgstr ""
455 |
456 | #: views/permastructs-table.php:33
457 | #: views/permastructs-table.php:61
458 | msgid "Name"
459 | msgstr ""
460 |
461 | #: views/permastructs-table.php:36
462 | #: views/permastructs-table.php:64
463 | msgid "Structure"
464 | msgstr ""
465 |
466 | #: views/permastructs-table.php:39
467 | #: views/permastructs-table.php:67
468 | msgid "Description"
469 | msgstr ""
470 |
471 | #: views/permastructs-table.php:50
472 | msgid "Permastruct structure"
473 | msgstr ""
474 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |