Changeset 2761725
- Timestamp:
- 07/26/2022 11:13:15 AM (4 years ago)
- Location:
- cc-redirects
- Files:
-
- 67 added
- 4 deleted
- 19 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/.gitignore (added)
-
tags/1.1.0/.htaccess (added)
-
tags/1.1.0/AUTHORS.txt (added)
-
tags/1.1.0/LICENSE.txt (added)
-
tags/1.1.0/README.txt (added)
-
tags/1.1.0/assets (added)
-
tags/1.1.0/assets/css (added)
-
tags/1.1.0/assets/css/index.html (added)
-
tags/1.1.0/assets/css/style.css (added)
-
tags/1.1.0/assets/index.html (added)
-
tags/1.1.0/assets/js (added)
-
tags/1.1.0/assets/js/index.html (added)
-
tags/1.1.0/assets/js/script.js (added)
-
tags/1.1.0/includes (added)
-
tags/1.1.0/includes/Redirects.php (added)
-
tags/1.1.0/includes/Settings.php (added)
-
tags/1.1.0/includes/Table.php (added)
-
tags/1.1.0/includes/index.html (added)
-
tags/1.1.0/index.html (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/cc-redirects-pl_PL.mo (added)
-
tags/1.1.0/languages/cc-redirects-pl_PL.po (added)
-
tags/1.1.0/languages/index.html (added)
-
tags/1.1.0/plugin.php (added)
-
tags/1.1.0/screenshot-1.png (added)
-
tags/1.1.0/templates (added)
-
tags/1.1.0/templates/button.php (added)
-
tags/1.1.0/templates/code.php (added)
-
tags/1.1.0/templates/export.php (added)
-
tags/1.1.0/templates/icon.php (added)
-
tags/1.1.0/templates/import.php (added)
-
tags/1.1.0/templates/index.html (added)
-
tags/1.1.0/templates/input.php (added)
-
tags/1.1.0/templates/link.php (added)
-
tags/1.1.0/templates/menu.php (added)
-
tags/1.1.0/templates/notice.php (added)
-
tags/1.1.0/templates/paragraph.php (added)
-
tags/1.1.0/templates/redirects.php (added)
-
tags/1.1.0/templates/reset.php (added)
-
tags/1.1.0/templates/select.php (added)
-
tags/1.1.0/uninstall.php (added)
-
tags/1.1.0/vendor (added)
-
tags/1.1.0/vendor/autoload.php (added)
-
tags/1.1.0/vendor/classmap.php (added)
-
tags/1.1.0/vendor/clearcode (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/.gitignore (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/.htaccess (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/AUTHORS.txt (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/LICENSE.txt (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/README.md (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/composer.json (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/index.html (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/index.html (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3 (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/Filterer.php (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/Plugin.php (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/Singleton.php (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/index.html (added)
-
trunk/.htaccess (modified) (1 diff)
-
trunk/AUTHORS.txt (modified) (1 diff)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/css/style.css (modified) (1 diff)
-
trunk/assets/js (added)
-
trunk/assets/js/index.html (added)
-
trunk/assets/js/script.js (added)
-
trunk/composer.json (deleted)
-
trunk/composer.lock (deleted)
-
trunk/includes/Redirects.php (modified) (3 diffs)
-
trunk/includes/Settings.php (modified) (16 diffs)
-
trunk/includes/Table.php (modified) (3 diffs)
-
trunk/languages/cc-redirects-pl_PL.mo (modified) (previous)
-
trunk/languages/cc-redirects-pl_PL.po (modified) (4 diffs)
-
trunk/plugin.php (modified) (3 diffs)
-
trunk/screenshot-1.png (modified) (previous)
-
trunk/templates/button.php (added)
-
trunk/templates/input.php (modified) (1 diff)
-
trunk/templates/paragraph.php (added)
-
trunk/templates/redirects.php (modified) (1 diff)
-
trunk/templates/select.php (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/classmap.php (added)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Autoloader.php (deleted)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Filterer.php (modified) (2 diffs)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Plugin.php (modified) (3 diffs)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Singleton.php (modified) (3 diffs)
-
trunk/vendor/composer (deleted)
Legend:
- Unmodified
- Added
- Removed
-
cc-redirects/trunk/.htaccess
r1849203 r2761725 8 8 </IfModule> 9 9 10 <FilesMatch "^(s tyle\.css)$">10 <FilesMatch "^(script\.js|style\.css)$"> 11 11 <IfModule !mod_authz_core.c> 12 12 Allow from all -
cc-redirects/trunk/AUTHORS.txt
r1849203 r2761725 1 1 This file contains the list of people involved in the development of CC-Redirects plugin along its history. 2 2 3 Piotr Niewiadomski <http ://piotr.press>3 Piotr Niewiadomski <https://piotr.press> 4 4 5 5 Great thanks to Clearcode <https://clearcode.cc> for allowing releasing CC-Redirects plugin as free software! -
cc-redirects/trunk/README.txt
r2437597 r2761725 2 2 Contributors: ClearcodeHQ, PiotrPress 3 3 Tags: 301, redirect, redirects, seo, url, request, destination, 302, csv, clearcode, piotrpress 4 Requires PHP: 7. 04 Requires PHP: 7.4 5 5 Requires at least: 4.9.4 6 Tested up to: 5.66 Tested up to: 6.0.1 7 7 Stable tag: trunk 8 8 License: GPLv3 … … 57 57 == Changelog == 58 58 59 = 1.1.0 = 60 *Release date: 26.07.2022* 61 62 * Added `comparison` method setting 63 * Added `parameters` forward setting 64 59 65 = 1.0.3 = 60 66 *Release date: 11.12.2020* -
cc-redirects/trunk/assets/css/style.css
r2437597 r2761725 6 6 width: 100%; 7 7 } 8 .cc-redirects .column-comparison { 9 width: 150px; 10 } 11 .cc-redirects .column-parameters { 12 width: 90px; 13 } 8 14 .cc-redirects .column-code { 9 15 width: 70px; -
cc-redirects/trunk/includes/Redirects.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 24 24 namespace Clearcode; 25 25 26 use Clearcode\ Framework\v3\Plugin;26 use Clearcode\Redirects\Vendor\Clearcode\Framework\v3\Plugin; 27 27 use Clearcode\Redirects\Settings; 28 28 … … 60 60 public function search( $request ) { 61 61 $redirects = Settings::instance()->redirects; 62 if ( empty( $redirects ) ) return false; 62 63 63 if ( empty( $redirects ) ) return false;64 parse_str( parse_url( $request, PHP_URL_QUERY ), $parameters ); 64 65 65 66 foreach ( $redirects as $id => $redirect ) { 66 67 $redirect['id'] = $id; 67 68 69 if ( (bool)($redirect['parameters'] ?? true ) ) 70 $redirect['to'] = add_query_arg( $parameters, $redirect['to'] ); 71 72 $from = ( $redirect['comparison'] ?? 'path' ) === 'path' ? strtok( $request, '?' ) : $request; 73 68 74 if ( false !== strpos( $redirect['from'], '*' ) ) { 69 75 $redirect['from'] = str_replace( '*', '(.*)', $redirect['from'] ); 70 $pattern = '/^' . str_replace( '/', '\/', rtrim( $redirect['from'], '/' )) . '/';76 $pattern = '/^' . str_replace( '/', '\/', $redirect['from'] ) . '/'; 71 77 $redirect['to'] = str_replace( '*', '$1', $redirect['to'] ); 72 $redirect['to'] = preg_replace( $pattern, $redirect['to'], $ request);78 $redirect['to'] = preg_replace( $pattern, $redirect['to'], $from ); 73 79 74 if ( $redirect['to'] !== $ request) return $redirect;80 if ( $redirect['to'] !== $from ) return $redirect; 75 81 76 } elseif ( urldecode( $ request ) == rtrim( $redirect['from'], '/' )) return $redirect;82 } elseif ( urldecode( $from ) === $redirect['from'] ) return $redirect; 77 83 } 78 84 79 return false;85 return false; 80 86 } 81 87 -
cc-redirects/trunk/includes/Settings.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 25 25 use Clearcode\Redirects; 26 26 27 use Clearcode\ Framework\v3\Singleton;28 use Clearcode\ Framework\v3\Filterer;27 use Clearcode\Redirects\Vendor\Clearcode\Framework\v3\Singleton; 28 use Clearcode\Redirects\Vendor\Clearcode\Framework\v3\Filterer; 29 29 30 30 if ( ! defined( 'ABSPATH' ) ) exit; … … 80 80 81 81 add_action( "load-$hook", function() { 82 add_screen_option( 'per_page', [82 add_screen_option( 'per_page', [ 83 83 'label' => Redirects::__( 'Redirects per page' ), 84 84 'default' => 100, 85 85 'option' => 'redirects_per_page' 86 86 ] ); 87 88 get_current_screen()->add_help_tab( [ 89 'id' => 'redirects', 90 'title' => Redirects::__( 'Redirects' ), 91 'content' => Redirects::render( 'paragraph', [ 'content' => 92 sprintf( 93 Redirects::__( 'The %s field should be relative to your website root.' ), 94 Redirects::render( 'code', [ 'content' => Redirects::__( 'From' ) ] ) 95 ) . '</br>' . 96 sprintf( 97 Redirects::__( 'The %s field can be either a full URL to any page on the web, or relative to your website root.' ), 98 Redirects::render( 'code', [ 'content' => Redirects::__( 'To' ) ] ) 99 ) . '</br>' . 100 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-page/' ] ) . ' ' . 101 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/new-page/' ] ) . '<br/>' . 102 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-page/' ] ) . ' ' . 103 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => 'http://example.com/new-page/' ] ) . '<br/>' . 104 '</br>' . 105 sprintf( 106 Redirects::__( 'To use wildcards, put an asterisk %s after the folder name you want to redirect.' ), 107 Redirects::render( 'code', [ 'content' => '*' ] ) 108 ) . '</br>' . 109 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-folder/*' ] ) . ' ' . 110 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/redirect-everything-here/' ] ) . '<br/>' . 111 '</br>' . 112 sprintf( 113 Redirects::__( 'You can also use the asterisk %s in the %s field to replace whatever it matches in the %s field.' ), 114 Redirects::render( 'code', [ 'content' => '*' ] ), 115 Redirects::render( 'code', [ 'content' => Redirects::__( 'To' ) ] ), 116 Redirects::render( 'code', [ 'content' => Redirects::__( 'From' ) ] ) 117 ) . '<br/>' . 118 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-folder/*' ] ) . ' ' . 119 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/some/other/folder/*' ] ) . '<br/>' . 120 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-folder/*/content/' ] ) . ' ' . 121 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/some/other/folder/*' ] ) . '<br/>' 122 ] ) 123 ] ); 124 125 get_current_screen()->add_help_tab( [ 126 'id' => 'import', 127 'title' => Redirects::__( 'Import' ), 128 'content' => Redirects::render( 'paragraph', [ 'content' => 129 sprintf( 130 Redirects::__( 'Format: %s' ), 131 Redirects::render( 'code', [ 'content' => '"from","to"[,"path|query"][,0|1][,301|302]' ] ) 132 ) . '</br>' . '</br>' . 133 sprintf( 134 Redirects::__( 'Field delimiter character: %s' ), 135 Redirects::render( 'code', [ 'content' => ',' ] ) 136 ) . '</br>' . 137 sprintf( 138 Redirects::__( 'Field enclosure character: %s' ), 139 Redirects::render( 'code', [ 'content' => '"' ] ) 140 ) . '</br>' . 141 sprintf( 142 Redirects::__( 'Escape character: %s' ), 143 Redirects::render( 'code', [ 'content' => '\\' ] ) 144 ) . '</br>' 145 ] ) 146 ] ); 87 147 } ); 88 148 } … … 94 154 public function action_admin_enqueue_scripts( $page ) { 95 155 if ( $this->page !== $page ) return; 156 96 157 wp_register_style( Redirects::get( 'slug' ), Redirects::get( 'url' ) . 'assets/css/style.css', [], Redirects::get( 'version' ) ); 97 158 wp_enqueue_style( Redirects::get( 'slug' ) ); 159 160 wp_register_script( Redirects::get( 'slug' ), Redirects::get( 'url' ) . 'assets/js/script.js', [], Redirects::get( 'version' ) ); 161 wp_enqueue_script( Redirects::get( 'slug' ) ); 98 162 } 99 163 … … 108 172 $redirects = false !== $id ? [ $id => $this->redirects[$id] ] : $this->redirects; 109 173 110 if ( 'search' !== $this->get_action() and false === $id ) $redirects[] = [ 'from' => '', 'to' => '', 'co de' => '301' ];174 if ( 'search' !== $this->get_action() and false === $id ) $redirects[] = [ 'from' => '', 'to' => '', 'comparison' => 'path', 'parameters' => '1', 'code' => '301' ]; 111 175 112 176 $table = new Table( $redirects ); … … 133 197 'tabs' => $this->get_tabs(), 134 198 'tab' => $this->get_tab(), 135 'desc' => sprintf( 136 Redirects::__( 'Redirects format is similar to the one that Apache uses. The %s field should be relative to your website root. The %s field can be either a full URL to any page on the web, or relative to your website root.' ), 137 Redirects::render( 'code', [ 'content' => Redirects::__( 'From' ) ] ), 138 Redirects::render( 'code', [ 'content' => Redirects::__( 'To' ) ] ) 139 ) . '</br>' . 140 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-page/' ] ) . ' ' . 141 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/new-page/' ] ) . '<br/>' . 142 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-page/' ] ) . ' ' . 143 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => 'http://example.com/new-page/' ] ) . '<br/>' . 144 '</br>' . 145 sprintf( 146 Redirects::__( 'To use wildcards, put an asterisk %s after the folder name you want to redirect.' ), 147 Redirects::render( 'code', [ 'content' => '*' ] ) 148 ) . '</br>' . 149 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-folder/*' ] ) . ' ' . 150 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/redirect-everything-here/' ] ) . '<br/>' . 151 '</br>' . 152 sprintf( 153 Redirects::__( 'You can also use the asterisk %s in the %s field to replace whatever it matches in the %s field.' ), 154 Redirects::render( 'code', [ 'content' => '*' ] ), 155 Redirects::render( 'code', [ 'content' => Redirects::__( 'To' ) ] ), 156 Redirects::render( 'code', [ 'content' => Redirects::__( 'From' ) ] ) 157 ) . '<br/>' . 158 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-folder/*' ] ) . ' ' . 159 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/some/other/folder/*' ] ) . '<br/>' . 160 Redirects::__( 'From' ) . ': ' . Redirects::render( 'code', [ 'content' => '/old-folder/*/content/' ] ) . ' ' . 161 Redirects::__( 'To' ) . ': ' . Redirects::render( 'code', [ 'content' => '/some/other/folder/*' ] ) . '<br/>' 199 'desc' => Redirects::render( 'button', [ 200 'type' => 'button', 201 'id' => Redirects::get( 'slug' ) . '-help-button', 202 'class' => 'button', 203 'content' => Redirects::__( 'Help' ) 204 ] ) 162 205 ] ); 163 206 } … … 180 223 'tabs' => $this->get_tabs(), 181 224 'tab' => $this->get_tab(), 182 'desc' => sprintf( 183 Redirects::__( 'Parse CSV formatted string to redirects.' ) . ' ' . 184 Redirects::__( 'Format: %s (optional 3rd argument).' ) . ' ' . 185 Redirects::__( 'Field delimiter character: %s' ) . ' ' . 186 Redirects::__( 'Field enclosure character: %s' ) . ' ' . 187 Redirects::__( 'Escape character: %s' ), 188 Redirects::render( 'code', [ 'content' => '"from","to",301' ] ), 189 Redirects::render( 'code', [ 'content' => ',' ] ), 190 Redirects::render( 'code', [ 'content' => '"' ] ), 191 Redirects::render( 'code', [ 'content' => '\\' ] ) 192 ) 225 'desc' => Redirects::__( 'Parse CSV formatted string to redirects.' ) 193 226 ] ); 194 227 } … … 197 230 $export = ''; 198 231 foreach ( $this->redirects as $redirect ) 199 $export .= sprintf( '"%s","%s",%s', $redirect['from'], $redirect['to'], $redirect['code'] ) . "\n"; 200 232 $export .= sprintf( 233 '"%s","%s","%s",%d,%d', 234 $redirect['from'], 235 $redirect['to'], 236 self::sanitize_comparison( $redirect['comparison'] ?? 'path' ), 237 (int)self::sanitize_parameters( $redirect['parameters'] ?? true ), 238 (int)self::sanitize_code( $redirect['code'] ?? 301 ) 239 ) . "\n"; 201 240 202 241 echo Redirects::render( 'export', [ … … 207 246 'tab' => $this->get_tab(), 208 247 'export' => $export, 209 'desc' => sprintf( 210 Redirects::__( 'Exported CSV formatted string of redirects.' ) . ' ' . 211 Redirects::__( 'Format: %s (optional 3rd argument).' ) . ' ' . 212 Redirects::__( 'Field delimiter character: %s' ) . ' ' . 213 Redirects::__( 'Field enclosure character: %s' ) . ' ' . 214 Redirects::__( 'Escape character: %s' ), 215 Redirects::render( 'code', [ 'content' => '"from","to",301' ] ), 216 Redirects::render( 'code', [ 'content' => ',' ] ), 217 Redirects::render( 'code', [ 'content' => '"' ] ), 218 Redirects::render( 'code', [ 'content' => '\\' ] ) 219 ) 248 'desc' => Redirects::__( 'Exported CSV formatted string of redirects.' ) 220 249 ] ); 221 250 } … … 276 305 } 277 306 307 static public function sanitize_url( $url ) { 308 $url = sanitize_text_field( (string)$url ); 309 if ( '/' !== $url ) rtrim( $url, '/' ); 310 if ( ! empty( $url ) and ! preg_match( '/^https?:\/\//i', $url ) ) $url = ( '/' . ltrim( $url, '/' ) ); 311 return $url; 312 } 313 314 static public function sanitize_comparison( $comparison ) { 315 return 'query' === $comparison ? 'query' : 'path'; 316 } 317 318 static public function sanitize_parameters( $parameters ) { 319 return (bool)$parameters; 320 } 321 322 static public function sanitize_code( $code ) { 323 return 302 === (int)$code ? 302 : 301; 324 } 325 278 326 protected function save() { 279 327 if ( empty( $_POST[Redirects::get( 'slug' )] ) or … … 286 334 $id = (int)$id; 287 335 288 $from = sanitize_text_field( (string)$redirect['from'] ); 289 $to = sanitize_text_field( (string)$redirect['to' ] ); 290 291 $code = (int)$redirect['code']; 292 if ( $code !== 302 ) $code = 301; 293 294 if ( empty( $from ) or empty( $to ) ) continue; 336 foreach ( [ 'from', 'to' ] as $url ) 337 $redirect[$url] = self::sanitize_url( $redirect[$url] ); 338 339 if ( empty( $redirect['from'] ) or empty( $redirect['to'] ) ) continue; 295 340 $this->redirects[$id] = [ 296 'from' => $from, 297 'to' => $to, 298 'code' => $code 341 'from' => $redirect['from'], 342 'to' => $redirect['to'], 343 'comparison' => self::sanitize_comparison( $redirect['comparison'] ?? 'path' ), 344 'parameters' => self::sanitize_parameters( $redirect['parameters'] ?? true ), 345 'code' => self::sanitize_code( $redirect['code'] ?? 301 ) 299 346 ]; 300 347 } … … 302 349 $this->redirects = array_values( $this->redirects ); 303 350 if ( update_option( Redirects::get( 'slug' ), $this->redirects ) ) 304 self::notice( Redirects::__( 'Redirects saved successfully.' , 'updated' ));351 self::notice( Redirects::__( 'Redirects saved successfully.' ), 'updated' ); 305 352 else self::notice( Redirects::__( 'Error while saving redirects occurred.' ) ); 306 353 } … … 316 363 $this->redirects = array_values( $this->redirects ); 317 364 if ( update_option( Redirects::get( 'slug' ), $this->redirects ) ) { 318 self::notice( Redirects::__( 'Redirect removed successfully.' , 'updated' ));365 self::notice( Redirects::__( 'Redirect removed successfully.' ), 'updated' ); 319 366 self::redirect(); 320 367 } else self::notice( Redirects::__( 'Error while removing redirect occurred.' ) ); … … 354 401 355 402 $redirects[] = [ 356 'from' => $redirect[0], 357 'to' => $redirect[1], 358 'code' => ( isset( $redirect[2] ) and 302 == $redirect[2] ) ? 302 : 301 403 'from' => rtrim( $redirect[0], '/' ), 404 'to' => rtrim( $redirect[1], '/' ), 405 'comparison' => self::sanitize_comparison( $redirect[2] ?? 'path' ), 406 'parameters' => self::sanitize_parameters( $redirect[3] ?? true ), 407 'code' => self::sanitize_code( $redirect[4] ?? 301 ) 359 408 ]; 360 409 } … … 362 411 $this->redirects = array_merge( $this->redirects, $redirects ); 363 412 if ( update_option( Redirects::get( 'slug' ), $this->redirects ) ) 364 self::notice( Redirects::__( 'Redirects imported successfully.' , 'updated' ));413 self::notice( Redirects::__( 'Redirects imported successfully.' ), 'updated' ); 365 414 else self::notice( Redirects::__( 'Error while importing redirects occurred.' ) ); 366 415 } … … 369 418 if ( delete_option( Redirects::get( 'slug' ) ) ) { 370 419 $this->redirects = []; 371 self::notice( Redirects::__( 'Redirects removed successfully.' , 'updated' ));420 self::notice( Redirects::__( 'Redirects removed successfully.' ), 'updated' ); 372 421 self::redirect(); 373 422 } else self::notice( Redirects::__( 'Error while removing redirects occurred.' ) ); -
cc-redirects/trunk/includes/Table.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 49 49 public function get_columns() { 50 50 return [ 51 'id' => Redirects::__( '#' ), 52 'from' => Redirects::__( 'From' ), 53 'to' => Redirects::__( 'To' ), 54 'code' => Redirects::__( 'Code' ), 55 'action' => Redirects::__( 'Action' ) 51 'id' => Redirects::__( '#' ), 52 'from' => Redirects::__( 'From' ), 53 'to' => Redirects::__( 'To' ), 54 'comparison' => Redirects::__( 'Comparison' ), 55 'parameters' => Redirects::__( 'Parameters' ), 56 'code' => Redirects::__( 'Code' ) 56 57 ]; 57 58 } … … 59 60 public function column_default( $item, $column_name ) { 60 61 switch ( $column_name ) { 61 case 'id' : return ++$item['id'];62 case 'id' : return ++$item['id']; 62 63 case 'from' : 63 case 'to' : 64 $actions['edit'] = Redirects::render( 'button', [ 65 'type' => 'submit', 66 'class' => 'button-link', 67 'content' => Redirects::__( 'Save' ) 68 ] ); 69 if ( count( $this->redirects ) !== $item['id'] + 1 ) 70 $actions['delete'] = Redirects::render( 'link', [ 71 'link' => Redirects::__( 'Remove' ), 72 'class' => '', 73 'url' => wp_nonce_url( add_query_arg( [ 74 'action' => 'remove', 75 'id' => $item['id'], 76 ], admin_url( sprintf( Settings::URL, Redirects::get( 'slug' ) ) ) ), 'remove' ) 77 ] ); 78 case 'to' : 64 79 return Settings::input( [ 65 80 'type' => 'text', 66 81 'name' => Redirects::get( 'slug' ) . '[' . $item['id'] . '][' . $column_name . ']', 67 'value' => $item[$column_name], 68 ] ); 82 'value' => Settings::sanitize_url( $item[$column_name] ), 83 ] ) . $this->row_actions( $actions ?? [] ); 84 case 'comparison' : 85 return Settings::select( [ 86 'name' => Redirects::get( 'slug' ) . '[' . $item['id'] . '][comparison]', 87 'selected' => Settings::sanitize_comparison( $item['comparison'] ?? 'path' ), 88 'options' => [ 89 'path' => Redirects::__( 'Ignore parameters' ), 90 'query' => Redirects::__( 'Precise address' ) 91 ] 92 ] ); 93 case 'parameters' : 94 return Settings::select( [ 95 'name' => Redirects::get( 'slug' ) . '[' . $item['id'] . '][parameters]', 96 'selected' => (int)Settings::sanitize_parameters( $item['parameters'] ?? true ), 97 'options' => [ 98 1 => Redirects::__( 'Forward' ), 99 0 => Redirects::__( 'Remove' ) 100 ] 101 ] ); 69 102 case 'code' : 70 $code = in_array( (int)$item['code'], [ 301, 302 ] ) ? $item['code'] : 301;71 103 return Settings::select( [ 72 104 'name' => Redirects::get( 'slug' ) . '[' . $item['id'] . '][code]', 73 'selected' => $code,105 'selected' => Settings::sanitize_code( $item['code'] ?? 301 ), 74 106 'options' => [ 75 107 301 => '301', 76 108 302 => '302' 77 109 ] 78 ] );79 case 'action' :80 return Redirects::render( 'link', [81 'link' => Redirects::__( 'Remove' ),82 'class' => 'button button-secondary',83 'url' => wp_nonce_url( add_query_arg( [84 'action' => 'remove',85 'id' => $item['id'],86 ], admin_url( sprintf( Settings::URL, Redirects::get( 'slug' ) ) ) ), 'remove' )87 110 ] ); 88 111 default : return print_r( $item, true ); -
cc-redirects/trunk/languages/cc-redirects-pl_PL.po
r2437597 r2761725 2 2 msgstr "" 3 3 "Project-Id-Version: cc-redirects\n" 4 "POT-Creation-Date: 202 0-12-11 17:07+0100\n"5 "PO-Revision-Date: 202 0-12-11 17:22+0100\n"4 "POT-Creation-Date: 2022-07-11 17:56+0200\n" 5 "PO-Revision-Date: 2022-07-11 18:09+0200\n" 6 6 "Last-Translator: Piotr Niewiadomski <p.niewiadomski@clearcode.cc>\n" 7 7 "Language-Team: Clearcode | Piotr Niewiadomski <p.niewiadomski@clearcode.cc>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"13 "X-Poedit-Basepath: ..\n"14 12 "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " 15 13 "|| n%100>=20) ? 1 : 2);\n" 14 "X-Generator: Poedit 3.1.1\n" 15 "X-Poedit-Basepath: ..\n" 16 16 "X-Poedit-SourceCharset: UTF-8\n" 17 17 "X-Poedit-KeywordsList: __;_e\n" 18 18 "X-Poedit-SearchPath-0: .\n" 19 19 20 #: includes/Redirects.php: 8820 #: includes/Redirects.php:95 21 21 msgid "Settings" 22 22 msgstr "Ustawienia" 23 23 24 #: includes/Redirects.php: 9824 #: includes/Redirects.php:105 25 25 msgid "Author" 26 26 msgstr "Autor" 27 27 28 #: includes/Redirects.php:12 128 #: includes/Redirects.php:128 29 29 #, php-format 30 30 msgid "This post is redirected from: %s to: %s with code: %s." 31 31 msgstr "Ten wpis jest przekierowany z: %s do: %s z kodem: %s." 32 32 33 #: includes/Redirects.php:1 2733 #: includes/Redirects.php:134 34 34 msgid "Edit" 35 35 msgstr "Edytuj" 36 36 37 #: includes/Settings.php:74 includes/Settings.php: 123 includes/Settings.php:17438 #: includes/Settings.php:2 03 includes/Settings.php:23239 #: includes/Settings.php:2 5037 #: includes/Settings.php:74 includes/Settings.php:90 includes/Settings.php:187 38 #: includes/Settings.php:217 includes/Settings.php:242 39 #: includes/Settings.php:261 includes/Settings.php:279 40 40 msgid "Redirects" 41 41 msgstr "Przekierowania" … … 45 45 msgstr "Ilość przekierowań na stronę" 46 46 47 #: includes/Settings.php:101 includes/Settings.php:263 47 #: includes/Settings.php:93 48 #, php-format 49 msgid "The %s field should be relative to your website root." 50 msgstr "Pole %s powinno być adresem względnym do Twojej strony głównej." 51 52 #: includes/Settings.php:94 includes/Settings.php:100 includes/Settings.php:102 53 #: includes/Settings.php:109 includes/Settings.php:116 54 #: includes/Settings.php:118 includes/Settings.php:120 includes/Table.php:52 55 msgid "From" 56 msgstr "Z" 57 58 #: includes/Settings.php:97 59 #, php-format 60 msgid "" 61 "The %s field can be either a full URL to any page on the web, or relative to " 62 "your website root." 63 msgstr "" 64 "Pole %s może być albo pełnym adresem URL do dowolnej strony w sieci, lub " 65 "względne do Twojej strony głównej." 66 67 #: includes/Settings.php:98 includes/Settings.php:101 includes/Settings.php:103 68 #: includes/Settings.php:110 includes/Settings.php:115 69 #: includes/Settings.php:119 includes/Settings.php:121 includes/Table.php:53 70 msgid "To" 71 msgstr "Do" 72 73 #: includes/Settings.php:106 74 #, php-format 75 msgid "" 76 "To use wildcards, put an asterisk %s after the folder name you want to " 77 "redirect." 78 msgstr "" 79 "Aby użyć symbolu wieloznacznego, umieść znak gwiazdki %s za folderem, który " 80 "chcesz przekierować." 81 82 #: includes/Settings.php:113 83 #, php-format 84 msgid "" 85 "You can also use the asterisk %s in the %s field to replace whatever it " 86 "matches in the %s field." 87 msgstr "" 88 "Możesz także użyć znaku gwiazdki %s w polu %s żeby zamienić spasowany " 89 "element adresu z pola %s." 90 91 #: includes/Settings.php:127 includes/Settings.php:280 92 msgid "Import" 93 msgstr "Import" 94 95 #: includes/Settings.php:130 96 #, php-format 97 msgid "Format: %s" 98 msgstr "Format: %s" 99 100 #: includes/Settings.php:134 101 #, php-format 102 msgid "Field delimiter character: %s" 103 msgstr "Znak rozdzielający pole: %s" 104 105 #: includes/Settings.php:138 106 #, php-format 107 msgid "Field enclosure character: %s" 108 msgstr "Znak okalający pole: %s" 109 110 #: includes/Settings.php:142 111 #, php-format 112 msgid "Escape character: %s" 113 msgstr "Znak ucieczki: %s" 114 115 #: includes/Settings.php:165 includes/Settings.php:292 48 116 #: vendor/clearcode/wordpress-framework/src/v3/Singleton.php:31 49 #: vendor/clearcode/wordpress-framework/src/v3/Singleton.php:3450 #: vendor/clearcode/wordpress-framework/src/v3/Singleton.php:3851 117 msgid "Cheatin’ uh?" 52 118 msgstr "Oszukujemy’ co?" 53 119 54 #: includes/Settings.php:1 29 includes/Settings.php:179120 #: includes/Settings.php:193 includes/Settings.php:222 includes/Table.php:67 55 121 msgid "Save" 56 122 msgstr "Zapisz" 57 123 58 #: includes/Settings.php:1 30124 #: includes/Settings.php:194 59 125 msgid "Search" 60 126 msgstr "Szukaj" 61 127 62 #: includes/Settings.php:1 32128 #: includes/Settings.php:196 63 129 msgid "Search results for" 64 130 msgstr "Wyniki wyszukiwania dla" 65 131 66 #: includes/Settings.php:136 67 #, php-format 68 msgid "" 69 "Redirects format is similar to the one that Apache uses. The %s field should " 70 "be relative to your website root. The %s field can be either a full URL to " 71 "any page on the web, or relative to your website root." 72 msgstr "" 73 "Format przekierowań jest podobny do tego wykorzystywanego przez Apache. Pole " 74 "%s powinno być względne do Twojej strony głównej. Pole %s może być albo " 75 "pełnym adresem URL do dowolnej strony w sieci, lub względne do Twojej strony " 76 "głównej." 77 78 #: includes/Settings.php:137 includes/Settings.php:140 79 #: includes/Settings.php:142 includes/Settings.php:149 80 #: includes/Settings.php:156 includes/Settings.php:158 81 #: includes/Settings.php:160 includes/Table.php:52 82 msgid "From" 83 msgstr "Z" 84 85 #: includes/Settings.php:138 includes/Settings.php:141 86 #: includes/Settings.php:143 includes/Settings.php:150 87 #: includes/Settings.php:155 includes/Settings.php:159 88 #: includes/Settings.php:161 includes/Table.php:53 89 msgid "To" 90 msgstr "Do" 91 92 #: includes/Settings.php:146 93 #, php-format 94 msgid "" 95 "To use wildcards, put an asterisk %s after the folder name you want to " 96 "redirect." 97 msgstr "" 98 "Aby użyć symbolu wieloznacznego, umieść znak gwiazdki %s za folderem, który " 99 "chcesz przekierować." 100 101 #: includes/Settings.php:153 102 #, php-format 103 msgid "" 104 "You can also use the asterisk %s in the %s field to replace whatever it " 105 "matches in the %s field." 106 msgstr "" 107 "Możesz także użyć znaku gwiazdki %s w polu %s żeby zamienić spasowany " 108 "element adresu z pola %s." 109 110 #: includes/Settings.php:183 132 #: includes/Settings.php:203 133 msgid "Help" 134 msgstr "Pomoc" 135 136 #: includes/Settings.php:225 111 137 msgid "Parse CSV formatted string to redirects." 112 138 msgstr "Zaimportuj przekierowania z formatu CSV." 113 139 114 #: includes/Settings.php:184 includes/Settings.php:211 115 #, php-format 116 msgid "Format: %s (optional 3rd argument)." 117 msgstr "Format: %s (opcjonalny trzeci argument)." 118 119 #: includes/Settings.php:185 includes/Settings.php:212 120 #, php-format 121 msgid "Field delimiter character: %s" 122 msgstr "Znak rozdzielający pole: %s" 123 124 #: includes/Settings.php:186 includes/Settings.php:213 125 #, php-format 126 msgid "Field enclosure character: %s" 127 msgstr "Znak okalający pole: %s" 128 129 #: includes/Settings.php:187 includes/Settings.php:214 130 #, php-format 131 msgid "Escape character: %s" 132 msgstr "Znak ucieczki: %s" 133 134 #: includes/Settings.php:210 140 #: includes/Settings.php:248 135 141 msgid "Exported CSV formatted string of redirects." 136 142 msgstr "Przekierowania wyeksportowane do formatu CSV." 137 143 138 #: includes/Settings.php:2 37 includes/Settings.php:253144 #: includes/Settings.php:266 includes/Settings.php:282 139 145 msgid "Reset" 140 146 msgstr "Resetuj" 141 147 142 #: includes/Settings.php:2 40148 #: includes/Settings.php:269 143 149 msgid "Remove all redirects." 144 150 msgstr "Usuń wszystkie przekierowania." 145 151 146 #: includes/Settings.php:251 147 msgid "Import" 148 msgstr "Import" 149 150 #: includes/Settings.php:252 152 #: includes/Settings.php:281 151 153 msgid "Export" 152 154 msgstr "Eksport" 153 155 154 #: includes/Settings.php: 281 includes/Settings.php:305156 #: includes/Settings.php:329 includes/Settings.php:352 155 157 msgid "Error while saving redirects occurred." 156 158 msgstr "Wystąpił błąd podczas zapisywania przekierowań." 157 159 158 #: includes/Settings.php:3 04160 #: includes/Settings.php:351 159 161 msgid "Redirects saved successfully." 160 162 msgstr "Przekierowania zostały zapisane." 161 163 162 #: includes/Settings.php:3 11 includes/Settings.php:320164 #: includes/Settings.php:358 includes/Settings.php:367 163 165 msgid "Error while removing redirect occurred." 164 166 msgstr "Wystąpił błąd podczas usuwania przekierowania." 165 167 166 #: includes/Settings.php:3 18168 #: includes/Settings.php:365 167 169 msgid "Redirect removed successfully." 168 170 msgstr "Przekierowanie zostało usunięte." 169 171 170 #: includes/Settings.php:3 42 includes/Settings.php:365172 #: includes/Settings.php:389 includes/Settings.php:414 171 173 msgid "Error while importing redirects occurred." 172 174 msgstr "Wystąpił błąd podczas importu przekierowań." 173 175 174 #: includes/Settings.php: 364176 #: includes/Settings.php:413 175 177 msgid "Redirects imported successfully." 176 178 msgstr "Przekierowania zostały zaimportowane." 177 179 178 #: includes/Settings.php: 371180 #: includes/Settings.php:420 179 181 msgid "Redirects removed successfully." 180 182 msgstr "Przekierowania zostały usunięte." 181 183 182 #: includes/Settings.php: 373184 #: includes/Settings.php:422 183 185 msgid "Error while removing redirects occurred." 184 186 msgstr "Wystąpił błąd podczas usuwania przekierowań." … … 189 191 190 192 #: includes/Table.php:54 193 msgid "Comparison" 194 msgstr "Porównanie" 195 196 #: includes/Table.php:55 197 msgid "Parameters" 198 msgstr "Parametry" 199 200 #: includes/Table.php:56 191 201 msgid "Code" 192 202 msgstr "Kod" 193 203 194 #: includes/Table.php:55 195 msgid "Action" 196 msgstr "Akcja" 197 198 #: includes/Table.php:81 204 #: includes/Table.php:71 includes/Table.php:99 199 205 msgid "Remove" 200 206 msgstr "Usuń" 201 207 202 #: includes/Table.php:93 208 #: includes/Table.php:89 209 msgid "Ignore parameters" 210 msgstr "Ignoruj parametry" 211 212 #: includes/Table.php:90 213 msgid "Precise address" 214 msgstr "Dokładny adres" 215 216 #: includes/Table.php:98 217 msgid "Forward" 218 msgstr "Przekaż" 219 220 #: includes/Table.php:116 203 221 msgid "No redirects available." 204 222 msgstr "Brak przekierowań do wyświetlenia." 205 223 224 #, php-format 206 225 #~ msgid "" 207 #~ "Redirects work similar to the formatthat Apache uses. The %s field "226 #~ "Redirects format is similar to the one that Apache uses. The %s field " 208 227 #~ "should be relative to your website root. The %s field can be either a " 209 228 #~ "full URL to any page on the web, or relative to your website root." 210 #~ msgstr "Przekierowania działają podobnie do " 229 #~ msgstr "" 230 #~ "Format przekierowań jest podobny do tego wykorzystywanego przez Apache. " 231 #~ "Pole %s powinno być względne do Twojej strony głównej. Pole %s może być " 232 #~ "albo pełnym adresem URL do dowolnej strony w sieci, lub względne do " 233 #~ "Twojej strony głównej." 234 235 #, php-format 236 #~ msgid "Format: %s (optional 3rd argument)." 237 #~ msgstr "Format: %s (opcjonalny trzeci argument)." 238 239 #~ msgid "Action" 240 #~ msgstr "Akcja" 211 241 212 242 #~ msgid "" -
cc-redirects/trunk/plugin.php
r2437597 r2761725 2 2 3 3 /** 4 * CC-Redirects5 *6 * @package CC-Redirects7 * @author PiotrPress8 * @copyright 2020 Clearcode9 * @license GPL-3.0+10 *11 * @wordpress-plugin12 4 * Plugin Name: CC-Redirects 13 5 * Plugin URI: https://wordpress.org/plugins/cc-redirects 14 6 * Description: This plugin allows you to create simple redirect requests to another page on your site or elsewhere on the web. 15 * Version: 1. 0.37 * Version: 1.1.0 16 8 * Author: Clearcode 17 9 * Author URI: https://clearcode.cc … … 21 13 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt 22 14 23 Copyright (C) 202 0by Clearcode <https://clearcode.cc>15 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 24 16 and associates (see AUTHORS.txt file). 25 17 … … 43 35 namespace Clearcode\Redirects; 44 36 use Clearcode\Redirects; 45 46 use Clearcode\Framework\v3\Autoloader;47 37 use Exception; 48 38 49 39 defined( 'ABSPATH' ) or exit; 50 40 41 require __DIR__ . '/vendor/autoload.php'; 42 51 43 try { 52 require __DIR__ . '/vendor/autoload.php';53 new Autoloader( [ __NAMESPACE__ . '\\' => __DIR__ . '/includes' ] );54 55 foreach( [ 'Redirects' ] as $file )56 require_once( __DIR__ . "/includes/$file.php" );57 58 44 Redirects::instance( __FILE__ ); 59 45 } catch ( Exception $exception ) { -
cc-redirects/trunk/templates/input.php
r1849203 r2761725 1 1 <?php defined( 'ABSPATH' ) or exit; ?> 2 < label>2 <?php if ( ! empty( $before ) or ! empty( $after ) ) : ?><label><?php endif; ?> 3 3 <?php if ( ! empty( $before ) ) : ?><?= $before; ?><?php endif; ?> 4 4 <input <?php if ( ! empty( $atts ) ) : ?><?= $atts; ?><?php endif; ?><?php if ( ! empty( $checked ) ) : ?> <?= $checked; ?><?php endif; ?>/> 5 5 <?php if ( ! empty( $after ) ) : ?><?= $after; ?><?php endif; ?> 6 < /label>6 <?php if ( ! empty( $before ) or ! empty( $after ) ) : ?></label><?php endif; ?> 7 7 <?php if ( ! empty( $desc ) ) : ?> 8 8 <p class="description"> -
cc-redirects/trunk/templates/redirects.php
r1849203 r2761725 13 13 <?php endforeach; ?> 14 14 </h2> 15 <p><?= $desc; ?></p>16 15 <div id="poststuff"> 17 16 <div id="post-body" class="metabox-holder"> 17 <?= $desc; ?> 18 18 <?php $table->search_box( $search, $id ); ?> 19 19 <div id="post-body-content"> -
cc-redirects/trunk/templates/select.php
r1849203 r2761725 3 3 <select<?php if ( ! empty( $name ) ) : ?> name="<?= $name; ?>"<?php endif; ?>> 4 4 <?php if ( $options ) foreach( $options as $value => $name ) : ?> 5 <option <?php if ( ! empty( $value ) ) : ?>value="<?= $value; ?>"<?php endif; ?><?php if ( ! empty( $selected ) and $selected== $value ) : ?> selected="selected"<?php endif; ?>><?php if ( ! empty( $name ) ) : ?><?= $name; ?><?php endif; ?></option>5 <option <?php if ( '' !== $value ) : ?>value="<?= $value; ?>"<?php endif; ?><?php if ( $selected === $value ) : ?> selected="selected"<?php endif; ?>><?php if ( ! empty( $name ) ) : ?><?= $name; ?><?php endif; ?></option> 6 6 <?php endforeach; ?> 7 7 </select> -
cc-redirects/trunk/uninstall.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 -
cc-redirects/trunk/vendor/autoload.php
r1849203 r2761725 1 <?php 2 3 // autoload.php @generated by Composer 4 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 7 return ComposerAutoloaderInit9bc91c4f337f84d06d294051e80dd290::getLoader(); 1 <?php return spl_autoload_register( function( string $class ) { 2 $map = require __DIR__ . '/classmap.php'; 3 if ( isset( $map[ $class ] ) ) require dirname( __DIR__ ) . $map[ $class ]; 4 } ); -
cc-redirects/trunk/vendor/clearcode/wordpress-framework/src/v3/Filterer.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 22 22 */ 23 23 24 namespace Clearcode\ Framework\v3;24 namespace Clearcode\Redirects\Vendor\Clearcode\Framework\v3; 25 25 26 26 use ReflectionClass; -
cc-redirects/trunk/vendor/clearcode/wordpress-framework/src/v3/Plugin.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 22 22 */ 23 23 24 namespace Clearcode\ Framework\v3;24 namespace Clearcode\Redirects\Vendor\Clearcode\Framework\v3; 25 25 26 26 defined( 'ABSPATH' ) or exit; … … 142 142 143 143 public function action_init_0(){ 144 load_plugin_textdomain( static::get( 'text_domain' ), false, static::get( ' dir' ) . static::get( 'domain_path' ) );144 load_plugin_textdomain( static::get( 'text_domain' ), false, static::get( 'slug' ) . static::get( 'domain_path' ) ); 145 145 } 146 146 -
cc-redirects/trunk/vendor/clearcode/wordpress-framework/src/v3/Singleton.php
r2437597 r2761725 2 2 3 3 /* 4 Copyright (C) 202 0by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 22 22 */ 23 23 24 namespace Clearcode\ Framework\v3;24 namespace Clearcode\Redirects\Vendor\Clearcode\Framework\v3; 25 25 26 26 defined( 'ABSPATH' ) or exit; … … 28 28 if ( ! trait_exists( __NAMESPACE__ . '\Singleton' ) ) { 29 29 trait Singleton { 30 final private function __clone() {31 _doing_it_wrong( __METHOD__, __( 'Cheatin’ uh?' ), '' );32 }33 final private function __wakeup() {34 _doing_it_wrong( __METHOD__, __( 'Cheatin’ uh?' ), '' );35 }36 37 30 protected function __construct() { 38 31 _doing_it_wrong( __METHOD__, __( 'Cheatin’ uh?' ), '' );
Note: See TracChangeset
for help on using the changeset viewer.