From 0c4fda16c087ce91ec15d296d07c444076893928 Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Tue, 18 Aug 2026 12:00:07 +0000 Subject: [PATCH] v1.2.5 --- assets/js/manager-notice.js | 29 ++ changelog.txt | 60 ++++ includes/class-robotstxt-hello-plugin.php | 244 +++++++++++++++- languages/robotstxt-hello-ca.mo | Bin 378 -> 1049 bytes languages/robotstxt-hello-ca.po | 29 +- languages/robotstxt-hello-de_DE.mo | Bin 382 -> 1033 bytes languages/robotstxt-hello-de_DE.po | 29 +- languages/robotstxt-hello-es_ES.mo | Bin 381 -> 1031 bytes languages/robotstxt-hello-es_ES.po | 29 +- languages/robotstxt-hello-eu.mo | Bin 379 -> 1021 bytes languages/robotstxt-hello-eu.po | 29 +- languages/robotstxt-hello-fr_FR.mo | Bin 384 -> 1105 bytes languages/robotstxt-hello-fr_FR.po | 31 +- languages/robotstxt-hello-gl_ES.mo | Bin 380 -> 1019 bytes languages/robotstxt-hello-gl_ES.po | 29 +- languages/robotstxt-hello-it_IT.mo | Bin 381 -> 1051 bytes languages/robotstxt-hello-it_IT.po | 29 +- languages/robotstxt-hello-pl_PL.mo | Bin 384 -> 1113 bytes languages/robotstxt-hello-pl_PL.po | 31 +- languages/robotstxt-hello-pt_PT.mo | Bin 381 -> 1038 bytes languages/robotstxt-hello-pt_PT.po | 29 +- readme.txt | 93 +++--- robotstxt-hello.php | 22 +- robotstxt-updater.php | 332 ---------------------- uninstall.php | 19 ++ update.json | 13 - 26 files changed, 619 insertions(+), 458 deletions(-) create mode 100644 assets/js/manager-notice.js delete mode 100644 robotstxt-updater.php create mode 100644 uninstall.php delete mode 100644 update.json diff --git a/assets/js/manager-notice.js b/assets/js/manager-notice.js new file mode 100644 index 0000000..fb0db0a --- /dev/null +++ b/assets/js/manager-notice.js @@ -0,0 +1,29 @@ +/** + * Persists the dismissal of the Manager (by ROBOTSTXT) admin notice. + * + * WordPress only hides a dismissible notice for the current page load; + * this script stores the dismissal so it does not come back. + */ +( function () { + 'use strict'; + + document.addEventListener( 'click', function ( event ) { + var notice = event.target.closest + ? event.target.closest( '.robotstxt-hello-manager-notice .notice-dismiss' ) + : null; + + if ( ! notice ) { + return; + } + + var data = new FormData(); + data.append( 'action', 'robotstxt_hello_dismiss_manager_notice' ); + data.append( 'nonce', window.robotstxthellomanagernotice.nonce ); + + window.fetch( window.robotstxthellomanagernotice.ajaxUrl, { + method: 'POST', + credentials: 'same-origin', + body: data + } ); + } ); +}() ); diff --git a/changelog.txt b/changelog.txt index 4082c78..d7263f3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,63 @@ +== Changelog == + += 1.2.5 = + +_Release date: 2026-08-18_ + +**Fixed** + +* The Hello menu item is now registered at position 1000 instead of PHP_INT_MAX. Positions are array keys in the WordPress menu array, and on WordPress 4.0-6.4 two top-level items registered at the same position overwrite each other, silently removing one of the menus. PHP_INT_MAX is one of the most popular "bottom" values in the ecosystem, so collisions were likely; 1000 sits past the last core separator (99), keeps the item at the bottom of the menu, and WordPress 6.5+ resolves any remaining collision automatically. + +**Compatibility** + +* WordPress: 4.0 - 7.1 +* PHP: 5.6 - 8.5 +* MariaDB: 11.8 (staging) + +**Tests** + +* PHP Coding Standards: 3.13.6 +* WordPress Coding Standards: 3.4.1 +* PHPStan: 2.2.8 with wp-compat (Requires at least 4.0) +* PHPUnit: 9.6.36 (plugin header tests included, line coverage 88.5%) + += 1.2.4 = + +_Release date: 2026-08-18_ + +**Highlights** + +* Automatic updates are now handled by the ROBOTSTXT ecosystem: the bundled auto-updater was removed in favor of Manager (by ROBOTSTXT). + +**Added** + +* Dismissible notice on the Plugins screen (single site and network) when Manager (by ROBOTSTXT) is not installed and active, with a link to its plugin page. +* Permanent, non-dismissible notice on the plugin settings page when Manager (by ROBOTSTXT) is not available. +* Setting to remove plugin data on uninstall. Data is preserved by default unless the user explicitly opts in. +* Uninstall routine that honors the data-removal setting. + +**Changed** + +* Author, contributor order and plugin URLs now point to the ROBOTSTXT software site (https://www.robotstxt.software/). +* Restored the real minimum requirements after a full-range compatibility review: WordPress 4.0+ and PHP 5.6+. + +**Removed** + +* Bundled JSON-based auto-updater (robotstxt-updater.php) and update.json. + +**Compatibility** + +* WordPress: 4.0 - 7.1 +* PHP: 5.6 - 8.5 +* MariaDB: 11.8 (staging) + +**Tests** + +* PHP Coding Standards: 3.13.6 +* WordPress Coding Standards: 3.4.1 +* PHPStan: 2.2.8 with wp-compat (Requires at least 4.0) +* PHPUnit: 9.6.36 (plugin header tests included, line coverage 88.5%) + = 1.2.3 = * Test release for update validation. diff --git a/includes/class-robotstxt-hello-plugin.php b/includes/class-robotstxt-hello-plugin.php index 132b7ea..6f4eff5 100644 --- a/includes/class-robotstxt-hello-plugin.php +++ b/includes/class-robotstxt-hello-plugin.php @@ -1,13 +1,14 @@ '; - echo '

' . esc_html__( 'Hello', 'robotstxt-hello' ) . '

'; + printf( '

%s

', esc_html__( 'Hello', 'robotstxt-hello' ) ); + + if ( ! $this->is_manager_active() ) { + $this->render_manager_message( false ); + } + + $this->render_settings_form(); + echo ''; } + + /** + * Renders the plugin settings form. + * + * @since 1.2.4 + * + * @return void + */ + private function render_settings_form() { + echo '
'; + settings_fields( 'robotstxt-hello' ); + + printf( + '

', + checked( '1', get_option( self::OPTION_DELETE_DATA, '' ), false ), + esc_html__( 'Delete plugin data on uninstall', 'robotstxt-hello' ) + ); + + printf( '

%s

', esc_html__( 'All plugin data will be removed when the plugin is uninstalled.', 'robotstxt-hello' ) ); + + submit_button(); + echo '
'; + } + + /** + * Renders the Manager (by ROBOTSTXT) notice on the plugins list page. + * + * The notice only appears on the plugins list page (single site or + * network), only while the manager plugin is not active, and only + * for users who have not dismissed it yet. + * + * @since 1.2.4 + * + * @return void + */ + public function render_manager_notice() { + $screen = get_current_screen(); + + if ( ! $screen instanceof WP_Screen ) { + return; + } + + if ( ! in_array( $screen->id, array( 'plugins', 'plugins-network' ), true ) ) { + return; + } + + if ( $this->is_manager_active() || $this->is_notice_dismissed() ) { + return; + } + + $this->render_manager_message( true ); + } + + /** + * Renders the shared Manager (by ROBOTSTXT) recommendation message. + * + * @since 1.2.4 + * + * @param bool $dismissible Whether the notice can be dismissed. + * @return void + */ + private function render_manager_message( $dismissible ) { + $classes = 'notice notice-warning robotstxt-hello-manager-notice'; + + if ( $dismissible ) { + $classes .= ' is-dismissible'; + } + + printf( + '

%2$s %4$s

', + esc_attr( $classes ), + esc_html__( 'To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active.', 'robotstxt-hello' ), + esc_url( self::MANAGER_PLUGIN_URL ), + esc_html__( 'Get Manager (by ROBOTSTXT)', 'robotstxt-hello' ) + ); + } + + /** + * Enqueues the dismissal script on the plugins list page. + * + * @since 1.2.4 + * + * @param string $hook_suffix Current admin page hook suffix. + * @return void + */ + public function enqueue_scripts( $hook_suffix ) { + if ( 'plugins.php' !== $hook_suffix ) { + return; + } + + if ( $this->is_manager_active() || $this->is_notice_dismissed() ) { + return; + } + + wp_enqueue_script( + 'robotstxt-hello-manager-notice', + plugins_url( 'assets/js/manager-notice.js', ROBOTSTXT_HELLO_FILE ), + array(), + ROBOTSTXT_HELLO_VERSION, + true + ); + + wp_localize_script( + 'robotstxt-hello-manager-notice', + 'robotstxthellomanagernotice', + array( + 'ajaxUrl' => admin_url( 'admin-ajax.php' ), + 'nonce' => wp_create_nonce( 'robotstxt-hello-manager-notice' ), + ) + ); + } + + /** + * Persists the dismissal of the manager notice for the current user. + * + * @since 1.2.4 + * + * @return void + */ + public function handle_dismiss() { + check_ajax_referer( 'robotstxt-hello-manager-notice', 'nonce' ); + + if ( ! current_user_can( 'activate_plugins' ) ) { + wp_die( '', '', 403 ); + } + + update_user_meta( get_current_user_id(), self::USER_META_DISMISSED, '1' ); + + wp_die( '', '', 200 ); + } + + /** + * Checks whether the Manager (by ROBOTSTXT) plugin is active. + * + * Detection covers both single-site and network-wide activation. + * + * @since 1.2.4 + * + * @return bool True when any active plugin basename starts with 'robotstxt-manager/'. + */ + private function is_manager_active() { + $active = (array) get_option( 'active_plugins', array() ); + + if ( is_multisite() ) { + $active = array_merge( $active, array_keys( (array) get_site_option( 'active_sitewide_plugins', array() ) ) ); + } + + foreach ( $active as $basename ) { + if ( is_string( $basename ) && 0 === strpos( $basename, 'robotstxt-manager/' ) ) { + return true; + } + } + + return false; + } + + /** + * Checks whether the current user dismissed the manager notice. + * + * @since 1.2.4 + * + * @return bool True when the notice was dismissed by the current user. + */ + private function is_notice_dismissed() { + return '1' === get_user_meta( get_current_user_id(), self::USER_META_DISMISSED, true ); + } } } diff --git a/languages/robotstxt-hello-ca.mo b/languages/robotstxt-hello-ca.mo index cae5513d3dafceae5435a8215d75133b72a33a94..b851efd3d62aaf8f1d25cdc6c1f95ad644d8ee12 100644 GIT binary patch literal 1049 zcmZ`%O>Yx15H(N`gd0bM#2|5K0dF=Df@n+l=ohWjs8PEhE*zZQX=3EHQ+u{a5fT>; z`~mJ9IM83f9sUP*{sprs-R4k6di%Wg_|3CDzi%vj5gb<-w;0=u>x>VKD!wzGF^(Cx z8Gjfz8P_fdahdrp^IPV7%pVz_8LRw%^^y>enYWp%eV>>Yn7=VQ=3{0~t)tSq$l&Q& zRJo^7c@r;;fw3uv+Cr{K!9?@K0KsG74l#$x2rbYEPm^?j(rOz>8H0Hw*3cl;t1}5_ z&r-xoBO%xok}DMH49YPpVR$fK`Fs^9 z%0QLj+7l?7gUW~%BhmNn9cCoAa`_s4(9R}j7GUN8T2VWC*x1Ff^CWv=sB^he4uecx z0wbbvNSe*bWD}tQE>Y-Q68HoHy4`qk{nfsYBu^iau*MERZy<+Q4(m!?ME{1 z$W{m9IEmx?F-K!t1(K;(HW)?D&zpNvi$1SM5r(I{#|}%rP?@4C=62Kz31q6#+v=^K zow*goja6p}EtfkQvme4Kv45rQGGrs=15)=@x*d%5Zn9(ETk-04DVX}KZx5JEZjy3i~JnrJlvg*VUmRy6c&1zqX&iOuH|6fP)85Dt@bz~WdzkqN(9RL6T delta 170 zcmbQq@rx_;{~5(hOmz(nbqx#^3@oe+OtcMvfXgSbxI{OkC^4@% kC$S{I$Vveyl9yhZn4YQ|lA4%nr7*dKX$q@Heoi6-0AdUtxc~qF diff --git a/languages/robotstxt-hello-ca.po b/languages/robotstxt-hello-ca.po index 3914e5a..ff6e1e3 100644 --- a/languages/robotstxt-hello-ca.po +++ b/languages/robotstxt-hello-ca.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Hola" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Per rebre actualitzacions automàtiques, heu de tenir el complement Manager (by ROBOTSTXT) instal·lat i actiu." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Baixa el Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Suprimeix les dades del complement en desinstal·lar-lo" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Se suprimiran totes les dades del complement quan es desinstal·li." + diff --git a/languages/robotstxt-hello-de_DE.mo b/languages/robotstxt-hello-de_DE.mo index 796cc910509f9dbeef37ccdeca17f9449b06637a..fb9857128bf604ef78315cf9b48b29f68aa1868d 100644 GIT binary patch literal 1033 zcmZ`&%We}f6g5zgnC@62BrZ}HE!2}qgitgkKucO$sZpykMQjjqGPlXVj2+pYq(!V) z@dK<_v4bDr2lx;6`~_$Fm}JpfIyxTvUf*-=Gk@>3zW`r>b$l=05MmkJ122Im;41z*cnJOhMrb{%z3Tv$PshSJ zS5#>e>v>M&yc}klQsos*Gc5F(EEi_NDNRSL$&dIVD05WmOgpdgoYPQrIcHz*o*rTJ zEJVCwPd%m8kS#6uPv~H8V=sA~yiHcbHs`q!i9xLaXA>q>dQ&K$4X7OBBzCLwl`lVq ziqiQ?aIJ}yPDu?sP7KAqH6M83&Btm#3Ank#EThk%! zWo)sQvO5oT1f8g?Jsxo``LeA1&u=$?PsJ4$8L=(Vx6KvmifuU8h{K|`Ta`Pl#nI0}wC)u?!IF05K~N+W;{L1OPFJ9|*(>j0_CnP<{oF4McDN(hmk6 zsX00MliL~9nGN(zCvRjFpZuRu%*0gJ&`{UFP{F{$%D_b100_8z5{pZ8Ly8jfigOZ6 i@{6n#fFgP6rHSdOx*@5FxmF63OPHp!c_adjV*mhryB{O~ diff --git a/languages/robotstxt-hello-de_DE.po b/languages/robotstxt-hello-de_DE.po index 833c265..82ef78d 100644 --- a/languages/robotstxt-hello-de_DE.po +++ b/languages/robotstxt-hello-de_DE.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Hallo" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Um automatische Updates zu erhalten, muss das Plugin Manager (by ROBOTSTXT) installiert und aktiv sein." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Manager (by ROBOTSTXT) herunterladen" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Plugindaten beim Deinstallieren löschen" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Alle Plugindaten werden beim Deinstallieren des Plugins entfernt." + diff --git a/languages/robotstxt-hello-es_ES.mo b/languages/robotstxt-hello-es_ES.mo index edc7adcb3df04ea977c515abc1865eadff45024f..cdc2f07ce0d02ed4d0d10022e62f04d47834e034 100644 GIT binary patch literal 1031 zcmZuw%We}f6g5zgnC@621V&=fLOq#82t`xEqqLsEn>xr zA3$u_bO+zj|6tEwaHfGt7rD}zGh<)hhwqu+x0b#!*bU$gum>yypMlDL0?&b8z&+p( za2vRJg|X}42jCCjhu|;3SD^A=zQ))Z_zn0j_yoKJ{ti9@{{X|awkpHacK%J^MHsk>pOcyc@VpWct_4FYtnfM{GtNhj9c;JXrCt51=00GRfvsp=tX8z zJ_=#t(?(-DoyN`%Z1CYE#NHl;sdUts-JEaKTVhl-)rk5%u}{aUN+>qbO3GVF>xoF( zqS@w2k|xQc1QzW{A4KM)@mdD!E*JN-4*H^gi^)I388a+#p&}zWzI3AANIChBTL)2h zx4SiOyBR0ZD{BH7WIUaqq(CPDEl6e7c|MZPQ|P?SwncmHS5yi_7Tea1eaa240iV9pTCZe+*UpOJ_dC3~x*o9u;-uAB8R^c?pe0*a&ozJ%S5K-1 zn3oux<({zUXY<4eH>`8gEj}Uj+*LZLsW(7>klJFgupO%<>q{pq&8dNMl~78l)hC%_ kRODwGJU@d7CFD1+ZE-+khx7=4gZn2yi3Uz*^0P7f3)tB-aR2}S delta 170 zcmZqY_{$V_Pl#nI0}wC)u?!IF05K~N+W;{L1OPFJ9|*(>j0_CnK$-=JD}Zbuf&-9# zFz`st$;qGG&Zy38pl3RHBcu4_|BPZLrn-iPx(0>{1{PKZCfWu-z~z%zT%sFNl$ckX klUR~pWTgNU$xAOyOi$GfNlnbPQkY!AG@aEWKPQm^09w}`vj6}9 diff --git a/languages/robotstxt-hello-es_ES.po b/languages/robotstxt-hello-es_ES.po index 1be46e5..a0190f2 100644 --- a/languages/robotstxt-hello-es_ES.po +++ b/languages/robotstxt-hello-es_ES.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: es_ES\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Hola" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Para recibir actualizaciones automáticas, el plugin Manager (by ROBOTSTXT) debe estar instalado y activo." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Obtener Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Borrar los datos del plugin al desinstalarlo" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Se eliminarán todos los datos del plugin cuando se desinstale." + diff --git a/languages/robotstxt-hello-eu.mo b/languages/robotstxt-hello-eu.mo index f4c8d55282705cef2b5ccd4361d08d72a206b8d2..b09399398688b21c654b79510fbdabc81a095d7e 100644 GIT binary patch literal 1021 zcmZ`&O>fgc5M7`k2se%hi9zDfLf3I3gd&&lQJT_jvU_*2~Z7mU-!sSq9M>DjxpZ{Ci_zwa%b365Kg2aFxYUB*{N6+aoT7{3?~8Gjh} z8F#J;ag+Hm^B3kP%-`7i)!uamFVAA>f-9=L zi8o~llQIeAiBvYr1FBMsL+1!g-^mY9dp?}F|OcA)DGDS7MbfVr!07Ij{-R~{#+=}AH zTWbgnmphrTAHri||4N%R7z~y3NZpU=rtB>8Dq9EWWX}w2u1%3ZC)3o}D}z&|+_Y}& z6ENHZe)Zk0C=!1G1!OUW delta 171 zcmey%{+lW6o)F7a1|VPpVi_RT0b*7lwgF-g2moRbKM;sz85tPDq5M)H8;IZlq#q1C zQgd?hC$}@IGaKlcPTt5UKKVbRn2D*bp`osUp@M;hm4S)20T6KcBo>$Gh7={{73U\n" +"Language-Team: ROBOTSTXT\n" "Language: eu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Kaixo" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Eguneratze automatikoak jasotzeko, Manager (by ROBOTSTXT) plugina instalatuta eta aktibo egon behar da." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Lortu Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Ezabatu pluginaren datuak desinstalatzean" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Pluginaren datu guztiak ezabatuko dira plugina desinstalatzean." + diff --git a/languages/robotstxt-hello-fr_FR.mo b/languages/robotstxt-hello-fr_FR.mo index 61548616b4316708d537173985513e798df6f612..f948105214ea494655e868a1cef2a92062ee4bf0 100644 GIT binary patch literal 1105 zcmaJ=%Wl&^6dj;|FgunA!CkOufpMG)p~$5L`hrT05~T*QL1+?Blc}5;Gc!(Fi3RNV z0T%37Qr7%IK7l0?3wHbk$7yj2f?nzPj6HYmYmUEPnS0M*7l3QPHgFku4V3l?cmNy% zH-MkORp8PY#?FIpf?t4df!_k}0EzeD9Aj(X9DE)81$+_w6q$WR*znzq$LM!dO$TFFRY+Yv3SG&^? zM$cT>W9g|WwCGDq^W6jLv{qZmPVziiU{7S08I~C2>Pa<{Bnoea!mAz?IU-4S=Va!8 zN1j0_CnK$;zhD}Zbuf&-9# zFz`st$;qGG&Zy38pl3RHBcu4_|BPZLrn-iPx(0>{1{PKZCfWu-z~z%zT%sFNl$ckX vlUR~pWTgNU$xAOyOi$GfNlnbPQkY!A)GwfDt6->U&Bfr9pO=+iTEqYVl5`;d diff --git a/languages/robotstxt-hello-fr_FR.po b/languages/robotstxt-hello-fr_FR.po index 9c6a3df..61207fe 100644 --- a/languages/robotstxt-hello-fr_FR.po +++ b/languages/robotstxt-hello-fr_FR.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Bonjour" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Pour recevoir les mises à jour automatiques, l’extension Manager (by ROBOTSTXT) doit être installée et activée." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Obtenir Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Supprimer les données de l’extension lors de la désinstallation" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Toutes les données de l’extension seront supprimées lors de la désinstallation de l’extension." + diff --git a/languages/robotstxt-hello-gl_ES.mo b/languages/robotstxt-hello-gl_ES.mo index 575720599914a342627222fcbdf25e5a650e3d3b..17dd5bb0cbd920d88b6c482ea0b8b9ecd821d0c3 100644 GIT binary patch literal 1019 zcmZuw%We}f6g5zgNOvp|5*LX@3wSb#5UQqxM`;R`8YOB6#0DW}#!ZYIJF-1Zi&(K@ z!-54Lzz)`YLjQw3f5CA>Ctc)fj?c{a&b`O>nLjsHzB9x%;1;k4tOB2a7(aohz%Sr7 z@E5oVT))KFRq$Q#JMca5XW$Ev;d%86W9#4@aI8B8<6>ViDDXEhQtODdE(0+q#>$+| z#;A=w*P5of8Yx4i2!dt`FNTtwoY*5-(rhdZg|R$OQl2WKj1NLZuoDqfLDdwMqpcTHhSWkwlo z3{_|hbmfHRJJwBnMh4q}N8f30Mw{Tavu5Z{hg$2K4c66aqKt@@Bn4YqPq=WtakS^Y zDsXC+kWorMKT4e5mUT|JW$D5$5(Qk;9|jm~xkXrC3pRj&Xf!ocF1n)_;{~5(hOmz(nbqx#^3@oe+OtcMvfXgSbxI{OkC^4@% jC$S{I$Vveyl9yhZn4YQ|lA4%nr7*dKX*!F4P9g&UhL9e+ diff --git a/languages/robotstxt-hello-gl_ES.po b/languages/robotstxt-hello-gl_ES.po index 3682723..c8f37d1 100644 --- a/languages/robotstxt-hello-gl_ES.po +++ b/languages/robotstxt-hello-gl_ES.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: gl_ES\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Ola" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Para recibir actualizacións automáticas, o plugin Manager (by ROBOTSTXT) debe estar instalado e activo." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Obter Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Borrar os datos do plugin ao desinstalalo" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Eliminaranse todos os datos do plugin cando se desinstale." + diff --git a/languages/robotstxt-hello-it_IT.mo b/languages/robotstxt-hello-it_IT.mo index dd4cef6240d77adb7175c3a846ee2261f5b1992a..9fd174c66235785a42bf744058d4e189bde62995 100644 GIT binary patch literal 1051 zcmZ`%O>fgc5M7`kk={5W1cSt(h1zi!cC?h>TuXp_B?d<%yw)9;ft^hZHJzyF53{>$Gcnll^w}8LE zb>Qj+AufaOfZu`dg1-P?ffraWUlO7Teha<{{svwGAA@u7FECQ;sI)Eu_y**)+yb3ApjOxp?>F{&Vyq8(E>mf+QD!bkOiW|% zCoXO_XR}#o&Cqz~4}Iv&fuBjs&C|}gX1x`Rt3x##gMP5jQ&klVws4e~+EM#K5Oso9 zhoUHsqI(gdu_v7m5-YXKr8job+{0S*N&ObGdxU>g1!IDV+s{w=PIeWZ^CrL$P@?o2fq?L2LJ#7 delta 170 zcmbQu@s}y=o)F7a1|VPpVi_RT0b*7lwgF-g2moRbKM;r&7#SGCfiw#cR{+^S1P37f zVBnFOlaoKWol%|HK+kmYMn>_;{~5(hOmz(nbqx#^3@oe+OtcMvfXgSbxI{OkC^4@% kC$S{I$Vveyl9yhZn4YQ|lA4%nr7*dKX*#QOW@0`A0B7kQzW@LL diff --git a/languages/robotstxt-hello-it_IT.po b/languages/robotstxt-hello-it_IT.po index ae8dd95..b22f4c8 100644 --- a/languages/robotstxt-hello-it_IT.po +++ b/languages/robotstxt-hello-it_IT.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: it_IT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Ciao" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Per ricevere gli aggiornamenti automatici, il plugin Manager (by ROBOTSTXT) deve essere installato e attivo." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Ottieni Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Elimina i dati del plugin alla disinstallazione" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Tutti i dati del plugin saranno rimossi quando il plugin verrà disinstallato." + diff --git a/languages/robotstxt-hello-pl_PL.mo b/languages/robotstxt-hello-pl_PL.mo index 8622ebdef5702171386679d541787ab1454ede8c..c41fe1feb501073a9817857164752e349867bce0 100644 GIT binary patch literal 1113 zcmZ`%%We}f6g5ylgdIzS;4YwQp);9;3PsbVrBA5Ts8N|xHV8R0w~5<{9gRJm&ZtXJ z`2iLPJ^=nB+42dj*dXx{T(?b9BzmQzV~?+ok3Hw-orzD3>IUH+VUuv1a7?iEjj%}g zPIy50O}I$ZSfJ>v5XB(^PmStwBSJ`fq=b6r z;>rJ4fo`geH9YbJTt>h{Ly9hICTbr;<7`CEYfQ9I(jQxZQwLCStL|)R8+$4-PD8gv zNCfyIh7iCp6_{2JgU+r*TxAFE_KX}N-mn4ABjF6ja<|Vv`4m6dQc}o-o3D6 zwBXavde_`6H8vV+<7-!3ue741K}jd(J+fr*$j}wIkaG}rc%sqNcY<}NHtw^|_AqhQ zWT+w`+dkAj0_CnK$;zhD}Zbuf&-9# zFz`st$;qGG&Zy38pl3RHBcu4_|BPZLrn-iPx(0>{1{PKZCfWu-z~z%zT%sFNl$ckX zlUR~pWTgNU$xAOyOi$GfNlnbPQkY!A)Ff+Utx%9tT9lY$tC6RmXsckTY0bspT$Ors I_K|i50CLkN1poj5 diff --git a/languages/robotstxt-hello-pl_PL.po b/languages/robotstxt-hello-pl_PL.po index 1ee712b..bd39964 100644 --- a/languages/robotstxt-hello-pl_PL.po +++ b/languages/robotstxt-hello-pl_PL.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=3; plural=(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Cześć" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Aby otrzymywać automatyczne aktualizacje, wtyczka Manager (by ROBOTSTXT) musi być zainstalowana i aktywna." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Pobierz Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Usuń dane wtyczki podczas dezinstalacji" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Wszystkie dane wtyczki zostaną usunięte po odinstalowaniu wtyczki." + diff --git a/languages/robotstxt-hello-pt_PT.mo b/languages/robotstxt-hello-pt_PT.mo index d4ae36622afa402de6c5cc6a7045e0d460f8d35b..5d70192323766e35aa75f1edd962ffbc3986ef84 100644 GIT binary patch literal 1038 zcmZuw%We}f6dj--k?vR`BrXz*7Vu;eArwsskJ1(@8YL>jV}p>Bxk-#BcCbB7i&%BV z53oiRNWcg11^Ey5`~_!HI>{neIXWKu`rc#v3($Q*D=lOb#JLq1DVj&iNE^D@gg4TCMt*q5ub5=PHc zf~V}MCAA!|rM2!6?YB4E$&2JovK~C+EHgo3(5uJlfJx@wjHFjR%Eze0?#^Q8*buJO(v`p}uapGeEq)0=bEa!Cw}LscuCw%F$bRWuY^I7&?QsD4jG z4N+@Q6va_=J3>_Ur1K)NQoBrgV;9BUFN;1ZMt8eM+-a3g_y?vT_>ru zc3a!?W7oo{^2BJ*8Xb?ukmUK$;|Nme4eAZ0b?lojlO55R=M~EOY{jIgomz2v0xwFquvE0X94>N%-o*G<*#Aa^T!N$FLdgCH$wN5J delta 170 zcmeC<_{$V_Pl#nI0}wC)u?!IF05K~N+W;{L1OPFJ9|*(>j0_CnK$-=JD}Zbuf&-9# zFz`st$;qGG&Zy38pl3RHBcu4_|BPZLrn-iPx(0>{1{PKZCfWu-z~z%zT%sFNl$ckX klUR~pWTgNU$xAOyOi$GfNlnbPQkY!AG@aEy=kP)X0AU#)RR910 diff --git a/languages/robotstxt-hello-pt_PT.po b/languages/robotstxt-hello-pt_PT.po index 601f0a1..2db8fea 100644 --- a/languages/robotstxt-hello-pt_PT.po +++ b/languages/robotstxt-hello-pt_PT.po @@ -1,17 +1,34 @@ msgid "" msgstr "" -"Project-Id-Version: ROBOTSTXT Hello 1.0.5\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ROBOTSTXT Hello 1.2.4\n" +"Report-Msgid-Bugs-To: https://www.robotstxt.software/plugins/robotstxt-hello/\n" "POT-Creation-Date: 2025-11-01 08:04+0000\n" -"PO-Revision-Date: 2025-11-01 08:04+0000\n" -"Last-Translator: \n" -"Language-Team: \n" +"PO-Revision-Date: 2026-08-18 00:00+0000\n" +"Last-Translator: ROBOTSTXT \n" +"Language-Team: ROBOTSTXT\n" "Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: includes/class-robotstxt-hello-plugin.php:57 includes/class-robotstxt-hello-plugin.php:58 includes/class-robotstxt-hello-plugin.php:76 +#: includes/class-robotstxt-hello-plugin.php msgid "Hello" msgstr "Olá" + +#: includes/class-robotstxt-hello-plugin.php +msgid "To receive automatic updates, the plugin Manager (by ROBOTSTXT) must be installed and active." +msgstr "Para receber atualizações automáticas, o plugin Manager (by ROBOTSTXT) tem de estar instalado e ativo." + +#: includes/class-robotstxt-hello-plugin.php +msgid "Get Manager (by ROBOTSTXT)" +msgstr "Obter Manager (by ROBOTSTXT)" + +#: includes/class-robotstxt-hello-plugin.php +msgid "Delete plugin data on uninstall" +msgstr "Eliminar os dados do plugin ao desinstalar" + +#: includes/class-robotstxt-hello-plugin.php +msgid "All plugin data will be removed when the plugin is uninstalled." +msgstr "Todos os dados do plugin serão removidos quando o plugin for desinstalado." + diff --git a/readme.txt b/readme.txt index 540dd4b..8bf1f9e 100644 --- a/readme.txt +++ b/readme.txt @@ -1,55 +1,68 @@ === Hello (by ROBOTSTXT) === -Contributors: javiercasares +Contributors: robotstxt, javiercasares Tags: hello-world -Requires at least: 6.5 -Tested up to: 6.9 -Stable tag: 1.2.3 -Requires PHP: 8.2 -Version: 1.2.3 +Requires at least: 4.0 +Tested up to: 7.1 +Stable tag: 1.2.5 +Requires PHP: 5.6 +Version: 1.2.5 License: GPL-3.0-or-later -License URI: https://www.gnu.org/licenses/gpl-3.0.html +License URI: https://www.gnu.org/licenses/gpl-3.0.txt -Provides a minimal Hello admin page for demonstration purposes. +Adds a Hello admin page for demonstration purposes. == Description == -Provides a minimal Hello admin page for demonstration purposes. + +Adds a Hello admin page for demonstration purposes. + +This plugin receives its automatic updates through Manager (by ROBOTSTXT). If the manager plugin is not installed and active, a dismissible notice on the Plugins screen — and a permanent notice on the plugin settings page — will remind you to install it. + +== Installation == + += Automatic download = + +Visit the plugin section in your WordPress, search for Hello (by ROBOTSTXT); download and install the plugin. + += Manual download = + +Extract the contents of the ZIP and upload the contents to the `/wp-content/plugins/robotstxt-hello/` directory. Once uploaded, it will appear in your plugin list. + +== Frequently Asked Questions == + += Why do I see a notice about Manager (by ROBOTSTXT)? = + +Automatic updates for this plugin are delivered through the ROBOTSTXT ecosystem by Manager (by ROBOTSTXT). Install and activate it to receive updates. + +== Compatibility == + +* WordPress: 4.0 - 7.1 +* PHP: 5.6 - 8.5 == Changelog == + += 1.2.5 = +* Fixed a conflict on WordPress 4.0-6.4 where the Hello menu item could remove another plugin's top-level menu (and vice versa) when both used the same menu position. The menu is now registered at position 1000, past the last core separator (99), so it renders at the bottom of the menu. + += 1.2.4 = +* Updates are now delivered through Manager (by ROBOTSTXT): the bundled auto-updater was removed and a dismissible notice on the Plugins screen recommends installing the manager plugin when it is not active. +* Added a permanent notice on the plugin settings page when Manager (by ROBOTSTXT) is not available. +* Added a setting to remove plugin data on uninstall (data is preserved by default). +* Restored the real minimum requirements: WordPress 4.0 and PHP 5.6, verified with a full-range compatibility scan. +* Author, contributors and plugin URLs now point to the ROBOTSTXT software site. + = 1.2.3 = * Test release for update validation. -= 1.2.2 = -* Removed Plugin ID (DID) from plugin header. += Previous versions = -= 1.2.1 = -* Test release to validate the Auto-Updater system is working correctly. +If you want to see the full changelog, visit the [changelog](https://www.robotstxt.software/plugins/robotstxt-hello/) page. -= 1.2.0 = -* Added generic JSON-based Auto-Updater system. Plugin now updates automatically from git.robotstxt.es without depending on WordPress.org repository. +== Compliance == -= 1.1.2 = -* Raised the minimum WordPress requirement to 6.5 and PHP to 8.2 so the plugin matches the AGENTS development guidelines while keeping the Hello admin page untouched. +This plugin adheres to the following security measures and review protocols for each version: -= 1.1.1 = -* Added compiled translation catalogs for supported locales (Catalan, German, Spanish, Basque, French, Galician, Italian, Polish, Portuguese) so localized greetings render without requiring manual compilation. - -= 1.1.0 = -* DID Support - -= 1.0.5 = -* Expanded the translation catalog to cover 202 locales with updated greetings. - -= 1.0.4 = -* Documented the plugin internals with PHPDoc blocks and loaded the text domain to ensure translations are available in WordPress. - -= 1.0.3 = -* Added translation files for 50 locales to improve WordPress i18n coverage. - -= 1.0.2 = -* Confirmed compatibility with PHP 5.6 through PHP 8.4 via PHPCompatibilityWP checks. - -= 1.0.1 = -* Broadened compatibility to cover WordPress 4.7+ and PHP 5.6+ while keeping the Hello admin page unchanged. - -= 1.0.0 = -* Added the Hello admin page and menu entry. +* [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/) +* [WordPress Plugin Security](https://developer.wordpress.org/plugins/wordpress-org/plugin-security/) +* [WordPress APIs Security](https://developer.wordpress.org/apis/security/) +* [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards) +* [Plugin Check (PCP)](https://wordpress.org/plugins/plugin-check/) diff --git a/robotstxt-hello.php b/robotstxt-hello.php index fe2489b..cda648d 100644 --- a/robotstxt-hello.php +++ b/robotstxt-hello.php @@ -1,21 +1,20 @@ register(); - -// Initialize ROBOTSTXT updater (auto-configures from plugin headers). -require_once __DIR__ . '/robotstxt-updater.php'; -Robotstxt_Updater::init( __FILE__ ); diff --git a/robotstxt-updater.php b/robotstxt-updater.php deleted file mode 100644 index 0f8b5c1..0000000 --- a/robotstxt-updater.php +++ /dev/null @@ -1,332 +0,0 @@ -register(); - } - - /** - * Constructor. - * - * @param string $plugin_file_path Absolute path to the main plugin file. - */ - private function __construct( string $plugin_file_path ) { - $this->plugin_file_path = $plugin_file_path; - $this->plugin_basename = plugin_basename( $plugin_file_path ); - $this->plugin_slug = dirname( $this->plugin_basename ); - $this->plugin_data = $this->get_plugin_data(); - $this->json_url = $this->build_json_url(); - $this->cache_key = 'robotstxt_updater_' . md5( $this->plugin_basename ); - } - - /** - * Register WordPress hooks. - */ - private function register(): void { - add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'inject_update_info' ) ); - add_filter( 'plugins_api', array( $this, 'provide_plugin_details' ), 10, 3 ); - add_action( 'admin_init', array( $this, 'handle_cache_clear' ) ); - add_action( 'robotstxt_updater_clear_cache', array( $this, 'clear_cache' ) ); - } - - /** - * Get plugin headers. - * - * @return array Plugin data. - */ - private function get_plugin_data(): array { - if ( ! function_exists( 'get_plugin_data' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - return get_plugin_data( $this->plugin_file_path, false, false ); - } - - /** - * Build JSON URL from plugin headers. - * - * Tries to use "Gitea Plugin URI" header to construct the URL. - * Falls back to Plugin URI if Gitea URI is not available. - * - * @return string JSON URL. - */ - private function build_json_url(): string { - // Try Gitea Plugin URI (format: "OWNER/REPO" or full URL). - if ( ! empty( $this->plugin_data['Gitea Plugin URI'] ) ) { - $gitea_uri = $this->plugin_data['Gitea Plugin URI']; - - // If it's already a full URL, use it. - if ( str_starts_with( $gitea_uri, 'http' ) ) { - // Extract base URL and construct JSON path. - return rtrim( $gitea_uri, '/' ) . '/raw/branch/main/update.json'; - } - - // If it's in format "OWNER/REPO", construct full URL. - if ( preg_match( '#^[^/]+/[^/]+$#', $gitea_uri ) ) { - return "https://git.robotstxt.es/{$gitea_uri}/raw/branch/main/update.json"; - } - } - - // Fallback: try to extract from Plugin URI. - if ( ! empty( $this->plugin_data['PluginURI'] ) ) { - $plugin_uri = $this->plugin_data['PluginURI']; - if ( str_contains( $plugin_uri, 'git.robotstxt.es' ) ) { - return rtrim( $plugin_uri, '/' ) . '/raw/branch/main/update.json'; - } - } - - // Last resort: construct from plugin slug. - return "https://git.robotstxt.es/ROBOTSTXT/{$this->plugin_slug}/raw/branch/main/update.json"; - } - - /** - * Inject update info into WP's plugin update transient. - * - * @param object|mixed $transient The update_plugins transient. - * - * @return object The modified transient. - */ - public function inject_update_info( $transient ) { - if ( ! is_object( $transient ) ) { - $transient = new stdClass(); - } - - if ( empty( $transient->checked ) || ! is_array( $transient->checked ) ) { - return $transient; - } - - if ( empty( $transient->checked[ $this->plugin_basename ] ) ) { - return $transient; - } - - $current_version = $transient->checked[ $this->plugin_basename ]; - $remote = $this->get_remote_data(); - - if ( empty( $remote['version'] ) || empty( $remote['download_url'] ) ) { - return $transient; - } - - if ( ! $this->is_compatible( $remote ) ) { - return $transient; - } - - if ( version_compare( $remote['version'], $current_version, '>' ) ) { - $update = (object) array( - 'slug' => $remote['slug'] ?? $this->plugin_slug, - 'plugin' => $this->plugin_basename, - 'new_version' => $remote['version'], - 'url' => $remote['homepage'] ?? $this->plugin_data['PluginURI'] ?? '', - 'package' => $remote['download_url'], - 'tested' => $remote['tested'] ?? '', - 'requires' => $remote['requires'] ?? '', - 'requires_php' => $remote['requires_php'] ?? '', - ); - - $transient->response[ $this->plugin_basename ] = $update; - } - - return $transient; - } - - /** - * Provide "View details" modal content. - * - * @param false|object|array $result The result object or array. - * @param string $action The type of information being requested. - * @param object $args Plugin API arguments. - * - * @return false|object The plugin information object or false. - */ - public function provide_plugin_details( $result, string $action, object $args ) { - if ( 'plugin_information' !== $action ) { - return $result; - } - - if ( empty( $args->slug ) || $args->slug !== $this->plugin_slug ) { - return $result; - } - - $remote = $this->get_remote_data(); - - if ( empty( $remote['version'] ) ) { - return $result; - } - - return (object) array( - 'name' => $remote['name'] ?? $this->plugin_data['Name'] ?? $this->plugin_slug, - 'slug' => $remote['slug'] ?? $this->plugin_slug, - 'version' => $remote['version'], - 'author' => $remote['author'] ?? $this->plugin_data['Author'] ?? '', - 'homepage' => $remote['homepage'] ?? $this->plugin_data['PluginURI'] ?? '', - 'requires' => $remote['requires'] ?? '', - 'tested' => $remote['tested'] ?? '', - 'requires_php' => $remote['requires_php'] ?? '', - 'sections' => array( - 'description' => $remote['description'] ?? $this->plugin_data['Description'] ?? '', - 'changelog' => $remote['changelog'] ?? '', - ), - 'download_link' => $remote['download_url'] ?? '', - ); - } - - /** - * Get remote data with caching. - * - * @return array Remote data. - */ - private function get_remote_data(): array { - $remote = get_site_transient( $this->cache_key ); - - if ( false === $remote ) { - $remote = $this->fetch_json(); - set_site_transient( $this->cache_key, $remote ?: array(), 6 * HOUR_IN_SECONDS ); - } - - return is_array( $remote ) ? $remote : array(); - } - - /** - * Fetch JSON from remote URL. - * - * @return array Decoded JSON data. - */ - private function fetch_json(): array { - $response = wp_remote_get( - $this->json_url, - array( - 'timeout' => 10, - 'headers' => array( - 'Accept' => 'application/json', - ), - ) - ); - - if ( is_wp_error( $response ) ) { - return array(); - } - - $code = (int) wp_remote_retrieve_response_code( $response ); - if ( $code < 200 || $code >= 300 ) { - return array(); - } - - $body = wp_remote_retrieve_body( $response ); - $data = json_decode( $body, true ); - - return is_array( $data ) ? $data : array(); - } - - /** - * Check compatibility. - * - * @param array $remote Remote data. - * - * @return bool True if compatible. - */ - private function is_compatible( array $remote ): bool { - if ( ! empty( $remote['requires_php'] ) ) { - if ( version_compare( PHP_VERSION, $remote['requires_php'], '<' ) ) { - return false; - } - } - - if ( ! empty( $remote['requires'] ) ) { - if ( version_compare( get_bloginfo( 'version' ), $remote['requires'], '<' ) ) { - return false; - } - } - - return true; - } - - /** - * Handle manual cache clear via URL parameter. - */ - public function handle_cache_clear(): void { - if ( isset( $_GET['robotstxt_clear_update_cache'] ) && current_user_can( 'update_plugins' ) ) { - $this->clear_cache(); - wp_safe_redirect( remove_query_arg( 'robotstxt_clear_update_cache' ) ); - exit; - } - } - - /** - * Clear update cache. - */ - public function clear_cache(): void { - delete_site_transient( $this->cache_key ); - delete_site_transient( 'update_plugins' ); - } -} diff --git a/uninstall.php b/uninstall.php new file mode 100644 index 0000000..417e030 --- /dev/null +++ b/uninstall.php @@ -0,0 +1,19 @@ +
  • 1.2.3 – Test release for update validation.
  • 1.2.2 – Removed Plugin ID (DID) from plugin header.
  • 1.2.1 – Test release to validate the Auto-Updater system is working correctly.
  • 1.2.0 – Added generic JSON-based Auto-Updater system. Plugin now updates automatically from git.robotstxt.es without depending on WordPress.org repository.
  • 1.1.2 – Maintenance release.
  • 1.1.1 – Bug fixes and improvements.
  • 1.1.0 – Enhanced admin interface.
  • 1.0.0 – Initial release.
  • " -}