§ sÃj4.ãóX—ddlZddlmZddlmZddlmZdZd„Z dZ Gd„d e¦«Z Gd „d e ¦«Z Gd „d e ¦«Z Gd„de ¦«ZGd„de ¦«ZGd„de ¦«ZGd„de¦«ZGd„de ¦«ZGd„de ¦«ZGd„de ¦«ZdS)éN)Úurlsplit)Úgettext)Ú WposError)ú"ú<ú>có‡—t‰t¦«sdStd„‰D¦«¦«rdSt‰¦«j ¦«}|dvrdStˆfd„t D¦«¦«rdS‰S)aèValidate a caller-supplied url shared between the HTML templates and the plain-text ``curl %(url)s`` fix_tip. The same value feeds an HTML sink (the anchor in MESSAGE_TEMPLATE) and a plain-text sink (the curl fix_tip), so it must not be html-escaped: that would corrupt a legitimate url (e.g. ``?a=1&b=2`` -> ``?a=1&b=2``) in the copy-pasteable command. Instead validate-and-reject: keep the url byte-for-byte when its scheme is http/https and it contains no attribute/tag-breaking characters; otherwise drop it to an empty string. A scheme-validated url with no breaking chars is safe in the HTML anchor (``&`` alone cannot break an attribute or inject script) and correct in the curl command. Úc3óŠK—|]>}| ¦«p%t|¦«dkpt|¦«dkV—Œ?dS)é éN)ÚisspaceÚord)Ú.0Úchs ú&py/clwpos/user/website_check/errors.pyú z_safe_url...sHèè€Ð KÐ KÀˆ2�:Š:‰<Œ<Ð <�3˜r™7œ7 Tš>Ð <­S°©W¬W¸ª_Ð KÐ KÐ KÐ KÐ KÐ Kó)ÚhttpÚhttpsc3ó •K—|]}|‰vV—Œ dS)N©)rrÚurls €rrz_safe_url..3s'øèè€Ð 3Ð 3˜ˆ2�ˆ9Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3r)Ú isinstanceÚstrÚanyrÚschemeÚlowerÚ_URL_BREAKING_CHARS)rrs` rÚ _safe_urlr s�ø€õ �c�3Ñ Ô ð؈rõ Ð KÐ KÀsÐ KÑ KÔ KÑKÔKð؈rÝ �c‰]Œ]Ô !× 'Ò 'Ñ )Ô )€FØ Ð&Ð&Ð&؈rÝ Ð 3Ð 3Ð 3Ð 3Õ2Ð 3Ñ 3Ô 3Ñ3Ô3ð؈rØ €Jrrcó>‡—eZdZdZddœˆfd„ Zed„¦«ZˆxZS)ÚWebsiteCheckErroraí Generic base class for all website post checks. Every context value reaching the HTML ``description`` is neutralised here, centrally, so no subclass, future key, or direct base-class raise (e.g. the case-4 ``error_desc`` in wp_utils._process_post_check) can leak raw caller/site-influenced markup into the panel HTML sink. The ``url`` key is validate-and-rejected via ``_safe_url`` (kept raw-but-safe so it stays a valid ``curl %(url)s`` command in the plain-text FIX_TIP); every other value is html-escaped. ``self.context`` therefore holds values that are simultaneously safe in the HTML ``description`` and intact enough for the plain-text FIX_TIP (which only ever interpolates ``url``/``timeout``). N)Údetailsc󬕗tt|¦« || |¦«¬¦«||_||_||_dS)N)ÚmessageÚcontext)Úsuperr"Ú__init__Ú_neutralise_contextÚheaderÚfix_tipr#)Úselfr*Ú descriptionr+r&r#Ú __class__s €rr(zWebsiteCheckError.__init__NsOø€Ý Õ Ñ&Ô&×/Ò/¸ ÈT×MeÒMeÐfmÑMnÔMnÐ/ÑoÔoÐo؈Œ ؈Œ ؈Œ ˆ ˆ rcóF—|s|Sd„| ¦«D¦«S)adReturn a copy of ``context`` safe for the HTML ``description`` sink: the ``url`` value validate-and-rejected via ``_safe_url`` (so the same value remains correct in the plain-text ``curl %(url)s`` FIX_TIP), and every other value html-escaped. Escaping is harmless on server-built values (paths, fixed ints render unchanged).có�—i|]C\}}||tkrt|¦«n"tjt |¦«d¬¦«“ŒDS)T)Úquote)Ú_URL_CONTEXT_KEYr ÚhtmlÚescaper)rÚkeyÚvalues rú z9WebsiteCheckError._neutralise_context..]s]€ð ð ð á��Uð  SÕ,<Ò%<Ð%<•˜5Ñ!Ô!Ð!Å$Ä+ÍcÐRWÉjÌjÐ`dÐBeÑBeÔBeð ð ð r)Úitems)r&s rr)z%WebsiteCheckError._neutralise_contextTs:€ðð ØˆNð ð à%Ÿmšm™oœoð ñ ô ð r)Ú__name__Ú __module__Ú __qualname__Ú__doc__r(Ú staticmethodr)Ú __classcell__©r.s@rr"r"?snø€€€€€ð ð ðJNðððððððð ð  ð  ñ„\ð  ð  ð  ð  ð  rr"có`‡—eZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZS)ÚPostCheckRequestExceptionzHttp request failedz–Fatal error on attempt to request website main page: %(url)s. Error message: %(error)sz0Manually check website responds on http requestsc󜕗tt|¦« |j|jt ||¬¦«|j¬¦«dS)N)rÚerror©r*r-r&r+)r'rAr(ÚHEADERÚMESSAGE_TEMPLATEÚdictÚFIX_TIP)r,rrCr.s €rr(z"PostCheckRequestException.__init__msUø€Ý Õ'¨Ñ.Ô.×7Ò7Ø”;ØÔ-ݘS¨Ð.Ñ.Ô.Ø”Lð 8ñ ô ð ð ð r© r9r:r;Ú_rErFrHr(r>r?s@rrArAcsqø€€€€€Ø ˆQÐ$Ñ %Ô %€FØ�qð #ñôÐð ˆaÐBÑCÔC€Gð ð ð ð ð ð ð ð ð rrAcód‡—eZdZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZ S)ÚWebsiteCheckBadHttpCodeú‚ Happens when we get unexpected status code from website. Usually user must go check logs and fix this issue himself. úBad http status code responsez´Unsuccessful attempt to request website main page: %(url)s. Webserver responded with http status code %(http_code)s.úaSearch your webserver logs for errors and manually check that WordPress site is working properly.c󜕗tt|¦« |j|jt ||¬¦«|j¬¦«dS)N)rÚ http_coderD)r'rLr(rErFrGrH)r,rrQr.s €rr(z WebsiteCheckBadHttpCode.__init__…sUø€Ý Õ% tÑ,Ô,×5Ò5Ø”;ØÔ-ݘS¨IÐ6Ñ6Ô6Ø”Lð 6ñ ô ð ð ð r© r9r:r;r<rJrErFrHr(r>r?s@rrLrLvs~ø€€€€€ððð ˆQÐ.Ñ /Ô /€FØ�qð CñôÐð ˆaÐsÑtÔt€Gð ð ð ð ð ð ð ð ð rrLcód‡—eZdZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZ S)ÚWebsiteTimeoutzE Happens when website does not respond in hardcoded timeout. zResponse timeout reachedzÏUnsuccessful attempt to request website main page: %(url)s. Webserver responds longer than %(timeout)s seconds (most likely it is not working).z²Make sure that WordPress site is working properly and specified url gives response in %(timeout)s seconds. Search your webserver logs for errors that may cause the timeout issue.c󜕗tt|¦« |j|jt ||¬¦«|j¬¦«dS)N)rÚtimeoutrD)r'rTr(rErFrGrH)r,rrVr.s €rr(zWebsiteTimeout.__init__¡sTø€Ý �n˜dÑ#Ô#×,Ò,Ø”;ØÔ-ݘS¨'Ð2Ñ2Ô2Ø”Lð -ñ ô ð ð ð rrRr?s@rrTrTŽs„ø€€€€€ðððˆQÐ)Ñ *Ô *€FØ�qð +ñôÐðˆað Rñô€Gð  ð ð ð ð ð ð ð ð rrTcód‡—eZdZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZ S)ÚWebsiteHttpsBrokenzM Happens when website has invalid or outdated https certificate. zBroken https certificatezÛUnsuccessful attempt to request website main page: %(url)s. Webserver redirected http request to https, but the last one does not have a valid certificate.ztMake sure that https certificate is valid and up to date or disable http to https redirection in your control panel.c󜕗tt|¦« |j|jt |¬¦«|j|¬¦«dS©N)r)r*r-r&r+r#)r'rXr(rErFrGrH©r,rr#r.s €rr(zWebsiteHttpsBroken.__init__½sSø€Ý Õ  $Ñ'Ô'×0Ò0Ø”;ØÔ-ݘS�M‘M”MØ”LØð 1ñ ô ð ð ð rrRr?s@rrXrXªs„ø€€€€€ððð ˆQÐ)Ñ *Ô *€FØ�qð 1ñôÐðˆað Cñô€Gð  ð ð ð ð ð ð ð ð rrXcód‡—eZdZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZ S)ÚWebsiteNotRespondingzF Happens when website does not have working webserver at all. zWebsite it not respondingz¢Unsuccessful attempt to request website main page: %(url)s. Webserver did not return any response.zqMake sure that webserver is working and your website is accessible: you can use `curl %(url)s` to check response.c󜕗tt|¦« |j|jt |¬¦«|j|¬¦«dSrZ)r'r]r(rErFrGrHr[s €rr(zWebsiteNotResponding.__init__ØsSø€Ý Õ" DÑ)Ô)×2Ò2Ø”;ØÔ-ݘS�M‘M”MØ”LØð 3ñ ô ð ð ð rrRr?s@rr]r]Çsƒø€€€€€ðððˆQÐ*Ñ +Ô +€FØ�qð 1ñôÐð ˆað 8ñô€Gð  ð ð ð ð ð ð ð ð rr]có:‡—eZdZed¦«Zdefˆfd„ ZˆxZS)ÚRollbackExceptionz+Action failed and rolled back. Here is why.Úreasonscó|•—d„|D¦«|_tt|¦« d¬¦«dS)Nc ój—g|]0}t|j|j|jd|j|j¬¦«‘Œ1S)Ú post_check)r*r-r+Útyper&r#)rGr*r%r+r&r#)rÚreasons rú z.RollbackException.__init__..æsU€ð  ð  ð  ðõ Ø”}Ø"œNØœØ!؜؜ð  ñ ô ð  ð  ð  rÚrollback)r%)Úerrorsr'r`r()r,rar.s €rr(zRollbackException.__init__åsOø€ð  ð  ð"ð  ñ  ô  ˆŒ õ Õ Ñ&Ô&×/Ò/¸ Ð/ÑCÔCÐCÐCÐCr)r9r:r;rJrFr"r(r>r?s@rr`r`âsaø€€€€€Ø�qÐFÑGÔGÐð DÐ!2ð Dð Dð Dð Dð Dð Dð Dð Dð Dð Drr`có`‡—eZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZS)ÚPhpLogErrorsFoundzWebsite server errorzhWe found some errors in the website log file: %(error_log_path)s. Here is some context: %(log_record)szuCheck found errors and decide whether they are critical or not. Contact your system administrator for help if needed.c󜕗tt|¦« |j|jt ||¬¦«|j¬¦«dS)N)Úerror_log_pathÚ log_recordrD)r'rkr(rErFrGrH)r,rmrnr.s €rr(zPhpLogErrorsFound.__init__ÿsUø€Ý Õ Ñ&Ô&×/Ò/Ø”;ØÔ-ݨÀ:ÐNÑNÔNØ”Lð 0ñ ô ð ð ð rrIr?s@rrkrkôsvø€€€€€Ø ˆQÐ%Ñ &Ô &€FØ�qØsñôÐðˆað @ñô€Gð  ð ð ð ð ð ð ð ð rrkcód‡—eZdZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZ S)ÚCDNActivationFailedzL Happens when website has invalid CDN configuration for some reason zCDN malfunctionz©CDN feature was not activated properly. Changes were reverted and CDN module is now disabled. Event is logged to file: '%(logger_path)s' with stdout and stderr recorded.z¢Activate feature again. If the issue persists, ignore error and check your website configuration with enabled CDN feature. Contact your hoster's support for help.cóš•—tt|¦« |j|j|jt |¬¦«¬¦«dS)N)Ú logger_path)r*r-r+r&)r'rpr(rErFrHrG)r,rrr.s €rr(zCDNActivationFailed.__init__sSø€Ý Õ! 4Ñ(Ô(×1Ò1Ø”;ØÔ-Ø”LÝ [Ð1Ñ1Ô1ð 2ñ ô ð ð ð rrRr?s@rrprps„ø€€€€€ðððˆQÐ Ñ !Ô !€FØ�qð VñôÐð ˆað 3ñô€Gð ð ð ð ð ð ð ð ð rrpcód‡—eZdZdZed¦«Zed¦«Zed¦«Zˆfd„ZˆxZ S)ÚJSCssCheckBadHttpCoderMrNztUnsuccessful attempt to request website styles and scripts. Webserver responded with http status code %(http_code)s.rOcóš•—tt|¦« |j|jt |¬¦«|j¬¦«dS)N)rQrD)r'rtr(rErFrGrH)r,rQr.s €rr(zJSCssCheckBadHttpCode.__init__2sSø€Ý Õ# TÑ*Ô*×3Ò3Ø”;ØÔ-Ý 9Ð-Ñ-Ô-Ø”Lð 4ñ ô ð ð ð rrRr?s@rrtrt$s~ø€€€€€ððð ˆQÐ.Ñ /Ô /€FØ�qð CñôÐð ˆaÐsÑtÔt€Gð ð ð ð ð ð ð ð ð rrt)r3Ú urllib.parserÚclwposrrJÚclwpos.cl_wpos_exceptionsrrr r2r"rArLrTrXr]r`rkrprtrrrúrys%ðð  € € € Ø!Ð!Ð!Ð!Ð!Ð!àÐÐÐÐÐØ/Ð/Ð/Ð/Ð/Ð/ð&ÐððððJÐð! ð! ð! ð! ð! ˜ ñ! ô! ð! ðH ð ð ð ð Ð 1ñ ô ð ð& ð ð ð ð Ð/ñ ô ð ð0 ð ð ð ð Ð&ñ ô ð ð8 ð ð ð ð Ð*ñ ô ð ð: ð ð ð ð Ð,ñ ô ð ð6DðDðDðDðD˜ ñDôDðDð$ ð ð ð ð Ð)ñ ô ð ð( ð ð ð ð Ð+ñ ô ð ð8 ð ð ð ð Ð-ñ ô ð ð ð r