- Timestamp:
- 06/27/2022 09:40:47 PM (4 years ago)
- Location:
- anrghg
- Files:
-
- 8 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from anrghg/trunk)
-
tags/1.2.0/admin/anrghg-admin.php (modified) (7 diffs)
-
tags/1.2.0/includes/helpers.php (modified) (2 diffs)
-
tags/1.2.0/readme.txt (modified) (2 diffs)
-
tags/1.2.0/svn-revs.txt (modified) (1 diff)
-
trunk/admin/anrghg-admin.php (modified) (7 diffs)
-
trunk/includes/helpers.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/svn-revs.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
anrghg/tags/1.2.0/admin/anrghg-admin.php
r2748691 r2748759 2298 2298 } 2299 2299 2300 h3 { 2301 margin: 10px 2px; 2302 padding-top: 10px; 2303 font-size: 20px; 2304 line-height: 1em; 2305 z-index: 99; 2306 } 2307 2308 h3.border { 2309 border-top: 1px solid #006EBF; 2310 } 2311 2300 2312 .info p { 2301 2313 margin-left: 32px; 2302 2314 margin-right: 32px; 2315 font-size: 14px; 2316 font-style: italic; 2317 font-weight: bold; 2303 2318 } 2304 2319 … … 2358 2373 2359 2374 /** 2360 * Import form for templates.2375 * Import form for adding templates. 2361 2376 */ 2362 $l_s_output = '<div class="h2"><h2>' . __( 'Templates' ) . '</h2></div>';2377 $l_s_output = '<div class="h2"><h2>' . __( 'Templates', 'anrghg' ) . _x( ' — ', 'Space-padded em dash', 'anrghg' ) . __( 'Add new ones', 'anrghg' ) . '</h2></div>'; 2363 2378 $l_s_output .= '<div class="info">'; 2364 2379 $l_s_output .= '<p>'; 2365 2380 $l_s_output .= __( 'Importing a templates file will add the new templates to the existing templates.', 'anrghg' ) . ' '; 2366 2381 $l_s_output .= __( 'Only valid template files can be imported.', 'anrghg' ) . ' '; 2367 $l_s_output .= __( 'Non-conformant or empty files will be rejected.', 'anrghg' ) . ' ';2382 $l_s_output .= __( 'Non-conformant or empty files will be dismissed.', 'anrghg' ) . ' '; 2368 2383 $l_s_output .= '</p>'; 2369 2384 $l_s_output .= '<p>'; 2370 2385 $l_s_output .= __( 'To add templates in bulk, please fill a file with the new templates in JSON format following the same scheme, and import.', 'anrghg' ) . ' '; 2371 $l_s_output .= __( 'ASCII double quotes in the content must be escaped with abackslash.', 'anrghg' ) . ' ';2386 $l_s_output .= __( 'ASCII double quotes that are not part of JSON must be escaped with a leading backslash.', 'anrghg' ) . ' '; 2372 2387 $l_s_output .= __( 'The JSON format prohibits trailing commas.', 'anrghg' ) . ' '; 2373 2388 $l_s_output .= '</p>'; … … 2377 2392 anrghg_import_form( 'import_templates', __( 'Import' ) ); 2378 2393 2379 $l_s_output = '<div class="info">'; 2394 /** 2395 * Import form for overwriting templates. 2396 */ 2397 $l_s_output = '<div class="h2"><h2>' . __( 'Templates', 'anrghg' ) . _x( ' — ', 'Space-padded em dash', 'anrghg' ) . __( 'Change existing', 'anrghg' ) . '</h2></div>'; 2398 $l_s_output .= '<div class="info">'; 2380 2399 $l_s_output .= '<p>'; 2381 2400 // Translators: %1$s: link start tag to the import page; %2$s: link end tag. … … 2495 2514 if ( ! isset( $_FILES['import_file']['tmp_name'] ) || empty( $l_o_import_file ) ) { 2496 2515 wp_die( 2497 wp_kses( __( 'There is no file. Please choose the desired file.', 'anrghg' ) ),2516 anrghg_kses( __( 'There is no file. Please choose the desired file.', 'anrghg' ) ), 2498 2517 '', 2499 2518 array( … … 2504 2523 2505 2524 // Retrieve the data from the file and convert the json object to an array. 2506 $l_a_data = (array) json_decode( wp_remote_get( $l_o_import_file ) ); 2525 // Cannot use wp_remote_get() here. 2526 // phpcs:ignore 2527 $l_a_data = (array) json_decode( file_get_contents( $l_o_import_file ) ); 2507 2528 2508 2529 if ( 'import_settings' === sanitize_key( $_POST['anrghg_action'] ) ) { … … 2512 2533 if ( isset( $_POST['option'] ) ) { 2513 2534 $l_s_name = sanitize_text_field( sanitize_key( $_POST['option'] ) ); 2535 $l_a_all = wp_load_alloptions(); 2536 if ( ! is_array( $l_a_all ) || ! array_key_exists( $l_s_name, $l_a_all ) ) { 2537 wp_die( 2538 anrghg_kses( __( 'Cannot find the specified option; importing its data is not possible.', 'anrghg' ) ), 2539 '', 2540 array( 2541 'back_link' => true, 2542 ) 2543 ); 2544 } 2514 2545 } else { 2515 2546 wp_die( 2516 wp_kses( __( 'The option name needs to be specified.', 'anrghg' ) ),2547 anrghg_kses( __( 'The option name needs to be specified.', 'anrghg' ) ), 2517 2548 '', 2518 2549 array( … … 2532 2563 $l_s_output .= __( 'If it does match, then it may contain trailing commas, prohibited in JSON.', 'anrghg' ); 2533 2564 wp_die( 2534 wp_kses(2565 anrghg_kses( 2535 2566 $l_s_output, 2536 2567 array( 'br' => true ) -
anrghg/tags/1.2.0/includes/helpers.php
r2748691 r2748759 90 90 91 91 /** 92 * Escapes and echoes outside Settings and Post Meta box.92 * Escapes and echoes also outside Settings and Post Meta box. 93 93 * 94 94 * @since 0.81.5 … … 108 108 anrghg_get_public_whitelist() 109 109 ); 110 } 111 112 /** 113 * Escapes and returns also outside Settings and Post Meta box. 114 * 115 * @since 1.1.2 116 * @param string $p_s_output HTML. 117 * @return string $l_s_output HTML. 118 */ 119 function anrghg_kses( $p_s_output ) { 120 $l_s_output = wp_kses( 121 $p_s_output, 122 anrghg_get_public_whitelist() 123 ); 124 return $l_s_output; 110 125 } 111 126 -
anrghg/tags/1.2.0/readme.txt
r2748691 r2748759 37 37 38 38 * Protect your WordPress websites against password leak effectiveness, by deactivating the login dialog depending on the value of a constant in `wp-config.php`; 39 * Allow to configure that constantso that in multisite networks, individual sites may be toggled independently;40 * Make authentication cookies then last longer fora configurable period of time, e.g. until the day after the next scheduled login rush.39 * Make that constant configurable so that in multisite networks, individual sites may be toggled independently; 40 * Extend authentication cookie lifespans to a configurable period of time, e.g. until the day after the next scheduled login rush. 41 41 * Blank the login dialog out permanently if it is convenient to access the WordPress Admin area through the hosting platform exclusively. 42 42 43 43 44 = Thank You message =45 46 * Display a configurable message after your posts, and optionally another message at the bottom of your pages;47 * Activate, deactivate and configure the display of a messagein the post editor Meta box;48 * Configure standard messages in rich text in the Template editor and insert them by their name;49 * Configure in rich text and position one or more messages in the Block editor, using the ‘Thank You message’ block.44 = Thank You messages = 45 46 * Display a configurable message after your posts, and optionally another one at the bottom of your pages; 47 * Display a message depending on activation, deactivation and configuration in the post editor Meta box; 48 * Help with configuring rich text messages in the Template editor; 49 * Provide a block to configure messages right in your posts and pages. 50 50 51 51 … … 505 505 == Changelog == 506 506 507 = 1.2.0 (2022-06-27) = 508 509 * Import: Templates: Clarify the interface. 510 * Import: Custom: Check if provided option name does exist. 511 * Import: Fix bug in exit statement display. 512 507 513 = 1.1.1 (2022-06-27) = 508 514 -
anrghg/tags/1.2.0/svn-revs.txt
r2748691 r2748759 11 11 Previous revisions: 12 12 13 1.1.1.0 2748691 2022-06-27 18:48:00 +0000 (Mon, 27 Jun 2022) 13 14 1.1.0.0 2747832 2022-06-25 03:03:42 +0000 (Sat, 25 Jun 2022) 14 15 1.0.4.0 2747340 2022-06-23 23:31:07 +0000 (Thu, 23 Jun 2022) -
anrghg/trunk/admin/anrghg-admin.php
r2748691 r2748759 2298 2298 } 2299 2299 2300 h3 { 2301 margin: 10px 2px; 2302 padding-top: 10px; 2303 font-size: 20px; 2304 line-height: 1em; 2305 z-index: 99; 2306 } 2307 2308 h3.border { 2309 border-top: 1px solid #006EBF; 2310 } 2311 2300 2312 .info p { 2301 2313 margin-left: 32px; 2302 2314 margin-right: 32px; 2315 font-size: 14px; 2316 font-style: italic; 2317 font-weight: bold; 2303 2318 } 2304 2319 … … 2358 2373 2359 2374 /** 2360 * Import form for templates.2375 * Import form for adding templates. 2361 2376 */ 2362 $l_s_output = '<div class="h2"><h2>' . __( 'Templates' ) . '</h2></div>';2377 $l_s_output = '<div class="h2"><h2>' . __( 'Templates', 'anrghg' ) . _x( ' — ', 'Space-padded em dash', 'anrghg' ) . __( 'Add new ones', 'anrghg' ) . '</h2></div>'; 2363 2378 $l_s_output .= '<div class="info">'; 2364 2379 $l_s_output .= '<p>'; 2365 2380 $l_s_output .= __( 'Importing a templates file will add the new templates to the existing templates.', 'anrghg' ) . ' '; 2366 2381 $l_s_output .= __( 'Only valid template files can be imported.', 'anrghg' ) . ' '; 2367 $l_s_output .= __( 'Non-conformant or empty files will be rejected.', 'anrghg' ) . ' ';2382 $l_s_output .= __( 'Non-conformant or empty files will be dismissed.', 'anrghg' ) . ' '; 2368 2383 $l_s_output .= '</p>'; 2369 2384 $l_s_output .= '<p>'; 2370 2385 $l_s_output .= __( 'To add templates in bulk, please fill a file with the new templates in JSON format following the same scheme, and import.', 'anrghg' ) . ' '; 2371 $l_s_output .= __( 'ASCII double quotes in the content must be escaped with abackslash.', 'anrghg' ) . ' ';2386 $l_s_output .= __( 'ASCII double quotes that are not part of JSON must be escaped with a leading backslash.', 'anrghg' ) . ' '; 2372 2387 $l_s_output .= __( 'The JSON format prohibits trailing commas.', 'anrghg' ) . ' '; 2373 2388 $l_s_output .= '</p>'; … … 2377 2392 anrghg_import_form( 'import_templates', __( 'Import' ) ); 2378 2393 2379 $l_s_output = '<div class="info">'; 2394 /** 2395 * Import form for overwriting templates. 2396 */ 2397 $l_s_output = '<div class="h2"><h2>' . __( 'Templates', 'anrghg' ) . _x( ' — ', 'Space-padded em dash', 'anrghg' ) . __( 'Change existing', 'anrghg' ) . '</h2></div>'; 2398 $l_s_output .= '<div class="info">'; 2380 2399 $l_s_output .= '<p>'; 2381 2400 // Translators: %1$s: link start tag to the import page; %2$s: link end tag. … … 2495 2514 if ( ! isset( $_FILES['import_file']['tmp_name'] ) || empty( $l_o_import_file ) ) { 2496 2515 wp_die( 2497 wp_kses( __( 'There is no file. Please choose the desired file.', 'anrghg' ) ),2516 anrghg_kses( __( 'There is no file. Please choose the desired file.', 'anrghg' ) ), 2498 2517 '', 2499 2518 array( … … 2504 2523 2505 2524 // Retrieve the data from the file and convert the json object to an array. 2506 $l_a_data = (array) json_decode( wp_remote_get( $l_o_import_file ) ); 2525 // Cannot use wp_remote_get() here. 2526 // phpcs:ignore 2527 $l_a_data = (array) json_decode( file_get_contents( $l_o_import_file ) ); 2507 2528 2508 2529 if ( 'import_settings' === sanitize_key( $_POST['anrghg_action'] ) ) { … … 2512 2533 if ( isset( $_POST['option'] ) ) { 2513 2534 $l_s_name = sanitize_text_field( sanitize_key( $_POST['option'] ) ); 2535 $l_a_all = wp_load_alloptions(); 2536 if ( ! is_array( $l_a_all ) || ! array_key_exists( $l_s_name, $l_a_all ) ) { 2537 wp_die( 2538 anrghg_kses( __( 'Cannot find the specified option; importing its data is not possible.', 'anrghg' ) ), 2539 '', 2540 array( 2541 'back_link' => true, 2542 ) 2543 ); 2544 } 2514 2545 } else { 2515 2546 wp_die( 2516 wp_kses( __( 'The option name needs to be specified.', 'anrghg' ) ),2547 anrghg_kses( __( 'The option name needs to be specified.', 'anrghg' ) ), 2517 2548 '', 2518 2549 array( … … 2532 2563 $l_s_output .= __( 'If it does match, then it may contain trailing commas, prohibited in JSON.', 'anrghg' ); 2533 2564 wp_die( 2534 wp_kses(2565 anrghg_kses( 2535 2566 $l_s_output, 2536 2567 array( 'br' => true ) -
anrghg/trunk/includes/helpers.php
r2748691 r2748759 90 90 91 91 /** 92 * Escapes and echoes outside Settings and Post Meta box.92 * Escapes and echoes also outside Settings and Post Meta box. 93 93 * 94 94 * @since 0.81.5 … … 108 108 anrghg_get_public_whitelist() 109 109 ); 110 } 111 112 /** 113 * Escapes and returns also outside Settings and Post Meta box. 114 * 115 * @since 1.1.2 116 * @param string $p_s_output HTML. 117 * @return string $l_s_output HTML. 118 */ 119 function anrghg_kses( $p_s_output ) { 120 $l_s_output = wp_kses( 121 $p_s_output, 122 anrghg_get_public_whitelist() 123 ); 124 return $l_s_output; 110 125 } 111 126 -
anrghg/trunk/readme.txt
r2748691 r2748759 37 37 38 38 * Protect your WordPress websites against password leak effectiveness, by deactivating the login dialog depending on the value of a constant in `wp-config.php`; 39 * Allow to configure that constantso that in multisite networks, individual sites may be toggled independently;40 * Make authentication cookies then last longer fora configurable period of time, e.g. until the day after the next scheduled login rush.39 * Make that constant configurable so that in multisite networks, individual sites may be toggled independently; 40 * Extend authentication cookie lifespans to a configurable period of time, e.g. until the day after the next scheduled login rush. 41 41 * Blank the login dialog out permanently if it is convenient to access the WordPress Admin area through the hosting platform exclusively. 42 42 43 43 44 = Thank You message =45 46 * Display a configurable message after your posts, and optionally another message at the bottom of your pages;47 * Activate, deactivate and configure the display of a messagein the post editor Meta box;48 * Configure standard messages in rich text in the Template editor and insert them by their name;49 * Configure in rich text and position one or more messages in the Block editor, using the ‘Thank You message’ block.44 = Thank You messages = 45 46 * Display a configurable message after your posts, and optionally another one at the bottom of your pages; 47 * Display a message depending on activation, deactivation and configuration in the post editor Meta box; 48 * Help with configuring rich text messages in the Template editor; 49 * Provide a block to configure messages right in your posts and pages. 50 50 51 51 … … 505 505 == Changelog == 506 506 507 = 1.2.0 (2022-06-27) = 508 509 * Import: Templates: Clarify the interface. 510 * Import: Custom: Check if provided option name does exist. 511 * Import: Fix bug in exit statement display. 512 507 513 = 1.1.1 (2022-06-27) = 508 514 -
anrghg/trunk/svn-revs.txt
r2748691 r2748759 11 11 Previous revisions: 12 12 13 1.1.1.0 2748691 2022-06-27 18:48:00 +0000 (Mon, 27 Jun 2022) 13 14 1.1.0.0 2747832 2022-06-25 03:03:42 +0000 (Sat, 25 Jun 2022) 14 15 1.0.4.0 2747340 2022-06-23 23:31:07 +0000 (Thu, 23 Jun 2022)
Note: See TracChangeset
for help on using the changeset viewer.