Changeset 3061445
- Timestamp:
- 03/30/2024 08:13:54 AM (23 months ago)
- Location:
- magic-robots-txt
- Files:
-
- 2 deleted
- 5 edited
- 11 copied
- 1 moved
-
. (modified) (1 prop)
-
tags/1.0.4/trunk (deleted)
-
tags/1.0.5 (copied) (copied from magic-robots-txt/trunk)
-
tags/1.0.5/admin/archivo.php (copied) (copied from magic-robots-txt/trunk/admin/archivo.php)
-
tags/1.0.5/admin/opciones.php (copied) (copied from magic-robots-txt/trunk/admin/opciones.php) (7 diffs)
-
tags/1.0.5/includes/configuracion.php (copied) (copied from magic-robots-txt/trunk/includes/configuracion.php)
-
tags/1.0.5/includes/mapasitio.php (copied) (copied from magic-robots-txt/trunk/includes/mapasitio.php)
-
tags/1.0.5/includes/publicidad.php (copied) (copied from magic-robots-txt/trunk/includes/publicidad.php)
-
tags/1.0.5/includes/robots.php (copied) (copied from magic-robots-txt/trunk/includes/robots.php)
-
tags/1.0.5/lista-opciones.php (copied) (copied from magic-robots-txt/trunk/lista_opciones.php) (1 diff)
-
tags/1.0.5/lista_opciones.php (deleted)
-
tags/1.0.5/magic-robots-txt.php (copied) (copied from magic-robots-txt/trunk/magic-robots-txt.php) (4 diffs)
-
tags/1.0.5/readme.txt (copied) (copied from magic-robots-txt/trunk/readme.txt) (2 diffs)
-
tags/1.0.5/uninstall.php (copied) (copied from magic-robots-txt/trunk/uninstall.php) (1 diff)
-
trunk/admin/opciones.php (modified) (7 diffs)
-
trunk/lista-opciones.php (moved) (moved from magic-robots-txt/trunk/lista_opciones.php) (1 diff)
-
trunk/magic-robots-txt.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
magic-robots-txt
-
Property
svn:ignore
set to
.svnignore
composer.json
composer.lock
vendor
-
Property
svn:ignore
set to
-
magic-robots-txt/tags/1.0.5/admin/opciones.php
r2968365 r3061445 26 26 } 27 27 28 // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- Base64 encoding used for SVG icon; considered safe. 29 $icono_base64 = 'data:image/svg+xml;base64,' . base64_encode( '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 511.999 511.999" style="fill:#a7aaad" xml:space="preserve"><g><g><path d="M424.464,226.038h-31.289c-4.637,0-8.394,3.758-8.394,8.394v17.485H370.51v-17.485c0-4.636-3.757-8.394-8.394-8.394h-34.743v-17.351h34.743c4.637,0,8.394-3.758,8.394-8.394V66.121c0-20.285-16.502-36.787-36.787-36.787h-69.329V8.394c0-4.636-3.757-8.394-8.394-8.394c-4.637,0-8.394,3.758-8.394,8.394v20.939h-69.33c-20.285,0-36.787,16.503-36.787,36.787v134.173c0,4.636,3.757,8.394,8.394,8.394h34.744v17.351h-34.744c-4.637,0-8.394,3.758-8.394,8.394v17.485h-14.271v-17.485c0-4.636-3.757-8.394-8.394-8.394h-31.29c-4.637,0-8.394,3.758-8.394,8.394v169.096c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V303.215h14.271v68.203c0,4.636,3.757,8.394,8.394,8.394h14.9v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h83.289v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h14.9c4.637,0,8.394-3.758,8.394-8.394v-68.203h14.271v100.312c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V234.431C432.857,229.796,429.1,226.038,424.464,226.038z M110.43,395.134H95.929V242.826h14.501V395.134z M141.489,286.428h-14.271v-17.723h14.271V286.428z M158.276,191.9V66.121c0-11.028,8.972-20,20-20h155.447c11.028,0,20,8.972,20,20V191.9H158.276z M310.586,208.686v17.351H201.414v-17.351H310.586z M216.547,472.314v22.898h-53.957v-22.898H216.547z M181.571,455.526v-75.713h15.998v75.713H181.571z M349.409,472.314v22.898h-53.957v-22.898H349.409zM314.433,455.526v-75.713h15.998v75.713h0H314.433z M353.723,363.024H158.276V242.826h195.446V363.024z M384.781,286.428H370.51v-17.723h14.271V286.428z M416.07,395.134h-14.501V242.826h14.501V395.134z"/></g></g><g><g><path d="M204.236,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.726,37.727,37.726c20.802,0.001,37.726-16.923,37.726-37.726C241.963,101.668,225.039,84.744,204.236,84.744z M204.236,143.409c-11.545,0-20.94-9.392-20.94-20.939c0-11.545,9.394-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C225.175,134.016,215.782,143.409,204.236,143.409z"/></g></g><g><g><path d="M307.765,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.727,37.727,37.727c20.802,0,37.726-16.924,37.726-37.726S328.567,84.744,307.765,84.744z M307.765,143.409c-11.545,0-20.94-9.393-20.94-20.939c0-11.545,9.393-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C328.703,134.016,319.31,143.409,307.765,143.409z"/></g></g><g><g><path d="M256.001,270.9c-30.317,0-54.982,24.664-54.982,54.982c0,4.636,3.757,8.394,8.394,8.394h93.176c4.637,0,8.394-3.758,8.394-8.394C310.982,295.565,286.318,270.9,256.001,270.9z M218.735,317.488c3.835-17.036,19.089-29.8,37.265-29.8c18.177,0,33.43,12.764,37.265,29.8H218.735z"/></g></g><g><g><circle cx="326.744" cy="267.215" r="8.394"/></g></g><g><g><circle cx="185.257" cy="267.215" r="8.394"/></g></g></svg>' ); 28 30 add_menu_page( 29 31 __( 'Magic robots.txt', 'magic-robots-txt' ) . ' - ' . __( 'Settings', 'magic-robots-txt' ), // Page title. 30 32 __( 'Magic robots.txt', 'magic-robots-txt' ) . wp_kses_post( $notificacion_globo ), 31 ' administrator',// Capability.33 'manage_options', // Capability. 32 34 'magic-robots-txt', // Menu slug. 33 35 'mrt_admin', // Function. 34 'data:image/svg+xml;base64,' . base64_encode( '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 511.999 511.999" style="fill:#a7aaad" xml:space="preserve"><g><g><path d="M424.464,226.038h-31.289c-4.637,0-8.394,3.758-8.394,8.394v17.485H370.51v-17.485c0-4.636-3.757-8.394-8.394-8.394h-34.743v-17.351h34.743c4.637,0,8.394-3.758,8.394-8.394V66.121c0-20.285-16.502-36.787-36.787-36.787h-69.329V8.394c0-4.636-3.757-8.394-8.394-8.394c-4.637,0-8.394,3.758-8.394,8.394v20.939h-69.33c-20.285,0-36.787,16.503-36.787,36.787v134.173c0,4.636,3.757,8.394,8.394,8.394h34.744v17.351h-34.744c-4.637,0-8.394,3.758-8.394,8.394v17.485h-14.271v-17.485c0-4.636-3.757-8.394-8.394-8.394h-31.29c-4.637,0-8.394,3.758-8.394,8.394v169.096c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V303.215h14.271v68.203c0,4.636,3.757,8.394,8.394,8.394h14.9v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h83.289v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h14.9c4.637,0,8.394-3.758,8.394-8.394v-68.203h14.271v100.312c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V234.431C432.857,229.796,429.1,226.038,424.464,226.038z M110.43,395.134H95.929V242.826h14.501V395.134z M141.489,286.428h-14.271v-17.723h14.271V286.428z M158.276,191.9V66.121c0-11.028,8.972-20,20-20h155.447c11.028,0,20,8.972,20,20V191.9H158.276z M310.586,208.686v17.351H201.414v-17.351H310.586z M216.547,472.314v22.898h-53.957v-22.898H216.547z M181.571,455.526v-75.713h15.998v75.713H181.571z M349.409,472.314v22.898h-53.957v-22.898H349.409zM314.433,455.526v-75.713h15.998v75.713h0H314.433z M353.723,363.024H158.276V242.826h195.446V363.024z M384.781,286.428H370.51v-17.723h14.271V286.428z M416.07,395.134h-14.501V242.826h14.501V395.134z"/></g></g><g><g><path d="M204.236,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.726,37.727,37.726c20.802,0.001,37.726-16.923,37.726-37.726C241.963,101.668,225.039,84.744,204.236,84.744z M204.236,143.409c-11.545,0-20.94-9.392-20.94-20.939c0-11.545,9.394-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C225.175,134.016,215.782,143.409,204.236,143.409z"/></g></g><g><g><path d="M307.765,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.727,37.727,37.727c20.802,0,37.726-16.924,37.726-37.726S328.567,84.744,307.765,84.744z M307.765,143.409c-11.545,0-20.94-9.393-20.94-20.939c0-11.545,9.393-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C328.703,134.016,319.31,143.409,307.765,143.409z"/></g></g><g><g><path d="M256.001,270.9c-30.317,0-54.982,24.664-54.982,54.982c0,4.636,3.757,8.394,8.394,8.394h93.176c4.637,0,8.394-3.758,8.394-8.394C310.982,295.565,286.318,270.9,256.001,270.9z M218.735,317.488c3.835-17.036,19.089-29.8,37.265-29.8c18.177,0,33.43,12.764,37.265,29.8H218.735z"/></g></g><g><g><circle cx="326.744" cy="267.215" r="8.394"/></g></g><g><g><circle cx="185.257" cy="267.215" r="8.394"/></g></g></svg>' )// Icon.36 'data:image/svg+xml;base64,' . $icono_base64, // Icon. 35 37 ); 36 38 } … … 82 84 function mrt_logo( $alturacss = '30px' ) { 83 85 $html = '<img src="'; 84 $html .= plugin_dir_url( dirname( __FILE__ )) . 'admin/images/robot.svg';86 $html .= plugin_dir_url( __DIR__ ) . 'admin/images/robot.svg'; 85 87 $html .= '" style="width:auto;height:'; 86 88 $html .= $alturacss; … … 122 124 mrt_echo_debug_info(); 123 125 } 124 125 } 126 } 127 128 /** 129 * Maneja acciones posteriores a la actualización de opciones específicas del plugin. 130 * 131 * Esta función se engancha en la acción `updated_option` de WordPress y establece 132 * un transitorio cuando se actualiza una opción relacionada con el plugin 'Magic robots.txt'. 133 * Esto permite realizar acciones solo una vez después de que las opciones relevantes 134 * han sido actualizadas, como regenerar archivos o limpiar cachés. 135 * 136 * @param string $option_name El nombre de la opción que se ha actualizado. Se espera que 137 * comience con 'mrt_' para las opciones relevantes del plugin. 138 */ 139 function mrt_on_option_update( $option_name ) { 140 // Comprueba si la opción actualizada es relevante para el plugin. 141 if ( false !== strpos( $option_name, 'mrt_' ) ) { 142 // Establece un transitorio para indicar que una opción relevante ha sido actualizada. 143 // El transitorio 'mrt_settings_updated' se usa para desencadenar acciones específicas 144 // del plugin que solo deben ocurrir después de la actualización de la configuración. 145 set_transient( 'mrt_settings_updated', 'yes', 30 ); 146 } 147 } 148 // Engancha la función al hook 'updated_option' de WordPress. 149 add_action( 'updated_option', 'mrt_on_option_update', 10, 1 ); 126 150 127 151 /** Funcionalidad de la página de ajustes. */ … … 133 157 134 158 // Gestión de uso de archivo físico. 135 if ( isset( $_GET['settings-updated'] ) ) { 159 // if ( isset( $_GET['settings-updated'] ) ) { 160 // Mediante el transitorio creado en mrt_on_option_update, sabremso que se grabaron las opciones sin requerir 161 // el acceso a $_GET y el consiguiente requisito de nonce de WPCS. 162 if ( get_transient( 'mrt_settings_updated' ) ) { 136 163 // Grabando ajustes es el momento de editar el archivo robots.txt físico si corresponde. 137 164 // Solo si (está configurado hacerlo o es forzoso) y se puede. … … 150 177 } 151 178 } 179 delete_transient( 'mrt_settings_updated' ); // Liquida el transitorio. 152 180 } 153 181 … … 269 297 if ( mrt_conf_carga() ) { 270 298 $nivel_carga = mrt_conf_carga(); 271 } else { 272 if ( mrt_carga_calculable() ) { 273 // Considera el nivel obtenido si es posible. 274 echo esc_html( ucfirst( __( 'the server load detected is', 'magic-robots-txt' ) ) . ' ' ); 275 $carga = mrt_carga_15(); 276 $nivel_carga = mrt_nivel_carga( $carga ); 277 echo esc_html( ucfirst( mrt_texto_carga( $nivel_carga ) ) ); 278 echo ".<br />\n"; 279 // Considera el nivel por omisión si no es posible obtenerlo. 280 } else { 281 $carga = mrt_carga_omision(); 282 $nivel_carga = mrt_nivel_carga( $carga ); 283 echo esc_html( ucfirst( __( 'server load can\'t be detected', 'magic-robots-txt' ) ) . '. ' ); 284 /* translators: %s: Load average number. */ 285 echo esc_html( ucfirst( sprintf( __( 'don\'t worry, estimating a %s value', 'magic-robots-txt' ), mrt_texto_carga( $nivel_carga ) ) ) . ' ' ); 286 esc_html_e( 'does the trick', 'magic-robots-txt' ); 287 echo ".<br /><br />\n"; 288 } 299 } elseif ( mrt_carga_calculable() ) { 300 // Considera el nivel obtenido si es posible. 301 echo esc_html( ucfirst( __( 'the server load detected is', 'magic-robots-txt' ) ) . ' ' ); 302 $carga = mrt_carga_15(); 303 $nivel_carga = mrt_nivel_carga( $carga ); 304 echo esc_html( ucfirst( mrt_texto_carga( $nivel_carga ) ) ); 305 echo ".<br />\n"; 306 // Considera el nivel por omisión si no es posible obtenerlo. 307 } else { 308 $carga = mrt_carga_omision(); 309 $nivel_carga = mrt_nivel_carga( $carga ); 310 echo esc_html( ucfirst( __( 'server load can\'t be detected', 'magic-robots-txt' ) ) . '. ' ); 311 /* translators: %s: Load average number. */ 312 echo esc_html( ucfirst( sprintf( __( 'don\'t worry, estimating a %s value', 'magic-robots-txt' ), mrt_texto_carga( $nivel_carga ) ) ) . ' ' ); 313 esc_html_e( 'does the trick', 'magic-robots-txt' ); 314 echo ".<br /><br />\n"; 289 315 } 290 316 echo '<input type="radio" name="mrt_carga" value="4" ' . checked( '4', $nivel_carga, false ) . '>'; … … 719 745 echo esc_html( mrt_subdirectorio_wp() ); 720 746 echo '<br />'; 721 722 } 747 } -
magic-robots-txt/tags/1.0.5/lista-opciones.php
r2968365 r3061445 22 22 'mrt_carga', 23 23 'mrt_ahorro', 24 // 'mrt_sitio_publico',25 24 'mrt_venta_publicidad', 26 25 'mrt_venta_enlaces', -
magic-robots-txt/tags/1.0.5/magic-robots-txt.php
r3018300 r3061445 4 4 * Plugin URI: https://taller.abcdatos.net/robots-txt-wordpress/ 5 5 * Description: Manages robots access control via robots.txt 6 * Version: 1.0. 46 * Version: 1.0.5 7 7 * Author: ABCdatos 8 8 * Author URI: https://taller.abcdatos.net/ … … 19 19 /** Requerido o se obtiene error Plugin is not compatible with language packs: Missing load_plugin_textdomain(). en el canal de Slack #meta-language-packs. */ 20 20 function mrt_load_plugin_textdomain() { 21 load_plugin_textdomain( 'magic-robots-txt', false, basename( dirname( __FILE__ )) . '/languages' );21 load_plugin_textdomain( 'magic-robots-txt', false, basename( __DIR__ ) . '/languages' ); 22 22 } 23 23 add_action( 'plugins_loaded', 'mrt_load_plugin_textdomain' ); … … 27 27 require_once plugin_dir_path( __FILE__ ) . 'includes/publicidad.php'; 28 28 // Lista de variables usadas en tabla options. 29 require_once plugin_dir_path( __FILE__ ) . 'lista _opciones.php';29 require_once plugin_dir_path( __FILE__ ) . 'lista-opciones.php'; 30 30 // Funciones sobre el contenido del archivo robots.txt. 31 31 require_once plugin_dir_path( __FILE__ ) . 'includes/robots.php'; … … 55 55 $nuevo_sitemap .= '# Debug mode: ' . ucfirst( __( 'already have sitemap', 'magic-robots-txt' ) ) . "\n"; 56 56 } 57 } else { 58 if ( mrt_sitemaps_enabled() ) { 59 $nuevo_sitemap .= 'Sitemap: ' . mrt_sitemap_wp_url() . "\n\n"; 60 } elseif ( WP_DEBUG ) { 61 $nuevo_sitemap .= '# Debug mode: ' . ucfirst( __( 'disabled sitemap', 'magic-robots-txt' ) ) . "\n"; 62 } 57 } elseif ( mrt_sitemaps_enabled() ) { 58 $nuevo_sitemap .= 'Sitemap: ' . mrt_sitemap_wp_url() . "\n\n"; 59 } elseif ( WP_DEBUG ) { 60 $nuevo_sitemap .= '# Debug mode: ' . ucfirst( __( 'disabled sitemap', 'magic-robots-txt' ) ) . "\n"; 63 61 } 64 62 -
magic-robots-txt/tags/1.0.5/readme.txt
r3018299 r3061445 3 3 Tags: robots,robots.txt,seo,google,bots 4 4 Requires at least: 4.2 5 Tested up to: 6. 46 Stable tag: 1.0. 35 Tested up to: 6.5 6 Stable tag: 1.0.5 7 7 Requires PHP: 5.4 8 8 License: GPLv2 … … 95 95 == Changelog == 96 96 97 = 1.0.5 = 98 *Mar 30 2024* 99 * Changed the required capability to access the settings page. 100 * Improved settings update mechanism for conditional real robots.txt file generation. 101 * Minor code improvements. 102 * WordPress 6.5 basic compatibility checked. 103 97 104 = 1.0.4 = 98 *Jan 0 62024*105 *Jan 07 2024* 99 106 * Added Owler (Open Web Search) to search engines bot list. 100 107 * Added netEstate NE Crawler (Sengine) to search engines bot list. -
magic-robots-txt/tags/1.0.5/uninstall.php
r2968365 r3061445 15 15 defined( 'WP_UNINSTALL_PLUGIN' ) || die( esc_html( __( 'Access is not allowed.', 'magic-robots-txt' ) ) ); 16 16 17 require_once plugin_dir_path( __FILE__ ) . 'lista _opciones.php';17 require_once plugin_dir_path( __FILE__ ) . 'lista-opciones.php'; 18 18 19 19 // Removes all the option values defined in the array. -
magic-robots-txt/trunk/admin/opciones.php
r2968365 r3061445 26 26 } 27 27 28 // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- Base64 encoding used for SVG icon; considered safe. 29 $icono_base64 = 'data:image/svg+xml;base64,' . base64_encode( '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 511.999 511.999" style="fill:#a7aaad" xml:space="preserve"><g><g><path d="M424.464,226.038h-31.289c-4.637,0-8.394,3.758-8.394,8.394v17.485H370.51v-17.485c0-4.636-3.757-8.394-8.394-8.394h-34.743v-17.351h34.743c4.637,0,8.394-3.758,8.394-8.394V66.121c0-20.285-16.502-36.787-36.787-36.787h-69.329V8.394c0-4.636-3.757-8.394-8.394-8.394c-4.637,0-8.394,3.758-8.394,8.394v20.939h-69.33c-20.285,0-36.787,16.503-36.787,36.787v134.173c0,4.636,3.757,8.394,8.394,8.394h34.744v17.351h-34.744c-4.637,0-8.394,3.758-8.394,8.394v17.485h-14.271v-17.485c0-4.636-3.757-8.394-8.394-8.394h-31.29c-4.637,0-8.394,3.758-8.394,8.394v169.096c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V303.215h14.271v68.203c0,4.636,3.757,8.394,8.394,8.394h14.9v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h83.289v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h14.9c4.637,0,8.394-3.758,8.394-8.394v-68.203h14.271v100.312c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V234.431C432.857,229.796,429.1,226.038,424.464,226.038z M110.43,395.134H95.929V242.826h14.501V395.134z M141.489,286.428h-14.271v-17.723h14.271V286.428z M158.276,191.9V66.121c0-11.028,8.972-20,20-20h155.447c11.028,0,20,8.972,20,20V191.9H158.276z M310.586,208.686v17.351H201.414v-17.351H310.586z M216.547,472.314v22.898h-53.957v-22.898H216.547z M181.571,455.526v-75.713h15.998v75.713H181.571z M349.409,472.314v22.898h-53.957v-22.898H349.409zM314.433,455.526v-75.713h15.998v75.713h0H314.433z M353.723,363.024H158.276V242.826h195.446V363.024z M384.781,286.428H370.51v-17.723h14.271V286.428z M416.07,395.134h-14.501V242.826h14.501V395.134z"/></g></g><g><g><path d="M204.236,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.726,37.727,37.726c20.802,0.001,37.726-16.923,37.726-37.726C241.963,101.668,225.039,84.744,204.236,84.744z M204.236,143.409c-11.545,0-20.94-9.392-20.94-20.939c0-11.545,9.394-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C225.175,134.016,215.782,143.409,204.236,143.409z"/></g></g><g><g><path d="M307.765,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.727,37.727,37.727c20.802,0,37.726-16.924,37.726-37.726S328.567,84.744,307.765,84.744z M307.765,143.409c-11.545,0-20.94-9.393-20.94-20.939c0-11.545,9.393-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C328.703,134.016,319.31,143.409,307.765,143.409z"/></g></g><g><g><path d="M256.001,270.9c-30.317,0-54.982,24.664-54.982,54.982c0,4.636,3.757,8.394,8.394,8.394h93.176c4.637,0,8.394-3.758,8.394-8.394C310.982,295.565,286.318,270.9,256.001,270.9z M218.735,317.488c3.835-17.036,19.089-29.8,37.265-29.8c18.177,0,33.43,12.764,37.265,29.8H218.735z"/></g></g><g><g><circle cx="326.744" cy="267.215" r="8.394"/></g></g><g><g><circle cx="185.257" cy="267.215" r="8.394"/></g></g></svg>' ); 28 30 add_menu_page( 29 31 __( 'Magic robots.txt', 'magic-robots-txt' ) . ' - ' . __( 'Settings', 'magic-robots-txt' ), // Page title. 30 32 __( 'Magic robots.txt', 'magic-robots-txt' ) . wp_kses_post( $notificacion_globo ), 31 ' administrator',// Capability.33 'manage_options', // Capability. 32 34 'magic-robots-txt', // Menu slug. 33 35 'mrt_admin', // Function. 34 'data:image/svg+xml;base64,' . base64_encode( '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 511.999 511.999" style="fill:#a7aaad" xml:space="preserve"><g><g><path d="M424.464,226.038h-31.289c-4.637,0-8.394,3.758-8.394,8.394v17.485H370.51v-17.485c0-4.636-3.757-8.394-8.394-8.394h-34.743v-17.351h34.743c4.637,0,8.394-3.758,8.394-8.394V66.121c0-20.285-16.502-36.787-36.787-36.787h-69.329V8.394c0-4.636-3.757-8.394-8.394-8.394c-4.637,0-8.394,3.758-8.394,8.394v20.939h-69.33c-20.285,0-36.787,16.503-36.787,36.787v134.173c0,4.636,3.757,8.394,8.394,8.394h34.744v17.351h-34.744c-4.637,0-8.394,3.758-8.394,8.394v17.485h-14.271v-17.485c0-4.636-3.757-8.394-8.394-8.394h-31.29c-4.637,0-8.394,3.758-8.394,8.394v169.096c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V303.215h14.271v68.203c0,4.636,3.757,8.394,8.394,8.394h14.9v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h83.289v75.713h-10.586c-4.637,0-8.394,3.758-8.394,8.394v39.686c0,4.636,3.757,8.394,8.394,8.394h70.744c4.637,0,8.394-3.758,8.394-8.394v-39.686c0-4.636-3.757-8.394-8.394-8.394h-10.585v-75.713h14.9c4.637,0,8.394-3.758,8.394-8.394v-68.203h14.271v100.312c0,4.636,3.757,8.394,8.394,8.394h31.289c4.637,0,8.394-3.758,8.394-8.394V234.431C432.857,229.796,429.1,226.038,424.464,226.038z M110.43,395.134H95.929V242.826h14.501V395.134z M141.489,286.428h-14.271v-17.723h14.271V286.428z M158.276,191.9V66.121c0-11.028,8.972-20,20-20h155.447c11.028,0,20,8.972,20,20V191.9H158.276z M310.586,208.686v17.351H201.414v-17.351H310.586z M216.547,472.314v22.898h-53.957v-22.898H216.547z M181.571,455.526v-75.713h15.998v75.713H181.571z M349.409,472.314v22.898h-53.957v-22.898H349.409zM314.433,455.526v-75.713h15.998v75.713h0H314.433z M353.723,363.024H158.276V242.826h195.446V363.024z M384.781,286.428H370.51v-17.723h14.271V286.428z M416.07,395.134h-14.501V242.826h14.501V395.134z"/></g></g><g><g><path d="M204.236,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.726,37.727,37.726c20.802,0.001,37.726-16.923,37.726-37.726C241.963,101.668,225.039,84.744,204.236,84.744z M204.236,143.409c-11.545,0-20.94-9.392-20.94-20.939c0-11.545,9.394-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C225.175,134.016,215.782,143.409,204.236,143.409z"/></g></g><g><g><path d="M307.765,84.744c-20.803,0-37.727,16.924-37.727,37.726c0,20.802,16.924,37.727,37.727,37.727c20.802,0,37.726-16.924,37.726-37.726S328.567,84.744,307.765,84.744z M307.765,143.409c-11.545,0-20.94-9.393-20.94-20.939c0-11.545,9.393-20.939,20.94-20.939c11.545,0,20.939,9.393,20.939,20.939C328.703,134.016,319.31,143.409,307.765,143.409z"/></g></g><g><g><path d="M256.001,270.9c-30.317,0-54.982,24.664-54.982,54.982c0,4.636,3.757,8.394,8.394,8.394h93.176c4.637,0,8.394-3.758,8.394-8.394C310.982,295.565,286.318,270.9,256.001,270.9z M218.735,317.488c3.835-17.036,19.089-29.8,37.265-29.8c18.177,0,33.43,12.764,37.265,29.8H218.735z"/></g></g><g><g><circle cx="326.744" cy="267.215" r="8.394"/></g></g><g><g><circle cx="185.257" cy="267.215" r="8.394"/></g></g></svg>' )// Icon.36 'data:image/svg+xml;base64,' . $icono_base64, // Icon. 35 37 ); 36 38 } … … 82 84 function mrt_logo( $alturacss = '30px' ) { 83 85 $html = '<img src="'; 84 $html .= plugin_dir_url( dirname( __FILE__ )) . 'admin/images/robot.svg';86 $html .= plugin_dir_url( __DIR__ ) . 'admin/images/robot.svg'; 85 87 $html .= '" style="width:auto;height:'; 86 88 $html .= $alturacss; … … 122 124 mrt_echo_debug_info(); 123 125 } 124 125 } 126 } 127 128 /** 129 * Maneja acciones posteriores a la actualización de opciones específicas del plugin. 130 * 131 * Esta función se engancha en la acción `updated_option` de WordPress y establece 132 * un transitorio cuando se actualiza una opción relacionada con el plugin 'Magic robots.txt'. 133 * Esto permite realizar acciones solo una vez después de que las opciones relevantes 134 * han sido actualizadas, como regenerar archivos o limpiar cachés. 135 * 136 * @param string $option_name El nombre de la opción que se ha actualizado. Se espera que 137 * comience con 'mrt_' para las opciones relevantes del plugin. 138 */ 139 function mrt_on_option_update( $option_name ) { 140 // Comprueba si la opción actualizada es relevante para el plugin. 141 if ( false !== strpos( $option_name, 'mrt_' ) ) { 142 // Establece un transitorio para indicar que una opción relevante ha sido actualizada. 143 // El transitorio 'mrt_settings_updated' se usa para desencadenar acciones específicas 144 // del plugin que solo deben ocurrir después de la actualización de la configuración. 145 set_transient( 'mrt_settings_updated', 'yes', 30 ); 146 } 147 } 148 // Engancha la función al hook 'updated_option' de WordPress. 149 add_action( 'updated_option', 'mrt_on_option_update', 10, 1 ); 126 150 127 151 /** Funcionalidad de la página de ajustes. */ … … 133 157 134 158 // Gestión de uso de archivo físico. 135 if ( isset( $_GET['settings-updated'] ) ) { 159 // if ( isset( $_GET['settings-updated'] ) ) { 160 // Mediante el transitorio creado en mrt_on_option_update, sabremso que se grabaron las opciones sin requerir 161 // el acceso a $_GET y el consiguiente requisito de nonce de WPCS. 162 if ( get_transient( 'mrt_settings_updated' ) ) { 136 163 // Grabando ajustes es el momento de editar el archivo robots.txt físico si corresponde. 137 164 // Solo si (está configurado hacerlo o es forzoso) y se puede. … … 150 177 } 151 178 } 179 delete_transient( 'mrt_settings_updated' ); // Liquida el transitorio. 152 180 } 153 181 … … 269 297 if ( mrt_conf_carga() ) { 270 298 $nivel_carga = mrt_conf_carga(); 271 } else { 272 if ( mrt_carga_calculable() ) { 273 // Considera el nivel obtenido si es posible. 274 echo esc_html( ucfirst( __( 'the server load detected is', 'magic-robots-txt' ) ) . ' ' ); 275 $carga = mrt_carga_15(); 276 $nivel_carga = mrt_nivel_carga( $carga ); 277 echo esc_html( ucfirst( mrt_texto_carga( $nivel_carga ) ) ); 278 echo ".<br />\n"; 279 // Considera el nivel por omisión si no es posible obtenerlo. 280 } else { 281 $carga = mrt_carga_omision(); 282 $nivel_carga = mrt_nivel_carga( $carga ); 283 echo esc_html( ucfirst( __( 'server load can\'t be detected', 'magic-robots-txt' ) ) . '. ' ); 284 /* translators: %s: Load average number. */ 285 echo esc_html( ucfirst( sprintf( __( 'don\'t worry, estimating a %s value', 'magic-robots-txt' ), mrt_texto_carga( $nivel_carga ) ) ) . ' ' ); 286 esc_html_e( 'does the trick', 'magic-robots-txt' ); 287 echo ".<br /><br />\n"; 288 } 299 } elseif ( mrt_carga_calculable() ) { 300 // Considera el nivel obtenido si es posible. 301 echo esc_html( ucfirst( __( 'the server load detected is', 'magic-robots-txt' ) ) . ' ' ); 302 $carga = mrt_carga_15(); 303 $nivel_carga = mrt_nivel_carga( $carga ); 304 echo esc_html( ucfirst( mrt_texto_carga( $nivel_carga ) ) ); 305 echo ".<br />\n"; 306 // Considera el nivel por omisión si no es posible obtenerlo. 307 } else { 308 $carga = mrt_carga_omision(); 309 $nivel_carga = mrt_nivel_carga( $carga ); 310 echo esc_html( ucfirst( __( 'server load can\'t be detected', 'magic-robots-txt' ) ) . '. ' ); 311 /* translators: %s: Load average number. */ 312 echo esc_html( ucfirst( sprintf( __( 'don\'t worry, estimating a %s value', 'magic-robots-txt' ), mrt_texto_carga( $nivel_carga ) ) ) . ' ' ); 313 esc_html_e( 'does the trick', 'magic-robots-txt' ); 314 echo ".<br /><br />\n"; 289 315 } 290 316 echo '<input type="radio" name="mrt_carga" value="4" ' . checked( '4', $nivel_carga, false ) . '>'; … … 719 745 echo esc_html( mrt_subdirectorio_wp() ); 720 746 echo '<br />'; 721 722 } 747 } -
magic-robots-txt/trunk/lista-opciones.php
r3061444 r3061445 22 22 'mrt_carga', 23 23 'mrt_ahorro', 24 // 'mrt_sitio_publico',25 24 'mrt_venta_publicidad', 26 25 'mrt_venta_enlaces', -
magic-robots-txt/trunk/magic-robots-txt.php
r3018300 r3061445 4 4 * Plugin URI: https://taller.abcdatos.net/robots-txt-wordpress/ 5 5 * Description: Manages robots access control via robots.txt 6 * Version: 1.0. 46 * Version: 1.0.5 7 7 * Author: ABCdatos 8 8 * Author URI: https://taller.abcdatos.net/ … … 19 19 /** Requerido o se obtiene error Plugin is not compatible with language packs: Missing load_plugin_textdomain(). en el canal de Slack #meta-language-packs. */ 20 20 function mrt_load_plugin_textdomain() { 21 load_plugin_textdomain( 'magic-robots-txt', false, basename( dirname( __FILE__ )) . '/languages' );21 load_plugin_textdomain( 'magic-robots-txt', false, basename( __DIR__ ) . '/languages' ); 22 22 } 23 23 add_action( 'plugins_loaded', 'mrt_load_plugin_textdomain' ); … … 27 27 require_once plugin_dir_path( __FILE__ ) . 'includes/publicidad.php'; 28 28 // Lista de variables usadas en tabla options. 29 require_once plugin_dir_path( __FILE__ ) . 'lista _opciones.php';29 require_once plugin_dir_path( __FILE__ ) . 'lista-opciones.php'; 30 30 // Funciones sobre el contenido del archivo robots.txt. 31 31 require_once plugin_dir_path( __FILE__ ) . 'includes/robots.php'; … … 55 55 $nuevo_sitemap .= '# Debug mode: ' . ucfirst( __( 'already have sitemap', 'magic-robots-txt' ) ) . "\n"; 56 56 } 57 } else { 58 if ( mrt_sitemaps_enabled() ) { 59 $nuevo_sitemap .= 'Sitemap: ' . mrt_sitemap_wp_url() . "\n\n"; 60 } elseif ( WP_DEBUG ) { 61 $nuevo_sitemap .= '# Debug mode: ' . ucfirst( __( 'disabled sitemap', 'magic-robots-txt' ) ) . "\n"; 62 } 57 } elseif ( mrt_sitemaps_enabled() ) { 58 $nuevo_sitemap .= 'Sitemap: ' . mrt_sitemap_wp_url() . "\n\n"; 59 } elseif ( WP_DEBUG ) { 60 $nuevo_sitemap .= '# Debug mode: ' . ucfirst( __( 'disabled sitemap', 'magic-robots-txt' ) ) . "\n"; 63 61 } 64 62 -
magic-robots-txt/trunk/readme.txt
r3018299 r3061445 3 3 Tags: robots,robots.txt,seo,google,bots 4 4 Requires at least: 4.2 5 Tested up to: 6. 46 Stable tag: 1.0. 35 Tested up to: 6.5 6 Stable tag: 1.0.5 7 7 Requires PHP: 5.4 8 8 License: GPLv2 … … 95 95 == Changelog == 96 96 97 = 1.0.5 = 98 *Mar 30 2024* 99 * Changed the required capability to access the settings page. 100 * Improved settings update mechanism for conditional real robots.txt file generation. 101 * Minor code improvements. 102 * WordPress 6.5 basic compatibility checked. 103 97 104 = 1.0.4 = 98 *Jan 0 62024*105 *Jan 07 2024* 99 106 * Added Owler (Open Web Search) to search engines bot list. 100 107 * Added netEstate NE Crawler (Sengine) to search engines bot list. -
magic-robots-txt/trunk/uninstall.php
r2968365 r3061445 15 15 defined( 'WP_UNINSTALL_PLUGIN' ) || die( esc_html( __( 'Access is not allowed.', 'magic-robots-txt' ) ) ); 16 16 17 require_once plugin_dir_path( __FILE__ ) . 'lista _opciones.php';17 require_once plugin_dir_path( __FILE__ ) . 'lista-opciones.php'; 18 18 19 19 // Removes all the option values defined in the array.
Note: See TracChangeset
for help on using the changeset viewer.