diff --git a/about_amharic.html b/about_amharic.html new file mode 100644 index 0000000..1008de3 --- /dev/null +++ b/about_amharic.html @@ -0,0 +1,85 @@ + +

እኔ ከፍተኛ አፈፃፀም ያላቸውን የዌብ እና የሞባይል መተግበሪያዎችን ለመገንባት የምተጋ የሶፍትዌር መሐንዲስ ነኝ። በቴክኖሎጂ ውስጥ ያለኝ ጉዞ ነገሮች እንዴት እንደሚሠሩ በመገረም የጀመረ ሲሆን ይህም በሶፍትዌር ልማት ውስጥ ሙያ እንድከተል አድርጎኛል። ዛሬ የእውነተኛ ዓለም ችግሮችን የሚፈቱ ዲጂታል ተሞክሮዎችን በመፍጠር ላይ አተኩራለሁ።
+ +የዩኒቨርሲቲ ስም | 2020 - 2024 (የሚጠበቅ)
+በአልጎሪዝም፣ በዳታ ስትራክቸር እና በሶፍትዌር አርክቴክቸር ላይ ያተኮረ። አውቶማቲክ የደረጃ አሰጣጥ ስርዓትን ጨምሮ በርካታ ከፍተኛ ተፅዕኖ ያላቸውን የዩኒቨርሲቲ ፕሮጀክቶች አጠናቅቄአለሁ።
+ቴክ ስታርትአፕ | ሰኔ 2023 - መስከረም 2023
+React እና Firebase በመጠቀም የእውነተኛ ጊዜ የመልዕክት ዳሽቦርድ ልማት ላይ ተሳትፌአለሁ። የዳታቤዝ ጥያቄዎችን በማመቻቸት መዘግየትን በ 20% ቀንሻለሁ።
+Flutter Bootcamp | 2022
+የመስቀለኛ መንገድ ልማት፣ የሁኔታ አስተዳደር (Provider/Riverpod) እና የኤፒአይ ውህደትን የሚሸፍን ጥልቅ የ3 ወራት ፕሮግራም።
+ግቤ ዋና የሶፍትዌር መሐንዲስ መሆን፣ በክፍት ምንጭ ፕሮጀክቶች ላይ አስተዋፅዖ ማድረግ እና ጀማሪ አልሚዎችን ማማከር ነው። በተለይም በአርቴፊሻል ኢንተለጀንስ እና በዌብ ልማት መገናኛ ላይ ፍላጎት አለኝ።
+
I am a dedicated Software Engineer with a passion for building high-performance web and mobile applications. My journey in technology started with a fascination for how things work, which led me to pursue a career in software development. Today, I focus on creating seamless digital experiences that solve real-world problems.
+ +University Name | 2020 - 2024 (Expected)
+Focused on algorithms, data structures, and software architecture. Completed several high-impact university projects including an automated grading system.
+Tech Startup | June 2023 - Sept 2023
+Contributed to the development of a real-time messaging dashboard using React and Firebase. Optimized database queries which reduced latency by 20%.
+Flutter Bootcamp | 2022
+Intensive 3-month program covering cross-platform development, state management (Provider/Riverpod), and API integration.
+My goal is to become a Lead Software Engineer, contributing to open-source projects and mentoring aspiring developers. I am particularly interested in the intersection of AI and Web development, exploring how intelligent agents can enhance user productivity.
+
Ani Injiinera Sooftiweerii appilikeeshiniiwwan weebii fi moobaayilaa dandeettii olaanaa qaban ijaaruuf carraaqu dha. Adeemsi koo teeknooloojii keessatti dinqisiifannaa akkaataa wantoonni hojjetaniin kan jalqabe yoo ta'u, kunis barumsa misooma sooftiweerii akkan hordofu na taasiseera. Har'a, muuxannoowwan dijiitaalaa rakkoolee addunyaa dhugaa hiikan uumuu irratti xiyyeeffadha.
+ +Maqaa Yuunivarsiitii | 2020 - 2024 (Kan eegamu)
+Alkooriizimii, caasaa daataa (data structures) fi arkiteekcharrii sooftiweerii irratti xiyyeeffata. Pirojektoota yuunivarsiitii dhibbaa olaanaa qaban kanneen akka sirna qabxii kennuu ofiin hojjetu dabalatee hojjedheera.
+Tech Startup | Waxabajjii 2023 - Fulbaana 2023
+React fi Firebase fayyadamuun misooma daashboordii ergaa yeroo dhugaa irratti hirmaadheera. Gaaffiiwwan daataabeesii fooyyessuun yeroo eegumsaa (latency) 20% hir'iseera.
+Flutter Bootcamp | 2022
+Sagantaa ji'a 3 bal'aa misooma kuroos-pilaatfoormii, bulchiinsa haalaa (Provider/Riverpod) fi walitti makinsa API hammatu.
+Galmi koo Injiinera Sooftiweerii Olaanaa ta'uu, pirojektoota bifa banaatiin (open-source) hojjetaman irratti gumaachuun fi ogeessota misoomaa haaraa gorsuu dha. Keessattuu walitti hidhamiinsa AI fi misooma Weebii irratti fedhii qaba.
+
በአእምሮዎ ውስጥ ፕሮጀክት አለዎት ወይስ ስለ ሶፍትዌር ኢንጂነሪንግ ሚና መወያየት ይፈልጋሉ? ከታች ካሉት አማራጮች በአንዱ በኩል ለማነጋገር ነፃነት ይሰማዎ።
+ብዙውን ጊዜ በ24 ሰዓታት ውስጥ ምላሽ እሰጣለሁ።
+ +ስልክ: 0980375465
+ + + +ቴሌግራም: @Bilnett
+ + + +GitHub: github.com/Bilnett
+ + + +LinkedIn: linkedin.com/in/bilaltaha
+ +
Pirojektii yaada keessaa qabdu moo waa'ee gahee injiinariingii sooftiweerii mari'achuu barbaaddu? Karaalee armaan gadii keessaa tokkoon nu quunnamuuf walaba ta'aa.
+Yeroo baay'ee sa'aatii 24 keessatti deebii nan kenna.
+ +Bilbila: 0980375465
+ + + +Telegram: @Bilnett
+ + + +GitHub: github.com/Bilnett
+ + + +LinkedIn: linkedin.com/in/bilaltaha
+ +በ Next.js፣ TypeScript፣ እና Flutter ላይ ያተኮርኩ የሶፍትዌር መሃንዲስ ነኝ። ዘመናዊ፣ ተለዋዋጭ እና ለተጠቃሚ ምቹ የሆኑ ዲጂታል ተሞክሮዎችን እገነባለሁ።
+ + + + +
React፣ Next.js እና Tailwind CSS በመጠቀም ምላሽ ሰጪ እና በይነተገናኝ የተጠቃሚ በይነገጾችን መፍጠር።
+በNode.js ጠንካራ የአገልጋይ-ወገን አመክንዮዎችን እና በFlutter የተለያዩ የመሳሪያ ስርዓት የሞባይል መተግበሪያዎችን ማልማት።
+ሙሉ ለሙሉ የሚሰሩ መተግበሪያዎችን ለማቅረብ እንደ PostgreSQL እና Firebase ያሉ የውሂብ ጎታዎችን ማቀናጀት።
+Software Engineer specializing in Next.js, TypeScript, and Flutter. I build modern, scalable, and user-centric digital experiences.
+ + + + +
Crafting responsive and interactive user interfaces using React, Next.js, and Tailwind CSS.
+Developing robust server-side logic with Node.js and cross-platform mobile apps with Flutter.
+Integrating databases like PostgreSQL and Firebase to deliver end-to-end applications.
+"Bilal is an exceptional developer who consistently delivers high-quality code and innovative solutions. Highly recommended!"
+— Tech Lead, Future Systems
+"The attention to detail in the UI/UX design was outstanding. Our users love the new mobile app."
+— Product Manager, Creative Solutions
+Injinera soofitweerii Next.js, TypeScript, fi Flutter irratti xiyyeeffachuun hojjedu dha. Muuxannoowwan diijitaalaa ammayyaa, hundaaf mijatoo ta'an nan ijaara.
+ + + + +
React, Next.js fi Tailwind CSS fayyadamuun fuulawwan weebsaayitii socho'oo fi ija qabatan nan ijaara.
+Node.js fayyadamuun hojiiwwan duubaa jabaatoo fi Flutter'n appii moobaayilaa gosa hundaaf ta'u nan qopheessa.
+Kuusaa deetaa akka PostgreSQL fi Firebase fayyadamuun appii guutuu dhiyeessuu.
+ከሙሉ የዌብ አፕሊኬሽኖች እስከ ሞባይል መተግበሪያዎች የቅርብ ጊዜ ስራዎቼ ምርጫ።
+
የምርት ማጣሪያ፣ የቅርጫት ተግባር እና የStripe ክፍያ ውህደት ያለው ሙሉ የመስመር ላይ መደብር።
+ቴክኖሎጂዎች: Next.js, Stripe, Tailwind CSS, PostgreSQL
+ + + +
የዕለት ተዕለት ተግባራትን በእውነተኛ ጊዜ ማሻሻያ እና የቡድን ትብብር ለማስተዳደር የሚረዳ ምርታማነት መሣሪያ።
+ቴክኖሎጂዎች: React, Firebase, Material UI
+ + + +
የOpenWeather API በመጠቀም በመላው ኢትዮጵያ ለሚገኙ ከተሞች የእውነተኛ ጊዜ የአየር ሁኔታ መረጃ ያግኙ።
+ቴክኖሎጂዎች: Next.js, OpenWeather API, Framer Motion
+ + + +Filannoo hojiiwwan koo dhiheenyaa, appilikeeshiniiwwan weebii guutuu irraa kaasee hanga appilikeeshiniiwwan moobaayilaatti.
+
Kuusaa toora interneetii guutuu calalchi oomishaa, dandeettii kaartii fi walitti makinsa ክፍያ Stripe qabu.
+Teeknooloojii: Next.js, Stripe, Tailwind CSS, PostgreSQL
+ + + +
Meeshaa oomishtummaa hojiiwwan guyyaa guyyaa odээffannoo yeroo dhugaa fi dandeettii waliin hojjechuutiin bulchuuf gargaaru.
+Teeknooloojii: React, Firebase, Material UI
+ + + +
API OpenWeather fayyadamuun magaalota Itoophiyaa keessa jiraniif odээffannoo haala qilleensaa yeroo dhugaa argadhu.
+Teeknooloojii: Next.js, OpenWeather API, Framer Motion
+ + + +' . __( 'On this screen, you can manage contact forms provided by Contact Form 7. You can manage an unlimited number of contact forms. Each contact form has a unique ID and Contact Form 7 shortcode ([contact-form-7 ...]). To insert a contact form into a post or a text widget, insert the shortcode into the target.', 'contact-form-7' ) . '
'; + + $content['list_available_actions'] = '' . __( 'Hovering over a row in the contact forms list will display action links that allow you to manage your contact form. You can perform the following actions:', 'contact-form-7' ) . '
'; + $content['list_available_actions'] .= '' . __( 'Edit - Navigates to the editing screen for that contact form. You can also reach that screen by clicking on the contact form title.', 'contact-form-7' ) . '
'; + $content['list_available_actions'] .= '' . __( 'Duplicate - Clones that contact form. A cloned contact form inherits all content from the original, but has a different ID.', 'contact-form-7' ) . '
'; + + $content['edit_overview'] = '' . __( 'On this screen, you can edit a contact form. A contact form is comprised of the following components:', 'contact-form-7' ) . '
'; + $content['edit_overview'] .= '' . __( 'Title is the title of a contact form. This title is only used for labeling a contact form, and can be edited.', 'contact-form-7' ) . '
'; + $content['edit_overview'] .= '' . __( 'Form is a content of HTML form. You can use arbitrary HTML, which is allowed inside a form element. You can also use Contact Form 7’s form-tags here.', 'contact-form-7' ) . '
'; + $content['edit_overview'] .= '' . __( 'Mail manages a mail template (headers and message body) that this contact form will send when users submit it. You can use Contact Form 7’s mail-tags here.', 'contact-form-7' ) . '
'; + $content['edit_overview'] .= '' . __( 'Mail (2) is an additional mail template that works similar to Mail. Mail (2) is different in that it is sent only when Mail has been sent successfully.', 'contact-form-7' ) . '
'; + $content['edit_overview'] .= '' . __( 'In Messages, you can edit various types of messages used for this contact form. These messages are relatively short messages, like a validation error message you see when you leave a required field blank.', 'contact-form-7' ) . '
'; + $content['edit_overview'] .= '' . __( 'Additional Settings provides a place where you can customize the behavior of this contact form by adding code snippets.', 'contact-form-7' ) . '
'; + + $content['edit_form_tags'] = '' . __( 'A form-tag is a short code enclosed in square brackets used in a form content. A form-tag generally represents an input field, and its components can be separated into four parts: type, name, options, and values. Contact Form 7 supports several types of form-tags including text fields, number fields, date fields, checkboxes, radio buttons, menus, file-uploading fields, CAPTCHAs, and quiz fields.', 'contact-form-7' ) . '
'; + $content['edit_form_tags'] .= '' . __( 'While form-tags have a comparatively complex syntax, you do not need to know the syntax to add form-tags because you can use the straightforward tag generator (Generate Tag button on this screen).', 'contact-form-7' ) . '
'; + + $content['edit_mail_tags'] = '' . __( 'A mail-tag is also a short code enclosed in square brackets that you can use in every Mail and Mail (2) field. A mail-tag represents a user input value through an input field of a corresponding form-tag.', 'contact-form-7' ) . '
'; + $content['edit_mail_tags'] .= '' . __( 'There are also special mail-tags that have specific names, but do not have corresponding form-tags. They are used to represent meta information of form submissions like the submitter’s IP address or the URL of the page.', 'contact-form-7' ) . '
'; + + $content['integration_overview'] = '' . __( 'On this screen, you can manage services that are available through Contact Form 7. Using API will allow you to collaborate with any services that are available.', 'contact-form-7' ) . '
'; + $content['integration_overview'] .= '' . __( 'You may need to first sign up for an account with the service that you plan to use. When you do so, you would need to authorize Contact Form 7 to access the service with your account.', 'contact-form-7' ) . '
'; + $content['integration_overview'] .= '' . __( 'Any information you provide will not be shared with service providers without your authorization.', 'contact-form-7' ) . '
'; + + if ( ! empty( $content[$name] ) ) { + return $content[$name]; + } + } + + public function sidebar() { + $content = '' . __( 'For more information:', 'contact-form-7' ) . '
'; + $content .= '' . wpcf7_link( __( 'https://contactform7.com/docs/', 'contact-form-7' ), __( 'Docs', 'contact-form-7' ) ) . '
'; + $content .= '' . wpcf7_link( __( 'https://contactform7.com/faq/', 'contact-form-7' ), __( 'FAQ', 'contact-form-7' ) ) . '
'; + $content .= '' . wpcf7_link( __( 'https://contactform7.com/support/', 'contact-form-7' ), __( 'Support', 'contact-form-7' ) ) . '
'; + + $this->screen->set_help_sidebar( $content ); + } +} diff --git a/wp-content/plugins/contact-form-7/admin/includes/js/index.asset.php b/wp-content/plugins/contact-form-7/admin/includes/js/index.asset.php new file mode 100644 index 0000000..61de87f --- /dev/null +++ b/wp-content/plugins/contact-form-7/admin/includes/js/index.asset.php @@ -0,0 +1,9 @@ + array( + 'wp-api-fetch', + 'wp-i18n', + ), + 'version' => WPCF7_VERSION, +); diff --git a/wp-content/plugins/contact-form-7/admin/includes/js/index.js b/wp-content/plugins/contact-form-7/admin/includes/js/index.js new file mode 100644 index 0000000..7087e3d --- /dev/null +++ b/wp-content/plugins/contact-form-7/admin/includes/js/index.js @@ -0,0 +1 @@ +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.i18n,a=document.querySelector("#contact-form-editor"),r=window.wp.apiFetch;var c=e.n(r);const o=e=>{const t=document.createElement("span");return t.classList.add("icon-in-circle"),t.setAttribute("aria-hidden","true"),t.append(e),t},n=e=>e.replace(/[^0-9a-z]+/gi,"-"),l=e=>{const t=document.querySelector(`#${e.dataset?.toggle}`);t&&(e.checked?t.classList.remove("hidden"):t.classList.add("hidden"))},i=()=>{document.querySelectorAll("#contact-form-editor .config-error, #misc-publishing-actions .config-error").forEach((e=>{e.remove()})),document.querySelectorAll("#contact-form-editor [data-config-field]").forEach((e=>{const t=e.dataset.configField;d(t).length?(e.setAttribute("aria-invalid","true"),e.setAttribute("aria-describedby",n(`wpcf7-config-error-for-${t}`)),e.after(u(t))):e.removeAttribute("aria-invalid")})),document.querySelectorAll("#contact-form-editor-tabs [data-panel]").forEach((e=>{e.querySelectorAll(".icon-in-circle").forEach((e=>{e.remove()})),s(e.dataset.panel)&&e.querySelector("a")?.append(o("!"))}));let e=0;if(document.querySelectorAll("#contact-form-editor .contact-form-editor-panel").forEach((a=>{const r=s(a.id);if(r){e+=r;const c=document.createElement("div");c.classList.add("config-error"),c.append(o("!"),(0,t.sprintf)((0,t._n)("%d configuration error detected in this tab panel.","%d configuration errors detected in this tab panel.",r,"contact-form-7"),r)),a.prepend(c)}})),e){const a=document.createElement("div");a.classList.add("misc-pub-section","config-error");const r=document.createElement("a");r.setAttribute("href",wpcf7.configValidator.docUrl),r.append((0,t.__)("How to resolve?","contact-form-7")),a.append(o("!"),(0,t.sprintf)((0,t._n)("%d configuration error detected.","%d configuration errors detected.",e,"contact-form-7"),e),document.createElement("br"),r),document.querySelector("#misc-publishing-actions")?.append(a)}},s=e=>document.querySelectorAll(`#${e} ul.config-error li`)?.length,d=e=>{const t=[];for(const a in wpcf7.configValidator.errors)a===e&&t.push(...wpcf7.configValidator.errors[a]);return t},u=e=>{if(!e)return"";const t=document.createElement("ul");return t.setAttribute("id",n(`wpcf7-config-error-for-${e}`)),t.classList.add("config-error"),d(e).forEach((e=>{if(!e.message)return;const a=document.createElement("li");if(a.append(o("!")),e.link){const t=document.createElement("a");t.setAttribute("href",e.link),t.append(e.message),a.append(" ",t)}else a.append(" ",e.message);t.append(a)})),t},m=document.querySelector("#wpcf7-welcome-panel"),p=e=>{const t=m.querySelector("#welcomepanelnonce")?.value;if(!t)return;const a=new FormData;a.append("action","wpcf7-update-welcome-panel"),a.append("visible",e),a.append("welcomepanelnonce",t),fetch(new Request(ajaxurl,{method:"POST",body:a})),e?m.classList.remove("hidden"):m.classList.add("hidden")},f=e=>{var t;const a=e.dataset.id,r=e.querySelector('[name="name"]');let c=null!==(t=r?.value.trim())&&void 0!==t?t:"";r&&(c||(c=`${a}-${Math.floor(1e3*Math.random())}`),r.value=c),e.querySelectorAll(".tag").forEach((t=>{const a=e.querySelector('[name="tagtype"]')?.value||t.name;a&&(t.value=v(a,e))})),e.querySelectorAll("span.mail-tag").forEach((e=>{e.innerText=`[${c}]`})),e.querySelectorAll("input.mail-tag").forEach((e=>{e.value=`[${c}]`}))},v=(e,t)=>{var a,r,c;const o=null!==(a=t.querySelector(`.scope.${e}`))&&void 0!==a?a:t,n=e+(t.querySelector('[name="required"]:checked')?"*":""),l=null!==(r=t.querySelector('[name="name"]')?.value)&&void 0!==r?r:"",i=[];o.querySelectorAll(".option").forEach((e=>{"checkbox"===e.type?e.checked&&i.push(e.name):"radio"===e.type?e.checked&&!e.classList.contains("default")&&i.push(`${e.name}:${e.value}`):""!==e.value&&(e.classList.contains("filetype")?i.push(`${e.name}:${e.value.split(/[,|\s]+/).join("|")}`):e.classList.contains("color")?i.push(`${e.name}:#${e.value}`):"class"===e.name?e.value.split(" ").forEach((e=>{i.push(`class:${e}`)})):i.push(`${e.name}:${e.value}`))})),"radio"===e&&i.push("default:1");const s=null!==(c=o.querySelector('[name="values"]')?.value.split("\n").map((e=>e.trim())).filter((e=>""!==e)).map((e=>`"${e.replace(/["]/g,""")}"`)))&&void 0!==c?c:[],d=[n,l,i.join(" "),s.join(" ")].map((e=>e.trim())).filter((e=>""!==e)),u=o.querySelector('[name="content"]')?.value.trim();return u?`[${d.join(" ")}] ${u} [/${n}]`:`[${d.join(" ")}]`},g=e=>{const t=h(e);t?(e.querySelectorAll('[data-tag-part="tag"]').forEach((e=>{e.value=t})),e.querySelectorAll('[data-taggen="insert-tag"]').forEach((e=>{e.disabled=!1})),e.querySelectorAll('[data-tag-part="mail-tag"]').forEach((t=>{const a=e.querySelector('[data-tag-part="name"]');a&&(t.innerText=`[${a.value.trim()}]`)}))):(e.querySelectorAll('[data-tag-part="tag"]').forEach((e=>{e.value=""})),e.querySelectorAll('[data-taggen="insert-tag"]').forEach((e=>{e.disabled=!0})))},h=e=>{var t,a;const r=e.querySelector('[data-tag-part="basetype"]')?.value.trim();if(!r)return;if(e.querySelector(":invalid"))return;let c=r;const o=e.querySelector('[data-tag-part="type-suffix"]');o&&(["checkbox","radio"].includes(o?.type)?c+=o.checked?o.value.trim():"":c+=o.value.trim());const n=e.querySelector('[data-tag-part="name"]');let l=null!==(t=n?.value.trim())&&void 0!==t?t:"";n&&(l||(l=`${r}-${Math.floor(1e3*Math.random())}`),n.value=l);const i=[];e.querySelectorAll('[data-tag-part="option"]').forEach((e=>{const t=e.dataset.tagOption?.trim();t&&(["checkbox","radio"].includes(e?.type)&&!e.checked||t.split(" ").forEach((t=>{t.endsWith(":")?e.value?.split(" ").forEach((e=>{(e=e.trim())&&i.push(t+e)})):i.push(t)})))}));const s=null!==(a=e.querySelector('[data-tag-part="value"]')?.value.split("\n").map((e=>e.trim())).filter((e=>""!==e)).map((e=>`"${e.replace(/["]/g,""")}"`)))&&void 0!==a?a:[],d=[c,l,i.join(" "),s.join(" ")].map((e=>e.trim())).filter((e=>""!==e)),u=e.querySelector('[data-tag-part="content"]')?.value.trim();return u?`[${d.join(" ")}] ${u} [/${c}]`:`[${d.join(" ")}]`},y=e=>{const t=document.querySelector("#wpcf7-admin-form-element");if(!t)return;let a=!1;t.querySelectorAll("input, textarea, select").forEach((e=>{if(!a)switch(e.type){case"button":case"hidden":case"image":case"reset":case"search":case"submit":break;case"checkbox":case"radio":a=e.defaultChecked!==e.checked;break;case"select-multiple":case"select-one":e.querySelectorAll("option").forEach((e=>{a||e.defaultSelected===e.selected||(a=!0)}));break;default:a=e.defaultValue!==e.value}})),a&&e.preventDefault()};document.addEventListener("DOMContentLoaded",(e=>{a&&a.querySelectorAll(':scope > [role="tablist"]').forEach((e=>{const t=e.querySelectorAll(':scope > [role="tab"]');let r=parseInt(e.dataset.activeTab);e.addEventListener("keydown",(a=>{["ArrowLeft","ArrowRight"].includes(a.key)&&(t[r].setAttribute("tabindex","-1"),"ArrowLeft"===a.key&&(r-=1,r<0&&(r=t.length-1)),"ArrowRight"===a.key&&(r+=1,t.length<=r&&(r=0)),t[r].setAttribute("tabindex","0"),t[r].focus(),e.dataset.activeTab=r)})),t.forEach((t=>{t.addEventListener("click",(r=>{const c=t.getAttribute("aria-controls");if(!c)return;const o=c.split(" ").reduceRight(((e,t)=>{const r=a.querySelector(`#${t}`);return r&&(e=r),e}),null);o&&(e.querySelectorAll(':scope > [aria-selected="true"]').forEach((e=>{e.setAttribute("aria-selected","false")})),t.setAttribute("aria-selected","true"),a.querySelectorAll(':scope > [role="tabpanel"]').forEach((e=>{e.setAttribute("hidden","hidden")})),o.removeAttribute("hidden"),document.querySelectorAll('input[name="active-tab"]').forEach((e=>{e.value=o.id})))}))}))})),document.querySelectorAll("#contact-form-editor [data-config-field]").forEach((e=>{e.addEventListener("change",(e=>{const t=document.querySelector('[name="post_ID"]')?.value;t&&0%1$s %2$s
', + esc_html( __( 'Error:', 'contact-form-7' ) ), + esc_html( __( "Contact form not found.", 'contact-form-7' ) ) + ); + } + + $callback = static function ( $contact_form, $atts ) { + return $contact_form->form_html( $atts ); + }; + + $output = wpcf7_switch_locale( + $contact_form->locale(), + $callback, + $contact_form, $atts + ); + + do_action( 'wpcf7_shortcode_callback', $contact_form, $atts ); + + return $output; +} + + +/** + * Saves the contact form data. + */ +function wpcf7_save_contact_form( $data = '', $context = 'save' ) { + $data = wp_parse_args( $data, array( + 'id' => -1, + 'title' => null, + 'locale' => null, + 'form' => null, + 'mail' => null, + 'mail_2' => null, + 'messages' => null, + 'additional_settings' => null, + ) ); + + $data['id'] = (int) $data['id']; + + if ( -1 === $data['id'] ) { + $contact_form = WPCF7_ContactForm::get_template(); + } else { + $contact_form = wpcf7_contact_form( $data['id'] ); + } + + if ( empty( $contact_form ) ) { + return false; + } + + if ( null !== $data['title'] ) { + $contact_form->set_title( $data['title'] ); + } + + if ( null !== $data['locale'] ) { + $contact_form->set_locale( $data['locale'] ); + } + + $properties = array(); + + if ( null !== $data['form'] ) { + $properties['form'] = wpcf7_sanitize_form( $data['form'] ); + } + + if ( null !== $data['mail'] ) { + $properties['mail'] = wpcf7_sanitize_mail( $data['mail'] ); + $properties['mail']['active'] = true; + } + + if ( null !== $data['mail_2'] ) { + $properties['mail_2'] = wpcf7_sanitize_mail( $data['mail_2'] ); + } + + if ( null !== $data['messages'] ) { + $properties['messages'] = wpcf7_sanitize_messages( $data['messages'] ); + } + + if ( null !== $data['additional_settings'] ) { + $properties['additional_settings'] = wpcf7_sanitize_additional_settings( + $data['additional_settings'] + ); + } + + $contact_form->set_properties( $properties ); + + do_action( 'wpcf7_save_contact_form', $contact_form, $data, $context ); + + if ( 'save' === $context ) { + $contact_form->save(); + } + + return $contact_form; +} + + +/** + * Sanitizes the form property data. + */ +function wpcf7_sanitize_form( $input, $default_template = '' ) { + if ( null === $input ) { + return $default_template; + } + + $output = trim( $input ); + + if ( ! current_user_can( 'unfiltered_html' ) ) { + $output = wpcf7_kses( $output, 'form' ); + } + + return $output; +} + + +/** + * Sanitizes the mail property data. + */ +function wpcf7_sanitize_mail( $input, $defaults = array() ) { + $input = wp_parse_args( $input, array( + 'active' => false, + 'subject' => '', + 'sender' => '', + 'recipient' => '', + 'body' => '', + 'additional_headers' => '', + 'attachments' => '', + 'use_html' => false, + 'exclude_blank' => false, + ) ); + + $input = wp_parse_args( $input, $defaults ); + + $output = array(); + $output['active'] = (bool) $input['active']; + $output['subject'] = trim( $input['subject'] ); + $output['sender'] = trim( $input['sender'] ); + $output['recipient'] = trim( $input['recipient'] ); + $output['body'] = trim( $input['body'] ); + + if ( ! current_user_can( 'unfiltered_html' ) ) { + $output['body'] = wpcf7_kses( $output['body'], 'mail' ); + } + + $output['additional_headers'] = ''; + + $headers = str_replace( "\r\n", "\n", $input['additional_headers'] ); + $headers = explode( "\n", $headers ); + + foreach ( $headers as $header ) { + $header = trim( $header ); + + if ( '' !== $header ) { + $output['additional_headers'] .= $header . "\n"; + } + } + + $output['additional_headers'] = trim( $output['additional_headers'] ); + $output['attachments'] = trim( $input['attachments'] ); + $output['use_html'] = (bool) $input['use_html']; + $output['exclude_blank'] = (bool) $input['exclude_blank']; + + return $output; +} + + +/** + * Sanitizes the messages property data. + */ +function wpcf7_sanitize_messages( $input, $defaults = array() ) { + $output = array(); + + foreach ( wpcf7_messages() as $key => $val ) { + if ( isset( $input[$key] ) ) { + $output[$key] = trim( $input[$key] ); + } elseif ( isset( $defaults[$key] ) ) { + $output[$key] = $defaults[$key]; + } + } + + return $output; +} + + +/** + * Sanitizes the additional settings property data. + */ +function wpcf7_sanitize_additional_settings( $input, $default_template = '' ) { + if ( null === $input ) { + return $default_template; + } + + $output = trim( $input ); + return $output; +} + + +/** + * Generates a random hash string for a contact form. + * + * @param int $post_id Post ID. + * @return string SHA-1 hash. + */ +function wpcf7_generate_contact_form_hash( $post_id ) { + return hash( 'sha256', implode( '|', array( + get_current_user_id(), + $post_id, + time(), + home_url(), + ) ) ); +} diff --git a/wp-content/plugins/contact-form-7/includes/contact-form-template.php b/wp-content/plugins/contact-form-7/includes/contact-form-template.php new file mode 100644 index 0000000..528e17f --- /dev/null +++ b/wp-content/plugins/contact-form-7/includes/contact-form-template.php @@ -0,0 +1,204 @@ + %2$s + [text* your-name autocomplete:name] + + + + + + + +[submit "%6$s"]', + __( '(optional)', 'contact-form-7' ), + __( 'Your name', 'contact-form-7' ), + __( 'Your email', 'contact-form-7' ), + __( 'Subject', 'contact-form-7' ), + __( 'Your message', 'contact-form-7' ), + __( 'Submit', 'contact-form-7' ) + ); + + return trim( $template ); + } + + public static function mail() { + $template = array( + 'subject' => sprintf( + /* translators: 1: blog name, 2: [your-subject] */ + _x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ), + '[_site_title]', + '[your-subject]' + ), + 'sender' => sprintf( + '%s <%s>', + '[_site_title]', + self::from_email() + ), + 'body' => + sprintf( + /* translators: %s: [your-name] [your-email] */ + __( 'From: %s', 'contact-form-7' ), + '[your-name] [your-email]' + ) . "\n" + . sprintf( + /* translators: %s: [your-subject] */ + __( 'Subject: %s', 'contact-form-7' ), + '[your-subject]' + ) . "\n\n" + . __( 'Message Body:', 'contact-form-7' ) + . "\n" . '[your-message]' . "\n\n" + . '-- ' . "\n" + . sprintf( + /* translators: 1: blog name, 2: blog URL */ + __( 'This is a notification that a contact form was submitted on your website (%1$s %2$s).', 'contact-form-7' ), + '[_site_title]', + '[_site_url]' + ), + 'recipient' => '[_site_admin_email]', + 'additional_headers' => 'Reply-To: [your-email]', + 'attachments' => '', + 'use_html' => 0, + 'exclude_blank' => 0, + ); + + return $template; + } + + public static function mail_2() { + $template = array( + 'active' => false, + 'subject' => sprintf( + /* translators: 1: blog name, 2: [your-subject] */ + _x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ), + '[_site_title]', + '[your-subject]' + ), + 'sender' => sprintf( + '%s <%s>', + '[_site_title]', + self::from_email() + ), + 'body' => + __( 'Message Body:', 'contact-form-7' ) + . "\n" . '[your-message]' . "\n\n" + . '-- ' . "\n" + . sprintf( + /* translators: 1: blog name, 2: blog URL */ + __( 'This email is a receipt for your contact form submission on our website (%1$s %2$s) in which your email address was used. If that was not you, please ignore this message.', 'contact-form-7' ), + '[_site_title]', + '[_site_url]' + ), + 'recipient' => '[your-email]', + 'additional_headers' => sprintf( + 'Reply-To: %s', + '[_site_admin_email]' + ), + 'attachments' => '', + 'use_html' => 0, + 'exclude_blank' => 0, + ); + + return $template; + } + + public static function from_email() { + $admin_email = get_option( 'admin_email' ); + + if ( wpcf7_is_localhost() ) { + return $admin_email; + } + + $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST ); + $sitename = strtolower( $sitename ); + + if ( 'www.' === substr( $sitename, 0, 4 ) ) { + $sitename = substr( $sitename, 4 ); + } + + if ( strpbrk( $admin_email, '@' ) === '@' . $sitename ) { + return $admin_email; + } + + return 'wordpress@' . $sitename; + } + + public static function messages() { + $messages = array(); + + foreach ( wpcf7_messages() as $key => $arr ) { + $messages[$key] = $arr['default']; + } + + return $messages; + } +} + +function wpcf7_messages() { + $messages = array( + 'mail_sent_ok' => array( + 'description' => __( 'Sender’s message was sent successfully', 'contact-form-7' ), + 'default' => __( 'Thank you for your message. It has been sent.', 'contact-form-7' ), + ), + + 'mail_sent_ng' => array( + 'description' => __( 'Sender’s message failed to send', 'contact-form-7' ), + 'default' => __( 'There was an error trying to send your message. Please try again later.', 'contact-form-7' ), + ), + + 'validation_error' => array( + 'description' => __( 'Validation errors occurred', 'contact-form-7' ), + 'default' => __( 'One or more fields have an error. Please check and try again.', 'contact-form-7' ), + ), + + 'spam' => array( + 'description' => __( 'Submission was referred to as spam', 'contact-form-7' ), + 'default' => __( 'There was an error trying to send your message. Please try again later.', 'contact-form-7' ), + ), + + 'accept_terms' => array( + 'description' => __( 'There are terms that the sender must accept', 'contact-form-7' ), + 'default' => __( 'You must accept the terms and conditions before sending your message.', 'contact-form-7' ), + ), + + 'invalid_required' => array( + 'description' => __( 'There is a field that the sender must fill in', 'contact-form-7' ), + 'default' => __( 'Please fill out this field.', 'contact-form-7' ), + ), + + 'invalid_too_long' => array( + 'description' => __( 'There is a field with input that is longer than the maximum allowed length', 'contact-form-7' ), + 'default' => __( 'This field has a too long input.', 'contact-form-7' ), + ), + + 'invalid_too_short' => array( + 'description' => __( 'There is a field with input that is shorter than the minimum allowed length', 'contact-form-7' ), + 'default' => __( 'This field has a too short input.', 'contact-form-7' ), + ), + ); + + return apply_filters( 'wpcf7_messages', $messages ); +} diff --git a/wp-content/plugins/contact-form-7/includes/contact-form.php b/wp-content/plugins/contact-form-7/includes/contact-form.php new file mode 100644 index 0000000..cdbb6d6 --- /dev/null +++ b/wp-content/plugins/contact-form-7/includes/contact-form.php @@ -0,0 +1,1379 @@ + array( + 'name' => __( 'Contact Forms', 'contact-form-7' ), + 'singular_name' => __( 'Contact Form', 'contact-form-7' ), + ), + 'rewrite' => false, + 'query_var' => false, + 'public' => false, + 'capability_type' => 'page', + 'capabilities' => array( + 'edit_post' => 'wpcf7_edit_contact_form', + 'read_post' => 'wpcf7_read_contact_form', + 'delete_post' => 'wpcf7_delete_contact_form', + 'edit_posts' => 'wpcf7_edit_contact_forms', + 'edit_others_posts' => 'wpcf7_edit_contact_forms', + 'publish_posts' => 'wpcf7_edit_contact_forms', + 'read_private_posts' => 'wpcf7_edit_contact_forms', + ), + ) ); + } + + + /** + * Retrieves contact form data that match given conditions. + * + * @param string|array $args Optional. Arguments to be passed to WP_Query. + * @return array Array of WPCF7_ContactForm objects. + */ + public static function find( $args = '' ) { + $defaults = array( + 'post_status' => 'any', + 'posts_per_page' => -1, + 'offset' => 0, + 'orderby' => 'ID', + 'order' => 'ASC', + ); + + $args = wp_parse_args( $args, $defaults ); + + $args['post_type'] = self::post_type; + + $q = new WP_Query(); + $posts = $q->query( $args ); + + self::$found_items = $q->found_posts; + + $objs = array(); + + foreach ( $posts as $post ) { + $objs[] = new self( $post ); + } + + return $objs; + } + + + /** + * Returns a contact form data filled by default template contents. + * + * @param string|array $options Optional. Contact form options. + * @return WPCF7_ContactForm A new contact form object. + */ + public static function get_template( $options = '' ) { + $options = wp_parse_args( $options, array( + 'locale' => null, + 'title' => __( 'Untitled', 'contact-form-7' ), + ) ); + + if ( ! isset( $options['locale'] ) ) { + $options['locale'] = determine_locale(); + } + + $callback = static function ( $options ) { + $contact_form = new self(); + $contact_form->title = $options['title']; + $contact_form->locale = $options['locale']; + + $properties = $contact_form->get_properties(); + + foreach ( $properties as $key => $value ) { + $default_template = WPCF7_ContactFormTemplate::get_default( $key ); + + if ( isset( $default_template ) ) { + $properties[$key] = $default_template; + } + } + + $contact_form->properties = $properties; + + return $contact_form; + }; + + $contact_form = wpcf7_switch_locale( + $options['locale'], + $callback, + $options + ); + + self::$current = apply_filters( 'wpcf7_contact_form_default_pack', + $contact_form, $options + ); + + return self::$current; + } + + + /** + * Creates a WPCF7_ContactForm object and sets it as the current instance. + * + * @param WPCF7_ContactForm|WP_Post|int $post Object or post ID. + * @return WPCF7_ContactForm|null Contact form object. Null if unset. + */ + public static function get_instance( $post ) { + $contact_form = null; + + if ( $post instanceof self ) { + $contact_form = $post; + } elseif ( ! empty( $post ) ) { + $post = get_post( $post ); + + if ( isset( $post ) and self::post_type === get_post_type( $post ) ) { + $contact_form = new self( $post ); + } + } + + return self::$current = $contact_form; + } + + + /** + * Generates a "unit-tag" for the given contact form ID. + * + * @return string Unit-tag. + */ + private static function generate_unit_tag( $id = 0 ) { + static $global_count = 0; + + $global_count += 1; + + if ( in_the_loop() ) { + $unit_tag = sprintf( 'wpcf7-f%1$d-p%2$d-o%3$d', + absint( $id ), + get_the_ID(), + $global_count + ); + } else { + $unit_tag = sprintf( 'wpcf7-f%1$d-o%2$d', + absint( $id ), + $global_count + ); + } + + return $unit_tag; + } + + + /** + * Constructor. + */ + private function __construct( $post = null ) { + $post = get_post( $post ); + + if ( $post and self::post_type === get_post_type( $post ) ) { + $this->id = $post->ID; + $this->name = $post->post_name; + $this->title = $post->post_title; + $this->locale = get_post_meta( $post->ID, '_locale', true ); + $this->hash = get_post_meta( $post->ID, '_hash', true ); + + $this->construct_properties( $post ); + $this->upgrade(); + } else { + $this->construct_properties(); + } + + do_action( 'wpcf7_contact_form', $this ); + } + + + /** + * Magic method for property overloading. + */ + public function __get( $name ) { + /* translators: 1: property name, 2: method name */ + $message = __( '%1$s property of a WPCF7_ContactForm object is no longer accessible. Use %2$s method instead.', 'contact-form-7' );
+
+ if ( 'id' === $name ) {
+ wp_trigger_error(
+ '',
+ sprintf( $message, 'id', 'id()' ),
+ E_USER_DEPRECATED
+ );
+
+ return $this->id;
+ } elseif ( 'title' === $name ) {
+ wp_trigger_error(
+ '',
+ sprintf( $message, 'title', 'title()' ),
+ E_USER_DEPRECATED
+ );
+
+ return $this->title;
+ } elseif ( $prop = $this->prop( $name ) ) {
+ wp_trigger_error(
+ '',
+ sprintf( $message, $name, 'prop(\'' . $name . '\')' ),
+ E_USER_DEPRECATED
+ );
+
+ return $prop;
+ }
+ }
+
+
+ /**
+ * Returns true if this contact form is not yet saved to the database.
+ */
+ public function initial() {
+ return empty( $this->id );
+ }
+
+
+ /**
+ * Constructs contact form properties. This is called only once
+ * from the constructor.
+ */
+ private function construct_properties( $post = null ) {
+ $builtin_properties = array(
+ 'form' => '',
+ 'mail' => array(),
+ 'mail_2' => array(),
+ 'messages' => array(),
+ 'additional_settings' => '',
+ );
+
+ $properties = apply_filters(
+ 'wpcf7_pre_construct_contact_form_properties',
+ $builtin_properties, $this
+ );
+
+ // Filtering out properties with invalid name
+ $properties = array_filter(
+ $properties,
+ static function ( $key ) {
+ $sanitized_key = sanitize_key( $key );
+ return $key === $sanitized_key;
+ },
+ ARRAY_FILTER_USE_KEY
+ );
+
+ foreach ( $properties as $name => $val ) {
+ $prop = $this->retrieve_property( $name );
+
+ if ( isset( $prop ) ) {
+ $properties[$name] = $prop;
+ }
+ }
+
+ $this->properties = $properties;
+
+ foreach ( $properties as $name => $val ) {
+ $properties[$name] = apply_filters(
+ "wpcf7_contact_form_property_{$name}",
+ $val, $this
+ );
+ }
+
+ $this->properties = $properties;
+
+ $properties = (array) apply_filters(
+ 'wpcf7_contact_form_properties',
+ $properties, $this
+ );
+
+ $this->properties = $properties;
+ }
+
+
+ /**
+ * Retrieves contact form property of the specified name from the database.
+ *
+ * @param string $name Property name.
+ * @return array|string|null Property value. Null if property does not exist.
+ */
+ private function retrieve_property( $name ) {
+ $property = null;
+
+ if ( ! $this->initial() ) {
+ $post_id = $this->id;
+
+ if ( metadata_exists( 'post', $post_id, '_' . $name ) ) {
+ $property = get_post_meta( $post_id, '_' . $name, true );
+ } elseif ( metadata_exists( 'post', $post_id, $name ) ) {
+ $property = get_post_meta( $post_id, $name, true );
+ }
+ }
+
+ return $property;
+ }
+
+
+ /**
+ * Returns the value for the given property name.
+ *
+ * @param string $name Property name.
+ * @return array|string|null Property value. Null if property does not exist.
+ */
+ public function prop( $name ) {
+ $props = $this->get_properties();
+ return isset( $props[$name] ) ? $props[$name] : null;
+ }
+
+
+ /**
+ * Returns all the properties.
+ *
+ * @return array This contact form's properties.
+ */
+ public function get_properties() {
+ return (array) $this->properties;
+ }
+
+
+ /**
+ * Updates properties.
+ *
+ * @param array $properties New properties.
+ */
+ public function set_properties( $properties ) {
+ $defaults = $this->get_properties();
+
+ $properties = wp_parse_args( $properties, $defaults );
+ $properties = array_intersect_key( $properties, $defaults );
+
+ $this->properties = $properties;
+ }
+
+
+ /**
+ * Returns ID of this contact form.
+ *
+ * @return int The ID.
+ */
+ public function id() {
+ return $this->id;
+ }
+
+
+ /**
+ * Returns unit-tag for this contact form.
+ *
+ * @return string Unit-tag.
+ */
+ public function unit_tag() {
+ return $this->unit_tag;
+ }
+
+
+ /**
+ * Returns name (slug) of this contact form.
+ *
+ * @return string Name.
+ */
+ public function name() {
+ return $this->name;
+ }
+
+
+ /**
+ * Returns title of this contact form.
+ *
+ * @return string Title.
+ */
+ public function title() {
+ return $this->title;
+ }
+
+
+ /**
+ * Set a title for this contact form.
+ *
+ * @param string $title Title.
+ */
+ public function set_title( $title ) {
+ $title = wp_strip_all_tags( $title, true );
+ $title = wpcf7_strip_whitespaces( $title );
+
+ if ( '' === $title ) {
+ $title = __( 'Untitled', 'contact-form-7' );
+ }
+
+ $this->title = $title;
+ }
+
+
+ /**
+ * Returns the locale code of this contact form.
+ *
+ * @return string Locale code. Empty string if no valid locale is set.
+ */
+ public function locale() {
+ if ( wpcf7_is_valid_locale( $this->locale ) ) {
+ return $this->locale;
+ } else {
+ return '';
+ }
+ }
+
+
+ /**
+ * Sets a locale for this contact form.
+ *
+ * @param string $locale Locale code.
+ */
+ public function set_locale( $locale ) {
+ $locale = trim( $locale );
+
+ if ( wpcf7_is_valid_locale( $locale ) ) {
+ $this->locale = $locale;
+ } else {
+ $this->locale = 'en_US';
+ }
+ }
+
+
+ /**
+ * Retrieves the random hash string tied to this contact form.
+ *
+ * @param int $length Length of hash string.
+ * @return string Hash string unique to this contact form.
+ */
+ public function hash( $length = 7 ) {
+ return substr( $this->hash, 0, absint( $length ) );
+ }
+
+
+ /**
+ * Returns the specified shortcode attribute value.
+ *
+ * @param string $name Shortcode attribute name.
+ * @return string|null Attribute value. Null if the attribute does not exist.
+ */
+ public function shortcode_attr( $name ) {
+ if ( isset( $this->shortcode_atts[$name] ) ) {
+ return (string) $this->shortcode_atts[$name];
+ }
+ }
+
+
+ /**
+ * Returns true if this contact form is identical to the submitted one.
+ */
+ public function is_posted() {
+ if ( ! WPCF7_Submission::get_instance() ) {
+ return false;
+ }
+
+ $unit_tag = wpcf7_superglobal_post( '_wpcf7_unit_tag' );
+
+ if ( empty( $unit_tag ) ) {
+ return false;
+ }
+
+ return $this->unit_tag() === $unit_tag;
+ }
+
+
+ /**
+ * Generates HTML that represents a form.
+ *
+ * @param string|array $options Optional. Form options.
+ * @return string HTML output.
+ */
+ public function form_html( $options = '' ) {
+ $options = wp_parse_args( $options, array(
+ 'html_id' => '',
+ 'html_name' => '',
+ 'html_title' => '',
+ 'html_class' => '',
+ 'output' => 'form',
+ ) );
+
+ $this->shortcode_atts = $options;
+
+ if ( 'raw_form' === $options['output'] ) {
+ return sprintf(
+ '%s',
+ esc_html( $this->prop( 'form' ) )
+ );
+ }
+
+ if (
+ $this->is_true( 'subscribers_only' ) and
+ ! current_user_can( 'wpcf7_submit', $this->id() )
+ ) {
+ $notice = sprintf(
+ '%s
', + wp_kses_data( __( 'This contact form is available only for logged in users.', 'contact-form-7' ) ) + ); + + return apply_filters( 'wpcf7_subscribers_only_notice', $notice, $this ); + } + + $this->unit_tag = self::generate_unit_tag( $this->id ); + + $action_url = wpcf7_get_request_uri(); + + if ( $frag = strstr( $action_url, '#' ) ) { + $action_url = substr( $action_url, 0, -strlen( $frag ) ); + } + + $action_url .= '#' . $this->unit_tag(); + + $action_url = apply_filters( 'wpcf7_form_action_url', $action_url ); + + if ( + str_starts_with( $action_url, '//' ) or + ! str_starts_with( $action_url, '/' ) and + ! str_starts_with( $action_url, home_url() ) + ) { + return sprintf( + '%1$s %2$s
', + esc_html( __( 'Error:', 'contact-form-7' ) ), + esc_html( __( 'Invalid action URL is detected.', 'contact-form-7' ) ) + ); + } + + $lang_tag = str_replace( '_', '-', $this->locale ); + + if ( preg_match( '/^([a-z]+-[a-z]+)-/i', $lang_tag, $matches ) ) { + $lang_tag = $matches[1]; + } + + $html = "\n" . sprintf( '%s
', + esc_html( $primary_response ) + ); + + $validation_errors = sprintf( + 'if the content starts with multiple line breaks. + if ( preg_match( '/^\s*\n\s*\n\s*/', $content ) ) { + $this->end_tag( 'p' ); + } + + // Split up the contents into paragraphs, separated by double line breaks. + $paragraphs = preg_split( '/\s*\n\s*\n\s*/', $content ); + + $paragraphs = array_filter( $paragraphs, static function ( $paragraph ) { + return '' !== wpcf7_strip_whitespaces( $paragraph ); + } ); + + $paragraphs = array_values( $paragraphs ); + + if ( $paragraphs ) { + if ( $this->is_inside( 'p' ) ) { + $paragraph = array_shift( $paragraphs ); + + $paragraph = self::normalize_paragraph( + $paragraph, + $this->options['auto_br'] + ); + + $this->append_preformatted( $paragraph ); + } + + foreach ( $paragraphs as $paragraph ) { + $this->start_tag( 'p' ); + + $paragraph = wpcf7_strip_whitespaces( $paragraph, 'start' ); + + $paragraph = self::normalize_paragraph( + $paragraph, + $this->options['auto_br'] + ); + + $this->append_preformatted( $paragraph ); + } + } + + // Close
if the content ends with multiple line breaks. + if ( preg_match( '/\s*\n\s*\n\s*$/', $content ) ) { + $this->end_tag( 'p' ); + } + + // Cases where the content is a single line break. + if ( preg_match( '/^\s*\n\s*$/', $content ) ) { + $auto_br = $this->options['auto_br'] && $this->is_inside( 'p' ); + + $content = self::normalize_paragraph( $content, $auto_br ); + + $this->append_preformatted( $content ); + } + } else { + $auto_br = $this->options['auto_br'] && + $this->has_parent( self::br_parent_elements ); + + $content = self::normalize_paragraph( $content, $auto_br ); + + $this->append_preformatted( $content ); + } + } + + + /** + * Appends a start tag to the output property. + * + * @param string $tag A start tag. + */ + public function start_tag( $tag ) { + list( $tag, $tag_name ) = self::normalize_start_tag( $tag ); + + if ( + in_array( $tag_name, self::p_child_elements, true ) and + ! $this->is_inside( 'p' ) and + ! $this->is_inside( self::p_child_elements ) and + ! $this->has_parent( self::p_nonparent_elements ) + ) { + // Open
if it does not exist. + $this->start_tag( 'p' ); + } + + $this->append_start_tag( $tag_name, array(), $tag ); + } + + + /** + * Appends a start tag to the output property. + * + * @param string $tag_name Tag name. + * @param array $atts Associative array of attribute name and value pairs. + * @param string $tag A start tag. + */ + public function append_start_tag( $tag_name, $atts = array(), $tag = '' ) { + if ( ! self::validate_tag_name( $tag_name ) ) { + wp_trigger_error( + __METHOD__, + sprintf( + /* translators: %s: Invalid HTML tag name */ + __( 'Invalid tag name (%s) is specified.', 'contact-form-7' ), + $tag_name + ), + E_USER_WARNING + ); + + return false; + } + + if ( WP_DEBUG and ! empty( $this->options['allowed_html'] ) ) { + $html_disallowance = array(); + + if ( ! isset( $this->options['allowed_html'][$tag_name] ) ) { + $html_disallowance = array( + 'element' => $tag_name, + ); + } else { + $atts_allowed = $this->options['allowed_html'][$tag_name]; + + $atts_disallowed = array_diff_ukey( $atts, $atts_allowed, + static function ( $key_1, $key_2 ) use ( $atts_allowed ) { + if ( + str_starts_with( $key_1, 'data-' ) and + ! empty( $atts_allowed['data-*'] ) and + preg_match( '/^data-[a-z0-9_-]+$/', $key_1 ) + ) { + return 0; + } else { + return $key_1 === $key_2 ? 0 : 1; + } + } + ); + + if ( ! empty( $atts_disallowed ) ) { + $html_disallowance = array( + 'element' => $tag_name, + 'attributes' => array_keys( $atts_disallowed ), + ); + } + } + + if ( $html_disallowance ) { + $notice = sprintf( + /* translators: %s: JSON-formatted array of disallowed HTML */ + __( 'HTML Disallowance: %s', 'contact-form-7' ), + wp_json_encode( $html_disallowance, JSON_PRETTY_PRINT ) + ); + + wp_trigger_error( __METHOD__, $notice, E_USER_NOTICE ); + } + } + + if ( + 'p' === $tag_name or + in_array( $tag_name, self::p_parent_elements, true ) or + in_array( $tag_name, self::p_nonparent_elements, true ) + ) { + // Close
if it exists. + $this->end_tag( 'p' ); + } + + if ( 'dd' === $tag_name or 'dt' === $tag_name ) { + // Close