{"id":1965,"date":"2024-10-09T11:37:51","date_gmt":"2024-10-09T03:37:51","guid":{"rendered":"https:\/\/www.openbyt.com\/after-all-is-said-and-done-more-is-said-than-done-2"},"modified":"2024-10-17T19:51:04","modified_gmt":"2024-10-17T11:51:04","slug":"after-all-is-said-and-done-more-is-said-than-done-2","status":"publish","type":"post","link":"https:\/\/www.openbyt.com\/pt\/depois-de-tudo-o-que-foi-dito-e-feito-e-mais-dito-do-que-feito-2","title":{"rendered":"Guia completo para o desenvolvimento seguro de plug-ins para WordPress"},"content":{"rendered":"<p>A seguran\u00e7a deve estar na vanguarda da sua mente quando cria plugins WordPress. Os plug-ins do WordPress s\u00e3o frequentemente um alvo principal para os atacantes devido \u00e0 sua utiliza\u00e7\u00e3o generalizada e ao potencial acesso a dados sens\u00edveis. Uma \u00fanica vulnerabilidade num plug-in pode comprometer todo um s\u00edtio Web, conduzindo a viola\u00e7\u00f5es de dados, desfigura\u00e7\u00e3o ou outros impactos graves. Um plug-in seguro mant\u00e9m os dados dos utilizadores seguros e protege-os contra ataques comuns, garantindo uma experi\u00eancia fi\u00e1vel e de confian\u00e7a. Abaixo, vamos percorrer algumas das melhores pr\u00e1ticas essenciais para criar plug-ins WordPress seguros e partilharei alguns exemplos pr\u00e1ticos.<\/p><figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W.webp\" alt=\"\" class=\"wp-image-2551\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.41.20-A-digital-illustration-of-a-computer-screen-displaying-lines-of-code-with-a-shield-icon-symbolizing-security.-The-background-shows-a-subtle-hint-of-W-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>1. Utilize Nonces para seguran\u00e7a de formul\u00e1rios e URLs<\/strong><\/p><p>Os nonces s\u00e3o vitais para a prote\u00e7\u00e3o contra ataques de falsifica\u00e7\u00e3o de pedidos entre s\u00edtios (CSRF). Eles ajudam a verificar a autenticidade dos pedidos, especialmente para formul\u00e1rios e URLs que realizam opera\u00e7\u00f5es sens\u00edveis. Sempre que criar um formul\u00e1rio ou URL, gere um nonce usando wp_nonce_field() ou wp_create_nonce() do WordPress. No lado do servidor, deve validar o nonce com check_admin_referer() ou check_ajax_referer().<\/p><pre class=\"wp-block-code\"><code>se (isset($_POST['my_nonce']) &amp;&amp; wp_verify_nonce($_POST['my_nonce'], 'my_action')) {\n    \/\/ Seguro para prosseguir com a a\u00e7\u00e3o\n}<\/code><\/pre><figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s.webp\" alt=\"\" class=\"wp-image-2554\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.44.01-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p>Este tipo de prote\u00e7\u00e3o tamb\u00e9m pode ser aplicado a pedidos AJAX para garantir que s\u00e3o provenientes de utilizadores autorizados:<\/p><pre class=\"wp-block-code\"><code>add_action('wp_ajax_my_secure_action', 'my_secure_ajax_handler');\nfunction my_secure_ajax_handler() {\n    check_ajax_referer('my_secure_nonce', 'security');\n    \/\/ Trate o pedido\n    wp_die();\n}<\/code><\/pre><figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s.webp\" alt=\"\" class=\"wp-image-2557\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.45.05-A-modern-visually-engaging-illustration-showing-a-person-working-at-a-laptop-surrounded-by-digital-security-icons-such-as-shields-locks-and-code-s-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>2. Limpe e valide as entradas do utilizador<\/strong><\/p><p>Uma das formas mais f\u00e1ceis de um atacante comprometer o seu plugin \u00e9 injectando dados maliciosos. \u00c9 por isso que a higieniza\u00e7\u00e3o e valida\u00e7\u00e3o de cada entrada do utilizador \u00e9 fundamental. O WordPress oferece v\u00e1rias fun\u00e7\u00f5es incorporadas para o ajudar a fazer isto:<\/p><ul class=\"wp-block-list\"><li><code><strong>sanitize_text_field()<\/strong><\/code>: Para campos de texto simples.<\/li>\n\n<li><code><strong>sanitize_email()<\/strong><\/code>: Para endere\u00e7os de correio eletr\u00f3nico.<\/li>\n\n<li><code><strong>esc_url()<\/strong><\/code>: Para URLs.<\/li><\/ul><p>Estas fun\u00e7\u00f5es s\u00e3o \u00f3ptimas para cen\u00e1rios b\u00e1sicos. No entanto, pode utilizar a fun\u00e7\u00e3o filter_var() do PHP para casos mais espec\u00edficos. Por exemplo, para validar um n\u00famero inteiro:<\/p><pre class=\"wp-block-code\"><code>$input = filter_var($_POST['user_input'], FILTER_VALIDATE_INT);\nSe ($input !== false) {\n    \/\/ A entrada \u00e9 v\u00e1lida\n}<\/code><\/pre><p>Para cen\u00e1rios mais complexos, como quando precisa de validar entradas de escolha m\u00faltipla, considere utilizar a valida\u00e7\u00e3o personalizada:<\/p><pre class=\"wp-block-code\"><code>$valid_options = ['option_1', 'option_2', 'option_3'];\nSe (in_array($_POST['op\u00e7\u00e3o_seleccionada'], $valid_options, true)) {\n    \/\/ A entrada \u00e9 v\u00e1lida\n}<\/code><\/pre><p>Isto garante que apenas os valores esperados s\u00e3o processados, reduzindo o risco de problemas inesperados.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual.webp\" alt=\"\" class=\"wp-image-2558\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.48.57-A-professional-illustration-representing-secure-data-handling-for-a-WordPress-plugin-suitable-for-a-Western-audience.-The-image-should-include-visual-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>3. Sa\u00eddas de escape<\/strong><\/p><p>O escape de sa\u00edda \u00e9 crucial para evitar ataques de Cross-Site Scripting (XSS). Sempre que estiver a apresentar dados aos utilizadores, utilize as fun\u00e7\u00f5es de escape do WordPress, como:<\/p><ul class=\"wp-block-list\"><li><code><strong>esc_html()<\/strong><\/code>: Para escapar ao conte\u00fado HTML.<\/li>\n\n<li><code><strong>esc_attr()<\/strong><\/code>: Para valores de atributos.<\/li>\n\n<li><code><strong>esc_url()<\/strong><\/code>: Para URLs.<\/li><\/ul><p>Eis um exemplo:<\/p><pre class=\"wp-block-code\"><code>echo esc_html($user_input);<\/code><\/pre><p>Isto impede que c\u00f3digo potencialmente perigoso seja executado no browser, mantendo os seus utilizadores seguros.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and.webp\" alt=\"\" class=\"wp-image-2562\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.51.18-A-professional-illustration-symbolizing-XSS-prevention-in-web-development.-The-image-should-include-elements-like-code-snippets-a-browser-window-and-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>4. Consultas seguras a bases de dados<\/strong><\/p><p>Para evitar a inje\u00e7\u00e3o de SQL, utilize sempre o <code>$wpdb<\/code> da classe de instru\u00e7\u00f5es preparadas. Evite concatenar as entradas do utilizador diretamente nas consultas SQL. Em vez disso, utilize marcadores de posi\u00e7\u00e3o:<\/p><pre class=\"wp-block-code\"><code>$results = $wpdb-&gt;get_results($wpdb-&gt;prepare(\"SELECT * FROM {$wpdb-&gt;prefix}my_table WHERE id = %d\", $id));<\/code><\/pre><p>A prepara\u00e7\u00e3o de instru\u00e7\u00f5es garante que as entradas do utilizador s\u00e3o adequadamente escapadas e tratadas como dados e n\u00e3o como c\u00f3digo SQL execut\u00e1vel.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets.webp\" alt=\"\" class=\"wp-image-2563\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.54.24-An-illustration-representing-secure-database-queries-for-web-development.-The-image-should-include-elements-like-a-database-symbol-SQL-query-snippets-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>5. Tratar corretamente as fun\u00e7\u00f5es e capacidades dos utilizadores<\/strong><\/p><p>Ao criar funcionalidades que envolvem diferentes n\u00edveis de permiss\u00f5es de utilizador, utilize current_user_can() para garantir que apenas os utilizadores com as capacidades adequadas podem executar ac\u00e7\u00f5es espec\u00edficas:<\/p><pre class=\"wp-block-code\"><code>se (actual_user_can('manage_options')) {\n    \/\/ Apenas permita que os administradores executem este c\u00f3digo\n}<\/code><\/pre><p>Para uma gest\u00e3o avan\u00e7ada de fun\u00e7\u00f5es, pode definir capacidades personalizadas e atribu\u00ed-las a fun\u00e7\u00f5es espec\u00edficas, o que o ajuda a manter um controlo apertado sobre quem pode aceder a partes sens\u00edveis do seu plugin.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di.webp\" alt=\"\" class=\"wp-image-2566\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-10.58.35-A-professional-illustration-representing-user-roles-and-capabilities-management-in-WordPress.-The-image-should-include-symbols-like-user-icons-with-di-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>6. Proteja-se contra XSS (Cross-Site Scripting)<\/strong><\/p><p>Os ataques XSS s\u00e3o uma das vulnerabilidades mais comuns que existem. Limpe sempre as entradas do utilizador e escape \u00e0 sa\u00edda, como mencionado anteriormente. Se precisar de permitir etiquetas HTML espec\u00edficas, utilize wp_kses() para as filtrar com seguran\u00e7a:<\/p><pre class=\"wp-block-code\"><code>$allowed_tags = [\n    'a' =&gt; [\n        'href' =&gt; [],\n        'title' =&gt; []\n    ],\n    'b' =&gt; [],\n    'em' =&gt; []\n];\n$safe_html = wp_kses($user_input, $allowed_tags);<\/code><\/pre><p>Desta forma, pode permitir alguma formata\u00e7\u00e3o b\u00e1sica, mantendo os utilizadores protegidos.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with.webp\" alt=\"\" class=\"wp-image-2567\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.00.37-A-modern-illustration-representing-Cross-Site-Scripting-XSS-prevention-in-web-development.-The-image-should-include-elements-like-a-web-browser-with-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>7. Tenha cuidado com o tratamento de ficheiros<\/strong><\/p><p>Os carregamentos de ficheiros podem ser um enorme risco de seguran\u00e7a se n\u00e3o forem tratados corretamente. Para reduzir estes riscos, permita apenas tipos de ficheiros espec\u00edficos, verifique os tipos MIME e carregue os ficheiros para uma localiza\u00e7\u00e3o segura:<\/p><pre class=\"wp-block-code\"><code>$allowed_file_types = ['jpg', 'jpeg', 'png', 'pdf'];\n$file_type = wp_check_filetype(basename($_FILES['file']['name']));\nSe (in_array($file_type['ext'], $allowed_file_types)) {\n    \/\/ Prossiga com o carregamento\n}<\/code><\/pre><p>Pode utilizar <code>wp_handle_upload()<\/code> para gerir com seguran\u00e7a os carregamentos de acordo com as diretrizes do WordPress:<\/p><pre class=\"wp-block-code\"><code>$uploaded_file = wp_handle_upload($_FILES['file'], ['test_form' =&gt; false]);\nSe ($uploaded_file &amp;&amp; !isset($uploaded_file['error'])) {\n    \/\/ Ficheiro carregado com sucesso\n}<\/code><\/pre><p>\u00c9 tamb\u00e9m uma boa pr\u00e1tica limitar o tamanho dos ficheiros carregados e efetuar verifica\u00e7\u00f5es de seguran\u00e7a adicionais, como a an\u00e1lise de v\u00edrus ou a verifica\u00e7\u00e3o da integridade do ficheiro utilizando uma fun\u00e7\u00e3o hash.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb.webp\" alt=\"\" class=\"wp-image-2568\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.03.08-An-illustration-representing-secure-file-handling-in-web-development.-The-image-should-include-elements-like-file-icons-a-padlock-and-a-server-symb-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>8. Pedidos AJAX seguros<\/strong><\/p><p>O AJAX \u00e9 uma excelente forma de tornar o seu plugin mais din\u00e2mico, mas \u00e9 essencial proteg\u00ea-lo corretamente. Certifique-se de que todos os pedidos AJAX validam um nonce e verificam as capacidades do utilizador:<\/p><pre class=\"wp-block-code\"><code>add_action('wp_ajax_my_action', 'my_ajax_handler');\nfunction my_ajax_handler() {\n    check_ajax_referer('my_nonce', 'security');\n    se (current_user_can('edit_posts')) {\n        \/\/ Trate o pedido\n    }\n    wp_die();\n}<\/code><\/pre><p>Para manter o seu plugin seguro, lembre-se de proteger tanto as ac\u00e7\u00f5es AJAX autenticadas (wp_ajax_) como as n\u00e3o autenticadas (wp_ajax_nopriv_).<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer-.webp\" alt=\"\" class=\"wp-image-2570\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer-.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer--600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer--100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer--300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer--150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.06.15-An-illustration-representing-secure-AJAX-requests-in-web-development.-The-image-should-include-symbols-like-arrows-representing-data-flow-a-computer--768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>9. Mantenha os dados sens\u00edveis seguros<\/strong><\/p><p>Nunca codifique dados sens\u00edveis, como chaves de API, diretamente no seu plugin. Em vez disso, armazene-os de forma segura usando a API de op\u00e7\u00f5es do WordPress ou em vari\u00e1veis de ambiente:<\/p><pre class=\"wp-block-code\"><code>update_option('my_plugin_api_key', sanitize_text_field($api_key));<\/code><\/pre><p>Desta forma, as informa\u00e7\u00f5es sens\u00edveis permanecem ocultas e menos acess\u00edveis a potenciais atacantes.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o.webp\" alt=\"\" class=\"wp-image-2572\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.08.32-A-professional-illustration-representing-data-security-with-symbols-like-a-padlock-API-key-and-code-snippets.-The-image-should-convey-the-concept-o-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>10. Siga o princ\u00edpio do menor privil\u00e9gio<\/strong><\/p><p>D\u00ea aos utilizadores e processos apenas as permiss\u00f5es de que necessitam. Se uma tarefa n\u00e3o necessitar de privil\u00e9gios de administrador, n\u00e3o os utilize. Este princ\u00edpio ajuda a limitar os danos que uma conta de utilizador comprometida pode causar.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad.webp\" alt=\"\" class=\"wp-image-2573\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.11.25-A-professional-illustration-representing-the-principle-of-least-privilege-in-security.-The-image-should-include-symbols-like-different-user-icons-pad-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>11. Proteja-se contra ataques de for\u00e7a bruta<\/strong><\/p><p>Os ataques de for\u00e7a bruta s\u00e3o comuns, especialmente nos formul\u00e1rios de in\u00edcio de sess\u00e3o. Pode utilizar plugins como o Wordfence ou implementar a sua pr\u00f3pria fun\u00e7\u00e3o de limita\u00e7\u00e3o de taxas:<\/p><pre class=\"wp-block-code\"><code>fun\u00e7\u00e3o limit_login_attempts() {\n    $ip_address = $_SERVER['REMOTE_ADDR'];\n    $attempts = get_transient('login_attempts_' . $ip_address);\n\n    se ($attempts &gt;= 5) {\n        wp_die('Demasiadas tentativas de in\u00edcio de sess\u00e3o. Por favor, tente novamente mais tarde.');\n    }\n\n    set_transient('login_attempts_' . $ip_address, $attempts + 1, 60 * 15); \/\/ Limite a 5 tentativas por 15 minutos\n}\nadd_action('wp_login_failed', 'limit_login_attempts');<\/code><\/pre><p>Esta estrat\u00e9gia simples pode ajudar a proteger o seu plugin de ataques de for\u00e7a bruta.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and-.webp\" alt=\"\" class=\"wp-image-2574\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and-.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and--600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and--100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and--300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and--150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.27.04-An-illustration-representing-protection-against-brute-force-attacks-in-cybersecurity.-The-image-should-include-symbols-like-a-lock-a-login-form-and--768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>12. Registe as ac\u00e7\u00f5es sens\u00edveis<\/strong><\/p><p>O registo \u00e9 essencial para seguir actividades suspeitas. Se um utilizador alterar as defini\u00e7\u00f5es do plug-in ou falhar demasiadas tentativas de in\u00edcio de sess\u00e3o, deve registar estes eventos para an\u00e1lise futura:<\/p><pre class=\"wp-block-code\"><code>function log_action($message) {\n    $log_file = WP_CONTENT_DIR . '\/plugin_logs.txt';\n    $current_time = current_time('mysql');\n    file_put_contents($log_file, \"[$current_time] $message\\n\", FILE_APPEND);\n}\n\nlog_action('Defini\u00e7\u00f5es do plugin alteradas pelo ID do utilizador ' . get_current_user_id());<\/code><\/pre><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com.webp\" alt=\"\" class=\"wp-image-2575\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.29.34-An-illustration-representing-logging-sensitive-actions-in-web-development.-The-image-should-include-elements-like-a-logbook-a-clock-symbol-and-a-com-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>13. Plug-ins de seguran\u00e7a recomendados<\/strong><\/p><p>Para aumentar ainda mais a seguran\u00e7a do seu plugin, recomende alguns plugins de grande confian\u00e7a. <strong>Wordfence<\/strong> e <strong>Sucuri<\/strong> s\u00e3o \u00f3ptimas op\u00e7\u00f5es. Oferecem funcionalidades como prote\u00e7\u00e3o por firewall, verifica\u00e7\u00e3o de malware e seguran\u00e7a de in\u00edcio de sess\u00e3o que podem proporcionar uma camada adicional de defesa.<\/p><ul class=\"wp-block-list\"><li><strong>Wordfence<\/strong>: Firewall de ponto de extremidade e verifica\u00e7\u00e3o de malware.<\/li>\n\n<li><strong>Sucuri<\/strong>: Auditoria de seguran\u00e7a, dete\u00e7\u00e3o de malware e prote\u00e7\u00e3o DDoS.<\/li><\/ul><p>A sua utiliza\u00e7\u00e3o, juntamente com as funcionalidades de seguran\u00e7a incorporadas no seu plug-in, cria um sistema de defesa robusto.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such-.webp\" alt=\"\" class=\"wp-image-2576\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such-.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such--600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such--100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such--300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such--150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.31.03-An-illustration-representing-WordPress-security-plugins.-The-image-should-include-elements-like-a-shield-a-WordPress-logo-and-security-symbols-such--768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p>14. Integra\u00e7\u00e3o segura com o WooCommerce<\/p><p>O WooCommerce \u00e9 extremamente popular nos EUA e na Europa, por isso, se o seu plug-in estiver integrado, trate todos os dados corretamente. Valide e desinfecte todas as entradas, especialmente quando se trata de encomendas ou informa\u00e7\u00f5es de pagamento. Tamb\u00e9m pode utilizar as fun\u00e7\u00f5es integradas do WooCommerce para tratar os dados de pagamento de forma segura.<\/p><p>Por exemplo:<\/p><pre class=\"wp-block-code\"><code>$order = wc_get_order($order_id);\nse ($order) {\n    $total = $order-&gt;get_total();\n    \/\/ Efectue opera\u00e7\u00f5es seguras com a encomenda\n}<\/code><\/pre><p>Respeite as pr\u00e1ticas de seguran\u00e7a do WooCommerce e garanta a seguran\u00e7a de todos os dados dos clientes que manuseia.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart.webp\" alt=\"\" class=\"wp-image-2577\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.33.28-An-illustration-representing-secure-integration-of-WooCommerce-in-WordPress-plugin-development.-The-image-should-include-symbols-like-a-shopping-cart-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>15. Utilize a autentica\u00e7\u00e3o multi-fator (MFA)<\/strong><\/p><p>Ativar a autentica\u00e7\u00e3o multi-fator (MFA) \u00e9 uma excelente forma de adicionar uma camada extra de seguran\u00e7a, especialmente para contas de administrador. Muitos plug-ins, como o <strong>Duo<\/strong> ou <strong>Google Authenticator<\/strong>permitem-lhe adicionar facilmente o MFA \u00e0 sua instala\u00e7\u00e3o do WordPress, dificultando o acesso n\u00e3o autorizado dos atacantes.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and.webp\" alt=\"\" class=\"wp-image-2578\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.35.08-An-illustration-representing-multi-factor-authentication-MFA-in-WordPress-security.-The-image-should-include-symbols-like-a-smartphone-padlock-and-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>16. Localize e teste em diferentes regi\u00f5es<\/strong><\/p><p>Se planeia alcan\u00e7ar um p\u00fablico internacional, \u00e9 crucial localizar o seu plugin e certificar-se de que funciona em diferentes ambientes:<\/p><ul class=\"wp-block-list\"><li><strong>Suporte multilingue<\/strong>: Para tornar o seu plugin f\u00e1cil de traduzir, utilize as fun\u00e7\u00f5es de localiza\u00e7\u00e3o do WordPress, como __() e _e().<\/li>\n\n<li><strong>Tratamento do fuso hor\u00e1rio<\/strong>: Certifique-se de que o seu plugin lida corretamente com diferentes fusos hor\u00e1rios, especialmente se envolver agendamento.<\/li><\/ul><p>Testar o seu plugin em diferentes defini\u00e7\u00f5es de idioma e fusos hor\u00e1rios do servidor ajud\u00e1-lo-\u00e1 a garantir a compatibilidade com utilizadores de todo o mundo.<\/p><p>Al\u00e9m disso, garante a conformidade com o RGPD, tratando os dados pessoais de forma respons\u00e1vel, fornecendo op\u00e7\u00f5es de consentimento claras e permitindo que os utilizadores eliminem ou exportem os seus dados mediante pedido.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va.webp\" alt=\"\" class=\"wp-image-2579\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.36.52-An-illustration-representing-localization-and-multi-region-testing-for-WordPress-plugin-development.-The-image-should-include-symbols-like-a-globe-va-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>17. Configure o WordPress para obter o m\u00e1ximo de seguran\u00e7a<\/strong><\/p><p>Para al\u00e9m de proteger o seu plugin, a configura\u00e7\u00e3o do WordPress \u00e9 essencial para uma seguran\u00e7a m\u00e1xima. Aqui ficam algumas sugest\u00f5es:<\/p><ul class=\"wp-block-list\"><li><strong>Restrinja o acesso a ficheiros sens\u00edveis<\/strong>: Utilize .htaccess para restringir o acesso a ficheiros como wp-config.php.<\/li>\n\n<li><strong>Desativar a edi\u00e7\u00e3o de ficheiros<\/strong>: Impe\u00e7a a edi\u00e7\u00e3o de ficheiros atrav\u00e9s do painel de controlo do WordPress, adicionando esta linha ao wp-config.php:<\/li><\/ul><pre class=\"wp-block-code\"><code>defina('DISALLOW_FILE_EDIT', true);<\/code><\/pre><ul class=\"wp-block-list\"><li><strong>Limite as tentativas de in\u00edcio de sess\u00e3o<\/strong>: Utilize plugins de seguran\u00e7a ou c\u00f3digo personalizado para limitar o n\u00famero de tentativas de in\u00edcio de sess\u00e3o.<\/li><\/ul><p><strong>18. Mantenha o WordPress e os plug-ins actualizados<\/strong><\/p><p>N\u00e3o \u00e9 segredo que manter o WordPress, os temas e os plug-ins actualizados \u00e9 vital para a seguran\u00e7a. As actualiza\u00e7\u00f5es incluem frequentemente patches de seguran\u00e7a, por isso certifique-se de que tudo est\u00e1 atualizado.<br>Considere a utiliza\u00e7\u00e3o de fornecedores de alojamento gerido que ofere\u00e7am actualiza\u00e7\u00f5es autom\u00e1ticas para garantir que o seu site permanece seguro.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield-.webp\" alt=\"\" class=\"wp-image-2582\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield-.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield--600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield--100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield--300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield--150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.40.34-An-illustration-representing-the-importance-of-keeping-WordPress-and-plugins-updated.-The-image-should-include-symbols-like-a-refresh-icon-a-shield--768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><p><strong>19. Efectue testes de seguran\u00e7a<\/strong><\/p><p>Os testes de seguran\u00e7a regulares ajudam a identificar vulnerabilidades antes dos atacantes. Ferramentas como <strong>WPScan<\/strong> pode ser ben\u00e9fico para este fim:<\/p><pre class=\"wp-block-code\"><code># Exemplo de comando WPScan para verificar se h\u00e1 vulnerabilidades\nwpscan --url https:\/\/example.com --api-token YOUR_API_TOKEN<\/code><\/pre><p>Al\u00e9m disso, a realiza\u00e7\u00e3o de revis\u00f5es de c\u00f3digo e de testes de penetra\u00e7\u00e3o pode ajud\u00e1-lo a detetar pontos fracos no c\u00f3digo do seu plug-in.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu.webp\" alt=\"\" class=\"wp-image-2583\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.42.22-An-illustration-representing-security-testing-for-WordPress-plugin-development.-The-image-should-include-elements-like-a-magnifying-glass-over-a-compu-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><h2 class=\"wp-block-heading\">Conclus\u00e3o<\/h2><p>A seguran\u00e7a deve ser sempre considerada ao desenvolver plug-ins do WordPress. Ao seguir estas pr\u00e1ticas recomendadas, estar\u00e1 mais bem equipado para proteger o seu plug-in e os seus utilizadores contra amea\u00e7as. \u00c9 um processo cont\u00ednuo, por isso continue a aprender, mantenha-se atualizado e pense em como tornar o seu plug-in mais seguro.<\/p><p>Desenvolver com uma mentalidade de seguran\u00e7a em primeiro lugar d\u00e1-lhe paz de esp\u00edrito e cria confian\u00e7a nos seus utilizadores, garantindo que eles podem utilizar o seu plugin com confian\u00e7a.<\/p><p>Recapitulando:<\/p><ul class=\"wp-block-list\"><li>Utilize nonces e valide as entradas.<\/li>\n\n<li>Proteja as consultas de bases de dados e as sa\u00eddas de escape.<\/li>\n\n<li>Trate os carregamentos de ficheiros com cuidado.<\/li>\n\n<li>Proteja os pedidos AJAX.<\/li>\n\n<li>Mantenha os dados sens\u00edveis em seguran\u00e7a e siga o princ\u00edpio do menor privil\u00e9gio.<\/li>\n\n<li>Proteja-se contra ataques de for\u00e7a bruta e registe ac\u00e7\u00f5es sens\u00edveis.<\/li>\n\n<li>Utilize os plug-ins de seguran\u00e7a recomendados e active a MFA.<\/li>\n\n<li>Teste para diferentes idiomas, fusos hor\u00e1rios e conformidade com o RGPD.<\/li>\n\n<li>Actualize regularmente e realize testes de seguran\u00e7a.<\/li><\/ul><p>Ao implementar estas pr\u00e1ticas, est\u00e1 no bom caminho para desenvolver um plugin WordPress seguro e fi\u00e1vel.<\/p><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn.webp\" alt=\"\" class=\"wp-image-2584\" srcset=\"https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn.webp 1024w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn-600x600.webp 600w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn-100x100.webp 100w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn-300x300.webp 300w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn-150x150.webp 150w, https:\/\/www.openbyt.com\/wp-content\/uploads\/2024\/10\/DALL\u00b7E-2024-10-14-11.44.38-A-futuristic-high-tech-illustration-representing-WordPress-plugin-security-development.-The-image-should-include-symbols-like-shields-locks-code-sn-768x768.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>","protected":false},"excerpt":{"rendered":"<p>A seguran\u00e7a deve estar na vanguarda da sua mente quando constr\u00f3i plugins WordPress. Os plugins WordPress s\u00e3o muitas vezes um alvo principal para os atacantes devido \u00e0 sua...<\/p>","protected":false},"author":1,"featured_media":2605,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,57],"tags":[232,230,231,229],"class_list":["post-1965","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plugin-development","category-plugins-theme","tag-cross-site-scripting-prevention","tag-data-sanitization-and-validation","tag-multi-factor-authentication","tag-wordpress-plugin-security",""],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/posts\/1965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/comments?post=1965"}],"version-history":[{"count":9,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/posts\/1965\/revisions"}],"predecessor-version":[{"id":3185,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/posts\/1965\/revisions\/3185"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/media\/2605"}],"wp:attachment":[{"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/media?parent=1965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/categories?post=1965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.openbyt.com\/pt\/wp-json\/wp\/v2\/tags?post=1965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}